summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.co.uk>2009-07-07 18:18:06 +0100
committerOlivier CrĂȘte <olivier.crete@collabora.co.uk>2009-07-07 19:21:45 +0100
commit4bf9fe969e154ee5f20a8f3946589a642ab746c0 (patch)
tree14c7c32876f21349da6a1c4795548a0e8a9ef80d
parenta97e0f0a941e6999a8371e5dc2ebbeddb0bdb309 (diff)
downloadgst-plugins-bad-4bf9fe969e154ee5f20a8f3946589a642ab746c0.tar.gz
gst-plugins-bad-4bf9fe969e154ee5f20a8f3946589a642ab746c0.tar.bz2
gst-plugins-bad-4bf9fe969e154ee5f20a8f3946589a642ab746c0.zip
mimenc: Put timestamp on the header buffer
-rw-r--r--ext/mimic/gstmimenc.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/ext/mimic/gstmimenc.c b/ext/mimic/gstmimenc.c
index c3d3688c..9f6727f5 100644
--- a/ext/mimic/gstmimenc.c
+++ b/ext/mimic/gstmimenc.c
@@ -84,7 +84,7 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
static gboolean gst_mimenc_setcaps (GstPad * pad, GstCaps * caps);
static GstFlowReturn gst_mimenc_chain (GstPad * pad, GstBuffer * in);
static GstBuffer *gst_mimenc_create_tcp_header (GstMimEnc * mimenc,
- guint32 payload_size, guint32 timestamp);
+ guint32 payload_size, GstClockTime timestamp);
static gboolean gst_mimenc_event (GstPad * pad, GstEvent * event);
static GstStateChangeReturn
@@ -327,7 +327,7 @@ gst_mimenc_chain (GstPad * pad, GstBuffer * in)
// now let's create that tcp header
header = gst_mimenc_create_tcp_header (mimenc, buffer_size,
- GST_BUFFER_TIMESTAMP (buf) / GST_MSECOND);
+ GST_BUFFER_TIMESTAMP (out_buf));
if (!header) {
gst_buffer_unref (out_buf);
@@ -376,12 +376,14 @@ out_unlock:
static GstBuffer *
gst_mimenc_create_tcp_header (GstMimEnc * mimenc, guint32 payload_size,
- guint32 timestamp)
+ GstClockTime timestamp)
{
// 24 bytes
GstBuffer *buf_header = gst_buffer_new_and_alloc (24);
guchar *p = (guchar *) GST_BUFFER_DATA (buf_header);
+ GST_BUFFER_TIMESTAMP (buf_header) = timestamp;
+
p[0] = 24;
*((guchar *) (p + 1)) = 0;
*((guint16 *) (p + 2)) = GUINT16_TO_LE (mimenc->width);
@@ -391,7 +393,7 @@ gst_mimenc_create_tcp_header (GstMimEnc * mimenc, guint32 payload_size,
*((guint32 *) (p + 12)) =
GUINT32_TO_LE (GST_MAKE_FOURCC ('M', 'L', '2', '0'));
*((guint32 *) (p + 16)) = 0;
- *((guint32 *) (p + 20)) = timestamp;
+ *((guint32 *) (p + 20)) = timestamp / GST_MSECOND;
return buf_header;
}