wrappercamerabinsrc: Push newsegments on video capture start

Pushing newsegments to inform muxers about the start time of the
video buffer timestamps.
This commit is contained in:
Thiago Santos 2011-12-19 15:16:42 -03:00
parent 248a1c86e0
commit 88e3d82201

View file

@ -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);