client-source: set format on client source

Set the format on the client source when it is created so that other
clients can inspect the format. It also makes client sources show up in
the device monitor.
This commit is contained in:
Wim Taymans 2015-07-14 11:34:59 +02:00
parent 81b7f15a0c
commit 1fec75d2a5
5 changed files with 109 additions and 20 deletions

View file

@ -230,7 +230,9 @@ handle_create_source_input (PinosClient1 *interface,
if (g_strcmp0 (pinos_client_get_sender (client), sender) != 0)
goto not_allowed;
source = pinos_client_source_new (priv->daemon);
formats = g_bytes_new (arg_possible_formats, strlen (arg_possible_formats) + 1);
source = pinos_client_source_new (priv->daemon, formats);
if (source == NULL)
goto no_source;
@ -241,7 +243,6 @@ handle_create_source_input (PinosClient1 *interface,
sender = g_dbus_method_invocation_get_sender (invocation);
formats = g_bytes_new (arg_possible_formats, strlen (arg_possible_formats) + 1);
input = pinos_client_source_get_source_input (PINOS_CLIENT_SOURCE (source),
priv->object_path,
@ -277,6 +278,7 @@ no_source:
{
g_dbus_method_invocation_return_dbus_error (invocation,
"org.pinos.Error", "Can't create source");
g_bytes_unref (formats);
return TRUE;
}
no_input: