output: send output properties in start

Also send the output properties in start, along with the format.
This commit is contained in:
Wim Taymans 2015-08-21 11:45:38 +02:00
parent 104632ea7a
commit e9c72a6102
3 changed files with 19 additions and 8 deletions

View file

@ -869,7 +869,7 @@ on_stream_started (GObject *source_object,
gint fd_idx, fd; gint fd_idx, fd;
gchar *format; gchar *format;
GError *error = NULL; GError *error = NULL;
GVariant *result; GVariant *result, *properties;
result = g_dbus_proxy_call_with_unix_fd_list_finish (priv->source_output, result = g_dbus_proxy_call_with_unix_fd_list_finish (priv->source_output,
&out_fd_list, &out_fd_list,
@ -879,18 +879,25 @@ on_stream_started (GObject *source_object,
goto start_failed; goto start_failed;
g_variant_get (result, g_variant_get (result,
"(hs)", "(hs@a{sv})",
&fd_idx, &fd_idx,
&format); &format,
&properties);
g_variant_unref (result); g_variant_unref (result);
if (priv->format) if (priv->format)
g_bytes_unref (priv->format); g_bytes_unref (priv->format);
priv->format = g_bytes_new (format, strlen (format) + 1); priv->format = g_bytes_new_take (format, strlen (format) + 1);
g_object_notify (G_OBJECT (stream), "format"); g_object_notify (G_OBJECT (stream), "format");
if (priv->properties)
pinos_properties_free (priv->properties);
priv->properties = pinos_properties_from_variant (properties);
g_variant_unref (properties);
g_object_notify (G_OBJECT (stream), "properties");
if ((fd = g_unix_fd_list_get (out_fd_list, fd_idx, &error)) < 0) if ((fd = g_unix_fd_list_get (out_fd_list, fd_idx, &error)) < 0)
goto fd_failed; goto fd_failed;

View file

@ -143,16 +143,19 @@
@requested_format: requested formats @requested_format: requested formats
@fd: output file descriptor @fd: output file descriptor
@format: output format @format: output format
@properties: output properties
Start the datatransfer of the source with @requested_format. Start the datatransfer of the source with @requested_format.
The result is a file descriptor that can be used to get metadata The result is a file descriptor that can be used to get metadata
and media. @format contains the final media format. and media. @format contains the final media format and @properties
the extra properties that describe the media format.
--> -->
<method name='Start'> <method name='Start'>
<arg type='s' name='requested_format' direction='in'/> <arg type='s' name='requested_format' direction='in'/>
<arg type='h' name='fd' direction='out'/> <arg type='h' name='fd' direction='out'/>
<arg type='s' name='format' direction='out'/> <arg type='s' name='format' direction='out'/>
<arg type='a{sv}' name='properties' direction='out'/>
</method> </method>
<!-- Stop: <!-- Stop:

View file

@ -215,9 +215,10 @@ handle_start (PinosSourceOutput1 *interface,
g_unix_fd_list_append (fdlist, fd[1], NULL); g_unix_fd_list_append (fdlist, fd[1], NULL);
g_dbus_method_invocation_return_value_with_unix_fd_list (invocation, g_dbus_method_invocation_return_value_with_unix_fd_list (invocation,
g_variant_new ("(hs)", g_variant_new ("(hs@a{sv})",
0, 0,
g_bytes_get_data (priv->format, NULL)), g_bytes_get_data (priv->format, NULL),
pinos_properties_to_variant (priv->properties)),
fdlist); fdlist);
g_object_set (priv->iface, g_object_set (priv->iface,