update DBus object with current format

Detect a format change in the payloader and post an element message.
Catch the format change element message in the client-source and use it
to update the format and possible formats in the source and source-outputs.
This commit is contained in:
Wim Taymans 2016-04-11 16:06:54 +02:00
parent 44f2c3602d
commit 45976ffeda
5 changed files with 57 additions and 0 deletions

View file

@ -115,6 +115,26 @@ bus_handler (GstBus *bus,
gst_element_set_state (priv->pipeline, GST_STATE_NULL);
break;
}
case GST_MESSAGE_ELEMENT:
{
if (gst_message_has_name (message, "PinosPayloaderFormatChange")) {
const GstStructure *str = gst_message_get_structure (message);
GstCaps *caps;
GBytes *format;
gchar *caps_str;
gst_structure_get (str, "format", GST_TYPE_CAPS, &caps, NULL);
gst_caps_replace (&priv->format, caps);
caps_str = gst_caps_to_string (caps);
format = g_bytes_new_take (caps_str, strlen (caps_str) + 1);
g_object_set (priv->input, "possible-formats", format, "format", format, NULL);
pinos_source_update_possible_formats (source, format);
pinos_source_update_format (source, format);
g_bytes_unref (format);
}
break;
}
default:
break;
}