mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-19 07:00:10 -05:00
monitor: remove monitor API and use device
Remove the monitor API, we can use the device API for it. Make sure we support creating devices (like alsa) from another device (udev). Use new object.id to store the object id in the object properties. Use the port.id/node.id etc to make relations to other objects.
This commit is contained in:
parent
818fb9e904
commit
6756a3c8fc
43 changed files with 474 additions and 1015 deletions
|
|
@ -66,9 +66,9 @@ struct spa_interface {
|
|||
struct spa_hook {
|
||||
struct spa_list link;
|
||||
struct spa_callbacks cb;
|
||||
void *priv; /**< private data for the hook list */
|
||||
/** callback and data for the hook list */
|
||||
void (*removed) (struct spa_hook *hook);
|
||||
|
||||
void *priv;
|
||||
};
|
||||
|
||||
/** Initialize a hook list */
|
||||
|
|
@ -77,6 +77,11 @@ static inline void spa_hook_list_init(struct spa_hook_list *list)
|
|||
spa_list_init(&list->list);
|
||||
}
|
||||
|
||||
static inline bool spa_hook_list_is_empty(struct spa_hook_list *list)
|
||||
{
|
||||
return spa_list_is_empty(&list->list);
|
||||
}
|
||||
|
||||
/** Append a hook \memberof spa_hook */
|
||||
static inline void spa_hook_list_append(struct spa_hook_list *list,
|
||||
struct spa_hook *hook,
|
||||
|
|
|
|||
|
|
@ -37,6 +37,10 @@ extern "C" {
|
|||
* Screen, Communication, Game,
|
||||
* Notification, DSP, Production,
|
||||
* Accessibility, Test */
|
||||
/** keys for udev api */
|
||||
#define SPA_KEY_API_UDEV "api.udev" /**< key for the udev api */
|
||||
#define SPA_KEY_API_UDEV_MATCH "api.udev.match" /**< udev subsystem match */
|
||||
|
||||
/** keys for alsa api */
|
||||
#define SPA_KEY_API_ALSA "api.alsa" /**< key for the alsa api */
|
||||
#define SPA_KEY_API_ALSA_PATH "api.alsa.path" /**< alsa device path as can be
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ extern "C" {
|
|||
#define SPA_NAME_VIDEO_ADAPT "video.adapt" /**< combination of a node and a
|
||||
* video.convert. */
|
||||
/** keys for alsa factory names */
|
||||
#define SPA_NAME_API_ALSA_MONITOR "api.alsa.monitor" /**< an alsa Monitor interface */
|
||||
#define SPA_NAME_API_ALSA_ENUM_UDEV "api.alsa.enum.udev" /**< an alsa udev Device interface */
|
||||
#define SPA_NAME_API_ALSA_DEVICE "api.alsa.device" /**< an alsa Device interface */
|
||||
#define SPA_NAME_API_ALSA_PCM_SOURCE "api.alsa.pcm.source" /**< an alsa Node interface for
|
||||
* capturing PCM */
|
||||
|
|
@ -87,7 +87,7 @@ extern "C" {
|
|||
* capturing midi */
|
||||
|
||||
/** keys for bluez5 factory names */
|
||||
#define SPA_NAME_API_BLUEZ5_MONITOR "api.bluez5.monitor" /**< a Monitor interface */
|
||||
#define SPA_NAME_API_BLUEZ5_ENUM_DBUS "api.bluez5.enum.dbus" /**< a dbus Device interface */
|
||||
#define SPA_NAME_API_BLUEZ5_DEVICE "api.bluez5.device" /**< a Device interface */
|
||||
#define SPA_NAME_API_BLUEZ5_A2DP_SINK "api.bluez5.a2dp.sink" /**< a playback Node interface for A2DP profiles */
|
||||
#define SPA_NAME_API_BLUEZ5_A2DP_SOURCE "api.bluez5.a2dp.source" /**< a capture Node interface for A2DP profiles */
|
||||
|
|
@ -95,7 +95,7 @@ extern "C" {
|
|||
#define SPA_NAME_API_BLUEZ5_SCO_SOURCE "api.bluez5.sco.source" /**< a capture Node interface for HSP/HFP profiles */
|
||||
|
||||
/** keys for v4l2 factory names */
|
||||
#define SPA_NAME_API_V4L2_MONITOR "api.v4l2.monitor" /**< a v4l2 Monitor interface */
|
||||
#define SPA_NAME_API_V4L2_ENUM_UDEV "api.v4l2.enum.udev" /**< a v4l2 udev Device interface */
|
||||
#define SPA_NAME_API_V4L2_DEVICE "api.v4l2.device" /**< a v4l2 Device interface */
|
||||
#define SPA_NAME_API_V4L2_SOURCE "api.v4l2.source" /**< a v4l2 Node interface for
|
||||
* capturing */
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@ static const struct spa_type_info spa_type_direction[] = {
|
|||
{ 0, 0, NULL, NULL }
|
||||
};
|
||||
|
||||
#include <spa/monitor/type-info.h>
|
||||
#include <spa/node/type-info.h>
|
||||
#include <spa/param/type-info.h>
|
||||
#include <spa/control/type-info.h>
|
||||
|
|
@ -110,16 +109,16 @@ static const struct spa_type_info spa_types[] = {
|
|||
{ SPA_TYPE_INTERFACE_DataSystem, SPA_TYPE_Pointer, SPA_TYPE_INFO_INTERFACE_BASE "DataSystem", NULL },
|
||||
{ SPA_TYPE_INTERFACE_DataLoop, SPA_TYPE_Pointer, SPA_TYPE_INFO_INTERFACE_BASE "DataLoop", NULL },
|
||||
{ SPA_TYPE_INTERFACE_DBus, SPA_TYPE_Pointer, SPA_TYPE_INFO_INTERFACE_BASE "DBus", NULL },
|
||||
{ SPA_TYPE_INTERFACE_Monitor, SPA_TYPE_Pointer, SPA_TYPE_INFO_INTERFACE_BASE "Monitor", NULL },
|
||||
{ SPA_TYPE_INTERFACE_Node, SPA_TYPE_Pointer, SPA_TYPE_INFO_INTERFACE_BASE "Node", NULL },
|
||||
{ SPA_TYPE_INTERFACE_Device, SPA_TYPE_Pointer, SPA_TYPE_INFO_INTERFACE_BASE "Device", NULL },
|
||||
{ SPA_TYPE_INTERFACE_CPU, SPA_TYPE_Pointer, SPA_TYPE_INFO_INTERFACE_BASE "CPU", NULL },
|
||||
|
||||
{ SPA_TYPE_EVENT_START, SPA_TYPE_Object, SPA_TYPE_INFO_Event, NULL },
|
||||
{ SPA_TYPE_EVENT_Monitor, SPA_TYPE_Object, SPA_TYPE_INFO_EVENT_BASE "Monitor", spa_type_monitor_event },
|
||||
{ SPA_TYPE_EVENT_Device, SPA_TYPE_Object, SPA_TYPE_INFO_EVENT_BASE "Device", NULL },
|
||||
{ SPA_TYPE_EVENT_Node, SPA_TYPE_Object, SPA_TYPE_INFO_EVENT_BASE "Node", spa_type_node_event },
|
||||
|
||||
{ SPA_TYPE_COMMAND_START, SPA_TYPE_Object, SPA_TYPE_INFO_Command, NULL },
|
||||
{ SPA_TYPE_COMMAND_Device, SPA_TYPE_Object, SPA_TYPE_INFO_COMMAND_BASE "Device", NULL },
|
||||
{ SPA_TYPE_COMMAND_Node, SPA_TYPE_Object, SPA_TYPE_INFO_COMMAND_BASE "Node", spa_type_node_command },
|
||||
|
||||
{ SPA_TYPE_OBJECT_START, SPA_TYPE_Object, SPA_TYPE_INFO_Object, NULL },
|
||||
|
|
|
|||
|
|
@ -75,7 +75,6 @@ enum {
|
|||
SPA_TYPE_INTERFACE_DataSystem, /**< System functions for data loop */
|
||||
SPA_TYPE_INTERFACE_DataLoop, /**< a data loop */
|
||||
SPA_TYPE_INTERFACE_DBus, /**< dbus connection */
|
||||
SPA_TYPE_INTERFACE_Monitor, /**< monitor of devices */
|
||||
SPA_TYPE_INTERFACE_Node, /**< nodes for data processing */
|
||||
SPA_TYPE_INTERFACE_Device, /**< device managing nodes */
|
||||
SPA_TYPE_INTERFACE_CPU, /**< CPU functions */
|
||||
|
|
@ -83,12 +82,13 @@ enum {
|
|||
|
||||
/* Events */
|
||||
SPA_TYPE_EVENT_START = 0x30000,
|
||||
SPA_TYPE_EVENT_Monitor,
|
||||
SPA_TYPE_EVENT_Device,
|
||||
SPA_TYPE_EVENT_Node,
|
||||
SPA_TYPE_EVENT_LAST, /**< not part of ABI */
|
||||
|
||||
/* Commands */
|
||||
SPA_TYPE_COMMAND_START = 0x40000,
|
||||
SPA_TYPE_COMMAND_Device,
|
||||
SPA_TYPE_COMMAND_Node,
|
||||
SPA_TYPE_COMMAND_LAST, /**< not part of ABI */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue