mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
fix for api changes
This commit is contained in:
parent
5f9200d9ee
commit
61edd78bf4
3 changed files with 25 additions and 15 deletions
|
|
@ -287,7 +287,7 @@ static int set_mask(pa_context *c, struct global *g)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void registry_event_global(void *data, uint32_t id, uint32_t parent_id,
|
static int registry_event_global(void *data, uint32_t id, uint32_t parent_id,
|
||||||
uint32_t permissions, uint32_t type, uint32_t version,
|
uint32_t permissions, uint32_t type, uint32_t version,
|
||||||
const struct spa_dict *props)
|
const struct spa_dict *props)
|
||||||
{
|
{
|
||||||
|
|
@ -304,26 +304,28 @@ static void registry_event_global(void *data, uint32_t id, uint32_t parent_id,
|
||||||
|
|
||||||
if (set_mask(c, g) == 0) {
|
if (set_mask(c, g) == 0) {
|
||||||
global_free(g);
|
global_free(g);
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
pw_log_debug("mask %d/%d", g->mask, g->event);
|
pw_log_debug("mask %d/%d", g->mask, g->event);
|
||||||
emit_event(c, g, PA_SUBSCRIPTION_EVENT_NEW);
|
emit_event(c, g, PA_SUBSCRIPTION_EVENT_NEW);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void registry_event_global_remove(void *object, uint32_t id)
|
static int registry_event_global_remove(void *object, uint32_t id)
|
||||||
{
|
{
|
||||||
pa_context *c = object;
|
pa_context *c = object;
|
||||||
struct global *g;
|
struct global *g;
|
||||||
|
|
||||||
pw_log_debug("context %p: remove %d", c, id);
|
pw_log_debug("context %p: remove %d", c, id);
|
||||||
if ((g = pa_context_find_global(c, id)) == NULL)
|
if ((g = pa_context_find_global(c, id)) == NULL)
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
emit_event(c, g, PA_SUBSCRIPTION_EVENT_REMOVE);
|
emit_event(c, g, PA_SUBSCRIPTION_EVENT_REMOVE);
|
||||||
|
|
||||||
pw_log_debug("context %p: free %d %p", c, id, g);
|
pw_log_debug("context %p: free %d %p", c, id, g);
|
||||||
global_free(g);
|
global_free(g);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct pw_registry_proxy_events registry_events =
|
static const struct pw_registry_proxy_events registry_events =
|
||||||
|
|
@ -357,17 +359,19 @@ static void complete_operations(pa_context *c, uint32_t seq)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void core_info(void *data, const struct pw_core_info *info)
|
static int core_info(void *data, const struct pw_core_info *info)
|
||||||
{
|
{
|
||||||
pa_context *c = data;
|
pa_context *c = data;
|
||||||
c->core_info = pw_core_info_update(c->core_info, info);
|
c->core_info = pw_core_info_update(c->core_info, info);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void core_done(void *data, uint32_t seq)
|
static int core_done(void *data, uint32_t id, uint32_t seq)
|
||||||
{
|
{
|
||||||
pa_context *c = data;
|
pa_context *c = data;
|
||||||
pw_log_debug("done %d", seq);
|
pw_log_debug("done %d", seq);
|
||||||
complete_operations(c, seq);
|
complete_operations(c, seq);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct pw_core_proxy_events core_events = {
|
static const struct pw_core_proxy_events core_events = {
|
||||||
|
|
|
||||||
|
|
@ -27,19 +27,21 @@
|
||||||
|
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
|
||||||
static void node_event_info(void *object, const struct pw_node_info *info)
|
static int node_event_info(void *object, const struct pw_node_info *info)
|
||||||
{
|
{
|
||||||
struct global *g = object;
|
struct global *g = object;
|
||||||
pw_log_debug("update %d", g->id);
|
pw_log_debug("update %d", g->id);
|
||||||
g->info = pw_node_info_update(g->info, info);
|
g->info = pw_node_info_update(g->info, info);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void node_event_param(void *object,
|
static int node_event_param(void *object,
|
||||||
uint32_t id, uint32_t index, uint32_t next,
|
uint32_t id, uint32_t index, uint32_t next,
|
||||||
const struct spa_pod *param)
|
const struct spa_pod *param)
|
||||||
{
|
{
|
||||||
struct global *g = object;
|
struct global *g = object;
|
||||||
pw_log_debug("update param %d", g->id);
|
pw_log_debug("update param %d", g->id);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct pw_node_proxy_events node_events = {
|
static const struct pw_node_proxy_events node_events = {
|
||||||
|
|
@ -48,7 +50,7 @@ static const struct pw_node_proxy_events node_events = {
|
||||||
.param = node_event_param,
|
.param = node_event_param,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void module_event_info(void *object, const struct pw_module_info *info)
|
static int module_event_info(void *object, const struct pw_module_info *info)
|
||||||
{
|
{
|
||||||
struct global *g = object;
|
struct global *g = object;
|
||||||
pa_module_info *i = &g->module_info.info;
|
pa_module_info *i = &g->module_info.info;
|
||||||
|
|
@ -71,6 +73,7 @@ static void module_event_info(void *object, const struct pw_module_info *info)
|
||||||
i->argument = info->args;
|
i->argument = info->args;
|
||||||
i->n_used = -1;
|
i->n_used = -1;
|
||||||
i->auto_unload = false;
|
i->auto_unload = false;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct pw_module_proxy_events module_events = {
|
static const struct pw_module_proxy_events module_events = {
|
||||||
|
|
@ -78,7 +81,7 @@ static const struct pw_module_proxy_events module_events = {
|
||||||
.info = module_event_info,
|
.info = module_event_info,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void client_event_info(void *object, const struct pw_client_info *info)
|
static int client_event_info(void *object, const struct pw_client_info *info)
|
||||||
{
|
{
|
||||||
struct global *g = object;
|
struct global *g = object;
|
||||||
pa_client_info *i = &g->client_info.info;
|
pa_client_info *i = &g->client_info.info;
|
||||||
|
|
@ -99,6 +102,7 @@ static void client_event_info(void *object, const struct pw_client_info *info)
|
||||||
i->driver = info->props ?
|
i->driver = info->props ?
|
||||||
spa_dict_lookup(info->props, PW_CLIENT_PROP_PROTOCOL) : NULL;
|
spa_dict_lookup(info->props, PW_CLIENT_PROP_PROTOCOL) : NULL;
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct pw_client_proxy_events client_events = {
|
static const struct pw_client_proxy_events client_events = {
|
||||||
|
|
@ -106,7 +110,7 @@ static const struct pw_client_proxy_events client_events = {
|
||||||
.info = client_event_info,
|
.info = client_event_info,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void device_event_param(void *object,
|
static int device_event_param(void *object,
|
||||||
uint32_t id, uint32_t index, uint32_t next,
|
uint32_t id, uint32_t index, uint32_t next,
|
||||||
const struct spa_pod *param)
|
const struct spa_pod *param)
|
||||||
{
|
{
|
||||||
|
|
@ -123,7 +127,7 @@ static void device_event_param(void *object,
|
||||||
SPA_PARAM_PROFILE_index, SPA_POD_Int(&id),
|
SPA_PARAM_PROFILE_index, SPA_POD_Int(&id),
|
||||||
SPA_PARAM_PROFILE_name, SPA_POD_String(&name)) < 0) {
|
SPA_PARAM_PROFILE_name, SPA_POD_String(&name)) < 0) {
|
||||||
pw_log_warn("device %d: can't parse profile", g->id);
|
pw_log_warn("device %d: can't parse profile", g->id);
|
||||||
return;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
pw_array_add_ptr(&g->card_info.profiles, pw_spa_pod_copy(param));
|
pw_array_add_ptr(&g->card_info.profiles, pw_spa_pod_copy(param));
|
||||||
pw_log_debug("device %d: enum profile %d: \"%s\"", g->id, id, name);
|
pw_log_debug("device %d: enum profile %d: \"%s\"", g->id, id, name);
|
||||||
|
|
@ -136,7 +140,7 @@ static void device_event_param(void *object,
|
||||||
SPA_TYPE_OBJECT_ParamProfile, NULL,
|
SPA_TYPE_OBJECT_ParamProfile, NULL,
|
||||||
SPA_PARAM_PROFILE_index, SPA_POD_Int(&id)) < 0) {
|
SPA_PARAM_PROFILE_index, SPA_POD_Int(&id)) < 0) {
|
||||||
pw_log_warn("device %d: can't parse profile", g->id);
|
pw_log_warn("device %d: can't parse profile", g->id);
|
||||||
return;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
g->card_info.active_profile = id;
|
g->card_info.active_profile = id;
|
||||||
pw_log_debug("device %d: current profile %d", g->id, id);
|
pw_log_debug("device %d: current profile %d", g->id, id);
|
||||||
|
|
@ -145,9 +149,10 @@ static void device_event_param(void *object,
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void device_event_info(void *object, const struct pw_device_info *info)
|
static int device_event_info(void *object, const struct pw_device_info *info)
|
||||||
{
|
{
|
||||||
struct global *g = object;
|
struct global *g = object;
|
||||||
pa_card_info *i = &g->card_info.info;
|
pa_card_info *i = &g->card_info.info;
|
||||||
|
|
@ -166,6 +171,7 @@ static void device_event_info(void *object, const struct pw_device_info *info)
|
||||||
else
|
else
|
||||||
i->proplist = pa_proplist_new_dict(info->props);
|
i->proplist = pa_proplist_new_dict(info->props);
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct pw_device_proxy_events device_events = {
|
static const struct pw_device_proxy_events device_events = {
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ int pa_operation_sync(pa_operation *o)
|
||||||
pa_context *c = o->context;
|
pa_context *c = o->context;
|
||||||
o->seq = ++c->seq;
|
o->seq = ++c->seq;
|
||||||
pw_log_debug("operation %p: sync %d", o, o->seq);
|
pw_log_debug("operation %p: sync %d", o, o->seq);
|
||||||
pw_core_proxy_sync(c->core_proxy, o->seq);
|
pw_core_proxy_sync(c->core_proxy, 0, o->seq);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue