segment: Modifiy inside segment condition
[platform/upstream/gstreamer.git] / gst / gstmessage.h
index 8c8e9a8..735dd80 100644 (file)
@@ -22,6 +22,8 @@
 #ifndef __GST_MESSAGE_H__
 #define __GST_MESSAGE_H__
 
+#include <glib.h>
+
 G_BEGIN_DECLS
 
 typedef struct _GstMessage GstMessage;
@@ -105,9 +107,18 @@ typedef struct _GstMessage GstMessage;
  *     filter for GST_MESSAGE_EXTENDED and then check the result for the
  *     specific type. (Since 1.4)
  * @GST_MESSAGE_DEVICE_ADDED: Message indicating a #GstDevice was added to
- *     a #GstDeviceMonitor (Since 1.4)
+ *     a #GstDeviceProvider (Since 1.4)
  * @GST_MESSAGE_DEVICE_REMOVED: Message indicating a #GstDevice was removed
- *     from a #GstDeviceMonitor (Since 1.4)
+ *     from a #GstDeviceProvider (Since 1.4)
+ * @GST_MESSAGE_PROPERTY_NOTIFY: Message indicating a #GObject property has
+ *     changed (Since 1.10)
+ * @GST_MESSAGE_STREAM_COLLECTION: Message indicating a new #GstStreamCollection
+ *     is available (Since 1.10)
+ * @GST_MESSAGE_STREAMS_SELECTED: Message indicating the active selection of
+ *     #GstStreams has changed (Since 1.10)
+ * @GST_MESSAGE_REDIRECT: Message indicating to request the application to
+ *     try to play the given URL(s). Useful if for example a HTTP 302/303
+ *     response is received with a non-HTTP URL inside. (Since 1.10)
  * @GST_MESSAGE_ANY: mask for all of the above messages.
  *
  * The different message types that are available.
@@ -116,6 +127,9 @@ typedef struct _GstMessage GstMessage;
  * 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 */
+/* FIXME: For GST_MESSAGE_ANY ~0 -> 0xffffffff see
+ *        https://bugzilla.gnome.org/show_bug.cgi?id=732633
+ */
 typedef enum
 {
   GST_MESSAGE_UNKNOWN           = 0,
@@ -150,10 +164,14 @@ typedef enum
   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_EXTENDED          = (gint) (1u << 31),
   GST_MESSAGE_DEVICE_ADDED      = GST_MESSAGE_EXTENDED + 1,
   GST_MESSAGE_DEVICE_REMOVED    = GST_MESSAGE_EXTENDED + 2,
-  GST_MESSAGE_ANY               = ~0
+  GST_MESSAGE_PROPERTY_NOTIFY   = GST_MESSAGE_EXTENDED + 3,
+  GST_MESSAGE_STREAM_COLLECTION = GST_MESSAGE_EXTENDED + 4,
+  GST_MESSAGE_STREAMS_SELECTED  = GST_MESSAGE_EXTENDED + 5,
+  GST_MESSAGE_REDIRECT          = GST_MESSAGE_EXTENDED + 6,
+  GST_MESSAGE_ANY               = (gint) (0xffffffff)
 } GstMessageType;
 
 #include <gst/gstminiobject.h>
@@ -164,6 +182,8 @@ typedef enum
 #include <gst/gstquery.h>
 #include <gst/gsttoc.h>
 #include <gst/gstdevice.h>
+#include <gst/gststreams.h>
+#include <gst/gststreamcollection.h>
 
 GST_EXPORT GType _gst_message_type;
 
@@ -194,7 +214,7 @@ GST_EXPORT GType _gst_message_type;
  * @message: a #GstMessage
  *
  * Check if the message is in the extended message group
- * (Since 1.4)
+ * Since: 1.4
  */
 #define GST_MESSAGE_TYPE_IS_EXTENDED(message)       (!!(GST_MESSAGE_CAST(message)->type & GST_MESSAGE_EXTENDED))
 
@@ -320,6 +340,8 @@ struct _GstMessage
   GCond           cond;
 };
 
+#include <gst/gstquery.h>
+
 GType           gst_message_get_type            (void);
 
 const gchar*    gst_message_type_get_name       (GstMessageType type);
@@ -334,10 +356,6 @@ GQuark          gst_message_type_to_quark       (GstMessageType type);
  *
  * Returns: @msg (for convenience when doing assignments)
  */
-#ifdef _FOOL_GTK_DOC_
-G_INLINE_FUNC GstMessage * gst_message_ref (GstMessage * msg);
-#endif
-
 static inline GstMessage *
 gst_message_ref (GstMessage * msg)
 {
@@ -351,10 +369,6 @@ gst_message_ref (GstMessage * msg)
  * Convenience macro to decrease the reference count of the message, possibly
  * freeing it.
  */
-#ifdef _FOOL_GTK_DOC_
-G_INLINE_FUNC void gst_message_unref (GstMessage * msg);
-#endif
-
 static inline void
 gst_message_unref (GstMessage * msg)
 {
@@ -372,10 +386,6 @@ gst_message_unref (GstMessage * msg)
  *
  * MT safe
  */
-#ifdef _FOOL_GTK_DOC_
-G_INLINE_FUNC GstMessage * gst_message_copy (const GstMessage * msg);
-#endif
-
 static inline GstMessage *
 gst_message_copy (const GstMessage * msg)
 {
@@ -418,10 +428,6 @@ gst_message_copy (const GstMessage * msg)
  *
  * Returns: %TRUE if @new_message was different from @old_message
  */
-#ifdef _FOOL_GTK_DOC_
-G_INLINE_FUNC gboolean gst_message_replace (GstMessage **old_message, GstMessage *new_message);
-#endif
-
 static inline gboolean
 gst_message_replace (GstMessage **old_message, GstMessage *new_message)
 {
@@ -448,15 +454,21 @@ GstMessage *    gst_message_new_eos             (GstObject * src) G_GNUC_MALLOC;
 /* ERROR */
 
 GstMessage *    gst_message_new_error           (GstObject * src, GError * error, const gchar * debug) G_GNUC_MALLOC;
+GstMessage *    gst_message_new_error_with_details (GstObject * src, GError * error, const gchar * debug, GstStructure * details) G_GNUC_MALLOC;
 void            gst_message_parse_error         (GstMessage *message, GError **gerror, gchar **debug);
+void            gst_message_parse_error_details (GstMessage *message, const GstStructure **structure);
 
 /* WARNING */
 GstMessage *    gst_message_new_warning         (GstObject * src, GError * error, const gchar * debug) G_GNUC_MALLOC;
+GstMessage *    gst_message_new_warning_with_details (GstObject * src, GError * error, const gchar * debug, GstStructure * details) G_GNUC_MALLOC;
 void            gst_message_parse_warning       (GstMessage *message, GError **gerror, gchar **debug);
+void            gst_message_parse_warning_details (GstMessage *message, const GstStructure **structure);
 
 /* INFO */
 GstMessage *    gst_message_new_info            (GstObject * src, GError * error, const gchar * debug) G_GNUC_MALLOC;
+GstMessage *    gst_message_new_info_with_details (GstObject * src, GError * error, const gchar * debug, GstStructure * details) G_GNUC_MALLOC;
 void            gst_message_parse_info          (GstMessage *message, GError **gerror, gchar **debug);
+void            gst_message_parse_info_details  (GstMessage *message, const GstStructure **structure);
 
 /* TAG */
 GstMessage *    gst_message_new_tag             (GstObject * src, GstTagList * tag_list) G_GNUC_MALLOC;
@@ -605,6 +617,30 @@ void            gst_message_parse_device_added  (GstMessage * message, GstDevice
 GstMessage *    gst_message_new_device_removed    (GstObject * src, GstDevice * device) G_GNUC_MALLOC;
 void            gst_message_parse_device_removed  (GstMessage * message, GstDevice ** device);
 
+/* PROPERTY_NOTIFY */
+GstMessage *    gst_message_new_property_notify   (GstObject * src, const gchar * property_name, GValue * val) G_GNUC_MALLOC;
+void            gst_message_parse_property_notify (GstMessage * message, GstObject ** object, const gchar ** property_name, const GValue ** property_value);
+
+/* STREAM_COLLECTION */
+GstMessage *    gst_message_new_stream_collection   (GstObject * src, GstStreamCollection * collection) G_GNUC_MALLOC;
+void            gst_message_parse_stream_collection (GstMessage *message, GstStreamCollection **collection);
+
+/* STREAMS_SELECTED */
+GstMessage *    gst_message_new_streams_selected (GstObject *src, GstStreamCollection *collection);
+void            gst_message_streams_selected_add (GstMessage *message, GstStream *stream);
+void            gst_message_parse_streams_selected (GstMessage * message, GstStreamCollection **collection);
+guint           gst_message_streams_selected_get_size (GstMessage * message);
+GstStream      *gst_message_streams_selected_get_stream (GstMessage *message, guint idx);
+
+/* REDIRECT */
+GstMessage *    gst_message_new_redirect             (GstObject * src, const gchar * location, GstTagList * tag_list, const GstStructure * entry_struct) G_GNUC_MALLOC;
+void            gst_message_add_redirect_entry       (GstMessage * message, const gchar * location, GstTagList * tag_list, const GstStructure * entry_struct);
+void            gst_message_parse_redirect_entry     (GstMessage * message, gsize entry_index, const gchar ** location, GstTagList ** tag_list, const GstStructure ** entry_struct);
+gsize           gst_message_get_num_redirect_entries (GstMessage * message);
+
+#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstMessage, gst_message_unref)
+#endif
 
 G_END_DECLS