Make media type and subtype properties

This is easier to debug and we only want properties in objects
in the future.
This commit is contained in:
Wim Taymans 2018-08-29 18:08:52 +02:00
parent 514528f2c7
commit ff6a244d8f
45 changed files with 151 additions and 124 deletions

View file

@ -47,8 +47,8 @@ spa_format_audio_raw_build(struct spa_pod_builder *builder, uint32_t id, struct
{
return spa_pod_builder_object(builder,
SPA_TYPE_OBJECT_Format, id,
"I", SPA_MEDIA_TYPE_audio,
"I", SPA_MEDIA_SUBTYPE_raw,
":", SPA_FORMAT_mediaType, "I", SPA_MEDIA_TYPE_audio,
":", SPA_FORMAT_mediaSubtype, "I", SPA_MEDIA_SUBTYPE_raw,
":", SPA_FORMAT_AUDIO_format, "I", info->format,
":", SPA_FORMAT_AUDIO_layout, "I", info->layout,
":", SPA_FORMAT_AUDIO_rate, "i", info->rate,

View file

@ -122,22 +122,21 @@ enum spa_audio_format {
};
/** Extra audio flags */
enum spa_audio_flags {
SPA_AUDIO_FLAG_NONE = 0, /*< no valid flag */
SPA_AUDIO_FLAG_UNPOSITIONED = (1 << 0), /*< the position array explicitly
#define SPA_AUDIO_FLAG_NONE (0) /*< no valid flag */
#define SPA_AUDIO_FLAG_UNPOSITIONED (1 << 0) /*< the position array explicitly
* contains unpositioned channels. */
};
/** Layout of the audio samples for the different channels. */
enum spa_audio_layout {
SPA_AUDIO_LAYOUT_INTERLEAVED = 0, /*< interleaved audio */
SPA_AUDIO_LAYOUT_NON_INTERLEAVED /*< non-interleaved audio */
SPA_AUDIO_LAYOUT_INVALID,
SPA_AUDIO_LAYOUT_INTERLEAVED, /*< interleaved audio */
SPA_AUDIO_LAYOUT_NON_INTERLEAVED, /*< non-interleaved audio */
};
/** Audio information description */
struct spa_audio_info_raw {
enum spa_audio_format format; /*< format, one of enum spa_audio_format */
enum spa_audio_flags flags; /*< extra flags */
uint32_t flags; /*< extra flags */
enum spa_audio_layout layout; /*< sample layout */
uint32_t rate; /*< sample rate */
uint32_t channels; /*< number of channels */

View file

@ -78,8 +78,9 @@ static const struct spa_type_info spa_type_audio_flags[] = {
#define SPA_TYPE_AUDIO_ENUM_BASE SPA_TYPE__AudioLayout ":"
static const struct spa_type_info spa_type_audio_layout[] = {
{ SPA_AUDIO_LAYOUT_INTERLEAVED, SPA_TYPE_AUDIO_ENUM_BASE "interleaved", SPA_TYPE_Int, },
{ SPA_AUDIO_LAYOUT_NON_INTERLEAVED, SPA_TYPE_AUDIO_ENUM_BASE "non-interleaved", SPA_TYPE_Int, },
{ SPA_AUDIO_LAYOUT_INVALID, SPA_TYPE_AUDIO_ENUM_BASE "Invalid", SPA_TYPE_Int, },
{ SPA_AUDIO_LAYOUT_INTERLEAVED, SPA_TYPE_AUDIO_ENUM_BASE "Interleaved", SPA_TYPE_Int, },
{ SPA_AUDIO_LAYOUT_NON_INTERLEAVED, SPA_TYPE_AUDIO_ENUM_BASE "Non-Interleaved", SPA_TYPE_Int, },
{ 0, NULL, },
};