rename core_proxy -> core

Rename core_proxy to core and move the introspect and interface
contents to core.h

In an effort to promote the proxy API.
This commit is contained in:
Wim Taymans 2019-12-11 07:46:59 +01:00
parent 8ea78c2e3f
commit ecc6b27cd7
54 changed files with 1068 additions and 1059 deletions

View file

@ -844,8 +844,8 @@ static void core_done(void *data, uint32_t id, int seq)
complete_operations(c, seq);
}
static const struct pw_core_proxy_events core_events = {
PW_VERSION_CORE_PROXY_EVENTS,
static const struct pw_core_events core_events = {
PW_VERSION_CORE_EVENTS,
.info = core_info,
.done = core_done,
.error = core_error
@ -880,7 +880,7 @@ pa_operation* pa_context_subscribe(pa_context *c, pa_subscription_mask_t m, pa_c
c->subscribe_mask = m;
if (c->registry_proxy == NULL) {
c->registry_proxy = pw_core_proxy_get_registry(c->core_proxy,
c->registry_proxy = pw_core_get_registry(c->core,
PW_VERSION_REGISTRY_PROXY, 0);
pw_registry_proxy_add_listener(c->registry_proxy,
&c->registry_listener,
@ -1056,13 +1056,13 @@ int pa_context_connect(pa_context *c, const char *server, pa_context_flags_t fla
pa_context_set_state(c, PA_CONTEXT_CONNECTING);
c->core_proxy = pw_context_connect(c->context, pw_properties_copy(c->props), 0);
if (c->core_proxy == NULL) {
c->core = pw_context_connect(c->context, pw_properties_copy(c->props), 0);
if (c->core == NULL) {
context_fail(c, PA_ERR_CONNECTIONREFUSED);
res = -1;
goto exit;
}
pw_core_proxy_add_listener(c->core_proxy, &c->core_listener, &core_events, c);
pw_core_add_listener(c->core, &c->core_listener, &core_events, c);
exit:
pa_context_unref(c);
@ -1077,9 +1077,9 @@ void pa_context_disconnect(pa_context *c)
pa_assert(c->refcount >= 1);
c->disconnect = true;
if (c->core_proxy) {
pw_core_proxy_disconnect(c->core_proxy);
c->core_proxy = NULL;
if (c->core) {
pw_core_disconnect(c->core);
c->core = NULL;
}
if (PA_CONTEXT_IS_GOOD(c->state))
pa_context_set_state(c, PA_CONTEXT_TERMINATED);
@ -1198,7 +1198,7 @@ pa_operation* pa_context_set_name(pa_context *c, const char *name, pa_context_su
if (changed) {
struct pw_client_proxy *client_proxy;
client_proxy = pw_core_proxy_get_client_proxy(c->core_proxy);
client_proxy = pw_core_get_client_proxy(c->core);
pw_client_proxy_update_properties(client_proxy, &c->props->dict);
}

View file

@ -286,7 +286,7 @@ struct pa_context {
struct pw_properties *props;
struct pw_core_proxy *core_proxy;
struct pw_core *core;
struct spa_hook core_listener;
struct pw_core_info *core_info;

View file

@ -52,7 +52,7 @@ pa_operation *pa_operation_new(pa_context *c, pa_stream *s, pa_operation_cb_t cb
int pa_operation_sync(pa_operation *o)
{
pa_context *c = o->context;
o->seq = pw_core_proxy_sync(c->core_proxy, 0, 0);
o->seq = pw_core_sync(c->core, 0, 0);
pw_log_debug("operation %p: sync %d", o, o->seq);
return 0;
}

View file

@ -872,7 +872,7 @@ static int create_stream(pa_stream_direction_t direction,
name = pa_proplist_gets(s->proplist, PA_PROP_MEDIA_NAME);
s->stream = pw_stream_new(c->core_proxy,
s->stream = pw_stream_new(c->core,
name, pw_properties_copy(c->props));
pw_stream_add_listener(s->stream, &s->stream_listener, &stream_events, s);