[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 02/11] audio/dbus: there are no sender for p2p mode
From: |
marcandre . lureau |
Subject: |
[PATCH 02/11] audio/dbus: there are no sender for p2p mode |
Date: |
Mon, 30 Jan 2023 15:24:22 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
audio/audio_int.h | 2 +-
audio/dbusaudio.c | 6 ++++--
ui/dbus.c | 2 +-
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/audio/audio_int.h b/audio/audio_int.h
index e87ce014a0..38864bfbbd 100644
--- a/audio/audio_int.h
+++ b/audio/audio_int.h
@@ -145,7 +145,7 @@ struct audio_driver {
void *(*init) (Audiodev *);
void (*fini) (void *);
#ifdef CONFIG_GIO
- void (*set_dbus_server) (AudioState *s, GDBusObjectManagerServer *manager);
+ void (*set_dbus_server) (AudioState *s, GDBusObjectManagerServer *manager,
bool p2p);
#endif
struct audio_pcm_ops *pcm_ops;
int can_be_default;
diff --git a/audio/dbusaudio.c b/audio/dbusaudio.c
index 722df0355e..9032dda49c 100644
--- a/audio/dbusaudio.c
+++ b/audio/dbusaudio.c
@@ -43,6 +43,7 @@
typedef struct DBusAudio {
GDBusObjectManagerServer *server;
+ bool p2p;
GDBusObjectSkeleton *audio;
QemuDBusDisplay1Audio *iface;
GHashTable *out_listeners;
@@ -448,7 +449,7 @@ dbus_audio_register_listener(AudioState *s,
bool out)
{
DBusAudio *da = s->drv_opaque;
- const char *sender = g_dbus_method_invocation_get_sender(invocation);
+ const char *sender = da->p2p ? "p2p" :
g_dbus_method_invocation_get_sender(invocation);
g_autoptr(GDBusConnection) listener_conn = NULL;
g_autoptr(GError) err = NULL;
g_autoptr(GSocket) socket = NULL;
@@ -591,7 +592,7 @@ dbus_audio_register_in_listener(AudioState *s,
}
static void
-dbus_audio_set_server(AudioState *s, GDBusObjectManagerServer *server)
+dbus_audio_set_server(AudioState *s, GDBusObjectManagerServer *server, bool
p2p)
{
DBusAudio *da = s->drv_opaque;
@@ -599,6 +600,7 @@ dbus_audio_set_server(AudioState *s,
GDBusObjectManagerServer *server)
g_assert(!da->server);
da->server = g_object_ref(server);
+ da->p2p = p2p;
da->audio = g_dbus_object_skeleton_new(DBUS_DISPLAY1_AUDIO_PATH);
da->iface = qemu_dbus_display1_audio_skeleton_new();
diff --git a/ui/dbus.c b/ui/dbus.c
index 32d88dc94a..0a9e2f4611 100644
--- a/ui/dbus.c
+++ b/ui/dbus.c
@@ -219,7 +219,7 @@ dbus_display_complete(UserCreatable *uc, Error **errp)
dd->audiodev);
return;
}
- audio_state->drv->set_dbus_server(audio_state, dd->server);
+ audio_state->drv->set_dbus_server(audio_state, dd->server, dd->p2p);
}
consoles = g_array_new(FALSE, FALSE, sizeof(guint32));
--
2.39.1
- [PATCH 00/11] ui: dbus & misc fixes, marcandre . lureau, 2023/01/30
- [PATCH 01/11] ui/dbus: unregister clipboard on connection close, marcandre . lureau, 2023/01/30
- [PATCH 02/11] audio/dbus: there are no sender for p2p mode,
marcandre . lureau <=
- [PATCH 03/11] ui/dbus: set mouse is-absolute during console creation, marcandre . lureau, 2023/01/30
- [PATCH 04/11] ui/dbus: update the display when switching surface, marcandre . lureau, 2023/01/30
- [PATCH 05/11] meson: ensure dbus-display generated code is built before other units, marcandre . lureau, 2023/01/30
- [PATCH 06/11] ui: rename cursor_{put->unref}, marcandre . lureau, 2023/01/30
- [PATCH 08/11] ui: keep current cursor with QemuConsole, marcandre . lureau, 2023/01/30
- [PATCH 10/11] ui: set cursor position upon listener registration, marcandre . lureau, 2023/01/30
- [PATCH 09/11] ui: set cursor upon listener registration, marcandre . lureau, 2023/01/30
- [PATCH 07/11] ui: rename cursor_{get->ref}, return it, marcandre . lureau, 2023/01/30
- [PATCH 11/11] ui/sdl: get the GL context from the window, marcandre . lureau, 2023/01/30