command: make commands dynamic

Ensure format object type.
This commit is contained in:
Wim Taymans 2017-03-22 10:04:24 +01:00
parent 4d9f2c5161
commit c44a7c9735
36 changed files with 549 additions and 604 deletions

View file

@ -32,21 +32,22 @@ extern "C" {
static inline uint32_t
spa_pod_builder_push_format (SpaPODBuilder *builder,
SpaPODFrame *frame,
uint32_t format_type,
uint32_t media_type,
uint32_t media_subtype)
{
const SpaFormat p = { { sizeof (SpaFormatBody), SPA_POD_TYPE_OBJECT },
{ { 0, 0 },
{ { 0, format_type },
{ { sizeof (uint32_t), SPA_POD_TYPE_URI }, media_type },
{ { sizeof (uint32_t), SPA_POD_TYPE_URI }, media_subtype } } };
return spa_pod_builder_push (builder, frame, &p.pod,
spa_pod_builder_raw (builder, &p, sizeof(p)));
}
#define spa_pod_builder_format(b,f,media_type,media_subtype,...) \
spa_pod_builder_object(b, f, 0, 0, \
SPA_POD_TYPE_URI,media_type, \
SPA_POD_TYPE_URI,media_subtype, \
#define spa_pod_builder_format(b,f,format_type,media_type,media_subtype,...) \
spa_pod_builder_object(b, f, 0, format_type, \
SPA_POD_TYPE_URI,media_type, \
SPA_POD_TYPE_URI,media_subtype, \
__VA_ARGS__)
SpaResult