summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Crete <olivier.crete@collabora.co.uk>2008-07-04 21:49:35 +0000
committerOlivier CrĂȘte <olivier.crete@collabora.co.uk>2009-03-03 14:34:06 -0500
commit749e12bb15c43aca81bb2f3b88fda71fa7844d4c (patch)
treef4d9800ed4f79a67b18b311251d227bbbf8478bf
parent10d0e46524a97adf4c4016649a7f414a1fac5128 (diff)
downloadgst-plugins-bad-749e12bb15c43aca81bb2f3b88fda71fa7844d4c.tar.gz
gst-plugins-bad-749e12bb15c43aca81bb2f3b88fda71fa7844d4c.tar.bz2
gst-plugins-bad-749e12bb15c43aca81bb2f3b88fda71fa7844d4c.zip
[MOVED FROM GST-P-FARSIGHT] Store the timestamp in the header
20080704214935-3e2dc-90ec73df3225b41baa681ab691fb8bd47e17c780.gz
-rw-r--r--ext/mimic/gstmimenc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/ext/mimic/gstmimenc.c b/ext/mimic/gstmimenc.c
index 087adef2..85f60a86 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;
}