gdp: bump GDP to 0.1, add buffer flags

Original commit message from CVS:
bump GDP to 0.1, add buffer flags
This commit is contained in:
Thomas Vander Stichele 2004-06-09 16:24:19 +00:00 committed by Tim-Philipp Müller
parent 047718e576
commit b07fa6fc05
3 changed files with 13 additions and 2 deletions

View file

@ -163,6 +163,7 @@ gst_dp_header_from_buffer (const GstBuffer * buffer, GstDPHeaderFlag flags,
{ {
guint8 *h; guint8 *h;
guint16 crc; guint16 crc;
guint16 flags_mask;
g_return_val_if_fail (GST_IS_BUFFER (buffer), FALSE); g_return_val_if_fail (GST_IS_BUFFER (buffer), FALSE);
g_return_val_if_fail (GST_BUFFER_REFCOUNT_VALUE (buffer) > 0, 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 + 24, GST_BUFFER_OFFSET (buffer));
GST_WRITE_UINT64_BE (h + 32, GST_BUFFER_OFFSET_END (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 */ /* 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); GST_WRITE_UINT64_BE (h + 48, (guint64) 0);
/* CRC */ /* 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_DURATION (buffer) = GST_DP_HEADER_DURATION (header);
GST_BUFFER_OFFSET (buffer) = GST_DP_HEADER_OFFSET (header); GST_BUFFER_OFFSET (buffer) = GST_DP_HEADER_OFFSET (header);
GST_BUFFER_OFFSET_END (buffer) = GST_DP_HEADER_OFFSET_END (header); GST_BUFFER_OFFSET_END (buffer) = GST_DP_HEADER_OFFSET_END (header);
GST_BUFFER_FLAGS (buffer) = GST_DP_HEADER_BUFFER_FLAGS (header);
return buffer; return buffer;
} }

View file

@ -33,7 +33,7 @@ G_BEGIN_DECLS
/* GStreamer Data Protocol Version */ /* GStreamer Data Protocol Version */
#define GST_DP_VERSION_MAJOR 0 #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 */ #define GST_DP_HEADER_LENGTH 60 /* header size in bytes */

View file

@ -40,6 +40,7 @@ G_BEGIN_DECLS
#define GST_DP_HEADER_DURATION(x) GST_READ_UINT64_BE (x + 16) #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(x) GST_READ_UINT64_BE (x + 24)
#define GST_DP_HEADER_OFFSET_END(x) GST_READ_UINT64_BE (x + 32) #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_HEADER(x) GST_READ_UINT16_BE (x + 56)
#define GST_DP_HEADER_CRC_PAYLOAD(x) GST_READ_UINT16_BE (x + 58) #define GST_DP_HEADER_CRC_PAYLOAD(x) GST_READ_UINT16_BE (x + 58)