core_proxy: prepare to rename pw_remote -> pw_core_proxy

The pw_remote object is really a wrapper around the pw_core_proxy.
The events it emits are also available in the core proxy and are
generally awkward to use.

With some clever new pw_core_proxy_* methods and a pw_core_connect
to create the core_proxy, we can convert all code away from pw_remote.

This is a first step in this conversion, using the pw_remote behind
the scenes. It leaks into some places because it really needs to become
its own struct in a next step.
This commit is contained in:
Wim Taymans 2019-12-06 11:48:40 +01:00
parent f8aabe69fe
commit 8a959ea7a1
37 changed files with 919 additions and 1185 deletions

View file

@ -23,8 +23,10 @@
*/
int pw_protocol_native_connect_local_socket(struct pw_protocol_client *client,
const struct spa_dict *props,
void (*done_callback) (void *data, int res),
void *data);
int pw_protocol_native_connect_portal_screencast(struct pw_protocol_client *client,
const struct spa_dict *props,
void (*done_callback) (void *data, int res),
void *data);

View file

@ -37,12 +37,12 @@
#include <pipewire/pipewire.h>
static const char *
get_remote(const struct pw_properties *properties)
get_remote(const struct spa_dict *props)
{
const char *name = NULL;
if (properties)
name = pw_properties_get(properties, PW_KEY_REMOTE_NAME);
if (props)
name = spa_dict_lookup(props, PW_KEY_REMOTE_NAME);
if (name == NULL)
name = getenv("PIPEWIRE_REMOTE");
if (name == NULL)
@ -51,10 +51,10 @@ get_remote(const struct pw_properties *properties)
}
int pw_protocol_native_connect_local_socket(struct pw_protocol_client *client,
const struct spa_dict *props,
void (*done_callback) (void *data, int res),
void *data)
{
struct pw_remote *remote = client->remote;
struct sockaddr_un addr;
socklen_t size;
const char *runtime_dir, *name = NULL;
@ -66,7 +66,7 @@ int pw_protocol_native_connect_local_socket(struct pw_protocol_client *client,
goto error;
}
name = get_remote(pw_remote_get_properties(remote));
name = get_remote(props);
if ((fd = socket(PF_LOCAL, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK, 0)) < 0) {
res = -errno;

View file

@ -33,6 +33,7 @@
#include <pipewire/pipewire.h>
int pw_protocol_native_connect_portal_screencast(struct pw_protocol_client *client,
const struct spa_dict *props,
void (*done_callback) (void *data, int res),
void *data)
{