mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-11 13:30:07 -05:00
pw_core -> pw_context
The proxy API is the one that we would like to expose for applications and the other API is used internally when implementing modules or factories. The current pw_core object is really a context for all objects so name it that way. It also makes it possible to rename pw_core_proxy to pw_proxy later.
This commit is contained in:
parent
42103a8218
commit
8ea78c2e3f
113 changed files with 905 additions and 906 deletions
|
|
@ -361,7 +361,7 @@ on_core_error(void *data, uint32_t id, int seq, int res, const char *message)
|
|||
}
|
||||
|
||||
static const struct pw_core_proxy_events core_events = {
|
||||
PW_VERSION_CORE_EVENTS,
|
||||
PW_VERSION_CORE_PROXY_EVENTS,
|
||||
.info = on_core_info,
|
||||
.done = on_core_done,
|
||||
.error = on_core_error,
|
||||
|
|
@ -524,7 +524,7 @@ gst_pipewire_device_provider_probe (GstDeviceProvider * provider)
|
|||
{
|
||||
GstPipeWireDeviceProvider *self = GST_PIPEWIRE_DEVICE_PROVIDER (provider);
|
||||
struct pw_loop *l = NULL;
|
||||
struct pw_core *c = NULL;
|
||||
struct pw_context *c = NULL;
|
||||
struct core_data *data;
|
||||
|
||||
GST_DEBUG_OBJECT (self, "starting probe");
|
||||
|
|
@ -532,16 +532,16 @@ gst_pipewire_device_provider_probe (GstDeviceProvider * provider)
|
|||
if (!(l = pw_loop_new (NULL)))
|
||||
return NULL;
|
||||
|
||||
if (!(c = pw_core_new (l, NULL, sizeof(*data))))
|
||||
if (!(c = pw_context_new (l, NULL, sizeof(*data))))
|
||||
return NULL;
|
||||
|
||||
data = pw_core_get_user_data(c);
|
||||
data = pw_context_get_user_data(c);
|
||||
data->self = self;
|
||||
spa_list_init(&data->nodes);
|
||||
spa_list_init(&data->ports);
|
||||
|
||||
spa_list_init(&self->pending);
|
||||
self->core_proxy = pw_core_connect (c, NULL, 0);
|
||||
self->core_proxy = pw_context_connect (c, NULL, 0);
|
||||
if (self->core_proxy == NULL)
|
||||
goto failed;
|
||||
|
||||
|
|
@ -567,7 +567,7 @@ gst_pipewire_device_provider_probe (GstDeviceProvider * provider)
|
|||
|
||||
GST_DEBUG_OBJECT (self, "disconnect");
|
||||
pw_core_proxy_disconnect (self->core_proxy);
|
||||
pw_core_destroy (c);
|
||||
pw_context_destroy (c);
|
||||
pw_loop_destroy (l);
|
||||
|
||||
return *self->devices;
|
||||
|
|
@ -594,9 +594,9 @@ gst_pipewire_device_provider_start (GstDeviceProvider * provider)
|
|||
goto failed_main_loop;
|
||||
}
|
||||
|
||||
if (!(self->core = pw_core_new (self->loop, NULL, sizeof(*data)))) {
|
||||
GST_ERROR_OBJECT (self, "Could not create PipeWire core");
|
||||
goto failed_core;
|
||||
if (!(self->context = pw_context_new (self->loop, NULL, sizeof(*data)))) {
|
||||
GST_ERROR_OBJECT (self, "Could not create PipeWire context");
|
||||
goto failed_context;
|
||||
}
|
||||
|
||||
if (pw_thread_loop_start (self->main_loop) < 0) {
|
||||
|
|
@ -606,14 +606,14 @@ gst_pipewire_device_provider_start (GstDeviceProvider * provider)
|
|||
|
||||
pw_thread_loop_lock (self->main_loop);
|
||||
|
||||
if ((self->core_proxy = pw_core_connect (self->core, NULL, 0)) == NULL) {
|
||||
if ((self->core_proxy = pw_context_connect (self->context, NULL, 0)) == NULL) {
|
||||
GST_ERROR_OBJECT (self, "Failed to connect");
|
||||
goto failed_connect;
|
||||
}
|
||||
|
||||
GST_DEBUG_OBJECT (self, "connected");
|
||||
|
||||
data = pw_core_get_user_data(self->core);
|
||||
data = pw_context_get_user_data(self->context);
|
||||
data->self = self;
|
||||
spa_list_init(&data->nodes);
|
||||
spa_list_init(&data->ports);
|
||||
|
|
@ -643,9 +643,9 @@ gst_pipewire_device_provider_start (GstDeviceProvider * provider)
|
|||
failed_connect:
|
||||
pw_thread_loop_unlock (self->main_loop);
|
||||
failed_start:
|
||||
pw_core_destroy (self->core);
|
||||
self->core = NULL;
|
||||
failed_core:
|
||||
pw_context_destroy (self->context);
|
||||
self->context = NULL;
|
||||
failed_context:
|
||||
pw_thread_loop_destroy (self->main_loop);
|
||||
self->main_loop = NULL;
|
||||
failed_main_loop:
|
||||
|
|
@ -665,9 +665,9 @@ gst_pipewire_device_provider_stop (GstDeviceProvider * provider)
|
|||
pw_core_proxy_disconnect (self->core_proxy);
|
||||
self->core_proxy = NULL;
|
||||
}
|
||||
if (self->core) {
|
||||
pw_core_destroy (self->core);
|
||||
self->core = NULL;
|
||||
if (self->context) {
|
||||
pw_context_destroy (self->context);
|
||||
self->context = NULL;
|
||||
}
|
||||
if (self->main_loop) {
|
||||
pw_thread_loop_destroy (self->main_loop);
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ struct _GstPipeWireDeviceProvider {
|
|||
struct pw_loop *loop;
|
||||
struct pw_thread_loop *main_loop;
|
||||
|
||||
struct pw_core *core;
|
||||
struct pw_context *context;
|
||||
|
||||
struct pw_core_proxy *core_proxy;
|
||||
struct spa_list pending;
|
||||
|
|
|
|||
|
|
@ -283,7 +283,7 @@ gst_pipewire_sink_init (GstPipeWireSink * sink)
|
|||
|
||||
sink->loop = pw_loop_new (NULL);
|
||||
sink->main_loop = pw_thread_loop_new (sink->loop, "pipewire-sink-loop");
|
||||
sink->core = pw_core_new (sink->loop, NULL, 0);
|
||||
sink->context = pw_context_new (sink->loop, NULL, 0);
|
||||
GST_DEBUG ("loop %p %p", sink->loop, sink->main_loop);
|
||||
}
|
||||
|
||||
|
|
@ -706,9 +706,9 @@ gst_pipewire_sink_open (GstPipeWireSink * pwsink)
|
|||
pw_thread_loop_lock (pwsink->main_loop);
|
||||
|
||||
if (pwsink->fd == -1)
|
||||
pwsink->core_proxy = pw_core_connect (pwsink->core, NULL, 0);
|
||||
pwsink->core_proxy = pw_context_connect (pwsink->context, NULL, 0);
|
||||
else
|
||||
pwsink->core_proxy = pw_core_connect_fd (pwsink->core, dup(pwsink->fd), NULL, 0);
|
||||
pwsink->core_proxy = pw_context_connect_fd (pwsink->context, dup(pwsink->fd), NULL, 0);
|
||||
|
||||
if (pwsink->core_proxy == NULL)
|
||||
goto connect_error;
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ struct _GstPipeWireSink {
|
|||
struct pw_loop *loop;
|
||||
struct pw_thread_loop *main_loop;
|
||||
|
||||
struct pw_core *core;
|
||||
struct pw_context *context;
|
||||
struct pw_core_proxy *core_proxy;
|
||||
|
||||
struct pw_stream *stream;
|
||||
|
|
|
|||
|
|
@ -208,8 +208,8 @@ gst_pipewire_src_finalize (GObject * object)
|
|||
|
||||
clear_queue (pwsrc);
|
||||
|
||||
pw_core_destroy (pwsrc->core);
|
||||
pwsrc->core = NULL;
|
||||
pw_context_destroy (pwsrc->context);
|
||||
pwsrc->context = NULL;
|
||||
pw_thread_loop_destroy (pwsrc->main_loop);
|
||||
pwsrc->main_loop = NULL;
|
||||
pw_loop_destroy (pwsrc->loop);
|
||||
|
|
@ -331,7 +331,7 @@ gst_pipewire_src_init (GstPipeWireSrc * src)
|
|||
src->pool = gst_pipewire_pool_new ();
|
||||
src->loop = pw_loop_new (NULL);
|
||||
src->main_loop = pw_thread_loop_new (src->loop, "pipewire-main-loop");
|
||||
src->core = pw_core_new (src->loop, NULL, 0);
|
||||
src->context = pw_context_new (src->loop, NULL, 0);
|
||||
GST_DEBUG ("loop %p, mainloop %p", src->loop, src->main_loop);
|
||||
|
||||
}
|
||||
|
|
@ -940,9 +940,9 @@ gst_pipewire_src_open (GstPipeWireSrc * pwsrc)
|
|||
pw_thread_loop_lock (pwsrc->main_loop);
|
||||
|
||||
if (pwsrc->fd == -1)
|
||||
pwsrc->core_proxy = pw_core_connect (pwsrc->core, NULL, 0);
|
||||
pwsrc->core_proxy = pw_context_connect (pwsrc->context, NULL, 0);
|
||||
else
|
||||
pwsrc->core_proxy = pw_core_connect_fd (pwsrc->core, dup(pwsrc->fd), NULL, 0);
|
||||
pwsrc->core_proxy = pw_context_connect_fd (pwsrc->context, dup(pwsrc->fd), NULL, 0);
|
||||
|
||||
if (pwsrc->core_proxy == NULL)
|
||||
goto connect_error;
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ struct _GstPipeWireSrc {
|
|||
struct pw_loop *loop;
|
||||
struct pw_thread_loop *main_loop;
|
||||
|
||||
struct pw_core *core;
|
||||
struct pw_context *context;
|
||||
struct pw_core_proxy *core_proxy;
|
||||
|
||||
struct pw_stream *stream;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue