[gst-plugins-farsight/master] Store the timestamp in the header
Olivier Crete
olivier.crete at collabora.co.uk
Tue Mar 3 10:53:13 PST 2009
20080704214935-3e2dc-90ec73df3225b41baa681ab691fb8bd47e17c780.gz
---
ext/mimic/gstmimenc.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/ext/mimic/gstmimenc.c b/ext/mimic/gstmimenc.c
index 087adef..85f60a8 100644
--- a/ext/mimic/gstmimenc.c
+++ b/ext/mimic/gstmimenc.c
@@ -76,7 +76,8 @@ static gboolean gst_mimenc_setcaps (GstPad *pad,
static GstFlowReturn gst_mimenc_chain (GstPad *pad,
GstBuffer *in);
static GstBuffer* gst_mimenc_create_tcp_header (GstMimEnc *mimenc,
- gint payload_size);
+ guint32 payload_size,
+ guint32 timestamp);
static GstStateChangeReturn
gst_mimenc_change_state (GstElement *element,
@@ -244,7 +245,8 @@ gst_mimenc_chain (GstPad *pad, GstBuffer *in)
++mimenc->frames;
// now let's create that tcp header
- header = gst_mimenc_create_tcp_header (mimenc, buffer_size);
+ header = gst_mimenc_create_tcp_header (mimenc, buffer_size,
+ GST_BUFFER_TIMESTAMP (buf) / GST_MSECOND);
if (header)
{
@@ -271,7 +273,8 @@ gst_mimenc_chain (GstPad *pad, GstBuffer *in)
}
static GstBuffer*
-gst_mimenc_create_tcp_header (GstMimEnc *mimenc, gint payload_size)
+gst_mimenc_create_tcp_header (GstMimEnc *mimenc, guint32 payload_size,
+ guint32 timestamp)
{
// 24 bytes
GstBuffer *buf_header = gst_buffer_new_and_alloc (24);
@@ -285,7 +288,7 @@ gst_mimenc_create_tcp_header (GstMimEnc *mimenc, gint payload_size)
*((guint32 *) (p + 8)) = GUINT32_TO_LE(payload_size);
*((guint32 *) (p + 12)) = GUINT32_TO_LE(GST_MAKE_FOURCC ('M', 'L', '2', '0'));
*((guint32 *) (p + 16)) = 0;
- *((guint32 *) (p + 20)) = 0; /* FIXME: must be timestamp */
+ *((guint32 *) (p + 20)) = timestamp;
return buf_header;
}
--
1.5.6.5
More information about the farsight-commits
mailing list