From cddf4c86d3612bfc2d48003a12e8a5351c4a42ee Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Tue, 6 Sep 2011 15:40:02 +0200 Subject: [PATCH 1/4] Automatic update of common submodule From 605cd9a to a39eb83 --- common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common b/common index 605cd9a65e..a39eb835fb 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 605cd9a65ed61505f24b840d3fe8e252be72b151 +Subproject commit a39eb835fb3be2a4c5a6a89b5ca5cc064e79b2e2 From 91d1112360725ea7b0c6b44d91ebc8bf7bd9dd11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 6 Sep 2011 15:16:15 +0100 Subject: [PATCH 2/4] audio: update audio format enums to match changes in 0.11 And add new audio format info stuff to docs. --- docs/libs/gst-plugins-base-libs-sections.txt | 38 ++++ gst-libs/gst/audio/audio.c | 56 +++--- gst-libs/gst/audio/audio.h | 184 ++++++++++--------- 3 files changed, 160 insertions(+), 118 deletions(-) diff --git a/docs/libs/gst-plugins-base-libs-sections.txt b/docs/libs/gst-plugins-base-libs-sections.txt index 39d274e01b..d8dc07d6f5 100644 --- a/docs/libs/gst-plugins-base-libs-sections.txt +++ b/docs/libs/gst-plugins-base-libs-sections.txt @@ -82,6 +82,42 @@ GST_IS_APP_SINK_CLASS
gstaudio gst/audio/audio.h +GstAudioFlags +GstAudioFormat +GstAudioFormatFlags +GstAudioFormatInfo +GstAudioInfo +gst_audio_info_init +gst_audio_info_clear +gst_audio_info_copy +gst_audio_info_free +gst_audio_info_from_caps +gst_audio_info_to_caps +gst_audio_info_convert +gst_audio_format_get_info +GST_AUDIO_FORMAT_INFO_DEPTH +GST_AUDIO_FORMAT_INFO_ENDIANNESS +GST_AUDIO_FORMAT_INFO_FLAGS +GST_AUDIO_FORMAT_INFO_FORMAT +GST_AUDIO_FORMAT_INFO_IS_FLOAT +GST_AUDIO_FORMAT_INFO_IS_INTEGER +GST_AUDIO_FORMAT_INFO_IS_BE +GST_AUDIO_FORMAT_INFO_IS_LE +GST_AUDIO_FORMAT_INFO_IS_SIGNED +GST_AUDIO_FORMAT_INFO_NAME +GST_AUDIO_FORMAT_INFO_WIDTH +GST_AUDIO_INFO_BPF +GST_AUDIO_INFO_BPS +GST_AUDIO_INFO_CHANNELS +GST_AUDIO_INFO_DEPTH +GST_AUDIO_INFO_FLAGS +GST_AUDIO_INFO_FORMAT +GST_AUDIO_INFO_HAS_DEFAULT_POSITIONS +GST_AUDIO_INFO_NAME +GST_AUDIO_INFO_POSITION +GST_AUDIO_INFO_RATE +GST_AUDIO_INFO_WIDTH + GstAudioFieldFlag GST_FRAMES_TO_CLOCK_TIME GST_CLOCK_TIME_TO_FRAMES @@ -101,6 +137,8 @@ GST_TYPE_BUFFER_FORMAT GST_TYPE_BUFFER_FORMAT_TYPE gst_buffer_format_get_type gst_buffer_format_type_get_type + +_GST_AUDIO_FORMAT_NE
diff --git a/gst-libs/gst/audio/audio.c b/gst-libs/gst/audio/audio.c index 23fe19e63b..5483b1da5f 100644 --- a/gst-libs/gst/audio/audio.c +++ b/gst-libs/gst/audio/audio.c @@ -297,43 +297,43 @@ static GstAudioFormatInfo formats[] = { 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) }; diff --git a/gst-libs/gst/audio/audio.h b/gst-libs/gst/audio/audio.h index e0bf676326..61464e47e7 100644 --- a/gst-libs/gst/audio/audio.h +++ b/gst-libs/gst/audio/audio.h @@ -27,39 +27,59 @@ 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. * @@ -71,71 +91,55 @@ typedef enum { 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 */ @@ -228,7 +232,7 @@ typedef enum { * @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(). From 36a75bdb71040bb46b1fc469281631d466750e5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 6 Sep 2011 15:46:45 +0100 Subject: [PATCH 3/4] audio: update internal silent sample defines as well to match 0.11 --- gst-libs/gst/audio/audio.c | 52 +++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/gst-libs/gst/audio/audio.c b/gst-libs/gst/audio/audio.c index 5483b1da5f..33ab3963b1 100644 --- a/gst-libs/gst/audio/audio.c +++ b/gst-libs/gst/audio/audio.c @@ -276,20 +276,20 @@ gst_audio_structure_set_int (GstStructure * structure, GstAudioFieldFlag flag) #define MAKE_FORMAT(str,flags,end,width,depth,silent) \ { GST_AUDIO_FORMAT_ ##str, G_STRINGIFY(str), flags, end, width, depth, silent } -#define SILENT_0 { 0, 0, 0, 0, 0, 0, 0, 0 } -#define SILENT_U8 { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 } -#define SILENT_U16_LE { 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80 } -#define SILENT_U16_BE { 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00 } -#define SILENT_U24_LE { 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00 } -#define SILENT_U24_BE { 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00 } -#define SILENT_U32_LE { 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80 } -#define SILENT_U32_BE { 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00 } -#define SILENT_U24_3LE { 0x00, 0x00, 0x80, 0x00, 0x00, 0x80 } -#define SILENT_U24_3BE { 0x80, 0x00, 0x00, 0x80, 0x00, 0x00 } -#define SILENT_U20_3LE { 0x00, 0x00, 0x08, 0x00, 0x00, 0x08 } -#define SILENT_U20_3BE { 0x08, 0x00, 0x00, 0x08, 0x00, 0x00 } -#define SILENT_U18_3LE { 0x00, 0x00, 0x02, 0x00, 0x00, 0x02 } -#define SILENT_U18_3BE { 0x02, 0x00, 0x00, 0x02, 0x00, 0x00 } +#define SILENT_0 { 0, 0, 0, 0, 0, 0, 0, 0 } +#define SILENT_U8 { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 } +#define SILENT_U16LE { 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80 } +#define SILENT_U16BE { 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00 } +#define SILENT_U24_32LE { 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00 } +#define SILENT_U24_32BE { 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00 } +#define SILENT_U32LE { 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80 } +#define SILENT_U32BE { 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00 } +#define SILENT_U24LE { 0x00, 0x00, 0x80, 0x00, 0x00, 0x80 } +#define SILENT_U24BE { 0x80, 0x00, 0x00, 0x80, 0x00, 0x00 } +#define SILENT_U20LE { 0x00, 0x00, 0x08, 0x00, 0x00, 0x08 } +#define SILENT_U20BE { 0x08, 0x00, 0x00, 0x08, 0x00, 0x00 } +#define SILENT_U18LE { 0x00, 0x00, 0x02, 0x00, 0x00, 0x02 } +#define SILENT_U18BE { 0x02, 0x00, 0x00, 0x02, 0x00, 0x00 } static GstAudioFormatInfo formats[] = { {GST_AUDIO_FORMAT_UNKNOWN, "UNKNOWN", 0, 0, 0, 0}, @@ -299,33 +299,33 @@ static GstAudioFormatInfo formats[] = { /* 16 bit */ 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), + MAKE_FORMAT (U16LE, UINT, G_LITTLE_ENDIAN, 16, 16, SILENT_U16LE), + MAKE_FORMAT (U16BE, UINT, G_BIG_ENDIAN, 16, 16, SILENT_U16BE), /* 24 bit in low 3 bytes of 32 bits */ 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), + MAKE_FORMAT (U24_32LE, UINT, G_LITTLE_ENDIAN, 32, 24, SILENT_U24_32LE), + MAKE_FORMAT (U24_32BE, UINT, G_BIG_ENDIAN, 32, 24, SILENT_U24_32BE), /* 32 bit */ 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), + MAKE_FORMAT (U32LE, UINT, G_LITTLE_ENDIAN, 32, 32, SILENT_U32LE), + MAKE_FORMAT (U32BE, UINT, G_BIG_ENDIAN, 32, 32, SILENT_U32BE), /* 24 bit in 3 bytes */ 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), + MAKE_FORMAT (U24LE, UINT, G_LITTLE_ENDIAN, 24, 24, SILENT_U24LE), + MAKE_FORMAT (U24BE, UINT, G_BIG_ENDIAN, 24, 24, SILENT_U24BE), /* 20 bit in 3 bytes */ 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), + MAKE_FORMAT (U20LE, UINT, G_LITTLE_ENDIAN, 24, 20, SILENT_U20LE), + MAKE_FORMAT (U20BE, UINT, G_BIG_ENDIAN, 24, 20, SILENT_U20BE), /* 18 bit in 3 bytes */ 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), + MAKE_FORMAT (U18LE, UINT, G_LITTLE_ENDIAN, 24, 18, SILENT_U18LE), + MAKE_FORMAT (U18BE, UINT, G_BIG_ENDIAN, 24, 18, SILENT_U18BE), /* float */ MAKE_FORMAT (F32LE, GST_AUDIO_FORMAT_FLAG_FLOAT, G_LITTLE_ENDIAN, 32, 32, SILENT_0), From dc28bd1b634bfcf6aace92fd711e9202ede75a8b Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 6 Sep 2011 16:46:02 +0200 Subject: [PATCH 4/4] audio: rename IS_LE/BE to _IS_LITTLE_ENDIAN/BIG_ENDIAN --- gst-libs/gst/audio/audio.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/gst-libs/gst/audio/audio.h b/gst-libs/gst/audio/audio.h index 61464e47e7..eba7a344ca 100644 --- a/gst-libs/gst/audio/audio.h +++ b/gst-libs/gst/audio/audio.h @@ -192,19 +192,19 @@ struct _GstAudioFormatInfo { gpointer padding_p[4]; }; -#define GST_AUDIO_FORMAT_INFO_FORMAT(info) ((info)->format) -#define GST_AUDIO_FORMAT_INFO_NAME(info) ((info)->name) -#define GST_AUDIO_FORMAT_INFO_FLAGS(info) ((info)->flags) +#define GST_AUDIO_FORMAT_INFO_FORMAT(info) ((info)->format) +#define GST_AUDIO_FORMAT_INFO_NAME(info) ((info)->name) +#define GST_AUDIO_FORMAT_INFO_FLAGS(info) ((info)->flags) -#define GST_AUDIO_FORMAT_INFO_IS_INTEGER(info) !!((info)->flags & GST_AUDIO_FORMAT_FLAG_INTEGER) -#define GST_AUDIO_FORMAT_INFO_IS_FLOAT(info) !!((info)->flags & GST_AUDIO_FORMAT_FLAG_FLOAT) -#define GST_AUDIO_FORMAT_INFO_IS_SIGNED(info) !!((info)->flags & GST_AUDIO_FORMAT_FLAG_SIGNED) +#define GST_AUDIO_FORMAT_INFO_IS_INTEGER(info) !!((info)->flags & GST_AUDIO_FORMAT_FLAG_INTEGER) +#define GST_AUDIO_FORMAT_INFO_IS_FLOAT(info) !!((info)->flags & GST_AUDIO_FORMAT_FLAG_FLOAT) +#define GST_AUDIO_FORMAT_INFO_IS_SIGNED(info) !!((info)->flags & GST_AUDIO_FORMAT_FLAG_SIGNED) -#define GST_AUDIO_FORMAT_INFO_ENDIANNESS(info) ((info)->endianness) -#define GST_AUDIO_FORMAT_INFO_IS_LE(info) ((info)->endianness == G_LITTLE_ENDIAN) -#define GST_AUDIO_FORMAT_INFO_IS_BE(info) ((info)->endianness == G_BIG_ENDIAN) -#define GST_AUDIO_FORMAT_INFO_WIDTH(info) ((info)->width) -#define GST_AUDIO_FORMAT_INFO_DEPTH(info) ((info)->depth) +#define GST_AUDIO_FORMAT_INFO_ENDIANNESS(info) ((info)->endianness) +#define GST_AUDIO_FORMAT_INFO_IS_LITTLE_ENDIAN(info) ((info)->endianness == G_LITTLE_ENDIAN) +#define GST_AUDIO_FORMAT_INFO_IS_BIG_ENDIAN(info) ((info)->endianness == G_BIG_ENDIAN) +#define GST_AUDIO_FORMAT_INFO_WIDTH(info) ((info)->width) +#define GST_AUDIO_FORMAT_INFO_DEPTH(info) ((info)->depth) const GstAudioFormatInfo * gst_audio_format_get_info (GstAudioFormat format) G_GNUC_CONST;