gst_message_unref
gst_message_copy
gst_message_get_structure
+gst_message_writable_structure
gst_message_make_writable
gst_message_get_seqnum
gst_message_set_seqnum
}
/**
+ * gst_message_writable_structure:
+ * @message: The #GstMessage.
+ *
+ * Get a writable version of the structure.
+ *
+ * Returns: (transfer none): The structure of the message. The structure
+ * is still owned by the message, which means that you should not free
+ * it and that the pointer becomes invalid when you free the message.
+ * This function checks if @message is writable and will never return
+ * %NULL.
+ *
+ * MT safe.
+ *
+ * Since: 1.14
+ */
+GstStructure *
+gst_message_writable_structure (GstMessage * message)
+{
+ GstStructure *structure;
+
+ g_return_val_if_fail (GST_IS_MESSAGE (message), NULL);
+ g_return_val_if_fail (gst_message_is_writable (message), NULL);
+
+ structure = GST_MESSAGE_STRUCTURE (message);
+
+ if (structure == NULL) {
+ structure =
+ gst_structure_new_id_empty (gst_message_type_to_quark (GST_MESSAGE_TYPE
+ (message)));
+ gst_structure_set_parent_refcount (structure,
+ &message->mini_object.refcount);
+ GST_MESSAGE_STRUCTURE (message) = structure;
+ }
+ return structure;
+}
+
+/**
* gst_message_has_name:
* @message: The #GstMessage.
* @name: name to check
gst_message_get_structure (GstMessage *message);
GST_EXPORT
+GstStructure * gst_message_writable_structure (GstMessage *message);
+
+GST_EXPORT
gboolean gst_message_has_name (GstMessage *message, const gchar *name);
/* identifiers for events and messages */
/* GST_MESSAGE_EOS */
{
+ GstStructure *s;
+
message = gst_message_new_eos (NULL);
fail_if (message == NULL);
fail_unless (GST_MESSAGE_TYPE (message) == GST_MESSAGE_EOS);
fail_unless (GST_MESSAGE_SRC (message) == NULL);
+
+ /* Add an extra field */
+ s = gst_message_writable_structure (message);
+ fail_if (s == NULL);
+ gst_structure_set (s, "eos-extra-field", G_TYPE_BOOLEAN, TRUE, NULL);
+
gst_message_unref (message);
}
/* GST_MESSAGE_ERROR */
gst_message_type_get_name
gst_message_type_get_type
gst_message_type_to_quark
+ gst_message_writable_structure
gst_meta_api_type_get_tags
gst_meta_api_type_has_tag
gst_meta_api_type_register