X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=include%2Fvlc_codecs.h;h=46047116c7d286a918163a796d5fb6c10e4bf9ba;hb=066390d34d3919a8201d06d65e8d7afac778fb01;hp=7b507118b6562a1949ae349f4e680be3f03ea784;hpb=1d1c5f07b38cb8a7c41fd30d41eb2147ad8961b0;p=vlc diff --git a/include/vlc_codecs.h b/include/vlc_codecs.h index 7b507118b6..46047116c7 100644 --- a/include/vlc_codecs.h +++ b/include/vlc_codecs.h @@ -21,12 +21,19 @@ * 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 */ @@ -44,9 +51,7 @@ typedef struct _GUID #ifndef _WAVEFORMATEX_ #define _WAVEFORMATEX_ typedef struct -#ifdef HAVE_ATTRIBUTE_PACKED - __attribute__((__packed__)) -#endif +ATTR_PACKED _WAVEFORMATEX { uint16_t wFormatTag; uint16_t nChannels; @@ -61,9 +66,7 @@ _WAVEFORMATEX { #ifndef _WAVEFORMATEXTENSIBLE_ #define _WAVEFORMATEXTENSIBLE_ typedef struct -#ifdef HAVE_ATTRIBUTE_PACKED - __attribute__((__packed__)) -#endif +ATTR_PACKED _WAVEFORMATEXTENSIBLE { WAVEFORMATEX Format; union { @@ -79,9 +82,7 @@ _WAVEFORMATEXTENSIBLE { #ifndef _WAVEHEADER_ #define _WAVEHEADER_ typedef struct -#ifdef HAVE_ATTRIBUTE_PACKED - __attribute__((__packed__)) -#endif +ATTR_PACKED _WAVEHEADER { uint32_t MainChunkID; uint32_t Length; @@ -102,9 +103,7 @@ _WAVEHEADER { #if !defined(_BITMAPINFOHEADER_) && !defined(WIN32) #define _BITMAPINFOHEADER_ typedef struct -#ifdef HAVE_ATTRIBUTE_PACKED - __attribute__((__packed__)) -#endif +ATTR_PACKED { uint32_t biSize; uint32_t biWidth; @@ -120,9 +119,7 @@ typedef struct } BITMAPINFOHEADER, *PBITMAPINFOHEADER, *LPBITMAPINFOHEADER; typedef struct -#ifdef HAVE_ATTRIBUTE_PACKED - __attribute__((__packed__)) -#endif +ATTR_PACKED { BITMAPINFOHEADER bmiHeader; int bmiColors[1]; @@ -132,9 +129,7 @@ typedef struct #ifndef _RECT32_ #define _RECT32_ typedef struct -#ifdef HAVE_ATTRIBUTE_PACKED - __attribute__((__packed__)) -#endif +ATTR_PACKED { int left, top, right, bottom; } RECT32; @@ -148,9 +143,7 @@ typedef int64_t REFERENCE_TIME; #ifndef _VIDEOINFOHEADER_ #define _VIDEOINFOHEADER_ typedef struct -#ifdef HAVE_ATTRIBUTE_PACKED - __attribute__((__packed__)) -#endif +ATTR_PACKED { RECT32 rcSource; RECT32 rcTarget; @@ -164,9 +157,7 @@ typedef struct #ifndef _RGBQUAD_ #define _RGBQUAD_ typedef struct -#ifdef HAVE_ATTRIBUTE_PACKED - __attribute__((__packed__)) -#endif +ATTR_PACKED { uint8_t rgbBlue; uint8_t rgbGreen; @@ -178,9 +169,7 @@ typedef struct #ifndef _TRUECOLORINFO_ #define _TRUECOLORINFO_ typedef struct -#ifdef HAVE_ATTRIBUTE_PACKED - __attribute__((__packed__)) -#endif +ATTR_PACKED { uint32_t dwBitMasks[3]; RGBQUAD1 bmiColors[256]; @@ -190,9 +179,7 @@ typedef struct #ifndef _VIDEOINFO_ #define _VIDEOINFO_ typedef struct -#ifdef HAVE_ATTRIBUTE_PACKED - __attribute__((__packed__)) -#endif +ATTR_PACKED { RECT32 rcSource; RECT32 rcTarget; @@ -304,7 +291,7 @@ static const GUID VLC_KSDATAFORMAT_SUBTYPE_UNKNOWN = {0x00000000, 0x0000, 0x0000 #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; @@ -372,7 +359,7 @@ static inline void fourcc_to_wf_tag( vlc_fourcc_t fcc, uint16_t *pi_tag ) * 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; @@ -421,12 +408,12 @@ typedef struct es_sys_t unsigned int i_scale_h; unsigned int i_scale_v; unsigned int i_alpha; - vlc_bool_t b_smooth; + bool b_smooth; mtime_t i_fade_in; mtime_t i_fade_out; unsigned int i_align; mtime_t i_time_offset; - vlc_bool_t b_forced_subs; + bool b_forced_subs; unsigned int palette[16]; unsigned int colors[4];