g_type_class_ref (gst_lock_flags_get_type ());
g_type_class_ref (gst_allocator_flags_get_type ());
g_type_class_ref (gst_stream_flags_get_type ());
+ g_type_class_ref (gst_message_extended_type_get_type ());
_priv_gst_event_initialize ();
_priv_gst_buffer_initialize ();
g_type_class_unref (g_type_class_peek (gst_allocator_flags_get_type ()));
g_type_class_unref (g_type_class_peek (gst_stream_flags_get_type ()));
g_type_class_unref (g_type_class_peek (gst_debug_color_mode_get_type ()));
+ g_type_class_unref (g_type_class_peek (gst_message_extended_type_get_type
+ ()));
gst_deinitialized = TRUE;
GST_INFO ("deinitialized GStreamer");
{
GstMessage message;
+ GstMessageExtendedType extended_type;
+
GstStructure *structure;
} GstMessageImpl;
{GST_MESSAGE_STREAM_START, "stream-start", 0},
{GST_MESSAGE_NEED_CONTEXT, "need-context", 0},
{GST_MESSAGE_HAVE_CONTEXT, "have-context", 0},
+ {GST_MESSAGE_EXTENDED, "extended", 0},
+ {GST_MESSAGE_DEVICE, "device", 0},
{0, NULL, 0}
};
return GST_MESSAGE_CAST (copy);
}
+GstMessageExtendedType
+gst_message_get_extended_type (GstMessage * msg)
+{
+ GstMessageImpl *message = (GstMessageImpl *) msg;
+
+ g_return_val_if_fail (GST_IS_MESSAGE (msg), 0);
+
+ return message->extended_type;
+}
+
static void
gst_message_init (GstMessageImpl * message, GstMessageType type,
GstObject * src)
}
}
+static inline GstMessage *
+gst_message_new_extended (GstMessageExtendedType extended_type, GstObject * src,
+ GstStructure * structure)
+{
+ GstMessageImpl *message;
+
+ message = (GstMessageImpl *) gst_message_new_custom (GST_MESSAGE_EXTENDED,
+ src, structure);
+
+ message->extended_type = extended_type;
+
+ return GST_MESSAGE_CAST (message);
+}
+
/**
* gst_message_get_seqnum:
* @message: A #GstMessage.
* the URI for the next title has been set).
* @GST_MESSAGE_NEED_CONTEXT: Message indicating that an element wants a specific context (Since 1.2)
* @GST_MESSAGE_HAVE_CONTEXT: Message indicating that an element created a context (Since 1.2)
+ * @GST_MESSAGE_EXTENDED: See gst_message_get_extended_type() to get the type (Since 1.2)
* @GST_MESSAGE_ANY: mask for all of the above messages.
*
- * The different message types that are available.
+ * The different message types that are available. Also see
+ * #GstMessageExtendedType for more types.
*/
/* NOTE: keep in sync with quark registration in gstmessage.c
* NOTE: keep GST_MESSAGE_ANY a valid gint to avoid compiler warnings.
*/
+/* FIXME: 2.0: Make it NOT flags, just a regular 1,2,3,4.. enumeration */
typedef enum
{
GST_MESSAGE_UNKNOWN = 0,
GST_MESSAGE_STREAM_START = (1 << 28),
GST_MESSAGE_NEED_CONTEXT = (1 << 29),
GST_MESSAGE_HAVE_CONTEXT = (1 << 30),
+ GST_MESSAGE_EXTENDED = (1 << 31),
GST_MESSAGE_ANY = ~0
} GstMessageType;
+/**
+ * GstMessageExtendedType:
+ * @GST_MESSAGE_DEVICE: A #GstDevice addition or removal according to
+ * a #GstDeviceMonitor
+ *
+ * Extra message types, see #GstMessageType for the basic types
+ */
+
+typedef enum {
+ /* Skip those defined in #GstMessage to avoid confusion */
+ GST_MESSAGE_DEVICE = 3
+} GstMessageExtendedType;
+
#include <gst/gstminiobject.h>
#include <gst/gstobject.h>
#include <gst/gstelement.h>
const gchar* gst_message_type_get_name (GstMessageType type);
GQuark gst_message_type_to_quark (GstMessageType type);
+GstMessageExtendedType gst_message_get_extended_type (GstMessage * msg);
+
/* refcounting */
/**
* gst_message_ref:
"GstEventSegmentDone",
"GstEventStreamStart", "stream-id", "GstQueryContext",
"GstMessageNeedContext", "GstMessageHaveContext", "context", "context-type",
- "GstMessageStreamStart", "group-id", "uri-redirection"
+ "GstMessageStreamStart", "group-id", "uri-redirection", "GstMessageExtended"
};
GQuark _priv_gst_quark_table[GST_QUARK_MAX];
GST_QUARK_MESSAGE_STREAM_START = 167,
GST_QUARK_GROUP_ID = 168,
GST_QUARK_URI_REDIRECTION = 169,
- GST_QUARK_MAX = 170
+ GST_QUARK_MESSAGE_EXTENDED = 170,
+ GST_QUARK_MAX = 171
} GstQuarkId;
extern GQuark _priv_gst_quark_table[GST_QUARK_MAX];