mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -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
|
|
@ -73,7 +73,7 @@ struct impl {
|
|||
struct timespec now;
|
||||
|
||||
struct pw_main_loop *loop;
|
||||
struct pw_core *core;
|
||||
struct pw_context *context;
|
||||
|
||||
struct pw_core_proxy *core_proxy;
|
||||
struct spa_hook core_listener;
|
||||
|
|
@ -108,7 +108,7 @@ static struct node *create_node(struct object *obj, uint32_t id,
|
|||
{
|
||||
struct node *node;
|
||||
struct impl *impl = obj->impl;
|
||||
struct pw_core *core = impl->core;
|
||||
struct pw_context *context = impl->context;
|
||||
struct spa_handle *handle;
|
||||
int res;
|
||||
void *iface;
|
||||
|
|
@ -118,7 +118,7 @@ static struct node *create_node(struct object *obj, uint32_t id,
|
|||
if (info->type != SPA_TYPE_INTERFACE_Node)
|
||||
return NULL;
|
||||
|
||||
handle = pw_core_load_spa_handle(core,
|
||||
handle = pw_context_load_spa_handle(context,
|
||||
info->factory_name,
|
||||
info->props);
|
||||
if (handle == NULL) {
|
||||
|
|
@ -216,7 +216,7 @@ static void update_object(struct impl *impl, struct object *obj,
|
|||
static struct object *create_object(struct impl *impl, uint32_t id,
|
||||
const struct spa_device_object_info *info)
|
||||
{
|
||||
struct pw_core *core = impl->core;
|
||||
struct pw_context *context = impl->context;
|
||||
struct object *obj;
|
||||
struct spa_handle *handle;
|
||||
int res;
|
||||
|
|
@ -227,7 +227,7 @@ static struct object *create_object(struct impl *impl, uint32_t id,
|
|||
if (info->type != SPA_TYPE_INTERFACE_Device)
|
||||
return NULL;
|
||||
|
||||
handle = pw_core_load_spa_handle(core,
|
||||
handle = pw_context_load_spa_handle(context,
|
||||
info->factory_name,
|
||||
info->props);
|
||||
if (handle == NULL) {
|
||||
|
|
@ -314,7 +314,7 @@ static int start_monitor(struct impl *impl)
|
|||
int res;
|
||||
void *iface;
|
||||
|
||||
handle = pw_core_load_spa_handle(impl->core, SPA_NAME_API_BLUEZ5_ENUM_DBUS, NULL);
|
||||
handle = pw_context_load_spa_handle(impl->context, SPA_NAME_API_BLUEZ5_ENUM_DBUS, NULL);
|
||||
if (handle == NULL) {
|
||||
res = -errno;
|
||||
goto out;
|
||||
|
|
@ -363,15 +363,15 @@ int main(int argc, char *argv[])
|
|||
pw_init(&argc, &argv);
|
||||
|
||||
impl.loop = pw_main_loop_new(NULL);
|
||||
impl.core = pw_core_new(pw_main_loop_get_loop(impl.loop), NULL, 0);
|
||||
impl.context = pw_context_new(pw_main_loop_get_loop(impl.loop), NULL, 0);
|
||||
|
||||
pw_core_add_spa_lib(impl.core, "api.bluez5.*", "bluez5/libspa-bluez5");
|
||||
pw_context_add_spa_lib(impl.context, "api.bluez5.*", "bluez5/libspa-bluez5");
|
||||
|
||||
clock_gettime(CLOCK_MONOTONIC, &impl.now);
|
||||
|
||||
spa_list_init(&impl.device_list);
|
||||
|
||||
impl.core_proxy = pw_core_connect(impl.core, NULL, 0);
|
||||
impl.core_proxy = pw_context_connect(impl.context, NULL, 0);
|
||||
if (impl.core_proxy == NULL) {
|
||||
pw_log_error(NAME" %p: can't connect %m", &impl);
|
||||
return -1;
|
||||
|
|
@ -388,7 +388,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
pw_main_loop_run(impl.loop);
|
||||
|
||||
pw_core_destroy(impl.core);
|
||||
pw_context_destroy(impl.context);
|
||||
pw_main_loop_destroy(impl.loop);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ struct data {
|
|||
|
||||
struct pw_main_loop *loop;
|
||||
|
||||
struct pw_core *core;
|
||||
struct pw_context *context;
|
||||
|
||||
struct pw_core_proxy *core_proxy;
|
||||
struct spa_hook core_listener;
|
||||
|
|
@ -518,7 +518,7 @@ int main(int argc, char *argv[])
|
|||
pw_init(&argc, &argv);
|
||||
|
||||
data.loop = pw_main_loop_new(NULL);
|
||||
data.core = pw_core_new(pw_main_loop_get_loop(data.loop), NULL, 0);
|
||||
data.context = pw_context_new(pw_main_loop_get_loop(data.loop), NULL, 0);
|
||||
data.path = argc > 1 ? argv[1] : NULL;
|
||||
|
||||
spa_hook_list_init(&data.hooks);
|
||||
|
|
@ -548,7 +548,7 @@ int main(int argc, char *argv[])
|
|||
return -1;
|
||||
}
|
||||
|
||||
data.core_proxy = pw_core_connect(data.core, NULL, 0);
|
||||
data.core_proxy = pw_context_connect(data.context, NULL, 0);
|
||||
if (data.core_proxy == NULL) {
|
||||
printf("can't connect: %m\n");
|
||||
return -1;
|
||||
|
|
@ -561,7 +561,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
pw_main_loop_run(data.loop);
|
||||
|
||||
pw_core_destroy(data.core);
|
||||
pw_context_destroy(data.context);
|
||||
pw_main_loop_destroy(data.loop);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ struct data {
|
|||
|
||||
struct pw_main_loop *loop;
|
||||
|
||||
struct pw_core *core;
|
||||
struct pw_context *context;
|
||||
|
||||
struct pw_core_proxy *core_proxy;
|
||||
struct spa_hook core_listener;
|
||||
|
|
@ -509,7 +509,7 @@ int main(int argc, char *argv[])
|
|||
pw_init(&argc, &argv);
|
||||
|
||||
data.loop = pw_main_loop_new(NULL);
|
||||
data.core = pw_core_new(pw_main_loop_get_loop(data.loop), NULL, 0);
|
||||
data.context = pw_context_new(pw_main_loop_get_loop(data.loop), NULL, 0);
|
||||
data.path = argc > 1 ? argv[1] : NULL;
|
||||
|
||||
data.info_all = SPA_PORT_CHANGE_MASK_FLAGS |
|
||||
|
|
@ -531,7 +531,7 @@ int main(int argc, char *argv[])
|
|||
spa_list_init(&data.empty);
|
||||
spa_hook_list_init(&data.hooks);
|
||||
|
||||
if ((data.core_proxy = pw_core_connect(data.core, NULL, 0)) == NULL) {
|
||||
if ((data.core_proxy = pw_context_connect(data.context, NULL, 0)) == NULL) {
|
||||
printf("can't connect: %m\n");
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -542,7 +542,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
pw_main_loop_run(data.loop);
|
||||
|
||||
pw_core_destroy(data.core);
|
||||
pw_context_destroy(data.context);
|
||||
pw_main_loop_destroy(data.loop);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
struct data {
|
||||
struct pw_main_loop *loop;
|
||||
|
||||
struct pw_core *core;
|
||||
struct pw_context *context;
|
||||
|
||||
struct pw_core_proxy *core_proxy;
|
||||
struct spa_hook core_listener;
|
||||
|
|
@ -51,7 +51,7 @@ static int make_device(struct data *data)
|
|||
struct pw_factory *factory;
|
||||
struct pw_properties *props;
|
||||
|
||||
factory = pw_core_find_factory(data->core, "spa-device-factory");
|
||||
factory = pw_context_find_factory(data->context, "spa-device-factory");
|
||||
if (factory == NULL)
|
||||
return -1;
|
||||
|
||||
|
|
@ -111,13 +111,13 @@ int main(int argc, char *argv[])
|
|||
l = pw_main_loop_get_loop(data.loop);
|
||||
pw_loop_add_signal(l, SIGINT, do_quit, &data);
|
||||
pw_loop_add_signal(l, SIGTERM, do_quit, &data);
|
||||
data.core = pw_core_new(l, NULL, 0);
|
||||
data.context = pw_context_new(l, NULL, 0);
|
||||
data.library = argv[1];
|
||||
data.factory = argv[2];
|
||||
|
||||
pw_module_load(data.core, "libpipewire-module-spa-device-factory", NULL, NULL);
|
||||
pw_module_load(data.context, "libpipewire-module-spa-device-factory", NULL, NULL);
|
||||
|
||||
data.core_proxy = pw_core_connect(data.core, NULL, 0);
|
||||
data.core_proxy = pw_context_connect(data.context, NULL, 0);
|
||||
if (data.core_proxy == NULL) {
|
||||
pw_log_error("can't connect %m");
|
||||
return -1;
|
||||
|
|
@ -132,7 +132,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
pw_main_loop_run(data.loop);
|
||||
|
||||
pw_core_destroy(data.core);
|
||||
pw_context_destroy(data.context);
|
||||
pw_main_loop_destroy(data.loop);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
struct data {
|
||||
struct pw_main_loop *loop;
|
||||
|
||||
struct pw_core *core;
|
||||
struct pw_context *context;
|
||||
|
||||
struct pw_core_proxy *core_proxy;
|
||||
struct spa_hook core_listener;
|
||||
|
|
@ -77,7 +77,7 @@ static int make_node(struct data *data)
|
|||
NULL);
|
||||
|
||||
|
||||
hndl = pw_core_load_spa_handle(data->core, data->factory, &props->dict);
|
||||
hndl = pw_context_load_spa_handle(data->context, data->factory, &props->dict);
|
||||
if (hndl == NULL)
|
||||
return -errno;
|
||||
|
||||
|
|
@ -144,15 +144,15 @@ int main(int argc, char *argv[])
|
|||
l = pw_main_loop_get_loop(data.loop);
|
||||
pw_loop_add_signal(l, SIGINT, do_quit, &data);
|
||||
pw_loop_add_signal(l, SIGTERM, do_quit, &data);
|
||||
data.core = pw_core_new(l, NULL, 0);
|
||||
data.context = pw_context_new(l, NULL, 0);
|
||||
data.library = argv[1];
|
||||
data.factory = argv[2];
|
||||
if (argc > 3)
|
||||
data.path = argv[3];
|
||||
|
||||
pw_module_load(data.core, "libpipewire-module-spa-node-factory", NULL, NULL);
|
||||
pw_module_load(data.context, "libpipewire-module-spa-node-factory", NULL, NULL);
|
||||
|
||||
data.core_proxy = pw_core_connect(data.core, NULL, 0);
|
||||
data.core_proxy = pw_context_connect(data.context, NULL, 0);
|
||||
if (data.core_proxy == NULL) {
|
||||
printf("can't connect: %m\n");
|
||||
return -1;
|
||||
|
|
@ -168,7 +168,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
pw_main_loop_run(data.loop);
|
||||
|
||||
pw_core_destroy(data.core);
|
||||
pw_context_destroy(data.context);
|
||||
pw_main_loop_destroy(data.loop);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ struct data {
|
|||
struct pw_main_loop *loop;
|
||||
struct spa_source *timer;
|
||||
|
||||
struct pw_core *core;
|
||||
struct pw_context *context;
|
||||
struct pw_core_proxy *core_proxy;
|
||||
struct spa_port_info port_info;
|
||||
|
||||
|
|
@ -401,7 +401,7 @@ int main(int argc, char *argv[])
|
|||
pw_init(&argc, &argv);
|
||||
|
||||
data.loop = pw_main_loop_new(NULL);
|
||||
data.core = pw_core_new(
|
||||
data.context = pw_context_new(
|
||||
pw_main_loop_get_loop(data.loop),
|
||||
pw_properties_new(
|
||||
PW_KEY_CORE_DAEMON, "0",
|
||||
|
|
@ -409,8 +409,8 @@ int main(int argc, char *argv[])
|
|||
|
||||
spa_hook_list_init(&data.hooks);
|
||||
|
||||
pw_module_load(data.core, "libpipewire-module-spa-node-factory", NULL, NULL);
|
||||
pw_module_load(data.core, "libpipewire-module-link-factory", NULL, NULL);
|
||||
pw_module_load(data.context, "libpipewire-module-spa-node-factory", NULL, NULL);
|
||||
pw_module_load(data.context, "libpipewire-module-link-factory", NULL, NULL);
|
||||
|
||||
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
|
||||
printf("can't initialize SDL: %s\n", SDL_GetError());
|
||||
|
|
@ -423,7 +423,7 @@ int main(int argc, char *argv[])
|
|||
return -1;
|
||||
}
|
||||
|
||||
data.core_proxy = pw_core_connect_self(data.core, NULL, 0);
|
||||
data.core_proxy = pw_context_connect_self(data.context, NULL, 0);
|
||||
if (data.core_proxy == NULL) {
|
||||
printf("can't connect to core: %m\n");
|
||||
return -1;
|
||||
|
|
@ -433,7 +433,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
pw_main_loop_run(data.loop);
|
||||
|
||||
pw_core_destroy(data.core);
|
||||
pw_context_destroy(data.context);
|
||||
pw_main_loop_destroy(data.loop);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -539,7 +539,7 @@ static const struct sm_object_events device_events = {
|
|||
static struct device *alsa_create_device(struct impl *impl, uint32_t id,
|
||||
const struct spa_device_object_info *info)
|
||||
{
|
||||
struct pw_core *core = impl->session->core;
|
||||
struct pw_context *context = impl->session->context;
|
||||
struct device *device;
|
||||
struct spa_handle *handle;
|
||||
int res;
|
||||
|
|
@ -553,7 +553,7 @@ static struct device *alsa_create_device(struct impl *impl, uint32_t id,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
handle = pw_core_load_spa_handle(core,
|
||||
handle = pw_context_load_spa_handle(context,
|
||||
info->factory_name,
|
||||
info->props);
|
||||
if (handle == NULL) {
|
||||
|
|
@ -700,7 +700,7 @@ static int alsa_start_jack_device(struct impl *impl)
|
|||
|
||||
void *sm_alsa_monitor_start(struct sm_media_session *session)
|
||||
{
|
||||
struct pw_core *core = session->core;
|
||||
struct pw_context *context = session->context;
|
||||
struct impl *impl;
|
||||
void *iface;
|
||||
int res;
|
||||
|
|
@ -718,7 +718,7 @@ void *sm_alsa_monitor_start(struct sm_media_session *session)
|
|||
else
|
||||
pw_log_debug("got dbus connection %p", impl->conn);
|
||||
|
||||
impl->handle = pw_core_load_spa_handle(core, SPA_NAME_API_ALSA_ENUM_UDEV, NULL);
|
||||
impl->handle = pw_context_load_spa_handle(context, SPA_NAME_API_ALSA_ENUM_UDEV, NULL);
|
||||
if (impl->handle == NULL) {
|
||||
res = -errno;
|
||||
goto out_free;
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ static struct bluez5_node *bluez5_create_node(struct bluez5_object *obj, uint32_
|
|||
{
|
||||
struct bluez5_node *node;
|
||||
struct impl *impl = obj->impl;
|
||||
struct pw_core *core = impl->session->core;
|
||||
struct pw_context *context = impl->session->context;
|
||||
struct pw_factory *factory;
|
||||
int res;
|
||||
const char *str;
|
||||
|
|
@ -142,7 +142,7 @@ static struct bluez5_node *bluez5_create_node(struct bluez5_object *obj, uint32_
|
|||
node->object = obj;
|
||||
node->id = id;
|
||||
|
||||
factory = pw_core_find_factory(core, "adapter");
|
||||
factory = pw_context_find_factory(context, "adapter");
|
||||
if (factory == NULL) {
|
||||
pw_log_error("no adapter factory found");
|
||||
res = -EIO;
|
||||
|
|
@ -236,7 +236,7 @@ static void bluez5_update_object(struct impl *impl, struct bluez5_object *obj,
|
|||
static struct bluez5_object *bluez5_create_object(struct impl *impl, uint32_t id,
|
||||
const struct spa_device_object_info *info)
|
||||
{
|
||||
struct pw_core *core = impl->session->core;
|
||||
struct pw_context *context = impl->session->context;
|
||||
struct bluez5_object *obj;
|
||||
struct spa_handle *handle;
|
||||
int res;
|
||||
|
|
@ -249,7 +249,7 @@ static struct bluez5_object *bluez5_create_object(struct impl *impl, uint32_t id
|
|||
return NULL;
|
||||
}
|
||||
|
||||
handle = pw_core_load_spa_handle(core,
|
||||
handle = pw_context_load_spa_handle(context,
|
||||
info->factory_name,
|
||||
info->props);
|
||||
if (handle == NULL) {
|
||||
|
|
@ -346,12 +346,12 @@ static const struct spa_device_events bluez5_enum_callbacks =
|
|||
void *sm_bluez5_monitor_start(struct sm_media_session *session)
|
||||
{
|
||||
struct spa_handle *handle;
|
||||
struct pw_core *core = session->core;
|
||||
struct pw_context *context = session->context;
|
||||
int res;
|
||||
void *iface;
|
||||
struct impl *impl;
|
||||
|
||||
handle = pw_core_load_spa_handle(core, SPA_NAME_API_BLUEZ5_ENUM_DBUS, NULL);
|
||||
handle = pw_context_load_spa_handle(context, SPA_NAME_API_BLUEZ5_ENUM_DBUS, NULL);
|
||||
if (handle == NULL) {
|
||||
res = -errno;
|
||||
goto out;
|
||||
|
|
|
|||
|
|
@ -1523,7 +1523,7 @@ static const struct pw_proxy_events client_session_proxy_events = {
|
|||
|
||||
static int start_session(struct impl *impl)
|
||||
{
|
||||
impl->monitor_core = pw_core_connect(impl->this.core, NULL, 0);
|
||||
impl->monitor_core = pw_context_connect(impl->this.context, NULL, 0);
|
||||
if (impl->monitor_core == NULL) {
|
||||
pw_log_error("can't start monitor: %m");
|
||||
return -errno;
|
||||
|
|
@ -1579,14 +1579,14 @@ static void core_error(void *data, uint32_t id, int seq, int res, const char *me
|
|||
|
||||
|
||||
static const struct pw_core_proxy_events core_events = {
|
||||
PW_VERSION_CORE_EVENTS,
|
||||
PW_VERSION_CORE_PROXY_EVENTS,
|
||||
.done = core_done,
|
||||
.error = core_error
|
||||
};
|
||||
|
||||
static int start_policy(struct impl *impl)
|
||||
{
|
||||
impl->policy_core = pw_core_connect(impl->this.core, NULL, 0);
|
||||
impl->policy_core = pw_context_connect(impl->this.context, NULL, 0);
|
||||
if (impl->policy_core == NULL) {
|
||||
pw_log_error("can't start policy: %m");
|
||||
return -errno;
|
||||
|
|
@ -1614,11 +1614,11 @@ int main(int argc, char *argv[])
|
|||
|
||||
impl.loop = pw_main_loop_new(NULL);
|
||||
impl.this.loop = pw_main_loop_get_loop(impl.loop);
|
||||
impl.this.core = pw_core_new(impl.this.loop, NULL, 0);
|
||||
impl.this.context = pw_context_new(impl.this.loop, NULL, 0);
|
||||
|
||||
pw_core_add_spa_lib(impl.this.core, "api.bluez5.*", "bluez5/libspa-bluez5");
|
||||
pw_core_add_spa_lib(impl.this.core, "api.alsa.*", "alsa/libspa-alsa");
|
||||
pw_core_add_spa_lib(impl.this.core, "api.v4l2.*", "v4l2/libspa-v4l2");
|
||||
pw_context_add_spa_lib(impl.this.context, "api.bluez5.*", "bluez5/libspa-bluez5");
|
||||
pw_context_add_spa_lib(impl.this.context, "api.alsa.*", "alsa/libspa-alsa");
|
||||
pw_context_add_spa_lib(impl.this.context, "api.v4l2.*", "v4l2/libspa-v4l2");
|
||||
|
||||
pw_map_init(&impl.globals, 64, 64);
|
||||
spa_list_init(&impl.global_list);
|
||||
|
|
@ -1627,7 +1627,7 @@ int main(int argc, char *argv[])
|
|||
spa_list_init(&impl.sync_list);
|
||||
spa_hook_list_init(&impl.hooks);
|
||||
|
||||
support = pw_core_get_support(impl.this.core, &n_support);
|
||||
support = pw_context_get_support(impl.this.context, &n_support);
|
||||
|
||||
impl.dbus = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_DBus);
|
||||
if (impl.dbus)
|
||||
|
|
@ -1644,7 +1644,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
pw_main_loop_run(impl.loop);
|
||||
|
||||
pw_core_destroy(impl.this.core);
|
||||
pw_context_destroy(impl.this.context);
|
||||
pw_main_loop_destroy(impl.loop);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ struct sm_media_session {
|
|||
struct sm_session *session; /** session object managed by this session */
|
||||
|
||||
struct pw_loop *loop; /** the main loop */
|
||||
struct pw_core *core;
|
||||
struct pw_context *context;
|
||||
|
||||
struct spa_dbus_connection *dbus_connection;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ struct impl {
|
|||
struct sm_media_session *session;
|
||||
struct spa_hook listener;
|
||||
|
||||
struct pw_core *core;
|
||||
struct pw_context *context;
|
||||
|
||||
struct spa_list endpoint_list;
|
||||
int seq;
|
||||
|
|
@ -474,6 +474,9 @@ static int rescan_endpoint(struct impl *impl, struct endpoint *ep)
|
|||
peer = sm_object_get_data(obj, SESSION_KEY);
|
||||
goto do_link;
|
||||
}
|
||||
if (obj->type == PW_TYPE_INTERFACE_Node) {
|
||||
pw_log_debug(NAME " %p: target is node", impl);
|
||||
}
|
||||
}
|
||||
else {
|
||||
str = spa_dict_lookup(props, PW_KEY_NODE_DONT_RECONNECT);
|
||||
|
|
@ -542,7 +545,7 @@ void *sm_policy_ep_start(struct sm_media_session *session)
|
|||
return NULL;
|
||||
|
||||
impl->session = session;
|
||||
impl->core = session->core;
|
||||
impl->context = session->context;
|
||||
|
||||
spa_list_init(&impl->endpoint_list);
|
||||
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ static int v4l2_update_device_props(struct v4l2_object *obj)
|
|||
static struct v4l2_object *v4l2_create_object(struct impl *impl, uint32_t id,
|
||||
const struct spa_device_object_info *info)
|
||||
{
|
||||
struct pw_core *core = impl->session->core;
|
||||
struct pw_context *context = impl->session->context;
|
||||
struct v4l2_object *obj;
|
||||
struct spa_handle *handle;
|
||||
int res;
|
||||
|
|
@ -274,7 +274,7 @@ static struct v4l2_object *v4l2_create_object(struct impl *impl, uint32_t id,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
handle = pw_core_load_spa_handle(core,
|
||||
handle = pw_context_load_spa_handle(context,
|
||||
info->factory_name,
|
||||
info->props);
|
||||
if (handle == NULL) {
|
||||
|
|
@ -364,7 +364,7 @@ static const struct spa_device_events v4l2_udev_callbacks =
|
|||
|
||||
void * sm_v4l2_monitor_start(struct sm_media_session *sess)
|
||||
{
|
||||
struct pw_core *core = sess->core;
|
||||
struct pw_context *context = sess->context;
|
||||
struct impl *impl;
|
||||
int res;
|
||||
void *iface;
|
||||
|
|
@ -375,7 +375,7 @@ void * sm_v4l2_monitor_start(struct sm_media_session *sess)
|
|||
|
||||
impl->session = sess;
|
||||
|
||||
impl->handle = pw_core_load_spa_handle(core, SPA_NAME_API_V4L2_ENUM_UDEV, NULL);
|
||||
impl->handle = pw_context_load_spa_handle(context, SPA_NAME_API_V4L2_ENUM_UDEV, NULL);
|
||||
if (impl->handle == NULL) {
|
||||
res = -errno;
|
||||
goto out_free;
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ struct data {
|
|||
struct pw_main_loop *loop;
|
||||
struct spa_source *timer;
|
||||
|
||||
struct pw_core *core;
|
||||
struct pw_context *context;
|
||||
struct pw_core_proxy *core_proxy;
|
||||
|
||||
struct pw_stream *stream;
|
||||
|
|
@ -280,11 +280,11 @@ int main(int argc, char *argv[])
|
|||
pw_init(&argc, &argv);
|
||||
|
||||
data.loop = pw_main_loop_new(NULL);
|
||||
data.core = pw_core_new(pw_main_loop_get_loop(data.loop), NULL, 0);
|
||||
data.context = pw_context_new(pw_main_loop_get_loop(data.loop), NULL, 0);
|
||||
|
||||
data.timer = pw_loop_add_timer(pw_main_loop_get_loop(data.loop), on_timeout, &data);
|
||||
|
||||
data.core_proxy = pw_core_connect(data.core, NULL, 0);
|
||||
data.core_proxy = pw_context_connect(data.context, NULL, 0);
|
||||
if (data.core_proxy == NULL)
|
||||
return -1;
|
||||
|
||||
|
|
@ -318,7 +318,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
pw_main_loop_run(data.loop);
|
||||
|
||||
pw_core_destroy(data.core);
|
||||
pw_context_destroy(data.context);
|
||||
pw_main_loop_destroy(data.loop);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue