diff --git a/spa/include/spa/debug/format.h b/spa/include/spa/debug/format.h index 74c8b62bb..5fe0eac3e 100644 --- a/spa/include/spa/debug/format.h +++ b/spa/include/spa/debug/format.h @@ -128,7 +128,7 @@ SPA_API_DEBUG_FORMAT int spa_debugc_format(struct spa_debug_context *ctx, int in if (info == NULL) info = spa_type_format; - if (format == NULL || SPA_POD_TYPE(format) != SPA_TYPE_Object) + if (format == NULL || format->type != SPA_TYPE_Object) return -EINVAL; if (spa_format_parse(format, &mtype, &mstype) < 0) diff --git a/spa/include/spa/pod/iter.h b/spa/include/spa/pod/iter.h index 0dcf514f8..826ac0d86 100644 --- a/spa/include/spa/pod/iter.h +++ b/spa/include/spa/pod/iter.h @@ -270,7 +270,7 @@ SPA_API_POD_ITER int spa_pod_get_bytes(const struct spa_pod *pod, const void **v if (!spa_pod_is_bytes(pod)) return -EINVAL; *value = (const void *)SPA_POD_CONTENTS(struct spa_pod_bytes, pod); - *len = SPA_POD_BODY_SIZE(pod); + *len = pod->size; return 0; } diff --git a/spa/include/spa/pod/parser.h b/spa/include/spa/pod/parser.h index a3a5527bc..9c128f26a 100644 --- a/spa/include/spa/pod/parser.h +++ b/spa/include/spa/pod/parser.h @@ -281,7 +281,7 @@ SPA_API_POD_PARSER bool spa_pod_parser_can_collect(const struct spa_pod *pod, ch if (pod == NULL) return false; - if (SPA_POD_TYPE(pod) == SPA_TYPE_Choice) { + if (pod->type == SPA_TYPE_Choice) { if (!spa_pod_is_choice(pod)) return false; if (type == 'V') diff --git a/spa/plugins/audioconvert/audioadapter.c b/spa/plugins/audioconvert/audioadapter.c index e9ff63009..b904923ac 100644 --- a/spa/plugins/audioconvert/audioadapter.c +++ b/spa/plugins/audioconvert/audioadapter.c @@ -918,7 +918,7 @@ static struct spa_pod *merge_objects(struct impl *this, struct spa_pod_builder * struct spa_pod_builder_state state; int res = 0; - if (o2 == NULL || SPA_POD_TYPE(o1) != SPA_POD_TYPE(o2)) + if (o2 == NULL || o1->pod.type != o2->pod.type) return (struct spa_pod*)o1; spa_pod_builder_push_object(b, &f, o1->body.type, o1->body.id); diff --git a/spa/plugins/v4l2/v4l2-utils.c b/spa/plugins/v4l2/v4l2-utils.c index 2c8a88443..96a5d73ed 100644 --- a/spa/plugins/v4l2/v4l2-utils.c +++ b/spa/plugins/v4l2/v4l2-utils.c @@ -1585,7 +1585,7 @@ spa_v4l2_set_control(struct impl *this, uint32_t id, if ((res = spa_v4l2_open(dev, this->props.device)) < 0) return res; - switch (SPA_POD_TYPE(&prop->value)) { + switch (prop->value.type) { case SPA_TYPE_Bool: { bool val; diff --git a/spa/plugins/videoconvert/videoadapter.c b/spa/plugins/videoconvert/videoadapter.c index 84a24cd2d..ccf9365f3 100644 --- a/spa/plugins/videoconvert/videoadapter.c +++ b/spa/plugins/videoconvert/videoadapter.c @@ -969,7 +969,7 @@ static struct spa_pod *merge_objects(struct impl *this, struct spa_pod_builder * struct spa_pod_builder_state state; int res = 0; - if (o2 == NULL || SPA_POD_TYPE(o1) != SPA_POD_TYPE(o2)) + if (o2 == NULL || o1->pod.type != o2->pod.type) return (struct spa_pod*)o1; spa_pod_builder_push_object(b, &f, o1->body.type, o1->body.id); diff --git a/spa/plugins/videoconvert/videoconvert-ffmpeg.c b/spa/plugins/videoconvert/videoconvert-ffmpeg.c index 9ab8fddeb..3a0f3903c 100644 --- a/spa/plugins/videoconvert/videoconvert-ffmpeg.c +++ b/spa/plugins/videoconvert/videoconvert-ffmpeg.c @@ -1286,7 +1286,7 @@ static int diff_prop(struct impl *impl, struct spa_pod_prop *prop, void *vals, *v, *best = NULL; int res = INT_MAX; - if (SPA_POD_TYPE(val) != type) + if (val->type != type) return -EINVAL; size = SPA_POD_BODY_SIZE(val); diff --git a/src/modules/module-protocol-native/v0/protocol-native.c b/src/modules/module-protocol-native/v0/protocol-native.c index 862d9eda1..04ad349be 100644 --- a/src/modules/module-protocol-native/v0/protocol-native.c +++ b/src/modules/module-protocol-native/v0/protocol-native.c @@ -646,10 +646,11 @@ struct spa_pod * pw_protocol_native0_pod_from_v2(struct pw_impl_client *client, if (pod == NULL) return NULL; - if ((res = remap_from_v2(SPA_POD_TYPE(pod), - SPA_POD_BODY(pod), - SPA_POD_BODY_SIZE(pod), - client, &b)) < 0) { + if ((res = remap_from_v2(pod->type, + SPA_POD_BODY(pod), + pod->size, + client, + &b)) < 0) { errno = -res; return NULL; } @@ -669,9 +670,9 @@ int pw_protocol_native0_pod_to_v2(struct pw_impl_client *client, const struct sp } if ((res = remap_to_v2(client, pw_type_info(), - SPA_POD_TYPE(pod), + pod->type, SPA_POD_BODY(pod), - SPA_POD_BODY_SIZE(pod), + pod->size, b)) < 0) { return -res; } diff --git a/src/modules/module-protocol-pulse/collect.c b/src/modules/module-protocol-pulse/collect.c index 189008019..720577216 100644 --- a/src/modules/module-protocol-pulse/collect.c +++ b/src/modules/module-protocol-pulse/collect.c @@ -524,8 +524,8 @@ uint32_t collect_transport_codec_info(struct pw_manager_object *card, if (iid != SPA_PROP_bluetoothAudioCodec) continue; - if (SPA_POD_CHOICE_TYPE(type) != SPA_CHOICE_Enum || - SPA_POD_TYPE(SPA_POD_CHOICE_CHILD(type)) != SPA_TYPE_Int) + if (type->body.type != SPA_CHOICE_Enum || + type->body.child.type != SPA_TYPE_Int) continue; /* diff --git a/src/pipewire/stream.c b/src/pipewire/stream.c index 44c1d3a27..d24a446c1 100644 --- a/src/pipewire/stream.c +++ b/src/pipewire/stream.c @@ -1278,7 +1278,7 @@ static int node_event_param(void *object, int seq, return -EINVAL; } - c->type = SPA_POD_TYPE(pod); + c->type = pod->type; if (spa_pod_is_float(pod)) vals = SPA_POD_BODY(pod); else if (spa_pod_is_double(pod)) { diff --git a/src/tools/pw-dump.c b/src/tools/pw-dump.c index b18928b79..e04cf74e1 100644 --- a/src/tools/pw-dump.c +++ b/src/tools/pw-dump.c @@ -511,10 +511,8 @@ static void put_pod(struct data *d, const char *key, const struct spa_pod *pod) if (pod == NULL) { put_value(d, key, NULL); } else { - put_pod_value(d, key, SPA_TYPE_ROOT, - SPA_POD_TYPE(pod), - SPA_POD_BODY(pod), - SPA_POD_BODY_SIZE(pod)); + put_pod_value(d, key, SPA_TYPE_ROOT, pod->type, + SPA_POD_BODY(pod), pod->size); } }