mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-01-02 11:08:48 -05:00
types: work on types
Move static pod types to type system work on type info for types Move the event and command ids to an enum to make it easier to extend later.
This commit is contained in:
parent
fca3e1d85d
commit
805e3bb6c1
82 changed files with 812 additions and 924 deletions
|
|
@ -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_POD_TYPE_PROP
|
||||
if (res->type == SPA_ID_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_POD_TYPE_OBJECT)
|
||||
if (pod->type == SPA_ID_Object)
|
||||
offset = sizeof(struct spa_pod_object);
|
||||
else if (pod->type == SPA_POD_TYPE_STRUCT)
|
||||
else if (pod->type == SPA_ID_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_POD_TYPE_OBJECT)
|
||||
if (pod->type == SPA_ID_Object)
|
||||
offset = sizeof(struct spa_pod_object);
|
||||
else if (pod->type == SPA_POD_TYPE_STRUCT)
|
||||
else if (pod->type == SPA_ID_Struct)
|
||||
offset = sizeof(struct spa_pod_struct);
|
||||
else
|
||||
return -EINVAL;
|
||||
|
||||
SPA_POD_CONTENTS_FOREACH(pod, offset, res) {
|
||||
if (res->type == SPA_POD_TYPE_PROP)
|
||||
if (res->type == SPA_ID_Prop)
|
||||
SPA_FLAG_UNSET (((struct spa_pod_prop *) res)->body.flags,
|
||||
SPA_POD_PROP_FLAG_UNSET);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue