improve props test

This commit is contained in:
Wim Taymans 2017-05-26 20:52:04 +02:00
parent ded1ea69a1
commit cf94117244
4 changed files with 92 additions and 75 deletions

View file

@ -29,6 +29,12 @@ extern "C" {
#include <spa/format.h>
#include <spa/pod-builder.h>
#define SPA_FORMAT_INIT(size,type,media_type,media_subtype,...) \
{ { size, SPA_POD_TYPE_OBJECT }, \
{ { 0, type }, \
SPA_POD_ID_INIT(media_type), \
SPA_POD_ID_INIT(media_subtype) } }
static inline uint32_t
spa_pod_builder_push_format(struct spa_pod_builder *builder,
struct spa_pod_frame *frame,
@ -36,10 +42,8 @@ spa_pod_builder_push_format(struct spa_pod_builder *builder,
uint32_t media_type,
uint32_t media_subtype)
{
const struct spa_format p = {
{sizeof(struct spa_format_body), SPA_POD_TYPE_OBJECT}, {{0, format_type},
{{sizeof(uint32_t), SPA_POD_TYPE_ID}, media_type},
{{sizeof(uint32_t), SPA_POD_TYPE_ID}, media_subtype} } };
const struct spa_format p = SPA_FORMAT_INIT(sizeof(struct spa_format_body),
0, format_type, media_type, media_subtype);
return spa_pod_builder_push(builder, frame, &p.pod,
spa_pod_builder_raw(builder, &p, sizeof(p)));
}