ksvideosrc: don't timestamp buffers for muxed streams
authorAndoni Morales Alastruey <ylatuya@gmail.com>
Wed, 29 Apr 2015 07:57:52 +0000 (09:57 +0200)
committerAndoni Morales Alastruey <ylatuya@gmail.com>
Wed, 29 Apr 2015 19:41:55 +0000 (21:41 +0200)
sys/winks/gstksvideodevice.c
sys/winks/gstksvideodevice.h
sys/winks/gstksvideosrc.c

index 0e2aa08..d00b6a7 100644 (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;
+}
index 105b79d..649faaa 100644 (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__ */
index 859699a..79cbb7a 100644 (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;