MAKE_FORMAT (S8, SINT, 0, 8, 8, SILENT_0),
MAKE_FORMAT (U8, UINT, 0, 8, 8, SILENT_U8),
/* 16 bit */
- MAKE_FORMAT (S16_LE, SINT, G_LITTLE_ENDIAN, 16, 16, SILENT_0),
- MAKE_FORMAT (S16_BE, SINT, G_BIG_ENDIAN, 16, 16, SILENT_0),
- MAKE_FORMAT (U16_LE, UINT, G_LITTLE_ENDIAN, 16, 16, SILENT_U16_LE),
- MAKE_FORMAT (U16_BE, UINT, G_BIG_ENDIAN, 16, 16, SILENT_U16_BE),
+ MAKE_FORMAT (S16LE, SINT, G_LITTLE_ENDIAN, 16, 16, SILENT_0),
+ MAKE_FORMAT (S16BE, SINT, G_BIG_ENDIAN, 16, 16, SILENT_0),
+ MAKE_FORMAT (U16LE, UINT, G_LITTLE_ENDIAN, 16, 16, SILENT_U16_LE),
+ MAKE_FORMAT (U16BE, UINT, G_BIG_ENDIAN, 16, 16, SILENT_U16_BE),
/* 24 bit in low 3 bytes of 32 bits */
- MAKE_FORMAT (S24_LE, SINT, G_LITTLE_ENDIAN, 32, 24, SILENT_0),
- MAKE_FORMAT (S24_BE, SINT, G_BIG_ENDIAN, 32, 24, SILENT_0),
- MAKE_FORMAT (U24_LE, UINT, G_LITTLE_ENDIAN, 32, 24, SILENT_U24_LE),
- MAKE_FORMAT (U24_BE, UINT, G_BIG_ENDIAN, 32, 24, SILENT_U24_BE),
+ MAKE_FORMAT (S24_32LE, SINT, G_LITTLE_ENDIAN, 32, 24, SILENT_0),
+ MAKE_FORMAT (S24_32BE, SINT, G_BIG_ENDIAN, 32, 24, SILENT_0),
+ MAKE_FORMAT (U24_32LE, UINT, G_LITTLE_ENDIAN, 32, 24, SILENT_U24_LE),
+ MAKE_FORMAT (U24_32BE, UINT, G_BIG_ENDIAN, 32, 24, SILENT_U24_BE),
/* 32 bit */
- MAKE_FORMAT (S32_LE, SINT, G_LITTLE_ENDIAN, 32, 32, SILENT_0),
- MAKE_FORMAT (S32_BE, SINT, G_BIG_ENDIAN, 32, 32, SILENT_0),
- MAKE_FORMAT (U32_LE, UINT, G_LITTLE_ENDIAN, 32, 32, SILENT_U32_LE),
- MAKE_FORMAT (U32_BE, UINT, G_BIG_ENDIAN, 32, 32, SILENT_U32_BE),
+ MAKE_FORMAT (S32LE, SINT, G_LITTLE_ENDIAN, 32, 32, SILENT_0),
+ MAKE_FORMAT (S32BE, SINT, G_BIG_ENDIAN, 32, 32, SILENT_0),
+ MAKE_FORMAT (U32LE, UINT, G_LITTLE_ENDIAN, 32, 32, SILENT_U32_LE),
+ MAKE_FORMAT (U32BE, UINT, G_BIG_ENDIAN, 32, 32, SILENT_U32_BE),
/* 24 bit in 3 bytes */
- MAKE_FORMAT (S24_3LE, SINT, G_LITTLE_ENDIAN, 24, 24, SILENT_0),
- MAKE_FORMAT (S24_3BE, SINT, G_BIG_ENDIAN, 24, 24, SILENT_0),
- MAKE_FORMAT (U24_3LE, UINT, G_LITTLE_ENDIAN, 24, 24, SILENT_U24_3LE),
- MAKE_FORMAT (U24_3BE, UINT, G_BIG_ENDIAN, 24, 24, SILENT_U24_3BE),
+ MAKE_FORMAT (S24LE, SINT, G_LITTLE_ENDIAN, 24, 24, SILENT_0),
+ MAKE_FORMAT (S24BE, SINT, G_BIG_ENDIAN, 24, 24, SILENT_0),
+ MAKE_FORMAT (U24LE, UINT, G_LITTLE_ENDIAN, 24, 24, SILENT_U24_3LE),
+ MAKE_FORMAT (U24BE, UINT, G_BIG_ENDIAN, 24, 24, SILENT_U24_3BE),
/* 20 bit in 3 bytes */
- MAKE_FORMAT (S20_3LE, SINT, G_LITTLE_ENDIAN, 24, 20, SILENT_0),
- MAKE_FORMAT (S20_3BE, SINT, G_BIG_ENDIAN, 24, 20, SILENT_0),
- MAKE_FORMAT (U20_3LE, UINT, G_LITTLE_ENDIAN, 24, 20, SILENT_U20_3LE),
- MAKE_FORMAT (U20_3BE, UINT, G_BIG_ENDIAN, 24, 20, SILENT_U20_3BE),
+ MAKE_FORMAT (S20LE, SINT, G_LITTLE_ENDIAN, 24, 20, SILENT_0),
+ MAKE_FORMAT (S20BE, SINT, G_BIG_ENDIAN, 24, 20, SILENT_0),
+ MAKE_FORMAT (U20LE, UINT, G_LITTLE_ENDIAN, 24, 20, SILENT_U20_3LE),
+ MAKE_FORMAT (U20BE, UINT, G_BIG_ENDIAN, 24, 20, SILENT_U20_3BE),
/* 18 bit in 3 bytes */
- MAKE_FORMAT (S18_3LE, SINT, G_LITTLE_ENDIAN, 24, 18, SILENT_0),
- MAKE_FORMAT (S18_3BE, SINT, G_BIG_ENDIAN, 24, 18, SILENT_0),
- MAKE_FORMAT (U18_3LE, UINT, G_LITTLE_ENDIAN, 24, 18, SILENT_U18_3LE),
- MAKE_FORMAT (U18_3BE, UINT, G_BIG_ENDIAN, 24, 18, SILENT_U18_3BE),
+ MAKE_FORMAT (S18LE, SINT, G_LITTLE_ENDIAN, 24, 18, SILENT_0),
+ MAKE_FORMAT (S18BE, SINT, G_BIG_ENDIAN, 24, 18, SILENT_0),
+ MAKE_FORMAT (U18LE, UINT, G_LITTLE_ENDIAN, 24, 18, SILENT_U18_3LE),
+ MAKE_FORMAT (U18BE, UINT, G_BIG_ENDIAN, 24, 18, SILENT_U18_3BE),
/* float */
- MAKE_FORMAT (F32_LE, GST_AUDIO_FORMAT_FLAG_FLOAT, G_LITTLE_ENDIAN, 32, 32,
+ MAKE_FORMAT (F32LE, GST_AUDIO_FORMAT_FLAG_FLOAT, G_LITTLE_ENDIAN, 32, 32,
SILENT_0),
- MAKE_FORMAT (F32_BE, GST_AUDIO_FORMAT_FLAG_FLOAT, G_BIG_ENDIAN, 32, 32,
+ MAKE_FORMAT (F32BE, GST_AUDIO_FORMAT_FLAG_FLOAT, G_BIG_ENDIAN, 32, 32,
SILENT_0),
- MAKE_FORMAT (F64_LE, GST_AUDIO_FORMAT_FLAG_FLOAT, G_LITTLE_ENDIAN, 64, 64,
+ MAKE_FORMAT (F64LE, GST_AUDIO_FORMAT_FLAG_FLOAT, G_LITTLE_ENDIAN, 64, 64,
SILENT_0),
- MAKE_FORMAT (F64_BE, GST_AUDIO_FORMAT_FLAG_FLOAT, G_BIG_ENDIAN, 64, 64,
+ MAKE_FORMAT (F64BE, GST_AUDIO_FORMAT_FLAG_FLOAT, G_BIG_ENDIAN, 64, 64,
SILENT_0)
};
G_BEGIN_DECLS
+#if G_BYTE_ORDER == G_BIG_ENDIAN
+#define _GST_AUDIO_FORMAT_NE(fmt) GST_AUDIO_FORMAT_ ## fmt ## BE
+#elif G_BYTE_ORDER == G_LITTLE_ENDIAN
+#define _GST_AUDIO_FORMAT_NE(fmt) GST_AUDIO_FORMAT_ ## fmt ## LE
+#endif
+
/**
* GstAudioFormat:
* @GST_AUDIO_FORMAT_UNKNOWN: unknown audio format
- * @GST_AUDIO_FORMAT_S8: sample
- * @GST_AUDIO_FORMAT_U8: sample
- * @GST_AUDIO_FORMAT_S16_LE: sample
- * @GST_AUDIO_FORMAT_S16_BE: sample
- * @GST_AUDIO_FORMAT_U16_LE: sample
- * @GST_AUDIO_FORMAT_U16_BE: sample
- * @GST_AUDIO_FORMAT_S24_LE: sample
- * @GST_AUDIO_FORMAT_S24_BE: sample
- * @GST_AUDIO_FORMAT_U24_LE: sample
- * @GST_AUDIO_FORMAT_U24_BE: sample
- * @GST_AUDIO_FORMAT_S32_LE: sample
- * @GST_AUDIO_FORMAT_S32_BE: sample
- * @GST_AUDIO_FORMAT_U32_LE: sample
- * @GST_AUDIO_FORMAT_U32_BE: sample
- * @GST_AUDIO_FORMAT_S24_3LE: sample
- * @GST_AUDIO_FORMAT_S24_3BE: sample
- * @GST_AUDIO_FORMAT_U24_3LE: sample
- * @GST_AUDIO_FORMAT_U24_3BE: sample
- * @GST_AUDIO_FORMAT_S20_3LE: sample
- * @GST_AUDIO_FORMAT_S20_3BE: sample
- * @GST_AUDIO_FORMAT_U20_3LE: sample
- * @GST_AUDIO_FORMAT_U20_3BE: sample
- * @GST_AUDIO_FORMAT_S18_3LE: sample
- * @GST_AUDIO_FORMAT_S18_3BE: sample
- * @GST_AUDIO_FORMAT_U18_3LE: sample
- * @GST_AUDIO_FORMAT_U18_3BE: sample
- * @GST_AUDIO_FORMAT_F32_LE: sample
- * @GST_AUDIO_FORMAT_F32_BE: sample
- * @GST_AUDIO_FORMAT_F64_LE: sample
- * @GST_AUDIO_FORMAT_F64_BE: sample
+ * @GST_AUDIO_FORMAT_S8: 8 bits in 8 bits, signed
+ * @GST_AUDIO_FORMAT_U8: 8 bits in 8 bits, unsigned
+ * @GST_AUDIO_FORMAT_S16LE: 16 bits in 16 bits, signed, little endian
+ * @GST_AUDIO_FORMAT_S16BE: 16 bits in 16 bits, signed, big endian
+ * @GST_AUDIO_FORMAT_U16LE: 16 bits in 16 bits, unsigned, little endian
+ * @GST_AUDIO_FORMAT_U16BE: 16 bits in 16 bits, unsigned, big endian
+ * @GST_AUDIO_FORMAT_S24_32LE: 24 bits in 32 bits, signed, little endian
+ * @GST_AUDIO_FORMAT_S24_32BE: 24 bits in 32 bits, signed, big endian
+ * @GST_AUDIO_FORMAT_U24_32LE: 24 bits in 32 bits, unsigned, little endian
+ * @GST_AUDIO_FORMAT_U24_32BE: 24 bits in 32 bits, unsigned, big endian
+ * @GST_AUDIO_FORMAT_S32LE: 32 bits in 32 bits, signed, little endian
+ * @GST_AUDIO_FORMAT_S32BE: 32 bits in 32 bits, signed, big endian
+ * @GST_AUDIO_FORMAT_U32LE: 32 bits in 32 bits, unsigned, little endian
+ * @GST_AUDIO_FORMAT_U32BE: 32 bits in 32 bits, unsigned, big endian
+ * @GST_AUDIO_FORMAT_S24LE: 24 bits in 24 bits, signed, little endian
+ * @GST_AUDIO_FORMAT_S24BE: 24 bits in 24 bits, signed, big endian
+ * @GST_AUDIO_FORMAT_U24LE: 24 bits in 24 bits, unsigned, little endian
+ * @GST_AUDIO_FORMAT_U24BE: 24 bits in 24 bits, unsigned, big endian
+ * @GST_AUDIO_FORMAT_S20LE: 20 bits in 24 bits, signed, little endian
+ * @GST_AUDIO_FORMAT_S20BE: 20 bits in 24 bits, signed, big endian
+ * @GST_AUDIO_FORMAT_U20LE: 20 bits in 24 bits, unsigned, little endian
+ * @GST_AUDIO_FORMAT_U20BE: 20 bits in 24 bits, unsigned, big endian
+ * @GST_AUDIO_FORMAT_S18LE: 18 bits in 24 bits, signed, little endian
+ * @GST_AUDIO_FORMAT_S18BE: 18 bits in 24 bits, signed, big endian
+ * @GST_AUDIO_FORMAT_U18LE: 18 bits in 24 bits, unsigned, little endian
+ * @GST_AUDIO_FORMAT_U18BE: 18 bits in 24 bits, unsigned, big endian
+ * @GST_AUDIO_FORMAT_F32LE: 32-bit floating point samples, little endian
+ * @GST_AUDIO_FORMAT_F32BE: 32-bit floating point samples, big endian
+ * @GST_AUDIO_FORMAT_F64LE: 64-bit floating point samples, little endian
+ * @GST_AUDIO_FORMAT_F64BE: 64-bit floating point samples, big endian
+ * @GST_AUDIO_FORMAT_S16: 16 bits in 16 bits, signed, native endianness
+ * @GST_AUDIO_FORMAT_U16: 16 bits in 16 bits, unsigned, native endianness
+ * @GST_AUDIO_FORMAT_S24_32: 24 bits in 32 bits, signed, native endianness
+ * @GST_AUDIO_FORMAT_U24_32: 24 bits in 32 bits, unsigned, native endianness
+ * @GST_AUDIO_FORMAT_S32: 32 bits in 32 bits, signed, native endianness
+ * @GST_AUDIO_FORMAT_U32: 32 bits in 32 bits, unsigned, native endianness
+ * @GST_AUDIO_FORMAT_S24: 24 bits in 24 bits, signed, native endianness
+ * @GST_AUDIO_FORMAT_U24: 24 bits in 24 bits, unsigned, native endianness
+ * @GST_AUDIO_FORMAT_S20: 20 bits in 24 bits, signed, native endianness
+ * @GST_AUDIO_FORMAT_U20: 20 bits in 24 bits, unsigned, native endianness
+ * @GST_AUDIO_FORMAT_S18: 18 bits in 24 bits, signed, native endianness
+ * @GST_AUDIO_FORMAT_U18: 18 bits in 24 bits, unsigned, native endianness
+ * @GST_AUDIO_FORMAT_F32: 32-bit floating point samples, native endianness
+ * @GST_AUDIO_FORMAT_F64: 64-bit floating point samples, native endianness
*
* Enum value describing the most common audio formats.
*
GST_AUDIO_FORMAT_S8,
GST_AUDIO_FORMAT_U8,
/* 16 bit */
- GST_AUDIO_FORMAT_S16_LE,
- GST_AUDIO_FORMAT_S16_BE,
- GST_AUDIO_FORMAT_U16_LE,
- GST_AUDIO_FORMAT_U16_BE,
+ GST_AUDIO_FORMAT_S16LE,
+ GST_AUDIO_FORMAT_S16BE,
+ GST_AUDIO_FORMAT_U16LE,
+ GST_AUDIO_FORMAT_U16BE,
/* 24 bit in low 3 bytes of 32 bits*/
- GST_AUDIO_FORMAT_S24_LE,
- GST_AUDIO_FORMAT_S24_BE,
- GST_AUDIO_FORMAT_U24_LE,
- GST_AUDIO_FORMAT_U24_BE,
+ GST_AUDIO_FORMAT_S24_32LE,
+ GST_AUDIO_FORMAT_S24_32BE,
+ GST_AUDIO_FORMAT_U24_32LE,
+ GST_AUDIO_FORMAT_U24_32BE,
/* 32 bit */
- GST_AUDIO_FORMAT_S32_LE,
- GST_AUDIO_FORMAT_S32_BE,
- GST_AUDIO_FORMAT_U32_LE,
- GST_AUDIO_FORMAT_U32_BE,
+ GST_AUDIO_FORMAT_S32LE,
+ GST_AUDIO_FORMAT_S32BE,
+ GST_AUDIO_FORMAT_U32LE,
+ GST_AUDIO_FORMAT_U32BE,
/* 24 bit in 3 bytes*/
- GST_AUDIO_FORMAT_S24_3LE,
- GST_AUDIO_FORMAT_S24_3BE,
- GST_AUDIO_FORMAT_U24_3LE,
- GST_AUDIO_FORMAT_U24_3BE,
+ GST_AUDIO_FORMAT_S24LE,
+ GST_AUDIO_FORMAT_S24BE,
+ GST_AUDIO_FORMAT_U24LE,
+ GST_AUDIO_FORMAT_U24BE,
/* 20 bit in 3 bytes*/
- GST_AUDIO_FORMAT_S20_3LE,
- GST_AUDIO_FORMAT_S20_3BE,
- GST_AUDIO_FORMAT_U20_3LE,
- GST_AUDIO_FORMAT_U20_3BE,
+ GST_AUDIO_FORMAT_S20LE,
+ GST_AUDIO_FORMAT_S20BE,
+ GST_AUDIO_FORMAT_U20LE,
+ GST_AUDIO_FORMAT_U20BE,
/* 18 bit in 3 bytes*/
- GST_AUDIO_FORMAT_S18_3LE,
- GST_AUDIO_FORMAT_S18_3BE,
- GST_AUDIO_FORMAT_U18_3LE,
- GST_AUDIO_FORMAT_U18_3BE,
+ GST_AUDIO_FORMAT_S18LE,
+ GST_AUDIO_FORMAT_S18BE,
+ GST_AUDIO_FORMAT_U18LE,
+ GST_AUDIO_FORMAT_U18BE,
/* float */
- GST_AUDIO_FORMAT_F32_LE,
- GST_AUDIO_FORMAT_F32_BE,
- GST_AUDIO_FORMAT_F64_LE,
- GST_AUDIO_FORMAT_F64_BE,
-#if G_BYTE_ORDER == G_BIG_ENDIAN
- GST_AUDIO_FORMAT_S16 = GST_AUDIO_FORMAT_S16_BE,
- GST_AUDIO_FORMAT_U16 = GST_AUDIO_FORMAT_U16_BE,
- GST_AUDIO_FORMAT_S24 = GST_AUDIO_FORMAT_S24_BE,
- GST_AUDIO_FORMAT_U24 = GST_AUDIO_FORMAT_U24_BE,
- GST_AUDIO_FORMAT_S32 = GST_AUDIO_FORMAT_S32_BE,
- GST_AUDIO_FORMAT_U32 = GST_AUDIO_FORMAT_U32_BE,
- GST_AUDIO_FORMAT_S24_3 = GST_AUDIO_FORMAT_S24_3BE,
- GST_AUDIO_FORMAT_U24_3 = GST_AUDIO_FORMAT_U24_3BE,
- GST_AUDIO_FORMAT_S20_3 = GST_AUDIO_FORMAT_S20_3BE,
- GST_AUDIO_FORMAT_U20_3 = GST_AUDIO_FORMAT_U20_3BE,
- GST_AUDIO_FORMAT_S18_3 = GST_AUDIO_FORMAT_S18_3BE,
- GST_AUDIO_FORMAT_U18_3 = GST_AUDIO_FORMAT_U18_3BE,
- GST_AUDIO_FORMAT_F32 = GST_AUDIO_FORMAT_F32_BE,
- GST_AUDIO_FORMAT_F64 = GST_AUDIO_FORMAT_F64_BE
-#elif G_BYTE_ORDER == G_LITTLE_ENDIAN
- GST_AUDIO_FORMAT_S16 = GST_AUDIO_FORMAT_S16_LE,
- GST_AUDIO_FORMAT_U16 = GST_AUDIO_FORMAT_U16_LE,
- GST_AUDIO_FORMAT_S24 = GST_AUDIO_FORMAT_S24_LE,
- GST_AUDIO_FORMAT_U24 = GST_AUDIO_FORMAT_U24_LE,
- GST_AUDIO_FORMAT_S32 = GST_AUDIO_FORMAT_S32_LE,
- GST_AUDIO_FORMAT_U32 = GST_AUDIO_FORMAT_U32_LE,
- GST_AUDIO_FORMAT_S24_3 = GST_AUDIO_FORMAT_S24_3LE,
- GST_AUDIO_FORMAT_U24_3 = GST_AUDIO_FORMAT_U24_3LE,
- GST_AUDIO_FORMAT_S20_3 = GST_AUDIO_FORMAT_S20_3LE,
- GST_AUDIO_FORMAT_U20_3 = GST_AUDIO_FORMAT_U20_3LE,
- GST_AUDIO_FORMAT_S18_3 = GST_AUDIO_FORMAT_S18_3LE,
- GST_AUDIO_FORMAT_U18_3 = GST_AUDIO_FORMAT_U18_3LE,
- GST_AUDIO_FORMAT_F32 = GST_AUDIO_FORMAT_F32_LE,
- GST_AUDIO_FORMAT_F64 = GST_AUDIO_FORMAT_F64_LE
-#endif
+ GST_AUDIO_FORMAT_F32LE,
+ GST_AUDIO_FORMAT_F32BE,
+ GST_AUDIO_FORMAT_F64LE,
+ GST_AUDIO_FORMAT_F64BE,
+ /* native endianness equivalents */
+ GST_AUDIO_FORMAT_S16 = _GST_AUDIO_FORMAT_NE(S16),
+ GST_AUDIO_FORMAT_U16 = _GST_AUDIO_FORMAT_NE(U16),
+ GST_AUDIO_FORMAT_S24_32 = _GST_AUDIO_FORMAT_NE(S24_32),
+ GST_AUDIO_FORMAT_U24_32 = _GST_AUDIO_FORMAT_NE(U24_32),
+ GST_AUDIO_FORMAT_S32 = _GST_AUDIO_FORMAT_NE(S32),
+ GST_AUDIO_FORMAT_U32 = _GST_AUDIO_FORMAT_NE(U32),
+ GST_AUDIO_FORMAT_S24 = _GST_AUDIO_FORMAT_NE(S24),
+ GST_AUDIO_FORMAT_U24 = _GST_AUDIO_FORMAT_NE(U24),
+ GST_AUDIO_FORMAT_S20 = _GST_AUDIO_FORMAT_NE(S20),
+ GST_AUDIO_FORMAT_U20 = _GST_AUDIO_FORMAT_NE(U20),
+ GST_AUDIO_FORMAT_S18 = _GST_AUDIO_FORMAT_NE(S18),
+ GST_AUDIO_FORMAT_U18 = _GST_AUDIO_FORMAT_NE(U18),
+ GST_AUDIO_FORMAT_F32 = _GST_AUDIO_FORMAT_NE(F32),
+ GST_AUDIO_FORMAT_F64 = _GST_AUDIO_FORMAT_NE(F64)
} GstAudioFormat;
/* FIXME: need GTypes */
* @channels: the number of channels
* @bpf: the number of bytes for one frame, this is the size of one
* sample * @channels
- * @positions: the positions for each channel
+ * @position: the position for each channel (assume all NONE for >64 channels)
*
* Information describing audio properties. This information can be filled
* in from GstCaps with gst_audio_info_from_caps().