diff options
author | Thomas Vander Stichele <thomas@apestaart.org> | 2004-06-09 16:24:19 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.net> | 2012-09-11 01:54:36 +0100 |
commit | 6139c0bf85cc3f2cf6fbddebda1ea57b446b3c85 (patch) | |
tree | 98858f75a78fc67ac180e2621beb50b7e46e7516 /gst/gdp | |
parent | 2070420420e453809907a62748ef7088dfe4d51b (diff) | |
download | gstreamer-plugins-bad-6139c0bf85cc3f2cf6fbddebda1ea57b446b3c85.tar.gz |
gdp: bump GDP to 0.1, add buffer flags
Original commit message from CVS:
bump GDP to 0.1, add buffer flags
Diffstat (limited to 'gst/gdp')
-rw-r--r-- | gst/gdp/dataprotocol.c | 12 | ||||
-rw-r--r-- | gst/gdp/dataprotocol.h | 2 | ||||
-rw-r--r-- | 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 85c798e92..2fdbc5fc7 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 ffe5cfe5f..3d4bbba48 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 f52245745..77f7f8b63 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) |