mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
types: more work on types
This commit is contained in:
parent
acedfe71c0
commit
5825c62d6d
76 changed files with 1713 additions and 1477 deletions
|
|
@ -64,7 +64,7 @@ do_check_send (PinosListener *listener,
|
|||
PinosClient *client = data->client;
|
||||
PinosCore *core = client->core;
|
||||
|
||||
if (data->resource->type == core->uri.registry) {
|
||||
if (data->resource->type == core->type.registry) {
|
||||
#if 0
|
||||
switch (data->opcode) {
|
||||
case 0:
|
||||
|
|
@ -107,7 +107,7 @@ do_check_dispatch (PinosListener *listener,
|
|||
PinosClient *client = data->client;
|
||||
PinosCore *core = client->core;
|
||||
|
||||
if (data->resource->type == core->uri.registry) {
|
||||
if (data->resource->type == core->type.registry) {
|
||||
#if 0
|
||||
if (data->opcode == 0) {
|
||||
PinosMessageBind *m = data->message;
|
||||
|
|
|
|||
|
|
@ -307,7 +307,7 @@ on_resource_added (PinosListener *listener,
|
|||
ClientInfo *cinfo = SPA_CONTAINER_OF (listener, ClientInfo, resource_added);
|
||||
ModuleImpl *impl = cinfo->impl;
|
||||
|
||||
if (resource->type == impl->core->uri.client_node) {
|
||||
if (resource->type == impl->core->type.client_node) {
|
||||
PinosClientNode *cnode = resource->object;
|
||||
on_node_added (impl, cnode->node, resource, cinfo);
|
||||
}
|
||||
|
|
@ -321,7 +321,7 @@ on_resource_removed (PinosListener *listener,
|
|||
ClientInfo *cinfo = SPA_CONTAINER_OF (listener, ClientInfo, resource_removed);
|
||||
ModuleImpl *impl = cinfo->impl;
|
||||
|
||||
if (resource->type == impl->core->uri.client_node) {
|
||||
if (resource->type == impl->core->type.client_node) {
|
||||
PinosClientNode *cnode = resource->object;
|
||||
NodeInfo *ninfo;
|
||||
|
||||
|
|
@ -339,7 +339,7 @@ on_global_added (PinosListener *listener,
|
|||
{
|
||||
ModuleImpl *impl = SPA_CONTAINER_OF (listener, ModuleImpl, global_added);
|
||||
|
||||
if (global->type == impl->core->uri.client) {
|
||||
if (global->type == impl->core->type.client) {
|
||||
PinosClient *client = global->object;
|
||||
ClientInfo *cinfo;
|
||||
|
||||
|
|
@ -362,7 +362,7 @@ on_global_removed (PinosListener *listener,
|
|||
{
|
||||
ModuleImpl *impl = SPA_CONTAINER_OF (listener, ModuleImpl, global_removed);
|
||||
|
||||
if (global->type == impl->core->uri.client) {
|
||||
if (global->type == impl->core->type.client) {
|
||||
PinosClient *client = global->object;
|
||||
ClientInfo *cinfo;
|
||||
|
||||
|
|
|
|||
|
|
@ -330,7 +330,7 @@ handle_create_node (PinosDaemon1 *interface,
|
|||
|
||||
pinos_resource_new (client,
|
||||
SPA_ID_INVALID,
|
||||
impl->core->uri.node,
|
||||
impl->core->type.node,
|
||||
node,
|
||||
(PinosDestroy) pinos_node_destroy);
|
||||
|
||||
|
|
@ -519,7 +519,7 @@ on_global_added (PinosListener *listener,
|
|||
PinosProtocolDBus *impl = SPA_CONTAINER_OF (listener, PinosProtocolDBus, global_added);
|
||||
PinosObjectSkeleton *skel;
|
||||
|
||||
if (global->type == impl->core->uri.client) {
|
||||
if (global->type == impl->core->type.client) {
|
||||
PinosClient1 *iface;
|
||||
PinosClient *client = global->object;
|
||||
PinosProperties *props = client->properties;
|
||||
|
|
@ -541,7 +541,7 @@ on_global_added (PinosListener *listener,
|
|||
false,
|
||||
(PinosDestroy) client_destroy);
|
||||
|
||||
} else if (global->type == impl->core->uri.node) {
|
||||
} else if (global->type == impl->core->type.node) {
|
||||
PinosNode1 *iface;
|
||||
PinosNode *node = global->object;
|
||||
PinosProperties *props = node->properties;
|
||||
|
|
@ -610,7 +610,7 @@ on_global_added (PinosListener *listener,
|
|||
name_lost_handler,
|
||||
proto,
|
||||
NULL);
|
||||
} else if (global->type == impl->core->uri.link) {
|
||||
} else if (global->type == impl->core->type.link) {
|
||||
PinosLink1 *iface;
|
||||
PinosLink *link = global->object;
|
||||
PinosProtocolDBusObject *obj;
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ on_global_added (PinosListener *listener,
|
|||
{
|
||||
ModuleImpl *impl = SPA_CONTAINER_OF (listener, ModuleImpl, global_added);
|
||||
|
||||
if (global->type == impl->core->uri.node) {
|
||||
if (global->type == impl->core->type.node) {
|
||||
PinosNode *node = global->object;
|
||||
NodeInfo *info;
|
||||
|
||||
|
|
@ -153,7 +153,7 @@ on_global_removed (PinosListener *listener,
|
|||
{
|
||||
ModuleImpl *impl = SPA_CONTAINER_OF (listener, ModuleImpl, global_removed);
|
||||
|
||||
if (global->type == impl->core->uri.node) {
|
||||
if (global->type == impl->core->type.node) {
|
||||
PinosNode *node = global->object;
|
||||
NodeInfo *info;
|
||||
|
||||
|
|
|
|||
|
|
@ -35,14 +35,14 @@ setup_video_node (PinosCore *core, SpaNode *spa_node, PinosProperties *pinos_pro
|
|||
SpaResult res;
|
||||
SpaProps *props;
|
||||
SpaPODProp *prop;
|
||||
const char *pattern, *pattern_uri;
|
||||
const char *pattern, *pattern_type;
|
||||
|
||||
/* Retrieve pattern property */
|
||||
pattern = pinos_properties_get (pinos_props, "pattern");
|
||||
if (strcmp (pattern, "smpte-snow") == 0) {
|
||||
pattern_uri = SPA_TYPE_PROPS__patternType ":smpte-snow";
|
||||
pattern_type = SPA_TYPE_PROPS__patternType ":smpte-snow";
|
||||
} else if (strcmp (pattern, "snow") == 0) {
|
||||
pattern_uri = SPA_TYPE_PROPS__patternType ":snow";
|
||||
pattern_type = SPA_TYPE_PROPS__patternType ":snow";
|
||||
} else {
|
||||
pinos_log_debug ("Unrecognized pattern");
|
||||
return SPA_RESULT_ERROR;
|
||||
|
|
@ -53,9 +53,9 @@ setup_video_node (PinosCore *core, SpaNode *spa_node, PinosProperties *pinos_pro
|
|||
return SPA_RESULT_ERROR;
|
||||
}
|
||||
|
||||
if ((prop = spa_pod_object_find_prop (props, spa_id_map_get_id (core->uri.map, SPA_TYPE_PROPS__patternType)))) {
|
||||
if ((prop = spa_pod_object_find_prop (props, spa_type_map_get_id (core->type.map, SPA_TYPE_PROPS__patternType)))) {
|
||||
if (prop->body.value.type == SPA_POD_TYPE_URI)
|
||||
SPA_POD_VALUE (SpaPODURI, &prop->body.value) = spa_id_map_get_id (core->uri.map, pattern_uri);
|
||||
SPA_POD_VALUE (SpaPODURI, &prop->body.value) = spa_type_map_get_id (core->type.map, pattern_type);
|
||||
}
|
||||
|
||||
if ((res = spa_node_set_props (spa_node, props)) != SPA_RESULT_OK) {
|
||||
|
|
|
|||
|
|
@ -67,11 +67,11 @@ add_item (PinosSpaMonitor *this, SpaMonitorItem *item)
|
|||
SpaPOD *info = NULL;
|
||||
|
||||
spa_pod_object_query (item,
|
||||
impl->core->uri.monitor_types.name, SPA_POD_TYPE_STRING, &name,
|
||||
impl->core->uri.monitor_types.id, SPA_POD_TYPE_STRING, &id,
|
||||
impl->core->uri.monitor_types.klass, SPA_POD_TYPE_STRING, &klass,
|
||||
impl->core->uri.monitor_types.factory, SPA_POD_TYPE_POINTER, &factory,
|
||||
impl->core->uri.monitor_types.info, SPA_POD_TYPE_STRUCT, &info,
|
||||
impl->core->type.monitor.name, SPA_POD_TYPE_STRING, &name,
|
||||
impl->core->type.monitor.id, SPA_POD_TYPE_STRING, &id,
|
||||
impl->core->type.monitor.klass, SPA_POD_TYPE_STRING, &klass,
|
||||
impl->core->type.monitor.factory, SPA_POD_TYPE_POINTER, &factory,
|
||||
impl->core->type.monitor.info, SPA_POD_TYPE_STRUCT, &info,
|
||||
0);
|
||||
|
||||
pinos_log_debug ("monitor %p: add: \"%s\" (%s)", this, name, id);
|
||||
|
|
@ -85,11 +85,11 @@ add_item (PinosSpaMonitor *this, SpaMonitorItem *item)
|
|||
pinos_log_error ("can't make factory instance: %d", res);
|
||||
return;
|
||||
}
|
||||
if ((res = spa_handle_get_interface (handle, impl->core->uri.spa_node, &node_iface)) < 0) {
|
||||
if ((res = spa_handle_get_interface (handle, impl->core->type.spa_node, &node_iface)) < 0) {
|
||||
pinos_log_error ("can't get NODE interface: %d", res);
|
||||
return;
|
||||
}
|
||||
if ((res = spa_handle_get_interface (handle, impl->core->uri.spa_clock, &clock_iface)) < 0) {
|
||||
if ((res = spa_handle_get_interface (handle, impl->core->type.spa_clock, &clock_iface)) < 0) {
|
||||
pinos_log_info ("no CLOCK interface: %d", res);
|
||||
}
|
||||
|
||||
|
|
@ -151,8 +151,8 @@ remove_item (PinosSpaMonitor *this, SpaMonitorItem *item)
|
|||
const char *name, *id;
|
||||
|
||||
spa_pod_object_query (item,
|
||||
impl->core->uri.monitor_types.name, SPA_POD_TYPE_STRING, &name,
|
||||
impl->core->uri.monitor_types.id, SPA_POD_TYPE_STRING, &id,
|
||||
impl->core->type.monitor.name, SPA_POD_TYPE_STRING, &name,
|
||||
impl->core->type.monitor.id, SPA_POD_TYPE_STRING, &id,
|
||||
0);
|
||||
|
||||
pinos_log_debug ("monitor %p: remove: \"%s\" (%s)", this, name, id);
|
||||
|
|
@ -169,20 +169,20 @@ on_monitor_event (SpaMonitor *monitor,
|
|||
PinosSpaMonitor *this = user_data;
|
||||
PinosSpaMonitorImpl *impl = SPA_CONTAINER_OF (this, PinosSpaMonitorImpl, this);
|
||||
|
||||
if (SPA_EVENT_TYPE (event) == impl->core->uri.monitor_types.Added) {
|
||||
if (SPA_EVENT_TYPE (event) == impl->core->type.monitor.Added) {
|
||||
SpaMonitorItem *item = SPA_POD_CONTENTS (SpaEvent, event);
|
||||
add_item (this, item);
|
||||
}
|
||||
else if (SPA_EVENT_TYPE (event) == impl->core->uri.monitor_types.Removed) {
|
||||
else if (SPA_EVENT_TYPE (event) == impl->core->type.monitor.Removed) {
|
||||
SpaMonitorItem *item = SPA_POD_CONTENTS (SpaEvent, event);
|
||||
remove_item (this, item);
|
||||
}
|
||||
else if (SPA_EVENT_TYPE (event) == impl->core->uri.monitor_types.Changed) {
|
||||
else if (SPA_EVENT_TYPE (event) == impl->core->type.monitor.Changed) {
|
||||
SpaMonitorItem *item = SPA_POD_CONTENTS (SpaEvent, event);
|
||||
const char *name;
|
||||
|
||||
spa_pod_object_query (item,
|
||||
impl->core->uri.monitor_types.name, SPA_POD_TYPE_STRING, &name,
|
||||
impl->core->type.monitor.name, SPA_POD_TYPE_STRING, &name,
|
||||
0);
|
||||
|
||||
pinos_log_debug ("monitor %p: changed: \"%s\"", this, name);
|
||||
|
|
@ -253,7 +253,7 @@ pinos_spa_monitor_load (PinosCore *core,
|
|||
goto init_failed;
|
||||
}
|
||||
if ((res = spa_handle_get_interface (handle,
|
||||
core->uri.spa_monitor,
|
||||
core->type.spa_monitor,
|
||||
&iface)) < 0) {
|
||||
free (handle);
|
||||
pinos_log_error ("can't get MONITOR interface: %d", res);
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ pinos_spa_node_load (PinosCore *core,
|
|||
goto init_failed;
|
||||
}
|
||||
if ((res = spa_handle_get_interface (handle,
|
||||
core->uri.spa_node,
|
||||
core->type.spa_node,
|
||||
&iface)) < 0) {
|
||||
pinos_log_error ("can't get interface %d", res);
|
||||
goto interface_failed;
|
||||
|
|
@ -89,7 +89,7 @@ pinos_spa_node_load (PinosCore *core,
|
|||
spa_node = iface;
|
||||
|
||||
if ((res = spa_handle_get_interface (handle,
|
||||
core->uri.spa_clock,
|
||||
core->type.spa_clock,
|
||||
&iface)) < 0) {
|
||||
iface = NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue