diff --git a/spa/include/spa/buffer/buffer.h b/spa/include/spa/buffer/buffer.h index 1949a96b1..3f7e4b213 100644 --- a/spa/include/spa/buffer/buffer.h +++ b/spa/include/spa/buffer/buffer.h @@ -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 */ diff --git a/spa/include/spa/buffer/type-info.h b/spa/include/spa/buffer/type-info.h index ed1153a8c..a369ea78f 100644 --- a/spa/include/spa/buffer/type-info.h +++ b/spa/include/spa/buffer/type-info.h @@ -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, }, }; diff --git a/spa/include/spa/debug/format.h b/spa/include/spa/debug/format.h index 437ed241f..e3883d17d 100644 --- a/spa/include/spa/debug/format.h +++ b/spa/include/spa/debug/format.h @@ -26,17 +26,17 @@ extern "C" { #include #include -#include +#include static inline int spa_debug_format_value(const struct spa_type_info *info, uint32_t type, void *body, uint32_t size) { switch (type) { - case SPA_ID_Bool: + case SPA_TYPE_Bool: fprintf(stderr, "%s", *(int32_t *) body ? "true" : "false"); break; - case SPA_ID_Enum: + case SPA_TYPE_Enum: { const char *str = spa_debug_type_find_name(info, *(int32_t *) body); char tmp[64]; @@ -51,37 +51,37 @@ spa_debug_format_value(const struct spa_type_info *info, fprintf(stderr, "%s", str); break; } - case SPA_ID_Int: + case SPA_TYPE_Int: fprintf(stderr, "%d", *(int32_t *) body); break; - case SPA_ID_Long: + case SPA_TYPE_Long: fprintf(stderr, "%" PRIi64, *(int64_t *) body); break; - case SPA_ID_Float: + case SPA_TYPE_Float: fprintf(stderr, "%f", *(float *) body); break; - case SPA_ID_Double: + case SPA_TYPE_Double: fprintf(stderr, "%g", *(double *) body); break; - case SPA_ID_String: + case SPA_TYPE_String: fprintf(stderr, "%s", (char *) body); break; - case SPA_ID_Rectangle: + case SPA_TYPE_Rectangle: { struct spa_rectangle *r = body; fprintf(stderr, "%" PRIu32 "x%" PRIu32, r->width, r->height); break; } - case SPA_ID_Fraction: + case SPA_TYPE_Fraction: { struct spa_fraction *f = body; fprintf(stderr, "%" PRIu32 "/%" PRIu32, f->num, f->denom); break; } - case SPA_ID_Bitmap: + case SPA_TYPE_Bitmap: fprintf(stderr, "Bitmap"); break; - case SPA_ID_Bytes: + case SPA_TYPE_Bytes: fprintf(stderr, "Bytes"); break; default: @@ -100,28 +100,28 @@ static inline int spa_debug_format(int indent, struct spa_pod *pod; uint32_t mtype, mstype; const char *pod_type_names[] = { - [SPA_ID_None] = "none", - [SPA_ID_Bool] = "bool", - [SPA_ID_Enum] = "enum", - [SPA_ID_Int] = "int", - [SPA_ID_Long] = "long", - [SPA_ID_Float] = "float", - [SPA_ID_Double] = "double", - [SPA_ID_String] = "string", - [SPA_ID_Bytes] = "bytes", - [SPA_ID_Rectangle] = "rectangle", - [SPA_ID_Fraction] = "fraction", - [SPA_ID_Bitmap] = "bitmap", - [SPA_ID_Array] = "array", - [SPA_ID_Struct] = "struct", - [SPA_ID_Object] = "object", - [SPA_ID_Pointer] = "pointer", - [SPA_ID_Fd] = "fd", - [SPA_ID_Prop] = "prop", - [SPA_ID_Pod] = "pod" + [SPA_TYPE_None] = "none", + [SPA_TYPE_Bool] = "bool", + [SPA_TYPE_Enum] = "enum", + [SPA_TYPE_Int] = "int", + [SPA_TYPE_Long] = "long", + [SPA_TYPE_Float] = "float", + [SPA_TYPE_Double] = "double", + [SPA_TYPE_String] = "string", + [SPA_TYPE_Bytes] = "bytes", + [SPA_TYPE_Rectangle] = "rectangle", + [SPA_TYPE_Fraction] = "fraction", + [SPA_TYPE_Bitmap] = "bitmap", + [SPA_TYPE_Array] = "array", + [SPA_TYPE_Struct] = "struct", + [SPA_TYPE_Object] = "object", + [SPA_TYPE_Pointer] = "pointer", + [SPA_TYPE_Fd] = "fd", + [SPA_TYPE_Prop] = "prop", + [SPA_TYPE_Pod] = "pod" }; - if (format == NULL || SPA_POD_TYPE(format) != SPA_ID_Object) + if (format == NULL || SPA_POD_TYPE(format) != SPA_TYPE_Object) return -EINVAL; @@ -144,7 +144,7 @@ static inline int spa_debug_format(int indent, const char *key; const struct spa_type_info *ti; - if (pod->type != SPA_ID_Prop) + if (pod->type != SPA_TYPE_Prop) continue; prop = (struct spa_pod_prop *)pod; diff --git a/spa/include/spa/debug/pod.h b/spa/include/spa/debug/pod.h index 16cc676e1..045f4420f 100644 --- a/spa/include/spa/debug/pod.h +++ b/spa/include/spa/debug/pod.h @@ -38,54 +38,54 @@ spa_debug_pod_value(int indent, const struct spa_type_info *info, uint32_t type, void *body, uint32_t size) { switch (type) { - case SPA_ID_Bool: + case SPA_TYPE_Bool: spa_debug("%*s" "Bool %d", indent, "", *(int32_t *) body); break; - case SPA_ID_Enum: - spa_debug("%*s" "Enum %d %s", indent, "", *(int32_t *) body, + case SPA_TYPE_Enum: + spa_debug("%*s" "Enum %d (%s)", indent, "", *(int32_t *) body, spa_debug_type_find_name(info, *(int32_t *) body)); break; - case SPA_ID_Int: + case SPA_TYPE_Int: spa_debug("%*s" "Int %d", indent, "", *(int32_t *) body); break; - case SPA_ID_Long: + case SPA_TYPE_Long: spa_debug("%*s" "Long %" PRIi64 "", indent, "", *(int64_t *) body); break; - case SPA_ID_Float: + case SPA_TYPE_Float: spa_debug("%*s" "Float %f", indent, "", *(float *) body); break; - case SPA_ID_Double: + case SPA_TYPE_Double: spa_debug("%*s" "Double %f", indent, "", *(double *) body); break; - case SPA_ID_String: + case SPA_TYPE_String: spa_debug("%*s" "String \"%s\"", indent, "", (char *) body); break; - case SPA_ID_Fd: + case SPA_TYPE_Fd: spa_debug("%*s" "Fd %d", indent, "", *(int *) body); break; - case SPA_ID_Pointer: + case SPA_TYPE_Pointer: { struct spa_pod_pointer_body *b = body; spa_debug("%*s" "Pointer %s %p", indent, "", spa_debug_type_find_name(spa_types, b->type), b->value); break; } - case SPA_ID_Rectangle: + case SPA_TYPE_Rectangle: { struct spa_rectangle *r = body; spa_debug("%*s" "Rectangle %dx%d", indent, "", r->width, r->height); break; } - case SPA_ID_Fraction: + case SPA_TYPE_Fraction: { struct spa_fraction *f = body; spa_debug("%*s" "Fraction %d/%d", indent, "", f->num, f->denom); break; } - case SPA_ID_Bitmap: + case SPA_TYPE_Bitmap: spa_debug("%*s" "Bitmap", indent, ""); break; - case SPA_ID_Array: + case SPA_TYPE_Array: { struct spa_pod_array_body *b = body; void *p; @@ -100,7 +100,7 @@ spa_debug_pod_value(int indent, const struct spa_type_info *info, spa_debug_pod_value(indent + 2, info, b->child.type, p, b->child.size); break; } - case SPA_ID_Struct: + case SPA_TYPE_Struct: { struct spa_pod *b = body, *p; spa_debug("%*s" "Struct: size %d", indent, "", size); @@ -108,14 +108,19 @@ spa_debug_pod_value(int indent, const struct spa_type_info *info, spa_debug_pod_value(indent + 2, info, p->type, SPA_POD_BODY(p), p->size); break; } - case SPA_ID_Object: + case SPA_TYPE_Object: { struct spa_pod_object_body *b = body; struct spa_pod *p; - const struct spa_type_info *ti = spa_debug_type_find(info, b->type); + const struct spa_type_info *ti; + const struct spa_type_info *ii; - spa_debug("%*s" "Object: size %d, id %s, type %s", indent, "", size, - spa_debug_type_find_name(info, b->id), ti ? ti->name : "unknown"); + ti = spa_debug_type_find(info, b->type); + ii = ti ? spa_debug_type_find(ti->values, 0) : NULL; + ii = ii ? spa_debug_type_find(ii->values, b->id) : NULL; + + spa_debug("%*s" "Object: size %d, type %s, id %s", indent, "", size, + ti ? ti->name : "unknown", ii ? ii->name : "unknown"); info = ti ? ti->values : info; @@ -124,7 +129,7 @@ spa_debug_pod_value(int indent, const struct spa_type_info *info, p->type, SPA_POD_BODY(p), p->size); break; } - case SPA_ID_Prop: + case SPA_TYPE_Prop: { struct spa_pod_prop_body *b = body; void *alt; @@ -188,11 +193,11 @@ spa_debug_pod_value(int indent, const struct spa_type_info *info, } break; } - case SPA_ID_Bytes: + case SPA_TYPE_Bytes: spa_debug("%*s" "Bytes", indent, ""); spa_debug_mem(indent + 2, body, size); break; - case SPA_ID_None: + case SPA_TYPE_None: spa_debug("%*s" "None", indent, ""); spa_debug_mem(indent + 2, body, size); break; diff --git a/spa/include/spa/debug/types.h b/spa/include/spa/debug/types.h index ffd0a4dc9..5e983864e 100644 --- a/spa/include/spa/debug/types.h +++ b/spa/include/spa/debug/types.h @@ -28,40 +28,39 @@ extern "C" { static const struct spa_type_info spa_debug_types[] = { - { SPA_ID_INVALID, "", SPA_ID_Enum, spa_types }, + { SPA_ID_INVALID, "", SPA_TYPE_Enum, spa_types }, { 0, NULL, }, }; -static inline const struct spa_type_info *spa_debug_type_find(const struct spa_type_info *info, uint32_t id) +static inline const struct spa_type_info *spa_debug_type_find(const struct spa_type_info *info, uint32_t type) { const struct spa_type_info *res; while (info && info->name) { - if (info->id == SPA_ID_INVALID) - if ((res = spa_debug_type_find(info->values, id))) + if (info->type == SPA_ID_INVALID) + if ((res = spa_debug_type_find(info->values, type))) return res; - if (info->id == id) + if (info->type == type) return info; info++; } return NULL; } -static inline const char *spa_debug_type_find_name(const struct spa_type_info *info, uint32_t id) +static inline const char *spa_debug_type_find_name(const struct spa_type_info *info, uint32_t type) { - const struct spa_type_info *type; - if ((type = spa_debug_type_find(info, id)) == NULL) + if ((info = spa_debug_type_find(info, type)) == NULL) return NULL; - return type->name; + return info->name; } -static inline uint32_t spa_debug_type_find_id(const struct spa_type_info *info, const char *name) +static inline uint32_t spa_debug_type_find_type(const struct spa_type_info *info, const char *name) { while (info && info->name) { uint32_t res; if (strcmp(info->name, name) == 0) - return info->id; - if ((res = spa_debug_type_find_id(info->values, name)) != SPA_ID_INVALID) + return info->type; + if ((res = spa_debug_type_find_type(info->values, name)) != SPA_ID_INVALID) return res; info++; } diff --git a/spa/include/spa/monitor/monitor.h b/spa/include/spa/monitor/monitor.h index d0d5e31a6..441b5d62c 100644 --- a/spa/include/spa/monitor/monitor.h +++ b/spa/include/spa/monitor/monitor.h @@ -37,18 +37,8 @@ enum spa_monitor_event { SPA_MONITOR_EVENT_Changed, }; -#define SPA_MONITOR_EVENT_ID(ev) SPA_EVENT_ID(ev, SPA_ID_EVENT_Monitor) - -/** properties for SPA_ID_OBJECT_MonitorItem */ -enum spa_monitor_item { - SPA_MONITOR_ITEM_id, - SPA_MONITOR_ITEM_flags, - SPA_MONITOR_ITEM_state, - SPA_MONITOR_ITEM_name, - SPA_MONITOR_ITEM_class, - SPA_MONITOR_ITEM_info, - SPA_MONITOR_ITEM_factory, -}; +/** monitor event id, one of enum spa_monitor_event */ +#define SPA_MONITOR_EVENT_ID(ev) SPA_EVENT_ID(ev, SPA_TYPE_EVENT_Monitor) enum spa_monitor_item_flags { SPA_MONITOR_ITEM_FLAG_NONE = 0, @@ -61,6 +51,18 @@ enum spa_monitor_item_state { SPA_MONITOR_ITEM_STATE_UNAVAILABLE, /*< The item is unavailable */ }; +/** properties for SPA_TYPE_OBJECT_MonitorItem */ +enum spa_monitor_item { + SPA_MONITOR_ITEM_START, /**< id of object, one of enum spa_monitor_event */ + SPA_MONITOR_ITEM_id, + SPA_MONITOR_ITEM_flags, /**< one of enum spa_monitor_item_flags */ + SPA_MONITOR_ITEM_state, /**< one of enum spa_monitor_item_state */ + SPA_MONITOR_ITEM_name, + SPA_MONITOR_ITEM_class, + SPA_MONITOR_ITEM_info, + SPA_MONITOR_ITEM_factory, +}; + /** * spa_monitor_callbacks: */ diff --git a/spa/include/spa/monitor/type-info.h b/spa/include/spa/monitor/type-info.h index 82fb7ee31..a398a2090 100644 --- a/spa/include/spa/monitor/type-info.h +++ b/spa/include/spa/monitor/type-info.h @@ -27,11 +27,26 @@ extern "C" { #include #include +#define SPA_TYPE__MonitorEvent SPA_TYPE_EVENT_BASE "Monitor" +#define SPA_TYPE_MONITOR_EVENT_BASE SPA_TYPE__MonitorEvent ":" + +static const struct spa_type_info spa_type_monitor_event_id[] = { + { SPA_MONITOR_EVENT_Added, SPA_TYPE_MONITOR_EVENT_BASE "Added", SPA_TYPE_Int, }, + { SPA_MONITOR_EVENT_Removed, SPA_TYPE_MONITOR_EVENT_BASE "Removed", SPA_TYPE_Int, }, + { SPA_MONITOR_EVENT_Changed, SPA_TYPE_MONITOR_EVENT_BASE "Changed", SPA_TYPE_Int, }, + { 0, NULL, }, +}; + +static const struct spa_type_info spa_type_monitor_event[] = { + { 0, SPA_TYPE_MONITOR_EVENT_BASE, SPA_TYPE_Enum, spa_type_monitor_event_id }, + { 0, NULL, }, +}; + #define SPA_TYPE__MonitorItemFlags SPA_TYPE_FLAGS_BASE "MonitorItemFlags" #define SPA_TYPE_MONITOR_ITEM_FLAGS_BASE SPA_TYPE__MonitorItemFlags ":" static const struct spa_type_info spa_type_monitor_item_flags[] = { - { SPA_MONITOR_ITEM_FLAG_NONE, SPA_TYPE_MONITOR_ITEM_FLAGS_BASE "none", SPA_ID_Int, }, + { SPA_MONITOR_ITEM_FLAG_NONE, SPA_TYPE_MONITOR_ITEM_FLAGS_BASE "none", SPA_TYPE_Int, }, { 0, NULL, }, }; @@ -39,9 +54,9 @@ static const struct spa_type_info spa_type_monitor_item_flags[] = { #define SPA_TYPE_MONITOR_ITEM_STATE_BASE SPA_TYPE__MonitorItemState ":" static const struct spa_type_info spa_type_monitor_item_state[] = { - { SPA_MONITOR_ITEM_STATE_AVAILABLE, SPA_TYPE_MONITOR_ITEM_STATE_BASE "available", SPA_ID_Int, }, - { SPA_MONITOR_ITEM_STATE_DISABLED, SPA_TYPE_MONITOR_ITEM_STATE_BASE "disabled", SPA_ID_Int, }, - { SPA_MONITOR_ITEM_STATE_UNAVAILABLE, SPA_TYPE_MONITOR_ITEM_STATE_BASE "unavailable", SPA_ID_Int, }, + { SPA_MONITOR_ITEM_STATE_AVAILABLE, SPA_TYPE_MONITOR_ITEM_STATE_BASE "available", SPA_TYPE_Int, }, + { SPA_MONITOR_ITEM_STATE_DISABLED, SPA_TYPE_MONITOR_ITEM_STATE_BASE "disabled", SPA_TYPE_Int, }, + { SPA_MONITOR_ITEM_STATE_UNAVAILABLE, SPA_TYPE_MONITOR_ITEM_STATE_BASE "unavailable", SPA_TYPE_Int, }, { 0, NULL, }, }; @@ -49,15 +64,16 @@ static const struct spa_type_info spa_type_monitor_item_state[] = { #define SPA_TYPE_MONITOR_ITEM_BASE SPA_TYPE__MonitorItem ":" static const struct spa_type_info spa_type_monitor_item[] = { - { SPA_MONITOR_ITEM_id, SPA_TYPE_MONITOR_ITEM_BASE "id", SPA_ID_String, }, - { SPA_MONITOR_ITEM_flags, SPA_TYPE_MONITOR_ITEM_BASE "flags", SPA_ID_Enum, + { SPA_MONITOR_ITEM_START, SPA_TYPE_MONITOR_ITEM_BASE, SPA_TYPE_Int, }, + { SPA_MONITOR_ITEM_id, SPA_TYPE_MONITOR_ITEM_BASE "id", SPA_TYPE_String, }, + { SPA_MONITOR_ITEM_flags, SPA_TYPE_MONITOR_ITEM_BASE "flags", SPA_TYPE_Enum, spa_type_monitor_item_flags }, - { SPA_MONITOR_ITEM_state, SPA_TYPE_MONITOR_ITEM_BASE "state", SPA_ID_Enum, + { SPA_MONITOR_ITEM_state, SPA_TYPE_MONITOR_ITEM_BASE "state", SPA_TYPE_Enum, spa_type_monitor_item_state }, - { SPA_MONITOR_ITEM_name, SPA_TYPE_MONITOR_ITEM_BASE "name", SPA_ID_String, }, - { SPA_MONITOR_ITEM_class, SPA_TYPE_MONITOR_ITEM_BASE "class", SPA_ID_String, }, - { SPA_MONITOR_ITEM_info, SPA_TYPE_MONITOR_ITEM_BASE "info", SPA_ID_Pod, }, - { SPA_MONITOR_ITEM_factory, SPA_TYPE_MONITOR_ITEM_BASE "factory", SPA_ID_Pointer, }, + { SPA_MONITOR_ITEM_name, SPA_TYPE_MONITOR_ITEM_BASE "name", SPA_TYPE_String, }, + { SPA_MONITOR_ITEM_class, SPA_TYPE_MONITOR_ITEM_BASE "class", SPA_TYPE_String, }, + { SPA_MONITOR_ITEM_info, SPA_TYPE_MONITOR_ITEM_BASE "info", SPA_TYPE_Pod, }, + { SPA_MONITOR_ITEM_factory, SPA_TYPE_MONITOR_ITEM_BASE "factory", SPA_TYPE_Pointer, }, { 0, NULL, }, }; diff --git a/spa/include/spa/node/command.h b/spa/include/spa/node/command.h index 4e6485713..f77ecc05c 100644 --- a/spa/include/spa/node/command.h +++ b/spa/include/spa/node/command.h @@ -26,6 +26,7 @@ extern "C" { #include +/* object id of SPA_TYPE_COMMAND_Node */ enum spa_node_command { SPA_NODE_COMMAND_Suspend, SPA_NODE_COMMAND_Pause, @@ -37,11 +38,11 @@ enum spa_node_command { SPA_NODE_COMMAND_Marker, }; -#define SPA_NODE_COMMAND_ID(cmd) SPA_COMMAND_ID(cmd, SPA_ID_COMMAND_Node) +#define SPA_NODE_COMMAND_ID(cmd) SPA_COMMAND_ID(cmd, SPA_TYPE_COMMAND_Node) #define SPA_NODE_COMMAND_INIT(id) (struct spa_command) \ - { { sizeof(struct spa_command_body), SPA_ID_Object }, \ - { { id, SPA_ID_COMMAND_Node } } } \ + { { sizeof(struct spa_command_body), SPA_TYPE_Object }, \ + { { SPA_TYPE_COMMAND_Node, id } } } \ #ifdef __cplusplus } /* extern "C" */ diff --git a/spa/include/spa/node/event.h b/spa/include/spa/node/event.h index 8143bf2a7..0488657c0 100644 --- a/spa/include/spa/node/event.h +++ b/spa/include/spa/node/event.h @@ -28,13 +28,14 @@ extern "C" { #include #include +/* object id of SPA_TYPE_EVENT_Node */ enum spa_node_event { SPA_NODE_EVENT_Error, SPA_NODE_EVENT_Buffering, SPA_NODE_EVENT_RequestRefresh, }; -#define SPA_NODE_EVENT_ID(ev) SPA_EVENT_ID(ev, SPA_ID_EVENT_Node) +#define SPA_NODE_EVENT_ID(ev) SPA_EVENT_ID(ev, SPA_TYPE_EVENT_Node) #ifdef __cplusplus } /* extern "C" */ diff --git a/spa/include/spa/node/io.h b/spa/include/spa/node/io.h index 1d2bf0114..a13261176 100644 --- a/spa/include/spa/node/io.h +++ b/spa/include/spa/node/io.h @@ -35,8 +35,6 @@ extern "C" { /** Different IO area types */ enum spa_io_type { - SPA_IO_BASE, - SPA_IO_Buffers, SPA_IO_ControlRange, SPA_IO_Clock, diff --git a/spa/include/spa/node/type-info.h b/spa/include/spa/node/type-info.h index 731e11b0b..a09fbefdd 100644 --- a/spa/include/spa/node/type-info.h +++ b/spa/include/spa/node/type-info.h @@ -30,22 +30,40 @@ extern "C" { #include #include -/** Base for IO structures to interface with node ports */ -#define SPA_TYPE__IO SPA_TYPE_POINTER_BASE "IO" -#define SPA_TYPE_IO_BASE SPA_TYPE__IO ":" +#define SPA_TYPE__NodeEvent SPA_TYPE_EVENT_BASE "Node" +#define SPA_TYPE_NODE_EVENT_BASE SPA_TYPE__NodeEvent ":" -/** Base for control structures */ -#define SPA_TYPE_IO__Control SPA_TYPE_IO_BASE "Control" -#define SPA_TYPE_IO_CONTROL_BASE SPA_TYPE_IO__Control ":" +static const struct spa_type_info spa_type_node_event_id[] = { + { SPA_NODE_EVENT_Error, SPA_TYPE_NODE_EVENT_BASE "Error", SPA_TYPE_Int, }, + { SPA_NODE_EVENT_Buffering, SPA_TYPE_NODE_EVENT_BASE "Buffering", SPA_TYPE_Int, }, + { SPA_NODE_EVENT_RequestRefresh, SPA_TYPE_NODE_EVENT_BASE "RequestRefresh", SPA_TYPE_Int, }, + { 0, NULL, }, +}; -/** An io area to exchange buffers with a port */ -#define SPA_TYPE_IO__Buffers SPA_TYPE_IO_BASE "Buffers" +static const struct spa_type_info spa_type_node_event[] = { + { 0, SPA_TYPE_NODE_EVENT_BASE, SPA_TYPE_Enum, spa_type_node_event_id }, + { 0, NULL, }, +}; -/** IO area with clock information */ -#define SPA_TYPE_IO__Clock SPA_TYPE_IO_BASE "Clock" +#define SPA_TYPE__NodeCommand SPA_TYPE_COMMAND_BASE "Node" +#define SPA_TYPE_NODE_COMMAND_BASE SPA_TYPE__NodeCommand ":" -/** IO area with latency information */ -#define SPA_TYPE_IO__Latency SPA_TYPE_IO_BASE "Latency" +static const struct spa_type_info spa_type_node_command_id[] = { + { SPA_NODE_COMMAND_Suspend, SPA_TYPE_NODE_COMMAND_BASE "Suspend", SPA_TYPE_Int, }, + { SPA_NODE_COMMAND_Pause, SPA_TYPE_NODE_COMMAND_BASE "Pause", SPA_TYPE_Int, }, + { SPA_NODE_COMMAND_Start, SPA_TYPE_NODE_COMMAND_BASE "Start", SPA_TYPE_Int, }, + { SPA_NODE_COMMAND_Enable, SPA_TYPE_NODE_COMMAND_BASE "Enable", SPA_TYPE_Int, }, + { SPA_NODE_COMMAND_Disable, SPA_TYPE_NODE_COMMAND_BASE "Disable", SPA_TYPE_Int, }, + { SPA_NODE_COMMAND_Flush, SPA_TYPE_NODE_COMMAND_BASE "Flush", SPA_TYPE_Int, }, + { SPA_NODE_COMMAND_Drain, SPA_TYPE_NODE_COMMAND_BASE "Drain", SPA_TYPE_Int, }, + { SPA_NODE_COMMAND_Marker, SPA_TYPE_NODE_COMMAND_BASE "Marker", SPA_TYPE_Int, }, + { 0, NULL, }, +}; + +static const struct spa_type_info spa_type_node_command[] = { + { 0, SPA_TYPE_NODE_COMMAND_BASE, SPA_TYPE_Enum, spa_type_node_command_id }, + { 0, NULL, }, +}; #ifdef __cplusplus } /* extern "C" */ diff --git a/spa/include/spa/param/audio/raw-types.h b/spa/include/spa/param/audio/type-info.h similarity index 81% rename from spa/include/spa/param/audio/raw-types.h rename to spa/include/spa/param/audio/type-info.h index 2aca6fe25..70a2d39e7 100644 --- a/spa/include/spa/param/audio/raw-types.h +++ b/spa/include/spa/param/audio/type-info.h @@ -30,38 +30,38 @@ extern "C" { #define SPA_TYPE_AUDIO_FORMAT_BASE SPA_TYPE__AudioFormat ":" static const struct spa_type_info spa_type_audio_format[] = { - { SPA_AUDIO_FORMAT_UNKNOWN, SPA_TYPE_AUDIO_FORMAT_BASE "UNKNOWN", SPA_ID_Int, }, - { SPA_AUDIO_FORMAT_ENCODED, SPA_TYPE_AUDIO_FORMAT_BASE "ENCODED", SPA_ID_Int, }, - { SPA_AUDIO_FORMAT_S8, SPA_TYPE_AUDIO_FORMAT_BASE "S8", SPA_ID_Int, }, - { SPA_AUDIO_FORMAT_U8, SPA_TYPE_AUDIO_FORMAT_BASE "U8", SPA_ID_Int, }, - { SPA_AUDIO_FORMAT_S16_LE, SPA_TYPE_AUDIO_FORMAT_BASE "S16LE", SPA_ID_Int, }, - { SPA_AUDIO_FORMAT_S16_BE, SPA_TYPE_AUDIO_FORMAT_BASE "S16BE", SPA_ID_Int, }, - { SPA_AUDIO_FORMAT_U16_LE, SPA_TYPE_AUDIO_FORMAT_BASE "U16LE", SPA_ID_Int, }, - { SPA_AUDIO_FORMAT_U16_BE, SPA_TYPE_AUDIO_FORMAT_BASE "U16BE", SPA_ID_Int, }, - { SPA_AUDIO_FORMAT_S24_32_LE, SPA_TYPE_AUDIO_FORMAT_BASE "S24_32LE", SPA_ID_Int, }, - { SPA_AUDIO_FORMAT_S24_32_BE, SPA_TYPE_AUDIO_FORMAT_BASE "S24_32BE", SPA_ID_Int, }, - { SPA_AUDIO_FORMAT_U24_32_LE, SPA_TYPE_AUDIO_FORMAT_BASE "U24_32LE", SPA_ID_Int, }, - { SPA_AUDIO_FORMAT_U24_32_BE, SPA_TYPE_AUDIO_FORMAT_BASE "U24_32BE", SPA_ID_Int, }, - { SPA_AUDIO_FORMAT_S32_LE, SPA_TYPE_AUDIO_FORMAT_BASE "S32LE", SPA_ID_Int, }, - { SPA_AUDIO_FORMAT_S32_BE, SPA_TYPE_AUDIO_FORMAT_BASE "S32BE", SPA_ID_Int, }, - { SPA_AUDIO_FORMAT_U32_LE, SPA_TYPE_AUDIO_FORMAT_BASE "U32LE", SPA_ID_Int, }, - { SPA_AUDIO_FORMAT_U32_BE, SPA_TYPE_AUDIO_FORMAT_BASE "U32BE", SPA_ID_Int, }, - { SPA_AUDIO_FORMAT_S24_LE, SPA_TYPE_AUDIO_FORMAT_BASE "S24LE", SPA_ID_Int, }, - { SPA_AUDIO_FORMAT_S24_BE, SPA_TYPE_AUDIO_FORMAT_BASE "S24BE", SPA_ID_Int, }, - { SPA_AUDIO_FORMAT_U24_LE, SPA_TYPE_AUDIO_FORMAT_BASE "U24LE", SPA_ID_Int, }, - { SPA_AUDIO_FORMAT_U24_BE, SPA_TYPE_AUDIO_FORMAT_BASE "U24BE", SPA_ID_Int, }, - { SPA_AUDIO_FORMAT_S20_LE, SPA_TYPE_AUDIO_FORMAT_BASE "S20LE", SPA_ID_Int, }, - { SPA_AUDIO_FORMAT_S20_BE, SPA_TYPE_AUDIO_FORMAT_BASE "S20BE", SPA_ID_Int, }, - { SPA_AUDIO_FORMAT_U20_LE, SPA_TYPE_AUDIO_FORMAT_BASE "U20LE", SPA_ID_Int, }, - { SPA_AUDIO_FORMAT_U20_BE, SPA_TYPE_AUDIO_FORMAT_BASE "U20BE", SPA_ID_Int, }, - { SPA_AUDIO_FORMAT_S18_LE, SPA_TYPE_AUDIO_FORMAT_BASE "S18LE", SPA_ID_Int, }, - { SPA_AUDIO_FORMAT_S18_BE, SPA_TYPE_AUDIO_FORMAT_BASE "S18BE", SPA_ID_Int, }, - { SPA_AUDIO_FORMAT_U18_LE, SPA_TYPE_AUDIO_FORMAT_BASE "U18LE", SPA_ID_Int, }, - { SPA_AUDIO_FORMAT_U18_BE, SPA_TYPE_AUDIO_FORMAT_BASE "U18BE", SPA_ID_Int, }, - { SPA_AUDIO_FORMAT_F32_LE, SPA_TYPE_AUDIO_FORMAT_BASE "F32LE", SPA_ID_Int, }, - { SPA_AUDIO_FORMAT_F32_BE, SPA_TYPE_AUDIO_FORMAT_BASE "F32BE", SPA_ID_Int, }, - { SPA_AUDIO_FORMAT_F64_LE, SPA_TYPE_AUDIO_FORMAT_BASE "F64LE", SPA_ID_Int, }, - { SPA_AUDIO_FORMAT_F64_BE, SPA_TYPE_AUDIO_FORMAT_BASE "F64BE", SPA_ID_Int, }, + { SPA_AUDIO_FORMAT_UNKNOWN, SPA_TYPE_AUDIO_FORMAT_BASE "UNKNOWN", SPA_TYPE_Int, }, + { SPA_AUDIO_FORMAT_ENCODED, SPA_TYPE_AUDIO_FORMAT_BASE "ENCODED", SPA_TYPE_Int, }, + { SPA_AUDIO_FORMAT_S8, SPA_TYPE_AUDIO_FORMAT_BASE "S8", SPA_TYPE_Int, }, + { SPA_AUDIO_FORMAT_U8, SPA_TYPE_AUDIO_FORMAT_BASE "U8", SPA_TYPE_Int, }, + { SPA_AUDIO_FORMAT_S16_LE, SPA_TYPE_AUDIO_FORMAT_BASE "S16LE", SPA_TYPE_Int, }, + { SPA_AUDIO_FORMAT_S16_BE, SPA_TYPE_AUDIO_FORMAT_BASE "S16BE", SPA_TYPE_Int, }, + { SPA_AUDIO_FORMAT_U16_LE, SPA_TYPE_AUDIO_FORMAT_BASE "U16LE", SPA_TYPE_Int, }, + { SPA_AUDIO_FORMAT_U16_BE, SPA_TYPE_AUDIO_FORMAT_BASE "U16BE", SPA_TYPE_Int, }, + { SPA_AUDIO_FORMAT_S24_32_LE, SPA_TYPE_AUDIO_FORMAT_BASE "S24_32LE", SPA_TYPE_Int, }, + { SPA_AUDIO_FORMAT_S24_32_BE, SPA_TYPE_AUDIO_FORMAT_BASE "S24_32BE", SPA_TYPE_Int, }, + { SPA_AUDIO_FORMAT_U24_32_LE, SPA_TYPE_AUDIO_FORMAT_BASE "U24_32LE", SPA_TYPE_Int, }, + { SPA_AUDIO_FORMAT_U24_32_BE, SPA_TYPE_AUDIO_FORMAT_BASE "U24_32BE", SPA_TYPE_Int, }, + { SPA_AUDIO_FORMAT_S32_LE, SPA_TYPE_AUDIO_FORMAT_BASE "S32LE", SPA_TYPE_Int, }, + { SPA_AUDIO_FORMAT_S32_BE, SPA_TYPE_AUDIO_FORMAT_BASE "S32BE", SPA_TYPE_Int, }, + { SPA_AUDIO_FORMAT_U32_LE, SPA_TYPE_AUDIO_FORMAT_BASE "U32LE", SPA_TYPE_Int, }, + { SPA_AUDIO_FORMAT_U32_BE, SPA_TYPE_AUDIO_FORMAT_BASE "U32BE", SPA_TYPE_Int, }, + { SPA_AUDIO_FORMAT_S24_LE, SPA_TYPE_AUDIO_FORMAT_BASE "S24LE", SPA_TYPE_Int, }, + { SPA_AUDIO_FORMAT_S24_BE, SPA_TYPE_AUDIO_FORMAT_BASE "S24BE", SPA_TYPE_Int, }, + { SPA_AUDIO_FORMAT_U24_LE, SPA_TYPE_AUDIO_FORMAT_BASE "U24LE", SPA_TYPE_Int, }, + { SPA_AUDIO_FORMAT_U24_BE, SPA_TYPE_AUDIO_FORMAT_BASE "U24BE", SPA_TYPE_Int, }, + { SPA_AUDIO_FORMAT_S20_LE, SPA_TYPE_AUDIO_FORMAT_BASE "S20LE", SPA_TYPE_Int, }, + { SPA_AUDIO_FORMAT_S20_BE, SPA_TYPE_AUDIO_FORMAT_BASE "S20BE", SPA_TYPE_Int, }, + { SPA_AUDIO_FORMAT_U20_LE, SPA_TYPE_AUDIO_FORMAT_BASE "U20LE", SPA_TYPE_Int, }, + { SPA_AUDIO_FORMAT_U20_BE, SPA_TYPE_AUDIO_FORMAT_BASE "U20BE", SPA_TYPE_Int, }, + { SPA_AUDIO_FORMAT_S18_LE, SPA_TYPE_AUDIO_FORMAT_BASE "S18LE", SPA_TYPE_Int, }, + { SPA_AUDIO_FORMAT_S18_BE, SPA_TYPE_AUDIO_FORMAT_BASE "S18BE", SPA_TYPE_Int, }, + { SPA_AUDIO_FORMAT_U18_LE, SPA_TYPE_AUDIO_FORMAT_BASE "U18LE", SPA_TYPE_Int, }, + { SPA_AUDIO_FORMAT_U18_BE, SPA_TYPE_AUDIO_FORMAT_BASE "U18BE", SPA_TYPE_Int, }, + { SPA_AUDIO_FORMAT_F32_LE, SPA_TYPE_AUDIO_FORMAT_BASE "F32LE", SPA_TYPE_Int, }, + { SPA_AUDIO_FORMAT_F32_BE, SPA_TYPE_AUDIO_FORMAT_BASE "F32BE", SPA_TYPE_Int, }, + { SPA_AUDIO_FORMAT_F64_LE, SPA_TYPE_AUDIO_FORMAT_BASE "F64LE", SPA_TYPE_Int, }, + { SPA_AUDIO_FORMAT_F64_BE, SPA_TYPE_AUDIO_FORMAT_BASE "F64BE", SPA_TYPE_Int, }, { 0, NULL, }, }; @@ -69,8 +69,8 @@ static const struct spa_type_info spa_type_audio_format[] = { #define SPA_TYPE_AUDIO_FLAGS_BASE SPA_TYPE__AudioFlags ":" static const struct spa_type_info spa_type_audio_flags[] = { - { SPA_AUDIO_FLAG_NONE, SPA_TYPE_AUDIO_FLAGS_BASE "none", SPA_ID_Int, }, - { SPA_AUDIO_FLAG_UNPOSITIONED, SPA_TYPE_AUDIO_FLAGS_BASE "unpositioned", SPA_ID_Int, }, + { SPA_AUDIO_FLAG_NONE, SPA_TYPE_AUDIO_FLAGS_BASE "none", SPA_TYPE_Int, }, + { SPA_AUDIO_FLAG_UNPOSITIONED, SPA_TYPE_AUDIO_FLAGS_BASE "unpositioned", SPA_TYPE_Int, }, { 0, NULL, }, }; @@ -78,8 +78,8 @@ static const struct spa_type_info spa_type_audio_flags[] = { #define SPA_TYPE_AUDIO_ENUM_BASE SPA_TYPE__AudioLayout ":" static const struct spa_type_info spa_type_audio_layout[] = { - { SPA_AUDIO_LAYOUT_INTERLEAVED, SPA_TYPE_AUDIO_ENUM_BASE "interleaved", SPA_ID_Int, }, - { SPA_AUDIO_LAYOUT_NON_INTERLEAVED, SPA_TYPE_AUDIO_ENUM_BASE "non-interleaved", SPA_ID_Int, }, + { SPA_AUDIO_LAYOUT_INTERLEAVED, SPA_TYPE_AUDIO_ENUM_BASE "interleaved", SPA_TYPE_Int, }, + { SPA_AUDIO_LAYOUT_NON_INTERLEAVED, SPA_TYPE_AUDIO_ENUM_BASE "non-interleaved", SPA_TYPE_Int, }, { 0, NULL, }, }; diff --git a/spa/include/spa/param/format-types.h b/spa/include/spa/param/format-types.h deleted file mode 100644 index 8036c79c5..000000000 --- a/spa/include/spa/param/format-types.h +++ /dev/null @@ -1,129 +0,0 @@ -/* Simple Plugin API - * Copyright (C) 2016 Wim Taymans - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef __SPA_PARAM_FORMAT_TYPES_H__ -#define __SPA_PARAM_FORMAT_TYPES_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#define SPA_TYPE__Format SPA_TYPE_PARAM_BASE "Format" -#define SPA_TYPE_FORMAT_BASE SPA_TYPE__Format ":" - -#define SPA_TYPE__MediaType SPA_TYPE_ENUM_BASE "MediaType" -#define SPA_TYPE_MEDIA_TYPE_BASE SPA_TYPE__MediaType ":" - -#include -#include - -static const struct spa_type_info spa_type_media_type[] = { - { SPA_MEDIA_TYPE_audio, SPA_TYPE_MEDIA_TYPE_BASE "audio", SPA_ID_Int, }, - { SPA_MEDIA_TYPE_video, SPA_TYPE_MEDIA_TYPE_BASE "video", SPA_ID_Int, }, - { SPA_MEDIA_TYPE_image, SPA_TYPE_MEDIA_TYPE_BASE "image", SPA_ID_Int, }, - { SPA_MEDIA_TYPE_binary, SPA_TYPE_MEDIA_TYPE_BASE "binary", SPA_ID_Int, }, - { SPA_MEDIA_TYPE_stream, SPA_TYPE_MEDIA_TYPE_BASE "stream", SPA_ID_Int, }, - { 0, NULL, }, -}; - -#define SPA_TYPE__MediaSubtype SPA_TYPE_ENUM_BASE "MediaSubtype" -#define SPA_TYPE_MEDIA_SUBTYPE_BASE SPA_TYPE__MediaSubtype ":" - -static const struct spa_type_info spa_type_media_subtype[] = { - /* generic subtypes */ - { SPA_MEDIA_SUBTYPE_raw, SPA_TYPE_MEDIA_SUBTYPE_BASE "raw", SPA_ID_Int, }, - /* audio subtypes */ - { SPA_MEDIA_SUBTYPE_mp3, SPA_TYPE_MEDIA_SUBTYPE_BASE "mp3", SPA_ID_Int, }, - { SPA_MEDIA_SUBTYPE_aac, SPA_TYPE_MEDIA_SUBTYPE_BASE "aac", SPA_ID_Int, }, - { SPA_MEDIA_SUBTYPE_vorbis, SPA_TYPE_MEDIA_SUBTYPE_BASE "vorbis", SPA_ID_Int, }, - { SPA_MEDIA_SUBTYPE_wma, SPA_TYPE_MEDIA_SUBTYPE_BASE "wma", SPA_ID_Int, }, - { SPA_MEDIA_SUBTYPE_ra, SPA_TYPE_MEDIA_SUBTYPE_BASE "ra", SPA_ID_Int, }, - { SPA_MEDIA_SUBTYPE_sbc, SPA_TYPE_MEDIA_SUBTYPE_BASE "sbc", SPA_ID_Int, }, - { SPA_MEDIA_SUBTYPE_adpcm, SPA_TYPE_MEDIA_SUBTYPE_BASE "adpcm", SPA_ID_Int, }, - { SPA_MEDIA_SUBTYPE_g723, SPA_TYPE_MEDIA_SUBTYPE_BASE "g723", SPA_ID_Int, }, - { SPA_MEDIA_SUBTYPE_g726, SPA_TYPE_MEDIA_SUBTYPE_BASE "g726", SPA_ID_Int, }, - { SPA_MEDIA_SUBTYPE_g729, SPA_TYPE_MEDIA_SUBTYPE_BASE "g729", SPA_ID_Int, }, - { SPA_MEDIA_SUBTYPE_amr, SPA_TYPE_MEDIA_SUBTYPE_BASE "amr", SPA_ID_Int, }, - { SPA_MEDIA_SUBTYPE_gsm, SPA_TYPE_MEDIA_SUBTYPE_BASE "gsm", SPA_ID_Int, }, - /* video subtypes */ - { SPA_MEDIA_SUBTYPE_h264, SPA_TYPE_MEDIA_SUBTYPE_BASE "h264", SPA_ID_Int, }, - { SPA_MEDIA_SUBTYPE_mjpg, SPA_TYPE_MEDIA_SUBTYPE_BASE "mjpg", SPA_ID_Int, }, - { SPA_MEDIA_SUBTYPE_dv, SPA_TYPE_MEDIA_SUBTYPE_BASE "dv", SPA_ID_Int, }, - { SPA_MEDIA_SUBTYPE_mpegts, SPA_TYPE_MEDIA_SUBTYPE_BASE "mpegts", SPA_ID_Int, }, - { SPA_MEDIA_SUBTYPE_h263, SPA_TYPE_MEDIA_SUBTYPE_BASE "h263", SPA_ID_Int, }, - { SPA_MEDIA_SUBTYPE_mpeg1, SPA_TYPE_MEDIA_SUBTYPE_BASE "mpeg1", SPA_ID_Int, }, - { SPA_MEDIA_SUBTYPE_mpeg2, SPA_TYPE_MEDIA_SUBTYPE_BASE "mpeg2", SPA_ID_Int, }, - { SPA_MEDIA_SUBTYPE_mpeg4, SPA_TYPE_MEDIA_SUBTYPE_BASE "mpeg4", SPA_ID_Int, }, - { SPA_MEDIA_SUBTYPE_xvid, SPA_TYPE_MEDIA_SUBTYPE_BASE "xvid", SPA_ID_Int, }, - { SPA_MEDIA_SUBTYPE_vc1, SPA_TYPE_MEDIA_SUBTYPE_BASE "vc1", SPA_ID_Int, }, - { SPA_MEDIA_SUBTYPE_vp8, SPA_TYPE_MEDIA_SUBTYPE_BASE "vp8", SPA_ID_Int, }, - { SPA_MEDIA_SUBTYPE_vp9, SPA_TYPE_MEDIA_SUBTYPE_BASE "vp9", SPA_ID_Int, }, - { SPA_MEDIA_SUBTYPE_jpeg, SPA_TYPE_MEDIA_SUBTYPE_BASE "jpeg", SPA_ID_Int, }, - { SPA_MEDIA_SUBTYPE_bayer, SPA_TYPE_MEDIA_SUBTYPE_BASE "bayer", SPA_ID_Int, }, - - { SPA_MEDIA_SUBTYPE_midi, SPA_TYPE_MEDIA_SUBTYPE_BASE "midi", SPA_ID_Int, }, - { 0, NULL, }, -}; - -#define SPA_TYPE__FormatAudio SPA_TYPE_FORMAT_BASE "Audio" -#define SPA_TYPE_FORMAT_AUDIO_BASE SPA_TYPE__FormatAudio ":" - -#define SPA_TYPE__FormatVideo SPA_TYPE_FORMAT_BASE "Video" -#define SPA_TYPE_FORMAT_VIDEO_BASE SPA_TYPE__FormatVideo ":" - -static const struct spa_type_info spa_type_format[] = { - { SPA_FORMAT_AUDIO_format, SPA_TYPE_FORMAT_AUDIO_BASE "format", SPA_ID_Enum, - spa_type_audio_format }, - { SPA_FORMAT_AUDIO_flags, SPA_TYPE_FORMAT_AUDIO_BASE "flags", SPA_ID_Enum, - spa_type_audio_flags }, - { SPA_FORMAT_AUDIO_layout, SPA_TYPE_FORMAT_AUDIO_BASE "layout", SPA_ID_Enum, - spa_type_audio_layout }, - { SPA_FORMAT_AUDIO_rate, SPA_TYPE_FORMAT_AUDIO_BASE "rate", SPA_ID_Int, }, - { SPA_FORMAT_AUDIO_channels, SPA_TYPE_FORMAT_AUDIO_BASE "channels", SPA_ID_Int, }, - { SPA_FORMAT_AUDIO_channelMask, SPA_TYPE_FORMAT_AUDIO_BASE "channelMask", SPA_ID_Int, }, - - { SPA_FORMAT_VIDEO_format, SPA_TYPE_FORMAT_VIDEO_BASE "format", SPA_ID_Enum, - spa_type_video_format, }, - { SPA_FORMAT_VIDEO_size, SPA_TYPE_FORMAT_VIDEO_BASE "size", SPA_ID_Rectangle, }, - { SPA_FORMAT_VIDEO_framerate, SPA_TYPE_FORMAT_VIDEO_BASE "framerate", SPA_ID_Fraction, }, - { SPA_FORMAT_VIDEO_maxFramerate, SPA_TYPE_FORMAT_VIDEO_BASE "maxFramerate", SPA_ID_Fraction, }, - { SPA_FORMAT_VIDEO_views, SPA_TYPE_FORMAT_VIDEO_BASE "views", SPA_ID_Int, }, - { SPA_FORMAT_VIDEO_interlaceMode, SPA_TYPE_FORMAT_VIDEO_BASE "interlaceMode", SPA_ID_Int, }, - { SPA_FORMAT_VIDEO_pixelAspectRatio, SPA_TYPE_FORMAT_VIDEO_BASE "pixelAspectRatio", SPA_ID_Int, }, - { SPA_FORMAT_VIDEO_multiviewMode, SPA_TYPE_FORMAT_VIDEO_BASE "multiviewMode", SPA_ID_Int, }, - { SPA_FORMAT_VIDEO_multiviewFlags, SPA_TYPE_FORMAT_VIDEO_BASE "multiviewFlags", SPA_ID_Int, }, - { SPA_FORMAT_VIDEO_chromaSite, SPA_TYPE_FORMAT_VIDEO_BASE "chromaSite", SPA_ID_Int, }, - { SPA_FORMAT_VIDEO_colorRange, SPA_TYPE_FORMAT_VIDEO_BASE "colorRange", SPA_ID_Int, }, - { SPA_FORMAT_VIDEO_colorMatrix, SPA_TYPE_FORMAT_VIDEO_BASE "colorMatrix", SPA_ID_Int, }, - { SPA_FORMAT_VIDEO_transferFunction, SPA_TYPE_FORMAT_VIDEO_BASE "transferFunction", SPA_ID_Int, }, - { SPA_FORMAT_VIDEO_colorPrimaries, SPA_TYPE_FORMAT_VIDEO_BASE "colorPrimaries", SPA_ID_Int, }, - { SPA_FORMAT_VIDEO_profile, SPA_TYPE_FORMAT_VIDEO_BASE "profile", SPA_ID_Int, }, - { SPA_FORMAT_VIDEO_level, SPA_TYPE_FORMAT_VIDEO_BASE "level", SPA_ID_Int, }, - { SPA_FORMAT_VIDEO_streamFormat, SPA_TYPE_FORMAT_VIDEO_BASE "streamFormat", SPA_ID_Int, }, - { SPA_FORMAT_VIDEO_alignment, SPA_TYPE_FORMAT_VIDEO_BASE "alignment", SPA_ID_Int, }, - { 0, NULL, }, -}; - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* __SPA_PARAM_FORMAT_TYPES_H__ */ diff --git a/spa/include/spa/param/format.h b/spa/include/spa/param/format.h index 16105c8d8..3ebed5d70 100644 --- a/spa/include/spa/param/format.h +++ b/spa/include/spa/param/format.h @@ -26,7 +26,7 @@ extern "C" { #include -/** media type for SPA_ID_OBJECT_Format */ +/** media type for SPA_TYPE_OBJECT_Format */ enum spa_media_type { SPA_MEDIA_TYPE_audio, SPA_MEDIA_TYPE_video, @@ -35,12 +35,12 @@ enum spa_media_type { SPA_MEDIA_TYPE_stream, }; -/** media subtype for SPA_ID_OBJECT_Format */ +/** media subtype for SPA_TYPE_OBJECT_Format */ enum spa_media_subtype { - SPA_MEDIA_SUBTYPE_BASE_Generic, + SPA_MEDIA_SUBTYPE_START_Generic, SPA_MEDIA_SUBTYPE_raw, - SPA_MEDIA_SUBTYPE_BASE_Audio = 0x10000, + SPA_MEDIA_SUBTYPE_START_Audio = 0x10000, SPA_MEDIA_SUBTYPE_mp3, SPA_MEDIA_SUBTYPE_aac, SPA_MEDIA_SUBTYPE_vorbis, @@ -54,7 +54,7 @@ enum spa_media_subtype { SPA_MEDIA_SUBTYPE_amr, SPA_MEDIA_SUBTYPE_gsm, - SPA_MEDIA_SUBTYPE_BASE_Video = 0x20000, + SPA_MEDIA_SUBTYPE_START_Video = 0x20000, SPA_MEDIA_SUBTYPE_h264, SPA_MEDIA_SUBTYPE_mjpg, SPA_MEDIA_SUBTYPE_dv, @@ -70,19 +70,23 @@ enum spa_media_subtype { SPA_MEDIA_SUBTYPE_jpeg, SPA_MEDIA_SUBTYPE_bayer, - SPA_MEDIA_SUBTYPE_BASE_Image = 0x30000, + SPA_MEDIA_SUBTYPE_START_Image = 0x30000, - SPA_MEDIA_SUBTYPE_BASE_Binary = 0x40000, + SPA_MEDIA_SUBTYPE_START_Binary = 0x40000, - SPA_MEDIA_SUBTYPE_BASE_Stream = 0x50000, + SPA_MEDIA_SUBTYPE_START_Stream = 0x50000, SPA_MEDIA_SUBTYPE_midi, }; -/** properties for audio SPA_ID_OBJECT_Format */ +/** properties for audio SPA_TYPE_OBJECT_Format */ enum spa_format { + SPA_FORMAT_START, /**< id of the object, one of enum spa_param_type */ + + SPA_FORMAT_MediaType, /**< first int in object, one of enum spa_media_type */ + SPA_FORMAT_MediaSubtype, /**< second int in object, one of enum spa_media_subtype */ /* Audio format keys */ - SPA_FORMAT_BASE_AUDIO = 0, + SPA_FORMAT_START_AUDIO, SPA_FORMAT_AUDIO_format, SPA_FORMAT_AUDIO_flags, SPA_FORMAT_AUDIO_layout, @@ -91,7 +95,7 @@ enum spa_format { SPA_FORMAT_AUDIO_channelMask, /* Video Format keys */ - SPA_FORMAT_BASE_VIDEO = 0x10000, + SPA_FORMAT_START_VIDEO = 0x10000, SPA_FORMAT_VIDEO_format, SPA_FORMAT_VIDEO_size, SPA_FORMAT_VIDEO_framerate, @@ -112,11 +116,11 @@ enum spa_format { SPA_FORMAT_VIDEO_alignment, /* Image Format keys */ - SPA_FORMAT_BASE_IMAGE = 0x20000, + SPA_FORMAT_START_IMAGE = 0x20000, /* Binary Format keys */ - SPA_FORMAT_BASE_BINARY = 0x30000, + SPA_FORMAT_START_BINARY = 0x30000, /* Stream Format keys */ - SPA_FORMAT_BASE_STREAM = 0x40000, + SPA_FORMAT_START_STREAM = 0x40000, }; #ifdef __cplusplus diff --git a/spa/include/spa/param/param.h b/spa/include/spa/param/param.h index 9d91f84f8..7b8aeda6b 100644 --- a/spa/include/spa/param/param.h +++ b/spa/include/spa/param/param.h @@ -38,13 +38,15 @@ enum spa_param_type { SPA_PARAM_IO, /**< configurable IO areas */ }; -/** Properties for SPA_ID_OBJECT_ParamList */ +/** Properties for SPA_TYPE_OBJECT_ParamList */ enum spa_param_list { + SPA_PARAM_LIST_START, /**< object id, one of enum spa_param_type */ SPA_PARAM_LIST_id, /**< id of the supported list param */ }; -/** properties for SPA_ID_OBJECT_ParamBuffers */ +/** properties for SPA_TYPE_OBJECT_ParamBuffers */ enum spa_param_buffers { + SPA_PARAM_BUFFERS_START, /**< object id, one of enum spa_param_type */ SPA_PARAM_BUFFERS_buffers, /**< number of buffers */ SPA_PARAM_BUFFERS_blocks, /**< number of data blocks per buffer */ SPA_PARAM_BUFFERS_size, /**< size of a data block memory */ @@ -52,14 +54,16 @@ enum spa_param_buffers { SPA_PARAM_BUFFERS_align, /**< alignment of data block memory */ }; -/** properties for SPA_ID_OBJECT_ParamMeta */ +/** properties for SPA_TYPE_OBJECT_ParamMeta */ enum spa_param_meta { + SPA_PARAM_META_START, /**< object id, one of enum spa_param_type */ SPA_PARAM_META_type, /**< the metadata, one of enum spa_meta_type */ SPA_PARAM_META_size, /**< the expected maximum size the meta */ }; -/** properties for SPA_ID_OBJECT_ParamIO */ +/** properties for SPA_TYPE_OBJECT_ParamIO */ enum spa_param_io { + SPA_PARAM_IO_START, /**< object id, one of enum spa_param_type */ SPA_PARAM_IO_id, /**< type ID, uniquely identifies the io area */ SPA_PARAM_IO_size, /**< size of the io area */ }; diff --git a/spa/include/spa/param/props.h b/spa/include/spa/param/props.h index ead58f568..a8e2628ce 100644 --- a/spa/include/spa/param/props.h +++ b/spa/include/spa/param/props.h @@ -26,8 +26,9 @@ extern "C" { #include -/** properties of SPA_ID_OBJECT_PropInfo */ +/** properties of SPA_TYPE_OBJECT_PropInfo */ enum spa_prop_info { + SPA_PROP_INFO_START, /**< id of object, one of enum spa_param_type */ SPA_PROP_INFO_id, /**< associated id of the property */ SPA_PROP_INFO_name, /**< name of the property */ SPA_PROP_INFO_type, /**< type and range/enums of property */ @@ -38,11 +39,11 @@ enum spa_prop_info { * for the value. */ }; -/** predefined properties for SPA_ID_OBJECT_Props */ +/** predefined properties for SPA_TYPE_OBJECT_Props */ enum spa_prop { - SPA_PROP_BASE_GENERIC = 0x0, + SPA_PROP_START, /**< id of object, one of enum spa_param_type */ - SPA_PROP_unknown, /**< an unknown property */ + SPA_PROP_unknown, /**< an unknown property */ SPA_PROP_device, SPA_PROP_deviceName, @@ -74,7 +75,7 @@ enum spa_prop { SPA_PROP_gain, SPA_PROP_sharpness, - SPA_PROP_BASE_CUSTOM = 0x10000, + SPA_PROP_START_CUSTOM = 0x10000, }; #ifdef __cplusplus diff --git a/spa/include/spa/param/type-info.h b/spa/include/spa/param/type-info.h index 81fb1c4b2..6f1b8bf85 100644 --- a/spa/include/spa/param/type-info.h +++ b/spa/include/spa/param/type-info.h @@ -27,6 +27,23 @@ extern "C" { #include #include #include +#include + +/* base for parameter object enumerations */ +#define SPA_TYPE__ParamId SPA_TYPE_ENUM_BASE "ParamId" +#define SPA_TYPE_PARAM_ID_BASE SPA_TYPE__ParamId ":" + +static const struct spa_type_info spa_type_param[] = { + { SPA_PARAM_List, SPA_TYPE_PARAM_ID_BASE "List", SPA_TYPE_Int, }, + { SPA_PARAM_PropInfo, SPA_TYPE_PARAM_ID_BASE "PropInfo", SPA_TYPE_Int, }, + { SPA_PARAM_Props, SPA_TYPE_PARAM_ID_BASE "Props", SPA_TYPE_Int, }, + { SPA_PARAM_EnumFormat, SPA_TYPE_PARAM_ID_BASE "EnumFormat", SPA_TYPE_Int, }, + { SPA_PARAM_Format, SPA_TYPE_PARAM_ID_BASE "Format", SPA_TYPE_Int, }, + { SPA_PARAM_Buffers, SPA_TYPE_PARAM_ID_BASE "Buffers", SPA_TYPE_Int, }, + { SPA_PARAM_Meta, SPA_TYPE_PARAM_ID_BASE "Meta", SPA_TYPE_Int, }, + { SPA_PARAM_IO, SPA_TYPE_PARAM_ID_BASE "IO", SPA_TYPE_Int, }, + { 0, NULL, }, +}; /* base for parameter objects */ #define SPA_TYPE__Param SPA_TYPE_OBJECT_BASE "Param" @@ -37,7 +54,8 @@ extern "C" { #define SPA_TYPE_PARAM_LIST_BASE SPA_TYPE_PARAM__List ":" static const struct spa_type_info spa_type_param_list[] = { - { SPA_PARAM_LIST_id, SPA_TYPE_PARAM_LIST_BASE "id", SPA_ID_Enum, }, + { SPA_PARAM_LIST_START, SPA_TYPE_PARAM_LIST_BASE, SPA_TYPE_Enum, spa_type_param }, + { SPA_PARAM_LIST_id, SPA_TYPE_PARAM_LIST_BASE "id", SPA_TYPE_Enum, }, { 0, NULL, }, }; @@ -45,33 +63,34 @@ static const struct spa_type_info spa_type_param_list[] = { #define SPA_TYPE_PROPS_BASE SPA_TYPE__Props ":" static const struct spa_type_info spa_type_props[] = { - { SPA_PROP_unknown, SPA_TYPE_PROPS_BASE "unknown", SPA_ID_INVALID, }, - { SPA_PROP_device, SPA_TYPE_PROPS_BASE "device", SPA_ID_String, }, - { SPA_PROP_deviceName, SPA_TYPE_PROPS_BASE "deviceName", SPA_ID_String, }, - { SPA_PROP_deviceFd, SPA_TYPE_PROPS_BASE "deviceFd", SPA_ID_Fd, }, - { SPA_PROP_card, SPA_TYPE_PROPS_BASE "card", SPA_ID_String, }, - { SPA_PROP_cardName, SPA_TYPE_PROPS_BASE "cardName", SPA_ID_String, }, - { SPA_PROP_minLatency, SPA_TYPE_PROPS_BASE "minLatency", SPA_ID_Int, }, - { SPA_PROP_maxLatency, SPA_TYPE_PROPS_BASE "maxLatency", SPA_ID_Int, }, - { SPA_PROP_periods, SPA_TYPE_PROPS_BASE "periods", SPA_ID_Int, }, - { SPA_PROP_periodSize, SPA_TYPE_PROPS_BASE "periodSize", SPA_ID_Int, }, - { SPA_PROP_periodEvent, SPA_TYPE_PROPS_BASE "periodEvent", SPA_ID_Bool, }, - { SPA_PROP_live, SPA_TYPE_PROPS_BASE "live", SPA_ID_Bool, }, - { SPA_PROP_waveType, SPA_TYPE_PROPS_BASE "waveType", SPA_ID_Enum, }, - { SPA_PROP_frequency, SPA_TYPE_PROPS_BASE "frequency", SPA_ID_Int, }, - { SPA_PROP_volume, SPA_TYPE_PROPS_BASE "volume", SPA_ID_Float, }, - { SPA_PROP_mute, SPA_TYPE_PROPS_BASE "mute", SPA_ID_Bool, }, - { SPA_PROP_patternType, SPA_TYPE_PROPS_BASE "patternType", SPA_ID_Enum, }, - { SPA_PROP_ditherType, SPA_TYPE_PROPS_BASE "ditherType", SPA_ID_Enum, }, - { SPA_PROP_truncate, SPA_TYPE_PROPS_BASE "truncate", SPA_ID_Bool, }, - { SPA_PROP_brightness, SPA_TYPE_PROPS_BASE "brightness", SPA_ID_Int, }, - { SPA_PROP_contrast, SPA_TYPE_PROPS_BASE "contrast", SPA_ID_Int, }, - { SPA_PROP_saturation, SPA_TYPE_PROPS_BASE "saturation", SPA_ID_Int, }, - { SPA_PROP_hue, SPA_TYPE_PROPS_BASE "hue", SPA_ID_Int, }, - { SPA_PROP_gamma, SPA_TYPE_PROPS_BASE "gamma", SPA_ID_Int, }, - { SPA_PROP_exposure, SPA_TYPE_PROPS_BASE "exposure", SPA_ID_Int, }, - { SPA_PROP_gain, SPA_TYPE_PROPS_BASE "gain", SPA_ID_Int, }, - { SPA_PROP_sharpness, SPA_TYPE_PROPS_BASE "sharpness", SPA_ID_Int, }, + { SPA_PROP_START, SPA_TYPE_PROPS_BASE, SPA_TYPE_Enum, spa_type_param, }, + { SPA_PROP_unknown, SPA_TYPE_PROPS_BASE "unknown", SPA_TYPE_None, }, + { SPA_PROP_device, SPA_TYPE_PROPS_BASE "device", SPA_TYPE_String, }, + { SPA_PROP_deviceName, SPA_TYPE_PROPS_BASE "deviceName", SPA_TYPE_String, }, + { SPA_PROP_deviceFd, SPA_TYPE_PROPS_BASE "deviceFd", SPA_TYPE_Fd, }, + { SPA_PROP_card, SPA_TYPE_PROPS_BASE "card", SPA_TYPE_String, }, + { SPA_PROP_cardName, SPA_TYPE_PROPS_BASE "cardName", SPA_TYPE_String, }, + { SPA_PROP_minLatency, SPA_TYPE_PROPS_BASE "minLatency", SPA_TYPE_Int, }, + { SPA_PROP_maxLatency, SPA_TYPE_PROPS_BASE "maxLatency", SPA_TYPE_Int, }, + { SPA_PROP_periods, SPA_TYPE_PROPS_BASE "periods", SPA_TYPE_Int, }, + { SPA_PROP_periodSize, SPA_TYPE_PROPS_BASE "periodSize", SPA_TYPE_Int, }, + { SPA_PROP_periodEvent, SPA_TYPE_PROPS_BASE "periodEvent", SPA_TYPE_Bool, }, + { SPA_PROP_live, SPA_TYPE_PROPS_BASE "live", SPA_TYPE_Bool, }, + { SPA_PROP_waveType, SPA_TYPE_PROPS_BASE "waveType", SPA_TYPE_Enum, }, + { SPA_PROP_frequency, SPA_TYPE_PROPS_BASE "frequency", SPA_TYPE_Int, }, + { SPA_PROP_volume, SPA_TYPE_PROPS_BASE "volume", SPA_TYPE_Float, }, + { SPA_PROP_mute, SPA_TYPE_PROPS_BASE "mute", SPA_TYPE_Bool, }, + { SPA_PROP_patternType, SPA_TYPE_PROPS_BASE "patternType", SPA_TYPE_Enum, }, + { SPA_PROP_ditherType, SPA_TYPE_PROPS_BASE "ditherType", SPA_TYPE_Enum, }, + { SPA_PROP_truncate, SPA_TYPE_PROPS_BASE "truncate", SPA_TYPE_Bool, }, + { SPA_PROP_brightness, SPA_TYPE_PROPS_BASE "brightness", SPA_TYPE_Int, }, + { SPA_PROP_contrast, SPA_TYPE_PROPS_BASE "contrast", SPA_TYPE_Int, }, + { SPA_PROP_saturation, SPA_TYPE_PROPS_BASE "saturation", SPA_TYPE_Int, }, + { SPA_PROP_hue, SPA_TYPE_PROPS_BASE "hue", SPA_TYPE_Int, }, + { SPA_PROP_gamma, SPA_TYPE_PROPS_BASE "gamma", SPA_TYPE_Int, }, + { SPA_PROP_exposure, SPA_TYPE_PROPS_BASE "exposure", SPA_TYPE_Int, }, + { SPA_PROP_gain, SPA_TYPE_PROPS_BASE "gain", SPA_TYPE_Int, }, + { SPA_PROP_sharpness, SPA_TYPE_PROPS_BASE "sharpness", SPA_TYPE_Int, }, { 0, NULL, }, }; @@ -80,10 +99,11 @@ static const struct spa_type_info spa_type_props[] = { #define SPA_TYPE_PROP_INFO_BASE SPA_TYPE__PropInfo ":" static const struct spa_type_info spa_type_prop_info[] = { - { SPA_PROP_INFO_id, SPA_TYPE_PROP_INFO_BASE "id", SPA_ID_Enum, spa_type_props }, - { SPA_PROP_INFO_name, SPA_TYPE_PROP_INFO_BASE "name", SPA_ID_String, }, - { SPA_PROP_INFO_type, SPA_TYPE_PROP_INFO_BASE "type", SPA_ID_Prop, }, - { SPA_PROP_INFO_labels, SPA_TYPE_PROP_INFO_BASE "labels", SPA_ID_Struct, }, + { SPA_PROP_INFO_START, SPA_TYPE_PROP_INFO_BASE, SPA_TYPE_Enum, spa_type_param, }, + { SPA_PROP_INFO_id, SPA_TYPE_PROP_INFO_BASE "id", SPA_TYPE_Enum, spa_type_props }, + { SPA_PROP_INFO_name, SPA_TYPE_PROP_INFO_BASE "name", SPA_TYPE_String, }, + { SPA_PROP_INFO_type, SPA_TYPE_PROP_INFO_BASE "type", SPA_TYPE_Prop, }, + { SPA_PROP_INFO_labels, SPA_TYPE_PROP_INFO_BASE "labels", SPA_TYPE_Struct, }, { 0, NULL, }, }; @@ -91,8 +111,9 @@ static const struct spa_type_info spa_type_prop_info[] = { #define SPA_TYPE_PARAM_META_BASE SPA_TYPE_PARAM__Meta ":" static const struct spa_type_info spa_type_param_meta[] = { - { SPA_PARAM_META_type, SPA_TYPE_PARAM_META_BASE "type", SPA_ID_Enum, }, - { SPA_PARAM_META_size, SPA_TYPE_PARAM_META_BASE "size", SPA_ID_Int, }, + { SPA_PARAM_META_START, SPA_TYPE_PARAM_META_BASE, SPA_TYPE_Enum, spa_type_param, }, + { SPA_PARAM_META_type, SPA_TYPE_PARAM_META_BASE "type", SPA_TYPE_Enum, }, + { SPA_PARAM_META_size, SPA_TYPE_PARAM_META_BASE "size", SPA_TYPE_Int, }, { 0, NULL, }, }; @@ -103,12 +124,114 @@ static const struct spa_type_info spa_type_param_meta[] = { #define SPA_TYPE_PARAM_IO_BASE SPA_TYPE_PARAM__IO ":" static const struct spa_type_info spa_type_param_io[] = { - { SPA_PARAM_IO_id, SPA_TYPE_PARAM_IO_BASE "id", SPA_ID_Enum, }, - { SPA_PARAM_IO_size, SPA_TYPE_PARAM_IO_BASE "size", SPA_ID_Int, }, + { SPA_PARAM_IO_START, SPA_TYPE_PARAM_IO_BASE, SPA_TYPE_Enum, spa_type_param, }, + { SPA_PARAM_IO_id, SPA_TYPE_PARAM_IO_BASE "id", SPA_TYPE_Enum, }, + { SPA_PARAM_IO_size, SPA_TYPE_PARAM_IO_BASE "size", SPA_TYPE_Int, }, { 0, NULL, }, }; -#include +#define SPA_TYPE__Format SPA_TYPE_PARAM_BASE "Format" +#define SPA_TYPE_FORMAT_BASE SPA_TYPE__Format ":" + +#define SPA_TYPE__MediaType SPA_TYPE_ENUM_BASE "MediaType" +#define SPA_TYPE_MEDIA_TYPE_BASE SPA_TYPE__MediaType ":" + +#include +#include + +static const struct spa_type_info spa_type_media_type[] = { + { SPA_MEDIA_TYPE_audio, SPA_TYPE_MEDIA_TYPE_BASE "audio", SPA_TYPE_Int, }, + { SPA_MEDIA_TYPE_video, SPA_TYPE_MEDIA_TYPE_BASE "video", SPA_TYPE_Int, }, + { SPA_MEDIA_TYPE_image, SPA_TYPE_MEDIA_TYPE_BASE "image", SPA_TYPE_Int, }, + { SPA_MEDIA_TYPE_binary, SPA_TYPE_MEDIA_TYPE_BASE "binary", SPA_TYPE_Int, }, + { SPA_MEDIA_TYPE_stream, SPA_TYPE_MEDIA_TYPE_BASE "stream", SPA_TYPE_Int, }, + { 0, NULL, }, +}; + +#define SPA_TYPE__MediaSubtype SPA_TYPE_ENUM_BASE "MediaSubtype" +#define SPA_TYPE_MEDIA_SUBTYPE_BASE SPA_TYPE__MediaSubtype ":" + +static const struct spa_type_info spa_type_media_subtype[] = { + /* generic subtypes */ + { SPA_MEDIA_SUBTYPE_raw, SPA_TYPE_MEDIA_SUBTYPE_BASE "raw", SPA_TYPE_Int, }, + /* audio subtypes */ + { SPA_MEDIA_SUBTYPE_mp3, SPA_TYPE_MEDIA_SUBTYPE_BASE "mp3", SPA_TYPE_Int, }, + { SPA_MEDIA_SUBTYPE_aac, SPA_TYPE_MEDIA_SUBTYPE_BASE "aac", SPA_TYPE_Int, }, + { SPA_MEDIA_SUBTYPE_vorbis, SPA_TYPE_MEDIA_SUBTYPE_BASE "vorbis", SPA_TYPE_Int, }, + { SPA_MEDIA_SUBTYPE_wma, SPA_TYPE_MEDIA_SUBTYPE_BASE "wma", SPA_TYPE_Int, }, + { SPA_MEDIA_SUBTYPE_ra, SPA_TYPE_MEDIA_SUBTYPE_BASE "ra", SPA_TYPE_Int, }, + { SPA_MEDIA_SUBTYPE_sbc, SPA_TYPE_MEDIA_SUBTYPE_BASE "sbc", SPA_TYPE_Int, }, + { SPA_MEDIA_SUBTYPE_adpcm, SPA_TYPE_MEDIA_SUBTYPE_BASE "adpcm", SPA_TYPE_Int, }, + { SPA_MEDIA_SUBTYPE_g723, SPA_TYPE_MEDIA_SUBTYPE_BASE "g723", SPA_TYPE_Int, }, + { SPA_MEDIA_SUBTYPE_g726, SPA_TYPE_MEDIA_SUBTYPE_BASE "g726", SPA_TYPE_Int, }, + { SPA_MEDIA_SUBTYPE_g729, SPA_TYPE_MEDIA_SUBTYPE_BASE "g729", SPA_TYPE_Int, }, + { SPA_MEDIA_SUBTYPE_amr, SPA_TYPE_MEDIA_SUBTYPE_BASE "amr", SPA_TYPE_Int, }, + { SPA_MEDIA_SUBTYPE_gsm, SPA_TYPE_MEDIA_SUBTYPE_BASE "gsm", SPA_TYPE_Int, }, + /* video subtypes */ + { SPA_MEDIA_SUBTYPE_h264, SPA_TYPE_MEDIA_SUBTYPE_BASE "h264", SPA_TYPE_Int, }, + { SPA_MEDIA_SUBTYPE_mjpg, SPA_TYPE_MEDIA_SUBTYPE_BASE "mjpg", SPA_TYPE_Int, }, + { SPA_MEDIA_SUBTYPE_dv, SPA_TYPE_MEDIA_SUBTYPE_BASE "dv", SPA_TYPE_Int, }, + { SPA_MEDIA_SUBTYPE_mpegts, SPA_TYPE_MEDIA_SUBTYPE_BASE "mpegts", SPA_TYPE_Int, }, + { SPA_MEDIA_SUBTYPE_h263, SPA_TYPE_MEDIA_SUBTYPE_BASE "h263", SPA_TYPE_Int, }, + { SPA_MEDIA_SUBTYPE_mpeg1, SPA_TYPE_MEDIA_SUBTYPE_BASE "mpeg1", SPA_TYPE_Int, }, + { SPA_MEDIA_SUBTYPE_mpeg2, SPA_TYPE_MEDIA_SUBTYPE_BASE "mpeg2", SPA_TYPE_Int, }, + { SPA_MEDIA_SUBTYPE_mpeg4, SPA_TYPE_MEDIA_SUBTYPE_BASE "mpeg4", SPA_TYPE_Int, }, + { SPA_MEDIA_SUBTYPE_xvid, SPA_TYPE_MEDIA_SUBTYPE_BASE "xvid", SPA_TYPE_Int, }, + { SPA_MEDIA_SUBTYPE_vc1, SPA_TYPE_MEDIA_SUBTYPE_BASE "vc1", SPA_TYPE_Int, }, + { SPA_MEDIA_SUBTYPE_vp8, SPA_TYPE_MEDIA_SUBTYPE_BASE "vp8", SPA_TYPE_Int, }, + { SPA_MEDIA_SUBTYPE_vp9, SPA_TYPE_MEDIA_SUBTYPE_BASE "vp9", SPA_TYPE_Int, }, + { SPA_MEDIA_SUBTYPE_jpeg, SPA_TYPE_MEDIA_SUBTYPE_BASE "jpeg", SPA_TYPE_Int, }, + { SPA_MEDIA_SUBTYPE_bayer, SPA_TYPE_MEDIA_SUBTYPE_BASE "bayer", SPA_TYPE_Int, }, + + { SPA_MEDIA_SUBTYPE_midi, SPA_TYPE_MEDIA_SUBTYPE_BASE "midi", SPA_TYPE_Int, }, + { 0, NULL, }, +}; + +#define SPA_TYPE__FormatAudio SPA_TYPE_FORMAT_BASE "Audio" +#define SPA_TYPE_FORMAT_AUDIO_BASE SPA_TYPE__FormatAudio ":" + +#define SPA_TYPE__FormatVideo SPA_TYPE_FORMAT_BASE "Video" +#define SPA_TYPE_FORMAT_VIDEO_BASE SPA_TYPE__FormatVideo ":" + +static const struct spa_type_info spa_type_format[] = { + { SPA_FORMAT_START, SPA_TYPE_FORMAT_BASE, SPA_TYPE_Enum, spa_type_param, }, + + { SPA_FORMAT_MediaType, SPA_TYPE_FORMAT_BASE "mediaType", SPA_TYPE_Enum, + spa_type_media_type, }, + { SPA_FORMAT_MediaSubtype, SPA_TYPE_FORMAT_BASE "mediaSubtype", SPA_TYPE_Enum, + spa_type_media_subtype, }, + + { SPA_FORMAT_AUDIO_format, SPA_TYPE_FORMAT_AUDIO_BASE "format", SPA_TYPE_Enum, + spa_type_audio_format }, + { SPA_FORMAT_AUDIO_flags, SPA_TYPE_FORMAT_AUDIO_BASE "flags", SPA_TYPE_Enum, + spa_type_audio_flags }, + { SPA_FORMAT_AUDIO_layout, SPA_TYPE_FORMAT_AUDIO_BASE "layout", SPA_TYPE_Enum, + spa_type_audio_layout }, + { SPA_FORMAT_AUDIO_rate, SPA_TYPE_FORMAT_AUDIO_BASE "rate", SPA_TYPE_Int, }, + { SPA_FORMAT_AUDIO_channels, SPA_TYPE_FORMAT_AUDIO_BASE "channels", SPA_TYPE_Int, }, + { SPA_FORMAT_AUDIO_channelMask, SPA_TYPE_FORMAT_AUDIO_BASE "channelMask", SPA_TYPE_Int, }, + + { SPA_FORMAT_VIDEO_format, SPA_TYPE_FORMAT_VIDEO_BASE "format", SPA_TYPE_Enum, + spa_type_video_format, }, + { SPA_FORMAT_VIDEO_size, SPA_TYPE_FORMAT_VIDEO_BASE "size", SPA_TYPE_Rectangle, }, + { SPA_FORMAT_VIDEO_framerate, SPA_TYPE_FORMAT_VIDEO_BASE "framerate", SPA_TYPE_Fraction, }, + { SPA_FORMAT_VIDEO_maxFramerate, SPA_TYPE_FORMAT_VIDEO_BASE "maxFramerate", SPA_TYPE_Fraction, }, + { SPA_FORMAT_VIDEO_views, SPA_TYPE_FORMAT_VIDEO_BASE "views", SPA_TYPE_Int, }, + { SPA_FORMAT_VIDEO_interlaceMode, SPA_TYPE_FORMAT_VIDEO_BASE "interlaceMode", SPA_TYPE_Int, }, + { SPA_FORMAT_VIDEO_pixelAspectRatio, SPA_TYPE_FORMAT_VIDEO_BASE "pixelAspectRatio", SPA_TYPE_Int, }, + { SPA_FORMAT_VIDEO_multiviewMode, SPA_TYPE_FORMAT_VIDEO_BASE "multiviewMode", SPA_TYPE_Int, }, + { SPA_FORMAT_VIDEO_multiviewFlags, SPA_TYPE_FORMAT_VIDEO_BASE "multiviewFlags", SPA_TYPE_Int, }, + { SPA_FORMAT_VIDEO_chromaSite, SPA_TYPE_FORMAT_VIDEO_BASE "chromaSite", SPA_TYPE_Int, }, + { SPA_FORMAT_VIDEO_colorRange, SPA_TYPE_FORMAT_VIDEO_BASE "colorRange", SPA_TYPE_Int, }, + { SPA_FORMAT_VIDEO_colorMatrix, SPA_TYPE_FORMAT_VIDEO_BASE "colorMatrix", SPA_TYPE_Int, }, + { SPA_FORMAT_VIDEO_transferFunction, SPA_TYPE_FORMAT_VIDEO_BASE "transferFunction", SPA_TYPE_Int, }, + { SPA_FORMAT_VIDEO_colorPrimaries, SPA_TYPE_FORMAT_VIDEO_BASE "colorPrimaries", SPA_TYPE_Int, }, + { SPA_FORMAT_VIDEO_profile, SPA_TYPE_FORMAT_VIDEO_BASE "profile", SPA_TYPE_Int, }, + { SPA_FORMAT_VIDEO_level, SPA_TYPE_FORMAT_VIDEO_BASE "level", SPA_TYPE_Int, }, + { SPA_FORMAT_VIDEO_streamFormat, SPA_TYPE_FORMAT_VIDEO_BASE "streamFormat", SPA_TYPE_Int, }, + { SPA_FORMAT_VIDEO_alignment, SPA_TYPE_FORMAT_VIDEO_BASE "alignment", SPA_TYPE_Int, }, + { 0, NULL, }, +}; #define SPA_TYPE_PARAM__Buffers SPA_TYPE_PARAM_BASE "Buffers" #define SPA_TYPE_PARAM_BUFFERS_BASE SPA_TYPE_PARAM__Buffers ":" @@ -117,27 +240,12 @@ static const struct spa_type_info spa_type_param_io[] = { #define SPA_TYPE_PARAM_BLOCK_INFO_BASE SPA_TYPE_PARAM__BlockInfo ":" static const struct spa_type_info spa_type_param_buffers[] = { - { SPA_PARAM_BUFFERS_buffers, SPA_TYPE_PARAM_BUFFERS_BASE "buffers", SPA_ID_Int, }, - { SPA_PARAM_BUFFERS_blocks, SPA_TYPE_PARAM_BUFFERS_BASE "blocks", SPA_ID_Int, }, - { SPA_PARAM_BUFFERS_size, SPA_TYPE_PARAM_BLOCK_INFO_BASE "size", SPA_ID_Int, }, - { SPA_PARAM_BUFFERS_stride, SPA_TYPE_PARAM_BLOCK_INFO_BASE "stride", SPA_ID_Int, }, - { SPA_PARAM_BUFFERS_align, SPA_TYPE_PARAM_BLOCK_INFO_BASE "align", SPA_ID_Int, }, - { 0, NULL, }, -}; - -/* base for parameter object enumerations */ -#define SPA_TYPE__ParamId SPA_TYPE_ENUM_BASE "ParamId" -#define SPA_TYPE_PARAM_ID_BASE SPA_TYPE__ParamId ":" - -static const struct spa_type_info spa_type_param[] = { - { SPA_PARAM_List, SPA_TYPE_PARAM_ID_BASE "List", SPA_ID_Int, }, - { SPA_PARAM_PropInfo, SPA_TYPE_PARAM_ID_BASE "PropInfo", SPA_ID_Int, }, - { SPA_PARAM_Props, SPA_TYPE_PARAM_ID_BASE "Props", SPA_ID_Int, }, - { SPA_PARAM_EnumFormat, SPA_TYPE_PARAM_ID_BASE "EnumFormat", SPA_ID_Int, }, - { SPA_PARAM_Format, SPA_TYPE_PARAM_ID_BASE "Format", SPA_ID_Int, }, - { SPA_PARAM_Buffers, SPA_TYPE_PARAM_ID_BASE "Buffers", SPA_ID_Int, }, - { SPA_PARAM_Meta, SPA_TYPE_PARAM_ID_BASE "Meta", SPA_ID_Int, }, - { SPA_PARAM_IO, SPA_TYPE_PARAM_ID_BASE "IO", SPA_ID_Int, }, + { SPA_PARAM_BUFFERS_START, SPA_TYPE_PARAM_BUFFERS_BASE, SPA_TYPE_Enum, spa_type_param, }, + { SPA_PARAM_BUFFERS_buffers, SPA_TYPE_PARAM_BUFFERS_BASE "buffers", SPA_TYPE_Int, }, + { SPA_PARAM_BUFFERS_blocks, SPA_TYPE_PARAM_BUFFERS_BASE "blocks", SPA_TYPE_Int, }, + { SPA_PARAM_BUFFERS_size, SPA_TYPE_PARAM_BLOCK_INFO_BASE "size", SPA_TYPE_Int, }, + { SPA_PARAM_BUFFERS_stride, SPA_TYPE_PARAM_BLOCK_INFO_BASE "stride", SPA_TYPE_Int, }, + { SPA_PARAM_BUFFERS_align, SPA_TYPE_PARAM_BLOCK_INFO_BASE "align", SPA_TYPE_Int, }, { 0, NULL, }, }; diff --git a/spa/include/spa/param/video-padding.h b/spa/include/spa/param/video-padding.h deleted file mode 100644 index b9cb0ca3b..000000000 --- a/spa/include/spa/param/video-padding.h +++ /dev/null @@ -1,48 +0,0 @@ -/* Simple Plugin API - * Copyright (C) 2016 Wim Taymans - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef __SPA_PARAM_VIDEO_PADDING_H__ -#define __SPA_PARAM_VIDEO_PADDING_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#if 0 -#define SPA_TYPE_PARAM__VideoPadding SPA_TYPE_PARAM_BASE "VideoPadding" -#define SPA_TYPE_PARAM_VIDEO_PADDING_BASE SPA_TYPE_PARAM__VideoPadding ":" - -#define SPA_TYPE_PARAM_VIDEO_PADDING__top SPA_TYPE_PARAM_VIDEO_PADDING_BASE "top" -#define SPA_TYPE_PARAM_VIDEO_PADDING__bottom SPA_TYPE_PARAM_VIDEO_PADDING_BASE "bottom" -#define SPA_TYPE_PARAM_VIDEO_PADDING__left SPA_TYPE_PARAM_VIDEO_PADDING_BASE "left" -#define SPA_TYPE_PARAM_VIDEO_PADDING__right SPA_TYPE_PARAM_VIDEO_PADDING_BASE "right" -#define SPA_TYPE_PARAM_VIDEO_PADDING__strideAlign0 SPA_TYPE_PARAM_VIDEO_PADDING_BASE "strideAlign0" -#define SPA_TYPE_PARAM_VIDEO_PADDING__strideAlign1 SPA_TYPE_PARAM_VIDEO_PADDING_BASE "strideAlign1" -#define SPA_TYPE_PARAM_VIDEO_PADDING__strideAlign2 SPA_TYPE_PARAM_VIDEO_PADDING_BASE "strideAlign2" -#define SPA_TYPE_PARAM_VIDEO_PADDING__strideAlign3 SPA_TYPE_PARAM_VIDEO_PADDING_BASE "strideAlign3" -#endif - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* __SPA_PARAM_VIDEO_PADDING_H__ */ diff --git a/spa/include/spa/param/video/raw-types.h b/spa/include/spa/param/video/type-info.h similarity index 81% rename from spa/include/spa/param/video/raw-types.h rename to spa/include/spa/param/video/type-info.h index 9624027c1..dd3ab2652 100644 --- a/spa/include/spa/param/video/raw-types.h +++ b/spa/include/spa/param/video/type-info.h @@ -30,83 +30,83 @@ extern "C" { #define SPA_TYPE_VIDEO_FORMAT_BASE SPA_TYPE__VideoFormat ":" static const struct spa_type_info spa_type_video_format[] = { - { SPA_VIDEO_FORMAT_ENCODED, SPA_TYPE_VIDEO_FORMAT_BASE "encoded", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_I420, SPA_TYPE_VIDEO_FORMAT_BASE "I420", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_YV12, SPA_TYPE_VIDEO_FORMAT_BASE "YV12", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_YUY2, SPA_TYPE_VIDEO_FORMAT_BASE "YUY2", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_UYVY, SPA_TYPE_VIDEO_FORMAT_BASE "UYVY", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_AYUV, SPA_TYPE_VIDEO_FORMAT_BASE "AYUV", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_RGBx, SPA_TYPE_VIDEO_FORMAT_BASE "RGBx", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_BGRx, SPA_TYPE_VIDEO_FORMAT_BASE "BGRx", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_xRGB, SPA_TYPE_VIDEO_FORMAT_BASE "xRGB", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_xBGR, SPA_TYPE_VIDEO_FORMAT_BASE "xBGR", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_RGBA, SPA_TYPE_VIDEO_FORMAT_BASE "RGBA", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_BGRA, SPA_TYPE_VIDEO_FORMAT_BASE "BGRA", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_ARGB, SPA_TYPE_VIDEO_FORMAT_BASE "ARGB", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_ABGR, SPA_TYPE_VIDEO_FORMAT_BASE "ABGR", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_RGB, SPA_TYPE_VIDEO_FORMAT_BASE "RGB", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_BGR, SPA_TYPE_VIDEO_FORMAT_BASE "BGR", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_Y41B, SPA_TYPE_VIDEO_FORMAT_BASE "Y41B", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_Y42B, SPA_TYPE_VIDEO_FORMAT_BASE "Y42B", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_YVYU, SPA_TYPE_VIDEO_FORMAT_BASE "YVYU", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_Y444, SPA_TYPE_VIDEO_FORMAT_BASE "Y444", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_v210, SPA_TYPE_VIDEO_FORMAT_BASE "v210", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_v216, SPA_TYPE_VIDEO_FORMAT_BASE "v216", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_NV12, SPA_TYPE_VIDEO_FORMAT_BASE "NV12", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_NV21, SPA_TYPE_VIDEO_FORMAT_BASE "NV21", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_GRAY8, SPA_TYPE_VIDEO_FORMAT_BASE "GRAY8", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_GRAY16_BE, SPA_TYPE_VIDEO_FORMAT_BASE "GRAY16_BE", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_GRAY16_LE, SPA_TYPE_VIDEO_FORMAT_BASE "GRAY16_LE", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_v308, SPA_TYPE_VIDEO_FORMAT_BASE "v308", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_RGB16, SPA_TYPE_VIDEO_FORMAT_BASE "RGB16", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_BGR16, SPA_TYPE_VIDEO_FORMAT_BASE "BGR16", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_RGB15, SPA_TYPE_VIDEO_FORMAT_BASE "RGB15", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_BGR15, SPA_TYPE_VIDEO_FORMAT_BASE "BGR15", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_UYVP, SPA_TYPE_VIDEO_FORMAT_BASE "UYVP", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_A420, SPA_TYPE_VIDEO_FORMAT_BASE "A420", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_RGB8P, SPA_TYPE_VIDEO_FORMAT_BASE "RGB8P", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_YUV9, SPA_TYPE_VIDEO_FORMAT_BASE "YUV9", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_YVU9, SPA_TYPE_VIDEO_FORMAT_BASE "YVU9", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_IYU1, SPA_TYPE_VIDEO_FORMAT_BASE "IYU1", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_ARGB64, SPA_TYPE_VIDEO_FORMAT_BASE "ARGB64", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_AYUV64, SPA_TYPE_VIDEO_FORMAT_BASE "AYUV64", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_r210, SPA_TYPE_VIDEO_FORMAT_BASE "r210", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_I420_10BE, SPA_TYPE_VIDEO_FORMAT_BASE "I420_10BE", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_I420_10LE, SPA_TYPE_VIDEO_FORMAT_BASE "I420_10LE", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_I422_10BE, SPA_TYPE_VIDEO_FORMAT_BASE "I422_10BE", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_I422_10LE, SPA_TYPE_VIDEO_FORMAT_BASE "I422_10LE", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_Y444_10BE, SPA_TYPE_VIDEO_FORMAT_BASE "Y444_10BE", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_Y444_10LE, SPA_TYPE_VIDEO_FORMAT_BASE "Y444_10LE", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_GBR, SPA_TYPE_VIDEO_FORMAT_BASE "GBR", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_GBR_10BE, SPA_TYPE_VIDEO_FORMAT_BASE "GBR_10BE", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_GBR_10LE, SPA_TYPE_VIDEO_FORMAT_BASE "GBR_10LE", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_NV16, SPA_TYPE_VIDEO_FORMAT_BASE "NV16", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_NV24, SPA_TYPE_VIDEO_FORMAT_BASE "NV24", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_NV12_64Z32, SPA_TYPE_VIDEO_FORMAT_BASE "NV12_64Z32", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_A420_10BE, SPA_TYPE_VIDEO_FORMAT_BASE "A420_10BE", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_A420_10LE, SPA_TYPE_VIDEO_FORMAT_BASE "A420_10LE", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_A422_10BE, SPA_TYPE_VIDEO_FORMAT_BASE "A422_10BE", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_A422_10LE, SPA_TYPE_VIDEO_FORMAT_BASE "A422_10LE", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_A444_10BE, SPA_TYPE_VIDEO_FORMAT_BASE "A444_10BE", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_A444_10LE, SPA_TYPE_VIDEO_FORMAT_BASE "A444_10LE", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_NV61, SPA_TYPE_VIDEO_FORMAT_BASE "NV61", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_P010_10BE, SPA_TYPE_VIDEO_FORMAT_BASE "P010_10BE", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_P010_10LE, SPA_TYPE_VIDEO_FORMAT_BASE "P010_10LE", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_IYU2, SPA_TYPE_VIDEO_FORMAT_BASE "IYU2", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_VYUY, SPA_TYPE_VIDEO_FORMAT_BASE "VYUY", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_GBRA, SPA_TYPE_VIDEO_FORMAT_BASE "GBRA", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_GBRA_10BE, SPA_TYPE_VIDEO_FORMAT_BASE "GBRA_10BE", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_GBRA_10LE, SPA_TYPE_VIDEO_FORMAT_BASE "GBRA_10LE", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_GBR_12BE, SPA_TYPE_VIDEO_FORMAT_BASE "GBR_12BE", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_GBR_12LE, SPA_TYPE_VIDEO_FORMAT_BASE "GBR_12LE", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_GBRA_12BE, SPA_TYPE_VIDEO_FORMAT_BASE "GBRA_12BE", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_GBRA_12LE, SPA_TYPE_VIDEO_FORMAT_BASE "GBRA_12LE", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_I420_12BE, SPA_TYPE_VIDEO_FORMAT_BASE "I420_12BE", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_I420_12LE, SPA_TYPE_VIDEO_FORMAT_BASE "I420_12LE", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_I422_12BE, SPA_TYPE_VIDEO_FORMAT_BASE "I422_12BE", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_I422_12LE, SPA_TYPE_VIDEO_FORMAT_BASE "I422_12LE", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_Y444_12BE, SPA_TYPE_VIDEO_FORMAT_BASE "Y444_12BE", SPA_ID_Int, }, - { SPA_VIDEO_FORMAT_Y444_12LE, SPA_TYPE_VIDEO_FORMAT_BASE "Y444_12LE", SPA_ID_Int, }, + { SPA_VIDEO_FORMAT_ENCODED, SPA_TYPE_VIDEO_FORMAT_BASE "encoded", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_I420, SPA_TYPE_VIDEO_FORMAT_BASE "I420", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_YV12, SPA_TYPE_VIDEO_FORMAT_BASE "YV12", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_YUY2, SPA_TYPE_VIDEO_FORMAT_BASE "YUY2", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_UYVY, SPA_TYPE_VIDEO_FORMAT_BASE "UYVY", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_AYUV, SPA_TYPE_VIDEO_FORMAT_BASE "AYUV", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_RGBx, SPA_TYPE_VIDEO_FORMAT_BASE "RGBx", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_BGRx, SPA_TYPE_VIDEO_FORMAT_BASE "BGRx", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_xRGB, SPA_TYPE_VIDEO_FORMAT_BASE "xRGB", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_xBGR, SPA_TYPE_VIDEO_FORMAT_BASE "xBGR", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_RGBA, SPA_TYPE_VIDEO_FORMAT_BASE "RGBA", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_BGRA, SPA_TYPE_VIDEO_FORMAT_BASE "BGRA", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_ARGB, SPA_TYPE_VIDEO_FORMAT_BASE "ARGB", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_ABGR, SPA_TYPE_VIDEO_FORMAT_BASE "ABGR", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_RGB, SPA_TYPE_VIDEO_FORMAT_BASE "RGB", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_BGR, SPA_TYPE_VIDEO_FORMAT_BASE "BGR", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_Y41B, SPA_TYPE_VIDEO_FORMAT_BASE "Y41B", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_Y42B, SPA_TYPE_VIDEO_FORMAT_BASE "Y42B", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_YVYU, SPA_TYPE_VIDEO_FORMAT_BASE "YVYU", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_Y444, SPA_TYPE_VIDEO_FORMAT_BASE "Y444", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_v210, SPA_TYPE_VIDEO_FORMAT_BASE "v210", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_v216, SPA_TYPE_VIDEO_FORMAT_BASE "v216", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_NV12, SPA_TYPE_VIDEO_FORMAT_BASE "NV12", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_NV21, SPA_TYPE_VIDEO_FORMAT_BASE "NV21", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_GRAY8, SPA_TYPE_VIDEO_FORMAT_BASE "GRAY8", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_GRAY16_BE, SPA_TYPE_VIDEO_FORMAT_BASE "GRAY16_BE", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_GRAY16_LE, SPA_TYPE_VIDEO_FORMAT_BASE "GRAY16_LE", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_v308, SPA_TYPE_VIDEO_FORMAT_BASE "v308", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_RGB16, SPA_TYPE_VIDEO_FORMAT_BASE "RGB16", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_BGR16, SPA_TYPE_VIDEO_FORMAT_BASE "BGR16", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_RGB15, SPA_TYPE_VIDEO_FORMAT_BASE "RGB15", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_BGR15, SPA_TYPE_VIDEO_FORMAT_BASE "BGR15", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_UYVP, SPA_TYPE_VIDEO_FORMAT_BASE "UYVP", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_A420, SPA_TYPE_VIDEO_FORMAT_BASE "A420", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_RGB8P, SPA_TYPE_VIDEO_FORMAT_BASE "RGB8P", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_YUV9, SPA_TYPE_VIDEO_FORMAT_BASE "YUV9", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_YVU9, SPA_TYPE_VIDEO_FORMAT_BASE "YVU9", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_IYU1, SPA_TYPE_VIDEO_FORMAT_BASE "IYU1", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_ARGB64, SPA_TYPE_VIDEO_FORMAT_BASE "ARGB64", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_AYUV64, SPA_TYPE_VIDEO_FORMAT_BASE "AYUV64", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_r210, SPA_TYPE_VIDEO_FORMAT_BASE "r210", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_I420_10BE, SPA_TYPE_VIDEO_FORMAT_BASE "I420_10BE", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_I420_10LE, SPA_TYPE_VIDEO_FORMAT_BASE "I420_10LE", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_I422_10BE, SPA_TYPE_VIDEO_FORMAT_BASE "I422_10BE", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_I422_10LE, SPA_TYPE_VIDEO_FORMAT_BASE "I422_10LE", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_Y444_10BE, SPA_TYPE_VIDEO_FORMAT_BASE "Y444_10BE", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_Y444_10LE, SPA_TYPE_VIDEO_FORMAT_BASE "Y444_10LE", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_GBR, SPA_TYPE_VIDEO_FORMAT_BASE "GBR", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_GBR_10BE, SPA_TYPE_VIDEO_FORMAT_BASE "GBR_10BE", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_GBR_10LE, SPA_TYPE_VIDEO_FORMAT_BASE "GBR_10LE", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_NV16, SPA_TYPE_VIDEO_FORMAT_BASE "NV16", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_NV24, SPA_TYPE_VIDEO_FORMAT_BASE "NV24", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_NV12_64Z32, SPA_TYPE_VIDEO_FORMAT_BASE "NV12_64Z32", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_A420_10BE, SPA_TYPE_VIDEO_FORMAT_BASE "A420_10BE", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_A420_10LE, SPA_TYPE_VIDEO_FORMAT_BASE "A420_10LE", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_A422_10BE, SPA_TYPE_VIDEO_FORMAT_BASE "A422_10BE", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_A422_10LE, SPA_TYPE_VIDEO_FORMAT_BASE "A422_10LE", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_A444_10BE, SPA_TYPE_VIDEO_FORMAT_BASE "A444_10BE", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_A444_10LE, SPA_TYPE_VIDEO_FORMAT_BASE "A444_10LE", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_NV61, SPA_TYPE_VIDEO_FORMAT_BASE "NV61", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_P010_10BE, SPA_TYPE_VIDEO_FORMAT_BASE "P010_10BE", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_P010_10LE, SPA_TYPE_VIDEO_FORMAT_BASE "P010_10LE", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_IYU2, SPA_TYPE_VIDEO_FORMAT_BASE "IYU2", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_VYUY, SPA_TYPE_VIDEO_FORMAT_BASE "VYUY", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_GBRA, SPA_TYPE_VIDEO_FORMAT_BASE "GBRA", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_GBRA_10BE, SPA_TYPE_VIDEO_FORMAT_BASE "GBRA_10BE", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_GBRA_10LE, SPA_TYPE_VIDEO_FORMAT_BASE "GBRA_10LE", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_GBR_12BE, SPA_TYPE_VIDEO_FORMAT_BASE "GBR_12BE", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_GBR_12LE, SPA_TYPE_VIDEO_FORMAT_BASE "GBR_12LE", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_GBRA_12BE, SPA_TYPE_VIDEO_FORMAT_BASE "GBRA_12BE", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_GBRA_12LE, SPA_TYPE_VIDEO_FORMAT_BASE "GBRA_12LE", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_I420_12BE, SPA_TYPE_VIDEO_FORMAT_BASE "I420_12BE", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_I420_12LE, SPA_TYPE_VIDEO_FORMAT_BASE "I420_12LE", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_I422_12BE, SPA_TYPE_VIDEO_FORMAT_BASE "I422_12BE", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_I422_12LE, SPA_TYPE_VIDEO_FORMAT_BASE "I422_12LE", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_Y444_12BE, SPA_TYPE_VIDEO_FORMAT_BASE "Y444_12BE", SPA_TYPE_Int, }, + { SPA_VIDEO_FORMAT_Y444_12LE, SPA_TYPE_VIDEO_FORMAT_BASE "Y444_12LE", SPA_TYPE_Int, }, { 0, NULL, }, }; diff --git a/spa/include/spa/pod/builder.h b/spa/include/spa/pod/builder.h index c53321f2f..674dfbefd 100644 --- a/spa/include/spa/pod/builder.h +++ b/spa/include/spa/pod/builder.h @@ -98,7 +98,7 @@ spa_pod_builder_push(struct spa_pod_builder *builder, frame->pod = *pod; frame->ref = ref; builder->state.in_array = builder->state.first = - (pod->type == SPA_ID_Array || pod->type == SPA_ID_Prop); + (pod->type == SPA_TYPE_Array || pod->type == SPA_TYPE_Prop); return ref; } @@ -153,7 +153,7 @@ static inline void *spa_pod_builder_pop(struct spa_pod_builder *builder) top = builder->state.depth > 0 ? &builder->frame[builder->state.depth-1] : NULL; builder->state.in_array = (top && - (top->pod.type == SPA_ID_Array || top->pod.type == SPA_ID_Prop)); + (top->pod.type == SPA_TYPE_Array || top->pod.type == SPA_TYPE_Prop)); spa_pod_builder_pad(builder, builder->state.offset); return pod; @@ -179,7 +179,7 @@ spa_pod_builder_primitive(struct spa_pod_builder *builder, const struct spa_pod return ref; } -#define SPA_POD_NONE_INIT() (struct spa_pod) { 0, SPA_ID_None } +#define SPA_POD_NONE_INIT() (struct spa_pod) { 0, SPA_TYPE_None } static inline uint32_t spa_pod_builder_none(struct spa_pod_builder *builder) { @@ -187,7 +187,7 @@ static inline uint32_t spa_pod_builder_none(struct spa_pod_builder *builder) return spa_pod_builder_primitive(builder, &p); } -#define SPA_POD_BOOL_INIT(val) (struct spa_pod_bool){ { sizeof(uint32_t), SPA_ID_Bool }, val ? 1 : 0, 0 } +#define SPA_POD_BOOL_INIT(val) (struct spa_pod_bool){ { sizeof(uint32_t), SPA_TYPE_Bool }, val ? 1 : 0, 0 } static inline uint32_t spa_pod_builder_bool(struct spa_pod_builder *builder, bool val) { @@ -195,7 +195,7 @@ static inline uint32_t spa_pod_builder_bool(struct spa_pod_builder *builder, boo return spa_pod_builder_primitive(builder, &p.pod); } -#define SPA_POD_ENUM_INIT(val) (struct spa_pod_enum){ { sizeof(uint32_t), SPA_ID_Enum }, val, 0 } +#define SPA_POD_ENUM_INIT(val) (struct spa_pod_enum){ { sizeof(uint32_t), SPA_TYPE_Enum }, val, 0 } static inline uint32_t spa_pod_builder_enum(struct spa_pod_builder *builder, uint32_t val) { @@ -203,7 +203,7 @@ static inline uint32_t spa_pod_builder_enum(struct spa_pod_builder *builder, uin return spa_pod_builder_primitive(builder, &p.pod); } -#define SPA_POD_INT_INIT(val) (struct spa_pod_int){ { sizeof(uint32_t), SPA_ID_Int }, val, 0 } +#define SPA_POD_INT_INIT(val) (struct spa_pod_int){ { sizeof(uint32_t), SPA_TYPE_Int }, val, 0 } static inline uint32_t spa_pod_builder_int(struct spa_pod_builder *builder, int32_t val) { @@ -211,7 +211,7 @@ static inline uint32_t spa_pod_builder_int(struct spa_pod_builder *builder, int3 return spa_pod_builder_primitive(builder, &p.pod); } -#define SPA_POD_LONG_INIT(val) (struct spa_pod_long){ { sizeof(uint64_t), SPA_ID_Long }, val } +#define SPA_POD_LONG_INIT(val) (struct spa_pod_long){ { sizeof(uint64_t), SPA_TYPE_Long }, val } static inline uint32_t spa_pod_builder_long(struct spa_pod_builder *builder, int64_t val) { @@ -219,7 +219,7 @@ static inline uint32_t spa_pod_builder_long(struct spa_pod_builder *builder, int return spa_pod_builder_primitive(builder, &p.pod); } -#define SPA_POD_FLOAT_INIT(val) (struct spa_pod_float){ { sizeof(float), SPA_ID_Float }, val } +#define SPA_POD_FLOAT_INIT(val) (struct spa_pod_float){ { sizeof(float), SPA_TYPE_Float }, val } static inline uint32_t spa_pod_builder_float(struct spa_pod_builder *builder, float val) { @@ -227,7 +227,7 @@ static inline uint32_t spa_pod_builder_float(struct spa_pod_builder *builder, fl return spa_pod_builder_primitive(builder, &p.pod); } -#define SPA_POD_DOUBLE_INIT(val) (struct spa_pod_double){ { sizeof(double), SPA_ID_Double }, val } +#define SPA_POD_DOUBLE_INIT(val) (struct spa_pod_double){ { sizeof(double), SPA_TYPE_Double }, val } static inline uint32_t spa_pod_builder_double(struct spa_pod_builder *builder, double val) { @@ -235,7 +235,7 @@ static inline uint32_t spa_pod_builder_double(struct spa_pod_builder *builder, d return spa_pod_builder_primitive(builder, &p.pod); } -#define SPA_POD_STRING_INIT(len) (struct spa_pod_string){ { len, SPA_ID_String } } +#define SPA_POD_STRING_INIT(len) (struct spa_pod_string){ { len, SPA_TYPE_String } } static inline uint32_t spa_pod_builder_write_string(struct spa_pod_builder *builder, const char *str, uint32_t len) @@ -265,7 +265,7 @@ static inline uint32_t spa_pod_builder_string(struct spa_pod_builder *builder, c return spa_pod_builder_string_len(builder, str ? str : "", len); } -#define SPA_POD_BYTES_INIT(len) (struct spa_pod_bytes){ { len, SPA_ID_Bytes } } +#define SPA_POD_BYTES_INIT(len) (struct spa_pod_bytes){ { len, SPA_TYPE_Bytes } } static inline uint32_t spa_pod_builder_bytes(struct spa_pod_builder *builder, const void *bytes, uint32_t len) @@ -277,7 +277,7 @@ spa_pod_builder_bytes(struct spa_pod_builder *builder, const void *bytes, uint32 return ref; } -#define SPA_POD_POINTER_INIT(type,value) (struct spa_pod_pointer){ { sizeof(struct spa_pod_pointer_body), SPA_ID_Pointer }, { type, value } } +#define SPA_POD_POINTER_INIT(type,value) (struct spa_pod_pointer){ { sizeof(struct spa_pod_pointer_body), SPA_TYPE_Pointer }, { type, value } } static inline uint32_t spa_pod_builder_pointer(struct spa_pod_builder *builder, uint32_t type, void *val) @@ -286,7 +286,7 @@ spa_pod_builder_pointer(struct spa_pod_builder *builder, uint32_t type, void *va return spa_pod_builder_primitive(builder, &p.pod); } -#define SPA_POD_FD_INIT(fd) (struct spa_pod_fd){ { sizeof(int), SPA_ID_Fd }, fd } +#define SPA_POD_FD_INIT(fd) (struct spa_pod_fd){ { sizeof(int), SPA_TYPE_Fd }, fd } static inline uint32_t spa_pod_builder_fd(struct spa_pod_builder *builder, int fd) { @@ -294,7 +294,7 @@ static inline uint32_t spa_pod_builder_fd(struct spa_pod_builder *builder, int f return spa_pod_builder_primitive(builder, &p.pod); } -#define SPA_POD_RECTANGLE_INIT(width,height) (struct spa_pod_rectangle){ { sizeof(struct spa_rectangle), SPA_ID_Rectangle }, { width, height } } +#define SPA_POD_RECTANGLE_INIT(width,height) (struct spa_pod_rectangle){ { sizeof(struct spa_rectangle), SPA_TYPE_Rectangle }, { width, height } } static inline uint32_t spa_pod_builder_rectangle(struct spa_pod_builder *builder, uint32_t width, uint32_t height) @@ -303,7 +303,7 @@ spa_pod_builder_rectangle(struct spa_pod_builder *builder, uint32_t width, uint3 return spa_pod_builder_primitive(builder, &p.pod); } -#define SPA_POD_FRACTION_INIT(num,denom) (struct spa_pod_fraction){ { sizeof(struct spa_fraction), SPA_ID_Fraction }, { num, denom } } +#define SPA_POD_FRACTION_INIT(num,denom) (struct spa_pod_fraction){ { sizeof(struct spa_fraction), SPA_TYPE_Fraction }, { num, denom } } static inline uint32_t spa_pod_builder_fraction(struct spa_pod_builder *builder, uint32_t num, uint32_t denom) @@ -316,7 +316,7 @@ static inline uint32_t spa_pod_builder_push_array(struct spa_pod_builder *builder) { const struct spa_pod_array p = - { {sizeof(struct spa_pod_array_body) - sizeof(struct spa_pod), SPA_ID_Array}, + { {sizeof(struct spa_pod_array_body) - sizeof(struct spa_pod), SPA_TYPE_Array}, {{0, 0}} }; return spa_pod_builder_push(builder, &p.pod, spa_pod_builder_raw(builder, &p, @@ -328,7 +328,7 @@ spa_pod_builder_array(struct spa_pod_builder *builder, uint32_t child_size, uint32_t child_type, uint32_t n_elems, const void *elems) { const struct spa_pod_array p = { - {(uint32_t)(sizeof(struct spa_pod_array_body) + n_elems * child_size), SPA_ID_Array}, + {(uint32_t)(sizeof(struct spa_pod_array_body) + n_elems * child_size), SPA_TYPE_Array}, {{child_size, child_type}} }; uint32_t ref = spa_pod_builder_raw(builder, &p, sizeof(p)); @@ -337,7 +337,7 @@ spa_pod_builder_array(struct spa_pod_builder *builder, return ref; } -#define SPA_POD_STRUCT_INIT(size) (struct spa_pod_struct){ { size, SPA_ID_Struct } } +#define SPA_POD_STRUCT_INIT(size) (struct spa_pod_struct){ { size, SPA_TYPE_Struct } } static inline uint32_t spa_pod_builder_push_struct(struct spa_pod_builder *builder) @@ -347,19 +347,19 @@ spa_pod_builder_push_struct(struct spa_pod_builder *builder) spa_pod_builder_raw(builder, &p, sizeof(p))); } -#define SPA_POD_OBJECT_INIT(size,id,type,...) (struct spa_pod_object){ { size, SPA_ID_Object }, { id, type }, ##__VA_ARGS__ } +#define SPA_POD_OBJECT_INIT(size,type,id,...) (struct spa_pod_object){ { size, SPA_TYPE_Object }, { type, id }, ##__VA_ARGS__ } static inline uint32_t -spa_pod_builder_push_object(struct spa_pod_builder *builder, uint32_t id, uint32_t type) +spa_pod_builder_push_object(struct spa_pod_builder *builder, uint32_t type, uint32_t id) { const struct spa_pod_object p = - SPA_POD_OBJECT_INIT(sizeof(struct spa_pod_object_body), id, type); + SPA_POD_OBJECT_INIT(sizeof(struct spa_pod_object_body), type, id); return spa_pod_builder_push(builder, &p.pod, spa_pod_builder_raw(builder, &p, sizeof(p))); } #define SPA_POD_PROP_INIT(size,key,flags,val_size,val_type) \ - (struct spa_pod_prop){ { size, SPA_ID_Prop}, {key, flags, { val_size, val_type } } } + (struct spa_pod_prop){ { size, SPA_TYPE_Prop}, {key, flags, { val_size, val_type } } } static inline uint32_t spa_pod_builder_push_prop(struct spa_pod_builder *builder, uint32_t key, uint32_t flags) @@ -507,9 +507,9 @@ spa_pod_builder_addv(struct spa_pod_builder *builder, switch (t) { case '<': { - uint32_t id = va_arg(args, uint32_t); uint32_t type = va_arg(args, uint32_t); - spa_pod_builder_push_object(builder, id, type); + uint32_t id = va_arg(args, uint32_t); + spa_pod_builder_push_object(builder, type, id); break; } case '[': @@ -556,7 +556,7 @@ spa_pod_builder_addv(struct spa_pod_builder *builder, case ']': case ')': case '>': spa_pod_builder_pop(builder); if (builder->state.depth > 0 && - builder->frame[builder->state.depth-1].pod.type == SPA_ID_Prop) + builder->frame[builder->state.depth-1].pod.type == SPA_TYPE_Prop) spa_pod_builder_pop(builder); break; case ' ': case '\n': case '\t': case '\r': @@ -586,8 +586,8 @@ static inline void *spa_pod_builder_add(struct spa_pod_builder *builder, const c return res; } -#define SPA_POD_OBJECT(id,type,...) \ - "<", id, type, ##__VA_ARGS__, ">" +#define SPA_POD_OBJECT(type,id,...) \ + "<", type, id, ##__VA_ARGS__, ">" #define SPA_POD_STRUCT(...) \ "[", ##__VA_ARGS__, "]" @@ -599,8 +599,8 @@ static inline void *spa_pod_builder_add(struct spa_pod_builder *builder, const c #define SPA_POD_PROP_STEP(min,max,step) 3,(min),(max),(step) #define SPA_POD_PROP_ENUM(n_vals,...) (n_vals),__VA_ARGS__ -#define spa_pod_builder_object(b,id,type,...) \ - spa_pod_builder_add(b, SPA_POD_OBJECT(id,type,##__VA_ARGS__), NULL) +#define spa_pod_builder_object(b,type,id,...) \ + spa_pod_builder_add(b, SPA_POD_OBJECT(type,id,##__VA_ARGS__), NULL) #define spa_pod_builder_struct(b,...) \ spa_pod_builder_add(b, SPA_POD_STRUCT(__VA_ARGS__), NULL) diff --git a/spa/include/spa/pod/command.h b/spa/include/spa/pod/command.h index f841ffeba..1080d3d1b 100644 --- a/spa/include/spa/pod/command.h +++ b/spa/include/spa/pod/command.h @@ -41,12 +41,12 @@ struct spa_command { (cmd)->body.body.id : SPA_ID_INVALID) #define SPA_COMMAND_INIT(type,id) (struct spa_command) \ - { { sizeof(struct spa_command_body), SPA_ID_Object }, \ - { { id, type } } } \ + { { sizeof(struct spa_command_body), SPA_TYPE_Object }, \ + { { type, id } } } \ #define SPA_COMMAND_INIT_FULL(t,size,type,id,...) (t) \ - { { size, SPA_ID_OBJECT }, \ - { { id, type }, ##__VA_ARGS__ } } \ + { { size, SPA_TYPE_OBJECT }, \ + { { type, id }, ##__VA_ARGS__ } } \ #ifdef __cplusplus } /* extern "C" */ diff --git a/spa/include/spa/pod/compare.h b/spa/include/spa/pod/compare.h index 5dbb40235..d5b045bd2 100644 --- a/spa/include/spa/pod/compare.h +++ b/spa/include/spa/pod/compare.h @@ -30,22 +30,22 @@ static inline int spa_pod_compare_value(uint32_t type, const void *r1, const void *r2) { switch (type) { - case SPA_ID_INVALID: + case SPA_TYPE_None: return 0; - case SPA_ID_Bool: - case SPA_ID_Enum: + case SPA_TYPE_Bool: + case SPA_TYPE_Enum: return *(int32_t *) r1 == *(uint32_t *) r2 ? 0 : 1; - case SPA_ID_Int: + case SPA_TYPE_Int: return *(int32_t *) r1 - *(int32_t *) r2; - case SPA_ID_Long: + case SPA_TYPE_Long: return *(int64_t *) r1 - *(int64_t *) r2; - case SPA_ID_Float: + case SPA_TYPE_Float: return *(float *) r1 - *(float *) r2; - case SPA_ID_Double: + case SPA_TYPE_Double: return *(double *) r1 - *(double *) r2; - case SPA_ID_String: + case SPA_TYPE_String: return strcmp(r1, r2); - case SPA_ID_Rectangle: + case SPA_TYPE_Rectangle: { const struct spa_rectangle *rec1 = (struct spa_rectangle *) r1, *rec2 = (struct spa_rectangle *) r2; @@ -56,7 +56,7 @@ static inline int spa_pod_compare_value(uint32_t type, const void *r1, const voi else return 1; } - case SPA_ID_Fraction: + case SPA_TYPE_Fraction: { const struct spa_fraction *f1 = (struct spa_fraction *) r1, *f2 = (struct spa_fraction *) r2; @@ -92,19 +92,19 @@ static inline int spa_pod_compare_part(const struct spa_pod *pod1, uint32_t pod1 return -EINVAL; switch (SPA_POD_TYPE(p1)) { - case SPA_ID_Struct: - case SPA_ID_Object: + case SPA_TYPE_Struct: + case SPA_TYPE_Object: if (SPA_POD_TYPE(p2) != SPA_POD_TYPE(p1)) return -EINVAL; - if (SPA_POD_TYPE(p1) == SPA_ID_Struct) + if (SPA_POD_TYPE(p1) == SPA_TYPE_Struct) recurse_offset = sizeof(struct spa_pod_struct); else recurse_offset = sizeof(struct spa_pod_object); do_advance = true; break; - case SPA_ID_Prop: + case SPA_TYPE_Prop: { struct spa_pod_prop *pr1, *pr2; void *a1, *a2; diff --git a/spa/include/spa/pod/event.h b/spa/include/spa/pod/event.h index 934a4fa6b..a8cfbe053 100644 --- a/spa/include/spa/pod/event.h +++ b/spa/include/spa/pod/event.h @@ -40,12 +40,12 @@ struct spa_event { (ev)->body.body.id : SPA_ID_INVALID) #define SPA_EVENT_INIT(type,id) (struct spa_event) \ - { { sizeof(struct spa_event_body), SPA_ID_Object }, \ - { { id, type } } } \ + { { sizeof(struct spa_event_body), SPA_TYPE_Object }, \ + { { type, id } } } \ #define SPA_EVENT_INIT_FULL(t,size,type,id,...) (t) \ - { { size, SPA_ID_OBJECT }, \ - { { id, type }, ##__VA_ARGS__ } } \ + { { size, SPA_TYPE_OBJECT }, \ + { { type, id }, ##__VA_ARGS__ } } \ #ifdef __cplusplus } /* extern "C" */ diff --git a/spa/include/spa/pod/filter.h b/spa/include/spa/pod/filter.h index 638002430..8ae81c6f7 100644 --- a/spa/include/spa/pod/filter.h +++ b/spa/include/spa/pod/filter.h @@ -249,19 +249,19 @@ static inline int spa_pod_filter_part(struct spa_pod_builder *b, uint32_t filter_offset = 0; switch (SPA_POD_TYPE(pp)) { - case SPA_ID_Struct: - case SPA_ID_Object: + case SPA_TYPE_Struct: + case SPA_TYPE_Object: if (pf != NULL) { if (SPA_POD_TYPE(pf) != SPA_POD_TYPE(pp)) return -EINVAL; - if (SPA_POD_TYPE(pp) == SPA_ID_Struct) { + if (SPA_POD_TYPE(pp) == SPA_TYPE_Struct) { filter_offset = sizeof(struct spa_pod_struct); spa_pod_builder_push_struct(b); } else { struct spa_pod_object *p1 = (struct spa_pod_object *) pp; filter_offset = sizeof(struct spa_pod_object); - spa_pod_builder_push_object(b, p1->body.id, p1->body.type); + spa_pod_builder_push_object(b, p1->body.type, p1->body.id); } do_advance = true; } @@ -269,7 +269,7 @@ static inline int spa_pod_filter_part(struct spa_pod_builder *b, do_copy = true; break; - case SPA_ID_Prop: + case SPA_TYPE_Prop: { struct spa_pod_prop *p1, *p2; diff --git a/spa/include/spa/pod/iter.h b/spa/include/spa/pod/iter.h index 6517440e5..e5ecb3e0a 100644 --- a/spa/include/spa/pod/iter.h +++ b/spa/include/spa/pod/iter.h @@ -101,7 +101,7 @@ static inline struct spa_pod_prop *spa_pod_contents_find_prop(const struct spa_p { const struct spa_pod *res; SPA_POD_FOREACH(pod, size, res) { - if (res->type == SPA_ID_Prop + if (res->type == SPA_TYPE_Prop && ((struct spa_pod_prop *) res)->body.key == key) return (struct spa_pod_prop *) res; } @@ -112,9 +112,9 @@ static inline struct spa_pod_prop *spa_pod_find_prop(const struct spa_pod *pod, { uint32_t offset; - if (pod->type == SPA_ID_Object) + if (pod->type == SPA_TYPE_Object) offset = sizeof(struct spa_pod_object); - else if (pod->type == SPA_ID_Struct) + else if (pod->type == SPA_TYPE_Struct) offset = sizeof(struct spa_pod_struct); else return NULL; @@ -128,15 +128,15 @@ static inline int spa_pod_fixate(struct spa_pod *pod) struct spa_pod *res; uint32_t offset; - if (pod->type == SPA_ID_Object) + if (pod->type == SPA_TYPE_Object) offset = sizeof(struct spa_pod_object); - else if (pod->type == SPA_ID_Struct) + else if (pod->type == SPA_TYPE_Struct) offset = sizeof(struct spa_pod_struct); else return -EINVAL; SPA_POD_CONTENTS_FOREACH(pod, offset, res) { - if (res->type == SPA_ID_Prop) + if (res->type == SPA_TYPE_Prop) SPA_FLAG_UNSET (((struct spa_pod_prop *) res)->body.flags, SPA_POD_PROP_FLAG_UNSET); } diff --git a/spa/include/spa/pod/parser.h b/spa/include/spa/pod/parser.h index ae679d1d6..48e29921f 100644 --- a/spa/include/spa/pod/parser.h +++ b/spa/include/spa/pod/parser.h @@ -53,41 +53,41 @@ static inline bool spa_pod_parser_can_collect(struct spa_pod *pod, char type) return true; switch (SPA_POD_TYPE(pod)) { - case SPA_ID_None: + case SPA_TYPE_None: return type == 'T' || type == 'O' || type == 'V' || type == 's'; - case SPA_ID_Bool: + case SPA_TYPE_Bool: return type == 'b'; - case SPA_ID_Enum: + case SPA_TYPE_Enum: return type == 'I'; - case SPA_ID_Int: + case SPA_TYPE_Int: return type == 'i'; - case SPA_ID_Long: + case SPA_TYPE_Long: return type == 'l'; - case SPA_ID_Float: + case SPA_TYPE_Float: return type == 'f'; - case SPA_ID_Double: + case SPA_TYPE_Double: return type == 'd'; - case SPA_ID_String: + case SPA_TYPE_String: return type == 's' || type == 'S'; - case SPA_ID_Bytes: + case SPA_TYPE_Bytes: return type == 'z'; - case SPA_ID_Rectangle: + case SPA_TYPE_Rectangle: return type == 'R'; - case SPA_ID_Fraction: + case SPA_TYPE_Fraction: return type == 'F'; - case SPA_ID_Bitmap: + case SPA_TYPE_Bitmap: return type == 'B'; - case SPA_ID_Array: + case SPA_TYPE_Array: return type == 'a'; - case SPA_ID_Struct: + case SPA_TYPE_Struct: return type == 'T'; - case SPA_ID_Object: + case SPA_TYPE_Object: return type == 'O'; - case SPA_ID_Pointer: + case SPA_TYPE_Pointer: return type == 'p'; - case SPA_ID_Fd: + case SPA_TYPE_Fd: return type == 'h'; - case SPA_ID_Prop: + case SPA_TYPE_Prop: return type == 'V'; default: return false; @@ -115,7 +115,7 @@ do { \ break; \ case 's': \ *va_arg(args, char**) = \ - (pod == NULL || (SPA_POD_TYPE(pod) == SPA_ID_None) \ + (pod == NULL || (SPA_POD_TYPE(pod) == SPA_TYPE_None) \ ? NULL \ : (char *)SPA_POD_CONTENTS(struct spa_pod_string, pod)); \ break; \ @@ -157,7 +157,7 @@ do { \ case 'O': \ case 'T': \ *va_arg(args, struct spa_pod**) = \ - (pod == NULL || (SPA_POD_TYPE(pod) == SPA_ID_None) \ + (pod == NULL || (SPA_POD_TYPE(pod) == SPA_TYPE_None) \ ? NULL : pod); \ break; \ default: \ @@ -209,7 +209,7 @@ static inline int spa_pod_parser_getv(struct spa_pod_parser *parser, while (format) { switch (*format) { case '<': - if (pod == NULL || SPA_POD_TYPE(pod) != SPA_ID_Object) + if (pod == NULL || SPA_POD_TYPE(pod) != SPA_TYPE_Object) return -EINVAL; if (++parser->depth >= SPA_POD_MAX_DEPTH) return -EINVAL; @@ -218,7 +218,7 @@ static inline int spa_pod_parser_getv(struct spa_pod_parser *parser, spa_pod_iter_init(it, pod, SPA_POD_SIZE(pod), sizeof(struct spa_pod_object)); goto read_pod; case '[': - if (pod == NULL || SPA_POD_TYPE(pod) != SPA_ID_Struct) + if (pod == NULL || SPA_POD_TYPE(pod) != SPA_TYPE_Struct) return -EINVAL; if (++parser->depth >= SPA_POD_MAX_DEPTH) return -EINVAL; diff --git a/spa/include/spa/pod/pod.h b/spa/include/spa/pod/pod.h index 017d4fb25..f1238ca3b 100644 --- a/spa/include/spa/pod/pod.h +++ b/spa/include/spa/pod/pod.h @@ -45,7 +45,7 @@ extern "C" { struct spa_pod { uint32_t size; - uint32_t type; /* one of spa_pod_type */ + uint32_t type; /* a basic id of enum spa_type */ }; #define SPA_POD_VALUE(type,pod) (((type*)pod)->value) @@ -125,8 +125,8 @@ struct spa_pod_struct { }; struct spa_pod_object_body { - uint32_t id; - uint32_t type; + uint32_t type; /**< one of enum spa_type */ + uint32_t id; /**< id of the object, depends on the object type */ /* contents follow, series of spa_pod */ }; @@ -137,18 +137,18 @@ struct spa_pod_object { static inline bool spa_pod_is_object_type(const struct spa_pod *pod, uint32_t type) { - return (pod && pod->type == SPA_ID_Object + return (pod && pod->type == SPA_TYPE_Object && ((struct spa_pod_object *) pod)->body.type == type); } static inline bool spa_pod_is_object_id(const struct spa_pod *pod, uint32_t id) { - return (pod && pod->type == SPA_ID_Object + return (pod && pod->type == SPA_TYPE_Object && ((struct spa_pod_object *) pod)->body.id == id); } struct spa_pod_pointer_body { - uint32_t type; + uint32_t type; /**< pointer id, one of enum spa_type */ void *value; }; @@ -165,7 +165,8 @@ struct spa_pod_fd { #define SPA_POD_PROP_N_VALUES(prop) (((prop)->pod.size - sizeof(struct spa_pod_prop_body)) / (prop)->body.value.size) struct spa_pod_prop_body { - uint32_t key; + uint32_t key; /**< key of property, list of valid keys depends on the + * object type */ #define SPA_POD_PROP_RANGE_NONE 0 /**< no range */ #define SPA_POD_PROP_RANGE_MIN_MAX 1 /**< property has range */ #define SPA_POD_PROP_RANGE_STEP 2 /**< property has range with step */ diff --git a/spa/include/spa/support/dbus.h b/spa/include/spa/support/dbus.h index 778043389..014522820 100644 --- a/spa/include/spa/support/dbus.h +++ b/spa/include/spa/support/dbus.h @@ -26,11 +26,6 @@ extern "C" { #include -#define SPA_TYPE__DBus SPA_TYPE_INTERFACE_BASE "DBus" -#define SPA_TYPE_DBUS_BASE SPA_TYPE__DBus ":" - -#define SPA_TYPE_DBUS__Connection SPA_TYPE_DBUS_BASE "Connection" - enum spa_dbus_type { SPA_DBUS_TYPE_SESSION, /**< The login session bus */ SPA_DBUS_TYPE_SYSTEM, /**< The systemwide bus */ diff --git a/spa/include/spa/support/loop-types.h b/spa/include/spa/support/loop-types.h deleted file mode 100644 index 836bcddd8..000000000 --- a/spa/include/spa/support/loop-types.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Simple Plugin API - * Copyright (C) 2016 Wim Taymans - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef __SPA_LOOP_TYPES_H__ -#define __SPA_LOOP_TYPES_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#define SPA_TYPE__Loop SPA_TYPE_INTERFACE_BASE "Loop" -#define SPA_TYPE_LOOP_BASE SPA_TYPE__Loop ":" - -#define SPA_TYPE__LoopControl SPA_TYPE_INTERFACE_BASE "LoopControl" -#define SPA_TYPE__LoopUtils SPA_TYPE_INTERFACE_BASE "LoopUtils" - -#define SPA_TYPE_LOOP__MainLoop SPA_TYPE_LOOP_BASE "MainLoop" -#define SPA_TYPE_LOOP__DataLoop SPA_TYPE_LOOP_BASE "DataLoop" - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* __SPA_LOOP_H__ */ diff --git a/spa/include/spa/support/plugin.h b/spa/include/spa/support/plugin.h index 84ae08827..617953183 100644 --- a/spa/include/spa/support/plugin.h +++ b/spa/include/spa/support/plugin.h @@ -35,16 +35,16 @@ struct spa_handle { /* user_data that can be set by the application */ void *user_data; /** - * Get the interface provided by \a handle with \a interface_id. + * Get the interface provided by \a handle with \a type. * * \param handle a spa_handle - * \param interface_id the interface id + * \param type the interface type * \param interface result to hold the interface. * \return 0 on success * -ENOTSUP when there are no interfaces * -EINVAL when handle or info is NULL */ - int (*get_interface) (struct spa_handle *handle, uint32_t interface_id, void **interface); + int (*get_interface) (struct spa_handle *handle, uint32_t type, void **interface); /** * Clean up the memory of \a handle. After this, \a handle should not be used * anymore. diff --git a/spa/include/spa/utils/defs.h b/spa/include/spa/utils/defs.h index b27a598cc..36049c98f 100644 --- a/spa/include/spa/utils/defs.h +++ b/spa/include/spa/utils/defs.h @@ -114,7 +114,7 @@ struct spa_fraction { #define SPA_TIME_INVALID ((int64_t)INT64_MIN) #define SPA_IDX_INVALID ((unsigned int)-1) -//#define SPA_ID_INVALID ((uint32_t)0xffffffff) +#define SPA_ID_INVALID ((uint32_t)0xffffffff) #define SPA_NSEC_PER_SEC (1000000000ll) #define SPA_NSEC_PER_MSEC (1000000ll) diff --git a/spa/include/spa/utils/dict.h b/spa/include/spa/utils/dict.h index e6a4fb13b..8ef8c4195 100644 --- a/spa/include/spa/utils/dict.h +++ b/spa/include/spa/utils/dict.h @@ -24,9 +24,6 @@ extern "C" { #endif -#define SPA_TYPE__Dict SPA_TYPE_POINTER_BASE "Dict" -#define SPA_TYPE_DICT_BASE SPA_TYPE__Dict ":" - #include #include diff --git a/spa/include/spa/utils/ringbuffer.h b/spa/include/spa/utils/ringbuffer.h index ade6a7e2a..9da27fce8 100644 --- a/spa/include/spa/utils/ringbuffer.h +++ b/spa/include/spa/utils/ringbuffer.h @@ -25,8 +25,6 @@ extern "C" { #endif struct spa_ringbuffer; -#define SPA_TYPE__RingBuffer SPA_TYPE_INTERFACE_BASE "RingBuffer" -#define SPA_TYPE_RINGBUFFER_BASE SPA_TYPE__RingBuffer ":" #include diff --git a/spa/include/spa/utils/type-info.h b/spa/include/spa/utils/type-info.h index 2b6beb09b..f1c3cb92d 100644 --- a/spa/include/spa/utils/type-info.h +++ b/spa/include/spa/utils/type-info.h @@ -33,9 +33,9 @@ static inline bool spa_type_is_a(const char *type, const char *parent) } struct spa_type_info { - uint32_t id; - const char *name; uint32_t type; + const char *name; + uint32_t parent; const struct spa_type_info *values; }; @@ -73,65 +73,63 @@ struct spa_type_info { #include static const struct spa_type_info spa_types[] = { - { SPA_ID_INVALID, "*invalid*", SPA_ID_INVALID, }, - /* Basic types */ - { SPA_ID_BASE, SPA_TYPE_BASE, SPA_ID_BASE, }, - { SPA_ID_None, SPA_TYPE_BASE "None", SPA_ID_None, }, - { SPA_ID_Bool, SPA_TYPE_BASE "Bool", SPA_ID_Bool, }, - { SPA_ID_Enum, SPA_TYPE__Enum, SPA_ID_Int, }, - { SPA_ID_Int, SPA_TYPE_BASE "Int", SPA_ID_Int, }, - { SPA_ID_Long, SPA_TYPE_BASE "Long", SPA_ID_Long, }, - { SPA_ID_Float, SPA_TYPE_BASE "Float", SPA_ID_Float, }, - { SPA_ID_Double, SPA_TYPE_BASE "Double", SPA_ID_Double, }, - { SPA_ID_String, SPA_TYPE_BASE "String", SPA_ID_String, }, - { SPA_ID_Bytes, SPA_TYPE_BASE "Bytes", SPA_ID_Bytes, }, - { SPA_ID_Rectangle, SPA_TYPE_BASE "Rectangle", SPA_ID_Rectangle, }, - { SPA_ID_Fraction, SPA_TYPE_BASE "Fraction", SPA_ID_Fraction, }, - { SPA_ID_Bitmap, SPA_TYPE_BASE "Bitmap", SPA_ID_Bitmap, }, - { SPA_ID_Array, SPA_TYPE_BASE "Array", SPA_ID_Array, }, - { SPA_ID_Pod, SPA_TYPE__Pod, SPA_ID_Pod, }, - { SPA_ID_Struct, SPA_TYPE__Struct, SPA_ID_Pod, }, - { SPA_ID_Object, SPA_TYPE__Object, SPA_ID_Pod, }, - { SPA_ID_Sequence, SPA_TYPE_POD_BASE "Sequence", SPA_ID_Pod, }, - { SPA_ID_Pointer, SPA_TYPE__Pointer, SPA_ID_Pointer, }, - { SPA_ID_Fd, SPA_TYPE_BASE "Fd", SPA_ID_Fd, }, - { SPA_ID_Prop, SPA_TYPE_POD_BASE "Prop", SPA_ID_Pod, }, + { SPA_TYPE_START, SPA_TYPE_BASE, SPA_TYPE_START, }, + { SPA_TYPE_None, SPA_TYPE_BASE "None", SPA_TYPE_None, }, + { SPA_TYPE_Bool, SPA_TYPE_BASE "Bool", SPA_TYPE_Bool, }, + { SPA_TYPE_Enum, SPA_TYPE__Enum, SPA_TYPE_Int, }, + { SPA_TYPE_Int, SPA_TYPE_BASE "Int", SPA_TYPE_Int, }, + { SPA_TYPE_Long, SPA_TYPE_BASE "Long", SPA_TYPE_Long, }, + { SPA_TYPE_Float, SPA_TYPE_BASE "Float", SPA_TYPE_Float, }, + { SPA_TYPE_Double, SPA_TYPE_BASE "Double", SPA_TYPE_Double, }, + { SPA_TYPE_String, SPA_TYPE_BASE "String", SPA_TYPE_String, }, + { SPA_TYPE_Bytes, SPA_TYPE_BASE "Bytes", SPA_TYPE_Bytes, }, + { SPA_TYPE_Rectangle, SPA_TYPE_BASE "Rectangle", SPA_TYPE_Rectangle, }, + { SPA_TYPE_Fraction, SPA_TYPE_BASE "Fraction", SPA_TYPE_Fraction, }, + { SPA_TYPE_Bitmap, SPA_TYPE_BASE "Bitmap", SPA_TYPE_Bitmap, }, + { SPA_TYPE_Array, SPA_TYPE_BASE "Array", SPA_TYPE_Array, }, + { SPA_TYPE_Pod, SPA_TYPE__Pod, SPA_TYPE_Pod, }, + { SPA_TYPE_Struct, SPA_TYPE__Struct, SPA_TYPE_Pod, }, + { SPA_TYPE_Object, SPA_TYPE__Object, SPA_TYPE_Pod, }, + { SPA_TYPE_Sequence, SPA_TYPE_POD_BASE "Sequence", SPA_TYPE_Pod, }, + { SPA_TYPE_Pointer, SPA_TYPE__Pointer, SPA_TYPE_Pointer, }, + { SPA_TYPE_Fd, SPA_TYPE_BASE "Fd", SPA_TYPE_Fd, }, + { SPA_TYPE_Prop, SPA_TYPE_POD_BASE "Prop", SPA_TYPE_Pod, }, - { SPA_ID_POINTER_BASE, SPA_TYPE__Pointer, SPA_ID_Pointer, }, - { SPA_ID_POINTER_Buffer, SPA_TYPE_POINTER_BASE "Buffer", SPA_ID_Pointer, }, - { SPA_ID_POINTER_Meta, SPA_TYPE_POINTER_BASE "Meta", SPA_ID_Pointer, }, - { SPA_ID_POINTER_Dict, SPA_TYPE_POINTER_BASE "Dict", SPA_ID_Pointer, }, + { SPA_TYPE_POINTER_START, SPA_TYPE__Pointer, SPA_TYPE_Pointer, }, + { SPA_TYPE_POINTER_Buffer, SPA_TYPE_POINTER_BASE "Buffer", SPA_TYPE_Pointer, }, + { SPA_TYPE_POINTER_Meta, SPA_TYPE_POINTER_BASE "Meta", SPA_TYPE_Pointer, }, + { SPA_TYPE_POINTER_Dict, SPA_TYPE_POINTER_BASE "Dict", SPA_TYPE_Pointer, }, - { SPA_ID_INTERFACE_BASE, SPA_TYPE__Interface, SPA_ID_Pointer, }, - { SPA_ID_INTERFACE_Handle, SPA_TYPE_INTERFACE_BASE "Handle", SPA_ID_INTERFACE_BASE, }, - { SPA_ID_INTERFACE_HandleFactory, SPA_TYPE_INTERFACE_BASE "HandleFactory", SPA_ID_INTERFACE_BASE, }, - { SPA_ID_INTERFACE_Log, SPA_TYPE_INTERFACE_BASE "Log", SPA_ID_INTERFACE_BASE, }, - { SPA_ID_INTERFACE_Loop, SPA_TYPE_INTERFACE_BASE "Loop", SPA_ID_INTERFACE_BASE, }, - { SPA_ID_INTERFACE_LoopControl, SPA_TYPE_INTERFACE_BASE "LoopControl", SPA_ID_INTERFACE_BASE, }, - { SPA_ID_INTERFACE_LoopUtils, SPA_TYPE_INTERFACE_BASE "LoopUtils", SPA_ID_INTERFACE_BASE, }, - { SPA_ID_INTERFACE_DataLoop, SPA_TYPE_INTERFACE_BASE "DataLoop", SPA_ID_INTERFACE_BASE, }, - { SPA_ID_INTERFACE_MainLoop, SPA_TYPE_INTERFACE_BASE "MainLoop", SPA_ID_INTERFACE_BASE, }, - { SPA_ID_INTERFACE_DBus, SPA_TYPE_INTERFACE_BASE "DBus", SPA_ID_INTERFACE_BASE, }, - { SPA_ID_INTERFACE_Monitor, SPA_TYPE_INTERFACE_BASE "Monitor", SPA_ID_INTERFACE_BASE, }, - { SPA_ID_INTERFACE_Node, SPA_TYPE_INTERFACE_BASE "Node", SPA_ID_INTERFACE_BASE, }, + { SPA_TYPE_INTERFACE_START, SPA_TYPE__Interface, SPA_TYPE_Pointer, }, + { SPA_TYPE_INTERFACE_Handle, SPA_TYPE_INTERFACE_BASE "Handle", SPA_TYPE_Pointer, }, + { SPA_TYPE_INTERFACE_HandleFactory, SPA_TYPE_INTERFACE_BASE "HandleFactory", SPA_TYPE_Pointer, }, + { SPA_TYPE_INTERFACE_Log, SPA_TYPE_INTERFACE_BASE "Log", SPA_TYPE_Pointer, }, + { SPA_TYPE_INTERFACE_Loop, SPA_TYPE_INTERFACE_BASE "Loop", SPA_TYPE_Pointer, }, + { SPA_TYPE_INTERFACE_LoopControl, SPA_TYPE_INTERFACE_BASE "LoopControl", SPA_TYPE_Pointer, }, + { SPA_TYPE_INTERFACE_LoopUtils, SPA_TYPE_INTERFACE_BASE "LoopUtils", SPA_TYPE_Pointer, }, + { SPA_TYPE_INTERFACE_DataLoop, SPA_TYPE_INTERFACE_BASE "DataLoop", SPA_TYPE_Pointer, }, + { SPA_TYPE_INTERFACE_MainLoop, SPA_TYPE_INTERFACE_BASE "MainLoop", SPA_TYPE_Pointer, }, + { SPA_TYPE_INTERFACE_DBus, SPA_TYPE_INTERFACE_BASE "DBus", SPA_TYPE_Pointer, }, + { SPA_TYPE_INTERFACE_Monitor, SPA_TYPE_INTERFACE_BASE "Monitor", SPA_TYPE_Pointer, }, + { SPA_TYPE_INTERFACE_Node, SPA_TYPE_INTERFACE_BASE "Node", SPA_TYPE_Pointer, }, - { SPA_ID_EVENT_BASE, SPA_TYPE__Event, SPA_ID_Object, }, - { SPA_ID_EVENT_Monitor, SPA_TYPE_EVENT_BASE "Monitor", SPA_ID_EVENT_BASE, }, - { SPA_ID_EVENT_Node, SPA_TYPE_EVENT_BASE "Node", SPA_ID_EVENT_BASE, }, + { SPA_TYPE_EVENT_START, SPA_TYPE__Event, SPA_TYPE_Object, }, + { SPA_TYPE_EVENT_Monitor, SPA_TYPE_EVENT_BASE "Monitor", SPA_TYPE_Object, spa_type_monitor_event }, + { SPA_TYPE_EVENT_Node, SPA_TYPE_EVENT_BASE "Node", SPA_TYPE_Object, spa_type_node_event }, - { SPA_ID_COMMAND_BASE, SPA_TYPE__Command, SPA_ID_Object, }, - { SPA_ID_COMMAND_Node, SPA_TYPE_COMMAND_BASE "Node", SPA_ID_COMMAND_BASE, }, + { SPA_TYPE_COMMAND_START, SPA_TYPE__Command, SPA_TYPE_Object, }, + { SPA_TYPE_COMMAND_Node, SPA_TYPE_COMMAND_BASE "Node", SPA_TYPE_Object, spa_type_node_command }, - { SPA_ID_OBJECT_BASE, SPA_TYPE__Object, SPA_ID_Object, }, - { SPA_ID_OBJECT_MonitorItem, SPA_TYPE__MonitorItem, SPA_ID_Object, spa_type_monitor_item }, - { SPA_ID_OBJECT_ParamList, SPA_TYPE_PARAM__List, SPA_ID_Object, spa_type_param_list, }, - { SPA_ID_OBJECT_PropInfo, SPA_TYPE__PropInfo, SPA_ID_Object, spa_type_prop_info, }, - { SPA_ID_OBJECT_Props, SPA_TYPE__Props, SPA_ID_Object, spa_type_props }, - { SPA_ID_OBJECT_Format, SPA_TYPE__Format, SPA_ID_Object, spa_type_format }, - { SPA_ID_OBJECT_ParamBuffers, SPA_TYPE_PARAM__Buffers, SPA_ID_Object, spa_type_param_buffers, }, - { SPA_ID_OBJECT_ParamMeta, SPA_TYPE_PARAM__Meta, SPA_ID_Object, spa_type_param_meta }, - { SPA_ID_OBJECT_ParamIO, SPA_TYPE_PARAM__IO, SPA_ID_Object, spa_type_param_io }, + { SPA_TYPE_OBJECT_START, SPA_TYPE__Object, SPA_TYPE_Object, }, + { SPA_TYPE_OBJECT_MonitorItem, SPA_TYPE__MonitorItem, SPA_TYPE_Object, spa_type_monitor_item }, + { SPA_TYPE_OBJECT_ParamList, SPA_TYPE_PARAM__List, SPA_TYPE_Object, spa_type_param_list, }, + { SPA_TYPE_OBJECT_PropInfo, SPA_TYPE__PropInfo, SPA_TYPE_Object, spa_type_prop_info, }, + { SPA_TYPE_OBJECT_Props, SPA_TYPE__Props, SPA_TYPE_Object, spa_type_props }, + { SPA_TYPE_OBJECT_Format, SPA_TYPE__Format, SPA_TYPE_Object, spa_type_format }, + { SPA_TYPE_OBJECT_ParamBuffers, SPA_TYPE_PARAM__Buffers, SPA_TYPE_Object, spa_type_param_buffers, }, + { SPA_TYPE_OBJECT_ParamMeta, SPA_TYPE_PARAM__Meta, SPA_TYPE_Object, spa_type_param_meta }, + { SPA_TYPE_OBJECT_ParamIO, SPA_TYPE_PARAM__IO, SPA_TYPE_Object, spa_type_param_io }, { 0, NULL, } }; diff --git a/spa/include/spa/utils/type.h b/spa/include/spa/utils/type.h index 65df87463..bb58e2569 100644 --- a/spa/include/spa/utils/type.h +++ b/spa/include/spa/utils/type.h @@ -27,75 +27,73 @@ extern "C" { #include enum { - SPA_ID_INVALID = 0xffffffff, - /* Basic types */ - SPA_ID_BASE = 0x00000, - SPA_ID_None, - SPA_ID_Bool, - SPA_ID_Enum, - SPA_ID_Int, - SPA_ID_Long, - SPA_ID_Float, - SPA_ID_Double, - SPA_ID_String, - SPA_ID_Bytes, - SPA_ID_Rectangle, - SPA_ID_Fraction, - SPA_ID_Bitmap, - SPA_ID_Array, - SPA_ID_Struct, - SPA_ID_Object, - SPA_ID_Sequence, - SPA_ID_Pointer, - SPA_ID_Fd, - SPA_ID_Prop, - SPA_ID_Pod, + SPA_TYPE_START = 0x00000, + SPA_TYPE_None, + SPA_TYPE_Bool, + SPA_TYPE_Enum, + SPA_TYPE_Int, + SPA_TYPE_Long, + SPA_TYPE_Float, + SPA_TYPE_Double, + SPA_TYPE_String, + SPA_TYPE_Bytes, + SPA_TYPE_Rectangle, + SPA_TYPE_Fraction, + SPA_TYPE_Bitmap, + SPA_TYPE_Array, + SPA_TYPE_Struct, + SPA_TYPE_Object, + SPA_TYPE_Sequence, + SPA_TYPE_Pointer, + SPA_TYPE_Fd, + SPA_TYPE_Prop, + SPA_TYPE_Pod, /* Pointers */ - SPA_ID_POINTER_BASE = 0x10000, - SPA_ID_POINTER_Buffer, - SPA_ID_POINTER_Meta, - SPA_ID_POINTER_Dict, + SPA_TYPE_POINTER_START = 0x10000, + SPA_TYPE_POINTER_Buffer, + SPA_TYPE_POINTER_Meta, + SPA_TYPE_POINTER_Dict, /* Interfaces */ - SPA_ID_INTERFACE_BASE = 0x20000, - SPA_ID_INTERFACE_Handle, - SPA_ID_INTERFACE_HandleFactory, - SPA_ID_INTERFACE_Log, - SPA_ID_INTERFACE_Loop, - SPA_ID_INTERFACE_LoopControl, - SPA_ID_INTERFACE_LoopUtils, - SPA_ID_INTERFACE_DataLoop, - SPA_ID_INTERFACE_MainLoop, - SPA_ID_INTERFACE_DBus, - SPA_ID_INTERFACE_Monitor, - SPA_ID_INTERFACE_Node, + SPA_TYPE_INTERFACE_START = 0x20000, + SPA_TYPE_INTERFACE_Handle, + SPA_TYPE_INTERFACE_HandleFactory, + SPA_TYPE_INTERFACE_Log, + SPA_TYPE_INTERFACE_Loop, + SPA_TYPE_INTERFACE_LoopControl, + SPA_TYPE_INTERFACE_LoopUtils, + SPA_TYPE_INTERFACE_DataLoop, + SPA_TYPE_INTERFACE_MainLoop, + SPA_TYPE_INTERFACE_DBus, + SPA_TYPE_INTERFACE_Monitor, + SPA_TYPE_INTERFACE_Node, /* Events */ - SPA_ID_EVENT_BASE = 0x30000, - SPA_ID_EVENT_Monitor, - SPA_ID_EVENT_Node, + SPA_TYPE_EVENT_START = 0x30000, + SPA_TYPE_EVENT_Monitor, + SPA_TYPE_EVENT_Node, /* Commands */ - SPA_ID_COMMAND_BASE = 0x40000, - SPA_ID_COMMAND_Node, + SPA_TYPE_COMMAND_START = 0x40000, + SPA_TYPE_COMMAND_Node, /* Objects */ - SPA_ID_OBJECT_BASE = 0x50000, - SPA_ID_OBJECT_MonitorItem, - SPA_ID_OBJECT_ParamList, - SPA_ID_OBJECT_PropInfo, - SPA_ID_OBJECT_Props, - SPA_ID_OBJECT_Format, - SPA_ID_OBJECT_ParamBuffers, - SPA_ID_OBJECT_ParamMeta, - SPA_ID_OBJECT_ParamIO, + SPA_TYPE_OBJECT_START = 0x50000, + SPA_TYPE_OBJECT_MonitorItem, + SPA_TYPE_OBJECT_ParamList, + SPA_TYPE_OBJECT_PropInfo, + SPA_TYPE_OBJECT_Props, + SPA_TYPE_OBJECT_Format, + SPA_TYPE_OBJECT_ParamBuffers, + SPA_TYPE_OBJECT_ParamMeta, + SPA_TYPE_OBJECT_ParamIO, /* vendor extensions */ - SPA_ID_VENDOR_PipeWire = 0x01000000, + SPA_TYPE_VENDOR_PipeWire = 0x01000000, - SPA_ID_VENDOR_Other = 0x7f000000, + SPA_TYPE_VENDOR_Other = 0x7f000000, }; diff --git a/spa/plugins/alsa/alsa-monitor.c b/spa/plugins/alsa/alsa-monitor.c index 1f092838f..9fd85917f 100644 --- a/spa/plugins/alsa/alsa-monitor.c +++ b/spa/plugins/alsa/alsa-monitor.c @@ -161,13 +161,13 @@ fill_item(struct impl *this, snd_ctl_card_info_t *card_info, name = "Unknown"; spa_pod_builder_add(builder, - "<", 0, SPA_ID_OBJECT_MonitorItem, + "<", SPA_TYPE_OBJECT_MonitorItem, 0, ":", SPA_MONITOR_ITEM_id, "s", id, ":", SPA_MONITOR_ITEM_flags, "I", SPA_MONITOR_ITEM_FLAG_NONE, ":", SPA_MONITOR_ITEM_state, "I", SPA_MONITOR_ITEM_STATE_AVAILABLE, ":", SPA_MONITOR_ITEM_name, "s", name, ":", SPA_MONITOR_ITEM_class, "s", klass, - ":", SPA_MONITOR_ITEM_factory, "p", SPA_ID_INTERFACE_HandleFactory, factory, + ":", SPA_MONITOR_ITEM_factory, "p", SPA_TYPE_INTERFACE_HandleFactory, factory, ":", SPA_MONITOR_ITEM_info, "[", NULL); spa_pod_builder_add(builder, @@ -380,18 +380,18 @@ static void impl_on_fd_events(struct spa_source *source) if (SPA_FLAG_CHECK(device->flags, DEVICE_FLAG_PLAYBACK)) { snprintf(id, 64, "%s,%d/P", card->name, device->id); - event = spa_pod_builder_object(&b, id, SPA_ID_EVENT_Monitor); + event = spa_pod_builder_object(&b, SPA_TYPE_EVENT_Monitor, id); spa_pod_builder_object(&b, - 0, SPA_ID_OBJECT_MonitorItem, + SPA_TYPE_OBJECT_MonitorItem, 0, ":", SPA_MONITOR_ITEM_id, "s", id, ":", SPA_MONITOR_ITEM_name, "s", id); this->callbacks->event(this->callbacks_data, event); } if (SPA_FLAG_CHECK(device->flags, DEVICE_FLAG_RECORD)) { snprintf(id, 64, "%s,%d/C", card->name, device->id); - event = spa_pod_builder_object(&b, id, SPA_ID_EVENT_Monitor); + event = spa_pod_builder_object(&b, SPA_TYPE_EVENT_Monitor, id); spa_pod_builder_object(&b, - 0, SPA_ID_OBJECT_MonitorItem, + SPA_TYPE_OBJECT_MonitorItem, 0, ":", SPA_MONITOR_ITEM_id, "s", id, ":", SPA_MONITOR_ITEM_name, "s", id); this->callbacks->event(this->callbacks_data, event); @@ -408,7 +408,7 @@ static void impl_on_fd_events(struct spa_source *source) struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer)); struct spa_pod *item; - event = spa_pod_builder_object(&b, id, SPA_ID_EVENT_Monitor); + event = spa_pod_builder_object(&b, SPA_TYPE_EVENT_Monitor, id); if (get_next_device(this, card, &item, &b) < 0) break; @@ -535,7 +535,7 @@ static const struct spa_monitor impl_monitor = { impl_monitor_enum_items, }; -static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, void **interface) +static int impl_get_interface(struct spa_handle *handle, uint32_t type, void **interface) { struct impl *this; @@ -544,7 +544,7 @@ static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, this = (struct impl *) handle; - if (interface_id == SPA_ID_INTERFACE_Monitor) + if (type == SPA_TYPE_INTERFACE_Monitor) *interface = &this->monitor; else return -ENOENT; @@ -596,9 +596,9 @@ impl_init(const struct spa_handle_factory *factory, this = (struct impl *) handle; for (i = 0; i < n_support; i++) { - if (support[i].type == SPA_ID_INTERFACE_Log) + if (support[i].type == SPA_TYPE_INTERFACE_Log) this->log = support[i].data; - else if (support[i].type == SPA_ID_INTERFACE_MainLoop) + else if (support[i].type == SPA_TYPE_INTERFACE_MainLoop) this->main_loop = support[i].data; } if (this->main_loop == NULL) { @@ -612,7 +612,7 @@ impl_init(const struct spa_handle_factory *factory, } static const struct spa_interface_info impl_interfaces[] = { - {SPA_ID_INTERFACE_Monitor,}, + {SPA_TYPE_INTERFACE_Monitor,}, }; static int diff --git a/spa/plugins/alsa/alsa-sink.c b/spa/plugins/alsa/alsa-sink.c index 1e86f187b..542ae2f45 100644 --- a/spa/plugins/alsa/alsa-sink.c +++ b/spa/plugins/alsa/alsa-sink.c @@ -69,7 +69,7 @@ static int impl_node_enum_params(struct spa_node *node, SPA_PARAM_Props }; if (*index < SPA_N_ELEMENTS(list)) - param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList, + param = spa_pod_builder_object(&b, SPA_TYPE_OBJECT_ParamList, id, ":", SPA_PARAM_LIST_id, "I", list[*index]); else return 0; @@ -82,28 +82,28 @@ static int impl_node_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_PropInfo, + SPA_TYPE_OBJECT_PropInfo, id, ":", SPA_PROP_INFO_id, "I", SPA_PROP_device, ":", SPA_PROP_INFO_name, "s", "The ALSA device", ":", SPA_PROP_INFO_type, "S", p->device, sizeof(p->device)); break; case 1: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_PropInfo, + SPA_TYPE_OBJECT_PropInfo, id, ":", SPA_PROP_INFO_id, "I", SPA_PROP_deviceName, ":", SPA_PROP_INFO_name, "s", "The ALSA device name", ":", SPA_PROP_INFO_type, "S-r", p->device_name, sizeof(p->device_name)); break; case 2: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_PropInfo, + SPA_TYPE_OBJECT_PropInfo, id, ":", SPA_PROP_INFO_id, "I", SPA_PROP_cardName, ":", SPA_PROP_INFO_name, "s", "The ALSA card name", ":", SPA_PROP_INFO_type, "S-r", p->card_name, sizeof(p->card_name)); break; case 3: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_PropInfo, + SPA_TYPE_OBJECT_PropInfo, id, ":", SPA_PROP_INFO_id, "I", SPA_PROP_minLatency, ":", SPA_PROP_INFO_name, "s", "The minimum latency", ":", SPA_PROP_INFO_type, "ir", p->min_latency, @@ -111,7 +111,7 @@ static int impl_node_enum_params(struct spa_node *node, break; case 4: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_PropInfo, + SPA_TYPE_OBJECT_PropInfo, id, ":", SPA_PROP_INFO_id, "I", SPA_PROP_maxLatency, ":", SPA_PROP_INFO_name, "s", "The maximum latency", ":", SPA_PROP_INFO_type, "ir", p->max_latency, @@ -129,7 +129,7 @@ static int impl_node_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_Props, + SPA_TYPE_OBJECT_Props, id, ":", SPA_PROP_device, "S", p->device, sizeof(p->device), ":", SPA_PROP_deviceName, "S-r", p->device_name, sizeof(p->device_name), ":", SPA_PROP_cardName, "S-r", p->card_name, sizeof(p->card_name), @@ -327,7 +327,7 @@ impl_node_port_enum_params(struct spa_node *node, SPA_PARAM_IO, }; if (*index < SPA_N_ELEMENTS(list)) - param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList, + param = spa_pod_builder_object(&b, SPA_TYPE_OBJECT_ParamList, id, ":", SPA_PARAM_LIST_id, "I", list[*index]); else return 0; @@ -343,7 +343,7 @@ impl_node_port_enum_params(struct spa_node *node, return 0; param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, id, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", this->current_format.info.raw.format, @@ -359,7 +359,7 @@ impl_node_port_enum_params(struct spa_node *node, return 0; param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamBuffers, + SPA_TYPE_OBJECT_ParamBuffers, id, ":", SPA_PARAM_BUFFERS_buffers, "ir", 1, SPA_POD_PROP_MIN_MAX(1, MAX_BUFFERS), ":", SPA_PARAM_BUFFERS_blocks, "i", 1, @@ -378,7 +378,7 @@ impl_node_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamMeta, + SPA_TYPE_OBJECT_ParamMeta, id, ":", SPA_PARAM_META_type, "I", SPA_META_Header, ":", SPA_PARAM_META_size, "i", sizeof(struct spa_meta_header)); break; @@ -391,19 +391,19 @@ impl_node_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamIO, + SPA_TYPE_OBJECT_ParamIO, id, ":", SPA_PARAM_IO_id, "I", SPA_IO_Buffers, ":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_buffers)); break; case 1: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamIO, + SPA_TYPE_OBJECT_ParamIO, id, ":", SPA_PARAM_IO_id, "I", SPA_IO_ControlRange, ":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_control_range)); break; case 2: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamIO, + SPA_TYPE_OBJECT_ParamIO, id, ":", SPA_PARAM_IO_id, "I", SPA_IO_Clock, ":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_clock)); break; @@ -680,7 +680,7 @@ static const struct spa_node impl_node = { impl_node_process, }; -static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, void **interface) +static int impl_get_interface(struct spa_handle *handle, uint32_t type, void **interface) { struct state *this; @@ -689,7 +689,7 @@ static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, this = (struct state *) handle; - if (interface_id == SPA_ID_INTERFACE_Node) + if (type == SPA_TYPE_INTERFACE_Node) *interface = &this->node; else return -ENOENT; @@ -724,11 +724,11 @@ impl_init(const struct spa_handle_factory *factory, this = (struct state *) handle; for (i = 0; i < n_support; i++) { - if (support[i].type == SPA_ID_INTERFACE_Log) + if (support[i].type == SPA_TYPE_INTERFACE_Log) this->log = support[i].data; - else if (support[i].type == SPA_ID_INTERFACE_DataLoop) + else if (support[i].type == SPA_TYPE_INTERFACE_DataLoop) this->data_loop = support[i].data; - else if (support[i].type == SPA_ID_INTERFACE_MainLoop) + else if (support[i].type == SPA_TYPE_INTERFACE_MainLoop) this->main_loop = support[i].data; } if (this->data_loop == NULL) { @@ -761,7 +761,7 @@ impl_init(const struct spa_handle_factory *factory, } static const struct spa_interface_info impl_interfaces[] = { - {SPA_ID_INTERFACE_Node,}, + {SPA_TYPE_INTERFACE_Node,}, }; static int diff --git a/spa/plugins/alsa/alsa-source.c b/spa/plugins/alsa/alsa-source.c index d269d8dfb..e0179d212 100644 --- a/spa/plugins/alsa/alsa-source.c +++ b/spa/plugins/alsa/alsa-source.c @@ -73,7 +73,7 @@ static int impl_node_enum_params(struct spa_node *node, SPA_PARAM_Props, }; if (*index < SPA_N_ELEMENTS(list)) - param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList, + param = spa_pod_builder_object(&b, SPA_TYPE_OBJECT_ParamList, id, ":", SPA_PARAM_LIST_id, "I", list[*index]); else return 0; @@ -83,28 +83,28 @@ static int impl_node_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_PropInfo, + SPA_TYPE_OBJECT_PropInfo, id, ":", SPA_PROP_INFO_id, "I", SPA_PROP_device, ":", SPA_PROP_INFO_name, "s", "The ALSA device", ":", SPA_PROP_INFO_type, "S", p->device, sizeof(p->device)); break; case 1: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_PropInfo, + SPA_TYPE_OBJECT_PropInfo, id, ":", SPA_PROP_INFO_id, "I", SPA_PROP_deviceName, ":", SPA_PROP_INFO_name, "s", "The ALSA device name", ":", SPA_PROP_INFO_type, "S-r", p->device_name, sizeof(p->device_name)); break; case 2: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_PropInfo, + SPA_TYPE_OBJECT_PropInfo, id, ":", SPA_PROP_INFO_id, "I", SPA_PROP_cardName, ":", SPA_PROP_INFO_name, "s", "The ALSA card name", ":", SPA_PROP_INFO_type, "S-r", p->card_name, sizeof(p->card_name)); break; case 3: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_PropInfo, + SPA_TYPE_OBJECT_PropInfo, id, ":", SPA_PROP_INFO_id, "I", SPA_PROP_minLatency, ":", SPA_PROP_INFO_name, "s", "The minimum latency", ":", SPA_PROP_INFO_type, "ir", p->min_latency, @@ -112,7 +112,7 @@ static int impl_node_enum_params(struct spa_node *node, break; case 4: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_PropInfo, + SPA_TYPE_OBJECT_PropInfo, id, ":", SPA_PROP_INFO_id, "I", SPA_PROP_maxLatency, ":", SPA_PROP_INFO_name, "s", "The maximum latency", ":", SPA_PROP_INFO_type, "ir", p->max_latency, @@ -127,7 +127,7 @@ static int impl_node_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_Props, + SPA_TYPE_OBJECT_Props, id, ":", SPA_PROP_device, "S", p->device, sizeof(p->device), ":", SPA_PROP_deviceName, "S-r", p->device_name, sizeof(p->device_name), ":", SPA_PROP_cardName, "S-r", p->card_name, sizeof(p->card_name), @@ -319,7 +319,7 @@ static int port_get_format(struct spa_node *node, return 0; *param = spa_pod_builder_object(builder, - SPA_PARAM_Format, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_Format, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", this->current_format.info.raw.format, @@ -364,7 +364,7 @@ impl_node_port_enum_params(struct spa_node *node, SPA_PARAM_Meta }; if (*index < SPA_N_ELEMENTS(list)) - param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList, + param = spa_pod_builder_object(&b, SPA_TYPE_OBJECT_ParamList, id, ":", SPA_PARAM_LIST_id, "I", list[*index]); else return 0; @@ -385,7 +385,7 @@ impl_node_port_enum_params(struct spa_node *node, return 0; param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamBuffers, + SPA_TYPE_OBJECT_ParamBuffers, id, ":", SPA_PARAM_BUFFERS_buffers, "ir", 2, SPA_POD_PROP_MIN_MAX(1, MAX_BUFFERS), ":", SPA_PARAM_BUFFERS_blocks, "i", 1, @@ -404,7 +404,7 @@ impl_node_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamMeta, + SPA_TYPE_OBJECT_ParamMeta, id, ":", SPA_PARAM_META_type, "I", SPA_META_Header, ":", SPA_PARAM_META_size, "i", sizeof(struct spa_meta_header)); break; @@ -417,13 +417,13 @@ impl_node_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamIO, + SPA_TYPE_OBJECT_ParamIO, id, ":", SPA_PARAM_IO_id, "I", SPA_IO_Buffers, ":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_buffers)); break; case 1: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamIO, + SPA_TYPE_OBJECT_ParamIO, id, ":", SPA_PARAM_IO_id, "I", SPA_IO_Clock, ":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_clock)); break; @@ -707,7 +707,7 @@ static const struct spa_node impl_node = { impl_node_process, }; -static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, void **interface) +static int impl_get_interface(struct spa_handle *handle, uint32_t type, void **interface) { struct state *this; @@ -716,7 +716,7 @@ static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, this = (struct state *) handle; - if (interface_id == SPA_ID_INTERFACE_Node) + if (type == SPA_TYPE_INTERFACE_Node) *interface = &this->node; else return -ENOENT; @@ -755,11 +755,11 @@ impl_init(const struct spa_handle_factory *factory, this = (struct state *) handle; for (i = 0; i < n_support; i++) { - if (support[i].type == SPA_ID_INTERFACE_Log) + if (support[i].type == SPA_TYPE_INTERFACE_Log) this->log = support[i].data; - else if (support[i].type == SPA_ID_INTERFACE_DataLoop) + else if (support[i].type == SPA_TYPE_INTERFACE_DataLoop) this->data_loop = support[i].data; - else if (support[i].type == SPA_ID_INTERFACE_MainLoop) + else if (support[i].type == SPA_TYPE_INTERFACE_MainLoop) this->main_loop = support[i].data; } if (this->data_loop == NULL) { @@ -792,7 +792,7 @@ impl_init(const struct spa_handle_factory *factory, } static const struct spa_interface_info impl_interfaces[] = { - {SPA_ID_INTERFACE_Node,}, + {SPA_TYPE_INTERFACE_Node,}, }; static int diff --git a/spa/plugins/alsa/alsa-utils.c b/spa/plugins/alsa/alsa-utils.c index e79338433..97558900a 100644 --- a/spa/plugins/alsa/alsa-utils.c +++ b/spa/plugins/alsa/alsa-utils.c @@ -133,7 +133,7 @@ spa_alsa_enum_format(struct state *state, uint32_t *index, snd_pcm_hw_params_alloca(¶ms); CHECK(snd_pcm_hw_params_any(hndl, params), "Broken configuration: no configurations available"); - spa_pod_builder_push_object(&b, SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format); + spa_pod_builder_push_object(&b, SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat); spa_pod_builder_add(&b, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, 0); diff --git a/spa/plugins/audioconvert/audioconvert.c b/spa/plugins/audioconvert/audioconvert.c index 7081cc849..1cc9a0124 100644 --- a/spa/plugins/audioconvert/audioconvert.c +++ b/spa/plugins/audioconvert/audioconvert.c @@ -568,7 +568,7 @@ impl_node_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(builder, - id, SPA_ID_OBJECT_PropInfo, + SPA_TYPE_OBJECT_PropInfo, id, ":", SPA_PROP_INFO_id, "I", SPA_PROP_volume, ":", SPA_PROP_INFO_type, "fru", 1.0, SPA_POD_PROP_MIN_MAX(0.0, 10.0)); @@ -752,7 +752,7 @@ static const struct spa_node impl_node = { impl_node_process, }; -static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, void **interface) +static int impl_get_interface(struct spa_handle *handle, uint32_t type, void **interface) { struct impl *this; @@ -761,7 +761,7 @@ static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, this = (struct impl *) handle; - if (interface_id == SPA_ID_INTERFACE_Node) + if (type == SPA_TYPE_INTERFACE_Node) *interface = &this->node; else return -ENOENT; @@ -820,7 +820,7 @@ impl_init(const struct spa_handle_factory *factory, this = (struct impl *) handle; for (i = 0; i < n_support; i++) { - if (support[i].type == SPA_ID_INTERFACE_Log) + if (support[i].type == SPA_TYPE_INTERFACE_Log) this->log = support[i].data; } this->node = impl_node; @@ -849,13 +849,13 @@ impl_init(const struct spa_handle_factory *factory, info, support, n_support); size = spa_handle_factory_get_size(&spa_resample_factory, info); - spa_handle_get_interface(this->hnd_fmt[SPA_DIRECTION_INPUT], SPA_ID_INTERFACE_Node, &iface); + spa_handle_get_interface(this->hnd_fmt[SPA_DIRECTION_INPUT], SPA_TYPE_INTERFACE_Node, &iface); this->fmt[SPA_DIRECTION_INPUT] = iface; - spa_handle_get_interface(this->hnd_fmt[SPA_DIRECTION_OUTPUT], SPA_ID_INTERFACE_Node, &iface); + spa_handle_get_interface(this->hnd_fmt[SPA_DIRECTION_OUTPUT], SPA_TYPE_INTERFACE_Node, &iface); this->fmt[SPA_DIRECTION_OUTPUT] = iface; - spa_handle_get_interface(this->hnd_channelmix, SPA_ID_INTERFACE_Node, &iface); + spa_handle_get_interface(this->hnd_channelmix, SPA_TYPE_INTERFACE_Node, &iface); this->channelmix = iface; - spa_handle_get_interface(this->hnd_resample, SPA_ID_INTERFACE_Node, &iface); + spa_handle_get_interface(this->hnd_resample, SPA_TYPE_INTERFACE_Node, &iface); this->resample = iface; props_reset(&this->props); @@ -864,7 +864,7 @@ impl_init(const struct spa_handle_factory *factory, } static const struct spa_interface_info impl_interfaces[] = { - { SPA_ID_INTERFACE_Node, }, + { SPA_TYPE_INTERFACE_Node, }, }; static int diff --git a/spa/plugins/audioconvert/channelmix.c b/spa/plugins/audioconvert/channelmix.c index b775e5d68..46aa3faae 100644 --- a/spa/plugins/audioconvert/channelmix.c +++ b/spa/plugins/audioconvert/channelmix.c @@ -312,7 +312,7 @@ static int port_enum_formats(struct spa_node *node, case 0: if (other->have_format) { *param = spa_pod_builder_object(builder, - SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_F32, @@ -322,7 +322,7 @@ static int port_enum_formats(struct spa_node *node, SPA_POD_PROP_MIN_MAX(1, INT32_MAX)); } else { *param = spa_pod_builder_object(builder, - SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_F32, @@ -354,7 +354,7 @@ static int port_get_format(struct spa_node *node, return 0; *param = spa_pod_builder_object(builder, - SPA_PARAM_Format, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_Format, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", port->format.info.raw.format, @@ -404,7 +404,7 @@ impl_node_port_enum_params(struct spa_node *node, SPA_PARAM_IO }; if (*index < SPA_N_ELEMENTS(list)) - param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList, + param = spa_pod_builder_object(&b, SPA_TYPE_OBJECT_ParamList, id, ":", SPA_PARAM_LIST_id, "I", list[*index]); else return 0; @@ -438,7 +438,7 @@ impl_node_port_enum_params(struct spa_node *node, } param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamBuffers, + SPA_TYPE_OBJECT_ParamBuffers, id, ":", SPA_PARAM_BUFFERS_buffers, "iru", buffers, SPA_POD_PROP_MIN_MAX(1, MAX_BUFFERS), ":", SPA_PARAM_BUFFERS_blocks, "i", port->blocks, @@ -455,7 +455,7 @@ impl_node_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamMeta, + SPA_TYPE_OBJECT_ParamMeta, id, ":", SPA_PARAM_META_type, "I", SPA_META_Header, ":", SPA_PARAM_META_size, "i", sizeof(struct spa_meta_header)); break; @@ -468,7 +468,7 @@ impl_node_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamIO, + SPA_TYPE_OBJECT_ParamIO, id, ":", SPA_PARAM_IO_id, "I", SPA_IO_Buffers, ":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_buffers)); break; @@ -818,7 +818,7 @@ static const struct spa_node impl_node = { impl_node_process, }; -static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, void **interface) +static int impl_get_interface(struct spa_handle *handle, uint32_t type, void **interface) { struct impl *this; @@ -827,7 +827,7 @@ static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, this = (struct impl *) handle; - if (interface_id == SPA_ID_INTERFACE_Node) + if (type == SPA_TYPE_INTERFACE_Node) *interface = &this->node; else return -ENOENT; @@ -867,7 +867,7 @@ impl_init(const struct spa_handle_factory *factory, this = (struct impl *) handle; for (i = 0; i < n_support; i++) { - if (support[i].type == SPA_ID_INTERFACE_Log) + if (support[i].type == SPA_TYPE_INTERFACE_Log) this->log = support[i].data; } @@ -889,7 +889,7 @@ impl_init(const struct spa_handle_factory *factory, } static const struct spa_interface_info impl_interfaces[] = { - {SPA_ID_INTERFACE_Node,}, + {SPA_TYPE_INTERFACE_Node,}, }; static int diff --git a/spa/plugins/audioconvert/fmtconvert.c b/spa/plugins/audioconvert/fmtconvert.c index e52d38e8c..920f88022 100644 --- a/spa/plugins/audioconvert/fmtconvert.c +++ b/spa/plugins/audioconvert/fmtconvert.c @@ -421,7 +421,7 @@ static int port_enum_formats(struct spa_node *node, case 0: if (other->info.raw.channels > 0) { *param = spa_pod_builder_object(builder, - SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "Ieu", other->info.raw.format, @@ -435,7 +435,7 @@ static int port_enum_formats(struct spa_node *node, ":", SPA_FORMAT_AUDIO_channels, "i", other->info.raw.channels); } else { *param = spa_pod_builder_object(builder, - SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "Ieu", SPA_AUDIO_FORMAT_S16, @@ -480,7 +480,7 @@ static int port_get_format(struct spa_node *node, return 0; *param = spa_pod_builder_object(builder, - SPA_PARAM_Format, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_Format, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", port->format.info.raw.format, @@ -531,7 +531,7 @@ impl_node_port_enum_params(struct spa_node *node, SPA_PARAM_IO }; if (*index < SPA_N_ELEMENTS(list)) - param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList, + param = spa_pod_builder_object(&b, SPA_TYPE_OBJECT_ParamList, id, ":", SPA_PARAM_LIST_id, "I", list[*index]); else return 0; @@ -568,7 +568,7 @@ impl_node_port_enum_params(struct spa_node *node, } param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamBuffers, + SPA_TYPE_OBJECT_ParamBuffers, id, ":", SPA_PARAM_BUFFERS_buffers, "iru", buffers, SPA_POD_PROP_MIN_MAX(2, MAX_BUFFERS), ":", SPA_PARAM_BUFFERS_blocks, "i", port->blocks, @@ -585,7 +585,7 @@ impl_node_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamMeta, + SPA_TYPE_OBJECT_ParamMeta, id, ":", SPA_PARAM_META_type, "I", SPA_META_Header, ":", SPA_PARAM_META_size, "i", sizeof(struct spa_meta_header)); break; @@ -598,7 +598,7 @@ impl_node_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamIO, + SPA_TYPE_OBJECT_ParamIO, id, ":", SPA_PARAM_IO_id, "I", SPA_IO_Buffers, ":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_buffers)); break; @@ -1126,7 +1126,7 @@ static const struct spa_node impl_node = { impl_node_process, }; -static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, void **interface) +static int impl_get_interface(struct spa_handle *handle, uint32_t type, void **interface) { struct impl *this; @@ -1135,7 +1135,7 @@ static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, this = (struct impl *) handle; - if (interface_id == SPA_ID_INTERFACE_Node) + if (type == SPA_TYPE_INTERFACE_Node) *interface = &this->node; else return -ENOENT; @@ -1174,7 +1174,7 @@ impl_init(const struct spa_handle_factory *factory, this = (struct impl *) handle; for (i = 0; i < n_support; i++) { - if (support[i].type == SPA_ID_INTERFACE_Log) + if (support[i].type == SPA_TYPE_INTERFACE_Log) this->log = support[i].data; } this->node = impl_node; @@ -1188,7 +1188,7 @@ impl_init(const struct spa_handle_factory *factory, } static const struct spa_interface_info impl_interfaces[] = { - {SPA_ID_INTERFACE_Node,}, + {SPA_TYPE_INTERFACE_Node,}, }; static int diff --git a/spa/plugins/audioconvert/merger.c b/spa/plugins/audioconvert/merger.c index 2d43c3008..5c29a6411 100644 --- a/spa/plugins/audioconvert/merger.c +++ b/spa/plugins/audioconvert/merger.c @@ -319,7 +319,7 @@ static int port_enum_formats(struct spa_node *node, if (direction == SPA_DIRECTION_OUTPUT) { *param = spa_pod_builder_object(builder, - SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "Ieu", SPA_AUDIO_FORMAT_F32, @@ -344,7 +344,7 @@ static int port_enum_formats(struct spa_node *node, } else { *param = spa_pod_builder_object(builder, - SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_F32, @@ -375,7 +375,7 @@ static int port_get_format(struct spa_node *node, return 0; *param = spa_pod_builder_object(builder, - SPA_PARAM_Format, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_Format, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", port->format.info.raw.format, @@ -426,7 +426,7 @@ impl_node_port_enum_params(struct spa_node *node, SPA_PARAM_IO, }; if (*index < SPA_N_ELEMENTS(list)) - param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList, + param = spa_pod_builder_object(&b, SPA_TYPE_OBJECT_ParamList, id, ":", SPA_PARAM_LIST_id, "I", list[*index]); else return 0; @@ -446,7 +446,7 @@ impl_node_port_enum_params(struct spa_node *node, return 0; param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamBuffers, + SPA_TYPE_OBJECT_ParamBuffers, id, ":", SPA_PARAM_BUFFERS_buffers, "iru", 1, SPA_POD_PROP_MIN_MAX(1, MAX_BUFFERS), ":", SPA_PARAM_BUFFERS_blocks, "i", port->blocks, @@ -462,7 +462,7 @@ impl_node_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamMeta, + SPA_TYPE_OBJECT_ParamMeta, id, ":", SPA_PARAM_META_type, "i", SPA_META_Header, ":", SPA_PARAM_META_size, "i", sizeof(struct spa_meta_header)); break; @@ -474,7 +474,7 @@ impl_node_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamIO, + SPA_TYPE_OBJECT_ParamIO, id, ":", SPA_PARAM_IO_id, "I", SPA_IO_Buffers, ":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_buffers)); break; @@ -935,7 +935,7 @@ static const struct spa_node impl_node = { impl_node_process, }; -static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, void **interface) +static int impl_get_interface(struct spa_handle *handle, uint32_t type, void **interface) { struct impl *this; @@ -944,7 +944,7 @@ static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, this = (struct impl *) handle; - if (interface_id == SPA_ID_INTERFACE_Node) + if (type == SPA_TYPE_INTERFACE_Node) *interface = &this->node; else return -ENOENT; @@ -987,7 +987,7 @@ impl_init(const struct spa_handle_factory *factory, this = (struct impl *) handle; for (i = 0; i < n_support; i++) { - if (support[i].type == SPA_ID_INTERFACE_Log) + if (support[i].type == SPA_TYPE_INTERFACE_Log) this->log = support[i].data; } @@ -1010,7 +1010,7 @@ impl_init(const struct spa_handle_factory *factory, } static const struct spa_interface_info impl_interfaces[] = { - {SPA_ID_INTERFACE_Node,}, + {SPA_TYPE_INTERFACE_Node,}, }; static int diff --git a/spa/plugins/audioconvert/resample.c b/spa/plugins/audioconvert/resample.c index 4342d4ccd..9674141d0 100644 --- a/spa/plugins/audioconvert/resample.c +++ b/spa/plugins/audioconvert/resample.c @@ -282,7 +282,7 @@ static int port_enum_formats(struct spa_node *node, case 0: if (other->have_format) { *param = spa_pod_builder_object(builder, - SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_F32, @@ -292,7 +292,7 @@ static int port_enum_formats(struct spa_node *node, ":", SPA_FORMAT_AUDIO_channels, "i", other->format.info.raw.channels); } else { *param = spa_pod_builder_object(builder, - SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_F32, @@ -324,7 +324,7 @@ static int port_get_format(struct spa_node *node, return 0; *param = spa_pod_builder_object(builder, - SPA_PARAM_Format, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_Format, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", port->format.info.raw.format, @@ -374,7 +374,7 @@ impl_node_port_enum_params(struct spa_node *node, SPA_PARAM_IO }; if (*index < SPA_N_ELEMENTS(list)) - param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList, + param = spa_pod_builder_object(&b, SPA_TYPE_OBJECT_ParamList, id, ":", SPA_PARAM_LIST_id, "I", list[*index]); else return 0; @@ -407,7 +407,7 @@ impl_node_port_enum_params(struct spa_node *node, } param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamBuffers, + SPA_TYPE_OBJECT_ParamBuffers, id, ":", SPA_PARAM_BUFFERS_buffers, "iru", buffers, SPA_POD_PROP_MIN_MAX(1, MAX_BUFFERS), ":", SPA_PARAM_BUFFERS_blocks, "i", port->blocks, @@ -424,7 +424,7 @@ impl_node_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamMeta, + SPA_TYPE_OBJECT_ParamMeta, id, ":", SPA_PARAM_META_type, "I", SPA_META_Header, ":", SPA_PARAM_META_size, "i", sizeof(struct spa_meta_header)); break; @@ -436,7 +436,7 @@ impl_node_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamIO, + SPA_TYPE_OBJECT_ParamIO, id, ":", SPA_PARAM_IO_id, "I", SPA_IO_Buffers, ":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_buffers)); break; @@ -799,7 +799,7 @@ static const struct spa_node impl_node = { impl_node_process, }; -static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, void **interface) +static int impl_get_interface(struct spa_handle *handle, uint32_t type, void **interface) { struct impl *this; @@ -808,7 +808,7 @@ static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, this = (struct impl *) handle; - if (interface_id == SPA_ID_INTERFACE_Node) + if (type == SPA_TYPE_INTERFACE_Node) *interface = &this->node; else return -ENOENT; @@ -856,7 +856,7 @@ impl_init(const struct spa_handle_factory *factory, this = (struct impl *) handle; for (i = 0; i < n_support; i++) { - if (support[i].type == SPA_ID_INTERFACE_Log) + if (support[i].type == SPA_TYPE_INTERFACE_Log) this->log = support[i].data; } @@ -878,7 +878,7 @@ impl_init(const struct spa_handle_factory *factory, } static const struct spa_interface_info impl_interfaces[] = { - {SPA_ID_INTERFACE_Node,}, + {SPA_TYPE_INTERFACE_Node,}, }; static int diff --git a/spa/plugins/audioconvert/splitter.c b/spa/plugins/audioconvert/splitter.c index 0b0d1799e..5187427c4 100644 --- a/spa/plugins/audioconvert/splitter.c +++ b/spa/plugins/audioconvert/splitter.c @@ -319,7 +319,7 @@ static int port_enum_formats(struct spa_node *node, if (direction == SPA_DIRECTION_INPUT) { *param = spa_pod_builder_object(builder, - SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "Ieu", SPA_AUDIO_FORMAT_F32, @@ -344,7 +344,7 @@ static int port_enum_formats(struct spa_node *node, } else { *param = spa_pod_builder_object(builder, - SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_F32, @@ -375,7 +375,7 @@ static int port_get_format(struct spa_node *node, return 0; *param = spa_pod_builder_object(builder, - SPA_PARAM_Format, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_Format, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", port->format.info.raw.format, @@ -426,7 +426,7 @@ impl_node_port_enum_params(struct spa_node *node, SPA_PARAM_IO }; if (*index < SPA_N_ELEMENTS(list)) - param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList, + param = spa_pod_builder_object(&b, SPA_TYPE_OBJECT_ParamList, id, ":", SPA_PARAM_LIST_id, "I", list[*index]); else return 0; @@ -447,7 +447,7 @@ impl_node_port_enum_params(struct spa_node *node, return 0; param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamBuffers, + SPA_TYPE_OBJECT_ParamBuffers, id, ":", SPA_PARAM_BUFFERS_buffers, "iru", 1, SPA_POD_PROP_MIN_MAX(1, MAX_BUFFERS), ":", SPA_PARAM_BUFFERS_blocks, "i", port->blocks, @@ -464,7 +464,7 @@ impl_node_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamMeta, + SPA_TYPE_OBJECT_ParamMeta, id, ":", SPA_PARAM_META_type, "I", SPA_META_Header, ":", SPA_PARAM_META_size, "i", sizeof(struct spa_meta_header)); break; @@ -476,7 +476,7 @@ impl_node_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamIO, + SPA_TYPE_OBJECT_ParamIO, id, ":", SPA_PARAM_IO_id, "I", SPA_IO_Buffers, ":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_buffers)); break; @@ -944,7 +944,7 @@ static const struct spa_node impl_node = { impl_node_process, }; -static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, void **interface) +static int impl_get_interface(struct spa_handle *handle, uint32_t type, void **interface) { struct impl *this; @@ -953,7 +953,7 @@ static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, this = (struct impl *) handle; - if (interface_id == SPA_ID_INTERFACE_Node) + if (type == SPA_TYPE_INTERFACE_Node) *interface = &this->node; else return -ENOENT; @@ -996,7 +996,7 @@ impl_init(const struct spa_handle_factory *factory, this = (struct impl *) handle; for (i = 0; i < n_support; i++) { - if (support[i].type == SPA_ID_INTERFACE_Log) + if (support[i].type == SPA_TYPE_INTERFACE_Log) this->log = support[i].data; } @@ -1018,7 +1018,7 @@ impl_init(const struct spa_handle_factory *factory, } static const struct spa_interface_info impl_interfaces[] = { - {SPA_ID_INTERFACE_Node,}, + {SPA_TYPE_INTERFACE_Node,}, }; static int diff --git a/spa/plugins/audiomixer/audiomixer.c b/spa/plugins/audiomixer/audiomixer.c index 5b311fec8..cba784f6a 100644 --- a/spa/plugins/audiomixer/audiomixer.c +++ b/spa/plugins/audiomixer/audiomixer.c @@ -327,7 +327,7 @@ static int port_enum_formats(struct spa_node *node, case 0: if (this->have_format) { *param = spa_pod_builder_object(builder, - SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", this->format.info.raw.format, @@ -335,7 +335,7 @@ static int port_enum_formats(struct spa_node *node, ":", SPA_FORMAT_AUDIO_channels, "i", this->format.info.raw.channels); } else { *param = spa_pod_builder_object(builder, - SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "Ieu", SPA_AUDIO_FORMAT_S16, @@ -368,7 +368,7 @@ static int port_get_format(struct spa_node *node, return 0; *param = spa_pod_builder_object(builder, - SPA_PARAM_Format, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_Format, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", this->format.info.raw.format, @@ -416,7 +416,7 @@ impl_node_port_enum_params(struct spa_node *node, SPA_PARAM_IO, }; if (*index < SPA_N_ELEMENTS(list)) - param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList, + param = spa_pod_builder_object(&b, SPA_TYPE_OBJECT_ParamList, id, ":", SPA_PARAM_LIST_id, "I", list[*index]); else return 0; @@ -437,7 +437,7 @@ impl_node_port_enum_params(struct spa_node *node, return 0; param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamBuffers, + SPA_TYPE_OBJECT_ParamBuffers, id, ":", SPA_PARAM_BUFFERS_buffers, "iru", 1, SPA_POD_PROP_MIN_MAX(1, MAX_BUFFERS), ":", SPA_PARAM_BUFFERS_blocks, "i", 1, @@ -453,7 +453,7 @@ impl_node_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamMeta, + SPA_TYPE_OBJECT_ParamMeta, id, ":", SPA_PARAM_META_type, "I", SPA_META_Header, ":", SPA_PARAM_META_size, "i", sizeof(struct spa_meta_header)); break; @@ -465,13 +465,13 @@ impl_node_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamIO, + SPA_TYPE_OBJECT_ParamIO, id, ":", SPA_PARAM_IO_id, "I", SPA_IO_Buffers, ":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_buffers)); break; case 1: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamIO, + SPA_TYPE_OBJECT_ParamIO, id, ":", SPA_PARAM_IO_id, "I", SPA_IO_ControlRange, ":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_control_range)); break; @@ -971,7 +971,7 @@ static const struct spa_node impl_node = { impl_node_process, }; -static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, void **interface) +static int impl_get_interface(struct spa_handle *handle, uint32_t type, void **interface) { struct impl *this; @@ -980,7 +980,7 @@ static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, this = (struct impl *) handle; - if (interface_id == SPA_ID_INTERFACE_Node) + if (type == SPA_TYPE_INTERFACE_Node) *interface = &this->node; else return -ENOENT; @@ -1020,7 +1020,7 @@ impl_init(const struct spa_handle_factory *factory, this = (struct impl *) handle; for (i = 0; i < n_support; i++) { - if (support[i].type == SPA_ID_INTERFACE_Log) + if (support[i].type == SPA_TYPE_INTERFACE_Log) this->log = support[i].data; } @@ -1039,7 +1039,7 @@ impl_init(const struct spa_handle_factory *factory, } static const struct spa_interface_info impl_interfaces[] = { - {SPA_ID_INTERFACE_Node,}, + {SPA_TYPE_INTERFACE_Node,}, }; static int diff --git a/spa/plugins/audiotestsrc/audiotestsrc.c b/spa/plugins/audiotestsrc/audiotestsrc.c index 8063ceee7..4b84e5bcd 100644 --- a/spa/plugins/audiotestsrc/audiotestsrc.c +++ b/spa/plugins/audiotestsrc/audiotestsrc.c @@ -148,7 +148,7 @@ static int impl_node_enum_params(struct spa_node *node, SPA_PARAM_Props }; if (*index < SPA_N_ELEMENTS(list)) - param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList, + param = spa_pod_builder_object(&b, SPA_TYPE_OBJECT_ParamList, id, ":", SPA_PARAM_LIST_id, "I", list[*index]); else return 0; @@ -161,14 +161,14 @@ static int impl_node_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_PropInfo, + SPA_TYPE_OBJECT_PropInfo, id, ":", SPA_PROP_INFO_id, "I", SPA_PROP_live, ":", SPA_PROP_INFO_name, "s", "Configure live mode of the source", ":", SPA_PROP_INFO_type, "b", p->live); break; case 1: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_PropInfo, + SPA_TYPE_OBJECT_PropInfo, id, ":", SPA_PROP_INFO_id, "I", SPA_PROP_waveType, ":", SPA_PROP_INFO_name, "s", "Select the waveform", ":", SPA_PROP_INFO_type, "i", p->wave, @@ -178,7 +178,7 @@ static int impl_node_enum_params(struct spa_node *node, break; case 2: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_PropInfo, + SPA_TYPE_OBJECT_PropInfo, id, ":", SPA_PROP_INFO_id, "I", SPA_PROP_frequency, ":", SPA_PROP_INFO_name, "s", "Select the frequency", ":", SPA_PROP_INFO_type, "dr", p->freq, @@ -186,7 +186,7 @@ static int impl_node_enum_params(struct spa_node *node, break; case 3: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_PropInfo, + SPA_TYPE_OBJECT_PropInfo, id, ":", SPA_PROP_INFO_id, "I", SPA_PROP_volume, ":", SPA_PROP_INFO_name, "s", "Select the volume", ":", SPA_PROP_INFO_type, "dr", p->volume, @@ -204,7 +204,7 @@ static int impl_node_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_Props, + SPA_TYPE_OBJECT_Props, id, ":", SPA_PROP_live, "b", p->live, ":", SPA_PROP_waveType, "i", p->wave, ":", SPA_PROP_frequency, "d", p->freq, @@ -524,7 +524,7 @@ port_enum_formats(struct impl *this, switch (*index) { case 0: *param = spa_pod_builder_object(builder, - SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "Ieu", SPA_AUDIO_FORMAT_S16, @@ -557,7 +557,7 @@ port_get_format(struct impl *this, return 0; *param = spa_pod_builder_object(builder, - SPA_PARAM_Format, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_Format, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", this->current_format.info.raw.format, @@ -602,7 +602,7 @@ impl_node_port_enum_params(struct spa_node *node, SPA_PARAM_IO, }; if (*index < SPA_N_ELEMENTS(list)) - param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList, + param = spa_pod_builder_object(&b, SPA_TYPE_OBJECT_ParamList, id, ":", SPA_PARAM_LIST_id, "I", list[*index]); else return 0; @@ -624,7 +624,7 @@ impl_node_port_enum_params(struct spa_node *node, return 0; param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamBuffers, + SPA_TYPE_OBJECT_ParamBuffers, id, ":", SPA_PARAM_BUFFERS_buffers, "iru", 1, SPA_POD_PROP_MIN_MAX(1, MAX_BUFFERS), ":", SPA_PARAM_BUFFERS_blocks, "i", 1, @@ -640,7 +640,7 @@ impl_node_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamMeta, + SPA_TYPE_OBJECT_ParamMeta, id, ":", SPA_PARAM_META_type, "I", SPA_META_Header, ":", SPA_PARAM_META_size, "i", sizeof(struct spa_meta_header)); break; @@ -652,13 +652,13 @@ impl_node_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamIO, + SPA_TYPE_OBJECT_ParamIO, id, ":", SPA_PARAM_IO_id, "I", SPA_IO_Buffers, ":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_buffers)); break; case 1: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamIO, + SPA_TYPE_OBJECT_ParamIO, id, ":", SPA_PARAM_IO_id, "I", SPA_IO_ControlRange, ":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_control_range)); break; @@ -1003,7 +1003,7 @@ static const struct spa_node impl_node = { impl_node_process, }; -static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, void **interface) +static int impl_get_interface(struct spa_handle *handle, uint32_t type, void **interface) { struct impl *this; @@ -1012,7 +1012,7 @@ static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, this = (struct impl *) handle; - if (interface_id == SPA_ID_INTERFACE_Node) + if (type == SPA_TYPE_INTERFACE_Node) *interface = &this->node; else return -ENOENT; @@ -1061,9 +1061,9 @@ impl_init(const struct spa_handle_factory *factory, this = (struct impl *) handle; for (i = 0; i < n_support; i++) { - if (support[i].type == SPA_ID_INTERFACE_Log) + if (support[i].type == SPA_TYPE_INTERFACE_Log) this->log = support[i].data; - else if (support[i].type == SPA_ID_INTERFACE_DataLoop) + else if (support[i].type == SPA_TYPE_INTERFACE_DataLoop) this->data_loop = support[i].data; } @@ -1099,7 +1099,7 @@ impl_init(const struct spa_handle_factory *factory, } static const struct spa_interface_info impl_interfaces[] = { - {SPA_ID_INTERFACE_Node,}, + {SPA_TYPE_INTERFACE_Node,}, }; static int diff --git a/spa/plugins/bluez5/a2dp-sink.c b/spa/plugins/bluez5/a2dp-sink.c index 6d511e05a..1f6bf01e0 100644 --- a/spa/plugins/bluez5/a2dp-sink.c +++ b/spa/plugins/bluez5/a2dp-sink.c @@ -166,7 +166,7 @@ static int impl_node_enum_params(struct spa_node *node, SPA_PARAM_Props }; if (*index < SPA_N_ELEMENTS(list)) - param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList, + param = spa_pod_builder_object(&b, SPA_TYPE_OBJECT_ParamList, id, ":", SPA_PARAM_LIST_id, "I", list[*index]); else return 0; @@ -179,7 +179,7 @@ static int impl_node_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_PropInfo, + SPA_TYPE_OBJECT_PropInfo, id, ":", SPA_PROP_INFO_id, "I", SPA_PROP_minLatency, ":", SPA_PROP_INFO_name, "s", "The minimum latency", ":", SPA_PROP_INFO_type, "ir", p->min_latency, @@ -187,7 +187,7 @@ static int impl_node_enum_params(struct spa_node *node, break; case 1: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_PropInfo, + SPA_TYPE_OBJECT_PropInfo, id, ":", SPA_PROP_INFO_id, "I", SPA_PROP_maxLatency, ":", SPA_PROP_INFO_name, "s", "The maximum latency", ":", SPA_PROP_INFO_type, "ir", p->max_latency, @@ -205,7 +205,7 @@ static int impl_node_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_Props, + SPA_TYPE_OBJECT_Props, id, ":", SPA_PROP_minLatency, "i", p->min_latency, ":", SPA_PROP_maxLatency, "i", p->max_latency); break; @@ -946,7 +946,7 @@ impl_node_port_enum_params(struct spa_node *node, SPA_PARAM_Meta }; if (*index < SPA_N_ELEMENTS(list)) - param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList, + param = spa_pod_builder_object(&b, SPA_TYPE_OBJECT_ParamList, id, ":", SPA_PARAM_LIST_id, "I", list[*index]); else return 0; @@ -966,7 +966,7 @@ impl_node_port_enum_params(struct spa_node *node, return -EIO; param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, id, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_S16, @@ -985,7 +985,7 @@ impl_node_port_enum_params(struct spa_node *node, return 0; param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, id, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", this->current_format.info.raw.format, @@ -1001,7 +1001,7 @@ impl_node_port_enum_params(struct spa_node *node, return 0; param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamBuffers, + SPA_TYPE_OBJECT_ParamBuffers, id, ":", SPA_PARAM_BUFFERS_buffers, "ir", 2, SPA_POD_PROP_MIN_MAX(2, MAX_BUFFERS), ":", SPA_PARAM_BUFFERS_blocks, "i", 1, @@ -1020,7 +1020,7 @@ impl_node_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamMeta, + SPA_TYPE_OBJECT_ParamMeta, id, ":", SPA_PARAM_META_type, "I", SPA_META_Header, ":", SPA_PARAM_META_size, "i", sizeof(struct spa_meta_header)); break; @@ -1288,7 +1288,7 @@ static const struct spa_node impl_node = { impl_node_process, }; -static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, void **interface) +static int impl_get_interface(struct spa_handle *handle, uint32_t type, void **interface) { struct impl *this; @@ -1297,7 +1297,7 @@ static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, this = (struct impl *) handle; - if (interface_id == SPA_ID_INTERFACE_Node) + if (type == SPA_TYPE_INTERFACE_Node) *interface = &this->node; else return -ENOENT; @@ -1336,11 +1336,11 @@ impl_init(const struct spa_handle_factory *factory, this = (struct impl *) handle; for (i = 0; i < n_support; i++) { - if (support[i].type == SPA_ID_INTERFACE_Log) + if (support[i].type == SPA_TYPE_INTERFACE_Log) this->log = support[i].data; - else if (support[i].type == SPA_ID_INTERFACE_DataLoop) + else if (support[i].type == SPA_TYPE_INTERFACE_DataLoop) this->data_loop = support[i].data; - else if (support[i].type == SPA_ID_INTERFACE_MainLoop) + else if (support[i].type == SPA_TYPE_INTERFACE_MainLoop) this->main_loop = support[i].data; } if (this->data_loop == NULL) { @@ -1373,7 +1373,7 @@ impl_init(const struct spa_handle_factory *factory, } static const struct spa_interface_info impl_interfaces[] = { - {SPA_ID_INTERFACE_Node,}, + {SPA_TYPE_INTERFACE_Node,}, }; static int diff --git a/spa/plugins/bluez5/bluez5-monitor.c b/spa/plugins/bluez5/bluez5-monitor.c index 0c8193026..0db4dbef5 100644 --- a/spa/plugins/bluez5/bluez5-monitor.c +++ b/spa/plugins/bluez5/bluez5-monitor.c @@ -70,13 +70,13 @@ static void fill_item(struct spa_bt_monitor *this, struct spa_bt_transport *tran char trans[16]; spa_pod_builder_add(builder, - "<", 0, SPA_ID_OBJECT_MonitorItem, + "<", SPA_TYPE_OBJECT_MonitorItem, 0, ":", SPA_MONITOR_ITEM_id, "s", transport->path, ":", SPA_MONITOR_ITEM_flags, "I", SPA_MONITOR_ITEM_FLAG_NONE, ":", SPA_MONITOR_ITEM_state, "I", SPA_MONITOR_ITEM_STATE_AVAILABLE, ":", SPA_MONITOR_ITEM_name, "s", transport->path, ":", SPA_MONITOR_ITEM_class, "s", "Adapter/Bluetooth", - ":", SPA_MONITOR_ITEM_factory, "p", SPA_ID_INTERFACE_HandleFactory, &spa_a2dp_sink_factory, + ":", SPA_MONITOR_ITEM_factory, "p", SPA_TYPE_INTERFACE_HandleFactory, &spa_a2dp_sink_factory, ":", SPA_MONITOR_ITEM_info, "[", NULL); @@ -640,7 +640,7 @@ static struct spa_bt_node *node_create(struct spa_bt_monitor *monitor, struct sp struct spa_pod *item; spa_pod_builder_init(&b, buffer, sizeof(buffer)); - event = spa_pod_builder_object(&b, SPA_MONITOR_EVENT_Added, SPA_ID_EVENT_Monitor); + event = spa_pod_builder_object(&b, SPA_TYPE_EVENT_Monitor, SPA_MONITOR_EVENT_Added); fill_item(monitor, transport, &item, &b); monitor->callbacks->event(monitor->callbacks_data, event); @@ -656,7 +656,7 @@ static struct spa_bt_node *node_destroy(struct spa_bt_monitor *monitor, struct s struct spa_pod *item; spa_pod_builder_init(&b, buffer, sizeof(buffer)); - event = spa_pod_builder_object(&b, SPA_MONITOR_EVENT_Removed, SPA_ID_EVENT_Monitor); + event = spa_pod_builder_object(&b, SPA_TYPE_EVENT_Monitor, SPA_MONITOR_EVENT_Removed); fill_item(monitor, transport, &item, &b); monitor->callbacks->event(monitor->callbacks_data, event); @@ -1178,7 +1178,7 @@ static const struct spa_monitor impl_monitor = { impl_monitor_enum_items, }; -static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, void **interface) +static int impl_get_interface(struct spa_handle *handle, uint32_t type, void **interface) { struct spa_bt_monitor *this; @@ -1187,7 +1187,7 @@ static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, this = (struct spa_bt_monitor *) handle; - if (interface_id == SPA_ID_INTERFACE_Monitor) + if (type == SPA_TYPE_INTERFACE_Monitor) *interface = &this->monitor; else return -ENOENT; @@ -1226,9 +1226,9 @@ impl_init(const struct spa_handle_factory *factory, this = (struct spa_bt_monitor *) handle; for (i = 0; i < n_support; i++) { - if (support[i].type == SPA_ID_INTERFACE_Log) + if (support[i].type == SPA_TYPE_INTERFACE_Log) this->log = support[i].data; - else if (support[i].type == SPA_ID_INTERFACE_DBus) + else if (support[i].type == SPA_TYPE_INTERFACE_DBus) this->dbus = support[i].data; } if (this->dbus == NULL) { @@ -1253,7 +1253,7 @@ impl_init(const struct spa_handle_factory *factory, } static const struct spa_interface_info impl_interfaces[] = { - {SPA_ID_INTERFACE_Monitor,}, + {SPA_TYPE_INTERFACE_Monitor,}, }; static int diff --git a/spa/plugins/ffmpeg/ffmpeg-dec.c b/spa/plugins/ffmpeg/ffmpeg-dec.c index b5369be51..46e5c5f29 100644 --- a/spa/plugins/ffmpeg/ffmpeg-dec.c +++ b/spa/plugins/ffmpeg/ffmpeg-dec.c @@ -275,7 +275,7 @@ spa_ffmpeg_dec_node_port_enum_params(struct spa_node *node, SPA_PARAM_Format }; if (*index < SPA_N_ELEMENTS(list)) - param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList, + param = spa_pod_builder_object(&b, SPA_TYPE_OBJECT_ParamList, id, ":", SPA_PARAM_LIST_id, "I", list[*index]); else return 0; @@ -485,7 +485,7 @@ static const struct spa_node ffmpeg_dec_node = { }; static int -spa_ffmpeg_dec_get_interface(struct spa_handle *handle, uint32_t interface_id, void **interface) +spa_ffmpeg_dec_get_interface(struct spa_handle *handle, uint32_t type, void **interface) { struct impl *this; @@ -494,7 +494,7 @@ spa_ffmpeg_dec_get_interface(struct spa_handle *handle, uint32_t interface_id, v this = (struct impl *) handle; - if (interface_id == SPA_ID_INTERFACE_Node) + if (type == SPA_TYPE_INTERFACE_Node) *interface = &this->node; else return -ENOENT; @@ -516,7 +516,7 @@ spa_ffmpeg_dec_init(struct spa_handle *handle, this = (struct impl *) handle; for (i = 0; i < n_support; i++) { - if (support[i].type == SPA_ID_INTERFACE_Log) + if (support[i].type == SPA_TYPE_INTERFACE_Log) this->log = support[i].data; } diff --git a/spa/plugins/ffmpeg/ffmpeg-enc.c b/spa/plugins/ffmpeg/ffmpeg-enc.c index 313c8b9f5..e7954e329 100644 --- a/spa/plugins/ffmpeg/ffmpeg-enc.c +++ b/spa/plugins/ffmpeg/ffmpeg-enc.c @@ -264,7 +264,7 @@ spa_ffmpeg_enc_node_port_enum_params(struct spa_node *node, SPA_PARAM_Format }; if (*index < SPA_N_ELEMENTS(list)) - param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList, + param = spa_pod_builder_object(&b, SPA_TYPE_OBJECT_ParamList, id, ":", SPA_PARAM_LIST_id, "I", list[*index]); else return 0; @@ -462,7 +462,7 @@ static const struct spa_node ffmpeg_enc_node = { }; static int -spa_ffmpeg_enc_get_interface(struct spa_handle *handle, uint32_t interface_id, void **interface) +spa_ffmpeg_enc_get_interface(struct spa_handle *handle, uint32_t type, void **interface) { struct impl *this; @@ -471,7 +471,7 @@ spa_ffmpeg_enc_get_interface(struct spa_handle *handle, uint32_t interface_id, v this = (struct impl *) handle; - if (interface_id == SPA_ID_INTERFACE_Node) + if (type == SPA_TYPE_INTERFACE_Node) *interface = &this->node; else return -ENOENT; @@ -492,7 +492,7 @@ spa_ffmpeg_enc_init(struct spa_handle *handle, this = (struct impl *) handle; for (i = 0; i < n_support; i++) { - if (support[i].type == SPA_ID_INTERFACE_Log) + if (support[i].type == SPA_TYPE_INTERFACE_Log) this->log = support[i].data; } diff --git a/spa/plugins/ffmpeg/ffmpeg.c b/spa/plugins/ffmpeg/ffmpeg.c index 3d8dd6d73..21f481b85 100644 --- a/spa/plugins/ffmpeg/ffmpeg.c +++ b/spa/plugins/ffmpeg/ffmpeg.c @@ -58,7 +58,7 @@ ffmpeg_enc_init(const struct spa_handle_factory *factory, } static const struct spa_interface_info ffmpeg_interfaces[] = { - {SPA_ID_INTERFACE_Node, }, + {SPA_TYPE_INTERFACE_Node, }, }; static int diff --git a/spa/plugins/support/dbus.c b/spa/plugins/support/dbus.c index f272222b6..73d6024dc 100644 --- a/spa/plugins/support/dbus.c +++ b/spa/plugins/support/dbus.c @@ -318,7 +318,7 @@ static const struct spa_dbus impl_dbus = { impl_get_connection, }; -static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, void **interface) +static int impl_get_interface(struct spa_handle *handle, uint32_t type, void **interface) { struct impl *this; @@ -327,7 +327,7 @@ static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, this = (struct impl *) handle; - if (interface_id == SPA_ID_INTERFACE_DBus) + if (type == SPA_TYPE_INTERFACE_DBus) *interface = &this->dbus; else return -ENOENT; @@ -370,9 +370,9 @@ impl_init(const struct spa_handle_factory *factory, this->dbus = impl_dbus; for (i = 0; i < n_support; i++) { - if (support[i].type == SPA_ID_INTERFACE_Log) + if (support[i].type == SPA_TYPE_INTERFACE_Log) this->log = support[i].data; - else if (support[i].type == SPA_ID_INTERFACE_LoopUtils) + else if (support[i].type == SPA_TYPE_INTERFACE_LoopUtils) this->utils = support[i].data; } if (this->utils == NULL) { @@ -386,7 +386,7 @@ impl_init(const struct spa_handle_factory *factory, } static const struct spa_interface_info impl_interfaces[] = { - {SPA_ID_INTERFACE_DBus,}, + {SPA_TYPE_INTERFACE_DBus,}, }; static int diff --git a/spa/plugins/support/logger.c b/spa/plugins/support/logger.c index 43eedc8a5..42712b1dd 100644 --- a/spa/plugins/support/logger.c +++ b/spa/plugins/support/logger.c @@ -149,7 +149,7 @@ static const struct spa_log impl_log = { impl_log_logv, }; -static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, void **interface) +static int impl_get_interface(struct spa_handle *handle, uint32_t type, void **interface) { struct impl *this; @@ -158,7 +158,7 @@ static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, this = (struct impl *) handle; - if (interface_id == SPA_ID_INTERFACE_Log) + if (type == SPA_TYPE_INTERFACE_Log) *interface = &this->log; else return -ENOENT; @@ -212,7 +212,7 @@ impl_init(const struct spa_handle_factory *factory, this->log = impl_log; for (i = 0; i < n_support; i++) { - if (support[i].type == SPA_ID_INTERFACE_MainLoop) + if (support[i].type == SPA_TYPE_INTERFACE_MainLoop) loop = support[i].data; } @@ -237,7 +237,7 @@ impl_init(const struct spa_handle_factory *factory, } static const struct spa_interface_info impl_interfaces[] = { - {SPA_ID_INTERFACE_Log,}, + {SPA_TYPE_INTERFACE_Log,}, }; static int diff --git a/spa/plugins/support/loop.c b/spa/plugins/support/loop.c index bd49410fb..0b1f9bade 100644 --- a/spa/plugins/support/loop.c +++ b/spa/plugins/support/loop.c @@ -652,7 +652,7 @@ static const struct spa_loop_utils impl_loop_utils = { loop_destroy_source, }; -static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, void **interface) +static int impl_get_interface(struct spa_handle *handle, uint32_t type, void **interface) { struct impl *impl; @@ -661,14 +661,14 @@ static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, impl = (struct impl *) handle; - switch (interface_id) { - case SPA_ID_INTERFACE_Loop: + switch (type) { + case SPA_TYPE_INTERFACE_Loop: *interface = &impl->loop; break; - case SPA_ID_INTERFACE_LoopControl: + case SPA_TYPE_INTERFACE_LoopControl: *interface = &impl->control; break; - case SPA_ID_INTERFACE_LoopUtils: + case SPA_TYPE_INTERFACE_LoopUtils: *interface = &impl->utils; break; default: @@ -726,7 +726,7 @@ impl_init(const struct spa_handle_factory *factory, impl->utils = impl_loop_utils; for (i = 0; i < n_support; i++) { - if (support[i].type == SPA_ID_INTERFACE_Log) + if (support[i].type == SPA_TYPE_INTERFACE_Log) impl->log = support[i].data; } @@ -749,9 +749,9 @@ impl_init(const struct spa_handle_factory *factory, } static const struct spa_interface_info impl_interfaces[] = { - {SPA_ID_INTERFACE_Loop,}, - {SPA_ID_INTERFACE_LoopControl,}, - {SPA_ID_INTERFACE_LoopUtils,}, + {SPA_TYPE_INTERFACE_Loop,}, + {SPA_TYPE_INTERFACE_LoopControl,}, + {SPA_TYPE_INTERFACE_LoopUtils,}, }; static int diff --git a/spa/plugins/test/fakesink.c b/spa/plugins/test/fakesink.c index 2f42913da..8377057c7 100644 --- a/spa/plugins/test/fakesink.c +++ b/spa/plugins/test/fakesink.c @@ -116,7 +116,7 @@ static int impl_node_enum_params(struct spa_node *node, return 0; param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamList, + SPA_TYPE_OBJECT_ParamList, id, ":", SPA_PARAM_LIST_id, "I", SPA_PARAM_Props); break; case SPA_PARAM_Props: @@ -124,7 +124,7 @@ static int impl_node_enum_params(struct spa_node *node, return 0; param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_Props, + SPA_TYPE_OBJECT_Props, id, ":", SPA_PROP_live, "b", this->props.live); break; default: @@ -460,7 +460,7 @@ impl_node_port_enum_params(struct spa_node *node, SPA_PARAM_Meta }; if (*index < SPA_N_ELEMENTS(list)) - param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList, + param = spa_pod_builder_object(&b, SPA_TYPE_OBJECT_ParamList, id, ":", SPA_PARAM_LIST_id, "I", list[*index]); else return 0; @@ -479,7 +479,7 @@ impl_node_port_enum_params(struct spa_node *node, return 0; param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamBuffers, + SPA_TYPE_OBJECT_ParamBuffers, id, ":", SPA_PARAM_BUFFERS_buffers, "ir", 2, SPA_POD_PROP_MIN_MAX(1, 32), ":", SPA_PARAM_BUFFERS_blocks, "i", 1, @@ -491,7 +491,7 @@ impl_node_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamMeta, + SPA_TYPE_OBJECT_ParamMeta, id, ":", SPA_PARAM_META_type, "I", SPA_META_Header, ":", SPA_PARAM_META_size, "i", sizeof(struct spa_meta_header)); break; @@ -718,7 +718,7 @@ static const struct spa_node impl_node = { impl_node_process, }; -static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, void **interface) +static int impl_get_interface(struct spa_handle *handle, uint32_t type, void **interface) { struct impl *this; @@ -727,7 +727,7 @@ static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, this = (struct impl *) handle; - if (interface_id == SPA_ID_INTERFACE_Node) + if (type == SPA_TYPE_INTERFACE_Node) *interface = &this->node; else return -ENOENT; @@ -776,9 +776,9 @@ impl_init(const struct spa_handle_factory *factory, this = (struct impl *) handle; for (i = 0; i < n_support; i++) { - if (support[i].type == SPA_ID_INTERFACE_Log) + if (support[i].type == SPA_TYPE_INTERFACE_Log) this->log = support[i].data; - else if (support[i].type == SPA_ID_INTERFACE_DataLoop) + else if (support[i].type == SPA_TYPE_INTERFACE_DataLoop) this->data_loop = support[i].data; } @@ -810,7 +810,7 @@ impl_init(const struct spa_handle_factory *factory, } static const struct spa_interface_info impl_interfaces[] = { - {SPA_ID_INTERFACE_Node,}, + {SPA_TYPE_INTERFACE_Node,}, }; static int diff --git a/spa/plugins/test/fakesrc.c b/spa/plugins/test/fakesrc.c index 497e3db07..73fc00217 100644 --- a/spa/plugins/test/fakesrc.c +++ b/spa/plugins/test/fakesrc.c @@ -121,7 +121,7 @@ static int impl_node_enum_params(struct spa_node *node, return 0; param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamList, + SPA_TYPE_OBJECT_ParamList, id, ":", SPA_PARAM_LIST_id, "I", SPA_PARAM_Props); break; @@ -133,7 +133,7 @@ static int impl_node_enum_params(struct spa_node *node, return 0; param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_Props, + SPA_TYPE_OBJECT_Props, id, ":", SPA_PROP_live, "b", p->live, ":", SPA_PROP_patternType, "Ie", p->pattern, SPA_POD_PROP_ENUM(1, p->pattern)); @@ -476,7 +476,7 @@ impl_node_port_enum_params(struct spa_node *node, SPA_PARAM_Meta }; if (*index < SPA_N_ELEMENTS(list)) - param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList, + param = spa_pod_builder_object(&b, SPA_TYPE_OBJECT_ParamList, id, ":", SPA_PARAM_LIST_id, "I", list[*index]); else return 0; @@ -495,7 +495,7 @@ impl_node_port_enum_params(struct spa_node *node, return 0; param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamBuffers, + SPA_TYPE_OBJECT_ParamBuffers, id, ":", SPA_PARAM_BUFFERS_buffers, "ir", 32, SPA_POD_PROP_MIN_MAX(2, 32), ":", SPA_PARAM_BUFFERS_blocks, "i", 1, @@ -507,7 +507,7 @@ impl_node_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamMeta, + SPA_TYPE_OBJECT_ParamMeta, id, ":", SPA_PARAM_META_type, "I", SPA_META_Header, ":", SPA_PARAM_META_size, "i", sizeof(struct spa_meta_header)); break; @@ -754,7 +754,7 @@ static const struct spa_node impl_node = { impl_node_process, }; -static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, void **interface) +static int impl_get_interface(struct spa_handle *handle, uint32_t type, void **interface) { struct impl *this; @@ -763,7 +763,7 @@ static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, this = (struct impl *) handle; - if (interface_id == SPA_ID_INTERFACE_Node) + if (type == SPA_TYPE_INTERFACE_Node) *interface = &this->node; else return -ENOENT; @@ -812,9 +812,9 @@ impl_init(const struct spa_handle_factory *factory, this = (struct impl *) handle; for (i = 0; i < n_support; i++) { - if (support[i].type == SPA_ID_INTERFACE_Log) + if (support[i].type == SPA_TYPE_INTERFACE_Log) this->log = support[i].data; - else if (support[i].type == SPA_ID_INTERFACE_DataLoop) + else if (support[i].type == SPA_TYPE_INTERFACE_DataLoop) this->data_loop = support[i].data; } @@ -846,7 +846,7 @@ impl_init(const struct spa_handle_factory *factory, } static const struct spa_interface_info impl_interfaces[] = { - {SPA_ID_INTERFACE_Node,}, + {SPA_TYPE_INTERFACE_Node,}, }; static int diff --git a/spa/plugins/v4l2/v4l2-monitor.c b/spa/plugins/v4l2/v4l2-monitor.c index 164212a7b..3d38a4cd3 100644 --- a/spa/plugins/v4l2/v4l2-monitor.c +++ b/spa/plugins/v4l2/v4l2-monitor.c @@ -98,13 +98,13 @@ static void fill_item(struct impl *this, struct item *item, struct udev_device * name = "Unknown"; spa_pod_builder_add(builder, - "<", 0, SPA_ID_OBJECT_MonitorItem, + "<", SPA_TYPE_OBJECT_MonitorItem, 0, ":", SPA_MONITOR_ITEM_id, "s", udev_device_get_syspath(item->udevice), ":", SPA_MONITOR_ITEM_flags, "I", SPA_MONITOR_ITEM_FLAG_NONE, ":", SPA_MONITOR_ITEM_state, "I", SPA_MONITOR_ITEM_STATE_AVAILABLE, ":", SPA_MONITOR_ITEM_name, "s", name, ":", SPA_MONITOR_ITEM_class, "s", "Video/Source", - ":", SPA_MONITOR_ITEM_factory, "p", SPA_ID_INTERFACE_HandleFactory, &spa_v4l2_source_factory, + ":", SPA_MONITOR_ITEM_factory, "p", SPA_TYPE_INTERFACE_HandleFactory, &spa_v4l2_source_factory, ":", SPA_MONITOR_ITEM_info, "[", NULL); @@ -165,7 +165,7 @@ static void impl_on_fd_events(struct spa_source *source) struct udev_device *dev; struct spa_event *event; const char *action; - uint32_t type; + uint32_t id; struct spa_pod_builder b = { NULL, }; uint8_t buffer[4096]; struct spa_pod *item; @@ -178,16 +178,16 @@ static void impl_on_fd_events(struct spa_source *source) action = "change"; if (strcmp(action, "add") == 0) { - type = SPA_MONITOR_EVENT_Added; + id = SPA_MONITOR_EVENT_Added; } else if (strcmp(action, "change") == 0) { - type = SPA_MONITOR_EVENT_Changed; + id = SPA_MONITOR_EVENT_Changed; } else if (strcmp(action, "remove") == 0) { - type = SPA_MONITOR_EVENT_Removed; + id = SPA_MONITOR_EVENT_Removed; } else return; spa_pod_builder_init(&b, buffer, sizeof(buffer)); - event = spa_pod_builder_object(&b, type, SPA_ID_EVENT_Monitor); + event = spa_pod_builder_object(&b, SPA_TYPE_EVENT_Monitor, id); fill_item(this, &this->uitem, dev, &item, &b); this->callbacks->event(this->callbacks_data, event); @@ -291,7 +291,7 @@ static const struct spa_monitor impl_monitor = { impl_monitor_enum_items, }; -static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, void **interface) +static int impl_get_interface(struct spa_handle *handle, uint32_t type, void **interface) { struct impl *this; @@ -300,7 +300,7 @@ static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, this = (struct impl *) handle; - if (interface_id == SPA_ID_INTERFACE_Monitor) + if (type == SPA_TYPE_INTERFACE_Monitor) *interface = &this->monitor; else return -ENOENT; @@ -350,9 +350,9 @@ impl_init(const struct spa_handle_factory *factory, this = (struct impl *) handle; for (i = 0; i < n_support; i++) { - if (support[i].type == SPA_ID_INTERFACE_Log) + if (support[i].type == SPA_TYPE_INTERFACE_Log) this->log = support[i].data; - else if (support[i].type == SPA_ID_INTERFACE_MainLoop) + else if (support[i].type == SPA_TYPE_INTERFACE_MainLoop) this->main_loop = support[i].data; } if (this->main_loop == NULL) { @@ -366,7 +366,7 @@ impl_init(const struct spa_handle_factory *factory, } static const struct spa_interface_info impl_interfaces[] = { - {SPA_ID_INTERFACE_Monitor,}, + {SPA_TYPE_INTERFACE_Monitor,}, }; static int diff --git a/spa/plugins/v4l2/v4l2-source.c b/spa/plugins/v4l2/v4l2-source.c index 25694ce25..527ff078c 100644 --- a/spa/plugins/v4l2/v4l2-source.c +++ b/spa/plugins/v4l2/v4l2-source.c @@ -162,7 +162,7 @@ static int impl_node_enum_params(struct spa_node *node, SPA_PARAM_Props }; if (*index < SPA_N_ELEMENTS(list)) - param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList, + param = spa_pod_builder_object(&b, SPA_TYPE_OBJECT_ParamList, id, ":", SPA_PARAM_LIST_id, "I", list[*index]); else return 0; @@ -175,21 +175,21 @@ static int impl_node_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_PropInfo, + SPA_TYPE_OBJECT_PropInfo, id, ":", SPA_PROP_INFO_id, "I", SPA_PROP_device, ":", SPA_PROP_INFO_name, "s", "The V4L2 device", ":", SPA_PROP_INFO_type, "S", p->device, sizeof(p->device)); break; case 1: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_PropInfo, + SPA_TYPE_OBJECT_PropInfo, id, ":", SPA_PROP_INFO_id, "I", SPA_PROP_deviceName, ":", SPA_PROP_INFO_name, "s", "The V4L2 device name", ":", SPA_PROP_INFO_type, "S-r", p->device_name, sizeof(p->device_name)); break; case 2: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_PropInfo, + SPA_TYPE_OBJECT_PropInfo, id, ":", SPA_PROP_INFO_id, "I", SPA_PROP_deviceFd, ":", SPA_PROP_INFO_name, "s", "The V4L2 fd", ":", SPA_PROP_INFO_type, "i-r", p->device_fd); @@ -206,7 +206,7 @@ static int impl_node_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_Props, + SPA_TYPE_OBJECT_Props, id, ":", SPA_PROP_device, "S", p->device, sizeof(p->device), ":", SPA_PROP_deviceName, "S-r", p->device_name, sizeof(p->device_name), ":", SPA_PROP_deviceFd, "i-r", p->device_fd); @@ -392,7 +392,7 @@ static int port_get_format(struct spa_node *node, if (*index > 0) return 0; - spa_pod_builder_push_object(builder, SPA_PARAM_Format, SPA_ID_OBJECT_Format); + spa_pod_builder_push_object(builder, SPA_TYPE_OBJECT_Format, SPA_PARAM_Format); spa_pod_builder_add(builder, "I", port->current_format.media_type, @@ -465,7 +465,7 @@ static int impl_node_port_enum_params(struct spa_node *node, SPA_PARAM_IO }; if (*index < SPA_N_ELEMENTS(list)) - param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList, + param = spa_pod_builder_object(&b, SPA_TYPE_OBJECT_ParamList, id, ":", SPA_PARAM_LIST_id, "I", list[*index]); else return 0; @@ -488,7 +488,7 @@ static int impl_node_port_enum_params(struct spa_node *node, return 0; param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamBuffers, + SPA_TYPE_OBJECT_ParamBuffers, id, ":", SPA_PARAM_BUFFERS_buffers, "iru", MAX_BUFFERS, SPA_POD_PROP_MIN_MAX(2, MAX_BUFFERS), ":", SPA_PARAM_BUFFERS_blocks, "i", 1, @@ -501,7 +501,7 @@ static int impl_node_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamMeta, + SPA_TYPE_OBJECT_ParamMeta, id, ":", SPA_PARAM_META_type, "I", SPA_META_Header, ":", SPA_PARAM_META_size, "i", sizeof(struct spa_meta_header)); break; @@ -518,13 +518,13 @@ static int impl_node_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamIO, + SPA_TYPE_OBJECT_ParamIO, id, ":", SPA_PARAM_IO_id, "I", SPA_IO_Buffers, ":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_buffers)); break; case 1: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamIO, + SPA_TYPE_OBJECT_ParamIO, id, ":", SPA_PARAM_IO_id, "I", SPA_IO_Clock, ":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_clock)); break; @@ -872,7 +872,7 @@ static const struct spa_node impl_node = { impl_node_process, }; -static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, void **interface) +static int impl_get_interface(struct spa_handle *handle, uint32_t type, void **interface) { struct impl *this; @@ -881,7 +881,7 @@ static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, this = (struct impl *) handle; - if (interface_id == SPA_ID_INTERFACE_Node) + if (type == SPA_TYPE_INTERFACE_Node) *interface = &this->node; else return -ENOENT; @@ -923,11 +923,11 @@ impl_init(const struct spa_handle_factory *factory, port = GET_OUT_PORT(this, 0); for (i = 0; i < n_support; i++) { - if (support[i].type == SPA_ID_INTERFACE_Log) + if (support[i].type == SPA_TYPE_INTERFACE_Log) this->log = support[i].data; - else if (support[i].type == SPA_ID_INTERFACE_MainLoop) + else if (support[i].type == SPA_TYPE_INTERFACE_MainLoop) port->main_loop = support[i].data; - else if (support[i].type == SPA_ID_INTERFACE_DataLoop) + else if (support[i].type == SPA_TYPE_INTERFACE_DataLoop) port->data_loop = support[i].data; } if (port->main_loop == NULL) { @@ -963,7 +963,7 @@ impl_init(const struct spa_handle_factory *factory, } static const struct spa_interface_info impl_interfaces[] = { - {SPA_ID_INTERFACE_Node,}, + {SPA_TYPE_INTERFACE_Node,}, }; static int impl_enum_interface_info(const struct spa_handle_factory *factory, diff --git a/spa/plugins/v4l2/v4l2-utils.c b/spa/plugins/v4l2/v4l2-utils.c index 3cb0db403..acc283b9f 100644 --- a/spa/plugins/v4l2/v4l2-utils.c +++ b/spa/plugins/v4l2/v4l2-utils.c @@ -409,7 +409,7 @@ enum_filter_format(uint32_t media_type, int32_t media_subtype, if (!(p = spa_pod_find_prop(filter, SPA_FORMAT_VIDEO_format))) return SPA_VIDEO_FORMAT_UNKNOWN; - if (p->body.value.type != SPA_ID_Enum) + if (p->body.value.type != SPA_TYPE_Enum) return SPA_VIDEO_FORMAT_UNKNOWN; values = SPA_POD_BODY_CONST(&p->body.value); @@ -596,7 +596,7 @@ spa_v4l2_enum_format(struct impl *this, if (!(p = spa_pod_find_prop(filter, SPA_FORMAT_VIDEO_size))) goto do_frmsize; - if (p->body.value.type != SPA_ID_Rectangle) { + if (p->body.value.type != SPA_TYPE_Rectangle) { goto enum_end; } @@ -675,7 +675,7 @@ spa_v4l2_enum_format(struct impl *this, } } - spa_pod_builder_push_object(builder, SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format); + spa_pod_builder_push_object(builder, SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat); spa_pod_builder_add(builder, "I", info->media_type, "I", info->media_subtype, 0); @@ -717,7 +717,7 @@ spa_v4l2_enum_format(struct impl *this, if (!(p = spa_pod_find_prop(filter, SPA_FORMAT_VIDEO_framerate))) goto have_framerate; - if (p->body.value.type != SPA_ID_Fraction) + if (p->body.value.type != SPA_TYPE_Fraction) goto enum_end; range = p->body.flags & SPA_POD_PROP_RANGE_MASK; @@ -1052,7 +1052,7 @@ spa_v4l2_enum_controls(struct impl *this, switch (queryctrl.type) { case V4L2_CTRL_TYPE_INTEGER: param = spa_pod_builder_object(&b, - SPA_PARAM_PropInfo, SPA_ID_OBJECT_PropInfo, + SPA_TYPE_OBJECT_PropInfo, SPA_PARAM_PropInfo, ":", SPA_PROP_INFO_id, "I", prop_id, ":", SPA_PROP_INFO_type, "isu", queryctrl.default_value, SPA_POD_PROP_STEP(queryctrl.minimum, @@ -1062,7 +1062,7 @@ spa_v4l2_enum_controls(struct impl *this, break; case V4L2_CTRL_TYPE_BOOLEAN: param = spa_pod_builder_object(&b, - SPA_PARAM_PropInfo, SPA_ID_OBJECT_PropInfo, + SPA_TYPE_OBJECT_PropInfo, SPA_PARAM_PropInfo, ":", SPA_PROP_INFO_id, "I", prop_id, ":", SPA_PROP_INFO_type, "b-u", queryctrl.default_value, ":", SPA_PROP_INFO_name, "s", queryctrl.name); @@ -1071,7 +1071,7 @@ spa_v4l2_enum_controls(struct impl *this, { struct v4l2_querymenu querymenu; - spa_pod_builder_push_object(&b, SPA_PARAM_PropInfo, SPA_ID_OBJECT_PropInfo); + spa_pod_builder_push_object(&b, SPA_TYPE_OBJECT_PropInfo, SPA_PARAM_PropInfo); spa_pod_builder_add(&b, ":", SPA_PROP_INFO_id, "I", prop_id, ":", SPA_PROP_INFO_type, "i-u", queryctrl.default_value, diff --git a/spa/plugins/videotestsrc/videotestsrc.c b/spa/plugins/videotestsrc/videotestsrc.c index 3e1c58822..961fbe62b 100644 --- a/spa/plugins/videotestsrc/videotestsrc.c +++ b/spa/plugins/videotestsrc/videotestsrc.c @@ -131,7 +131,7 @@ static int impl_node_enum_params(struct spa_node *node, SPA_PARAM_Props }; if (*index < SPA_N_ELEMENTS(list)) - param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList, + param = spa_pod_builder_object(&b, SPA_TYPE_OBJECT_ParamList, id, ":", SPA_PARAM_LIST_id, "I", list[*index]); else return 0; @@ -144,14 +144,14 @@ static int impl_node_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_PropInfo, + SPA_TYPE_OBJECT_PropInfo, id, ":", SPA_PROP_INFO_id, "I", SPA_PROP_live, ":", SPA_PROP_INFO_name, "s", "Configure live mode of the source", ":", SPA_PROP_INFO_type, "b", p->live); break; case 1: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_PropInfo, + SPA_TYPE_OBJECT_PropInfo, id, ":", SPA_PROP_INFO_id, "I", SPA_PROP_patternType, ":", SPA_PROP_INFO_name, "s", "The pattern", ":", SPA_PROP_INFO_type, "i", p->pattern, @@ -171,7 +171,7 @@ static int impl_node_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_Props, + SPA_TYPE_OBJECT_Props, id, ":", SPA_PROP_live, "b", p->live, ":", SPA_PROP_patternType, "i", p->pattern); break; @@ -463,7 +463,7 @@ static int port_enum_formats(struct spa_node *node, switch (*index) { case 0: *param = spa_pod_builder_object(builder, - SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat, "I", SPA_MEDIA_TYPE_video, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_VIDEO_format, "Ieu", SPA_VIDEO_FORMAT_RGB, @@ -497,7 +497,7 @@ static int port_get_format(struct spa_node *node, return 0; *param = spa_pod_builder_object(builder, - SPA_PARAM_Format, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_Format, "I", SPA_MEDIA_TYPE_video, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_VIDEO_format, "I", this->current_format.info.raw.format, @@ -541,7 +541,7 @@ impl_node_port_enum_params(struct spa_node *node, SPA_PARAM_Meta }; if (*index < SPA_N_ELEMENTS(list)) - param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList, + param = spa_pod_builder_object(&b, SPA_TYPE_OBJECT_ParamList, id, ":", SPA_PARAM_LIST_id, "I", list[*index]); else return 0; @@ -567,7 +567,7 @@ impl_node_port_enum_params(struct spa_node *node, return 0; param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamBuffers, + SPA_TYPE_OBJECT_ParamBuffers, id, ":", SPA_PARAM_BUFFERS_buffers, "ir", 2, SPA_POD_PROP_MIN_MAX(1, MAX_BUFFERS), ":", SPA_PARAM_BUFFERS_blocks, "i", 1, @@ -583,7 +583,7 @@ impl_node_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamMeta, + SPA_TYPE_OBJECT_ParamMeta, id, ":", SPA_PARAM_META_type, "I", SPA_META_Header, ":", SPA_PARAM_META_size, "i", sizeof(struct spa_meta_header)); break; @@ -861,7 +861,7 @@ static const struct spa_node impl_node = { impl_node_process, }; -static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, void **interface) +static int impl_get_interface(struct spa_handle *handle, uint32_t type, void **interface) { struct impl *this; @@ -870,7 +870,7 @@ static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, this = (struct impl *) handle; - if (interface_id == SPA_ID_INTERFACE_Node) + if (type == SPA_TYPE_INTERFACE_Node) *interface = &this->node; else return -ENOENT; @@ -919,9 +919,9 @@ impl_init(const struct spa_handle_factory *factory, this = (struct impl *) handle; for (i = 0; i < n_support; i++) { - if (support[i].type == SPA_ID_INTERFACE_Log) + if (support[i].type == SPA_TYPE_INTERFACE_Log) this->log = support[i].data; - else if (support[i].type == SPA_ID_INTERFACE_DataLoop) + else if (support[i].type == SPA_TYPE_INTERFACE_DataLoop) this->data_loop = support[i].data; } @@ -953,7 +953,7 @@ impl_init(const struct spa_handle_factory *factory, } static const struct spa_interface_info impl_interfaces[] = { - {SPA_ID_INTERFACE_Node,}, + {SPA_TYPE_INTERFACE_Node,}, }; static int diff --git a/spa/plugins/volume/volume.c b/spa/plugins/volume/volume.c index 6d037ad45..08f883ea4 100644 --- a/spa/plugins/volume/volume.c +++ b/spa/plugins/volume/volume.c @@ -125,7 +125,7 @@ static int impl_node_enum_params(struct spa_node *node, SPA_PARAM_Props }; if (*index < SPA_N_ELEMENTS(list)) - param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList, + param = spa_pod_builder_object(&b, SPA_TYPE_OBJECT_ParamList, id, ":", SPA_PARAM_LIST_id, "I", list[*index]); else return 0; @@ -135,7 +135,7 @@ static int impl_node_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_PropInfo, + SPA_TYPE_OBJECT_PropInfo, id, ":", SPA_PROP_INFO_id, "I", SPA_PROP_volume, ":", SPA_PROP_INFO_name, "s", "The volume", ":", SPA_PROP_INFO_type, "dr", p->volume, @@ -143,7 +143,7 @@ static int impl_node_enum_params(struct spa_node *node, break; case 1: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_PropInfo, + SPA_TYPE_OBJECT_PropInfo, id, ":", SPA_PROP_INFO_id, "I", SPA_PROP_mute, ":", SPA_PROP_INFO_name, "s", "Mute", ":", SPA_PROP_INFO_type, "b", p->mute); @@ -156,7 +156,7 @@ static int impl_node_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_Props, + SPA_TYPE_OBJECT_Props, id, ":", SPA_PROP_volume, "d", p->volume, ":", SPA_PROP_mute, "b", p->mute); break; @@ -327,7 +327,7 @@ static int port_enum_formats(struct spa_node *node, switch (*index) { case 0: *param = spa_pod_builder_object(builder, - SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "Ieu", SPA_AUDIO_FORMAT_S16, @@ -362,7 +362,7 @@ static int port_get_format(struct spa_node *node, return 0; *param = spa_pod_builder_object(builder, - SPA_PARAM_Format, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_Format, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", this->current_format.info.raw.format, @@ -410,7 +410,7 @@ impl_node_port_enum_params(struct spa_node *node, SPA_PARAM_IO }; if (*index < SPA_N_ELEMENTS(list)) - param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList, + param = spa_pod_builder_object(&b, SPA_TYPE_OBJECT_ParamList, id, ":", SPA_PARAM_LIST_id, "I", list[*index]); else return 0; @@ -431,7 +431,7 @@ impl_node_port_enum_params(struct spa_node *node, return 0; param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamBuffers, + SPA_TYPE_OBJECT_ParamBuffers, id, ":", SPA_PARAM_BUFFERS_buffers, "iru", 2, SPA_POD_PROP_MIN_MAX(1, MAX_BUFFERS), ":", SPA_PARAM_BUFFERS_blocks, "i", 1, @@ -444,7 +444,7 @@ impl_node_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamMeta, + SPA_TYPE_OBJECT_ParamMeta, id, ":", SPA_PARAM_META_type, "I", SPA_META_Header, ":", SPA_PARAM_META_size, "i", sizeof(struct spa_meta_header)); break; @@ -456,13 +456,13 @@ impl_node_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamIO, + SPA_TYPE_OBJECT_ParamIO, id, ":", SPA_PARAM_IO_id, "I", SPA_IO_Buffers, ":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_buffers)); break; case 1: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamIO, + SPA_TYPE_OBJECT_ParamIO, id, ":", SPA_PARAM_IO_id, "I", SPA_IO_ControlRange, ":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_control_range)); break; @@ -819,7 +819,7 @@ static const struct spa_node impl_node = { impl_node_process, }; -static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, void **interface) +static int impl_get_interface(struct spa_handle *handle, uint32_t type, void **interface) { struct impl *this; @@ -828,7 +828,7 @@ static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, this = (struct impl *) handle; - if (interface_id == SPA_ID_INTERFACE_Node) + if (type == SPA_TYPE_INTERFACE_Node) *interface = &this->node; else return -ENOENT; @@ -867,7 +867,7 @@ impl_init(const struct spa_handle_factory *factory, this = (struct impl *) handle; for (i = 0; i < n_support; i++) { - if (support[i].type == SPA_ID_INTERFACE_Log) + if (support[i].type == SPA_TYPE_INTERFACE_Log) this->log = support[i].data; } @@ -886,7 +886,7 @@ impl_init(const struct spa_handle_factory *factory, } static const struct spa_interface_info impl_interfaces[] = { - {SPA_ID_INTERFACE_Node,}, + {SPA_TYPE_INTERFACE_Node,}, }; static int diff --git a/spa/tests/test-bluez5.c b/spa/tests/test-bluez5.c index 1cb1a751c..80f73da79 100644 --- a/spa/tests/test-bluez5.c +++ b/spa/tests/test-bluez5.c @@ -178,12 +178,12 @@ int main(int argc, char *argv[]) } if ((res = spa_handle_get_interface(handle, - SPA_ID_INTERFACE_Log, + SPA_TYPE_INTERFACE_Log, &iface)) < 0) error(-1, res, "can't get log interface"); data.log = iface; - data.support[0] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_Log, data.log); + data.support[0] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_Log, data.log); data.n_support = 1; if ((str = getenv("SPA_DEBUG"))) @@ -195,27 +195,27 @@ int main(int argc, char *argv[]) error(-1, res, "can't create loop"); } if ((res = spa_handle_get_interface(handle, - SPA_ID_INTERFACE_Loop, + SPA_TYPE_INTERFACE_Loop, &iface)) < 0) error(-1, res, "can't get loop interface"); data.loop = iface; if ((res = spa_handle_get_interface(handle, - SPA_ID_INTERFACE_LoopControl, + SPA_TYPE_INTERFACE_LoopControl, &iface)) < 0) error(-1, res, "can't get loopcontrol interface"); data.loop_control = iface; if ((res = spa_handle_get_interface(handle, - SPA_ID_INTERFACE_LoopUtils, + SPA_TYPE_INTERFACE_LoopUtils, &iface)) < 0) error(-1, res, "can't get looputils interface"); data.loop_utils = iface; - data.support[1] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_DataLoop, data.loop); - data.support[2] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_MainLoop, data.loop); - data.support[3] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_LoopControl, data.loop_control); - data.support[4] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_LoopUtils, data.loop_utils); + data.support[1] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_DataLoop, data.loop); + data.support[2] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_MainLoop, data.loop); + data.support[3] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_LoopControl, data.loop_control); + data.support[4] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_LoopUtils, data.loop_utils); data.n_support = 5; if ((res = get_handle(&data, &handle, @@ -225,12 +225,12 @@ int main(int argc, char *argv[]) } if ((res = spa_handle_get_interface(handle, - SPA_ID_INTERFACE_DBus, + SPA_TYPE_INTERFACE_DBus, &iface)) < 0) error(-1, res, "can't get dbus interface"); data.dbus = iface; - data.support[5] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_DBus, data.dbus); + data.support[5] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_DBus, data.dbus); data.n_support = 6; if ((res = get_handle(&data, &handle, @@ -240,7 +240,7 @@ int main(int argc, char *argv[]) } if ((res = spa_handle_get_interface(handle, - SPA_ID_INTERFACE_Monitor, + SPA_TYPE_INTERFACE_Monitor, &iface)) < 0) error(-1, res, "can't get monitor interface"); diff --git a/spa/tests/test-control.c b/spa/tests/test-control.c index 1c7d1706f..cd6e5a732 100644 --- a/spa/tests/test-control.c +++ b/spa/tests/test-control.c @@ -172,7 +172,7 @@ static int make_node(struct data *data, struct spa_node **node, const char *lib, printf("can't make factory instance: %d\n", res); return res; } - if ((res = spa_handle_get_interface(handle, SPA_ID_INTERFACE_Node, &iface)) < 0) { + if ((res = spa_handle_get_interface(handle, SPA_TYPE_INTERFACE_Node, &iface)) < 0) { printf("can't get interface %d\n", res); return res; } @@ -274,7 +274,7 @@ static int make_nodes(struct data *data, const char *device) spa_pod_builder_init(&b, buffer, sizeof(buffer)); props = spa_pod_builder_object(&b, - 0, SPA_ID_OBJECT_Props, + SPA_TYPE_OBJECT_Props, 0, ":", SPA_PROP_device, "s", device ? device : "hw:0", ":", SPA_PROP_minLatency, "i", MIN_LATENCY); @@ -292,7 +292,7 @@ static int make_nodes(struct data *data, const char *device) spa_pod_builder_init(&b, buffer, sizeof(buffer)); props = spa_pod_builder_object(&b, - 0, SPA_ID_OBJECT_Props, + SPA_TYPE_OBJECT_Props, 0, ":", SPA_PROP_frequency, "d", 600.0, ":", SPA_PROP_volume, "d", 0.5, ":", SPA_PROP_live, "b", false); @@ -377,7 +377,7 @@ static int negotiate_formats(struct data *data) spa_pod_builder_init(&b, buffer, sizeof(buffer)); filter = spa_pod_builder_object(&b, - 0, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, 0, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_S16, @@ -530,9 +530,9 @@ int main(int argc, char *argv[]) if ((str = getenv("SPA_DEBUG"))) data.log->level = atoi(str); - data.support[0] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_Log, data.log); - data.support[1] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_MainLoop, &data.data_loop); - data.support[2] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_DataLoop, &data.data_loop); + data.support[0] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_Log, data.log); + data.support[1] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_MainLoop, &data.data_loop); + data.support[2] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_DataLoop, &data.data_loop); data.n_support = 3; if ((res = make_nodes(&data, argc > 1 ? argv[1] : NULL)) < 0) { diff --git a/spa/tests/test-convert.c b/spa/tests/test-convert.c index 89eb4e162..25ceb262e 100644 --- a/spa/tests/test-convert.c +++ b/spa/tests/test-convert.c @@ -143,7 +143,7 @@ static int make_node(struct data *data, struct spa_node **node, const char *lib, printf("can't make factory instance: %d\n", res); return res; } - if ((res = spa_handle_get_interface(handle, SPA_ID_INTERFACE_Node, &iface)) < 0) { + if ((res = spa_handle_get_interface(handle, SPA_TYPE_INTERFACE_Node, &iface)) < 0) { printf("can't get interface %d\n", res); return res; } @@ -207,7 +207,7 @@ static int negotiate_formats(struct data *data) spa_pod_builder_init(&b, buffer, sizeof(buffer)); format = spa_pod_builder_object(&b, - 0, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, 0, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_S16, @@ -236,7 +236,7 @@ static int negotiate_formats(struct data *data) spa_pod_builder_init(&b, buffer, sizeof(buffer)); format = spa_pod_builder_object(&b, - 0, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, 0, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_F32, @@ -353,7 +353,7 @@ int main(int argc, char *argv[]) if ((str = getenv("SPA_DEBUG"))) data.log->level = atoi(str); - data.support[0] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_Log, data.log); + data.support[0] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_Log, data.log); data.n_support = 1; if ((res = make_nodes(&data, argc > 1 ? argv[1] : NULL)) < 0) { diff --git a/spa/tests/test-convert2.c b/spa/tests/test-convert2.c index eb91cf30a..24ff636b8 100644 --- a/spa/tests/test-convert2.c +++ b/spa/tests/test-convert2.c @@ -111,7 +111,7 @@ static int make_node(struct data *data, struct spa_node **node, const char *lib, printf("can't make factory instance: %d\n", res); return res; } - if ((res = spa_handle_get_interface(handle, SPA_ID_INTERFACE_Node, &iface)) < 0) { + if ((res = spa_handle_get_interface(handle, SPA_TYPE_INTERFACE_Node, &iface)) < 0) { printf("can't get interface %d\n", res); return res; } @@ -258,7 +258,7 @@ static int negotiate_formats(struct data *data) spa_pod_builder_init(&b, buffer, sizeof(buffer)); format = spa_pod_builder_object(&b, - 0, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, 0, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_S16, @@ -271,7 +271,7 @@ static int negotiate_formats(struct data *data) spa_pod_builder_init(&b, buffer, sizeof(buffer)); format = spa_pod_builder_object(&b, - 0, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, 0, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_F32, @@ -486,7 +486,7 @@ int main(int argc, char *argv[]) if ((str = getenv("SPA_DEBUG"))) data.log->level = atoi(str); - data.support[0] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_Log, data.log); + data.support[0] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_Log, data.log); data.n_support = 1; if ((res = make_nodes(&data, argc > 1 ? argv[1] : NULL)) < 0) { diff --git a/spa/tests/test-graph.c b/spa/tests/test-graph.c index 0cd444e47..d89e12de8 100644 --- a/spa/tests/test-graph.c +++ b/spa/tests/test-graph.c @@ -173,7 +173,7 @@ static int make_node(struct data *data, struct spa_node **node, const char *lib, printf("can't make factory instance: %d\n", res); return res; } - if ((res = spa_handle_get_interface(handle, SPA_ID_INTERFACE_Node, &iface)) < 0) { + if ((res = spa_handle_get_interface(handle, SPA_TYPE_INTERFACE_Node, &iface)) < 0) { printf("can't get interface %d\n", res); return res; } @@ -257,7 +257,7 @@ static int make_nodes(struct data *data, const char *device) spa_pod_builder_init(&b, buffer, sizeof(buffer)); props = spa_pod_builder_object(&b, - 0, SPA_ID_OBJECT_Props, + SPA_TYPE_OBJECT_Props, 0, ":", SPA_PROP_device, "s", device ? device : "hw:0", ":", SPA_PROP_minLatency, "i", MIN_LATENCY); @@ -281,7 +281,7 @@ static int make_nodes(struct data *data, const char *device) spa_pod_builder_init(&b, buffer, sizeof(buffer)); props = spa_pod_builder_object(&b, - 0, SPA_ID_OBJECT_Props, + SPA_TYPE_OBJECT_Props, 0, ":", SPA_PROP_frequency, "d", 600.0, ":", SPA_PROP_volume, "d", 0.5, ":", SPA_PROP_live, "b", false); @@ -347,7 +347,7 @@ static int negotiate_formats(struct data *data) spa_pod_builder_init(&b, buffer, sizeof(buffer)); filter = spa_pod_builder_object(&b, - 0, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, 0, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_S16, @@ -524,9 +524,9 @@ int main(int argc, char *argv[]) if ((str = getenv("SPA_DEBUG"))) data.log->level = atoi(str); - data.support[0] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_Log, data.log); - data.support[1] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_MainLoop, &data.data_loop); - data.support[2] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_DataLoop, &data.data_loop); + data.support[0] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_Log, data.log); + data.support[1] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_MainLoop, &data.data_loop); + data.support[2] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_DataLoop, &data.data_loop); data.n_support = 3; if ((res = make_nodes(&data, argc > 1 ? argv[1] : NULL)) < 0) { diff --git a/spa/tests/test-mixer.c b/spa/tests/test-mixer.c index eca1c1c20..d2dc53a5c 100644 --- a/spa/tests/test-mixer.c +++ b/spa/tests/test-mixer.c @@ -189,7 +189,7 @@ static int make_node(struct data *data, struct spa_node **node, const char *lib, printf("can't make factory instance: %d\n", res); return res; } - if ((res = spa_handle_get_interface(handle, SPA_ID_INTERFACE_Node, &iface)) < 0) { + if ((res = spa_handle_get_interface(handle, SPA_TYPE_INTERFACE_Node, &iface)) < 0) { printf("can't get interface %d\n", res); return res; } @@ -319,7 +319,7 @@ static int make_nodes(struct data *data, const char *device) spa_pod_builder_init(&b, buffer, sizeof(buffer)); props = spa_pod_builder_object(&b, - 0, SPA_ID_OBJECT_Props, + SPA_TYPE_OBJECT_Props, 0, ":", SPA_PROP_device, "s", device ? device : "hw:0", ":", SPA_PROP_minLatency, "i", MIN_LATENCY); @@ -342,7 +342,7 @@ static int make_nodes(struct data *data, const char *device) spa_pod_builder_init(&b, buffer, sizeof(buffer)); props = spa_pod_builder_object(&b, - SPA_PARAM_Props, SPA_ID_OBJECT_Props, + SPA_TYPE_OBJECT_Props, SPA_PARAM_Props, ":", SPA_PROP_frequency, "d", 600.0, ":", SPA_PROP_volume, "d", 1.0, ":", SPA_PROP_live, "b", false); @@ -359,7 +359,7 @@ static int make_nodes(struct data *data, const char *device) spa_pod_builder_init(&b, buffer, sizeof(buffer)); props = spa_pod_builder_object(&b, - SPA_PARAM_Props, SPA_ID_OBJECT_Props, + SPA_TYPE_OBJECT_Props, SPA_PARAM_Props, ":", SPA_PROP_frequency, "d", 440.0, ":", SPA_PROP_volume, "d", 1.0, ":", SPA_PROP_live, "b", false); @@ -473,7 +473,7 @@ static int negotiate_formats(struct data *data) spa_pod_builder_init(&b, buffer, sizeof(buffer)); filter = spa_pod_builder_object(&b, - 0, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, 0, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_S16, @@ -675,9 +675,9 @@ int main(int argc, char *argv[]) if ((str = getenv("SPA_DEBUG"))) data.log->level = atoi(str); - data.support[0] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_Log, data.log); - data.support[1] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_MainLoop, &data.data_loop); - data.support[2] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_DataLoop, &data.data_loop); + data.support[0] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_Log, data.log); + data.support[1] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_MainLoop, &data.data_loop); + data.support[2] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_DataLoop, &data.data_loop); data.n_support = 3; if ((res = make_nodes(&data, argc > 1 ? argv[1] : NULL)) < 0) { diff --git a/spa/tests/test-perf.c b/spa/tests/test-perf.c index 2e4d254ca..0ea561753 100644 --- a/spa/tests/test-perf.c +++ b/spa/tests/test-perf.c @@ -172,7 +172,7 @@ static int make_node(struct data *data, struct spa_node **node, const char *lib, printf("can't make factory instance: %d\n", res); return res; } - if ((res = spa_handle_get_interface(handle, SPA_ID_INTERFACE_Node, &iface)) < 0) { + if ((res = spa_handle_get_interface(handle, SPA_TYPE_INTERFACE_Node, &iface)) < 0) { printf("can't get interface %d\n", res); return res; } @@ -359,7 +359,7 @@ static int negotiate_formats(struct data *data) spa_pod_builder_init(&b, buffer, sizeof(buffer)); format = spa_pod_builder_object(&b, - 0, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, 0, "I", SPA_MEDIA_TYPE_binary, "I", SPA_MEDIA_SUBTYPE_raw); @@ -519,9 +519,9 @@ int main(int argc, char *argv[]) printf("mode %08x\n", data.mode); - data.support[0] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_Log, data.log); - data.support[1] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_MainLoop, &data.data_loop); - data.support[2] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_DataLoop, &data.data_loop); + data.support[0] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_Log, data.log); + data.support[1] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_MainLoop, &data.data_loop); + data.support[2] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_DataLoop, &data.data_loop); data.n_support = 3; if ((res = make_nodes(&data)) < 0) { diff --git a/spa/tests/test-props.c b/spa/tests/test-props.c index 727a997b5..cc1f54f68 100644 --- a/spa/tests/test-props.c +++ b/spa/tests/test-props.c @@ -195,7 +195,7 @@ static void do_static_struct(void) } props; } test_format = { SPA_POD_OBJECT_INIT(sizeof(test_format.props) + sizeof(struct spa_pod_object_body), - 0, SPA_ID_OBJECT_Format), + SPA_TYPE_OBJECT_Format, 0), { SPA_POD_ENUM_INIT(SPA_MEDIA_TYPE_video), SPA_POD_ENUM_INIT(SPA_MEDIA_SUBTYPE_raw), @@ -204,7 +204,7 @@ static void do_static_struct(void) sizeof(struct spa_pod_prop_body), SPA_FORMAT_VIDEO_format, SPA_POD_PROP_RANGE_ENUM | SPA_POD_PROP_FLAG_UNSET, - sizeof(uint32_t), SPA_ID_Enum), + sizeof(uint32_t), SPA_TYPE_Enum), { SPA_VIDEO_FORMAT_I420, { SPA_VIDEO_FORMAT_I420, SPA_VIDEO_FORMAT_YUY2 } @@ -213,7 +213,7 @@ static void do_static_struct(void) sizeof(struct spa_pod_prop_body), SPA_FORMAT_VIDEO_size, SPA_POD_PROP_RANGE_MIN_MAX | SPA_POD_PROP_FLAG_UNSET, - sizeof(struct spa_rectangle), SPA_ID_Rectangle), + sizeof(struct spa_rectangle), SPA_TYPE_Rectangle), { SPA_RECTANGLE(320,243), @@ -223,7 +223,7 @@ static void do_static_struct(void) sizeof(struct spa_pod_prop_body), SPA_FORMAT_VIDEO_framerate, SPA_POD_PROP_RANGE_MIN_MAX | SPA_POD_PROP_FLAG_UNSET, - sizeof(struct spa_fraction), SPA_ID_Fraction), + sizeof(struct spa_fraction), SPA_TYPE_Fraction), { SPA_FRACTION(25,1), SPA_FRACTION(0,1), SPA_FRACTION(INT32_MAX,1) @@ -264,7 +264,7 @@ int main(int argc, char *argv[]) spa_pod_builder_init(&b, buffer, sizeof(buffer)); - spa_pod_builder_push_object(&b, 0, SPA_ID_OBJECT_Format); + spa_pod_builder_push_object(&b, SPA_TYPE_OBJECT_Format, 0); spa_pod_builder_enum(&b, SPA_MEDIA_TYPE_video); spa_pod_builder_enum(&b, SPA_MEDIA_SUBTYPE_raw); @@ -299,7 +299,7 @@ int main(int argc, char *argv[]) spa_pod_builder_init(&b, buffer, sizeof(buffer)); fmt = spa_pod_builder_object(&b, - 0, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, 0, "I", SPA_MEDIA_TYPE_video, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_VIDEO_format, "Ieu", SPA_VIDEO_FORMAT_I420, @@ -328,7 +328,7 @@ int main(int argc, char *argv[]) * ) */ fmt = spa_pod_builder_add(&b, - "<", 0, SPA_ID_OBJECT_Format, + "<", SPA_TYPE_OBJECT_Format, 0, "I", SPA_MEDIA_TYPE_video, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_VIDEO_format, "Ieu", SPA_VIDEO_FORMAT_I420, diff --git a/spa/tests/test-ringbuffer.c b/spa/tests/test-ringbuffer.c index e15004ad2..1dbc88c81 100644 --- a/spa/tests/test-ringbuffer.c +++ b/spa/tests/test-ringbuffer.c @@ -144,7 +144,7 @@ static int make_node(struct data *data, struct spa_node **node, const char *lib, printf("can't make factory instance: %d\n", res); return res; } - if ((res = spa_handle_get_interface(handle, SPA_ID_INTERFACE_Node, &iface)) < 0) { + if ((res = spa_handle_get_interface(handle, SPA_TYPE_INTERFACE_Node, &iface)) < 0) { printf("can't get interface %d\n", res); return res; } @@ -236,7 +236,7 @@ static int make_nodes(struct data *data, const char *device) spa_pod_builder_init(&b, buffer, sizeof(buffer)); props = spa_pod_builder_object(&b, - 0, SPA_ID_OBJECT_Props, + SPA_TYPE_OBJECT_Props, 0, ":", SPA_PROP_device, "s", device ? device : "hw:0", ":", SPA_PROP_minLatency, "i", 64); @@ -252,7 +252,7 @@ static int make_nodes(struct data *data, const char *device) spa_pod_builder_init(&b, buffer, sizeof(buffer)); props = spa_pod_builder_object(&b, - 0, SPA_ID_OBJECT_Props, + SPA_TYPE_OBJECT_Props, 0, ":", SPA_PROP_live, "b", false); if ((res = spa_node_set_param(data->source, SPA_PARAM_Props, 0, props)) < 0) @@ -271,7 +271,7 @@ static int negotiate_formats(struct data *data) spa_pod_builder_init(&b, buffer, sizeof(buffer)); filter = spa_pod_builder_object(&b, - 0, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, 0, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_S16, @@ -428,9 +428,9 @@ int main(int argc, char *argv[]) if ((str = getenv("SPA_DEBUG"))) data.log->level = atoi(str); - data.support[0] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_Log, data.log); - data.support[1] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_MainLoop, &data.data_loop); - data.support[2] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_DataLoop, &data.data_loop); + data.support[0] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_Log, data.log); + data.support[1] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_MainLoop, &data.data_loop); + data.support[2] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_DataLoop, &data.data_loop); data.n_support = 3; if ((res = make_nodes(&data, argc > 1 ? argv[1] : NULL)) < 0) { diff --git a/spa/tests/test-v4l2.c b/spa/tests/test-v4l2.c index 2bc815f3f..f5f5084b3 100644 --- a/spa/tests/test-v4l2.c +++ b/spa/tests/test-v4l2.c @@ -118,7 +118,7 @@ static int make_node(struct data *data, struct spa_node **node, const char *lib, printf("can't make factory instance: %d\n", res); return res; } - if ((res = spa_handle_get_interface(handle, SPA_ID_INTERFACE_Node, &iface)) < 0) { + if ((res = spa_handle_get_interface(handle, SPA_TYPE_INTERFACE_Node, &iface)) < 0) { printf("can't get interface %d\n", res); return res; } @@ -288,7 +288,7 @@ static int make_nodes(struct data *data, const char *device) spa_pod_builder_init(&b, buffer, sizeof(buffer)); props = spa_pod_builder_object(&b, - 0, SPA_ID_OBJECT_Props, + SPA_TYPE_OBJECT_Props, 0, ":", SPA_PROP_device, "s", device ? device : "/dev/video0"); if ((res = spa_node_set_param(data->source, SPA_PARAM_Props, 0, props)) < 0) @@ -388,7 +388,7 @@ static int negotiate_formats(struct data *data) return res; format = spa_pod_builder_object(&b, - 0, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, 0, "I", SPA_MEDIA_TYPE_video, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_VIDEO_format, "I", SPA_VIDEO_FORMAT_YUY2, @@ -541,9 +541,9 @@ int main(int argc, char *argv[]) data.data_loop.remove_source = do_remove_source; data.data_loop.invoke = do_invoke; - data.support[0] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_Log, data.log); - data.support[1] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_MainLoop, &data.data_loop); - data.support[2] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_DataLoop, &data.data_loop); + data.support[0] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_Log, data.log); + data.support[1] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_MainLoop, &data.data_loop); + data.support[2] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_DataLoop, &data.data_loop); data.n_support = 3; if (SDL_Init(SDL_INIT_VIDEO) < 0) { diff --git a/spa/tools/spa-inspect.c b/spa/tools/spa-inspect.c index fc66ca1b7..8a4659679 100644 --- a/spa/tools/spa-inspect.c +++ b/spa/tools/spa-inspect.c @@ -122,7 +122,7 @@ inspect_port_params(struct data *data, struct spa_node *node, break; } - if (spa_pod_is_object_type(param, SPA_ID_OBJECT_Format)) + if (spa_pod_is_object_id(param, SPA_TYPE_OBJECT_Format)) spa_debug_format(0, NULL, param); else spa_debug_pod(0, spa_debug_types, param); @@ -219,7 +219,7 @@ static void inspect_factory(struct data *data, const struct spa_handle_factory * continue; } - if (info->type == SPA_ID_INTERFACE_Node) + if (info->type == SPA_TYPE_INTERFACE_Node) inspect_node(data, interface); else printf("skipping unknown interface\n"); @@ -263,9 +263,9 @@ int main(int argc, char *argv[]) if ((str = getenv("SPA_DEBUG"))) data.log->level = atoi(str); - data.support[0] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_Log, data.log); - data.support[1] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_MainLoop, &data.loop); - data.support[2] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_DataLoop, &data.loop); + data.support[0] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_Log, data.log); + data.support[1] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_MainLoop, &data.loop); + data.support[2] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_DataLoop, &data.loop); data.n_support = 3; if ((handle = dlopen(argv[1], RTLD_NOW)) == NULL) { diff --git a/spa/tools/spa-monitor.c b/spa/tools/spa-monitor.c index 5dcc2973d..0f1e211cc 100644 --- a/spa/tools/spa-monitor.c +++ b/spa/tools/spa-monitor.c @@ -170,8 +170,8 @@ int main(int argc, char *argv[]) data.main_loop.update_source = do_update_source; data.main_loop.remove_source = do_remove_source; - data.support[1] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_Log, data.log); - data.support[2] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_MainLoop, &data.main_loop); + data.support[1] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_Log, data.log); + data.support[2] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_MainLoop, &data.main_loop); data.n_support = 3; if (argc < 2) { @@ -208,7 +208,7 @@ int main(int argc, char *argv[]) break; } - if (info->type == SPA_ID_INTERFACE_Monitor) { + if (info->type == SPA_TYPE_INTERFACE_Monitor) { struct spa_handle *handle; void *interface; @@ -221,7 +221,7 @@ int main(int argc, char *argv[]) } if ((res = - spa_handle_get_interface(handle, SPA_ID_INTERFACE_Monitor, + spa_handle_get_interface(handle, SPA_TYPE_INTERFACE_Monitor, &interface)) < 0) { printf("can't get interface: %s\n", strerror(res)); continue; diff --git a/src/examples/audio-src.c b/src/examples/audio-src.c index 88b212cfd..1d8a62713 100644 --- a/src/examples/audio-src.c +++ b/src/examples/audio-src.c @@ -113,7 +113,7 @@ int main(int argc, char *argv[]) data.remote = pw_stream_get_remote(data.stream); params[0] = spa_pod_builder_object(&b, - SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_F32, diff --git a/src/examples/export-sink.c b/src/examples/export-sink.c index d88392360..53c678d6d 100644 --- a/src/examples/export-sink.c +++ b/src/examples/export-sink.c @@ -218,7 +218,7 @@ static int port_get_format(struct spa_node *node, return 0; *result = spa_pod_builder_object(builder, - SPA_PARAM_Format, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_Format, "I", SPA_MEDIA_TYPE_video, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_VIDEO_format, "I", d->format.format, @@ -251,7 +251,7 @@ static int impl_port_enum_params(struct spa_node *node, if (*index < SPA_N_ELEMENTS(list)) param = spa_pod_builder_object(builder, - id, SPA_ID_OBJECT_ParamList, + SPA_TYPE_OBJECT_ParamList, id, ":", SPA_PARAM_LIST_id, "I", list[*index]); else return 0; @@ -268,7 +268,7 @@ static int impl_port_enum_params(struct spa_node *node, return 0; param = spa_pod_builder_object(builder, - id, SPA_ID_OBJECT_ParamBuffers, + SPA_TYPE_OBJECT_ParamBuffers, id, ":", SPA_PARAM_BUFFERS_buffers, "iru", 2, SPA_POD_PROP_MIN_MAX(2, MAX_BUFFERS), ":", SPA_PARAM_BUFFERS_blocks, "i", 1, @@ -281,13 +281,13 @@ static int impl_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(builder, - id, SPA_ID_OBJECT_ParamMeta, + SPA_TYPE_OBJECT_ParamMeta, id, ":", SPA_PARAM_META_type, "I", SPA_META_Header, ":", SPA_PARAM_META_size, "i", sizeof(struct spa_meta_header)); break; case 1: param = spa_pod_builder_object(builder, - id, SPA_ID_OBJECT_ParamMeta, + SPA_TYPE_OBJECT_ParamMeta, id, ":", SPA_PARAM_META_type, "I", SPA_META_VideoDamage, ":", SPA_PARAM_META_size, "i", sizeof(struct spa_meta_region)); break; diff --git a/src/examples/export-source.c b/src/examples/export-source.c index d51f45c0f..3322a1b9a 100644 --- a/src/examples/export-source.c +++ b/src/examples/export-source.c @@ -181,7 +181,7 @@ static int port_enum_formats(struct spa_node *node, return 0; *param = spa_pod_builder_object(builder, - SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "Ieu", SPA_AUDIO_FORMAT_S16, @@ -216,7 +216,7 @@ static int port_get_format(struct spa_node *node, return 0; *param = spa_pod_builder_object(builder, - SPA_PARAM_Format, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_Format, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", d->format.format, @@ -249,7 +249,7 @@ static int impl_port_enum_params(struct spa_node *node, if (*index < SPA_N_ELEMENTS(list)) param = spa_pod_builder_object(builder, - id, SPA_ID_OBJECT_ParamList, + SPA_TYPE_OBJECT_ParamList, id, ":", SPA_PARAM_LIST_id, "I", list[*index]); else return 0; @@ -266,7 +266,7 @@ static int impl_port_enum_params(struct spa_node *node, return 0; param = spa_pod_builder_object(builder, - id, SPA_ID_OBJECT_ParamBuffers, + SPA_TYPE_OBJECT_ParamBuffers, id, ":", SPA_PARAM_BUFFERS_buffers, "iru", 1, SPA_POD_PROP_MIN_MAX(1, 32), ":", SPA_PARAM_BUFFERS_blocks, "i", 1, @@ -279,7 +279,7 @@ static int impl_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(builder, - id, SPA_ID_OBJECT_ParamMeta, + SPA_TYPE_OBJECT_ParamMeta, id, ":", SPA_PARAM_META_type, "I", SPA_META_Header, ":", SPA_PARAM_META_size, "i", sizeof(struct spa_meta_header)); break; @@ -291,7 +291,7 @@ static int impl_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(builder, - id, SPA_ID_OBJECT_ParamIO, + SPA_TYPE_OBJECT_ParamIO, id, ":", SPA_PARAM_IO_id, "I", SPA_IO_Buffers, ":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_buffers)); break; diff --git a/src/examples/export-spa.c b/src/examples/export-spa.c index 5d473bb15..a919b23a6 100644 --- a/src/examples/export-spa.c +++ b/src/examples/export-spa.c @@ -60,7 +60,7 @@ static int make_node(struct data *data) data->node = pw_factory_create_object(factory, NULL, - PW_ID_INTERFACE_Node, + PW_TYPE_INTERFACE_Node, PW_VERSION_NODE, props, SPA_ID_INVALID); diff --git a/src/examples/local-v4l2.c b/src/examples/local-v4l2.c index a4c389d40..b932b31ef 100644 --- a/src/examples/local-v4l2.c +++ b/src/examples/local-v4l2.c @@ -225,7 +225,7 @@ static int port_enum_formats(struct spa_node *node, SDL_GetRendererInfo(d->renderer, &info); - spa_pod_builder_push_object(builder, SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format); + spa_pod_builder_push_object(builder, SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat); spa_pod_builder_enum(builder, SPA_MEDIA_TYPE_video); spa_pod_builder_enum(builder, SPA_MEDIA_SUBTYPE_raw); @@ -281,7 +281,7 @@ static int impl_port_enum_params(struct spa_node *node, return 0; *result = spa_pod_builder_object(builder, - id, SPA_ID_OBJECT_ParamBuffers, + SPA_TYPE_OBJECT_ParamBuffers, id, ":", SPA_PARAM_BUFFERS_buffers, "iru", 2, SPA_POD_PROP_MIN_MAX(1, 32), ":", SPA_PARAM_BUFFERS_blocks, "i", 1, @@ -295,7 +295,7 @@ static int impl_port_enum_params(struct spa_node *node, return 0; *result = spa_pod_builder_object(builder, - id, SPA_ID_OBJECT_ParamMeta, + SPA_TYPE_OBJECT_ParamMeta, id, ":", SPA_PARAM_META_type, "I", SPA_META_Header, ":", SPA_PARAM_META_size, "i", sizeof(struct spa_meta_header)); break; @@ -458,7 +458,7 @@ static void make_nodes(struct data *data) "spa.factory.name", "v4l2-source", NULL); data->v4l2 = pw_factory_create_object(factory, NULL, - PW_ID_INTERFACE_Node, + PW_TYPE_INTERFACE_Node, PW_VERSION_NODE, props, SPA_ID_INVALID); diff --git a/src/examples/media-session.c b/src/examples/media-session.c index 53b41873f..910301479 100644 --- a/src/examples/media-session.c +++ b/src/examples/media-session.c @@ -272,10 +272,10 @@ registry_global(void *data,uint32_t id, uint32_t parent_id, clock_gettime(CLOCK_MONOTONIC, &impl->now); - if (type == PW_ID_INTERFACE_Node) { + if (type == PW_TYPE_INTERFACE_Node) { handle_node(impl, id, parent_id, type, props); } - else if (type == PW_ID_INTERFACE_Port) { + else if (type == PW_TYPE_INTERFACE_Port) { handle_port(impl, id, parent_id, type, props); } schedule_rescan(impl); @@ -313,7 +313,7 @@ static void rescan_session(struct impl *impl) sess->dsp = pw_core_proxy_create_object(impl->core_proxy, "audio-dsp", - PW_ID_INTERFACE_Node, + PW_TYPE_INTERFACE_Node, PW_VERSION_NODE, &props->dict, 0); @@ -334,7 +334,7 @@ static void on_state_changed(void *_data, enum pw_remote_state old, enum pw_remo case PW_REMOTE_STATE_CONNECTED: impl->core_proxy = pw_remote_get_core_proxy(impl->remote); impl->registry_proxy = pw_core_proxy_get_registry(impl->core_proxy, - PW_ID_INTERFACE_Registry, + PW_TYPE_INTERFACE_Registry, PW_VERSION_REGISTRY, 0); pw_registry_proxy_add_listener(impl->registry_proxy, &impl->registry_listener, diff --git a/src/examples/sdl.h b/src/examples/sdl.h index 1de5b3d61..1f6e816aa 100644 --- a/src/examples/sdl.h +++ b/src/examples/sdl.h @@ -97,7 +97,7 @@ static struct spa_pod *sdl_build_formats(SDL_RendererInfo *info, struct spa_pod_ { int i, c; - spa_pod_builder_push_object(b, SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format); + spa_pod_builder_push_object(b, SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat); spa_pod_builder_enum(b, SPA_MEDIA_TYPE_video); spa_pod_builder_enum(b, SPA_MEDIA_SUBTYPE_raw); diff --git a/src/examples/video-play.c b/src/examples/video-play.c index 0266154a0..f554bd795 100644 --- a/src/examples/video-play.c +++ b/src/examples/video-play.c @@ -169,7 +169,7 @@ on_stream_format_changed(void *_data, const struct spa_pod *format) SDL_UnlockTexture(data->texture); params[0] = spa_pod_builder_object(&b, - SPA_PARAM_Buffers, SPA_ID_OBJECT_ParamBuffers, + SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers, ":", SPA_PARAM_BUFFERS_buffers, "iru", 8, SPA_POD_PROP_MIN_MAX(2, 16), ":", SPA_PARAM_BUFFERS_blocks, "i", 1, @@ -178,7 +178,7 @@ on_stream_format_changed(void *_data, const struct spa_pod *format) ":", SPA_PARAM_BUFFERS_align, "i", 16); params[1] = spa_pod_builder_object(&b, - SPA_PARAM_Meta, SPA_ID_OBJECT_ParamMeta, + SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, ":", SPA_PARAM_META_type, "I", SPA_META_Header, ":", SPA_PARAM_META_size, "i", sizeof(struct spa_meta_header)); diff --git a/src/examples/video-src.c b/src/examples/video-src.c index a430cbf55..82e643e4d 100644 --- a/src/examples/video-src.c +++ b/src/examples/video-src.c @@ -168,7 +168,7 @@ on_stream_format_changed(void *_data, const struct spa_pod *format) data->stride = SPA_ROUND_UP_N(data->format.size.width * BPP, 4); params[0] = spa_pod_builder_object(&b, - SPA_PARAM_Buffers, SPA_ID_OBJECT_ParamBuffers, + SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers, ":", SPA_PARAM_BUFFERS_buffers, "iru", 2, SPA_POD_PROP_MIN_MAX(1, 32), ":", SPA_PARAM_BUFFERS_blocks, "i", 1, @@ -177,12 +177,12 @@ on_stream_format_changed(void *_data, const struct spa_pod *format) ":", SPA_PARAM_BUFFERS_align, "i", 16); params[1] = spa_pod_builder_object(&b, - SPA_PARAM_Meta, SPA_ID_OBJECT_ParamMeta, + SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, ":", SPA_PARAM_META_type, "I", SPA_META_Header, ":", SPA_PARAM_META_size, "i", sizeof(struct spa_meta_header)); params[2] = spa_pod_builder_object(&b, - SPA_PARAM_Meta, SPA_ID_OBJECT_ParamMeta, + SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, ":", SPA_PARAM_META_type, "I", SPA_META_VideoDamage, ":", SPA_PARAM_META_size, "iru", sizeof(struct spa_meta_region) * 16, SPA_POD_PROP_MIN_MAX(sizeof(struct spa_meta_region) * 1, @@ -223,7 +223,7 @@ static void on_state_changed(void *_data, enum pw_remote_state old, enum pw_remo NULL)); params[0] = spa_pod_builder_object(&b, - SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat, "I", SPA_MEDIA_TYPE_video, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_VIDEO_format, "I", SPA_VIDEO_FORMAT_RGB, diff --git a/src/gst/gstpipewiredeviceprovider.c b/src/gst/gstpipewiredeviceprovider.c index 1574c0d44..663660e78 100644 --- a/src/gst/gstpipewiredeviceprovider.c +++ b/src/gst/gstpipewiredeviceprovider.c @@ -464,11 +464,11 @@ static void registry_event_global(void *data, uint32_t id, uint32_t parent_id, u GstPipeWireDeviceProvider *self = rd->self; struct node_data *nd; - if (type == PW_ID_INTERFACE_Node) { + if (type == PW_TYPE_INTERFACE_Node) { struct pw_node_proxy *node; node = pw_registry_proxy_bind(rd->registry, - id, PW_ID_INTERFACE_Node, + id, PW_TYPE_INTERFACE_Node, PW_VERSION_NODE, sizeof(*nd)); if (node == NULL) goto no_mem; @@ -484,7 +484,7 @@ static void registry_event_global(void *data, uint32_t id, uint32_t parent_id, u pw_proxy_add_listener((struct pw_proxy*)node, &nd->proxy_listener, &proxy_node_events, nd); add_pending(self, &nd->pending, NULL, NULL); } - else if (type == PW_ID_INTERFACE_Port) { + else if (type == PW_TYPE_INTERFACE_Port) { struct pw_port_proxy *port; struct port_data *pd; @@ -492,7 +492,7 @@ static void registry_event_global(void *data, uint32_t id, uint32_t parent_id, u return; port = pw_registry_proxy_bind(rd->registry, - id, PW_ID_INTERFACE_Port, + id, PW_TYPE_INTERFACE_Port, PW_VERSION_PORT, sizeof(*pd)); if (port == NULL) goto no_mem; @@ -590,7 +590,7 @@ gst_pipewire_device_provider_probe (GstDeviceProvider * provider) self->core_proxy = pw_remote_get_core_proxy(r); data->registry = pw_core_proxy_get_registry(self->core_proxy, - PW_ID_INTERFACE_Registry, PW_VERSION_REGISTRY, 0); + PW_TYPE_INTERFACE_Registry, PW_VERSION_REGISTRY, 0); pw_registry_proxy_add_listener(data->registry, &data->registry_listener, ®istry_events, data); pw_core_proxy_sync(self->core_proxy, ++self->seq); @@ -677,7 +677,7 @@ gst_pipewire_device_provider_start (GstDeviceProvider * provider) self->core_proxy = pw_remote_get_core_proxy(self->remote); self->registry = pw_core_proxy_get_registry(self->core_proxy, - PW_ID_INTERFACE_Registry, PW_VERSION_REGISTRY, 0); + PW_TYPE_INTERFACE_Registry, PW_VERSION_REGISTRY, 0); data->registry = self->registry; diff --git a/src/gst/gstpipewireformat.c b/src/gst/gstpipewireformat.c index bf7e99ba1..072f4fdca 100644 --- a/src/gst/gstpipewireformat.c +++ b/src/gst/gstpipewireformat.c @@ -371,7 +371,7 @@ handle_video_fields (ConvertData *d) idx = gst_video_format_from_string (v); if (idx < SPA_N_ELEMENTS (video_format_map)) - spa_pod_builder_id (&d->b, video_format_map[idx]); + spa_pod_builder_enum (&d->b, video_format_map[idx]); } prop = spa_pod_builder_pop(&d->b); if (i > 1) @@ -447,7 +447,7 @@ handle_audio_fields (ConvertData *d) idx = gst_audio_format_from_string (v); if (idx < SPA_N_ELEMENTS (audio_format_map)) - spa_pod_builder_id (&d->b, audio_format_map[idx]); + spa_pod_builder_enum (&d->b, audio_format_map[idx]); } prop = spa_pod_builder_pop(&d->b); if (i > 1) @@ -534,9 +534,9 @@ convert_1 (ConvertData *d) d->b.write = write_pod; - spa_pod_builder_push_object (&d->b, d->id, SPA_ID_OBJECT_Format); - spa_pod_builder_id(&d->b, d->type->media_type); - spa_pod_builder_id(&d->b, d->type->media_subtype); + spa_pod_builder_push_object (&d->b, SPA_TYPE_OBJECT_Format, d->id); + spa_pod_builder_enum(&d->b, d->type->media_type); + spa_pod_builder_enum(&d->b, d->type->media_subtype); if (d->type->media_type == SPA_MEDIA_TYPE_video) handle_video_fields (d); diff --git a/src/gst/gstpipewiresink.c b/src/gst/gstpipewiresink.c index b9cf44f1a..da2852aa3 100644 --- a/src/gst/gstpipewiresink.c +++ b/src/gst/gstpipewiresink.c @@ -230,7 +230,7 @@ pool_activated (GstPipeWirePool *pool, GstPipeWireSink *sink) gst_buffer_pool_config_get_params (config, &caps, &size, &min_buffers, &max_buffers); spa_pod_builder_init (&b, buffer, sizeof (buffer)); - spa_pod_builder_push_object (&b, SPA_PARAM_Buffers, SPA_ID_OBJECT_ParamBuffers); + spa_pod_builder_push_object (&b, SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers); if (size == 0) spa_pod_builder_add (&b, ":", SPA_PARAM_BUFFERS_size, "iru", 0, SPA_POD_PROP_MIN_MAX(0, INT32_MAX), NULL); @@ -248,7 +248,7 @@ pool_activated (GstPipeWirePool *pool, GstPipeWireSink *sink) port_params[0] = spa_pod_builder_pop (&b); port_params[1] = spa_pod_builder_object (&b, - SPA_PARAM_Meta, SPA_ID_OBJECT_ParamMeta, + SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, ":", SPA_PARAM_META_type, "I", SPA_META_Header, ":", SPA_PARAM_META_size, "i", sizeof (struct spa_meta_header)); diff --git a/src/gst/gstpipewiresrc.c b/src/gst/gstpipewiresrc.c index 550075549..75b9a376f 100644 --- a/src/gst/gstpipewiresrc.c +++ b/src/gst/gstpipewiresrc.c @@ -702,7 +702,7 @@ on_format_changed (void *data, spa_pod_builder_init (&b, buffer, sizeof (buffer)); params[0] = spa_pod_builder_object (&b, - SPA_PARAM_Buffers, SPA_ID_OBJECT_ParamBuffers, + SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers, ":", SPA_PARAM_BUFFERS_buffers, "iru", 16, SPA_POD_PROP_MIN_MAX(1, INT32_MAX), ":", SPA_PARAM_BUFFERS_blocks, "iru", 0, SPA_POD_PROP_MIN_MAX(1, INT32_MAX), ":", SPA_PARAM_BUFFERS_size, "iru", 0, SPA_POD_PROP_MIN_MAX(0, INT32_MAX), @@ -710,7 +710,7 @@ on_format_changed (void *data, ":", SPA_PARAM_BUFFERS_align, "i", 16); params[1] = spa_pod_builder_object (&b, - SPA_PARAM_Meta, SPA_ID_OBJECT_ParamMeta, + SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, ":", SPA_PARAM_META_type, "I", SPA_META_Header, ":", SPA_PARAM_META_size, "i", sizeof (struct spa_meta_header)); diff --git a/src/modules/module-audio-dsp.c b/src/modules/module-audio-dsp.c index 8a367fd10..2dfb38248 100644 --- a/src/modules/module-audio-dsp.c +++ b/src/modules/module-audio-dsp.c @@ -185,7 +185,7 @@ static int module_init(struct pw_module *module, struct pw_properties *propertie factory = pw_factory_new(core, "audio-dsp", - PW_ID_INTERFACE_Node, + PW_TYPE_INTERFACE_Node, PW_VERSION_NODE, NULL, sizeof(*data)); diff --git a/src/modules/module-client-node.c b/src/modules/module-client-node.c index ee0f05e19..24a60a7d4 100644 --- a/src/modules/module-client-node.c +++ b/src/modules/module-client-node.c @@ -125,7 +125,7 @@ static int module_init(struct pw_module *module, struct pw_properties *propertie factory = pw_factory_new(core, "client-node", - PW_ID_INTERFACE_ClientNode, + PW_TYPE_INTERFACE_ClientNode, PW_VERSION_CLIENT_NODE, NULL, sizeof(*data)); diff --git a/src/modules/module-client-node/client-node.c b/src/modules/module-client-node/client-node.c index a351b74f9..b78bae7c5 100644 --- a/src/modules/module-client-node/client-node.c +++ b/src/modules/module-client-node/client-node.c @@ -365,7 +365,7 @@ static int impl_node_enum_params(struct spa_node *node, param = this->params[(*index)++]; - if (!spa_pod_is_object_id(param, id)) + if (!spa_pod_is_object_type(param, id)) continue; if (spa_pod_filter(builder, result, param, filter) == 0) @@ -1155,10 +1155,10 @@ node_init(struct node *this, for (i = 0; i < n_support; i++) { switch (support[i].type) { - case SPA_ID_INTERFACE_Log: + case SPA_TYPE_INTERFACE_Log: this->log = support[i].data; break; - case SPA_ID_INTERFACE_DataLoop: + case SPA_TYPE_INTERFACE_DataLoop: this->data_loop = support[i].data; break; default: diff --git a/src/modules/module-client-node/client-stream.c b/src/modules/module-client-node/client-stream.c index 944464283..75a11f720 100644 --- a/src/modules/module-client-node/client-stream.c +++ b/src/modules/module-client-node/client-stream.c @@ -813,7 +813,7 @@ node_init(struct node *this, uint32_t i; for (i = 0; i < n_support; i++) { - if (support[i].type == SPA_ID_INTERFACE_Log) + if (support[i].type == SPA_TYPE_INTERFACE_Log) this->log = support[i].data; } this->node = impl_node; @@ -905,7 +905,7 @@ static void client_node_initialized(void *data) media_type == SPA_MEDIA_TYPE_audio && media_subtype == SPA_MEDIA_SUBTYPE_raw) { if ((impl->adapter = pw_load_spa_interface("audioconvert/libspa-audioconvert", - "audioconvert", SPA_ID_INTERFACE_Node, NULL, 0, NULL)) == NULL) + "audioconvert", SPA_TYPE_INTERFACE_Node, NULL, 0, NULL)) == NULL) return; impl->adapter_mix = impl->adapter; diff --git a/src/modules/module-client-node/protocol-native.c b/src/modules/module-client-node/protocol-native.c index ef1985842..6a5e49bbb 100644 --- a/src/modules/module-client-node/protocol-native.c +++ b/src/modules/module-client-node/protocol-native.c @@ -938,7 +938,7 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_client_node_ }; static const struct pw_protocol_marshal pw_protocol_native_client_node_marshal = { - PW_ID_INTERFACE_ClientNode, + PW_TYPE_INTERFACE_ClientNode, PW_VERSION_CLIENT_NODE, &pw_protocol_native_client_node_method_marshal, &pw_protocol_native_client_node_method_demarshal, diff --git a/src/modules/module-flatpak.c b/src/modules/module-flatpak.c index 0cb175f11..45cb767d5 100644 --- a/src/modules/module-flatpak.c +++ b/src/modules/module-flatpak.c @@ -221,16 +221,16 @@ set_global_permissions(void *data, struct pw_global *global) props = pw_global_get_properties(global); switch (pw_global_get_type(global)) { - case PW_ID_INTERFACE_Core: + case PW_TYPE_INTERFACE_Core: allowed = true; break; - case PW_ID_INTERFACE_Factory: + case PW_TYPE_INTERFACE_Factory: if (props && (str = pw_properties_get(props, "factory.name"))) { if (strcmp(str, "client-node") == 0) allowed = true; } break; - case PW_ID_INTERFACE_Node: + case PW_TYPE_INTERFACE_Node: if (props && (str = pw_properties_get(props, "media.class"))) { if (strcmp(str, "Video/Source") == 0 && cinfo->camera_allowed) allowed = true; @@ -393,7 +393,7 @@ core_global_added(void *data, struct pw_global *global) struct client_info *cinfo; int res; - if (pw_global_get_type(global) == PW_ID_INTERFACE_Client) { + if (pw_global_get_type(global) == PW_TYPE_INTERFACE_Client) { struct pw_client *client = pw_global_get_object(global); res = check_sandboxed(client); @@ -432,7 +432,7 @@ core_global_removed(void *data, struct pw_global *global) { struct impl *impl = data; - if (pw_global_get_type(global) == PW_ID_INTERFACE_Client) { + if (pw_global_get_type(global) == PW_TYPE_INTERFACE_Client) { struct pw_client *client = pw_global_get_object(global); struct client_info *cinfo; @@ -483,7 +483,7 @@ static int module_init(struct pw_module *module, struct pw_properties *propertie support = pw_core_get_support(core, &n_support); - dbus = spa_support_find(support, n_support, SPA_ID_INTERFACE_DBus); + dbus = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_DBus); if (dbus == NULL) return -ENOTSUP; diff --git a/src/modules/module-link-factory.c b/src/modules/module-link-factory.c index b8c3c0536..542085cbc 100644 --- a/src/modules/module-link-factory.c +++ b/src/modules/module-link-factory.c @@ -88,13 +88,13 @@ static void *create_object(void *_data, core = pw_client_get_core(client); global = pw_core_find_global(core, output_node_id); - if (global == NULL || pw_global_get_type(global) != PW_ID_INTERFACE_Node) + if (global == NULL || pw_global_get_type(global) != PW_TYPE_INTERFACE_Node) goto no_output; output_node = pw_global_get_object(global); global = pw_core_find_global(core, input_node_id); - if (global == NULL || pw_global_get_type(global) != PW_ID_INTERFACE_Node) + if (global == NULL || pw_global_get_type(global) != PW_TYPE_INTERFACE_Node) goto no_input; input_node = pw_global_get_object(global); @@ -103,7 +103,7 @@ static void *create_object(void *_data, outport = pw_node_find_port(output_node, SPA_DIRECTION_OUTPUT, SPA_ID_INVALID); else { global = pw_core_find_global(core, output_port_id); - if (global == NULL || pw_global_get_type(global) != PW_ID_INTERFACE_Port) + if (global == NULL || pw_global_get_type(global) != PW_TYPE_INTERFACE_Port) goto no_output_port; outport = pw_global_get_object(global); @@ -115,7 +115,7 @@ static void *create_object(void *_data, inport = pw_node_find_port(input_node, SPA_DIRECTION_INPUT, SPA_ID_INVALID); else { global = pw_core_find_global(core, input_port_id); - if (global == NULL || pw_global_get_type(global) != PW_ID_INTERFACE_Port) + if (global == NULL || pw_global_get_type(global) != PW_TYPE_INTERFACE_Port) goto no_output_port; inport = pw_global_get_object(global); @@ -204,7 +204,7 @@ static int module_init(struct pw_module *module, struct pw_properties *propertie factory = pw_factory_new(core, "link-factory", - PW_ID_INTERFACE_Link, + PW_TYPE_INTERFACE_Link, PW_VERSION_LINK, NULL, sizeof(*data)); diff --git a/src/modules/module-media-session.c b/src/modules/module-media-session.c index feabdda89..146925893 100644 --- a/src/modules/module-media-session.c +++ b/src/modules/module-media-session.c @@ -687,7 +687,7 @@ static int on_global(void *data, struct pw_global *global) bool need_dsp; uint64_t plugged; - if (pw_global_get_type(global) != PW_ID_INTERFACE_Node) + if (pw_global_get_type(global) != PW_TYPE_INTERFACE_Node) return 0; node = pw_global_get_object(global); diff --git a/src/modules/module-media-session/audio-dsp.c b/src/modules/module-media-session/audio-dsp.c index 9d81f5b2a..ff041ba83 100644 --- a/src/modules/module-media-session/audio-dsp.c +++ b/src/modules/module-media-session/audio-dsp.c @@ -254,7 +254,7 @@ struct pw_node *pw_audio_dsp_new(struct pw_core *core, p->spa_handle, NULL, support, n_support); - spa_handle_get_interface(p->spa_handle, SPA_ID_INTERFACE_Node, &iface); + spa_handle_get_interface(p->spa_handle, SPA_TYPE_INTERFACE_Node, &iface); p->spa_node = iface; diff --git a/src/modules/module-media-session/floatmix.c b/src/modules/module-media-session/floatmix.c index dc528bdbb..5a70b7295 100644 --- a/src/modules/module-media-session/floatmix.c +++ b/src/modules/module-media-session/floatmix.c @@ -325,7 +325,7 @@ static int port_enum_formats(struct spa_node *node, case 0: if (this->have_format) { *param = spa_pod_builder_object(builder, - SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", this->format.info.raw.format, @@ -334,7 +334,7 @@ static int port_enum_formats(struct spa_node *node, ":", SPA_FORMAT_AUDIO_channels, "i", this->format.info.raw.channels); } else { *param = spa_pod_builder_object(builder, - SPA_PARAM_EnumFormat, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", SPA_AUDIO_FORMAT_F32, @@ -365,7 +365,7 @@ static int port_get_format(struct spa_node *node, return 0; *param = spa_pod_builder_object(builder, - SPA_PARAM_Format, SPA_ID_OBJECT_Format, + SPA_TYPE_OBJECT_Format, SPA_PARAM_Format, "I", SPA_MEDIA_TYPE_audio, "I", SPA_MEDIA_SUBTYPE_raw, ":", SPA_FORMAT_AUDIO_format, "I", this->format.info.raw.format, @@ -414,7 +414,7 @@ impl_node_port_enum_params(struct spa_node *node, SPA_PARAM_IO }; if (*index < SPA_N_ELEMENTS(list)) - param = spa_pod_builder_object(&b, id, SPA_ID_OBJECT_ParamList, + param = spa_pod_builder_object(&b, SPA_TYPE_OBJECT_ParamList, id, ":", SPA_PARAM_LIST_id, "I", list[*index]); else return 0; @@ -436,7 +436,7 @@ impl_node_port_enum_params(struct spa_node *node, return 0; param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamBuffers, + SPA_TYPE_OBJECT_ParamBuffers, id, ":", SPA_PARAM_BUFFERS_buffers, "iru", 1, SPA_POD_PROP_MIN_MAX(1, MAX_BUFFERS), ":", SPA_PARAM_BUFFERS_blocks, "i", 1, @@ -453,7 +453,7 @@ impl_node_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamMeta, + SPA_TYPE_OBJECT_ParamMeta, id, ":", SPA_PARAM_META_type, "I", SPA_META_Header, ":", SPA_PARAM_META_size, "i", sizeof(struct spa_meta_header)); break; @@ -466,13 +466,13 @@ impl_node_port_enum_params(struct spa_node *node, switch (*index) { case 0: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamIO, + SPA_TYPE_OBJECT_ParamIO, id, ":", SPA_PARAM_IO_id, "I", SPA_IO_Buffers, ":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_buffers)); break; case 1: param = spa_pod_builder_object(&b, - id, SPA_ID_OBJECT_ParamIO, + SPA_TYPE_OBJECT_ParamIO, id, ":", SPA_PARAM_IO_id, "I", SPA_IO_ControlRange, ":", SPA_PARAM_IO_size, "i", sizeof(struct spa_io_control_range)); break; @@ -924,7 +924,7 @@ static const struct spa_node impl_node = { impl_node_process, }; -static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, void **interface) +static int impl_get_interface(struct spa_handle *handle, uint32_t type, void **interface) { struct impl *this; @@ -933,7 +933,7 @@ static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, this = (struct impl *) handle; - if (interface_id == SPA_ID_INTERFACE_Node) + if (type == SPA_TYPE_INTERFACE_Node) *interface = &this->node; else return -ENOENT; @@ -973,7 +973,7 @@ impl_init(const struct spa_handle_factory *factory, this = (struct impl *) handle; for (i = 0; i < n_support; i++) { - if (support[i].type == SPA_ID_INTERFACE_Log) + if (support[i].type == SPA_TYPE_INTERFACE_Log) this->log = support[i].data; } @@ -990,7 +990,7 @@ impl_init(const struct spa_handle_factory *factory, } static const struct spa_interface_info impl_interfaces[] = { - {SPA_ID_INTERFACE_Node,}, + {SPA_TYPE_INTERFACE_Node,}, }; static int diff --git a/src/modules/module-protocol-native/protocol-native.c b/src/modules/module-protocol-native/protocol-native.c index 6ff450d09..051898a6d 100644 --- a/src/modules/module-protocol-native/protocol-native.c +++ b/src/modules/module-protocol-native/protocol-native.c @@ -1106,7 +1106,7 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_core_event_d }; static const struct pw_protocol_marshal pw_protocol_native_core_marshal = { - PW_ID_INTERFACE_Core, + PW_TYPE_INTERFACE_Core, PW_VERSION_CORE, &pw_protocol_native_core_method_marshal, pw_protocol_native_core_method_demarshal, @@ -1137,7 +1137,7 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_registry_eve }; const struct pw_protocol_marshal pw_protocol_native_registry_marshal = { - PW_ID_INTERFACE_Registry, + PW_TYPE_INTERFACE_Registry, PW_VERSION_REGISTRY, &pw_protocol_native_registry_method_marshal, pw_protocol_native_registry_method_demarshal, @@ -1157,7 +1157,7 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_module_event }; const struct pw_protocol_marshal pw_protocol_native_module_marshal = { - PW_ID_INTERFACE_Module, + PW_TYPE_INTERFACE_Module, PW_VERSION_MODULE, NULL, NULL, 0, &pw_protocol_native_module_event_marshal, @@ -1175,7 +1175,7 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_factory_even }; const struct pw_protocol_marshal pw_protocol_native_factory_marshal = { - PW_ID_INTERFACE_Factory, + PW_TYPE_INTERFACE_Factory, PW_VERSION_FACTORY, NULL, NULL, 0, &pw_protocol_native_factory_event_marshal, @@ -1204,7 +1204,7 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_node_event_d }; static const struct pw_protocol_marshal pw_protocol_native_node_marshal = { - PW_ID_INTERFACE_Node, + PW_TYPE_INTERFACE_Node, PW_VERSION_NODE, &pw_protocol_native_node_method_marshal, pw_protocol_native_node_method_demarshal, @@ -1236,7 +1236,7 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_port_event_d }; static const struct pw_protocol_marshal pw_protocol_native_port_marshal = { - PW_ID_INTERFACE_Port, + PW_TYPE_INTERFACE_Port, PW_VERSION_PORT, &pw_protocol_native_port_method_marshal, pw_protocol_native_port_method_demarshal, @@ -1256,7 +1256,7 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_client_event }; static const struct pw_protocol_marshal pw_protocol_native_client_marshal = { - PW_ID_INTERFACE_Client, + PW_TYPE_INTERFACE_Client, PW_VERSION_CLIENT, NULL, NULL, 0, &pw_protocol_native_client_event_marshal, @@ -1274,7 +1274,7 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_link_event_d }; static const struct pw_protocol_marshal pw_protocol_native_link_marshal = { - PW_ID_INTERFACE_Link, + PW_TYPE_INTERFACE_Link, PW_VERSION_LINK, NULL, NULL, 0, &pw_protocol_native_link_event_marshal, diff --git a/src/modules/module-rtkit.c b/src/modules/module-rtkit.c index 3298fd93c..981839abe 100644 --- a/src/modules/module-rtkit.c +++ b/src/modules/module-rtkit.c @@ -481,7 +481,7 @@ static int module_init(struct pw_module *module, struct pw_properties *propertie support = pw_core_get_support(core, &n_support); - loop = spa_support_find(support, n_support, SPA_ID_INTERFACE_DataLoop); + loop = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_DataLoop); if (loop == NULL) return -ENOTSUP; diff --git a/src/modules/module-suspend-on-idle.c b/src/modules/module-suspend-on-idle.c index 4c0f48f9e..c1b7cbc37 100644 --- a/src/modules/module-suspend-on-idle.c +++ b/src/modules/module-suspend-on-idle.c @@ -127,7 +127,7 @@ core_global_added(void *data, struct pw_global *global) { struct impl *impl = data; - if (pw_global_get_type(global) == PW_ID_INTERFACE_Node) { + if (pw_global_get_type(global) == PW_TYPE_INTERFACE_Node) { struct pw_node *node = pw_global_get_object(global); struct node_info *info; @@ -147,7 +147,7 @@ core_global_removed(void *data, struct pw_global *global) { struct impl *impl = data; - if (pw_global_get_type(global) == PW_ID_INTERFACE_Node) { + if (pw_global_get_type(global) == PW_TYPE_INTERFACE_Node) { struct pw_node *node = pw_global_get_object(global); struct node_info *info; diff --git a/src/modules/spa/module-node-factory.c b/src/modules/spa/module-node-factory.c index 31a2491ea..ca24745dc 100644 --- a/src/modules/spa/module-node-factory.c +++ b/src/modules/spa/module-node-factory.c @@ -177,7 +177,7 @@ static int module_init(struct pw_module *module, struct pw_properties *propertie factory = pw_factory_new(core, "spa-node-factory", - PW_ID_INTERFACE_Node, + PW_TYPE_INTERFACE_Node, PW_VERSION_NODE, NULL, sizeof(*data)); diff --git a/src/modules/spa/spa-monitor.c b/src/modules/spa/spa-monitor.c index 3d2307568..173f5f04c 100644 --- a/src/modules/spa/spa-monitor.c +++ b/src/modules/spa/spa-monitor.c @@ -118,7 +118,7 @@ static struct monitor_item *add_item(struct pw_spa_monitor *this, pw_log_error("can't make factory instance: %d", res); return NULL; } - if ((res = spa_handle_get_interface(handle, SPA_ID_INTERFACE_Node, &node_iface)) < 0) { + if ((res = spa_handle_get_interface(handle, SPA_TYPE_INTERFACE_Node, &node_iface)) < 0) { pw_log_error("can't get NODE interface: %d", res); return NULL; } @@ -315,7 +315,7 @@ struct pw_spa_monitor *pw_spa_monitor_load(struct pw_core *core, pw_log_error("can't make factory instance: %d", res); goto init_failed; } - if ((res = spa_handle_get_interface(handle, SPA_ID_INTERFACE_Monitor, &iface)) < 0) { + if ((res = spa_handle_get_interface(handle, SPA_TYPE_INTERFACE_Monitor, &iface)) < 0) { pw_log_error("can't get MONITOR interface: %d", res); goto interface_failed; } diff --git a/src/modules/spa/spa-node.c b/src/modules/spa/spa-node.c index ef77a6163..b18ace81a 100644 --- a/src/modules/spa/spa-node.c +++ b/src/modules/spa/spa-node.c @@ -170,48 +170,48 @@ setup_props(struct pw_core *core, struct spa_node *spa_node, struct pw_propertie while ((key = pw_properties_iterate(pw_props, &state))) { struct spa_pod_prop *prop; - uint32_t id = 0; + uint32_t type = 0; #if 0 if (!spa_type_is_a(key, SPA_TYPE_PROPS_BASE)) continue; #endif - id = spa_debug_type_find_id(spa_debug_types, key); - if (id == SPA_ID_INVALID) + type = spa_debug_type_find_type(spa_debug_types, key); + if (type == SPA_TYPE_None) continue; - if ((prop = spa_pod_find_prop(props, id))) { + if ((prop = spa_pod_find_prop(props, type))) { const char *value = pw_properties_get(pw_props, key); pw_log_info("configure prop %s", key); switch(prop->body.value.type) { - case SPA_ID_Bool: + case SPA_TYPE_Bool: SPA_POD_VALUE(struct spa_pod_bool, &prop->body.value) = pw_properties_parse_bool(value); break; - case SPA_ID_Enum: + case SPA_TYPE_Enum: SPA_POD_VALUE(struct spa_pod_enum, &prop->body.value) = - spa_debug_type_find_id(spa_debug_types, value); + spa_debug_type_find_type(spa_debug_types, value); break; - case SPA_ID_Int: + case SPA_TYPE_Int: SPA_POD_VALUE(struct spa_pod_int, &prop->body.value) = pw_properties_parse_int(value); break; - case SPA_ID_Long: + case SPA_TYPE_Long: SPA_POD_VALUE(struct spa_pod_long, &prop->body.value) = pw_properties_parse_int64(value); break; - case SPA_ID_Float: + case SPA_TYPE_Float: SPA_POD_VALUE(struct spa_pod_float, &prop->body.value) = pw_properties_parse_float(value); break; - case SPA_ID_Double: + case SPA_TYPE_Double: SPA_POD_VALUE(struct spa_pod_double, &prop->body.value) = pw_properties_parse_double(value); break; - case SPA_ID_String: + case SPA_TYPE_String: break; default: break; @@ -293,7 +293,7 @@ struct pw_node *pw_spa_node_load(struct pw_core *core, if (SPA_RESULT_IS_ASYNC(res)) flags |= PW_SPA_NODE_FLAG_ASYNC; - if ((res = spa_handle_get_interface(handle, SPA_ID_INTERFACE_Node, &iface)) < 0) { + if ((res = spa_handle_get_interface(handle, SPA_TYPE_INTERFACE_Node, &iface)) < 0) { pw_log_error("can't get node interface %d", res); goto interface_failed; } diff --git a/src/pipewire/client.c b/src/pipewire/client.c index 6512568f0..dabaf684b 100644 --- a/src/pipewire/client.c +++ b/src/pipewire/client.c @@ -228,7 +228,7 @@ int pw_client_register(struct pw_client *client, client->registered = true; client->global = pw_global_new(core, - PW_ID_INTERFACE_Client, PW_VERSION_CLIENT, + PW_TYPE_INTERFACE_Client, PW_VERSION_CLIENT, properties, client); if (client->global == NULL) diff --git a/src/pipewire/core.c b/src/pipewire/core.c index 337d5edb2..be13d8d45 100644 --- a/src/pipewire/core.c +++ b/src/pipewire/core.c @@ -148,7 +148,7 @@ static void core_get_registry(void *object, uint32_t version, uint32_t new_id) registry_resource = pw_resource_new(client, new_id, PW_PERM_RWX, - PW_ID_INTERFACE_Registry, + PW_TYPE_INTERFACE_Registry, version, sizeof(*data)); if (registry_resource == NULL) @@ -377,11 +377,11 @@ struct pw_core *pw_core_new(struct pw_loop *main_loop, struct pw_properties *pro pw_map_init(&this->globals, 128, 32); - this->support[0] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_DataLoop, this->data_loop->loop); - this->support[1] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_MainLoop, this->main_loop->loop); - this->support[2] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_LoopUtils, this->main_loop->utils); - this->support[3] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_Log, pw_log_get()); - this->support[4] = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_DBus, pw_get_spa_dbus(this->main_loop)); + this->support[0] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_DataLoop, this->data_loop->loop); + this->support[1] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_MainLoop, this->main_loop->loop); + this->support[2] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_LoopUtils, this->main_loop->utils); + this->support[3] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_Log, pw_log_get()); + this->support[4] = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_DBus, pw_get_spa_dbus(this->main_loop)); this->n_support = 5; pw_data_loop_start(this->data_loop_impl); @@ -419,7 +419,7 @@ struct pw_core *pw_core_new(struct pw_loop *main_loop, struct pw_properties *pro this->sc_pagesize = sysconf(_SC_PAGESIZE); this->global = pw_global_new(this, - PW_ID_INTERFACE_Core, + PW_TYPE_INTERFACE_Core, PW_VERSION_CORE, pw_properties_new( PW_CORE_PROP_USER_NAME, this->info.user_name, diff --git a/src/pipewire/factory.c b/src/pipewire/factory.c index e7688f6b9..9e5dcef3b 100644 --- a/src/pipewire/factory.c +++ b/src/pipewire/factory.c @@ -156,7 +156,7 @@ int pw_factory_register(struct pw_factory *factory, factory->registered = true; factory->global = pw_global_new(core, - PW_ID_INTERFACE_Factory, PW_VERSION_FACTORY, + PW_TYPE_INTERFACE_Factory, PW_VERSION_FACTORY, properties, factory); if (factory->global == NULL) diff --git a/src/pipewire/link.c b/src/pipewire/link.c index acc81a214..fdbe2a6e6 100644 --- a/src/pipewire/link.c +++ b/src/pipewire/link.c @@ -381,7 +381,7 @@ static int alloc_buffers(struct pw_link *this, /* collect metadata */ for (i = 0; i < n_params; i++) { - if (spa_pod_is_object_type (params[i], SPA_ID_OBJECT_ParamMeta)) { + if (spa_pod_is_object_type (params[i], SPA_TYPE_OBJECT_ParamMeta)) { uint32_t type, size; if (spa_pod_object_parse(params[i], @@ -657,7 +657,7 @@ static int do_allocation(struct pw_link *this, uint32_t in_state, uint32_t out_s max_buffers = MAX_BUFFERS; minsize = stride = 0; - param = find_param(params, n_params, SPA_ID_OBJECT_ParamBuffers); + param = find_param(params, n_params, SPA_TYPE_OBJECT_ParamBuffers); if (param) { uint32_t qmax_buffers = max_buffers, qminsize = minsize, qstride = stride; @@ -1328,7 +1328,7 @@ int pw_link_register(struct pw_link *link, link->registered = true; link->global = pw_global_new(core, - PW_ID_INTERFACE_Link, PW_VERSION_LINK, + PW_TYPE_INTERFACE_Link, PW_VERSION_LINK, properties, link); if (link->global == NULL) diff --git a/src/pipewire/loop.c b/src/pipewire/loop.c index 2340cc895..4b4988bc1 100644 --- a/src/pipewire/loop.c +++ b/src/pipewire/loop.c @@ -20,7 +20,6 @@ #include #include -#include #include #include @@ -77,25 +76,25 @@ struct pw_loop *pw_loop_new(struct pw_properties *properties) } if ((res = spa_handle_get_interface(impl->handle, - SPA_ID_INTERFACE_Loop, + SPA_TYPE_INTERFACE_Loop, &iface)) < 0) { - fprintf(stderr, "can't get %s interface %d\n", SPA_TYPE__Loop, res); + fprintf(stderr, "can't get Loop interface %d\n", res); goto failed; } this->loop = iface; if ((res = spa_handle_get_interface(impl->handle, - SPA_ID_INTERFACE_LoopControl, + SPA_TYPE_INTERFACE_LoopControl, &iface)) < 0) { - fprintf(stderr, "can't get %s interface %d\n", SPA_TYPE__LoopControl, res); + fprintf(stderr, "can't get LoopControl interface %d\n", res); goto failed; } this->control = iface; if ((res = spa_handle_get_interface(impl->handle, - SPA_ID_INTERFACE_LoopUtils, + SPA_TYPE_INTERFACE_LoopUtils, &iface)) < 0) { - fprintf(stderr, "can't get %s interface %d\n", SPA_TYPE__LoopUtils, res); + fprintf(stderr, "can't get LoopUtils interface %d\n", res); goto failed; } this->utils = iface; diff --git a/src/pipewire/module.c b/src/pipewire/module.c index ffbe3cd25..250dd9b4c 100644 --- a/src/pipewire/module.c +++ b/src/pipewire/module.c @@ -238,7 +238,7 @@ pw_module_load(struct pw_core *core, spa_list_append(&core->module_list, &this->link); this->global = pw_global_new(core, - PW_ID_INTERFACE_Module, PW_VERSION_MODULE, + PW_TYPE_INTERFACE_Module, PW_VERSION_MODULE, pw_properties_new( PW_MODULE_PROP_NAME, name, NULL), diff --git a/src/pipewire/node.c b/src/pipewire/node.c index 914ced350..c3b11385f 100644 --- a/src/pipewire/node.c +++ b/src/pipewire/node.c @@ -354,7 +354,7 @@ int pw_node_register(struct pw_node *this, this->registered = true; this->global = pw_global_new(core, - PW_ID_INTERFACE_Node, PW_VERSION_NODE, + PW_TYPE_INTERFACE_Node, PW_VERSION_NODE, properties, this); if (this->global == NULL) diff --git a/src/pipewire/pipewire.c b/src/pipewire/pipewire.c index 18f297ecc..ba20e6c1a 100644 --- a/src/pipewire/pipewire.c +++ b/src/pipewire/pipewire.c @@ -379,9 +379,9 @@ int pw_unload_spa_interface(void *iface) void *pw_get_spa_dbus(struct pw_loop *loop) { - struct spa_support support = SPA_SUPPORT_INIT(SPA_ID_INTERFACE_LoopUtils, loop->utils); + struct spa_support support = SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_LoopUtils, loop->utils); - return pw_load_spa_interface("support/libspa-dbus", "dbus", SPA_ID_INTERFACE_DBus, + return pw_load_spa_interface("support/libspa-dbus", "dbus", SPA_TYPE_INTERFACE_DBus, NULL, 1, &support); } @@ -430,11 +430,11 @@ void pw_init(int *argc, char **argv[]) items[0] = SPA_DICT_ITEM_INIT("log.colors", "1"); info = SPA_DICT_INIT(items, 1); - iface = load_interface(plugin, "logger", SPA_ID_INTERFACE_Log, &info, + iface = load_interface(plugin, "logger", SPA_TYPE_INTERFACE_Log, &info, support->n_support, support->support); if (iface != NULL) { support->support[support->n_support++] = - SPA_SUPPORT_INIT(SPA_ID_INTERFACE_Log, iface->iface); + SPA_SUPPORT_INIT(SPA_TYPE_INTERFACE_Log, iface->iface); pw_log_set(iface->iface); } pw_log_info("version %s", pw_get_library_version()); diff --git a/src/pipewire/port.c b/src/pipewire/port.c index c6215e487..2b0cf8713 100644 --- a/src/pipewire/port.c +++ b/src/pipewire/port.c @@ -443,7 +443,7 @@ int pw_port_register(struct pw_port *port, struct pw_core *core = node->core; port->global = pw_global_new(core, - PW_ID_INTERFACE_Port, PW_VERSION_PORT, + PW_TYPE_INTERFACE_Port, PW_VERSION_PORT, properties, port); if (port->global == NULL) diff --git a/src/pipewire/remote.c b/src/pipewire/remote.c index f0707f81d..88979d396 100644 --- a/src/pipewire/remote.c +++ b/src/pipewire/remote.c @@ -359,7 +359,7 @@ static int do_connect(struct pw_remote *remote) dummy.remote = remote; remote->core_proxy = (struct pw_core_proxy*)pw_proxy_new(&dummy, - PW_ID_INTERFACE_Core, PW_VERSION_CORE); + PW_TYPE_INTERFACE_Core, PW_VERSION_CORE); if (remote->core_proxy == NULL) goto no_proxy; @@ -1355,7 +1355,7 @@ struct pw_proxy *pw_remote_export(struct pw_remote *remote, proxy = pw_core_proxy_create_object(remote->core_proxy, "client-node", - PW_ID_INTERFACE_ClientNode, + PW_TYPE_INTERFACE_ClientNode, PW_VERSION_CLIENT_NODE, &node->properties->dict, sizeof(struct node_data)); diff --git a/src/pipewire/stream.c b/src/pipewire/stream.c index 0214d2184..21ee7dab6 100644 --- a/src/pipewire/stream.c +++ b/src/pipewire/stream.c @@ -400,7 +400,7 @@ static int impl_port_enum_params(struct spa_node *node, if (last_id == SPA_ID_INVALID){ *result = spa_pod_builder_object(builder, - id, SPA_ID_OBJECT_ParamList, + SPA_TYPE_OBJECT_ParamList, id, ":", SPA_PARAM_LIST_id, "I", new_id); last_id = new_id; } @@ -433,7 +433,7 @@ static int port_set_format(struct spa_node *node, spa_debug_format(2, NULL, format); clear_params(stream, PARAM_TYPE_FORMAT); - if (spa_pod_is_object_type(format, SPA_ID_OBJECT_Format)) { + if (spa_pod_is_object_type(format, SPA_TYPE_OBJECT_Format)) { p = add_param(stream, PARAM_TYPE_FORMAT, format); if (p == NULL) goto no_mem; diff --git a/src/pipewire/type.h b/src/pipewire/type.h index f704f6f93..975395e7b 100644 --- a/src/pipewire/type.h +++ b/src/pipewire/type.h @@ -33,22 +33,22 @@ extern "C" { #include enum { - PW_ID_FIRST = SPA_ID_VENDOR_PipeWire, + PW_TYPE_FIRST = SPA_TYPE_VENDOR_PipeWire, - PW_ID_INTERFACE_Core, - PW_ID_INTERFACE_Registry, - PW_ID_INTERFACE_Node, - PW_ID_INTERFACE_Port, - PW_ID_INTERFACE_Factory, - PW_ID_INTERFACE_Link, - PW_ID_INTERFACE_Client, - PW_ID_INTERFACE_Module, - PW_ID_INTERFACE_ClientNode, + PW_TYPE_INTERFACE_Core, + PW_TYPE_INTERFACE_Registry, + PW_TYPE_INTERFACE_Node, + PW_TYPE_INTERFACE_Port, + PW_TYPE_INTERFACE_Factory, + PW_TYPE_INTERFACE_Link, + PW_TYPE_INTERFACE_Client, + PW_TYPE_INTERFACE_Module, + PW_TYPE_INTERFACE_ClientNode, }; enum { - PW_IO_BASE = PW_ID_FIRST, + PW_IO_BASE = PW_TYPE_FIRST, PW_IO_ClientNodePosition, }; diff --git a/src/tools/pipewire-cli.c b/src/tools/pipewire-cli.c index b4f7c3f59..d0bc8e701 100644 --- a/src/tools/pipewire-cli.c +++ b/src/tools/pipewire-cli.c @@ -367,7 +367,7 @@ static void on_state_changed(void *_data, enum pw_remote_state old, fprintf(stdout, "remote %d state: \"%s\"\n", rd->id, pw_remote_state_as_string(state)); rd->core_proxy = pw_remote_get_core_proxy(rd->remote); rd->registry_proxy = pw_core_proxy_get_registry(rd->core_proxy, - PW_ID_INTERFACE_Registry, + PW_TYPE_INTERFACE_Registry, PW_VERSION_REGISTRY, 0); pw_registry_proxy_add_listener(rd->registry_proxy, &rd->registry_listener, @@ -665,7 +665,7 @@ static void node_event_param(void *object, uint32_t id, uint32_t index, uint32_t fprintf(stdout, "remote %d node %d param %d index %d\n", rd->id, data->global->id, id, index); - if (spa_pod_is_object_type(param, SPA_ID_OBJECT_Format)) + if (spa_pod_is_object_type(param, SPA_TYPE_OBJECT_Format)) spa_debug_format(2, NULL, param); else spa_debug_pod(2, spa_debug_types, param); @@ -702,7 +702,7 @@ static void port_event_param(void *object, uint32_t id, uint32_t index, uint32_t fprintf(stdout, "remote %d port %d param %d index %d\n", rd->id, data->global->id, id, index); - if (spa_pod_is_object_type(param, SPA_ID_OBJECT_Format)) + if (spa_pod_is_object_type(param, SPA_TYPE_OBJECT_Format)) spa_debug_format(2, NULL, param); else spa_debug_pod(2, spa_debug_types, param); @@ -812,43 +812,43 @@ static bool bind_global(struct remote_data *rd, struct global *global, char **er struct pw_proxy *proxy; switch (global->type) { - case PW_ID_INTERFACE_Core: + case PW_TYPE_INTERFACE_Core: events = &core_events; client_version = PW_VERSION_CORE; destroy = (pw_destroy_t) pw_core_info_free; info_func = info_core; break; - case PW_ID_INTERFACE_Module: + case PW_TYPE_INTERFACE_Module: events = &module_events; client_version = PW_VERSION_MODULE; destroy = (pw_destroy_t) pw_module_info_free; info_func = info_module; break; - case PW_ID_INTERFACE_Node: + case PW_TYPE_INTERFACE_Node: events = &node_events; client_version = PW_VERSION_NODE; destroy = (pw_destroy_t) pw_node_info_free; info_func = info_node; break; - case PW_ID_INTERFACE_Port: + case PW_TYPE_INTERFACE_Port: events = &port_events; client_version = PW_VERSION_PORT; destroy = (pw_destroy_t) pw_port_info_free; info_func = info_port; break; - case PW_ID_INTERFACE_Factory: + case PW_TYPE_INTERFACE_Factory: events = &factory_events; client_version = PW_VERSION_FACTORY; destroy = (pw_destroy_t) pw_factory_info_free; info_func = info_factory; break; - case PW_ID_INTERFACE_Client: + case PW_TYPE_INTERFACE_Client: events = &client_events; client_version = PW_VERSION_CLIENT; destroy = (pw_destroy_t) pw_client_info_free; info_func = info_client; break; - case PW_ID_INTERFACE_Link: + case PW_TYPE_INTERFACE_Link: events = &link_events; client_version = PW_VERSION_LINK; destroy = (pw_destroy_t) pw_link_info_free; @@ -957,7 +957,7 @@ static bool do_create_node(struct data *data, const char *cmd, char *args, char props = parse_props(a[1]); proxy = pw_core_proxy_create_object(rd->core_proxy, a[0], - PW_ID_INTERFACE_Node, PW_VERSION_NODE, + PW_TYPE_INTERFACE_Node, PW_VERSION_NODE, props ? &props->dict : NULL, sizeof(struct proxy_data)); @@ -1025,7 +1025,7 @@ static bool do_create_link(struct data *data, const char *cmd, char *args, char proxy = (struct pw_proxy*)pw_core_proxy_create_object(rd->core_proxy, "link-factory", - PW_ID_INTERFACE_Link, + PW_TYPE_INTERFACE_Link, PW_VERSION_LINK, props ? &props->dict : NULL, sizeof(struct proxy_data)); @@ -1070,7 +1070,7 @@ static bool do_export_node(struct data *data, const char *cmd, char *args, char asprintf(error, "object %d does not exist", atoi(a[0])); return false; } - if (pw_global_get_type(global) != PW_ID_INTERFACE_Node) { + if (pw_global_get_type(global) != PW_TYPE_INTERFACE_Node) { asprintf(error, "object %d is not a node", atoi(a[0])); return false; } @@ -1111,7 +1111,7 @@ static bool do_node_params(struct data *data, const char *cmd, char *args, char asprintf(error, "%s: unknown global %d", cmd, id); return false; } - if (global->type != PW_ID_INTERFACE_Node) { + if (global->type != PW_TYPE_INTERFACE_Node) { asprintf(error, "object %d is not a node", atoi(a[0])); return false; } @@ -1145,7 +1145,7 @@ static bool do_port_params(struct data *data, const char *cmd, char *args, char asprintf(error, "%s: unknown global %d", cmd, id); return false; } - if (global->type != PW_ID_INTERFACE_Port) { + if (global->type != PW_TYPE_INTERFACE_Port) { asprintf(error, "object %d is not a port", atoi(a[0])); return false; } diff --git a/src/tools/pipewire-monitor.c b/src/tools/pipewire-monitor.c index 892ea8d47..33f6a6ea7 100644 --- a/src/tools/pipewire-monitor.c +++ b/src/tools/pipewire-monitor.c @@ -217,7 +217,7 @@ static void print_node(struct proxy_data *data) printf("%c\tname: \"%s\"\n", MARK_CHANGE(0), info->name); printf("%c\tparams:\n", MARK_CHANGE(5)); for (i = 0; i < data->n_params; i++) { - if (spa_pod_is_object_type(data->params[i], SPA_ID_OBJECT_Format)) + if (spa_pod_is_object_type(data->params[i], SPA_TYPE_OBJECT_Format)) spa_debug_format(2, NULL, data->params[i]); else spa_debug_pod(2, spa_debug_types, data->params[i]); @@ -292,7 +292,7 @@ static void print_port(struct proxy_data *data) printf("%c\tname: \"%s\"\n", MARK_CHANGE(0), info->name); printf("%c\tparams:\n", MARK_CHANGE(2)); for (i = 0; i < data->n_params; i++) { - if (spa_pod_is_object_type(data->params[i], SPA_ID_OBJECT_Format)) + if (spa_pod_is_object_type(data->params[i], SPA_TYPE_OBJECT_Format)) spa_debug_format(2, NULL, data->params[i]); else spa_debug_pod(2, spa_debug_types, data->params[i]); @@ -473,34 +473,34 @@ static void registry_event_global(void *data, uint32_t id, uint32_t parent_id, pw_destroy_t destroy; print_func_t print_func = NULL; - if (type == PW_ID_INTERFACE_Node) { + if (type == PW_TYPE_INTERFACE_Node) { events = &node_events; client_version = PW_VERSION_NODE; destroy = (pw_destroy_t) pw_node_info_free; print_func = print_node; } - else if (type == PW_ID_INTERFACE_Port) { + else if (type == PW_TYPE_INTERFACE_Port) { events = &port_events; client_version = PW_VERSION_PORT; destroy = (pw_destroy_t) pw_port_info_free; print_func = print_port; } - else if (type == PW_ID_INTERFACE_Module) { + else if (type == PW_TYPE_INTERFACE_Module) { events = &module_events; client_version = PW_VERSION_MODULE; destroy = (pw_destroy_t) pw_module_info_free; } - else if (type == PW_ID_INTERFACE_Factory) { + else if (type == PW_TYPE_INTERFACE_Factory) { events = &factory_events; client_version = PW_VERSION_FACTORY; destroy = (pw_destroy_t) pw_factory_info_free; } - else if (type == PW_ID_INTERFACE_Client) { + else if (type == PW_TYPE_INTERFACE_Client) { events = &client_events; client_version = PW_VERSION_CLIENT; destroy = (pw_destroy_t) pw_client_info_free; } - else if (type == PW_ID_INTERFACE_Link) { + else if (type == PW_TYPE_INTERFACE_Link) { events = &link_events; client_version = PW_VERSION_LINK; destroy = (pw_destroy_t) pw_link_info_free; @@ -572,7 +572,7 @@ static void on_state_changed(void *_data, enum pw_remote_state old, data->core_proxy = pw_remote_get_core_proxy(data->remote); data->registry_proxy = pw_core_proxy_get_registry(data->core_proxy, - PW_ID_INTERFACE_Registry, + PW_TYPE_INTERFACE_Registry, PW_VERSION_REGISTRY, 0); pw_registry_proxy_add_listener(data->registry_proxy, &data->registry_listener,