mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-07 13:30:09 -05:00
More type cleanups
SPA_ID_* -> SPA_TYPE_*. We use 'type' for all registered types. ID refers to either a registered type or an enum. Improve introspection of object ids. Make 0 an invalid enum and use it to look up the object id type. Move some type-info files together. Swap type and id of the object, we first specify the type and then the id because the meaning of the id depends on the object type.
This commit is contained in:
parent
281b65934e
commit
90c1a95eef
117 changed files with 1198 additions and 1272 deletions
|
|
@ -34,9 +34,10 @@ extern "C" {
|
|||
*/
|
||||
|
||||
enum spa_data_type {
|
||||
SPA_DATA_MemPtr,
|
||||
SPA_DATA_MemFd,
|
||||
SPA_DATA_DmaBuf,
|
||||
SPA_DATA_MemPtr, /**< pointer to memory, the data field in
|
||||
* struct spa_data is set. */
|
||||
SPA_DATA_MemFd, /**< generic fd, mmap to get to memory */
|
||||
SPA_DATA_DmaBuf, /**< fd to dmabuf memory */
|
||||
};
|
||||
|
||||
/** Chunk of memory */
|
||||
|
|
@ -53,6 +54,8 @@ struct spa_chunk {
|
|||
/** Data for a buffer */
|
||||
struct spa_data {
|
||||
uint32_t type; /**< memory type, one of enum spa_data_type */
|
||||
#define SPA_DATA_FLAG_NONE 0
|
||||
#define SPA_DATA_FLAG_CORRUPTED (1<<0) /**< data is corrupted in some way */
|
||||
uint32_t flags; /**< data flags */
|
||||
int fd; /**< optional fd for data */
|
||||
uint32_t mapoffset; /**< offset to map fd at */
|
||||
|
|
|
|||
|
|
@ -40,9 +40,9 @@ extern "C" {
|
|||
#define SPA_TYPE_DATA_FD_BASE SPA_TYPE_DATA__Fd ":"
|
||||
|
||||
static const struct spa_type_info spa_type_data_type[] = {
|
||||
{ SPA_DATA_MemPtr, SPA_TYPE_DATA_BASE "MemPtr", SPA_ID_INT, },
|
||||
{ SPA_DATA_MemFd, SPA_TYPE_DATA_FD_BASE "MemFd", SPA_ID_INT, },
|
||||
{ SPA_DATA_DmaBuf, SPA_TYPE_DATA_FD_BASE "DmaBuf", SPA_ID_INT, },
|
||||
{ SPA_DATA_MemPtr, SPA_TYPE_DATA_BASE "MemPtr", SPA_TYPE_Int, },
|
||||
{ SPA_DATA_MemFd, SPA_TYPE_DATA_FD_BASE "MemFd", SPA_TYPE_Int, },
|
||||
{ SPA_DATA_DmaBuf, SPA_TYPE_DATA_FD_BASE "DmaBuf", SPA_TYPE_Int, },
|
||||
{ 0, NULL, },
|
||||
};
|
||||
|
||||
|
|
@ -56,9 +56,9 @@ static const struct spa_type_info spa_type_data_type[] = {
|
|||
#define SPA_TYPE_META_REGION_ARRAY_BASE SPA_TYPE_META__RegionArray ":"
|
||||
|
||||
static const struct spa_type_info spa_type_meta_type[] = {
|
||||
{ SPA_META_Header, SPA_TYPE_META_BASE "Header", SPA_ID_POINTER },
|
||||
{ SPA_META_VideoCrop, SPA_TYPE_META_REGION_BASE "VideoCrop", SPA_ID_POINTER },
|
||||
{ SPA_META_VideoDamage, SPA_TYPE_META_REGION_ARRAY_BASE "VideoDamage", SPA_ID_POINTER },
|
||||
{ SPA_META_Header, SPA_TYPE_META_BASE "Header", SPA_TYPE_Pointer },
|
||||
{ SPA_META_VideoCrop, SPA_TYPE_META_REGION_BASE "VideoCrop", SPA_TYPE_Pointer },
|
||||
{ SPA_META_VideoDamage, SPA_TYPE_META_REGION_ARRAY_BASE "VideoDamage", SPA_TYPE_Pointer },
|
||||
{ 0, NULL, },
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue