[0.10] gst-plugins-bad: wrappercamerabinsrc: Push newsegments on video capture start

Tim Müller tpm at kemper.freedesktop.org
Wed Jan 4 10:07:55 PST 2012


Module: gst-plugins-bad
Branch: 0.10
Commit: 9ce80ec80b1423601cff1f214da07ffaf47ef577
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=9ce80ec80b1423601cff1f214da07ffaf47ef577

Author: Thiago Santos <thiago.sousa.santos at collabora.com>
Date:   Mon Dec 19 15:16:42 2011 -0300

wrappercamerabinsrc: Push newsegments on video capture start

Pushing newsegments to inform muxers about the start time of the
video buffer timestamps.

---

 gst/camerabin2/gstwrappercamerabinsrc.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/gst/camerabin2/gstwrappercamerabinsrc.c b/gst/camerabin2/gstwrappercamerabinsrc.c
index 16aa34b..5c8d2d1 100644
--- a/gst/camerabin2/gstwrappercamerabinsrc.c
+++ b/gst/camerabin2/gstwrappercamerabinsrc.c
@@ -253,9 +253,17 @@ gst_wrapper_camera_bin_src_vidsrc_probe (GstPad * pad, GstBuffer * buffer,
   if (self->video_rec_status == GST_VIDEO_RECORDING_STATUS_DONE) {
     /* NOP */
   } else if (self->video_rec_status == GST_VIDEO_RECORDING_STATUS_STARTING) {
+    GstClockTime ts;
+
     GST_DEBUG_OBJECT (self, "Starting video recording");
     self->video_rec_status = GST_VIDEO_RECORDING_STATUS_RUNNING;
 
+    ts = GST_BUFFER_TIMESTAMP (buffer);
+    if (!GST_CLOCK_TIME_IS_VALID (ts))
+      ts = 0;
+    gst_pad_push_event (self->vidsrc, gst_event_new_new_segment (FALSE, 1.0,
+            GST_FORMAT_TIME, ts, -1, 0));
+
     /* post preview */
     GST_DEBUG_OBJECT (self, "Posting preview for video");
     gst_base_camera_src_post_preview (camerasrc, buffer);



More information about the gstreamer-commits mailing list