mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-13 13:30:05 -05:00
add get_proxy_finish
Fix some compilation issues
This commit is contained in:
parent
0a9f79b675
commit
1b89f2f8ad
6 changed files with 47 additions and 22 deletions
|
|
@ -321,7 +321,6 @@ on_client_connected (GObject *source_object,
|
|||
g_variant_get (ret, "(o)", &priv->client_path);
|
||||
g_print ("got client %s\n", priv->client_path);
|
||||
g_variant_unref (ret);
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -138,6 +138,8 @@ handle_create_source_output (PvSource1 *interface,
|
|||
const gchar *object_path;
|
||||
|
||||
output = pv_source_create_source_output (source, arg_properties, priv->object_path);
|
||||
if (output == NULL)
|
||||
goto no_output;
|
||||
|
||||
object_path = pv_source_output_get_object_path (output);
|
||||
|
||||
|
|
@ -145,6 +147,14 @@ handle_create_source_output (PvSource1 *interface,
|
|||
invocation,
|
||||
object_path);
|
||||
return TRUE;
|
||||
|
||||
/* ERRORS */
|
||||
no_output:
|
||||
{
|
||||
g_dbus_method_invocation_return_dbus_error (invocation,
|
||||
"org.pulsevideo.Error", "Can't create output");
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
|
|||
|
|
@ -340,8 +340,12 @@ on_source_output_proxy (GObject *source_object,
|
|||
{
|
||||
PvStream *stream = user_data;
|
||||
PvStreamPrivate *priv = stream->priv;
|
||||
PvContext *context = priv->context;
|
||||
GError *error = NULL;
|
||||
|
||||
priv->source_output = pv_subscribe_get_proxy_finish (context->priv->subscribe,
|
||||
res,
|
||||
&error);
|
||||
if (priv->source_output == NULL)
|
||||
goto source_output_failed;
|
||||
|
||||
|
|
@ -384,13 +388,13 @@ on_source_output_created (GObject *source_object,
|
|||
g_print ("got source-output %s\n", priv->source_output_path);
|
||||
g_variant_unref (ret);
|
||||
|
||||
priv->source_output = pv_subscribe_get_proxy (context->priv->subscribe,
|
||||
PV_DBUS_SERVICE,
|
||||
priv->source_output_path,
|
||||
"org.pulsevideo.SourceOutput1",
|
||||
NULL,
|
||||
on_source_ouput_proxy,
|
||||
stream);
|
||||
pv_subscribe_get_proxy (context->priv->subscribe,
|
||||
PV_DBUS_SERVICE,
|
||||
priv->source_output_path,
|
||||
"org.pulsevideo.SourceOutput1",
|
||||
NULL,
|
||||
on_source_output_proxy,
|
||||
stream);
|
||||
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -115,9 +115,9 @@ on_proxy_properties_changed (GDBusProxy *proxy,
|
|||
GStrv invalidated_properties,
|
||||
gpointer user_data)
|
||||
{
|
||||
ProxyData *data = user_data;
|
||||
PvObjectData *data = user_data;
|
||||
|
||||
notify_event (subscribe, data->proxy, PV_SUBSCRIPTION_EVENT_CHANGE);
|
||||
notify_event (data->subscribe, data, PV_SUBSCRIPTION_EVENT_CHANGE);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -125,12 +125,14 @@ on_proxy_created (GObject *source_object,
|
|||
GAsyncResult *res,
|
||||
gpointer user_data)
|
||||
{
|
||||
ProxyData *data = user_data;
|
||||
PvObjectData *data = user_data;
|
||||
PvSubscribe *subscribe = data->subscribe;
|
||||
PvSubscribePrivate *priv = subscribe->priv;
|
||||
GError *error = NULL;
|
||||
GList *walk;
|
||||
|
||||
data->pending = FALSE;
|
||||
|
||||
data->proxy = g_dbus_proxy_new_finish (res, &error);
|
||||
if (data->proxy == NULL) {
|
||||
priv->objects = g_list_remove (priv->objects, data);
|
||||
|
|
@ -166,13 +168,14 @@ add_interface (PvSubscribe *subscribe,
|
|||
GVariant *properties)
|
||||
{
|
||||
PvSubscribePrivate *priv = subscribe->priv;
|
||||
ProxyData *data;
|
||||
PvObjectData *data;
|
||||
|
||||
data = g_new0 (ProxyData, 1);
|
||||
data = g_new0 (PvObjectData, 1);
|
||||
data->subscribe = subscribe;
|
||||
data->sender_name = g_strdup (priv->service);
|
||||
data->object_path = g_strdup (object_path);
|
||||
data->interface_name = g_strdup (interface_name);
|
||||
data->pending = TRUE;
|
||||
|
||||
priv->objects = g_list_prepend (priv->objects, data);
|
||||
priv->pending_proxies++;
|
||||
|
|
@ -647,8 +650,6 @@ compare_data (PvObjectData *data, const gchar *name,
|
|||
|
||||
void
|
||||
pv_subscribe_get_proxy (PvSubscribe *subscribe,
|
||||
GDBusProxyFlags flags,
|
||||
GDBusInterfaceInfo *info,
|
||||
const gchar *name,
|
||||
const gchar *object_path,
|
||||
const gchar *interface_name,
|
||||
|
|
@ -657,10 +658,9 @@ pv_subscribe_get_proxy (PvSubscribe *subscribe,
|
|||
gpointer user_data)
|
||||
{
|
||||
PvSubscribePrivate *priv;
|
||||
GDBusProxy *res = NULL;
|
||||
GList *walk;
|
||||
|
||||
g_return_val_if_fail (PV_IS_SUBSCRIBE (subscribe), NULL);
|
||||
g_return_if_fail (PV_IS_SUBSCRIBE (subscribe));
|
||||
priv = subscribe->priv;
|
||||
|
||||
for (walk = priv->objects; walk; walk = g_list_next (walk)) {
|
||||
|
|
@ -675,7 +675,6 @@ pv_subscribe_get_proxy (PvSubscribe *subscribe,
|
|||
user_data);
|
||||
|
||||
if (data->pending) {
|
||||
g_task_set_task_data (task, data, NULL);
|
||||
data->tasks = g_list_prepend (data->tasks, task);
|
||||
} else if (data->proxy) {
|
||||
g_task_return_pointer (task, g_object_ref (data->proxy), g_object_unref);
|
||||
|
|
@ -687,3 +686,11 @@ pv_subscribe_get_proxy (PvSubscribe *subscribe,
|
|||
}
|
||||
}
|
||||
|
||||
GDBusProxy *
|
||||
pv_subscribe_get_proxy_finish (PvSubscribe *subscribe,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
return g_task_propagate_pointer (G_TASK (res), error);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -87,13 +87,17 @@ PvSubscribe * pv_subscribe_new (void);
|
|||
PvSubscriptionState pv_subscribe_get_state (PvSubscribe *subscribe);
|
||||
GError * pv_subscribe_get_error (PvSubscribe *subscribe);
|
||||
|
||||
GDBusProxy * pv_subscribe_get_proxy (PvSubscribe *subscribe,
|
||||
void pv_subscribe_get_proxy (PvSubscribe *subscribe,
|
||||
const gchar *name,
|
||||
const gchar *object_path,
|
||||
const gchar *interface_name,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
GDBusProxy * pv_subscribe_get_proxy_finish (PvSubscribe *subscribe,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue