summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorThiago Santos <thiago.sousa.santos@collabora.com>2011-12-19 15:16:42 -0300
committerThiago Santos <thiago.sousa.santos@collabora.com>2011-12-20 14:46:26 -0300
commit88e3d82201017ae40bced069d9ce3c5f01e58d57 (patch)
tree451c61ebf24e1ea040ff5077dd050b6acb424eb0 /gst
parent248a1c86e0e4d60ec52ac13700fe392a2677cdf2 (diff)
downloadgstreamer-plugins-bad-88e3d82201017ae40bced069d9ce3c5f01e58d57.tar.gz
wrappercamerabinsrc: Push newsegments on video capture start
Pushing newsegments to inform muxers about the start time of the video buffer timestamps.
Diffstat (limited to 'gst')
-rw-r--r--gst/camerabin2/gstwrappercamerabinsrc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gst/camerabin2/gstwrappercamerabinsrc.c b/gst/camerabin2/gstwrappercamerabinsrc.c
index 16aa34b94..5c8d2d116 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);