index fa8063653ed2d937172335f35ea98a23bb665be7..b57d377d6939ee1551461b2cf71d4e8b0d088743 100644 (file)
/* helper macros */
-/* write first 6 bytes of header, as well as ABI padding */
+/* write first 6 bytes of header */
#define GST_DP_INIT_HEADER(h, version, flags, type) \
G_STMT_START { \
gint maj = 0, min = 0; \
h[2] = (guint8) flags; \
h[3] = 0; /* padding byte */ \
GST_WRITE_UINT16_BE (h + 4, type); \
- \
- GST_WRITE_UINT64_BE (h + 42, (guint64) 0); /* ABI padding */ \
- GST_WRITE_UINT64_BE (h + 50, (guint64) 0); /* ABI padding */ \
} G_STMT_END
#define GST_DP_SET_CRC(h, flags, payload, length); \
GType
gst_dp_version_get_type (void)
{
- static GType gst_dp_version_type = 0;
+ static gsize gst_dp_version_type = 0;
static const GEnumValue gst_dp_version[] = {
- {GST_DP_VERSION_0_2, "GDP Version 0.2", "0.2"},
- {GST_DP_VERSION_1_0, "GDP Version 1.0", "1.0"},
+ {GST_DP_VERSION_0_2, "GST_DP_VERSION_0_2", "0.2"},
+ {GST_DP_VERSION_1_0, "GST_DP_VERSION_1_0", "1.0"},
{0, NULL, NULL},
};
- if (!gst_dp_version_type) {
- gst_dp_version_type =
- g_enum_register_static ("GstDPVersion", gst_dp_version);
+ if (g_once_init_enter (&gst_dp_version_type)) {
+ GType tmp = g_enum_register_static ("GstDPVersion", gst_dp_version);
+ g_once_init_leave (&gst_dp_version_type, tmp);
}
- return gst_dp_version_type;
+
+ return (GType) gst_dp_version_type;
};
/**
_gst_dp_initialized = TRUE;
- gst_dp_version_get_type ();
+ g_type_class_ref (gst_dp_version_get_type ());
GST_DEBUG_CATEGORY_INIT (data_protocol_debug, "gdp", 0,
"GStreamer Data Protocol");
/**
* gst_dp_header_from_buffer:
* @buffer: a #GstBuffer to create a header for
- * @flags: the #GDPHeaderFlags to create the header with
+ * @flags: the #GstDPHeaderFlag to create the header with
* @length: a guint pointer to store the header length in
* @header: a guint8 * pointer to store a newly allocated header byte array in
*
*
* Returns: %TRUE if the header was successfully created.
*/
-#ifndef GST_DISABLE_DEPRECATED
+#ifndef GST_REMOVE_DEPRECATED
+#ifdef GST_DISABLE_DEPRECATED
+gboolean
+gst_dp_header_from_buffer (const GstBuffer * buffer, GstDPHeaderFlag flags,
+ guint * length, guint8 ** header);
+#endif
gboolean
gst_dp_header_from_buffer (const GstBuffer * buffer, GstDPHeaderFlag flags,
guint * length, guint8 ** header)
/**
* gst_dp_packet_from_caps:
* @caps: a #GstCaps to create a packet for
- * @flags: the #GDPHeaderFlags to create the header with
+ * @flags: the #GstDPHeaderFlag to create the header with
* @length: a guint pointer to store the header length in
* @header: a guint8 pointer to store a newly allocated header byte array in
* @payload: a guint8 pointer to store a newly allocated payload byte array in
@@ -412,7 +415,12 @@ gst_dp_header_from_buffer_1_0 (const GstBuffer * buffer, GstDPHeaderFlag flags,
*
* Returns: %TRUE if the packet was successfully created.
*/
-#ifndef GST_DISABLE_DEPRECATED
+#ifndef GST_REMOVE_DEPRECATED
+#ifdef GST_DISABLE_DEPRECATED
+gboolean
+gst_dp_packet_from_caps (const GstCaps * caps, GstDPHeaderFlag flags,
+ guint * length, guint8 ** header, guint8 ** payload);
+#endif
gboolean
gst_dp_packet_from_caps (const GstCaps * caps, GstDPHeaderFlag flags,
guint * length, guint8 ** header, guint8 ** payload)
/**
* gst_dp_packet_from_event:
* @event: a #GstEvent to create a packet for
- * @flags: the #GDPHeaderFlags to create the header with
+ * @flags: the #GstDPHeaderFlag to create the header with
* @length: a guint pointer to store the header length in
* @header: a guint8 pointer to store a newly allocated header byte array in
* @payload: a guint8 pointer to store a newly allocated payload byte array in
*
* Returns: %TRUE if the packet was successfully created.
*/
-#ifndef GST_DISABLE_DEPRECATED
+#ifndef GST_REMOVE_DEPRECATED
+#ifdef GST_DISABLE_DEPRECATED
+gboolean
+gst_dp_packet_from_event (const GstEvent * event, GstDPHeaderFlag flags,
+ guint * length, guint8 ** header, guint8 ** payload);
+#endif
gboolean
gst_dp_packet_from_event (const GstEvent * event, GstDPHeaderFlag flags,
guint * length, guint8 ** header, guint8 ** payload)
GST_LOG ("event %p has structure, string %s", event, string);
pl_length = strlen ((gchar *) string) + 1; /* include trailing 0 */
} else {
- GST_LOG ("event %p has no structure");
+ GST_LOG ("event %p has no structure", event);
pl_length = 0;
}
/* timestamp */
GST_WRITE_UINT64_BE (h + 10, GST_EVENT_TIMESTAMP (event));
- GST_DP_SET_CRC (h, flags, *payload, pl_length);
+ GST_DP_SET_CRC (h, flags, string, pl_length);
GST_LOG ("created header from event:");
gst_dp_dump_byte_array (h, GST_DP_HEADER_LENGTH);
switch (type) {
case GST_EVENT_UNKNOWN:
GST_WARNING ("Unknown event, ignoring");
- return FALSE;
+ return NULL;
case GST_EVENT_EOS:
case GST_EVENT_FLUSH_START:
case GST_EVENT_FLUSH_STOP:
case GST_EVENT_NAVIGATION:
case GST_EVENT_TAG:
GST_WARNING ("Unhandled event type %d, ignoring", type);
- return FALSE;
+ return NULL;
default:
GST_WARNING ("Unknown event type %d, ignoring", type);
- return FALSE;
+ return NULL;
}
return event;
ret->version = version;
switch (version) {
-#ifndef GST_DISABLE_DEPRECATED
+#ifndef GST_REMOVE_DEPRECATED
case GST_DP_VERSION_0_2:
ret->header_from_buffer = gst_dp_header_from_buffer;
ret->packet_from_caps = gst_dp_packet_from_caps;