]> git.sesse.net Git - vlc/blobdiff - include/vlc_codecs.h
macosx: Fix a memleak.
[vlc] / include / vlc_codecs.h
index 1f8c7015ead712589405eb42abee727a88bd3e36..d217470698da1c63f28cc03f65f09a39bcd8915a 100644 (file)
  * 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
 
+#ifdef HAVE_ATTRIBUTE_PACKED
+#   define ATTR_PACKED __attribute__((__packed__))
+#else
+#   error FIXME
+#endif
+
 /* Structures exported to the demuxers and decoders */
 
 #if !(defined _GUID_DEFINED || defined GUID_DEFINED)
@@ -44,9 +46,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 +61,7 @@ _WAVEFORMATEX {
 #ifndef _WAVEFORMATEXTENSIBLE_
 #define _WAVEFORMATEXTENSIBLE_
 typedef struct
-#ifdef HAVE_ATTRIBUTE_PACKED
-    __attribute__((__packed__))
-#endif
+ATTR_PACKED
 _WAVEFORMATEXTENSIBLE {
     WAVEFORMATEX Format;
     union {
@@ -79,9 +77,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 +98,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 +114,7 @@ typedef struct
 } BITMAPINFOHEADER, *PBITMAPINFOHEADER, *LPBITMAPINFOHEADER;
 
 typedef struct
-#ifdef HAVE_ATTRIBUTE_PACKED
-    __attribute__((__packed__))
-#endif
+ATTR_PACKED
 {
     BITMAPINFOHEADER bmiHeader;
     int        bmiColors[1];
@@ -132,9 +124,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 +138,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 +152,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 +164,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 +174,7 @@ typedef struct
 #ifndef _VIDEOINFO_
 #define _VIDEOINFO_
 typedef struct
-#ifdef HAVE_ATTRIBUTE_PACKED
-    __attribute__((__packed__))
-#endif
+ATTR_PACKED
 {
     RECT32            rcSource;
     RECT32            rcTarget;
@@ -242,12 +224,24 @@ typedef struct
 #define WAVE_FORMAT_DK3                 0x0061
 #define WAVE_FORMAT_DK4                 0x0062
 
+/* At least FFmpeg use that ID: from libavformat/riff.c ('Vo' == 0x566f)
+ * { CODEC_ID_VORBIS, ('V'<<8)+'o' }, //HACK/FIXME, does vorbis in WAV/AVI have an (in)official id?
+ */
+#define WAVE_FORMAT_VORBIS              0x566f
+
+/* It seems that these IDs are used by braindead & obsolete VorbisACM encoder
+ * (Windows only)
+ * A few info is available except VorbisACM source (remember, Windows only)
+ * (available on http://svn.xiph.org), but it seems that vo3+ at least is
+ * made of Vorbis data encapsulated in Ogg container...
+ */
 #define WAVE_FORMAT_VORB_1              0x674f
-#define WAVE_FORMAT_VORB_1PLUS          0x676f
 #define WAVE_FORMAT_VORB_2              0x6750
-#define WAVE_FORMAT_VORB_2PLUS          0x6770
 #define WAVE_FORMAT_VORB_3              0x6751
+#define WAVE_FORMAT_VORB_1PLUS          0x676f
+#define WAVE_FORMAT_VORB_2PLUS          0x6770
 #define WAVE_FORMAT_VORB_3PLUS          0x6771
+
 #define WAVE_FORMAT_SPEEX               0xa109 /* Speex audio */
 
 
@@ -323,6 +317,7 @@ wave_format_tag_to_fourcc[] =
     { WAVE_FORMAT_DIVIO_AAC,  VLC_FOURCC( 'm', 'p', '4', 'a' ), "MPEG-4 Audio (Divio)" },
     { WAVE_FORMAT_AAC,        VLC_FOURCC( 'm', 'p', '4', 'a' ), "MPEG-4 Audio" },
     { WAVE_FORMAT_FFMPEG_AAC, VLC_FOURCC( 'm', 'p', '4', 'a' ), "MPEG-4 Audio" },
+    { WAVE_FORMAT_VORBIS,     VLC_FOURCC( 'v', 'o', 'r', 'b' ), "Vorbis Audio" },
     { WAVE_FORMAT_VORB_1,     VLC_FOURCC( 'v', 'o', 'r', '1' ), "Vorbis 1 Audio" },
     { WAVE_FORMAT_VORB_1PLUS, VLC_FOURCC( 'v', 'o', '1', '+' ), "Vorbis 1+ Audio" },
     { WAVE_FORMAT_VORB_2,     VLC_FOURCC( 'v', 'o', 'r', '2' ), "Vorbis 2 Audio" },
@@ -408,12 +403,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];