common: Stop using GQuark-based GstStructure name API

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7432>
This commit is contained in:
Sebastian Dröge 2024-08-09 10:41:57 +03:00
parent 8cbc76b180
commit 0c1611d31d
28 changed files with 396 additions and 536 deletions

View file

@ -372,8 +372,8 @@ gst_svthevc_enc_sink_getcaps (GstVideoEncoder * enc, GstCaps * filter)
filter_caps = gst_caps_new_empty ();
for (i = 0; i < gst_caps_get_size (supported_incaps); i++) {
GQuark q_name =
gst_structure_get_name_id (gst_caps_get_structure (supported_incaps,
const GstIdStr *name =
gst_structure_get_name_id_str (gst_caps_get_structure (supported_incaps,
i));
for (j = 0; j < gst_caps_get_size (allowed_caps); j++) {
@ -381,7 +381,7 @@ gst_svthevc_enc_sink_getcaps (GstVideoEncoder * enc, GstCaps * filter)
const GValue *val;
GstStructure *s;
s = gst_structure_new_id_empty (q_name);
s = gst_structure_new_id_str_empty (name);
if ((val = gst_structure_get_value (allowed_s, "width")))
gst_structure_set_value (s, "width", val);
if ((val = gst_structure_get_value (allowed_s, "height")))

View file

@ -90,18 +90,6 @@
* # API
*/
static GQuark QUARK_PAT;
static GQuark QUARK_CAT;
static GQuark QUARK_BAT;
static GQuark QUARK_PMT;
static GQuark QUARK_NIT;
static GQuark QUARK_SDT;
static GQuark QUARK_EIT;
static GQuark QUARK_TDT;
static GQuark QUARK_TOT;
static GQuark QUARK_SCTE_SIT;
static GQuark QUARK_SECTION;
static GType _gst_mpegts_section_type = 0;
#define MPEG_TYPE_TS_SECTION (_gst_mpegts_section_type)
GST_DEFINE_MINI_OBJECT_TYPE (GstMpegtsSection, gst_mpegts_section);
@ -278,7 +266,7 @@ gst_message_parse_mpegts_section (GstMessage * message)
st = gst_message_get_structure (message);
/* FIXME : Add checks against know section names */
if (!gst_structure_id_get (st, QUARK_SECTION, GST_TYPE_MPEGTS_SECTION,
if (!gst_structure_get (st, "section", GST_TYPE_MPEGTS_SECTION,
&section, NULL))
return NULL;
@ -289,46 +277,46 @@ static GstStructure *
_mpegts_section_get_structure (GstMpegtsSection * section)
{
GstStructure *st;
GQuark quark;
const gchar *name;
switch (section->section_type) {
case GST_MPEGTS_SECTION_PAT:
quark = QUARK_PAT;
name = "pat";
break;
case GST_MPEGTS_SECTION_PMT:
quark = QUARK_PMT;
name = "pmt";
break;
case GST_MPEGTS_SECTION_CAT:
quark = QUARK_CAT;
name = "cat";
break;
case GST_MPEGTS_SECTION_EIT:
quark = QUARK_EIT;
name = "eit";
break;
case GST_MPEGTS_SECTION_BAT:
quark = QUARK_BAT;
name = "bat";
break;
case GST_MPEGTS_SECTION_NIT:
quark = QUARK_NIT;
name = "nit";
break;
case GST_MPEGTS_SECTION_SDT:
quark = QUARK_SDT;
name = "sdt";
break;
case GST_MPEGTS_SECTION_TDT:
quark = QUARK_TDT;
name = "tdt";
break;
case GST_MPEGTS_SECTION_TOT:
quark = QUARK_TOT;
name = "tot";
break;
case GST_MPEGTS_SECTION_SCTE_SIT:
quark = QUARK_SCTE_SIT;
name = "scte-sit";
break;
default:
GST_DEBUG ("Creating structure for unknown GstMpegtsSection");
quark = QUARK_SECTION;
name = "section";
break;
}
st = gst_structure_new_id (quark, QUARK_SECTION, MPEG_TYPE_TS_SECTION,
st = gst_structure_new_static_str (name, "section", MPEG_TYPE_TS_SECTION,
section, NULL);
return st;
@ -399,7 +387,7 @@ gst_event_parse_mpegts_section (GstEvent * event)
if (!structure)
return NULL;
if (!gst_structure_id_get (structure, QUARK_SECTION, MPEG_TYPE_TS_SECTION,
if (!gst_structure_get (structure, "section", MPEG_TYPE_TS_SECTION,
&section, NULL))
return NULL;
@ -1333,16 +1321,4 @@ __initialize_sections (void)
{
/* FIXME : Temporary hack to initialize section gtype */
_gst_mpegts_section_type = gst_mpegts_section_get_type ();
QUARK_PAT = g_quark_from_string ("pat");
QUARK_CAT = g_quark_from_string ("cat");
QUARK_PMT = g_quark_from_string ("pmt");
QUARK_NIT = g_quark_from_string ("nit");
QUARK_BAT = g_quark_from_string ("bat");
QUARK_SDT = g_quark_from_string ("sdt");
QUARK_EIT = g_quark_from_string ("eit");
QUARK_TDT = g_quark_from_string ("tdt");
QUARK_TOT = g_quark_from_string ("tot");
QUARK_SCTE_SIT = g_quark_from_string ("scte-sit");
QUARK_SECTION = g_quark_from_string ("section");
}

View file

@ -118,30 +118,6 @@ gst_play_error_quark (void)
return g_quark_from_static_string ("gst-play-error-quark");
}
static GQuark QUARK_CONFIG;
/* Keep ConfigQuarkId and _config_quark_strings ordered and synced */
typedef enum
{
CONFIG_QUARK_USER_AGENT = 0,
CONFIG_QUARK_POSITION_INTERVAL_UPDATE,
CONFIG_QUARK_ACCURATE_SEEK,
CONFIG_QUARK_PIPELINE_DUMP_IN_ERROR_DETAILS,
CONFIG_QUARK_MAX
} ConfigQuarkId;
static const gchar *_config_quark_strings[] = {
"user-agent",
"position-interval-update",
"accurate-seek",
"pipeline-dump-in-error-details",
};
static GQuark _config_quark_table[CONFIG_QUARK_MAX];
#define CONFIG_QUARK(q) _config_quark_table[CONFIG_QUARK_##q]
enum
{
PROP_0,
@ -317,10 +293,10 @@ gst_play_init (GstPlay * self)
gst_object_set_name (GST_OBJECT (self->api_bus), "api_bus");
/* *INDENT-OFF* */
self->config = gst_structure_new_id (QUARK_CONFIG,
CONFIG_QUARK (POSITION_INTERVAL_UPDATE), G_TYPE_UINT, DEFAULT_POSITION_UPDATE_INTERVAL_MS,
CONFIG_QUARK (ACCURATE_SEEK), G_TYPE_BOOLEAN, FALSE,
CONFIG_QUARK (PIPELINE_DUMP_IN_ERROR_DETAILS), G_TYPE_BOOLEAN, FALSE,
self->config = gst_structure_new_static_str ("play-config",
"position-interval-update", G_TYPE_UINT, DEFAULT_POSITION_UPDATE_INTERVAL_MS,
"accurate-seek", G_TYPE_BOOLEAN, FALSE,
"pipeline-dump-error-in-details", G_TYPE_BOOLEAN, FALSE,
NULL);
/* *INDENT-ON* */
@ -347,7 +323,7 @@ api_bus_post_message (GstPlay * self, GstPlayMessage message_type,
GST_INFO ("Posting API-bus message-type: %s",
gst_play_message_get_name (message_type));
message_data = gst_structure_new (GST_PLAY_MESSAGE_DATA,
message_data = gst_structure_new_static_str (GST_PLAY_MESSAGE_DATA,
GST_PLAY_MESSAGE_DATA_TYPE, GST_TYPE_PLAY_MESSAGE, message_type, NULL);
va_start (varargs, firstfield);
@ -361,23 +337,6 @@ api_bus_post_message (GstPlay * self, GstPlayMessage message_type,
gst_bus_post (self->api_bus, msg);
}
static void
config_quark_initialize (void)
{
gint i;
QUARK_CONFIG = g_quark_from_static_string ("play-config");
if (G_N_ELEMENTS (_config_quark_strings) != CONFIG_QUARK_MAX)
g_warning ("the quark table is not consistent! %d != %d",
(int) G_N_ELEMENTS (_config_quark_strings), CONFIG_QUARK_MAX);
for (i = 0; i < CONFIG_QUARK_MAX; i++) {
_config_quark_table[i] =
g_quark_from_static_string (_config_quark_strings[i]);
}
}
static void
gst_play_class_init (GstPlayClass * klass)
{
@ -476,8 +435,6 @@ gst_play_class_init (GstPlayClass * klass)
G_MININT64, G_MAXINT64, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (gobject_class, PROP_LAST, param_specs);
config_quark_initialize ();
}
static void
@ -988,7 +945,7 @@ on_error (GstPlay * self, GError * err, const GstStructure * details)
if (details != NULL) {
extra_details = gst_structure_copy (details);
} else {
extra_details = gst_structure_new_empty ("error-details");
extra_details = gst_structure_new_static_str_empty ("error-details");
}
if (gst_play_config_get_pipeline_dump_in_error_details (self->config)) {
dot_data = gst_debug_bin_to_dot_data (GST_BIN_CAST (self->playbin),
@ -4455,8 +4412,7 @@ gst_play_config_set_user_agent (GstStructure * config, const gchar * agent)
g_return_if_fail (config != NULL);
g_return_if_fail (agent != NULL);
gst_structure_id_set (config,
CONFIG_QUARK (USER_AGENT), G_TYPE_STRING, agent, NULL);
gst_structure_set (config, "user-agent", G_TYPE_STRING, agent, NULL);
}
/**
@ -4476,8 +4432,7 @@ gst_play_config_get_user_agent (const GstStructure * config)
g_return_val_if_fail (config != NULL, NULL);
gst_structure_id_get (config,
CONFIG_QUARK (USER_AGENT), G_TYPE_STRING, &agent, NULL);
gst_structure_get (config, "user-agent", G_TYPE_STRING, &agent, NULL);
return agent;
}
@ -4498,8 +4453,8 @@ gst_play_config_set_position_update_interval (GstStructure * config,
g_return_if_fail (config != NULL);
g_return_if_fail (interval <= 10000);
gst_structure_id_set (config,
CONFIG_QUARK (POSITION_INTERVAL_UPDATE), G_TYPE_UINT, interval, NULL);
gst_structure_set (config,
"position-update-interval", G_TYPE_UINT, interval, NULL);
}
/**
@ -4517,8 +4472,8 @@ gst_play_config_get_position_update_interval (const GstStructure * config)
g_return_val_if_fail (config != NULL, DEFAULT_POSITION_UPDATE_INTERVAL_MS);
gst_structure_id_get (config,
CONFIG_QUARK (POSITION_INTERVAL_UPDATE), G_TYPE_UINT, &interval, NULL);
gst_structure_get (config,
"position-update-interval", G_TYPE_UINT, &interval, NULL);
return interval;
}
@ -4545,8 +4500,7 @@ gst_play_config_set_seek_accurate (GstStructure * config, gboolean accurate)
{
g_return_if_fail (config != NULL);
gst_structure_id_set (config,
CONFIG_QUARK (ACCURATE_SEEK), G_TYPE_BOOLEAN, accurate, NULL);
gst_structure_set (config, "accurate-seek", G_TYPE_BOOLEAN, accurate, NULL);
}
/**
@ -4564,8 +4518,7 @@ gst_play_config_get_seek_accurate (const GstStructure * config)
g_return_val_if_fail (config != NULL, FALSE);
gst_structure_id_get (config,
CONFIG_QUARK (ACCURATE_SEEK), G_TYPE_BOOLEAN, &accurate, NULL);
gst_structure_get (config, "accurate-seek", G_TYPE_BOOLEAN, &accurate, NULL);
return accurate;
}
@ -4589,7 +4542,7 @@ gst_play_config_set_pipeline_dump_in_error_details (GstStructure * config,
{
g_return_if_fail (config != NULL);
gst_structure_id_set (config, CONFIG_QUARK (PIPELINE_DUMP_IN_ERROR_DETAILS),
gst_structure_set (config, "pipeline-dump-in-error-details",
G_TYPE_BOOLEAN, value, NULL);
}
@ -4609,7 +4562,7 @@ gst_play_config_get_pipeline_dump_in_error_details (const GstStructure * config)
g_return_val_if_fail (config != NULL, FALSE);
gst_structure_id_get (config, CONFIG_QUARK (PIPELINE_DUMP_IN_ERROR_DETAILS),
gst_structure_get (config, "pipeline-dump-in-error-details",
G_TYPE_BOOLEAN, &value, NULL);
return value;

View file

@ -88,14 +88,6 @@ GST_DEBUG_CATEGORY_STATIC (ts_demux_debug);
#define ABSDIFF(a,b) (((a) > (b)) ? ((a) - (b)) : ((b) - (a)))
static GQuark QUARK_TSDEMUX;
static GQuark QUARK_PID;
static GQuark QUARK_PCR;
static GQuark QUARK_OPCR;
static GQuark QUARK_PTS;
static GQuark QUARK_DTS;
static GQuark QUARK_OFFSET;
typedef enum
{
PENDING_PACKET_EMPTY = 0, /* No pending packet/buffer
@ -349,21 +341,8 @@ static void gst_ts_demux_check_and_sync_streams (GstTSDemux * demux,
GstClockTime time);
static void handle_psi (MpegTSBase * base, GstMpegtsSection * section);
static void
_extra_init (void)
{
QUARK_TSDEMUX = g_quark_from_string ("tsdemux");
QUARK_PID = g_quark_from_string ("pid");
QUARK_PCR = g_quark_from_string ("pcr");
QUARK_OPCR = g_quark_from_string ("opcr");
QUARK_PTS = g_quark_from_string ("pts");
QUARK_DTS = g_quark_from_string ("dts");
QUARK_OFFSET = g_quark_from_string ("offset");
}
#define gst_ts_demux_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GstTSDemux, gst_ts_demux, GST_TYPE_MPEGTS_BASE,
_extra_init ());
G_DEFINE_TYPE (GstTSDemux, gst_ts_demux, GST_TYPE_MPEGTS_BASE);
#define _do_element_init \
GST_DEBUG_CATEGORY_INIT (ts_demux_debug, "tsdemux", 0, \
"MPEG transport stream demuxer");\
@ -1159,7 +1138,7 @@ handle_psi (MpegTSBase * base, GstMpegtsSection * section)
GstMpegtsSCTESIT *sit =
(GstMpegtsSCTESIT *) gst_mpegts_section_get_scte_sit (new_section);
rtime_map = gst_structure_new_empty ("running-time-map");
rtime_map = gst_structure_new_static_str_empty ("running-time-map");
if (sit->fully_parsed) {
if (sit->splice_time_specified) {
@ -2465,11 +2444,9 @@ gst_ts_demux_record_pts (GstTSDemux * demux, TSDemuxStream * stream,
if (G_UNLIKELY (demux->emit_statistics)) {
GstStructure *st;
st = gst_structure_new_id_empty (QUARK_TSDEMUX);
gst_structure_id_set (st,
QUARK_PID, G_TYPE_UINT, bs->pid,
QUARK_OFFSET, G_TYPE_UINT64, offset, QUARK_PTS, G_TYPE_UINT64, pts,
NULL);
st = gst_structure_new_static_str ("tsdemux",
"pid", G_TYPE_UINT, bs->pid,
"offset", G_TYPE_UINT64, offset, "pts", G_TYPE_UINT64, pts, NULL);
gst_element_post_message (GST_ELEMENT_CAST (demux),
gst_message_new_element (GST_OBJECT (demux), st));
}
@ -2499,11 +2476,9 @@ gst_ts_demux_record_dts (GstTSDemux * demux, TSDemuxStream * stream,
if (G_UNLIKELY (demux->emit_statistics)) {
GstStructure *st;
st = gst_structure_new_id_empty (QUARK_TSDEMUX);
gst_structure_id_set (st,
QUARK_PID, G_TYPE_UINT, bs->pid,
QUARK_OFFSET, G_TYPE_UINT64, offset, QUARK_DTS, G_TYPE_UINT64, dts,
NULL);
st = gst_structure_new_static_str ("tsdemux",
"pid", G_TYPE_UINT, bs->pid,
"offset", G_TYPE_UINT64, offset, "dts", G_TYPE_UINT64, dts, NULL);
gst_element_post_message (GST_ELEMENT_CAST (demux),
gst_message_new_element (GST_OBJECT (demux), st));
}

View file

@ -519,7 +519,7 @@ static void
metadata_base_class->handle_tag =
mxf_metadata_wave_audio_essence_descriptor_handle_tag;
metadata_base_class->name_quark = MXF_QUARK (WAVE_AUDIO_ESSENCE_DESCRIPTOR);
metadata_base_class->name = "wave-audio-essence-descriptor";
metadata_base_class->to_structure =
mxf_metadata_wave_audio_essence_descriptor_to_structure;
metadata_base_class->write_tags =
@ -1070,7 +1070,7 @@ static void
object_class->finalize = mxf_metadata_aes3_audio_essence_descriptor_finalize;
metadata_base_class->handle_tag =
mxf_metadata_aes3_audio_essence_descriptor_handle_tag;
metadata_base_class->name_quark = MXF_QUARK (AES3_AUDIO_ESSENCE_DESCRIPTOR);
metadata_base_class->name = "aes3-audio-essence-descriptor";
metadata_base_class->to_structure =
mxf_metadata_aes3_audio_essence_descriptor_to_structure;
metadata_base_class->write_tags =

View file

@ -259,7 +259,7 @@ static void
metadata_base_class->handle_tag =
mxf_metadata_ffv1_picture_descriptor_handle_tag;
metadata_base_class->name_quark = MXF_QUARK (FFV1_PICTURE_DESCRIPTOR);
metadata_base_class->name = "ffv1-picture-descriptor";
metadata_class->type = 0x0181;
}

View file

@ -68,9 +68,9 @@ mxf_metadata_base_to_structure_default (MXFMetadataBase * self)
GstStructure *ret;
gchar str[48];
g_return_val_if_fail (klass->name_quark != 0, NULL);
g_return_val_if_fail (klass->name != NULL, NULL);
ret = gst_structure_new_id_empty (klass->name_quark);
ret = gst_structure_new_static_str_empty (klass->name);
if (!mxf_uuid_is_zero (&self->instance_uid)) {
mxf_uuid_to_string (&self->instance_uid, str);
@ -98,7 +98,7 @@ mxf_metadata_base_to_structure_default (MXFMetadataBase * self)
while (g_hash_table_iter_next (&iter, NULL, (gpointer) & tag)) {
g_value_init (&v, GST_TYPE_STRUCTURE);
s = gst_structure_new_id_empty (MXF_QUARK (TAG));
s = gst_structure_new_static_str_empty ("tag");
mxf_ul_to_string (&tag->ul, str);
@ -957,7 +957,7 @@ mxf_metadata_preface_class_init (MXFMetadataPrefaceClass * klass)
metadata_base_class->resolve = mxf_metadata_preface_resolve;
metadata_base_class->to_structure = mxf_metadata_preface_to_structure;
metadata_base_class->write_tags = mxf_metadata_preface_write_tags;
metadata_base_class->name_quark = MXF_QUARK (PREFACE);
metadata_base_class->name = "preface";
metadata_class->type = 0x012f;
}
@ -1249,7 +1249,7 @@ mxf_metadata_identification_class_init (MXFMetadataIdentificationClass * klass)
object_class->finalize = mxf_metadata_identification_finalize;
metadata_base_class->handle_tag = mxf_metadata_identification_handle_tag;
metadata_base_class->name_quark = MXF_QUARK (IDENTIFICATION);
metadata_base_class->name = "identification";
metadata_base_class->to_structure = mxf_metadata_identification_to_structure;
metadata_base_class->write_tags = mxf_metadata_identification_write_tags;
metadata_class->type = 0x0130;
@ -1551,7 +1551,7 @@ mxf_metadata_content_storage_class_init (MXFMetadataContentStorageClass * klass)
object_class->finalize = mxf_metadata_content_storage_finalize;
metadata_base_class->handle_tag = mxf_metadata_content_storage_handle_tag;
metadata_base_class->resolve = mxf_metadata_content_storage_resolve;
metadata_base_class->name_quark = MXF_QUARK (CONTENT_STORAGE);
metadata_base_class->name = "content-storage";
metadata_base_class->to_structure = mxf_metadata_content_storage_to_structure;
metadata_base_class->write_tags = mxf_metadata_content_storage_write_tags;
metadata_class->type = 0x0118;
@ -1734,7 +1734,7 @@ static void
metadata_base_class->handle_tag =
mxf_metadata_essence_container_data_handle_tag;
metadata_base_class->resolve = mxf_metadata_essence_container_data_resolve;
metadata_base_class->name_quark = MXF_QUARK (ESSENCE_CONTAINER_DATA);
metadata_base_class->name = "essence-container-data";
metadata_base_class->to_structure =
mxf_metadata_essence_container_data_to_structure;
metadata_base_class->write_tags =
@ -2136,7 +2136,7 @@ mxf_metadata_material_package_class_init (MXFMetadataMaterialPackageClass *
MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass;
metadata_base_class->resolve = mxf_metadata_material_package_resolve;
metadata_base_class->name_quark = MXF_QUARK (MATERIAL_PACKAGE);
metadata_base_class->name = "material-package";
metadata_class->type = 0x0136;
}
@ -2343,7 +2343,7 @@ mxf_metadata_source_package_class_init (MXFMetadataSourcePackageClass * klass)
metadata_base_class->handle_tag = mxf_metadata_source_package_handle_tag;
metadata_base_class->resolve = mxf_metadata_source_package_resolve;
metadata_base_class->name_quark = MXF_QUARK (SOURCE_PACKAGE);
metadata_base_class->name = "source-package";
metadata_base_class->to_structure = mxf_metadata_source_package_to_structure;
metadata_base_class->write_tags = mxf_metadata_source_package_write_tags;
metadata_class->type = 0x0137;
@ -2701,7 +2701,7 @@ mxf_metadata_timeline_track_class_init (MXFMetadataTimelineTrackClass * klass)
MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass;
metadata_base_class->handle_tag = mxf_metadata_timeline_track_handle_tag;
metadata_base_class->name_quark = MXF_QUARK (TIMELINE_TRACK);
metadata_base_class->name = "timeline-track";
metadata_base_class->to_structure = mxf_metadata_timeline_track_to_structure;
metadata_base_class->write_tags = mxf_metadata_timeline_track_write_tags;
metadata_class->type = 0x013b;
@ -2806,7 +2806,7 @@ mxf_metadata_event_track_class_init (MXFMetadataEventTrackClass * klass)
MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass;
metadata_base_class->handle_tag = mxf_metadata_event_track_handle_tag;
metadata_base_class->name_quark = MXF_QUARK (EVENT_TRACK);
metadata_base_class->name = "event-track";
metadata_base_class->to_structure = mxf_metadata_event_track_to_structure;
metadata_base_class->write_tags = mxf_metadata_event_track_write_tags;
metadata_class->type = 0x0139;
@ -2826,7 +2826,7 @@ mxf_metadata_static_track_class_init (MXFMetadataStaticTrackClass * klass)
MXFMetadataBaseClass *metadata_base_class = (MXFMetadataBaseClass *) klass;
MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass;
metadata_base_class->name_quark = MXF_QUARK (STATIC_TRACK);
metadata_base_class->name = "static-track";
metadata_class->type = 0x013a;
}
@ -3059,7 +3059,7 @@ mxf_metadata_sequence_class_init (MXFMetadataSequenceClass * klass)
object_class->finalize = mxf_metadata_sequence_finalize;
metadata_base_class->handle_tag = mxf_metadata_sequence_handle_tag;
metadata_base_class->resolve = mxf_metadata_sequence_resolve;
metadata_base_class->name_quark = MXF_QUARK (SEQUENCE);
metadata_base_class->name = "sequence";
metadata_base_class->to_structure = mxf_metadata_sequence_to_structure;
metadata_base_class->write_tags = mxf_metadata_sequence_write_tags;
metadata_class->type = 0x010f;
@ -3293,7 +3293,7 @@ mxf_metadata_timecode_component_class_init (MXFMetadataTimecodeComponentClass *
MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass;
metadata_base_class->handle_tag = mxf_metadata_timecode_component_handle_tag;
metadata_base_class->name_quark = MXF_QUARK (TIMECODE_COMPONENT);
metadata_base_class->name = "timecode-component";
metadata_base_class->to_structure =
mxf_metadata_timecode_component_to_structure;
metadata_base_class->write_tags = mxf_metadata_timecode_component_write_tags;
@ -3466,7 +3466,7 @@ mxf_metadata_source_clip_class_init (MXFMetadataSourceClipClass * klass)
metadata_base_class->handle_tag = mxf_metadata_source_clip_handle_tag;
metadata_base_class->resolve = mxf_metadata_source_clip_resolve;
metadata_base_class->name_quark = MXF_QUARK (SOURCE_CLIP);
metadata_base_class->name = "source-clip";
metadata_base_class->to_structure = mxf_metadata_source_clip_to_structure;
metadata_base_class->write_tags = mxf_metadata_source_clip_write_tags;
metadata_class->type = 0x0111;
@ -3488,7 +3488,7 @@ mxf_metadata_filler_class_init (MXFMetadataFillerClass * klass)
MXFMetadataBaseClass *metadata_base_class = (MXFMetadataBaseClass *) klass;
MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass;
metadata_base_class->name_quark = MXF_QUARK (FILLER);
metadata_base_class->name = "filler";
metadata_class->type = 0x0109;
}
@ -3643,7 +3643,7 @@ mxf_metadata_dm_source_clip_class_init (MXFMetadataDMSourceClipClass * klass)
object_class->finalize = mxf_metadata_dm_source_clip_finalize;
metadata_base_class->handle_tag = mxf_metadata_dm_source_clip_handle_tag;
metadata_base_class->name_quark = MXF_QUARK (DM_SOURCE_CLIP);
metadata_base_class->name = "dm-source-clip";
metadata_base_class->to_structure = mxf_metadata_dm_source_clip_to_structure;
metadata_base_class->write_tags = mxf_metadata_dm_source_clip_write_tags;
metadata_class->type = 0x0145;
@ -3902,7 +3902,7 @@ mxf_metadata_dm_segment_class_init (MXFMetadataDMSegmentClass * klass)
object_class->finalize = mxf_metadata_dm_segment_finalize;
metadata_base_class->handle_tag = mxf_metadata_dm_segment_handle_tag;
metadata_base_class->resolve = mxf_metadata_dm_segment_resolve;
metadata_base_class->name_quark = MXF_QUARK (DM_SEGMENT);
metadata_base_class->name = "dm-segment";
metadata_base_class->to_structure = mxf_metadata_dm_segment_to_structure;
metadata_base_class->write_tags = mxf_metadata_dm_segment_write_tags;
metadata_class->type = 0x0141;
@ -4329,7 +4329,7 @@ mxf_metadata_file_descriptor_class_init (MXFMetadataFileDescriptorClass * klass)
MXFMetadataClass *metadata_class = (MXFMetadataClass *) klass;
metadata_base_class->handle_tag = mxf_metadata_file_descriptor_handle_tag;
metadata_base_class->name_quark = MXF_QUARK (FILE_DESCRIPTOR);
metadata_base_class->name = "file-descriptor";
metadata_base_class->to_structure = mxf_metadata_file_descriptor_to_structure;
metadata_base_class->write_tags = mxf_metadata_file_descriptor_write_tags;
metadata_class->type = 0x0125;
@ -4910,8 +4910,7 @@ static void
metadata_base_class->handle_tag =
mxf_metadata_generic_picture_essence_descriptor_handle_tag;
metadata_base_class->name_quark =
MXF_QUARK (GENERIC_PICTURE_ESSENCE_DESCRIPTOR);
metadata_base_class->name = "generic-picture-essence-descriptor";
metadata_base_class->to_structure =
mxf_metadata_generic_picture_essence_descriptor_to_structure;
metadata_base_class->write_tags =
@ -5295,8 +5294,7 @@ static void
metadata_base_class->handle_tag =
mxf_metadata_generic_sound_essence_descriptor_handle_tag;
metadata_base_class->name_quark =
MXF_QUARK (GENERIC_SOUND_ESSENCE_DESCRIPTOR);
metadata_base_class->name = "generic-sound-essence-descriptor";
metadata_base_class->to_structure =
mxf_metadata_generic_sound_essence_descriptor_to_structure;
metadata_base_class->write_tags =
@ -5659,7 +5657,7 @@ static void
metadata_base_class->handle_tag =
mxf_metadata_cdci_picture_essence_descriptor_handle_tag;
metadata_base_class->name_quark = MXF_QUARK (CDCI_PICTURE_ESSENCE_DESCRIPTOR);
metadata_base_class->name = "cdci-picture-essence-descriptor";
metadata_base_class->to_structure =
mxf_metadata_cdci_picture_essence_descriptor_to_structure;
metadata_base_class->write_tags =
@ -5914,7 +5912,7 @@ static void
mxf_metadata_rgba_picture_essence_descriptor_finalize;
metadata_base_class->handle_tag =
mxf_metadata_rgba_picture_essence_descriptor_handle_tag;
metadata_base_class->name_quark = MXF_QUARK (RGBA_PICTURE_ESSENCE_DESCRIPTOR);
metadata_base_class->name = "rgba-picture-essence-descriptor";
metadata_base_class->to_structure =
mxf_metadata_rgba_picture_essence_descriptor_to_structure;
metadata_base_class->write_tags =
@ -6026,7 +6024,7 @@ static void
metadata_base_class->handle_tag =
mxf_metadata_generic_data_essence_descriptor_handle_tag;
metadata_base_class->name_quark = MXF_QUARK (GENERIC_DATA_ESSENCE_DESCRIPTOR);
metadata_base_class->name = "generic-data-essence-descriptor";
metadata_base_class->to_structure =
mxf_metadata_generic_data_essence_descriptor_to_structure;
metadata_base_class->write_tags =
@ -6230,7 +6228,7 @@ mxf_metadata_multiple_descriptor_class_init (MXFMetadataMultipleDescriptorClass
object_class->finalize = mxf_metadata_multiple_descriptor_finalize;
metadata_base_class->handle_tag = mxf_metadata_multiple_descriptor_handle_tag;
metadata_base_class->resolve = mxf_metadata_multiple_descriptor_resolve;
metadata_base_class->name_quark = MXF_QUARK (MULTIPLE_DESCRIPTOR);
metadata_base_class->name = "multiple-descriptor";
metadata_base_class->to_structure =
mxf_metadata_multiple_descriptor_to_structure;
metadata_base_class->write_tags = mxf_metadata_multiple_descriptor_write_tags;
@ -6338,7 +6336,7 @@ mxf_metadata_text_locator_class_init (MXFMetadataTextLocatorClass * klass)
object_class->finalize = mxf_metadata_text_locator_finalize;
metadata_base_class->handle_tag = mxf_metadata_text_locator_handle_tag;
metadata_base_class->name_quark = MXF_QUARK (TEXT_LOCATOR);
metadata_base_class->name = "text-locator";
metadata_base_class->to_structure = mxf_metadata_text_locator_to_structure;
metadata_base_class->write_tags = mxf_metadata_text_locator_write_tags;
metadata_class->type = 0x0133;
@ -6431,7 +6429,7 @@ mxf_metadata_network_locator_class_init (MXFMetadataNetworkLocatorClass * klass)
object_class->finalize = mxf_metadata_network_locator_finalize;
metadata_base_class->handle_tag = mxf_metadata_network_locator_handle_tag;
metadata_base_class->name_quark = MXF_QUARK (NETWORK_LOCATOR);
metadata_base_class->name = "network-locator";
metadata_base_class->to_structure = mxf_metadata_network_locator_to_structure;
metadata_base_class->write_tags = mxf_metadata_network_locator_write_tags;
metadata_class->type = 0x0133;

View file

@ -399,7 +399,7 @@ struct _MXFMetadataBaseClass {
GstStructure * (*to_structure) (MXFMetadataBase *self);
GList * (*write_tags) (MXFMetadataBase *self, MXFPrimerPack *primer);
GQuark name_quark;
const gchar *name;
};
struct _MXFMetadata {

View file

@ -374,7 +374,7 @@ static void
metadata_base_class->handle_tag =
mxf_metadata_mpeg_video_descriptor_handle_tag;
metadata_base_class->name_quark = MXF_QUARK (MPEG_VIDEO_DESCRIPTOR);
metadata_base_class->name = "mpeg-video-descriptor";
metadata_base_class->to_structure =
mxf_metadata_mpeg_video_descriptor_to_structure;
metadata_base_class->write_tags =

View file

@ -43,8 +43,8 @@ __gst_audio_element_proxy_caps (GstElement * element, GstCaps * templ_caps,
gint caps_size = gst_caps_get_size (caps);
for (i = 0; i < templ_caps_size; i++) {
GQuark q_name =
gst_structure_get_name_id (gst_caps_get_structure (templ_caps, i));
const GstIdStr *name =
gst_structure_get_name_id_str (gst_caps_get_structure (templ_caps, i));
GstCapsFeatures *features = gst_caps_get_features (templ_caps, i);
for (j = 0; j < caps_size; j++) {
@ -52,7 +52,7 @@ __gst_audio_element_proxy_caps (GstElement * element, GstCaps * templ_caps,
const GValue *val;
GstStructure *s;
s = gst_structure_new_id_empty (q_name);
s = gst_structure_new_id_str_empty (name);
if ((val = gst_structure_get_value (caps_s, "rate")))
gst_structure_set_value (s, "rate", val);
if ((val = gst_structure_get_value (caps_s, "channels")))

View file

@ -65,8 +65,6 @@ static GQuark _TAGS_QUARK;
static GQuark _ELEMENT_SRCPAD_QUARK;
static GQuark _TOC_QUARK;
static GQuark _STREAM_ID_QUARK;
static GQuark _MISSING_PLUGIN_QUARK;
static GQuark _STREAM_TOPOLOGY_QUARK;
static GQuark _TOPOLOGY_PAD_QUARK;
@ -158,8 +156,6 @@ _do_init (void)
_TAGS_QUARK = g_quark_from_static_string ("tags");
_TOC_QUARK = g_quark_from_static_string ("toc");
_STREAM_ID_QUARK = g_quark_from_static_string ("stream-id");
_MISSING_PLUGIN_QUARK = g_quark_from_static_string ("missing-plugin");
_STREAM_TOPOLOGY_QUARK = g_quark_from_static_string ("stream-topology");
_TOPOLOGY_PAD_QUARK = g_quark_from_static_string ("pad");
};
@ -1673,14 +1669,12 @@ handle_message (GstDiscoverer * dc, GstMessage * msg)
case GST_MESSAGE_ELEMENT:
{
GQuark sttype;
const GstStructure *structure;
structure = gst_message_get_structure (msg);
sttype = gst_structure_get_name_id (structure);
GST_DEBUG_OBJECT (GST_MESSAGE_SRC (msg),
"structure %" GST_PTR_FORMAT, structure);
if (sttype == _MISSING_PLUGIN_QUARK) {
if (gst_structure_has_name (structure, "missing-plugin")) {
GST_DEBUG_OBJECT (GST_MESSAGE_SRC (msg),
"Setting result to MISSING_PLUGINS");
dc->priv->current_info->result = GST_DISCOVERER_MISSING_PLUGINS;
@ -1692,7 +1686,7 @@ handle_message (GstDiscoverer * dc, GstMessage * msg)
dc->priv->current_info->misc = gst_structure_copy (structure);
g_ptr_array_add (dc->priv->current_info->missing_elements_details,
gst_missing_plugin_message_get_installer_detail (msg));
} else if (sttype == _STREAM_TOPOLOGY_QUARK) {
} else if (gst_structure_has_name (structure, "stream-topology")) {
if (dc->priv->current_topology)
gst_structure_free (dc->priv->current_topology);
dc->priv->current_topology = gst_structure_copy (structure);

View file

@ -39,8 +39,8 @@ __gst_video_element_proxy_caps (GstElement * element, GstCaps * templ_caps,
gint caps_size = gst_caps_get_size (caps);
for (i = 0; i < templ_caps_size; i++) {
GQuark q_name =
gst_structure_get_name_id (gst_caps_get_structure (templ_caps, i));
const GstIdStr *name =
gst_structure_get_name_id_str (gst_caps_get_structure (templ_caps, i));
GstCapsFeatures *features = gst_caps_get_features (templ_caps, i);
for (j = 0; j < caps_size; j++) {
@ -49,7 +49,7 @@ __gst_video_element_proxy_caps (GstElement * element, GstCaps * templ_caps,
GstStructure *s;
GstCaps *tmp = gst_caps_new_empty ();
s = gst_structure_new_id_empty (q_name);
s = gst_structure_new_id_str_empty (name);
if ((val = gst_structure_get_value (caps_s, "width")))
gst_structure_set_value (s, "width", val);
if ((val = gst_structure_get_value (caps_s, "height")))

View file

@ -587,22 +587,10 @@ static GstPadProbeReturn pad_event_cb (GstPad * pad, GstPadProbeInfo * info,
static void gst_decode_bin_dispose (GObject * object);
static void gst_decode_bin_finalize (GObject * object);
/* Register some quarks here for the stream topology message */
static GQuark topology_structure_name = 0;
static GQuark topology_caps = 0;
static GQuark topology_next = 0;
static GQuark topology_pad = 0;
static GQuark topology_element_srcpad = 0;
GType gst_decode_bin_get_type (void);
G_DEFINE_TYPE (GstDecodeBin, gst_decode_bin, GST_TYPE_BIN);
#define _do_init \
GST_DEBUG_CATEGORY_INIT (gst_decode_bin_debug, "decodebin", 0, "decoder bin");\
topology_structure_name = g_quark_from_static_string ("stream-topology"); \
topology_caps = g_quark_from_static_string ("caps");\
topology_next = g_quark_from_static_string ("next");\
topology_pad = g_quark_from_static_string ("pad");\
topology_element_srcpad = g_quark_from_static_string ("element-srcpad");\
playback_element_init (plugin);\
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (decodebin, "decodebin", GST_RANK_NONE,
@ -4565,28 +4553,26 @@ gst_decode_chain_get_topology (GstDecodeChain * chain)
return NULL;
}
u = gst_structure_new_id_empty (topology_structure_name);
u = gst_structure_new_static_str_empty ("stream-topology");
/* Now at the last element */
if ((chain->elements || !chain->active_group) &&
(chain->endpad || chain->deadend)) {
GstPad *srcpad;
s = gst_structure_new_id_empty (topology_structure_name);
gst_structure_id_set (u, topology_caps, GST_TYPE_CAPS, chain->endcaps,
NULL);
s = gst_structure_new_static_str_empty ("stream-topology");
gst_structure_set (u, "caps", GST_TYPE_CAPS, chain->endcaps, NULL);
if (chain->endpad) {
gst_structure_id_set (u, topology_pad, GST_TYPE_PAD, chain->endpad, NULL);
gst_structure_set (u, "pad", GST_TYPE_PAD, chain->endpad, NULL);
srcpad = gst_ghost_pad_get_target (GST_GHOST_PAD_CAST (chain->endpad));
gst_structure_id_set (u, topology_element_srcpad, GST_TYPE_PAD,
srcpad, NULL);
gst_structure_set (u, "element-srcpad", GST_TYPE_PAD, srcpad, NULL);
gst_object_unref (srcpad);
}
gst_structure_id_set (s, topology_next, GST_TYPE_STRUCTURE, u, NULL);
gst_structure_set (s, "next", GST_TYPE_STRUCTURE, u, NULL);
gst_structure_free (u);
u = s;
} else if (chain->active_group) {
@ -4604,7 +4590,7 @@ gst_decode_chain_get_topology (GstDecodeChain * chain)
gst_structure_free (s);
}
}
gst_structure_id_set_value (u, topology_next, &list);
gst_structure_set_value (u, "next", &list);
g_value_unset (&list);
g_value_unset (&item);
}
@ -4627,18 +4613,17 @@ gst_decode_chain_get_topology (GstDecodeChain * chain)
caps = _gst_element_get_linked_caps (elem_next, elem, capsfilter, &srcpad);
if (caps) {
s = gst_structure_new_id_empty (topology_structure_name);
gst_structure_id_set (u, topology_caps, GST_TYPE_CAPS, caps, NULL);
s = gst_structure_new_static_str_empty ("stream-topology");
gst_structure_set (u, "caps", GST_TYPE_CAPS, caps, NULL);
gst_caps_unref (caps);
gst_structure_id_set (s, topology_next, GST_TYPE_STRUCTURE, u, NULL);
gst_structure_set (s, "next", GST_TYPE_STRUCTURE, u, NULL);
gst_structure_free (u);
u = s;
}
if (srcpad) {
gst_structure_id_set (u, topology_element_srcpad, GST_TYPE_PAD, srcpad,
NULL);
gst_structure_set (u, "element-srcpad", GST_TYPE_PAD, srcpad, NULL);
gst_object_unref (srcpad);
}
}
@ -4649,9 +4634,8 @@ gst_decode_chain_get_topology (GstDecodeChain * chain)
GST_WARNING_OBJECT (chain->pad, "Couldn't get the caps of decode chain");
return u;
}
gst_structure_id_set (u, topology_caps, GST_TYPE_CAPS, caps, NULL);
gst_structure_id_set (u, topology_element_srcpad, GST_TYPE_PAD, chain->pad,
NULL);
gst_structure_set (u, "caps", GST_TYPE_CAPS, caps, NULL);
gst_structure_set (u, "element-srcpad", GST_TYPE_PAD, chain->pad, NULL);
gst_caps_unref (caps);
return u;

View file

@ -547,14 +547,14 @@ gst_event_store_insert_event (GstEventStore * store, GstEvent * event,
{
guint i, len;
GArray *events;
GQuark name_id = 0;
const gchar *name = NULL;
gboolean insert = TRUE;
GstEventType type = GST_EVENT_TYPE (event);
guint event_sticky_order = gst_event_type_to_sticky_ordering (type);
if (type & GST_EVENT_TYPE_STICKY_MULTI)
name_id = gst_structure_get_name_id (gst_event_get_structure (event));
name = gst_structure_get_name (gst_event_get_structure (event));
events = store->events;
@ -567,7 +567,7 @@ gst_event_store_insert_event (GstEventStore * store, GstEvent * event,
if (type == GST_EVENT_TYPE (ev->event)) {
/* matching types, check matching name if needed */
if (name_id && !gst_event_has_name_id (ev->event, name_id))
if (name && !gst_event_has_name (ev->event, name))
continue;
/* overwrite if different */

View file

@ -848,8 +848,8 @@ gst_x264_enc_sink_getcaps (GstVideoEncoder * enc, GstCaps * filter)
filter_caps = gst_caps_new_empty ();
for (i = 0; i < gst_caps_get_size (supported_incaps); i++) {
GQuark q_name =
gst_structure_get_name_id (gst_caps_get_structure (supported_incaps,
const GstIdStr *name =
gst_structure_get_name_id_str (gst_caps_get_structure (supported_incaps,
i));
for (j = 0; j < gst_caps_get_size (allowed); j++) {
@ -859,7 +859,7 @@ gst_x264_enc_sink_getcaps (GstVideoEncoder * enc, GstCaps * filter)
/* FIXME Find a way to reuse gst_video_encoder_proxy_getcaps so that
* we do not need to copy that logic */
s = gst_structure_new_id_empty (q_name);
s = gst_structure_new_id_str_empty (name);
if ((val = gst_structure_get_value (allowed_s, "width")))
gst_structure_set_value (s, "width", val);
if ((val = gst_structure_get_value (allowed_s, "height")))

View file

@ -1355,9 +1355,9 @@ gst_allocator_set_vaapi_video_info (GstAllocator * allocator,
g_return_val_if_fail (alloc_info != NULL, FALSE);
g_object_set_qdata_full (G_OBJECT (allocator), GST_VAAPI_VIDEO_INFO_QUARK,
gst_structure_new_id (GST_VAAPI_VIDEO_INFO_QUARK,
ALLOCATION_VINFO_QUARK, GST_TYPE_VIDEO_INFO, alloc_info,
SURFACE_ALLOC_FLAGS_QUARK, G_TYPE_UINT, surface_alloc_flags, NULL),
gst_structure_new_static_str ("GstVaapiVideoInfo",
"allocation-vinfo", GST_TYPE_VIDEO_INFO, alloc_info,
"surface-alloc-flags", G_TYPE_UINT, surface_alloc_flags, NULL),
(GDestroyNotify) gst_structure_free);
return TRUE;

View file

@ -167,7 +167,7 @@ gst_buffer_pool_init (GstBufferPool * pool)
priv->active = FALSE;
priv->configured = FALSE;
priv->started = FALSE;
priv->config = gst_structure_new_id_empty (GST_QUARK (BUFFER_POOL_CONFIG));
priv->config = gst_structure_new_static_str_empty ("GstBufferPoolConfig");
gst_buffer_pool_config_set_params (priv->config, NULL, 0, 0, 0);
priv->allocator = NULL;
gst_allocation_params_init (&priv->params);

View file

@ -1927,7 +1927,7 @@ gst_caps_subtract (GstCaps * minuend, GstCaps * subtrahend)
/* Same reason as above for ANY caps */
g_return_val_if_fail (!gst_caps_features_is_any (min_f), NULL);
if (gst_structure_get_name_id (min) == gst_structure_get_name_id (sub) &&
if (gst_structure_has_name (min, gst_structure_get_name (sub)) &&
gst_caps_features_is_equal (min_f, sub_f)) {
GSList *list;
@ -2204,8 +2204,7 @@ gst_caps_simplify (GstCaps * caps)
compare_f = gst_caps_get_features_unchecked (caps, start);
if (!compare_f)
compare_f = GST_CAPS_FEATURES_MEMORY_SYSTEM_MEMORY;
if (gst_structure_get_name_id (simplify) !=
gst_structure_get_name_id (compare) ||
if (!gst_structure_has_name (simplify, gst_structure_get_name (compare)) ||
!gst_caps_features_is_equal (simplify_f, compare_f))
start = i;
for (j = start; j >= 0; j--) {
@ -2215,9 +2214,8 @@ gst_caps_simplify (GstCaps * caps)
compare_f = gst_caps_get_features_unchecked (caps, j);
if (!compare_f)
compare_f = GST_CAPS_FEATURES_MEMORY_SYSTEM_MEMORY;
if (gst_structure_get_name_id (simplify) !=
gst_structure_get_name_id (compare) ||
!gst_caps_features_is_equal (simplify_f, compare_f)) {
if (!gst_structure_has_name (simplify, gst_structure_get_name (compare))
|| !gst_caps_features_is_equal (simplify_f, compare_f)) {
break;
}
if (gst_caps_structure_simplify (&result, simplify, compare)) {

View file

@ -175,7 +175,7 @@ gst_context_new (const gchar * context_type, gboolean persistent)
GST_CAT_LOG (GST_CAT_CONTEXT, "creating new context %p", context);
structure = gst_structure_new_id_empty (GST_QUARK (CONTEXT));
structure = gst_structure_new_static_str_empty ("context");
gst_structure_set_parent_refcount (structure, &context->mini_object.refcount);
gst_context_init (context);

View file

@ -405,8 +405,8 @@ gst_event_writable_structure (GstEvent * event)
if (structure == NULL) {
structure =
gst_structure_new_id_empty (gst_event_type_to_quark (GST_EVENT_TYPE
(event)));
gst_structure_new_static_str_empty (gst_event_type_get_name
(GST_EVENT_TYPE (event)));
gst_structure_set_parent_refcount (structure, &event->mini_object.refcount);
GST_EVENT_STRUCTURE (event) = structure;
}
@ -445,16 +445,13 @@ gst_event_has_name (GstEvent * event, const gchar * name)
* Returns: %TRUE if @name matches the name of the event structure.
*
* Since: 1.18
*
* Deprecated: 1.26: Use gst_event_has_name().
*/
gboolean
gst_event_has_name_id (GstEvent * event, GQuark name)
{
g_return_val_if_fail (GST_IS_EVENT (event), FALSE);
if (GST_EVENT_STRUCTURE (event) == NULL)
return FALSE;
return (gst_structure_get_name_id (GST_EVENT_STRUCTURE (event)) == name);
return gst_event_has_name (event, g_quark_to_string (name));
}
/**
@ -609,8 +606,8 @@ gst_event_new_flush_stop (gboolean reset_time)
GST_CAT_INFO (GST_CAT_EVENT, "creating flush stop %d", reset_time);
event = gst_event_new_custom (GST_EVENT_FLUSH_STOP,
gst_structure_new_id (GST_QUARK (EVENT_FLUSH_STOP),
GST_QUARK (RESET_TIME), G_TYPE_BOOLEAN, reset_time, NULL));
gst_structure_new_static_str ("GstEventFlushStop",
"reset-time", G_TYPE_BOOLEAN, reset_time, NULL));
return event;
}
@ -668,7 +665,7 @@ gst_event_new_select_streams (GList * streams)
g_return_val_if_fail (streams != NULL, NULL);
GST_CAT_INFO (GST_CAT_EVENT, "Creating new select-streams event");
struc = gst_structure_new_id_empty (GST_QUARK (EVENT_SELECT_STREAMS));
struc = gst_structure_new_static_str_empty ("GstEventSelectStreams");
g_value_init (&val, GST_TYPE_LIST);
/* Fill struc with streams */
for (tmpl = streams; tmpl; tmpl = tmpl->next) {
@ -741,8 +738,8 @@ gst_event_new_stream_group_done (guint group_id)
g_return_val_if_fail (group_id != GST_GROUP_ID_INVALID, NULL);
s = gst_structure_new_id (GST_QUARK (EVENT_STREAM_GROUP_DONE),
GST_QUARK (GROUP_ID), G_TYPE_UINT, group_id, NULL);
s = gst_structure_new_static_str ("GstEventStreamGroupDone",
"group-id", G_TYPE_UINT, group_id, NULL);
return gst_event_new_custom (GST_EVENT_STREAM_GROUP_DONE, s);
}
@ -820,9 +817,9 @@ gst_event_new_gap (GstClockTime timestamp, GstClockTime duration)
GST_TIME_ARGS (duration));
event = gst_event_new_custom (GST_EVENT_GAP,
gst_structure_new_id (GST_QUARK (EVENT_GAP),
GST_QUARK (TIMESTAMP), GST_TYPE_CLOCK_TIME, timestamp,
GST_QUARK (DURATION), GST_TYPE_CLOCK_TIME, duration, NULL));
gst_structure_new_static_str ("GstEventGap",
"timestamp", GST_TYPE_CLOCK_TIME, timestamp,
"duration", GST_TYPE_CLOCK_TIME, duration, NULL));
return event;
}
@ -918,8 +915,8 @@ gst_event_new_caps (GstCaps * caps)
GST_CAT_INFO (GST_CAT_EVENT, "creating caps event %" GST_PTR_FORMAT, caps);
event = gst_event_new_custom (GST_EVENT_CAPS,
gst_structure_new_id (GST_QUARK (EVENT_CAPS),
GST_QUARK (CAPS), GST_TYPE_CAPS, caps, NULL));
gst_structure_new_static_str ("GstEventCaps", "caps", GST_TYPE_CAPS, caps,
NULL));
return event;
}
@ -999,8 +996,8 @@ gst_event_new_segment (const GstSegment * segment)
segment);
event = gst_event_new_custom (GST_EVENT_SEGMENT,
gst_structure_new_id (GST_QUARK (EVENT_SEGMENT),
GST_QUARK (SEGMENT), GST_TYPE_SEGMENT, segment, NULL));
gst_structure_new_static_str ("GstEventSegment",
"segment", GST_TYPE_SEGMENT, segment, NULL));
return event;
}
@ -1075,7 +1072,8 @@ gst_event_new_tag (GstTagList * taglist)
g_return_val_if_fail (taglist != NULL, NULL);
s = gst_structure_new_empty (names[gst_tag_list_get_scope (taglist)]);
s = gst_structure_new_static_str_empty (names[gst_tag_list_get_scope
(taglist)]);
g_value_init (&val, GST_TYPE_TAG_LIST);
g_value_take_boxed (&val, taglist);
gst_structure_id_take_value (s, GST_QUARK (TAGLIST), &val);
@ -1134,11 +1132,10 @@ gst_event_new_buffer_size (GstFormat format, gint64 minsize,
", maxsize %" G_GINT64_FORMAT ", async %d", gst_format_get_name (format),
minsize, maxsize, async);
structure = gst_structure_new_id (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,
GST_QUARK (ASYNC), G_TYPE_BOOLEAN, async, NULL);
structure = gst_structure_new_static_str ("GstEventBufferSize",
"format", GST_TYPE_FORMAT, format,
"minsize", G_TYPE_INT64, minsize,
"maxsize", G_TYPE_INT64, maxsize, "async", G_TYPE_BOOLEAN, async, NULL);
event = gst_event_new_custom (GST_EVENT_BUFFERSIZE, structure);
return event;
@ -1249,11 +1246,10 @@ gst_event_new_qos (GstQOSType type, gdouble proportion,
", timestamp %" GST_TIME_FORMAT, type, proportion,
diff, GST_TIME_ARGS (timestamp));
structure = gst_structure_new_id (GST_QUARK (EVENT_QOS),
GST_QUARK (TYPE), GST_TYPE_QOS_TYPE, type,
GST_QUARK (PROPORTION), G_TYPE_DOUBLE, proportion,
GST_QUARK (DIFF), G_TYPE_INT64, diff,
GST_QUARK (TIMESTAMP), G_TYPE_UINT64, timestamp, NULL);
structure = gst_structure_new_static_str ("GstEventQOS",
"type", GST_TYPE_QOS_TYPE, type,
"proportion", G_TYPE_DOUBLE, proportion,
"diff", G_TYPE_INT64, diff, "timestamp", G_TYPE_UINT64, timestamp, NULL);
event = gst_event_new_custom (GST_EVENT_QOS, structure);
return event;
@ -1401,16 +1397,15 @@ gst_event_new_seek (gdouble rate, GstFormat format, GstSeekFlags flags,
stop);
}
structure = gst_structure_new_id (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_QUARK (CUR_TYPE), GST_TYPE_SEEK_TYPE, start_type,
GST_QUARK (CUR), G_TYPE_INT64, start,
GST_QUARK (STOP_TYPE), GST_TYPE_SEEK_TYPE, stop_type,
GST_QUARK (STOP), G_TYPE_INT64, stop,
GST_QUARK (TRICKMODE_INTERVAL), GST_TYPE_CLOCK_TIME, (GstClockTime) 0,
NULL);
structure = gst_structure_new_static_str ("GstEventSeek",
"rate", G_TYPE_DOUBLE, rate,
"format", GST_TYPE_FORMAT, format,
"flags", GST_TYPE_SEEK_FLAGS, flags,
"cur-type", GST_TYPE_SEEK_TYPE, start_type,
"cur", G_TYPE_INT64, start,
"stop-type", GST_TYPE_SEEK_TYPE, stop_type,
"stop", G_TYPE_INT64, stop,
"trickmode-interval", GST_TYPE_CLOCK_TIME, (GstClockTime) 0, NULL);
event = gst_event_new_custom (GST_EVENT_SEEK, structure);
return event;
@ -1557,8 +1552,8 @@ gst_event_new_latency (GstClockTime latency)
GST_CAT_INFO (GST_CAT_EVENT,
"creating latency event %" GST_TIME_FORMAT, GST_TIME_ARGS (latency));
structure = gst_structure_new_id (GST_QUARK (EVENT_LATENCY),
GST_QUARK (LATENCY), G_TYPE_UINT64, latency, NULL);
structure = gst_structure_new_static_str ("GstEventLatency",
"latency", G_TYPE_UINT64, latency, NULL);
event = gst_event_new_custom (GST_EVENT_LATENCY, structure);
return event;
@ -1618,12 +1613,12 @@ gst_event_new_step (GstFormat format, guint64 amount, gdouble rate,
GST_CAT_INFO (GST_CAT_EVENT, "creating step event");
structure = gst_structure_new_id (GST_QUARK (EVENT_STEP),
GST_QUARK (FORMAT), GST_TYPE_FORMAT, format,
GST_QUARK (AMOUNT), G_TYPE_UINT64, amount,
GST_QUARK (RATE), G_TYPE_DOUBLE, rate,
GST_QUARK (FLUSH), G_TYPE_BOOLEAN, flush,
GST_QUARK (INTERMEDIATE), G_TYPE_BOOLEAN, intermediate, NULL);
structure = gst_structure_new_static_str ("GstEventStep",
"format", GST_TYPE_FORMAT, format,
"amount", G_TYPE_UINT64, amount,
"rate", G_TYPE_DOUBLE, rate,
"flush", G_TYPE_BOOLEAN, flush,
"intermediate", G_TYPE_BOOLEAN, intermediate, NULL);
event = gst_event_new_custom (GST_EVENT_STEP, structure);
return event;
@ -1715,8 +1710,9 @@ gst_event_new_sink_message (const gchar * name, GstMessage * msg)
GST_CAT_INFO (GST_CAT_EVENT, "creating sink-message event");
structure = gst_structure_new_id (g_quark_from_string (name),
GST_QUARK (MESSAGE), GST_TYPE_MESSAGE, msg, NULL);
structure =
gst_structure_new_static_str (name, "message", GST_TYPE_MESSAGE, msg,
NULL);
event = gst_event_new_custom (GST_EVENT_SINK_MESSAGE, structure);
return event;
@ -1779,9 +1775,9 @@ gst_event_new_stream_start (const gchar * stream_id)
g_return_val_if_fail (stream_id != NULL, NULL);
s = gst_structure_new_id (GST_QUARK (EVENT_STREAM_START),
GST_QUARK (STREAM_ID), G_TYPE_STRING, stream_id,
GST_QUARK (FLAGS), GST_TYPE_STREAM_FLAGS, GST_STREAM_FLAG_NONE, NULL);
s = gst_structure_new_static_str ("GstEventStreamStart",
"stream-id", G_TYPE_STRING, stream_id,
"flags", GST_TYPE_STREAM_FLAGS, GST_STREAM_FLAG_NONE, NULL);
return gst_event_new_custom (GST_EVENT_STREAM_START, s);
}
@ -1970,8 +1966,8 @@ gst_event_new_stream_collection (GstStreamCollection * collection)
g_return_val_if_fail (collection != NULL, NULL);
g_return_val_if_fail (GST_IS_STREAM_COLLECTION (collection), NULL);
s = gst_structure_new_id (GST_QUARK (EVENT_STREAM_COLLECTION),
GST_QUARK (COLLECTION), GST_TYPE_STREAM_COLLECTION, collection, NULL);
s = gst_structure_new_static_str ("stream-collection",
"collection", GST_TYPE_STREAM_COLLECTION, collection, NULL);
return gst_event_new_custom (GST_EVENT_STREAM_COLLECTION, s);
}
@ -2016,7 +2012,7 @@ GstEvent *
gst_event_new_toc (GstToc * toc, gboolean updated)
{
GstStructure *toc_struct;
GQuark id;
const gchar *name;
g_return_val_if_fail (toc != NULL, NULL);
@ -2025,13 +2021,12 @@ gst_event_new_toc (GstToc * toc, gboolean updated)
/* need different structure names so sticky_multi event stuff on pads
* works, i.e. both TOC events are kept around */
if (gst_toc_get_scope (toc) == GST_TOC_SCOPE_GLOBAL)
id = GST_QUARK (EVENT_TOC_GLOBAL);
name = "GstEventTocGlobal";
else
id = GST_QUARK (EVENT_TOC_CURRENT);
name = "GstEventTocCurrent";
toc_struct = gst_structure_new_id (id,
GST_QUARK (TOC), GST_TYPE_TOC, toc,
GST_QUARK (UPDATED), G_TYPE_BOOLEAN, updated, NULL);
toc_struct = gst_structure_new_static_str (name,
"toc", GST_TYPE_TOC, toc, "updated", G_TYPE_BOOLEAN, updated, NULL);
return gst_event_new_custom (GST_EVENT_TOC, toc_struct);
}
@ -2079,8 +2074,8 @@ gst_event_new_toc_select (const gchar * uid)
GST_CAT_INFO (GST_CAT_EVENT, "creating toc select event for UID: %s", uid);
structure = gst_structure_new_id (GST_QUARK (EVENT_TOC_SELECT),
GST_QUARK (UID), G_TYPE_STRING, uid, NULL);
structure = gst_structure_new_static_str ("GstEventTocSelect",
"uid", G_TYPE_STRING, uid, NULL);
return gst_event_new_custom (GST_EVENT_TOC_SELECT, structure);
}
@ -2239,9 +2234,9 @@ gst_event_new_segment_done (GstFormat format, gint64 position)
GST_CAT_INFO (GST_CAT_EVENT, "creating segment-done event");
structure = gst_structure_new_id (GST_QUARK (EVENT_SEGMENT_DONE),
GST_QUARK (FORMAT), GST_TYPE_FORMAT, format,
GST_QUARK (POSITION), G_TYPE_INT64, position, NULL);
structure = gst_structure_new_static_str ("GstEventSegmentDone",
"format", GST_TYPE_FORMAT, format,
"position", G_TYPE_INT64, position, NULL);
event = gst_event_new_custom (GST_EVENT_SEGMENT_DONE, structure);
@ -2311,9 +2306,9 @@ gst_event_new_instant_rate_change (gdouble rate_multiplier,
rate_multiplier, new_flags);
event = gst_event_new_custom (GST_EVENT_INSTANT_RATE_CHANGE,
gst_structure_new_id (GST_QUARK (EVENT_INSTANT_RATE_CHANGE),
GST_QUARK (RATE), G_TYPE_DOUBLE, rate_multiplier,
GST_QUARK (FLAGS), GST_TYPE_SEGMENT_FLAGS, new_flags, NULL));
gst_structure_new_static_str ("GstEventInstantRateChange",
"rate", G_TYPE_DOUBLE, rate_multiplier,
"flags", GST_TYPE_SEGMENT_FLAGS, new_flags, NULL));
return event;
}
@ -2385,10 +2380,10 @@ gst_event_new_instant_rate_sync_time (gdouble rate_multiplier,
GST_TIME_ARGS (running_time), GST_TIME_ARGS (upstream_running_time));
event = gst_event_new_custom (GST_EVENT_INSTANT_RATE_SYNC_TIME,
gst_structure_new_id (GST_QUARK (EVENT_INSTANT_RATE_SYNC_TIME),
GST_QUARK (RATE), G_TYPE_DOUBLE, rate_multiplier,
GST_QUARK (RUNNING_TIME), GST_TYPE_CLOCK_TIME, running_time,
GST_QUARK (UPSTREAM_RUNNING_TIME), GST_TYPE_CLOCK_TIME,
gst_structure_new_static_str ("GstEventInstantRateSyncTime",
"rate", G_TYPE_DOUBLE, rate_multiplier,
"running-time", GST_TYPE_CLOCK_TIME, running_time,
"upstream-running-time", GST_TYPE_CLOCK_TIME,
upstream_running_time, NULL));
return event;

View file

@ -480,7 +480,7 @@ GstStructure * gst_event_writable_structure (GstEvent *event);
GST_API
gboolean gst_event_has_name (GstEvent *event, const gchar *name);
GST_API
GST_DEPRECATED_FOR(gst_event_has_name)
gboolean gst_event_has_name_id (GstEvent *event, GQuark name);
/* identifiers for events and messages */

View file

@ -903,8 +903,7 @@ gst_info_structure_to_string (const GstStructure * s)
{
if (G_LIKELY (s)) {
gchar *str = gst_structure_to_string (s);
if (G_UNLIKELY (pretty_tags
&& gst_structure_get_name_id (s) == GST_QUARK (TAGLIST)))
if (G_UNLIKELY (pretty_tags && gst_structure_has_name (s, "taglist")))
return prettify_structure_string (str);
else
return str;

View file

@ -410,9 +410,9 @@ message_set_details (GstMessage * message, GstStructure * details)
GValue v = G_VALUE_INIT;
if (GST_MESSAGE_STRUCTURE (message) == NULL) {
GQuark message_quark = gst_message_type_to_quark (message->type);
g_return_if_fail (message_quark);
GstStructure *structure = gst_structure_new_id_empty (message_quark);
const gchar *message_name = gst_message_type_get_name (message->type);
g_return_if_fail (message_name);
GstStructure *structure = gst_structure_new_static_str_empty (message_name);
gst_structure_set_parent_refcount (structure,
&message->mini_object.refcount);
GST_MESSAGE_STRUCTURE (message) = structure;
@ -475,7 +475,7 @@ message_parse_details (GstMessage * message, GstStructure ** details,
*details = g_value_get_boxed (v);
}
} else if (create_if_missing) {
*details = gst_structure_new_empty ("message-details");
*details = gst_structure_new_static_str_empty ("message-details");
message_set_details (message, (GstStructure *) * details);
}
}
@ -560,9 +560,8 @@ gst_message_new_error_with_details (GstObject * src, GError * error,
"string is not valid UTF-8. Please file a bug.");
}
structure = gst_structure_new_id (GST_QUARK (MESSAGE_ERROR),
GST_QUARK (GERROR), G_TYPE_ERROR, error,
GST_QUARK (DEBUG), G_TYPE_STRING, debug, NULL);
structure = gst_structure_new_static_str ("GstMessageError",
"gerror", G_TYPE_ERROR, error, "debug", G_TYPE_STRING, debug, NULL);
message = gst_message_new_custom (GST_MESSAGE_ERROR, src, structure);
if (details) {
message_set_details (message, details);
@ -662,9 +661,8 @@ gst_message_new_warning_with_details (GstObject * src, GError * error,
"string is not valid UTF-8. Please file a bug.");
}
structure = gst_structure_new_id (GST_QUARK (MESSAGE_WARNING),
GST_QUARK (GERROR), G_TYPE_ERROR, error,
GST_QUARK (DEBUG), G_TYPE_STRING, debug, NULL);
structure = gst_structure_new_static_str ("GstMessageWarning",
"gerror", G_TYPE_ERROR, error, "debug", G_TYPE_STRING, debug, NULL);
message = gst_message_new_custom (GST_MESSAGE_WARNING, src, structure);
if (details) {
message_set_details (message, details);
@ -762,9 +760,8 @@ gst_message_new_info_with_details (GstObject * src, GError * error,
"string is not valid UTF-8. Please file a bug.");
}
structure = gst_structure_new_id (GST_QUARK (MESSAGE_INFO),
GST_QUARK (GERROR), G_TYPE_ERROR, error,
GST_QUARK (DEBUG), G_TYPE_STRING, debug, NULL);
structure = gst_structure_new_static_str ("GstMessageInfo",
"gerror", G_TYPE_ERROR, error, "debug", G_TYPE_STRING, debug, NULL);
message = gst_message_new_custom (GST_MESSAGE_INFO, src, structure);
if (details) {
message_set_details (message, details);
@ -856,7 +853,7 @@ gst_message_new_tag (GstObject * src, GstTagList * tag_list)
g_return_val_if_fail (GST_IS_TAG_LIST (tag_list), NULL);
s = gst_structure_new_id_empty (GST_QUARK (MESSAGE_TAG));
s = gst_structure_new_static_str_empty ("GstMessageTag");
g_value_init (&val, GST_TYPE_TAG_LIST);
g_value_take_boxed (&val, tag_list);
gst_structure_id_take_value (s, GST_QUARK (TAGLIST), &val);
@ -895,12 +892,12 @@ gst_message_new_buffering (GstObject * src, gint percent)
buffering_left = (percent == 100 ? 0 : -1);
structure = gst_structure_new_id (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,
GST_QUARK (AVG_OUT_RATE), G_TYPE_INT, -1,
GST_QUARK (BUFFERING_LEFT), G_TYPE_INT64, buffering_left, NULL);
structure = gst_structure_new_static_str ("GstMessageBuffering",
"buffer-percent", G_TYPE_INT, percent,
"buffering-mode", GST_TYPE_BUFFERING_MODE, GST_BUFFERING_STREAM,
"avg-in-rate", G_TYPE_INT, -1,
"avg-out-rate", G_TYPE_INT, -1,
"buffering-left", G_TYPE_INT64, buffering_left, NULL);
message = gst_message_new_custom (GST_MESSAGE_BUFFERING, src, structure);
return message;
@ -927,10 +924,10 @@ gst_message_new_state_changed (GstObject * src,
GstMessage *message;
GstStructure *structure;
structure = gst_structure_new_id (GST_QUARK (MESSAGE_STATE_CHANGED),
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);
structure = gst_structure_new_static_str ("GstMessageStateChanged",
"old-state", GST_TYPE_STATE, (gint) oldstate,
"new-state", GST_TYPE_STATE, (gint) newstate,
"pending-state", GST_TYPE_STATE, (gint) pending, NULL);
message = gst_message_new_custom (GST_MESSAGE_STATE_CHANGED, src, structure);
return message;
@ -982,9 +979,8 @@ gst_message_new_clock_provide (GstObject * src, GstClock * clock,
GstMessage *message;
GstStructure *structure;
structure = gst_structure_new_id (GST_QUARK (MESSAGE_CLOCK_PROVIDE),
GST_QUARK (CLOCK), GST_TYPE_CLOCK, clock,
GST_QUARK (READY), G_TYPE_BOOLEAN, ready, NULL);
structure = gst_structure_new_static_str ("GstMessageClockProvide",
"clock", GST_TYPE_CLOCK, clock, "ready", G_TYPE_BOOLEAN, ready, NULL);
message = gst_message_new_custom (GST_MESSAGE_CLOCK_PROVIDE, src, structure);
return message;
@ -1012,8 +1008,8 @@ gst_message_new_clock_lost (GstObject * src, GstClock * clock)
GstMessage *message;
GstStructure *structure;
structure = gst_structure_new_id (GST_QUARK (MESSAGE_CLOCK_LOST),
GST_QUARK (CLOCK), GST_TYPE_CLOCK, clock, NULL);
structure = gst_structure_new_static_str ("GstMessageClockLost",
"clock", GST_TYPE_CLOCK, clock, NULL);
message = gst_message_new_custom (GST_MESSAGE_CLOCK_LOST, src, structure);
return message;
@ -1037,8 +1033,8 @@ gst_message_new_new_clock (GstObject * src, GstClock * clock)
GstMessage *message;
GstStructure *structure;
structure = gst_structure_new_id (GST_QUARK (MESSAGE_NEW_CLOCK),
GST_QUARK (CLOCK), GST_TYPE_CLOCK, clock, NULL);
structure = gst_structure_new_static_str ("GstMessageNewClock",
"clock", GST_TYPE_CLOCK, clock, NULL);
message = gst_message_new_custom (GST_MESSAGE_NEW_CLOCK, src, structure);
return message;
@ -1072,10 +1068,9 @@ gst_message_new_structure_change (GstObject * src, GstStructureChangeType type,
/* g_return_val_if_fail (GST_PAD_DIRECTION (src) == GST_PAD_SINK, NULL); */
g_return_val_if_fail (GST_IS_ELEMENT (owner), NULL);
structure = gst_structure_new_id (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);
structure = gst_structure_new_static_str ("GstMessageStructureChange",
"type", GST_TYPE_STRUCTURE_CHANGE_TYPE, type,
"owner", GST_TYPE_ELEMENT, owner, "busy", G_TYPE_BOOLEAN, busy, NULL);
message = gst_message_new_custom (GST_MESSAGE_STRUCTURE_CHANGE, src,
structure);
@ -1105,9 +1100,9 @@ gst_message_new_segment_start (GstObject * src, GstFormat format,
GstMessage *message;
GstStructure *structure;
structure = gst_structure_new_id (GST_QUARK (MESSAGE_SEGMENT_START),
GST_QUARK (FORMAT), GST_TYPE_FORMAT, format,
GST_QUARK (POSITION), G_TYPE_INT64, position, NULL);
structure = gst_structure_new_static_str ("GstMessageSegmentStart",
"format", GST_TYPE_FORMAT, format,
"position", G_TYPE_INT64, position, NULL);
message = gst_message_new_custom (GST_MESSAGE_SEGMENT_START, src, structure);
return message;
@ -1135,9 +1130,9 @@ gst_message_new_segment_done (GstObject * src, GstFormat format,
GstMessage *message;
GstStructure *structure;
structure = gst_structure_new_id (GST_QUARK (MESSAGE_SEGMENT_DONE),
GST_QUARK (FORMAT), GST_TYPE_FORMAT, format,
GST_QUARK (POSITION), G_TYPE_INT64, position, NULL);
structure = gst_structure_new_static_str ("GstMessageSegmentDone",
"format", GST_TYPE_FORMAT, format,
"position", G_TYPE_INT64, position, NULL);
message = gst_message_new_custom (GST_MESSAGE_SEGMENT_DONE, src, structure);
return message;
@ -1206,7 +1201,7 @@ gst_message_new_duration_changed (GstObject * src)
GstMessage *message;
message = gst_message_new_custom (GST_MESSAGE_DURATION_CHANGED, src,
gst_structure_new_id_empty (GST_QUARK (MESSAGE_DURATION_CHANGED)));
gst_structure_new_static_str_empty ("GstMessageDurationChanged"));
return message;
}
@ -1252,8 +1247,8 @@ gst_message_new_async_done (GstObject * src, GstClockTime running_time)
GstMessage *message;
GstStructure *structure;
structure = gst_structure_new_id (GST_QUARK (MESSAGE_ASYNC_DONE),
GST_QUARK (RUNNING_TIME), G_TYPE_UINT64, running_time, NULL);
structure = gst_structure_new_static_str ("GstMessageAsyncDone",
"running-time", G_TYPE_UINT64, running_time, NULL);
message = gst_message_new_custom (GST_MESSAGE_ASYNC_DONE, src, structure);
return message;
@ -1299,8 +1294,8 @@ gst_message_new_request_state (GstObject * src, GstState state)
GstMessage *message;
GstStructure *structure;
structure = gst_structure_new_id (GST_QUARK (MESSAGE_REQUEST_STATE),
GST_QUARK (NEW_STATE), GST_TYPE_STATE, (gint) state, NULL);
structure = gst_structure_new_static_str ("GstMessageRequestState",
"new-state", GST_TYPE_STATE, (gint) state, NULL);
message = gst_message_new_custom (GST_MESSAGE_REQUEST_STATE, src, structure);
return message;
@ -1354,8 +1349,8 @@ gst_message_writable_structure (GstMessage * message)
if (structure == NULL) {
structure =
gst_structure_new_id_empty (gst_message_type_to_quark (GST_MESSAGE_TYPE
(message)));
gst_structure_new_static_str_empty (gst_message_type_get_name
(GST_MESSAGE_TYPE (message)));
gst_structure_set_parent_refcount (structure,
&message->mini_object.refcount);
GST_MESSAGE_STRUCTURE (message) = structure;
@ -1914,9 +1909,9 @@ gst_message_new_stream_status (GstObject * src, GstStreamStatusType type,
GstMessage *message;
GstStructure *structure;
structure = gst_structure_new_id (GST_QUARK (MESSAGE_STREAM_STATUS),
GST_QUARK (TYPE), GST_TYPE_STREAM_STATUS_TYPE, (gint) type,
GST_QUARK (OWNER), GST_TYPE_ELEMENT, owner, NULL);
structure = gst_structure_new_static_str ("GstMessageStreamStatus",
"type", GST_TYPE_STREAM_STATUS_TYPE, (gint) type,
"owner", GST_TYPE_ELEMENT, owner, NULL);
message = gst_message_new_custom (GST_MESSAGE_STREAM_STATUS, src, structure);
return message;
@ -2033,14 +2028,13 @@ gst_message_new_step_done (GstObject * src, GstFormat format, guint64 amount,
GstMessage *message;
GstStructure *structure;
structure = gst_structure_new_id (GST_QUARK (MESSAGE_STEP_DONE),
GST_QUARK (FORMAT), GST_TYPE_FORMAT, format,
GST_QUARK (AMOUNT), G_TYPE_UINT64, amount,
GST_QUARK (RATE), G_TYPE_DOUBLE, rate,
GST_QUARK (FLUSH), G_TYPE_BOOLEAN, flush,
GST_QUARK (INTERMEDIATE), G_TYPE_BOOLEAN, intermediate,
GST_QUARK (DURATION), G_TYPE_UINT64, duration,
GST_QUARK (EOS), G_TYPE_BOOLEAN, eos, NULL);
structure = gst_structure_new_static_str ("GstMessageStepDone",
"format", GST_TYPE_FORMAT, format,
"amount", G_TYPE_UINT64, amount,
"rate", G_TYPE_DOUBLE, rate,
"flush", G_TYPE_BOOLEAN, flush,
"intermediate", G_TYPE_BOOLEAN, intermediate,
"duration", G_TYPE_UINT64, duration, "eos", G_TYPE_BOOLEAN, eos, NULL);
message = gst_message_new_custom (GST_MESSAGE_STEP_DONE, src, structure);
return message;
@ -2114,13 +2108,13 @@ gst_message_new_step_start (GstObject * src, gboolean active, GstFormat format,
GstMessage *message;
GstStructure *structure;
structure = gst_structure_new_id (GST_QUARK (MESSAGE_STEP_START),
GST_QUARK (ACTIVE), G_TYPE_BOOLEAN, active,
GST_QUARK (FORMAT), GST_TYPE_FORMAT, format,
GST_QUARK (AMOUNT), G_TYPE_UINT64, amount,
GST_QUARK (RATE), G_TYPE_DOUBLE, rate,
GST_QUARK (FLUSH), G_TYPE_BOOLEAN, flush,
GST_QUARK (INTERMEDIATE), G_TYPE_BOOLEAN, intermediate, NULL);
structure = gst_structure_new_static_str ("GstMessageStepStart",
"active", G_TYPE_BOOLEAN, active,
"format", GST_TYPE_FORMAT, format,
"amount", G_TYPE_UINT64, amount,
"rate", G_TYPE_DOUBLE, rate,
"flush", G_TYPE_BOOLEAN, flush,
"intermediate", G_TYPE_BOOLEAN, intermediate, NULL);
message = gst_message_new_custom (GST_MESSAGE_STEP_START, src, structure);
return message;
@ -2194,18 +2188,18 @@ gst_message_new_qos (GstObject * src, gboolean live, guint64 running_time,
GstMessage *message;
GstStructure *structure;
structure = gst_structure_new_id (GST_QUARK (MESSAGE_QOS),
GST_QUARK (LIVE), G_TYPE_BOOLEAN, live,
GST_QUARK (RUNNING_TIME), G_TYPE_UINT64, running_time,
GST_QUARK (STREAM_TIME), G_TYPE_UINT64, stream_time,
GST_QUARK (TIMESTAMP), G_TYPE_UINT64, timestamp,
GST_QUARK (DURATION), G_TYPE_UINT64, duration,
GST_QUARK (JITTER), G_TYPE_INT64, (gint64) 0,
GST_QUARK (PROPORTION), G_TYPE_DOUBLE, (gdouble) 1.0,
GST_QUARK (QUALITY), G_TYPE_INT, (gint) 1000000,
GST_QUARK (FORMAT), GST_TYPE_FORMAT, GST_FORMAT_UNDEFINED,
GST_QUARK (PROCESSED), G_TYPE_UINT64, (guint64) - 1,
GST_QUARK (DROPPED), G_TYPE_UINT64, (guint64) - 1, NULL);
structure = gst_structure_new_static_str ("GstMessageQOS",
"live", G_TYPE_BOOLEAN, live,
"running-time", G_TYPE_UINT64, running_time,
"stream-time", G_TYPE_UINT64, stream_time,
"timestamp", G_TYPE_UINT64, timestamp,
"duration", G_TYPE_UINT64, duration,
"jitter", G_TYPE_INT64, (gint64) 0,
"proportion", G_TYPE_DOUBLE, (gdouble) 1.0,
"quality", G_TYPE_INT, (gint) 1000000,
"format", GST_TYPE_FORMAT, GST_FORMAT_UNDEFINED,
"processed", G_TYPE_UINT64, (guint64) - 1,
"dropped", G_TYPE_UINT64, (guint64) - 1, NULL);
message = gst_message_new_custom (GST_MESSAGE_QOS, src, structure);
return message;
@ -2411,12 +2405,11 @@ gst_message_new_progress (GstObject * src, GstProgressType type,
if (type == GST_PROGRESS_TYPE_START || type == GST_PROGRESS_TYPE_CONTINUE)
percent = 0;
structure = gst_structure_new_id (GST_QUARK (MESSAGE_PROGRESS),
GST_QUARK (TYPE), GST_TYPE_PROGRESS_TYPE, type,
GST_QUARK (CODE), G_TYPE_STRING, code,
GST_QUARK (TEXT), G_TYPE_STRING, text,
GST_QUARK (PERCENT), G_TYPE_INT, percent,
GST_QUARK (TIMEOUT), G_TYPE_INT, timeout, NULL);
structure = gst_structure_new_static_str ("GstMessageProgress",
"type", GST_TYPE_PROGRESS_TYPE, type,
"code", G_TYPE_STRING, code,
"text", G_TYPE_STRING, text,
"percent", G_TYPE_INT, percent, "timeout", G_TYPE_INT, timeout, NULL);
message = gst_message_new_custom (GST_MESSAGE_PROGRESS, src, structure);
return message;
@ -2467,9 +2460,8 @@ gst_message_new_toc (GstObject * src, GstToc * toc, gboolean updated)
g_return_val_if_fail (toc != NULL, NULL);
toc_struct = gst_structure_new_id (GST_QUARK (MESSAGE_TOC),
GST_QUARK (TOC), GST_TYPE_TOC, toc,
GST_QUARK (UPDATED), G_TYPE_BOOLEAN, updated, NULL);
toc_struct = gst_structure_new_static_str ("GstMessageToc",
"toc", GST_TYPE_TOC, toc, "updated", G_TYPE_BOOLEAN, updated, NULL);
return gst_message_new_custom (GST_MESSAGE_TOC, src, toc_struct);
}
@ -2518,8 +2510,8 @@ gst_message_new_reset_time (GstObject * src, GstClockTime running_time)
g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (running_time), NULL);
structure = gst_structure_new_id (GST_QUARK (MESSAGE_RESET_TIME),
GST_QUARK (RUNNING_TIME), G_TYPE_UINT64, running_time, NULL);
structure = gst_structure_new_static_str ("GstMessageResetTime",
"running-time", G_TYPE_UINT64, running_time, NULL);
message = gst_message_new_custom (GST_MESSAGE_RESET_TIME, src, structure);
return message;
@ -2568,7 +2560,7 @@ gst_message_new_stream_start (GstObject * src)
GstMessage *message;
GstStructure *s;
s = gst_structure_new_id_empty (GST_QUARK (MESSAGE_STREAM_START));
s = gst_structure_new_static_str_empty ("GstMessageStreamStart");
message = gst_message_new_custom (GST_MESSAGE_STREAM_START, src, s);
return message;
@ -2667,8 +2659,8 @@ gst_message_new_need_context (GstObject * src, const gchar * context_type)
g_return_val_if_fail (context_type != NULL, NULL);
structure = gst_structure_new_id (GST_QUARK (MESSAGE_NEED_CONTEXT),
GST_QUARK (CONTEXT_TYPE), G_TYPE_STRING, context_type, NULL);
structure = gst_structure_new_static_str ("GstMessageNeedContext",
"context-type", G_TYPE_STRING, context_type, NULL);
message = gst_message_new_custom (GST_MESSAGE_NEED_CONTEXT, src, structure);
return message;
@ -2724,8 +2716,8 @@ gst_message_new_have_context (GstObject * src, GstContext * context)
GstMessage *message;
GstStructure *structure;
structure = gst_structure_new_id (GST_QUARK (MESSAGE_HAVE_CONTEXT),
GST_QUARK (CONTEXT), GST_TYPE_CONTEXT, context, NULL);
structure = gst_structure_new_static_str ("GstMessageHaveContext",
"context", GST_TYPE_CONTEXT, context, NULL);
message = gst_message_new_custom (GST_MESSAGE_HAVE_CONTEXT, src, structure);
gst_context_unref (context);
@ -2777,8 +2769,8 @@ gst_message_new_device_added (GstObject * src, GstDevice * device)
g_return_val_if_fail (device != NULL, NULL);
g_return_val_if_fail (GST_IS_DEVICE (device), NULL);
structure = gst_structure_new_id (GST_QUARK (MESSAGE_DEVICE_ADDED),
GST_QUARK (DEVICE), GST_TYPE_DEVICE, device, NULL);
structure = gst_structure_new_static_str ("GstMessageDeviceAdded",
"device", GST_TYPE_DEVICE, device, NULL);
message = gst_message_new_custom (GST_MESSAGE_DEVICE_ADDED, src, structure);
return message;
@ -2829,8 +2821,8 @@ gst_message_new_device_removed (GstObject * src, GstDevice * device)
g_return_val_if_fail (device != NULL, NULL);
g_return_val_if_fail (GST_IS_DEVICE (device), NULL);
structure = gst_structure_new_id (GST_QUARK (MESSAGE_DEVICE_REMOVED),
GST_QUARK (DEVICE), GST_TYPE_DEVICE, device, NULL);
structure = gst_structure_new_static_str ("GstMessageDeviceRemoved",
"device", GST_TYPE_DEVICE, device, NULL);
message = gst_message_new_custom (GST_MESSAGE_DEVICE_REMOVED, src, structure);
return message;
@ -2884,9 +2876,9 @@ gst_message_new_device_changed (GstObject * src, GstDevice * device,
g_return_val_if_fail (device != NULL, NULL);
g_return_val_if_fail (GST_IS_DEVICE (device), NULL);
structure = gst_structure_new_id (GST_QUARK (MESSAGE_DEVICE_CHANGED),
GST_QUARK (DEVICE), GST_TYPE_DEVICE, device,
GST_QUARK (DEVICE_CHANGED), GST_TYPE_DEVICE, changed_device, NULL);
structure = gst_structure_new_static_str ("GstMessageDeviceChanged",
"device", GST_TYPE_DEVICE, device,
"device-changed", GST_TYPE_DEVICE, changed_device, NULL);
message = gst_message_new_custom (GST_MESSAGE_DEVICE_CHANGED, src, structure);
return message;
@ -2943,7 +2935,7 @@ gst_message_new_property_notify (GstObject * src, const gchar * property_name,
g_return_val_if_fail (GST_IS_OBJECT (src), NULL);
g_return_val_if_fail (property_name != NULL, NULL);
structure = gst_structure_new_id_empty (GST_QUARK (MESSAGE_PROPERTY_NOTIFY));
structure = gst_structure_new_static_str_empty ("GstMessagePropertyNotify");
g_value_init (&name_val, G_TYPE_STRING);
/* should already be interned, but let's make sure */
g_value_set_static_string (&name_val, g_intern_string (property_name));
@ -3019,8 +3011,8 @@ gst_message_new_stream_collection (GstObject * src,
g_return_val_if_fail (GST_IS_STREAM_COLLECTION (collection), NULL);
structure =
gst_structure_new_id (GST_QUARK (MESSAGE_STREAM_COLLECTION),
GST_QUARK (COLLECTION), GST_TYPE_STREAM_COLLECTION, collection, NULL);
gst_structure_new_static_str ("GstMessageStreamCollection",
"collection", GST_TYPE_STREAM_COLLECTION, collection, NULL);
message =
gst_message_new_custom (GST_MESSAGE_STREAM_COLLECTION, src, structure);
@ -3082,8 +3074,8 @@ gst_message_new_streams_selected (GstObject * src,
g_return_val_if_fail (GST_IS_STREAM_COLLECTION (collection), NULL);
structure =
gst_structure_new_id (GST_QUARK (MESSAGE_STREAMS_SELECTED),
GST_QUARK (COLLECTION), GST_TYPE_STREAM_COLLECTION, collection, NULL);
gst_structure_new_static_str ("GstMessageStreamsSelected",
"collection", GST_TYPE_STREAM_COLLECTION, collection, NULL);
g_value_init (&val, GST_TYPE_ARRAY);
gst_structure_id_take_value (structure, GST_QUARK (STREAMS), &val);
message =
@ -3250,7 +3242,7 @@ gst_message_new_redirect (GstObject * src, const gchar * location,
g_value_init (&entry_taglists_gvalue, GST_TYPE_LIST);
g_value_init (&entry_structures_gvalue, GST_TYPE_LIST);
structure = gst_structure_new_id_empty (GST_QUARK (MESSAGE_REDIRECT));
structure = gst_structure_new_static_str_empty ("GstMessageRedirect");
gst_structure_id_take_value (structure, GST_QUARK (REDIRECT_ENTRY_LOCATIONS),
&entry_locations_gvalue);
gst_structure_id_take_value (structure, GST_QUARK (REDIRECT_ENTRY_TAGLISTS),
@ -3461,8 +3453,8 @@ gst_message_new_instant_rate_request (GstObject * src, gdouble rate_multiplier)
g_return_val_if_fail (rate_multiplier != 0.0, NULL);
structure = gst_structure_new_id (GST_QUARK (MESSAGE_INSTANT_RATE_REQUEST),
GST_QUARK (RATE), G_TYPE_DOUBLE, rate_multiplier, NULL);
structure = gst_structure_new_static_str ("GstMessageInstantRateRequest",
"rate", G_TYPE_DOUBLE, rate_multiplier, NULL);
message =
gst_message_new_custom (GST_MESSAGE_INSTANT_RATE_REQUEST, src, structure);

View file

@ -5346,7 +5346,7 @@ store_sticky_event (GstPad * pad, GstEvent * event)
GstEventType type;
GArray *events;
gboolean res = FALSE;
GQuark name_id = 0;
const gchar *name = NULL;
gboolean insert = TRUE;
type = GST_EVENT_TYPE (event);
@ -5375,7 +5375,7 @@ store_sticky_event (GstPad * pad, GstEvent * event)
goto eos;
if (type & GST_EVENT_TYPE_STICKY_MULTI)
name_id = gst_structure_get_name_id (gst_event_get_structure (event));
name = gst_structure_get_name (gst_event_get_structure (event));
events = pad->priv->events;
len = events->len;
@ -5388,7 +5388,7 @@ store_sticky_event (GstPad * pad, GstEvent * event)
if (type == GST_EVENT_TYPE (ev->event)) {
/* matching types, check matching name if needed */
if (name_id && !gst_event_has_name_id (ev->event, name_id))
if (name && !gst_event_has_name (ev->event, name))
continue;
/* overwrite */

View file

@ -237,9 +237,9 @@ gst_query_new_position (GstFormat format)
GstQuery *query;
GstStructure *structure;
structure = gst_structure_new_id (GST_QUARK (QUERY_POSITION),
GST_QUARK (FORMAT), GST_TYPE_FORMAT, format,
GST_QUARK (CURRENT), G_TYPE_INT64, G_GINT64_CONSTANT (-1), NULL);
structure = gst_structure_new_static_str ("GstQueryPosition",
"format", GST_TYPE_FORMAT, format,
"current", G_TYPE_INT64, G_GINT64_CONSTANT (-1), NULL);
query = gst_query_new_custom (GST_QUERY_POSITION, structure);
@ -316,9 +316,9 @@ gst_query_new_duration (GstFormat format)
GstQuery *query;
GstStructure *structure;
structure = gst_structure_new_id (GST_QUARK (QUERY_DURATION),
GST_QUARK (FORMAT), GST_TYPE_FORMAT, format,
GST_QUARK (DURATION), G_TYPE_INT64, G_GINT64_CONSTANT (-1), NULL);
structure = gst_structure_new_static_str ("GstQueryDuration",
"format", GST_TYPE_FORMAT, format,
"duration", G_TYPE_INT64, G_GINT64_CONSTANT (-1), NULL);
query = gst_query_new_custom (GST_QUERY_DURATION, structure);
@ -393,10 +393,10 @@ gst_query_new_latency (void)
GstQuery *query;
GstStructure *structure;
structure = gst_structure_new_id (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, GST_CLOCK_TIME_NONE, NULL);
structure = gst_structure_new_static_str ("GstQueryLatency",
"live", G_TYPE_BOOLEAN, FALSE,
"min-latency", G_TYPE_UINT64, G_GUINT64_CONSTANT (0),
"max-latency", G_TYPE_UINT64, GST_CLOCK_TIME_NONE, NULL);
query = gst_query_new_custom (GST_QUERY_LATENCY, structure);
@ -479,11 +479,11 @@ gst_query_new_convert (GstFormat src_format, gint64 value,
GstQuery *query;
GstStructure *structure;
structure = gst_structure_new_id (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,
GST_QUARK (DEST_VALUE), G_TYPE_INT64, G_GINT64_CONSTANT (-1), NULL);
structure = gst_structure_new_static_str ("GstQueryConvert",
"src_format", GST_TYPE_FORMAT, src_format,
"src_value", G_TYPE_INT64, value,
"dest_format", GST_TYPE_FORMAT, dest_format,
"dest_value", G_TYPE_INT64, G_GINT64_CONSTANT (-1), NULL);
query = gst_query_new_custom (GST_QUERY_CONVERT, structure);
@ -573,11 +573,11 @@ gst_query_new_segment (GstFormat format)
GstQuery *query;
GstStructure *structure;
structure = gst_structure_new_id (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),
GST_QUARK (STOP_VALUE), G_TYPE_INT64, G_GINT64_CONSTANT (-1), NULL);
structure = gst_structure_new_static_str ("GstQuerySegment",
"rate", G_TYPE_DOUBLE, (gdouble) 0.0,
"format", GST_TYPE_FORMAT, format,
"start_value", G_TYPE_INT64, G_GINT64_CONSTANT (-1),
"stop_value", G_TYPE_INT64, G_GINT64_CONSTANT (-1), NULL);
query = gst_query_new_custom (GST_QUERY_SEGMENT, structure);
@ -745,8 +745,8 @@ gst_query_writable_structure (GstQuery * query)
if (structure == NULL) {
structure =
gst_structure_new_id_empty (gst_query_type_to_quark (GST_QUERY_TYPE
(query)));
gst_structure_new_static_str_empty (gst_query_type_get_name
(GST_QUERY_TYPE (query)));
gst_structure_set_parent_refcount (structure, &query->mini_object.refcount);
GST_QUERY_STRUCTURE (query) = structure;
}
@ -770,11 +770,11 @@ gst_query_new_seeking (GstFormat format)
GstQuery *query;
GstStructure *structure;
structure = gst_structure_new_id (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),
GST_QUARK (SEGMENT_END), G_TYPE_INT64, G_GINT64_CONSTANT (-1), NULL);
structure = gst_structure_new_static_str ("GstQuerySeeking",
"format", GST_TYPE_FORMAT, format,
"seekable", G_TYPE_BOOLEAN, FALSE,
"segment-start", G_TYPE_INT64, G_GINT64_CONSTANT (-1),
"segment-end", G_TYPE_INT64, G_GINT64_CONSTANT (-1), NULL);
query = gst_query_new_custom (GST_QUERY_SEEKING, structure);
@ -886,7 +886,7 @@ gst_query_new_formats (void)
GstQuery *query;
GstStructure *structure;
structure = gst_structure_new_id_empty (GST_QUARK (QUERY_FORMATS));
structure = gst_structure_new_static_str_empty ("GstQueryFormats");
query = gst_query_new_custom (GST_QUERY_FORMATS, structure);
return query;
@ -1048,17 +1048,17 @@ gst_query_new_buffering (GstFormat format)
/* by default, we configure the answer as no buffering with a 100% buffering
* progress */
structure = gst_structure_new_id (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,
GST_QUARK (AVG_IN_RATE), G_TYPE_INT, -1,
GST_QUARK (AVG_OUT_RATE), G_TYPE_INT, -1,
GST_QUARK (BUFFERING_LEFT), G_TYPE_INT64, G_GINT64_CONSTANT (0),
GST_QUARK (ESTIMATED_TOTAL), G_TYPE_INT64, G_GINT64_CONSTANT (-1),
GST_QUARK (FORMAT), GST_TYPE_FORMAT, format,
GST_QUARK (START_VALUE), G_TYPE_INT64, G_GINT64_CONSTANT (-1),
GST_QUARK (STOP_VALUE), G_TYPE_INT64, G_GINT64_CONSTANT (-1), NULL);
structure = gst_structure_new_static_str ("GstQueryBuffering",
"busy", G_TYPE_BOOLEAN, FALSE,
"buffer-percent", G_TYPE_INT, 100,
"buffering-mode", GST_TYPE_BUFFERING_MODE, GST_BUFFERING_STREAM,
"avg-in-rate", G_TYPE_INT, -1,
"avg-out-rate", G_TYPE_INT, -1,
"buffering-left", G_TYPE_INT64, G_GINT64_CONSTANT (0),
"estimated-total", G_TYPE_INT64, G_GINT64_CONSTANT (-1),
"format", GST_TYPE_FORMAT, format,
"start_value", G_TYPE_INT64, G_GINT64_CONSTANT (-1),
"stop_value", G_TYPE_INT64, G_GINT64_CONSTANT (-1), NULL);
query = gst_query_new_custom (GST_QUERY_BUFFERING, structure);
@ -1378,8 +1378,8 @@ gst_query_new_uri (void)
GstQuery *query;
GstStructure *structure;
structure = gst_structure_new_id (GST_QUARK (QUERY_URI),
GST_QUARK (URI), G_TYPE_STRING, NULL, NULL);
structure = gst_structure_new_static_str ("GstQueryURI",
"uri", G_TYPE_STRING, NULL, NULL);
query = gst_query_new_custom (GST_QUERY_URI, structure);
@ -1546,9 +1546,9 @@ gst_query_new_allocation (GstCaps * caps, gboolean need_pool)
GstQuery *query;
GstStructure *structure;
structure = gst_structure_new_id (GST_QUARK (QUERY_ALLOCATION),
GST_QUARK (CAPS), GST_TYPE_CAPS, caps,
GST_QUARK (NEED_POOL), G_TYPE_BOOLEAN, need_pool, NULL);
structure = gst_structure_new_static_str ("GstQueryAllocation",
"caps", GST_TYPE_CAPS, caps,
"need-pool", G_TYPE_BOOLEAN, need_pool, NULL);
query = gst_query_new_custom (GST_QUERY_ALLOCATION, structure);
@ -2123,11 +2123,10 @@ gst_query_new_scheduling (void)
GstQuery *query;
GstStructure *structure;
structure = gst_structure_new_id (GST_QUARK (QUERY_SCHEDULING),
GST_QUARK (FLAGS), GST_TYPE_SCHEDULING_FLAGS, 0,
GST_QUARK (MINSIZE), G_TYPE_INT, 1,
GST_QUARK (MAXSIZE), G_TYPE_INT, -1,
GST_QUARK (ALIGN), G_TYPE_INT, 0, NULL);
structure = gst_structure_new_static_str ("GstQueryScheduling",
"flags", GST_TYPE_SCHEDULING_FLAGS, 0,
"minsize", G_TYPE_INT, 1,
"maxsize", G_TYPE_INT, -1, "align", G_TYPE_INT, 0, NULL);
query = gst_query_new_custom (GST_QUERY_SCHEDULING, structure);
return query;
@ -2340,9 +2339,8 @@ gst_query_new_accept_caps (GstCaps * caps)
g_return_val_if_fail (gst_caps_is_fixed (caps), NULL);
structure = gst_structure_new_id (GST_QUARK (QUERY_ACCEPT_CAPS),
GST_QUARK (CAPS), GST_TYPE_CAPS, caps,
GST_QUARK (RESULT), G_TYPE_BOOLEAN, FALSE, NULL);
structure = gst_structure_new_static_str ("GstQueryAcceptCaps",
"caps", GST_TYPE_CAPS, caps, "result", G_TYPE_BOOLEAN, FALSE, NULL);
query = gst_query_new_custom (GST_QUERY_ACCEPT_CAPS, structure);
return query;
@ -2441,9 +2439,8 @@ gst_query_new_caps (GstCaps * filter)
GstQuery *query;
GstStructure *structure;
structure = gst_structure_new_id (GST_QUARK (QUERY_CAPS),
GST_QUARK (FILTER), GST_TYPE_CAPS, filter,
GST_QUARK (CAPS), GST_TYPE_CAPS, NULL, NULL);
structure = gst_structure_new_static_str ("GstQueryCaps",
"filter", GST_TYPE_CAPS, filter, "caps", GST_TYPE_CAPS, NULL, NULL);
query = gst_query_new_custom (GST_QUERY_CAPS, structure);
return query;
@ -2539,7 +2536,7 @@ gst_query_new_drain (void)
GstQuery *query;
GstStructure *structure;
structure = gst_structure_new_id_empty (GST_QUARK (QUERY_DRAIN));
structure = gst_structure_new_static_str_empty ("GstQueryDrain");
query = gst_query_new_custom (GST_QUERY_DRAIN, structure);
return query;
@ -2565,8 +2562,8 @@ gst_query_new_context (const gchar * context_type)
g_return_val_if_fail (context_type != NULL, NULL);
structure = gst_structure_new_id (GST_QUARK (QUERY_CONTEXT),
GST_QUARK (CONTEXT_TYPE), G_TYPE_STRING, context_type, NULL);
structure = gst_structure_new_static_str ("GstQueryContext",
"context-type", G_TYPE_STRING, context_type, NULL);
query = gst_query_new_custom (GST_QUERY_CONTEXT, structure);
return query;
@ -2672,7 +2669,7 @@ gst_query_new_bitrate (void)
GstQuery *query;
GstStructure *structure;
structure = gst_structure_new_id_empty (GST_QUARK (QUERY_BITRATE));
structure = gst_structure_new_static_str_empty ("GstQueryBitrate");
query = gst_query_new_custom (GST_QUERY_BITRATE, structure);
return query;
@ -2744,7 +2741,7 @@ gst_query_new_selectable (void)
GstQuery *query;
GstStructure *structure;
structure = gst_structure_new_id_empty (GST_QUARK (QUERY_SELECTABLE));
structure = gst_structure_new_static_str_empty ("GstQuerySelectable");
query = gst_query_new_custom (GST_QUERY_SELECTABLE, structure);
return query;

View file

@ -2893,18 +2893,18 @@ gst_value_serialize_segment_internal (const GValue * value, gboolean escape)
gchar *t, *res;
GstStructure *s;
s = gst_structure_new_id (GST_QUARK (SEGMENT),
GST_QUARK (FLAGS), GST_TYPE_SEGMENT_FLAGS, seg->flags,
GST_QUARK (RATE), G_TYPE_DOUBLE, seg->rate,
GST_QUARK (APPLIED_RATE), G_TYPE_DOUBLE, seg->applied_rate,
GST_QUARK (FORMAT), GST_TYPE_FORMAT, seg->format,
GST_QUARK (BASE), G_TYPE_UINT64, seg->base,
GST_QUARK (OFFSET), G_TYPE_UINT64, seg->offset,
GST_QUARK (START), G_TYPE_UINT64, seg->start,
GST_QUARK (STOP), G_TYPE_UINT64, seg->stop,
GST_QUARK (TIME), G_TYPE_UINT64, seg->time,
GST_QUARK (POSITION), G_TYPE_UINT64, seg->position,
GST_QUARK (DURATION), G_TYPE_UINT64, seg->duration, NULL);
s = gst_structure_new_static_str ("segment",
"flags", GST_TYPE_SEGMENT_FLAGS, seg->flags,
"rate", G_TYPE_DOUBLE, seg->rate,
"applied-rate", G_TYPE_DOUBLE, seg->applied_rate,
"format", GST_TYPE_FORMAT, seg->format,
"base", G_TYPE_UINT64, seg->base,
"offset", G_TYPE_UINT64, seg->offset,
"start", G_TYPE_UINT64, seg->start,
"stop", G_TYPE_UINT64, seg->stop,
"time", G_TYPE_UINT64, seg->time,
"position", G_TYPE_UINT64, seg->position,
"duration", G_TYPE_UINT64, seg->duration, NULL);
t = gst_structure_to_string (s);
if (escape) {
@ -8051,11 +8051,11 @@ gst_value_transform_allocation_params_string (const GValue * value1,
gchar *res;
GstStructure *s;
s = gst_structure_new_id (GST_QUARK (ALLOCATION_PARAMS),
GST_QUARK (FLAGS), GST_TYPE_MEMORY_FLAGS, params->flags,
GST_QUARK (ALIGN), G_TYPE_UINT64, params->align,
GST_QUARK (PREFIX), G_TYPE_UINT64, params->prefix,
GST_QUARK (PADDING), G_TYPE_UINT64, params->padding, NULL);
s = gst_structure_new_static_str ("GstAllocationParams",
"flags", GST_TYPE_MEMORY_FLAGS, params->flags,
"align", G_TYPE_UINT64, params->align,
"prefix", G_TYPE_UINT64, params->prefix,
"padding", G_TYPE_UINT64, params->padding, NULL);
res = gst_structure_to_string (s);
gst_structure_free (s);

View file

@ -253,11 +253,11 @@ send_latency_probe (GstLatencyTracer * self, GstElement * parent, GstPad * pad,
pad_name = gst_pad_get_name (pad);
latency_probe = gst_event_new_custom (GST_EVENT_CUSTOM_DOWNSTREAM,
gst_structure_new_id (latency_probe_id,
latency_probe_element_id, G_TYPE_STRING, element_id,
latency_probe_element, G_TYPE_STRING, element_name,
latency_probe_pad, G_TYPE_STRING, pad_name,
latency_probe_ts, G_TYPE_UINT64, ts, NULL));
gst_structure_new_static_str ("latency_probe.id",
"latency_probe.element_id", G_TYPE_STRING, element_id,
"latency_probe.element", G_TYPE_STRING, element_name,
"latency_probe.pad", G_TYPE_STRING, pad_name,
"latency_probe.ts", G_TYPE_UINT64, ts, NULL));
GST_DEBUG ("%s_%s: Sending latency event %p", GST_DEBUG_PAD_NAME (pad),
latency_probe);
@ -275,11 +275,11 @@ send_latency_probe (GstLatencyTracer * self, GstElement * parent, GstPad * pad,
pad_name = gst_pad_get_name (peer_pad);
latency_probe = gst_event_new_custom (GST_EVENT_CUSTOM_DOWNSTREAM,
gst_structure_new_id (sub_latency_probe_id,
latency_probe_element_id, G_TYPE_STRING, element_id,
latency_probe_element, G_TYPE_STRING, element_name,
latency_probe_pad, G_TYPE_STRING, pad_name,
latency_probe_ts, G_TYPE_UINT64, ts, NULL));
gst_structure_new_static_str ("sub_latency_probe.id",
"latency_probe.element_id", G_TYPE_STRING, element_id,
"latency_probe.element", G_TYPE_STRING, element_name,
"latency_probe.pad", G_TYPE_STRING, pad_name,
"latency_probe.ts", G_TYPE_UINT64, ts, NULL));
GST_DEBUG ("%s_%s: Sending sub-latency event %p",
GST_DEBUG_PAD_NAME (pad), latency_probe);
@ -378,7 +378,7 @@ do_drop_sub_latency_event (GstPad * pad, GstPadProbeInfo * info,
if (GST_EVENT_TYPE (ev) == GST_EVENT_CUSTOM_DOWNSTREAM) {
const GstStructure *data = gst_event_get_structure (ev);
if (gst_structure_get_name_id (data) == sub_latency_probe_id) {
if (gst_structure_has_name (data, "sub_latency_probe.id")) {
GstPad *peer_pad = gst_pad_get_peer (pad);
GstElement *peer_parent = get_real_pad_parent (peer_pad);
const GValue *value;
@ -427,8 +427,7 @@ do_push_event_pre (GstTracer * self, guint64 ts, GstPad * pad, GstEvent * ev)
/* if not set yet, add a pad probe that prevents sub-latency event from
* flowing further */
if (gst_structure_get_name_id (data) == latency_probe_id) {
if (gst_structure_has_name (data, "latency_probe.id")) {
if (!g_object_get_qdata ((GObject *) pad, drop_sub_latency_quark)) {
GST_DEBUG ("%s_%s: Adding pad probe to drop sub-latency event",
GST_DEBUG_PAD_NAME (pad));
@ -447,7 +446,7 @@ do_push_event_pre (GstTracer * self, guint64 ts, GstPad * pad, GstEvent * ev)
}
}
if (gst_structure_get_name_id (data) == sub_latency_probe_id) {
if (gst_structure_has_name (data, "sub_latency_probe.id")) {
const GValue *value;
gchar *element_id = g_strdup_printf ("%p", peer_parent);
gchar *pad_name = peer_pad ? gst_pad_get_name (peer_pad) : NULL;
@ -615,42 +614,42 @@ gst_latency_tracer_class_init (GstLatencyTracerClass * klass)
/* announce trace formats */
/* *INDENT-OFF* */
tr_latency = gst_tracer_record_new ("latency.class",
"src-element-id", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"src-element-id", GST_TYPE_STRUCTURE, gst_structure_new_static_str ("scope",
"type", G_TYPE_GTYPE, G_TYPE_STRING,
"related-to", GST_TYPE_TRACER_VALUE_SCOPE,
GST_TRACER_VALUE_SCOPE_ELEMENT,
NULL),
"src-element", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"src-element", GST_TYPE_STRUCTURE, gst_structure_new_static_str ("scope",
"type", G_TYPE_GTYPE, G_TYPE_STRING,
"related-to", GST_TYPE_TRACER_VALUE_SCOPE,
GST_TRACER_VALUE_SCOPE_ELEMENT,
NULL),
"src", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"src", GST_TYPE_STRUCTURE, gst_structure_new_static_str ("scope",
"type", G_TYPE_GTYPE, G_TYPE_STRING,
"related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_PAD,
NULL),
"sink-element-id", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"sink-element-id", GST_TYPE_STRUCTURE, gst_structure_new_static_str ("scope",
"type", G_TYPE_GTYPE, G_TYPE_STRING,
"related-to", GST_TYPE_TRACER_VALUE_SCOPE,
GST_TRACER_VALUE_SCOPE_ELEMENT,
NULL),
"sink-element", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"sink-element", GST_TYPE_STRUCTURE, gst_structure_new_static_str ("scope",
"type", G_TYPE_GTYPE, G_TYPE_STRING,
"related-to", GST_TYPE_TRACER_VALUE_SCOPE,
GST_TRACER_VALUE_SCOPE_ELEMENT,
NULL),
"sink", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"sink", GST_TYPE_STRUCTURE, gst_structure_new_static_str ("scope",
"type", G_TYPE_GTYPE, G_TYPE_STRING,
"related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_PAD,
NULL),
"time", GST_TYPE_STRUCTURE, gst_structure_new ("value",
"time", GST_TYPE_STRUCTURE, gst_structure_new_static_str ("value",
"type", G_TYPE_GTYPE, G_TYPE_UINT64,
"description", G_TYPE_STRING,
"time it took for the buffer to go from src to sink ns",
"min", G_TYPE_UINT64, G_GUINT64_CONSTANT (0),
"max", G_TYPE_UINT64, G_MAXUINT64,
NULL),
"ts", GST_TYPE_STRUCTURE, gst_structure_new ("value",
"ts", GST_TYPE_STRUCTURE, gst_structure_new_static_str ("value",
"type", G_TYPE_GTYPE, G_TYPE_UINT64,
"description", G_TYPE_STRING, "ts when the latency has been logged",
"min", G_TYPE_UINT64, G_GUINT64_CONSTANT (0),
@ -659,28 +658,28 @@ gst_latency_tracer_class_init (GstLatencyTracerClass * klass)
NULL);
tr_element_latency = gst_tracer_record_new ("element-latency.class",
"element-id", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"element-id", GST_TYPE_STRUCTURE, gst_structure_new_static_str ("scope",
"type", G_TYPE_GTYPE, G_TYPE_STRING,
"related-to", GST_TYPE_TRACER_VALUE_SCOPE,
GST_TRACER_VALUE_SCOPE_ELEMENT,
NULL),
"element", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"element", GST_TYPE_STRUCTURE, gst_structure_new_static_str ("scope",
"type", G_TYPE_GTYPE, G_TYPE_STRING,
"related-to", GST_TYPE_TRACER_VALUE_SCOPE,
GST_TRACER_VALUE_SCOPE_ELEMENT,
NULL),
"src", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"src", GST_TYPE_STRUCTURE, gst_structure_new_static_str ("scope",
"type", G_TYPE_GTYPE, G_TYPE_STRING,
"related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_PAD,
NULL),
"time", GST_TYPE_STRUCTURE, gst_structure_new ("value",
"time", GST_TYPE_STRUCTURE, gst_structure_new_static_str ("value",
"type", G_TYPE_GTYPE, G_TYPE_UINT64,
"description", G_TYPE_STRING,
"time it took for the buffer to go from src to sink ns",
"min", G_TYPE_UINT64, G_GUINT64_CONSTANT (0),
"max", G_TYPE_UINT64, G_MAXUINT64,
NULL),
"ts", GST_TYPE_STRUCTURE, gst_structure_new ("value",
"ts", GST_TYPE_STRUCTURE, gst_structure_new_static_str ("value",
"type", G_TYPE_GTYPE, G_TYPE_UINT64,
"description", G_TYPE_STRING, "ts when the latency has been logged",
"min", G_TYPE_UINT64, G_GUINT64_CONSTANT (0),
@ -691,35 +690,35 @@ gst_latency_tracer_class_init (GstLatencyTracerClass * klass)
tr_element_reported_latency = gst_tracer_record_new (
"element-reported-latency.class",
"element-id", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"element-id", GST_TYPE_STRUCTURE, gst_structure_new_static_str ("scope",
"type", G_TYPE_GTYPE, G_TYPE_STRING,
"related-to", GST_TYPE_TRACER_VALUE_SCOPE,
GST_TRACER_VALUE_SCOPE_ELEMENT,
NULL),
"element", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"element", GST_TYPE_STRUCTURE, gst_structure_new_static_str ("scope",
"type", G_TYPE_GTYPE, G_TYPE_STRING,
"related-to", GST_TYPE_TRACER_VALUE_SCOPE,
GST_TRACER_VALUE_SCOPE_ELEMENT,
NULL),
"live", GST_TYPE_STRUCTURE, gst_structure_new ("value",
"live", GST_TYPE_STRUCTURE, gst_structure_new_static_str ("value",
"type", G_TYPE_GTYPE, G_TYPE_BOOLEAN,
"description", G_TYPE_STRING,
"wether the it is a live stream or not",
NULL),
"min", GST_TYPE_STRUCTURE, gst_structure_new ("value",
"min", GST_TYPE_STRUCTURE, gst_structure_new_static_str ("value",
"type", G_TYPE_GTYPE, G_TYPE_UINT64,
"description", G_TYPE_STRING,
"the minimum reported latency",
"min", G_TYPE_UINT64, G_GUINT64_CONSTANT (0),
"max", G_TYPE_UINT64, G_MAXUINT64,
NULL),
"max", GST_TYPE_STRUCTURE, gst_structure_new ("value",
"max", GST_TYPE_STRUCTURE, gst_structure_new_static_str ("value",
"type", G_TYPE_GTYPE, G_TYPE_UINT64,
"description", G_TYPE_STRING, "the maximum reported latency",
"min", G_TYPE_UINT64, G_GUINT64_CONSTANT (0),
"max", G_TYPE_UINT64, G_MAXUINT64,
NULL),
"ts", GST_TYPE_STRUCTURE, gst_structure_new ("value",
"ts", GST_TYPE_STRUCTURE, gst_structure_new_static_str ("value",
"type", G_TYPE_GTYPE, G_TYPE_UINT64,
"description", G_TYPE_STRING, "ts when the latency has been reported",
"min", G_TYPE_UINT64, G_GUINT64_CONSTANT (0),