format: improve format parsing

This commit is contained in:
Wim Taymans 2017-03-24 18:11:11 +01:00
parent 94019fb1f5
commit 29cb7bf39a
30 changed files with 459 additions and 406 deletions

View file

@ -50,8 +50,21 @@ spa_type_format_audio_map (SpaTypeMap *map, SpaTypeFormatAudio *type)
}
}
SpaResult spa_format_audio_parse (const SpaFormat *format,
SpaAudioInfo *info);
static inline bool
spa_format_audio_raw_parse (const SpaFormat *format,
SpaAudioInfoRaw *info,
SpaTypeFormatAudio *type)
{
spa_format_query (format,
type->format, SPA_POD_TYPE_ID, &info->format,
type->flags, SPA_POD_TYPE_INT, &info->flags,
type->layout, SPA_POD_TYPE_INT, &info->layout,
type->rate, SPA_POD_TYPE_INT, &info->rate,
type->channels, SPA_POD_TYPE_INT, &info->channels,
type->channel_mask, SPA_POD_TYPE_INT, &info->channel_mask,
0);
return true;
}
#ifdef __cplusplus
} /* extern "C" */