From d09ec5e87bfd892306ccdba56944583bd9213aaf Mon Sep 17 00:00:00 2001 From: Maki Date: Sat, 20 Apr 2024 18:34:09 -0400 Subject: Rework macro magic for symbol grabber --- .../cef/linux/volume_catcher_pipewire.cpp | 2 - .../cef/linux/volume_catcher_pipewire_syms.inc | 42 ++++++++++--------- .../cef/linux/volume_catcher_pulseaudio.cpp | 6 +-- .../linux/volume_catcher_pulseaudio_glib_syms.inc | 10 +++-- .../cef/linux/volume_catcher_pulseaudio_syms.inc | 48 ++++++++++++---------- 5 files changed, 59 insertions(+), 49 deletions(-) (limited to 'indra/media_plugins/cef') diff --git a/indra/media_plugins/cef/linux/volume_catcher_pipewire.cpp b/indra/media_plugins/cef/linux/volume_catcher_pipewire.cpp index 213efbfcfb..ca1808d63c 100755 --- a/indra/media_plugins/cef/linux/volume_catcher_pipewire.cpp +++ b/indra/media_plugins/cef/linux/volume_catcher_pipewire.cpp @@ -45,8 +45,6 @@ extern "C" { } SymbolGrabber pwSymbolGrabber; -#undef LL_SYMBOL_GRABBER -#define LL_SYMBOL_GRABBER pwSymbolGrabber #include "volume_catcher_pipewire_syms.inc" diff --git a/indra/media_plugins/cef/linux/volume_catcher_pipewire_syms.inc b/indra/media_plugins/cef/linux/volume_catcher_pipewire_syms.inc index 14e4a42f1d..dbc0f5f169 100644 --- a/indra/media_plugins/cef/linux/volume_catcher_pipewire_syms.inc +++ b/indra/media_plugins/cef/linux/volume_catcher_pipewire_syms.inc @@ -1,22 +1,26 @@ +#define G pwSymbolGrabber + // required symbols to grab -LL_GRAB_SYM(true, pw_init, void, int *argc, char **argv[]); -// LL_GRAB_SYM(true, pw_main_loop_new, struct pw_main_loop *, const struct spa_dict *props); -// LL_GRAB_SYM(true, pw_main_loop_get_loop, struct pw_loop *, struct pw_main_loop *loop); -// LL_GRAB_SYM(true, pw_main_loop_destroy, void, struct pw_main_loop *loop); -// LL_GRAB_SYM(true, pw_main_loop_run, void, struct pw_main_loop *loop); -LL_GRAB_SYM(true, pw_context_new, struct pw_context *, struct pw_loop *main_loop, struct pw_properties *props, size_t user_data_size); -LL_GRAB_SYM(true, pw_context_destroy, void, struct pw_context *context); -LL_GRAB_SYM(true, pw_context_connect, struct pw_core *, struct pw_context *context, struct pw_properties *properties, size_t user_data_size); -LL_GRAB_SYM(true, pw_thread_loop_new, struct pw_thread_loop *, const char *name, const struct spa_dict *props); -LL_GRAB_SYM(true, pw_thread_loop_destroy, void, struct pw_thread_loop *loop); -LL_GRAB_SYM(true, pw_thread_loop_get_loop, struct pw_loop *, struct pw_thread_loop *loop); -LL_GRAB_SYM(true, pw_thread_loop_start, int, struct pw_thread_loop *loop); -LL_GRAB_SYM(true, pw_thread_loop_stop, void, struct pw_thread_loop *loop); -LL_GRAB_SYM(true, pw_thread_loop_lock, void, struct pw_thread_loop *loop); -LL_GRAB_SYM(true, pw_thread_loop_unlock, void, struct pw_thread_loop *loop); -LL_GRAB_SYM(true, pw_proxy_add_listener, void, struct pw_proxy *proxy, struct spa_hook *listener, const struct pw_proxy_events *events, void *data); -LL_GRAB_SYM(true, pw_proxy_destroy, void, struct pw_proxy *proxy); -LL_GRAB_SYM(true, pw_proxy_get_user_data, void *, struct pw_proxy *proxy); -LL_GRAB_SYM(true, pw_core_disconnect, int, struct pw_core *core); +LL_GRAB_SYM(G, true, pw_init, void, int *argc, char **argv[]); +// LL_GRAB_SYM(G, true, pw_main_loop_new, struct pw_main_loop *, const struct spa_dict *props); +// LL_GRAB_SYM(G, true, pw_main_loop_get_loop, struct pw_loop *, struct pw_main_loop *loop); +// LL_GRAB_SYM(G, true, pw_main_loop_destroy, void, struct pw_main_loop *loop); +// LL_GRAB_SYM(G, true, pw_main_loop_run, void, struct pw_main_loop *loop); +LL_GRAB_SYM(G, true, pw_context_new, struct pw_context *, struct pw_loop *main_loop, struct pw_properties *props, size_t user_data_size); +LL_GRAB_SYM(G, true, pw_context_destroy, void, struct pw_context *context); +LL_GRAB_SYM(G, true, pw_context_connect, struct pw_core *, struct pw_context *context, struct pw_properties *properties, size_t user_data_size); +LL_GRAB_SYM(G, true, pw_thread_loop_new, struct pw_thread_loop *, const char *name, const struct spa_dict *props); +LL_GRAB_SYM(G, true, pw_thread_loop_destroy, void, struct pw_thread_loop *loop); +LL_GRAB_SYM(G, true, pw_thread_loop_get_loop, struct pw_loop *, struct pw_thread_loop *loop); +LL_GRAB_SYM(G, true, pw_thread_loop_start, int, struct pw_thread_loop *loop); +LL_GRAB_SYM(G, true, pw_thread_loop_stop, void, struct pw_thread_loop *loop); +LL_GRAB_SYM(G, true, pw_thread_loop_lock, void, struct pw_thread_loop *loop); +LL_GRAB_SYM(G, true, pw_thread_loop_unlock, void, struct pw_thread_loop *loop); +LL_GRAB_SYM(G, true, pw_proxy_add_listener, void, struct pw_proxy *proxy, struct spa_hook *listener, const struct pw_proxy_events *events, void *data); +LL_GRAB_SYM(G, true, pw_proxy_destroy, void, struct pw_proxy *proxy); +LL_GRAB_SYM(G, true, pw_proxy_get_user_data, void *, struct pw_proxy *proxy); +LL_GRAB_SYM(G, true, pw_core_disconnect, int, struct pw_core *core); // optional symbols to grab + +#undef G diff --git a/indra/media_plugins/cef/linux/volume_catcher_pulseaudio.cpp b/indra/media_plugins/cef/linux/volume_catcher_pulseaudio.cpp index 20a6458ea3..f7f64ef76c 100755 --- a/indra/media_plugins/cef/linux/volume_catcher_pulseaudio.cpp +++ b/indra/media_plugins/cef/linux/volume_catcher_pulseaudio.cpp @@ -49,8 +49,6 @@ extern "C" { } SymbolGrabber paSymbolGrabber; -#undef LL_SYMBOL_GRABBER -#define LL_SYMBOL_GRABBER paSymbolGrabber #include "volume_catcher_pulseaudio_syms.inc" #include "volume_catcher_pulseaudio_glib_syms.inc" @@ -95,7 +93,9 @@ void VolumeCatcherPulseAudio::init() // probably be loaded separately. Our Linux DSO framework needs refactoring, // we do this sort of thing a lot with practically identical logic... mGotSyms = loadsyms("libpulse-mainloop-glib.so.0"); - if (!mGotSyms) mGotSyms = loadsyms("libpulse.so.0"); + + if (!mGotSyms) + mGotSyms = loadsyms("libpulse.so.0"); if (!mGotSyms) return; diff --git a/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_glib_syms.inc b/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_glib_syms.inc index 5fba60c188..e9b7196e51 100755 --- a/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_glib_syms.inc +++ b/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_glib_syms.inc @@ -1,6 +1,10 @@ +#define G paSymbolGrabber + // required symbols to grab -LL_GRAB_SYM(true, pa_glib_mainloop_free, void, pa_glib_mainloop* g) -LL_GRAB_SYM(true, pa_glib_mainloop_get_api, pa_mainloop_api*, pa_glib_mainloop* g) -LL_GRAB_SYM(true, pa_glib_mainloop_new, pa_glib_mainloop *, GMainContext *c) +LL_GRAB_SYM(G, true, pa_glib_mainloop_free, void, pa_glib_mainloop* g) +LL_GRAB_SYM(G, true, pa_glib_mainloop_get_api, pa_mainloop_api*, pa_glib_mainloop* g) +LL_GRAB_SYM(G, true, pa_glib_mainloop_new, pa_glib_mainloop *, GMainContext *c) // optional symbols to grab + +#undef G diff --git a/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_syms.inc b/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_syms.inc index fe4ad084b6..4859a34405 100755 --- a/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_syms.inc +++ b/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_syms.inc @@ -1,25 +1,29 @@ +#define G paSymbolGrabber + // required symbols to grab -LL_GRAB_SYM(true, pa_context_connect, int, pa_context *c, const char *server, pa_context_flags_t flags, const pa_spawn_api *api) -LL_GRAB_SYM(true, pa_context_disconnect, void, pa_context *c) -LL_GRAB_SYM(true, pa_context_get_sink_input_info, pa_operation*, pa_context *c, uint32_t idx, pa_sink_input_info_cb_t cb, void *userdata) -LL_GRAB_SYM(true, pa_context_get_sink_input_info_list, pa_operation*, pa_context *c, pa_sink_input_info_cb_t cb, void *userdata) -LL_GRAB_SYM(true, pa_context_get_state, pa_context_state_t, pa_context *c) -LL_GRAB_SYM(true, pa_context_new_with_proplist, pa_context*, pa_mainloop_api *mainloop, const char *name, pa_proplist *proplist) -LL_GRAB_SYM(true, pa_context_set_sink_input_volume, pa_operation*, pa_context *c, uint32_t idx, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata) -LL_GRAB_SYM(true, pa_context_set_state_callback, void, pa_context *c, pa_context_notify_cb_t cb, void *userdata) -LL_GRAB_SYM(true, pa_context_set_subscribe_callback, void, pa_context *c, pa_context_subscribe_cb_t cb, void *userdata) -LL_GRAB_SYM(true, pa_context_subscribe, pa_operation*, pa_context *c, pa_subscription_mask_t m, pa_context_success_cb_t cb, void *userdata) -LL_GRAB_SYM(true, pa_context_unref, void, pa_context *c) -LL_GRAB_SYM(true, pa_cvolume_set, pa_cvolume*, pa_cvolume *a, unsigned channels, pa_volume_t v) -LL_GRAB_SYM(true, pa_operation_unref, void, pa_operation *o) -LL_GRAB_SYM(true, pa_proplist_free, void, pa_proplist* p) -LL_GRAB_SYM(true, pa_proplist_gets, const char*, pa_proplist *p, const char *key) -LL_GRAB_SYM(true, pa_proplist_new, pa_proplist*, void) -LL_GRAB_SYM(true, pa_proplist_sets, int, pa_proplist *p, const char *key, const char *value) -LL_GRAB_SYM(true, pa_sw_volume_from_linear, pa_volume_t, double v) -// LL_GRAB_SYM(true, pa_mainloop_free, void, pa_mainloop *m) -// LL_GRAB_SYM(true, pa_mainloop_get_api, pa_mainloop_api *, pa_mainloop *m) -// LL_GRAB_SYM(true, pa_mainloop_iterate, int, pa_mainloop *m, int block, int *retval) -// LL_GRAB_SYM(true, pa_mainloop_new, pa_mainloop *, void) +LL_GRAB_SYM(G, true, pa_context_connect, int, pa_context *c, const char *server, pa_context_flags_t flags, const pa_spawn_api *api) +LL_GRAB_SYM(G, true, pa_context_disconnect, void, pa_context *c) +LL_GRAB_SYM(G, true, pa_context_get_sink_input_info, pa_operation*, pa_context *c, uint32_t idx, pa_sink_input_info_cb_t cb, void *userdata) +LL_GRAB_SYM(G, true, pa_context_get_sink_input_info_list, pa_operation*, pa_context *c, pa_sink_input_info_cb_t cb, void *userdata) +LL_GRAB_SYM(G, true, pa_context_get_state, pa_context_state_t, pa_context *c) +LL_GRAB_SYM(G, true, pa_context_new_with_proplist, pa_context*, pa_mainloop_api *mainloop, const char *name, pa_proplist *proplist) +LL_GRAB_SYM(G, true, pa_context_set_sink_input_volume, pa_operation*, pa_context *c, uint32_t idx, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata) +LL_GRAB_SYM(G, true, pa_context_set_state_callback, void, pa_context *c, pa_context_notify_cb_t cb, void *userdata) +LL_GRAB_SYM(G, true, pa_context_set_subscribe_callback, void, pa_context *c, pa_context_subscribe_cb_t cb, void *userdata) +LL_GRAB_SYM(G, true, pa_context_subscribe, pa_operation*, pa_context *c, pa_subscription_mask_t m, pa_context_success_cb_t cb, void *userdata) +LL_GRAB_SYM(G, true, pa_context_unref, void, pa_context *c) +LL_GRAB_SYM(G, true, pa_cvolume_set, pa_cvolume*, pa_cvolume *a, unsigned channels, pa_volume_t v) +LL_GRAB_SYM(G, true, pa_operation_unref, void, pa_operation *o) +LL_GRAB_SYM(G, true, pa_proplist_free, void, pa_proplist* p) +LL_GRAB_SYM(G, true, pa_proplist_gets, const char*, pa_proplist *p, const char *key) +LL_GRAB_SYM(G, true, pa_proplist_new, pa_proplist*, void) +LL_GRAB_SYM(G, true, pa_proplist_sets, int, pa_proplist *p, const char *key, const char *value) +LL_GRAB_SYM(G, true, pa_sw_volume_from_linear, pa_volume_t, double v) +// LL_GRAB_SYM(G, true, pa_mainloop_free, void, pa_mainloop *m) +// LL_GRAB_SYM(G, true, pa_mainloop_get_api, pa_mainloop_api *, pa_mainloop *m) +// LL_GRAB_SYM(G, true, pa_mainloop_iterate, int, pa_mainloop *m, int block, int *retval) +// LL_GRAB_SYM(G, true, pa_mainloop_new, pa_mainloop *, void) // optional symbols to grab + +#undef G -- cgit v1.2.3