From 6139c0bf85cc3f2cf6fbddebda1ea57b446b3c85 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Wed, 9 Jun 2004 16:24:19 +0000 Subject: [PATCH] gdp: bump GDP to 0.1, add buffer flags Original commit message from CVS: bump GDP to 0.1, add buffer flags --- gst/gdp/dataprotocol.c | 12 +++++++++++- gst/gdp/dataprotocol.h | 2 +- gst/gdp/dp-private.h | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/gst/gdp/dataprotocol.c b/gst/gdp/dataprotocol.c index 85c798e929..2fdbc5fc74 100644 --- a/gst/gdp/dataprotocol.c +++ b/gst/gdp/dataprotocol.c @@ -163,6 +163,7 @@ gst_dp_header_from_buffer (const GstBuffer * buffer, GstDPHeaderFlag flags, { guint8 *h; guint16 crc; + guint16 flags_mask; g_return_val_if_fail (GST_IS_BUFFER (buffer), FALSE); g_return_val_if_fail (GST_BUFFER_REFCOUNT_VALUE (buffer) > 0, FALSE); @@ -184,8 +185,16 @@ gst_dp_header_from_buffer (const GstBuffer * buffer, GstDPHeaderFlag flags, GST_WRITE_UINT64_BE (h + 24, GST_BUFFER_OFFSET (buffer)); GST_WRITE_UINT64_BE (h + 32, GST_BUFFER_OFFSET_END (buffer)); + /* data flags */ + /* we only copy KEY_UNIT and IN_CAPS flags */ + flags_mask = GST_DATA_FLAG_SHIFT (GST_BUFFER_KEY_UNIT) | + GST_DATA_FLAG_SHIFT (GST_BUFFER_IN_CAPS); + + GST_WRITE_UINT16_BE (h + 40, GST_BUFFER_FLAGS (buffer) & flags_mask); + /* ABI padding */ - GST_WRITE_UINT64_BE (h + 40, (guint64) 0); + GST_WRITE_UINT16_BE (h + 42, (guint64) 0); + GST_WRITE_UINT32_BE (h + 44, (guint64) 0); GST_WRITE_UINT64_BE (h + 48, (guint64) 0); /* CRC */ @@ -419,6 +428,7 @@ gst_dp_buffer_from_header (guint header_length, const guint8 * header) GST_BUFFER_DURATION (buffer) = GST_DP_HEADER_DURATION (header); GST_BUFFER_OFFSET (buffer) = GST_DP_HEADER_OFFSET (header); GST_BUFFER_OFFSET_END (buffer) = GST_DP_HEADER_OFFSET_END (header); + GST_BUFFER_FLAGS (buffer) = GST_DP_HEADER_BUFFER_FLAGS (header); return buffer; } diff --git a/gst/gdp/dataprotocol.h b/gst/gdp/dataprotocol.h index ffe5cfe5ff..3d4bbba482 100644 --- a/gst/gdp/dataprotocol.h +++ b/gst/gdp/dataprotocol.h @@ -33,7 +33,7 @@ G_BEGIN_DECLS /* GStreamer Data Protocol Version */ #define GST_DP_VERSION_MAJOR 0 -#define GST_DP_VERSION_MINOR 0 +#define GST_DP_VERSION_MINOR 1 #define GST_DP_HEADER_LENGTH 60 /* header size in bytes */ diff --git a/gst/gdp/dp-private.h b/gst/gdp/dp-private.h index f522457454..77f7f8b630 100644 --- a/gst/gdp/dp-private.h +++ b/gst/gdp/dp-private.h @@ -40,6 +40,7 @@ G_BEGIN_DECLS #define GST_DP_HEADER_DURATION(x) GST_READ_UINT64_BE (x + 16) #define GST_DP_HEADER_OFFSET(x) GST_READ_UINT64_BE (x + 24) #define GST_DP_HEADER_OFFSET_END(x) GST_READ_UINT64_BE (x + 32) +#define GST_DP_HEADER_BUFFER_FLAGS(x) GST_READ_UINT16_BE (x + 40) #define GST_DP_HEADER_CRC_HEADER(x) GST_READ_UINT16_BE (x + 56) #define GST_DP_HEADER_CRC_PAYLOAD(x) GST_READ_UINT16_BE (x + 58) -- 2.34.1