case GST_MESSAGE_ELEMENT:
{
- GQuark sttype = gst_structure_get_name_id (msg->structure);
+ 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, msg->structure);
+ "structure %" GST_PTR_FORMAT, structure);
if (sttype == _MISSING_PLUGIN_QUARK) {
GST_DEBUG_OBJECT (GST_MESSAGE_SRC (msg),
"Setting result to MISSING_PLUGINS");
dc->priv->current_info->result = GST_DISCOVERER_MISSING_PLUGINS;
- dc->priv->current_info->misc = gst_structure_copy (msg->structure);
+ dc->priv->current_info->misc = gst_structure_copy (structure);
} else if (sttype == _STREAM_TOPOLOGY_QUARK) {
- dc->priv->current_topology = gst_structure_copy (msg->structure);
+ dc->priv->current_topology = gst_structure_copy (structure);
}
}
break;
GString *str = NULL;
gchar *detail = NULL;
gchar *desc;
+ const GstStructure *structure;
g_return_val_if_fail (gst_is_missing_plugin_message (msg), NULL);
- GST_LOG ("Parsing missing-plugin message: %" GST_PTR_FORMAT, msg->structure);
+ structure = gst_message_get_structure (msg);
+ GST_LOG ("Parsing missing-plugin message: %" GST_PTR_FORMAT, structure);
- missing_type = missing_structure_get_type (msg->structure);
+ missing_type = missing_structure_get_type (structure);
if (missing_type == GST_MISSING_TYPE_UNKNOWN) {
GST_WARNING ("couldn't parse 'type' field");
goto error;
}
- type = gst_structure_get_string (msg->structure, "type");
+ type = gst_structure_get_string (structure, "type");
g_assert (type != NULL); /* validity already checked above */
/* FIXME: use gst_installer_detail_new() here too */
case GST_MISSING_TYPE_URISOURCE:
case GST_MISSING_TYPE_URISINK:
case GST_MISSING_TYPE_ELEMENT:
- if (!missing_structure_get_string_detail (msg->structure, &detail))
+ if (!missing_structure_get_string_detail (structure, &detail))
goto error;
break;
case GST_MISSING_TYPE_DECODER:
case GST_MISSING_TYPE_ENCODER:{
GstCaps *caps = NULL;
- if (!missing_structure_get_caps_detail (msg->structure, &caps))
+ if (!missing_structure_get_caps_detail (structure, &caps))
goto error;
detail = gst_caps_to_string (caps);
GstMissingType missing_type;
const gchar *desc;
gchar *ret = NULL;
+ const GstStructure *structure;
g_return_val_if_fail (gst_is_missing_plugin_message (msg), NULL);
- GST_LOG ("Parsing missing-plugin message: %" GST_PTR_FORMAT, msg->structure);
+ structure = gst_message_get_structure (msg);
+ GST_LOG ("Parsing missing-plugin message: %" GST_PTR_FORMAT, structure);
- desc = gst_structure_get_string (msg->structure, "name");
+ desc = gst_structure_get_string (structure, "name");
if (desc != NULL && *desc != '\0') {
ret = g_strdup (desc);
goto done;
}
/* fallback #1 */
- missing_type = missing_structure_get_type (msg->structure);
+ missing_type = missing_structure_get_type (structure);
switch (missing_type) {
case GST_MISSING_TYPE_URISOURCE:
case GST_MISSING_TYPE_ELEMENT:{
gchar *detail = NULL;
- if (missing_structure_get_string_detail (msg->structure, &detail)) {
+ if (missing_structure_get_string_detail (structure, &detail)) {
if (missing_type == GST_MISSING_TYPE_URISOURCE)
ret = gst_pb_utils_get_source_description (detail);
else if (missing_type == GST_MISSING_TYPE_URISINK)
case GST_MISSING_TYPE_ENCODER:{
GstCaps *caps = NULL;
- if (missing_structure_get_caps_detail (msg->structure, &caps)) {
+ if (missing_structure_get_caps_detail (structure, &caps)) {
if (missing_type == GST_MISSING_TYPE_DECODER)
ret = gst_pb_utils_get_decoder_description (caps);
else
gboolean
gst_is_missing_plugin_message (GstMessage * msg)
{
+ const GstStructure *structure;
+
g_return_val_if_fail (msg != NULL, FALSE);
g_return_val_if_fail (GST_IS_MESSAGE (msg), FALSE);
- if (GST_MESSAGE_TYPE (msg) != GST_MESSAGE_ELEMENT || msg->structure == NULL)
+ structure = gst_message_get_structure (msg);
+ if (GST_MESSAGE_TYPE (msg) != GST_MESSAGE_ELEMENT || structure == NULL)
return FALSE;
- return gst_structure_has_name (msg->structure, "missing-plugin");
+ return gst_structure_has_name (structure, "missing-plugin");
}
/* takes ownership of the description */
guint size, i;
GstPlayBaseBin *playbasebin = GST_PLAY_BASE_BIN (playbin);
guint connection_speed = playbasebin->connection_speed;
+ const GstStructure *structure;
GST_DEBUG_OBJECT (playbin, "redirect message: %" GST_PTR_FORMAT, msg);
GST_DEBUG_OBJECT (playbin, "connection speed: %u", connection_speed);
- if (connection_speed == 0 || msg->structure == NULL)
+ structure = gst_message_get_structure (msg);
+ if (connection_speed == 0 || structure == NULL)
return msg;
- locations_list = gst_structure_get_value (msg->structure, "locations");
+ locations_list = gst_structure_get_value (structure, "locations");
if (locations_list == NULL)
return msg;
static void
gst_play_bin_handle_message (GstBin * bin, GstMessage * msg)
{
- if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_ELEMENT && msg->structure != NULL
- && gst_structure_has_name (msg->structure, "redirect")) {
+ const GstStructure *structure;
+
+ structure = gst_message_get_structure (msg);
+ if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_ELEMENT && structure != NULL
+ && gst_structure_has_name (structure, "redirect")) {
msg = gst_play_bin_handle_redirect_message (GST_PLAY_BIN (bin), msg);
}
GstMessage *message;
gst_event_parse_sink_message (event, &message);
- if (message->structure
- && gst_structure_has_name (message->structure,
- "playbin2-stream-changed")) {
+ if (gst_message_has_name (message, "playbin2-stream-changed")) {
GstStream *stream;
GST_STREAM_SYNCHRONIZER_LOCK (self);
GList *l_good = NULL, *l_neutral = NULL, *l_bad = NULL;
GValue new_list = { 0, };
guint size, i;
+ const GstStructure *structure;
GST_DEBUG_OBJECT (dec, "redirect message: %" GST_PTR_FORMAT, msg);
GST_DEBUG_OBJECT (dec, "connection speed: %u", dec->connection_speed);
- if (dec->connection_speed == 0 || msg->structure == NULL)
+ structure = gst_message_get_structure (msg);
+ if (dec->connection_speed == 0 || structure == NULL)
return msg;
- locations_list = gst_structure_get_value (msg->structure, "locations");
+ locations_list = gst_structure_get_value (structure, "locations");
if (locations_list == NULL)
return msg;
static void
handle_message (GstBin * bin, GstMessage * msg)
{
- if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_ELEMENT && msg->structure != NULL
- && gst_structure_has_name (msg->structure, "redirect")) {
+ if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_ELEMENT
+ && gst_message_has_name (msg, "redirect")) {
/* sort redirect messages based on the connection speed. This simplifies
* the user of this element as it can in most cases just pick the first item
* of the sorted list as a good redirection candidate. It can of course
if (strcmp (name, "not-mounted") == 0) {
GMountOperation *mop = gtk_mount_operation_new (NULL);
GFile *file =
- G_FILE (g_value_get_object (gst_structure_get_value
- (message->structure, "file")));
+ G_FILE (g_value_get_object (gst_structure_get_value (s, "file")));
g_print ("not-mounted\n");
gst_element_set_state (pipeline, GST_STATE_NULL);
bus_sync_handler (GstBus * bus, GstMessage * message, GstPipeline * data)
{
if ((GST_MESSAGE_TYPE (message) == GST_MESSAGE_ELEMENT) &&
- gst_structure_has_name (message->structure, "prepare-xwindow-id")) {
+ gst_message_has_name (message, "prepare-xwindow-id")) {
GstElement *element = GST_ELEMENT (GST_MESSAGE_SRC (message));
g_print ("got prepare-xwindow-id, setting XID %lu\n", embed_xid);
bus_sync_handler (GstBus * bus, GstMessage * message, GstPipeline * data)
{
if ((GST_MESSAGE_TYPE (message) == GST_MESSAGE_ELEMENT) &&
- gst_structure_has_name (message->structure, "prepare-xwindow-id")) {
+ gst_message_has_name (message, "prepare-xwindow-id")) {
GstElement *element = GST_ELEMENT (GST_MESSAGE_SRC (message));
g_print ("got prepare-xwindow-id, setting XID %lu\n", embed_xid);