* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
-#if !defined( __LIBVLC__ )
- #error You are not libvlc or one of its plugins. You cannot include this file
-#endif
+#ifndef VLC_CODECS_H
+#define VLC_CODECS_H 1
-#ifndef _VLC_CODECS_H
-#define _VLC_CODECS_H 1
+/**
+ * \file
+ * This file defines codec related structures needed by the demuxers and decoders
+ */
+
+#ifdef HAVE_ATTRIBUTE_PACKED
+# define ATTR_PACKED __attribute__((__packed__))
+#else
+# error FIXME
+#endif
/* Structures exported to the demuxers and decoders */
#ifndef _WAVEFORMATEX_
#define _WAVEFORMATEX_
typedef struct
-#ifdef HAVE_ATTRIBUTE_PACKED
- __attribute__((__packed__))
-#endif
+ATTR_PACKED
_WAVEFORMATEX {
uint16_t wFormatTag;
uint16_t nChannels;
#ifndef _WAVEFORMATEXTENSIBLE_
#define _WAVEFORMATEXTENSIBLE_
typedef struct
-#ifdef HAVE_ATTRIBUTE_PACKED
- __attribute__((__packed__))
-#endif
+ATTR_PACKED
_WAVEFORMATEXTENSIBLE {
WAVEFORMATEX Format;
union {
#ifndef _WAVEHEADER_
#define _WAVEHEADER_
typedef struct
-#ifdef HAVE_ATTRIBUTE_PACKED
- __attribute__((__packed__))
-#endif
+ATTR_PACKED
_WAVEHEADER {
uint32_t MainChunkID;
uint32_t Length;
#if !defined(_BITMAPINFOHEADER_) && !defined(WIN32)
#define _BITMAPINFOHEADER_
typedef struct
-#ifdef HAVE_ATTRIBUTE_PACKED
- __attribute__((__packed__))
-#endif
+ATTR_PACKED
{
uint32_t biSize;
uint32_t biWidth;
} BITMAPINFOHEADER, *PBITMAPINFOHEADER, *LPBITMAPINFOHEADER;
typedef struct
-#ifdef HAVE_ATTRIBUTE_PACKED
- __attribute__((__packed__))
-#endif
+ATTR_PACKED
{
BITMAPINFOHEADER bmiHeader;
int bmiColors[1];
#ifndef _RECT32_
#define _RECT32_
typedef struct
-#ifdef HAVE_ATTRIBUTE_PACKED
- __attribute__((__packed__))
-#endif
+ATTR_PACKED
{
int left, top, right, bottom;
} RECT32;
#ifndef _VIDEOINFOHEADER_
#define _VIDEOINFOHEADER_
typedef struct
-#ifdef HAVE_ATTRIBUTE_PACKED
- __attribute__((__packed__))
-#endif
+ATTR_PACKED
{
RECT32 rcSource;
RECT32 rcTarget;
#ifndef _RGBQUAD_
#define _RGBQUAD_
typedef struct
-#ifdef HAVE_ATTRIBUTE_PACKED
- __attribute__((__packed__))
-#endif
+ATTR_PACKED
{
uint8_t rgbBlue;
uint8_t rgbGreen;
#ifndef _TRUECOLORINFO_
#define _TRUECOLORINFO_
typedef struct
-#ifdef HAVE_ATTRIBUTE_PACKED
- __attribute__((__packed__))
-#endif
+ATTR_PACKED
{
uint32_t dwBitMasks[3];
RGBQUAD1 bmiColors[256];
#ifndef _VIDEOINFO_
#define _VIDEOINFO_
typedef struct
-#ifdef HAVE_ATTRIBUTE_PACKED
- __attribute__((__packed__))
-#endif
+ATTR_PACKED
{
RECT32 rcSource;
RECT32 rcTarget;
#define WAVE_SPEAKER_TOP_BACK_RIGHT 0x20000
#define WAVE_SPEAKER_RESERVED 0x80000000
-static struct
+static const struct
{
uint16_t i_tag;
vlc_fourcc_t i_fourcc;
{ WAVE_FORMAT_ALAW, VLC_FOURCC( 'a', 'l', 'a', 'w' ), "A-Law" },
{ WAVE_FORMAT_MULAW, VLC_FOURCC( 'm', 'l', 'a', 'w' ), "Mu-Law" },
{ WAVE_FORMAT_IMA_ADPCM, VLC_FOURCC( 'm', 's', 0x00,0x11), "Ima-ADPCM" },
+ { WAVE_FORMAT_GSM610, VLC_FOURCC( 'a', 'g', 's', 'm' ), "Microsoft WAV GSM" },
{ WAVE_FORMAT_G726, VLC_FOURCC( 'g', '7', '2', '6' ), "G.726 ADPCM" },
{ WAVE_FORMAT_MPEGLAYER3, VLC_FOURCC( 'm', 'p', 'g', 'a' ), "Mpeg Audio" },
{ WAVE_FORMAT_MPEG, VLC_FOURCC( 'm', 'p', 'g', 'a' ), "Mpeg Audio" },
* to determine the actual format. Microsoft has stopped giving out wFormatTag
* assignments in lieu of letting 3rd parties generate their own GUIDs
*/
-static struct
+static const struct
{
GUID guid_tag;
vlc_fourcc_t i_fourcc;