ksvideosrc: don't timestamp buffers for muxed streams

This commit is contained in:
Andoni Morales Alastruey 2015-04-29 09:57:52 +02:00
parent 20e5a4a498
commit 1991b5bb6f
3 changed files with 18 additions and 0 deletions

View file

@ -1224,3 +1224,11 @@ gst_ks_video_device_cancel_stop (GstKsVideoDevice * self)
ResetEvent (priv->cancel_event);
}
gboolean
gst_ks_video_device_stream_is_muxed (GstKsVideoDevice * self)
{
GstKsVideoDevicePrivate *priv = GST_KS_VIDEO_DEVICE_GET_PRIVATE (self);
return priv->is_muxed;
}

View file

@ -81,6 +81,8 @@ gboolean gst_ks_video_device_postprocess_frame (GstKsVideoDevice * self, GstBuff
void gst_ks_video_device_cancel (GstKsVideoDevice * self);
void gst_ks_video_device_cancel_stop (GstKsVideoDevice * self);
gboolean gst_ks_video_device_stream_is_muxed (GstKsVideoDevice * self);
G_END_DECLS
#endif /* __GST_KS_VIDEO_DEVICE_H__ */

View file

@ -815,6 +815,13 @@ gst_ks_video_src_timestamp_buffer (GstKsVideoSrc * self, GstBuffer * buf,
GstClock *clock;
GstClockTime timestamp;
/* Don't timestamp muxed strams */
if (!gst_ks_video_device_stream_is_muxed (priv->device)) {
duration = timestamp = GST_CLOCK_TIME_NONE;
priv->offset++;
goto timestamp;
}
duration = gst_ks_video_device_get_duration (priv->device);
GST_OBJECT_LOCK (self);
@ -900,6 +907,7 @@ gst_ks_video_src_timestamp_buffer (GstKsVideoSrc * self, GstBuffer * buf,
priv->prev_ts = timestamp;
}
timestamp:
GST_BUFFER_OFFSET (buf) = priv->offset;
GST_BUFFER_OFFSET_END (buf) = GST_BUFFER_OFFSET (buf) + 1;
GST_BUFFER_PTS (buf) = timestamp;