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

@ -134,7 +134,6 @@ static void test_create(void)
{
struct pw_main_loop *loop;
struct pw_core *core;
struct pw_remote *remote;
struct pw_stream *stream;
struct pw_stream_events stream_events = stream_events_error;
struct spa_hook listener = { 0, };
@ -143,8 +142,7 @@ static void test_create(void)
loop = pw_main_loop_new(NULL);
core = pw_core_new(pw_main_loop_get_loop(loop), NULL, 12);
remote = pw_remote_new(core, NULL, 12);
stream = pw_stream_new(remote, "test", NULL);
stream = pw_stream_new(NULL, "test", NULL);
spa_assert(stream != NULL);
pw_stream_add_listener(stream, &listener, &stream_events, stream);
@ -153,8 +151,6 @@ static void test_create(void)
spa_assert(error == NULL);
/* check name */
spa_assert(!strcmp(pw_stream_get_name(stream), "test"));
/* check remote */
spa_assert(pw_stream_get_remote(stream) == remote);
/* check id, only when connected */
spa_assert(pw_stream_get_node_id(stream) == SPA_ID_INVALID);
@ -184,7 +180,6 @@ static void test_properties(void)
struct pw_main_loop *loop;
struct pw_core *core;
const struct pw_properties *props;
struct pw_remote *remote;
struct pw_stream *stream;
struct pw_stream_events stream_events = stream_events_error;
struct spa_hook listener = { NULL, };
@ -192,8 +187,7 @@ static void test_properties(void)
loop = pw_main_loop_new(NULL);
core = pw_core_new(pw_main_loop_get_loop(loop), NULL, 0);
remote = pw_remote_new(core, NULL, 0);
stream = pw_stream_new(remote, "test",
stream = pw_stream_new(NULL, "test",
pw_properties_new("foo", "bar",
"biz", "fuzz",
NULL));