gst_structure_id_empty_new
gst_structure_new
gst_structure_new_valist
+gst_structure_id_new
gst_structure_copy
gst_structure_free
gst_structure_get_name
if (stop != -1)
g_return_val_if_fail (start <= stop, NULL);
- structure = gst_structure_id_empty_new (GST_QUARK (EVENT_NEWSEGMENT));
- gst_structure_id_set (structure,
+ structure = gst_structure_id_new (GST_QUARK (EVENT_NEWSEGMENT),
GST_QUARK (UPDATE), G_TYPE_BOOLEAN, update,
GST_QUARK (RATE), G_TYPE_DOUBLE, rate,
GST_QUARK (APPLIED_RATE), G_TYPE_DOUBLE, applied_rate,
", maxsize %" G_GINT64_FORMAT ", async %d", gst_format_get_name (format),
minsize, maxsize, async);
- structure = gst_structure_id_empty_new (GST_QUARK (EVENT_BUFFER_SIZE));
- gst_structure_id_set (structure,
+ structure = gst_structure_id_new (GST_QUARK (EVENT_BUFFER_SIZE),
GST_QUARK (FORMAT), GST_TYPE_FORMAT, format,
GST_QUARK (MINSIZE), G_TYPE_INT64, minsize,
GST_QUARK (MAXSIZE), G_TYPE_INT64, maxsize,
", timestamp %" GST_TIME_FORMAT, proportion,
diff, GST_TIME_ARGS (timestamp));
- structure = gst_structure_id_empty_new (GST_QUARK (EVENT_QOS));
- gst_structure_id_set (structure,
+ structure = gst_structure_id_new (GST_QUARK (EVENT_QOS),
GST_QUARK (PROPORTION), G_TYPE_DOUBLE, proportion,
GST_QUARK (DIFF), G_TYPE_INT64, diff,
GST_QUARK (TIMESTAMP), G_TYPE_UINT64, timestamp, NULL);
stop);
}
- structure = gst_structure_id_empty_new (GST_QUARK (EVENT_SEEK));
- gst_structure_id_set (structure,
+ structure = gst_structure_id_new (GST_QUARK (EVENT_SEEK),
GST_QUARK (RATE), G_TYPE_DOUBLE, rate,
GST_QUARK (FORMAT), GST_TYPE_FORMAT, format,
GST_QUARK (FLAGS), GST_TYPE_SEEK_FLAGS, flags,
GST_CAT_INFO (GST_CAT_EVENT,
"creating latency event %" GST_TIME_FORMAT, GST_TIME_ARGS (latency));
- structure = gst_structure_id_empty_new (GST_QUARK (EVENT_LATENCY));
- gst_structure_id_set (structure,
+ structure = gst_structure_id_new (GST_QUARK (EVENT_LATENCY),
GST_QUARK (LATENCY), G_TYPE_UINT64, latency, NULL);
event = gst_event_new_custom (GST_EVENT_LATENCY, structure);
GstMessage *message;
GstStructure *structure;
- structure = gst_structure_id_empty_new (GST_QUARK (MESSAGE_ERROR));
- gst_structure_id_set (structure,
+ structure = gst_structure_id_new (GST_QUARK (MESSAGE_ERROR),
GST_QUARK (GERROR), GST_TYPE_G_ERROR, error,
GST_QUARK (DEBUG), G_TYPE_STRING, debug, NULL);
message = gst_message_new_custom (GST_MESSAGE_ERROR, src, structure);
GstMessage *message;
GstStructure *structure;
- structure = gst_structure_id_empty_new (GST_QUARK (MESSAGE_WARNING));
- gst_structure_id_set (structure,
+ structure = gst_structure_id_new (GST_QUARK (MESSAGE_WARNING),
GST_QUARK (GERROR), GST_TYPE_G_ERROR, error,
GST_QUARK (DEBUG), G_TYPE_STRING, debug, NULL);
message = gst_message_new_custom (GST_MESSAGE_WARNING, src, structure);
GstMessage *message;
GstStructure *structure;
- structure = gst_structure_id_empty_new (GST_QUARK (MESSAGE_INFO));
- gst_structure_id_set (structure, GST_QUARK (GERROR), GST_TYPE_G_ERROR,
- error, GST_QUARK (DEBUG), G_TYPE_STRING, debug, NULL);
+ structure = gst_structure_id_new (GST_QUARK (MESSAGE_INFO),
+ GST_QUARK (GERROR), GST_TYPE_G_ERROR, error,
+ GST_QUARK (DEBUG), G_TYPE_STRING, debug, NULL);
message = gst_message_new_custom (GST_MESSAGE_INFO, src, structure);
return message;
g_return_val_if_fail (percent >= 0 && percent <= 100, NULL);
- structure = gst_structure_id_empty_new (GST_QUARK (MESSAGE_BUFFERING));
- gst_structure_id_set (structure,
+ structure = gst_structure_id_new (GST_QUARK (MESSAGE_BUFFERING),
GST_QUARK (BUFFER_PERCENT), G_TYPE_INT, percent,
GST_QUARK (BUFFERING_MODE), GST_TYPE_BUFFERING_MODE, GST_BUFFERING_STREAM,
GST_QUARK (AVG_IN_RATE), G_TYPE_INT, -1,
GstMessage *message;
GstStructure *structure;
- structure = gst_structure_id_empty_new (GST_QUARK (MESSAGE_STATE));
- gst_structure_id_set (structure,
+ structure = gst_structure_id_new (GST_QUARK (MESSAGE_STATE),
GST_QUARK (OLD_STATE), GST_TYPE_STATE, (gint) oldstate,
GST_QUARK (NEW_STATE), GST_TYPE_STATE, (gint) newstate,
GST_QUARK (PENDING_STATE), GST_TYPE_STATE, (gint) pending, NULL);
GstMessage *message;
GstStructure *structure;
- structure = gst_structure_id_empty_new (GST_QUARK (MESSAGE_CLOCK_PROVIDE));
- gst_structure_id_set (structure,
+ structure = gst_structure_id_new (GST_QUARK (MESSAGE_CLOCK_PROVIDE),
GST_QUARK (CLOCK), GST_TYPE_CLOCK, clock,
GST_QUARK (READY), G_TYPE_BOOLEAN, ready, NULL);
message = gst_message_new_custom (GST_MESSAGE_CLOCK_PROVIDE, src, structure);
GstMessage *message;
GstStructure *structure;
- structure = gst_structure_id_empty_new (GST_QUARK (MESSAGE_CLOCK_LOST));
- gst_structure_id_set (structure,
+ structure = gst_structure_id_new (GST_QUARK (MESSAGE_CLOCK_LOST),
GST_QUARK (CLOCK), GST_TYPE_CLOCK, clock, NULL);
message = gst_message_new_custom (GST_MESSAGE_CLOCK_LOST, src, structure);
GstMessage *message;
GstStructure *structure;
- structure = gst_structure_id_empty_new (GST_QUARK (MESSAGE_NEW_CLOCK));
- gst_structure_id_set (structure,
+ structure = gst_structure_id_new (GST_QUARK (MESSAGE_NEW_CLOCK),
GST_QUARK (CLOCK), GST_TYPE_CLOCK, clock, NULL);
message = gst_message_new_custom (GST_MESSAGE_NEW_CLOCK, src, structure);
g_return_val_if_fail (GST_PAD_DIRECTION (src) == GST_PAD_SRC, NULL);
g_return_val_if_fail (GST_IS_ELEMENT (owner), NULL);
- structure = gst_structure_id_empty_new (GST_QUARK (MESSAGE_STRUCTURE_CHANGE));
- gst_structure_id_set (structure,
+ structure = gst_structure_id_new (GST_QUARK (MESSAGE_STRUCTURE_CHANGE),
GST_QUARK (TYPE), GST_TYPE_STRUCTURE_CHANGE_TYPE, type,
GST_QUARK (OWNER), GST_TYPE_ELEMENT, owner,
GST_QUARK (BUSY), G_TYPE_BOOLEAN, busy, NULL);
GstMessage *message;
GstStructure *structure;
- structure = gst_structure_id_empty_new (GST_QUARK (MESSAGE_SEGMENT_START));
- gst_structure_id_set (structure,
+ structure = gst_structure_id_new (GST_QUARK (MESSAGE_SEGMENT_START),
GST_QUARK (FORMAT), GST_TYPE_FORMAT, format,
GST_QUARK (POSITION), G_TYPE_INT64, position, NULL);
message = gst_message_new_custom (GST_MESSAGE_SEGMENT_START, src, structure);
GstMessage *message;
GstStructure *structure;
- structure = gst_structure_id_empty_new (GST_QUARK (MESSAGE_SEGMENT_DONE));
- gst_structure_id_set (structure,
+ structure = gst_structure_id_new (GST_QUARK (MESSAGE_SEGMENT_DONE),
GST_QUARK (FORMAT), GST_TYPE_FORMAT, format,
GST_QUARK (POSITION), G_TYPE_INT64, position, NULL);
message = gst_message_new_custom (GST_MESSAGE_SEGMENT_DONE, src, structure);
GstMessage *message;
GstStructure *structure;
- structure = gst_structure_id_empty_new (GST_QUARK (MESSAGE_DURATION));
- gst_structure_id_set (structure,
+ structure = gst_structure_id_new (GST_QUARK (MESSAGE_DURATION),
GST_QUARK (FORMAT), GST_TYPE_FORMAT, format,
GST_QUARK (DURATION), G_TYPE_INT64, duration, NULL);
message = gst_message_new_custom (GST_MESSAGE_DURATION, src, structure);
GstMessage *message;
GstStructure *structure;
- structure = gst_structure_id_empty_new (GST_QUARK (MESSAGE_ASYNC_START));
- gst_structure_id_set (structure,
+ structure = gst_structure_id_new (GST_QUARK (MESSAGE_ASYNC_START),
GST_QUARK (NEW_BASE_TIME), G_TYPE_BOOLEAN, new_base_time, NULL);
message = gst_message_new_custom (GST_MESSAGE_ASYNC_START, src, structure);
GstMessage *message;
GstStructure *structure;
- structure = gst_structure_id_empty_new (GST_QUARK (MESSAGE_REQUEST_STATE));
- gst_structure_id_set (structure,
+ structure = gst_structure_id_new (GST_QUARK (MESSAGE_REQUEST_STATE),
GST_QUARK (NEW_STATE), GST_TYPE_STATE, (gint) state, NULL);
message = gst_message_new_custom (GST_MESSAGE_REQUEST_STATE, src, structure);
GstMessage *message;
GstStructure *structure;
- structure = gst_structure_id_empty_new (GST_QUARK (MESSAGE_STREAM_STATUS));
- gst_structure_id_set (structure,
+ structure = gst_structure_id_new (GST_QUARK (MESSAGE_STREAM_STATUS),
GST_QUARK (TYPE), GST_TYPE_STREAM_STATUS_TYPE, (gint) type,
GST_QUARK (OWNER), GST_TYPE_ELEMENT, owner, NULL);
message = gst_message_new_custom (GST_MESSAGE_STREAM_STATUS, src, structure);
GstQuery *query;
GstStructure *structure;
- structure = gst_structure_id_empty_new (GST_QUARK (QUERY_POSITION));
- gst_structure_id_set (structure,
+ structure = gst_structure_id_new (GST_QUARK (QUERY_POSITION),
GST_QUARK (FORMAT), GST_TYPE_FORMAT, format,
GST_QUARK (CURRENT), G_TYPE_INT64, G_GINT64_CONSTANT (-1), NULL);
GstQuery *query;
GstStructure *structure;
- structure = gst_structure_id_empty_new (GST_QUARK (QUERY_DURATION));
- gst_structure_id_set (structure,
+ structure = gst_structure_id_new (GST_QUARK (QUERY_DURATION),
GST_QUARK (FORMAT), GST_TYPE_FORMAT, format,
GST_QUARK (DURATION), G_TYPE_INT64, G_GINT64_CONSTANT (-1), NULL);
GstQuery *query;
GstStructure *structure;
- structure = gst_structure_id_empty_new (GST_QUARK (QUERY_LATENCY));
- gst_structure_id_set (structure,
+ structure = gst_structure_id_new (GST_QUARK (QUERY_LATENCY),
GST_QUARK (LIVE), G_TYPE_BOOLEAN, FALSE,
GST_QUARK (MIN_LATENCY), G_TYPE_UINT64, G_GUINT64_CONSTANT (0),
GST_QUARK (MAX_LATENCY), G_TYPE_UINT64, G_GUINT64_CONSTANT (-1), NULL);
GstQuery *query;
GstStructure *structure;
- structure = gst_structure_id_empty_new (GST_QUARK (QUERY_CONVERT));
- gst_structure_id_set (structure,
+ structure = gst_structure_id_new (GST_QUARK (QUERY_CONVERT),
GST_QUARK (SRC_FORMAT), GST_TYPE_FORMAT, src_format,
GST_QUARK (SRC_VALUE), G_TYPE_INT64, value,
GST_QUARK (DEST_FORMAT), GST_TYPE_FORMAT, dest_format,
GstQuery *query;
GstStructure *structure;
- structure = gst_structure_id_empty_new (GST_QUARK (QUERY_SEGMENT));
- gst_structure_id_set (structure,
+ structure = gst_structure_id_new (GST_QUARK (QUERY_SEGMENT),
GST_QUARK (RATE), G_TYPE_DOUBLE, (gdouble) 0.0,
GST_QUARK (FORMAT), GST_TYPE_FORMAT, format,
GST_QUARK (START_VALUE), G_TYPE_INT64, G_GINT64_CONSTANT (-1),
GstQuery *query;
GstStructure *structure;
- structure = gst_structure_id_empty_new (GST_QUARK (QUERY_SEEKING));
- gst_structure_id_set (structure,
+ structure = gst_structure_id_new (GST_QUARK (QUERY_SEEKING),
GST_QUARK (FORMAT), GST_TYPE_FORMAT, format,
GST_QUARK (SEEKABLE), G_TYPE_BOOLEAN, FALSE,
GST_QUARK (SEGMENT_START), G_TYPE_INT64, G_GINT64_CONSTANT (-1),
GstQuery *query;
GstStructure *structure;
- structure = gst_structure_id_empty_new (GST_QUARK (QUERY_BUFFERING));
/* by default, we configure the answer as no buffering with a 100% buffering
* progress */
- gst_structure_id_set (structure,
+ structure = gst_structure_id_new (GST_QUARK (QUERY_BUFFERING),
GST_QUARK (BUSY), G_TYPE_BOOLEAN, FALSE,
GST_QUARK (BUFFER_PERCENT), G_TYPE_INT, 100,
GST_QUARK (BUFFERING_MODE), GST_TYPE_BUFFERING_MODE, GST_BUFFERING_STREAM,
GstQuery *query;
GstStructure *structure;
- structure = gst_structure_id_empty_new (GST_QUARK (QUERY_URI));
- gst_structure_id_set (structure, GST_QUARK (URI), G_TYPE_STRING, NULL, NULL);
+ structure = gst_structure_id_new (GST_QUARK (QUERY_URI),
+ GST_QUARK (URI), G_TYPE_STRING, NULL, NULL);
query = gst_query_new (GST_QUERY_URI, structure);
}
}
+/**
+ * gst_structure_id_new:
+ * @name_quark: name of new structure
+ * @field_quark: the GQuark for the name of the field to set
+ * @...: variable arguments
+ *
+ * Creates a new #GstStructure with the given name as a GQuark, followed by
+ * fieldname quark, GType, argument(s) "triplets" in the same format as
+ * gst_structure_id_set(). Basically a convenience wrapper around
+ * gst_structure_id_empty_new() and gst_structure_id_set().
+ *
+ * The last variable argument must be NULL (or 0).
+ *
+ * Returns: a new #GstStructure
+ *
+ * Since: 0.10.24
+ */
+GstStructure *
+gst_structure_id_new (GQuark name_quark, GQuark field_quark, ...)
+{
+ GstStructure *s;
+ va_list varargs;
+
+ g_return_val_if_fail (name_quark != 0, NULL);
+ g_return_val_if_fail (field_quark != 0, NULL);
+
+ s = gst_structure_id_empty_new (name_quark);
+
+ va_start (varargs, field_quark);
+ gst_structure_id_set_valist (s, field_quark, varargs);
+ va_end (varargs);
+
+ return s;
+}
+
/* If the structure currently contains a field with the same name, it is
* replaced with the provided field. Otherwise, the field is added to the
* structure. The field's value is not deeply copied.
GstStructure * gst_structure_new_valist (const gchar * name,
const gchar * firstfield,
va_list varargs);
+GstStructure * gst_structure_id_new (GQuark name_quark,
+ GQuark field_quark,
+ ...);
GstStructure * gst_structure_copy (const GstStructure *structure);
void gst_structure_set_parent_refcount (GstStructure *structure,
gint *refcount);
gst_structure_has_name
gst_structure_id_empty_new
gst_structure_id_get_value
+ gst_structure_id_new
gst_structure_id_set
gst_structure_id_set_valist
gst_structure_id_set_value