Added fourcc helpers and defines to centralize them.
authorLaurent Aimar <fenrir@videolan.org>
Tue, 17 Mar 2009 22:01:27 +0000 (23:01 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Wed, 13 May 2009 19:18:17 +0000 (21:18 +0200)
It introduces a bunch of VLC_CODEC_* defines as a representative
fourcc for a codec. The fourccs have been chosen pretty much randomly
except when I knew well know ones.

It adds two helpers: vlc_fourcc_GetCodec and vlc_fourcc_GetDescription.

Don't hesitate if you have any comments.

include/vlc_fourcc.h [new file with mode: 0644]
src/Makefile.am
src/libvlccore.sym
src/misc/fourcc.c [new file with mode: 0644]

diff --git a/include/vlc_fourcc.h b/include/vlc_fourcc.h
new file mode 100644 (file)
index 0000000..6951228
--- /dev/null
@@ -0,0 +1,311 @@
+/*****************************************************************************
+ * vlc_fourcc.h: Definition of various FOURCC and helpers
+ *****************************************************************************
+ * Copyright (C) 2009 Laurent Aimar
+ * $Id$
+ *
+ * Authors: Laurent Aimar <fenrir _AT_ videolan _DOT_ com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#ifndef VLC_FOURCC_H
+#define VLC_FOURCC_H 1
+
+#include <vlc_common.h>
+#include <vlc_es.h>
+
+/* Video codec */
+#define VLC_CODEC_MPGV      VLC_FOURCC('m','p','g','v')
+#define VLC_CODEC_MP1V      VLC_FOURCC('m','p','1','v')
+#define VLC_CODEC_MP2V      VLC_FOURCC('m','p','2','v')
+#define VLC_CODEC_MP4V      VLC_FOURCC('m','p','4','v')
+#define VLC_CODEC_DIV1      VLC_FOURCC('D','I','V','1')
+#define VLC_CODEC_DIV2      VLC_FOURCC('D','I','V','2')
+#define VLC_CODEC_DIV3      VLC_FOURCC('D','I','V','3')
+#define VLC_CODEC_SVQ1      VLC_FOURCC('S','V','Q','1')
+#define VLC_CODEC_SVQ3      VLC_FOURCC('S','V','Q','3')
+#define VLC_CODEC_H264      VLC_FOURCC('h','2','6','4')
+#define VLC_CODEC_H263      VLC_FOURCC('h','2','6','3')
+#define VLC_CODEC_H263I     VLC_FOURCC('I','2','6','3')
+#define VLC_CODEC_H263P     VLC_FOURCC('I','L','V','R')
+#define VLC_CODEC_FLV1      VLC_FOURCC('F','L','V','1')
+#define VLC_CODEC_H261      VLC_FOURCC('h','2','6','1')
+#define VLC_CODEC_MJPG      VLC_FOURCC('M','J','P','G')
+#define VLC_CODEC_MJPGB     VLC_FOURCC('m','j','p','b')
+#define VLC_CODEC_LJPG      VLC_FOURCC('L','J','P','G')
+#define VLC_CODEC_WMV1      VLC_FOURCC('W','M','V','1')
+#define VLC_CODEC_WMV2      VLC_FOURCC('W','M','V','2')
+#define VLC_CODEC_WMV3      VLC_FOURCC('W','M','V','3')
+#define VLC_CODEC_WMVA      VLC_FOURCC('W','M','V','A')
+#define VLC_CODEC_VC1       VLC_FOURCC('V','C','-','1')
+#define VLC_CODEC_THEORA    VLC_FOURCC('t','h','e','o')
+#define VLC_CODEC_TARKIN    VLC_FOURCC('t','a','r','k')
+#define VLC_CODEC_SNOW      VLC_FOURCC('S','N','O','W')
+#define VLC_CODEC_DIRAC     VLC_FOURCC('d','r','a','c')
+#define VLC_CODEC_CAVS      VLC_FOURCC('C','A','V','S')
+#define VLC_CODEC_NUV       VLC_FOURCC('N','J','P','G')
+#define VLC_CODEC_RV10      VLC_FOURCC('R','V','1','0')
+#define VLC_CODEC_RV13      VLC_FOURCC('R','V','1','3')
+#define VLC_CODEC_RV20      VLC_FOURCC('R','V','2','0')
+#define VLC_CODEC_RV30      VLC_FOURCC('R','V','3','0')
+#define VLC_CODEC_RV40      VLC_FOURCC('R','V','4','0')
+#define VLC_CODEC_VP3       VLC_FOURCC('V','P','3',' ')
+#define VLC_CODEC_VP5       VLC_FOURCC('V','P','5',' ')
+#define VLC_CODEC_VP6       VLC_FOURCC('V','P','6','2')
+#define VLC_CODEC_VP6F      VLC_FOURCC('V','P','6','F')
+#define VLC_CODEC_VP6A      VLC_FOURCC('V','P','6','A')
+#define VLC_CODEC_MSVIDEO1  VLC_FOURCC('M','S','V','C')
+#define VLC_CODEC_FLIC      VLC_FOURCC('F','L','I','C')
+#define VLC_CODEC_SP5X      VLC_FOURCC('S','P','5','X')
+#define VLC_CODEC_DV        VLC_FOURCC('d','v',' ',' ')
+#define VLC_CODEC_MSRLE     VLC_FOURCC('m','r','l','e')
+#define VLC_CODEC_INDEO3    VLC_FOURCC('I','V','3','1')
+#define VLC_CODEC_HUFFYUV   VLC_FOURCC('H','F','Y','U')
+#define VLC_CODEC_FFVHUFF   VLC_FOURCC('F','F','V','H')
+#define VLC_CODEC_ASV1      VLC_FOURCC('A','S','V','1')
+#define VLC_CODEC_ASV2      VLC_FOURCC('A','S','V','2')
+#define VLC_CODEC_FFV1      VLC_FOURCC('F','F','V','1')
+#define VLC_CODEC_VCR1      VLC_FOURCC('V','C','R','1')
+#define VLC_CODEC_CLJR      VLC_FOURCC('C','L','J','R')
+#define VLC_CODEC_RPZA      VLC_FOURCC('r','p','z','a')
+#define VLC_CODEC_SMC       VLC_FOURCC('s','m','c',' ')
+#define VLC_CODEC_CINEPAK   VLC_FOURCC('C','V','I','D')
+#define VLC_CODEC_TSCC      VLC_FOURCC('T','S','C','C')
+#define VLC_CODEC_CSCD      VLC_FOURCC('C','S','C','D')
+#define VLC_CODEC_ZMBV      VLC_FOURCC('Z','M','B','V')
+#define VLC_CODEC_VMNC      VLC_FOURCC('V','M','n','c')
+#define VLC_CODEC_FRAPS     VLC_FOURCC('F','P','S','1')
+#define VLC_CODEC_TRUEMOTION1 VLC_FOURCC('D','U','C','K')
+#define VLC_CODEC_TRUEMOTION2 VLC_FOURCC('T','M','2','0')
+#define VLC_CODEC_QTRLE     VLC_FOURCC('r','l','e',' ')
+#define VLC_CODEC_QDRAW     VLC_FOURCC('q','d','r','w')
+#define VLC_CODEC_QPEG      VLC_FOURCC('Q','P','E','G')
+#define VLC_CODEC_ULTI      VLC_FOURCC('U','L','T','I')
+#define VLC_CODEC_VIXL      VLC_FOURCC('V','I','X','L')
+#define VLC_CODEC_LOCO      VLC_FOURCC('L','O','C','O')
+#define VLC_CODEC_WNV1      VLC_FOURCC('W','N','V','1')
+#define VLC_CODEC_AASC      VLC_FOURCC('A','A','S','C')
+#define VLC_CODEC_INDEO2    VLC_FOURCC('I','V','2','0')
+#define VLC_CODEC_FLASHSV   VLC_FOURCC('F','S','V','1')
+#define VLC_CODEC_KMVC      VLC_FOURCC('K','M','V','C')
+#define VLC_CODEC_SMACKVIDEO VLC_FOURCC('S','M','K','2')
+#define VLC_CODEC_DNXHD     VLC_FOURCC('A','V','d','n')
+#define VLC_CODEC_8BPS      VLC_FOURCC('8','B','P','S')
+#define VLC_CODEC_MIMIC     VLC_FOURCC('M','L','2','O')
+#define VLC_CODEC_INTERPLAY VLC_FOURCC('i','m','v','e')
+#define VLC_CODEC_IDCIN     VLC_FOURCC('I','D','C','I')
+#define VLC_CODEC_4XM       VLC_FOURCC('4','X','M','V')
+#define VLC_CODEC_ROQ       VLC_FOURCC('R','o','Q','v')
+#define VLC_CODEC_MDEC      VLC_FOURCC('M','D','E','C')
+#define VLC_CODEC_VMDVIDEO  VLC_FOURCC('V','M','D','V')
+#define VLC_CODEC_CDG       VLC_FOURCC('C','D','G',' ')
+
+/* Planar YUV 4:2:0 Y:V:U */
+#define VLC_CODEC_YV12      VLC_FOURCC('Y','V','1','2')
+/* Planar YUV 4:1:0 Y:U:V */
+#define VLC_CODEC_I410      VLC_FOURCC('I','4','1','0')
+/* Planar YUV 4:1:1 Y:U:V */
+#define VLC_CODEC_I411      VLC_FOURCC('I','4','1','1')
+/* Planar YUV 4:2:0 Y:U:V */
+#define VLC_CODEC_I420      VLC_FOURCC('I','4','2','0')
+/* Planar YUV 4:2:2 Y:U:V */
+#define VLC_CODEC_I422      VLC_FOURCC('I','4','2','2')
+/* Planar YUV 4:4:0 Y:U:V */
+#define VLC_CODEC_I440      VLC_FOURCC('I','4','4','0')
+/* Planar YUV 4:4:4 Y:U:V */
+#define VLC_CODEC_I444      VLC_FOURCC('I','4','4','4')
+/* Planar YUV 4:2:0 Y:U:V full scale */
+#define VLC_CODEC_J420      VLC_FOURCC('J','4','2','0')
+/* Planar YUV 4:2:2 Y:U:V full scale */
+#define VLC_CODEC_J422      VLC_FOURCC('J','4','2','2')
+/* Planar YUV 4:4:0 Y:U:V full scale */
+#define VLC_CODEC_J440      VLC_FOURCC('J','4','4','0')
+/* Planar YUV 4:4:4 Y:U:V full scale */
+#define VLC_CODEC_J444      VLC_FOURCC('J','4','4','4')
+/* Palettized YUV with palette element Y:U:V:A */
+#define VLC_CODEC_YUVP      VLC_FOURCC('Y','U','V','P')
+/* Planar YUV 4:4:4 Y:U:V:A */
+#define VLC_CODEC_YUVA      VLC_FOURCC('Y','U','V','A')
+/* Palettized RGB with palette element R:G:B */
+#define VLC_CODEC_RGBP      VLC_FOURCC('R','G','B','P')
+/* 8 bits RGB */
+#define VLC_CODEC_RGB8      VLC_FOURCC('R','G','B','2')
+/* 15 bits RGB stored on 16 bits */
+#define VLC_CODEC_RGB15     VLC_FOURCC('R','V','1','5')
+/* 16 bits RGB store on a 16 bits */
+#define VLC_CODEC_RGB16     VLC_FOURCC('R','V','1','6')
+/* 24 bits RGB */
+#define VLC_CODEC_RGB24     VLC_FOURCC('R','V','2','4')
+/* 32 bits RGB */
+#define VLC_CODEC_RGB32     VLC_FOURCC('R','V','3','2')
+/* 32 bits VLC RGBA */
+#define VLC_CODEC_RGBA      VLC_FOURCC('R','G','B','A')
+/* 8 bits grey */
+#define VLC_CODEC_GREY      VLC_FOURCC('G','R','E','Y')
+/* Packed YUV 4:2:2, U:Y:V:Y */
+#define VLC_CODEC_UYVY      VLC_FOURCC('U','Y','V','Y')
+/* Packed YUV 4:2:2, Y:U:Y:V */
+#define VLC_CODEC_YUYV      VLC_FOURCC('Y','U','Y','2')
+/* Packed YUV 4:2:2, Y:V:Y:U */
+#define VLC_CODEC_YVYU      VLC_FOURCC('Y','V','Y','U')
+/* Packed YUV 2:1:1, Y:U:Y:V */
+#define VLC_CODEC_Y211      VLC_FOURCC('Y','2','1','1')
+/* Planar Y, packed UV, from Matrox */
+#define VLC_CODEC_YMGA      VLC_FOURCC('Y','M','G','A')
+/* Packed YUV 4:2:2, U:Y:V:Y, reverted */
+#define VLC_CODEC_CYUV      VLC_FOURCC('c','y','u','v')
+
+/* Image codec (video) */
+#define VLC_CODEC_PNG       VLC_FOURCC('p','n','g',' ')
+#define VLC_CODEC_PPM       VLC_FOURCC('p','p','m',' ')
+#define VLC_CODEC_PGM       VLC_FOURCC('p','g','m',' ')
+#define VLC_CODEC_PGMYUV    VLC_FOURCC('p','g','m','y')
+#define VLC_CODEC_PAM       VLC_FOURCC('p','a','m',' ')
+#define VLC_CODEC_JPEG      VLC_FOURCC('j','p','e','g')
+#define VLC_CODEC_JPEGLS    VLC_FOURCC('M','J','L','S')
+#define VLC_CODEC_BMP       VLC_FOURCC('b','m','p',' ')
+#define VLC_CODEC_TIFF      VLC_FOURCC('t','i','f','f')
+#define VLC_CODEC_GIF       VLC_FOURCC('g','i','f',' ')
+#define VLC_CODEC_TARGA     VLC_FOURCC('t','g','a',' ')
+#define VLC_CODEC_SGI       VLC_FOURCC('s','g','i',' ')
+#define VLC_CODEC_PNM       VLC_FOURCC('p','n','m',' ')
+#define VLC_CODEC_PCX       VLC_FOURCC('p','c','x',' ')
+
+
+/* Audio codec */
+#define VLC_CODEC_MPGA      VLC_FOURCC('m','p','g','a')
+#define VLC_CODEC_MP4A      VLC_FOURCC('m','p','4','a')
+#define VLC_CODEC_A52       VLC_FOURCC('a','5','2',' ')
+#define VLC_CODEC_EAC3      VLC_FOURCC('e','a','c','3')
+#define VLC_CODEC_DTS       VLC_FOURCC('d','t','s',' ')
+#define VLC_CODEC_WMA1      VLC_FOURCC('W','M','A','1')
+#define VLC_CODEC_WMA2      VLC_FOURCC('W','M','A','2')
+#define VLC_CODEC_WMAP      VLC_FOURCC('W','M','A','P')
+#define VLC_CODEC_WMAL      VLC_FOURCC('W','M','A','L')
+#define VLC_CODEC_WMAS      VLC_FOURCC('W','M','A','S')
+#define VLC_CODEC_FLAC      VLC_FOURCC('f','l','a','c')
+#define VLC_CODEC_MLP       VLC_FOURCC('m','l','p',' ')
+#define VLC_CODEC_TRUEHD    VLC_FOURCC('t','r','h','d')
+#define VLC_CODEC_DVAUDIO   VLC_FOURCC('d','v','a','u')
+#define VLC_CODEC_SPEEX     VLC_FOURCC('s','p','x',' ')
+#define VLC_CODEC_VORBIS    VLC_FOURCC('v','o','r','b')
+#define VLC_CODEC_MACE3     VLC_FOURCC('M','A','C','3')
+#define VLC_CODEC_MACE6     VLC_FOURCC('M','A','C','6')
+#define VLC_CODEC_MUSEPACK7 VLC_FOURCC('M','P','C',' ')
+#define VLC_CODEC_MUSEPACK8 VLC_FOURCC('M','P','C','K')
+#define VLC_CODEC_RA_144    VLC_FOURCC('1','4','_','4')
+#define VLC_CODEC_RA_288    VLC_FOURCC('2','8','_','8')
+#define VLC_CODEC_ADPCM_4XM VLC_FOURCC('4','x','m','a')
+#define VLC_CODEC_ADPCM_EA  VLC_FOURCC('A','D','E','A')
+#define VLC_CODEC_INTERPLAY_DPCM VLC_FOURCC('i','d','p','c')
+#define VLC_CODEC_ROQ_DPCM  VLC_FOURCC('R','o','Q','a')
+#define VLC_CODEC_DSICINAUDIO VLC_FOURCC('D','C','I','A')
+#define VLC_CODEC_ADPCM_XA  VLC_FOURCC('x','a',' ',' ')
+#define VLC_CODEC_ADPCM_ADX VLC_FOURCC('a','d','x',' ')
+#define VLC_CODEC_ADPCM_IMA_WS VLC_FOURCC('A','I','W','S')
+#define VLC_CODEC_VMDAUDIO  VLC_FOURCC('v','m','d','a')
+#define VLC_CODEC_ADPCM_G726 VLC_FOURCC('g','7','2','6')
+#define VLC_CODEC_AMR_NB    VLC_FOURCC('s','a','m','r')
+#define VLC_CODEC_AMR_WB    VLC_FOURCC('s','a','w','b')
+#define VLC_CODEC_ALAC      VLC_FOURCC('a','l','a','c')
+#define VLC_CODEC_QDM2      VLC_FOURCC('Q','D','M','2')
+#define VLC_CODEC_COOK      VLC_FOURCC('c','o','o','k')
+#define VLC_CODEC_TTA       VLC_FOURCC('T','T','A','1')
+#define VLC_CODEC_SHORTEN   VLC_FOURCC('s','h','n',' ')
+#define VLC_CODEC_WAVPACK   VLC_FOURCC('W','V','P','K')
+#define VLC_CODEC_GSM       VLC_FOURCC('g','s','m',' ')
+#define VLC_CODEC_GSM_MS    VLC_FOURCC('a','g','s','m')
+#define VLC_CODEC_ATRAC3    VLC_FOURCC('a','t','r','c')
+#define VLC_CODEC_SONIC     VLC_FOURCC('S','O','N','C')
+#define VLC_CODEC_IMC       VLC_FOURCC(0x1,0x4,0x0,0x0)
+#define VLC_CODEC_TRUESPEECH VLC_FOURCC(0x22,0x0,0x0,0x0)
+#define VLC_CODEC_NELLYMOSER VLC_FOURCC('N','E','L','L')
+#define VLC_CODEC_APE       VLC_FOURCC('A','P','E',' ')
+#define VLC_CODEC_QCELP     VLC_FOURCC('Q','c','l','p')
+#define VLC_CODEC_302M      VLC_FOURCC('3','0','2','m')
+#define VLC_CODEC_DVD_LPCM  VLC_FOURCC('l','p','c','m')
+#define VLC_CODEC_BD_LPCM   VLC_FOURCC('b','p','c','m')
+#define VLC_CODEC_SDDS      VLC_FOURCC('s','d','d','s')
+#define VLC_CODEC_MIDI      VLC_FOURCC('M','I','D','I')
+#define VLC_CODEC_S8        VLC_FOURCC('s','8',' ',' ')
+#define VLC_CODEC_U8        VLC_FOURCC('u','8',' ',' ')
+#define VLC_CODEC_S16L      VLC_FOURCC('s','1','6','l')
+#define VLC_CODEC_S16B      VLC_FOURCC('s','1','6','b')
+#define VLC_CODEC_U16L      VLC_FOURCC('u','1','6','l')
+#define VLC_CODEC_U16B      VLC_FOURCC('u','1','6','b')
+#define VLC_CODEC_S24L      VLC_FOURCC('s','2','4','l')
+#define VLC_CODEC_S24B      VLC_FOURCC('s','2','4','b')
+#define VLC_CODEC_U24L      VLC_FOURCC('u','2','4','l')
+#define VLC_CODEC_U24B      VLC_FOURCC('u','2','4','b')
+#define VLC_CODEC_S32L      VLC_FOURCC('s','3','2','l')
+#define VLC_CODEC_S32B      VLC_FOURCC('s','3','2','b')
+#define VLC_CODEC_U32L      VLC_FOURCC('u','3','2','l')
+#define VLC_CODEC_U32B      VLC_FOURCC('u','3','2','b')
+#define VLC_CODEC_ALAW      VLC_FOURCC('a','l','a','w')
+#define VLC_CODEC_MULAW     VLC_FOURCC('m','l','a','w')
+#define VLC_CODEC_S24DAUD   VLC_FOURCC('d','a','u','d')
+#define VLC_CODEC_FI32      VLC_FOURCC('f','i','3','2')
+#define VLC_CODEC_FL32      VLC_FOURCC('f','l','3','2')
+#define VLC_CODEC_FL64      VLC_FOURCC('f','l','6','4')
+
+/* Subtitle */
+#define VLC_CODEC_SPU       VLC_FOURCC('s','p','u',' ')
+#define VLC_CODEC_DVBS      VLC_FOURCC('d','v','b','s')
+#define VLC_CODEC_SUBT      VLC_FOURCC('s','u','b','t')
+#define VLC_CODEC_XSUB      VLC_FOURCC('X','S','U','B')
+#define VLC_CODEC_SSA       VLC_FOURCC('s','s','a',' ')
+#define VLC_CODEC_TEXT      VLC_FOURCC('T','E','X','T')
+#define VLC_CODEC_TELETEXT  VLC_FOURCC('t','e','l','x')
+#define VLC_CODEC_KATE      VLC_FOURCC('k','a','t','e')
+#define VLC_CODEC_CMML      VLC_FOURCC('c','m','m','l')
+#define VLC_CODEC_ITU_T140  VLC_FOURCC('t','1','4','0')
+#define VLC_CODEC_USF       VLC_FOURCC('u','s','f',' ')
+#define VLC_CODEC_OGT       VLC_FOURCC('o','g','t',' ')
+#define VLC_CODEC_CVD       VLC_FOURCC('c','v','d',' ')
+
+
+/* Special endian dependant values */
+#ifdef WORDS_BIGENDIAN
+#   define VLC_CODEC_S16N VLC_CODEC_S16B
+#   define VLC_CODEC_U16N VLC_CODEC_U16B
+#   define VLC_CODEC_S24N VLC_CODEC_S24B
+#   define VLC_CODEC_S32N VLC_CODEC_S32B
+#else
+#   define VLC_CODEC_S16N VLC_CODEC_S16L
+#   define VLC_CODEC_U16N VLC_CODEC_U16L
+#   define VLC_CODEC_S24N VLC_CODEC_S24L
+#   define VLC_CODEC_S32N VLC_CODEC_S32L
+#endif
+
+/**
+ * It returns the codec associatedto a fourcc within a ES category.
+ *
+ * If not found, it will return the given fourcc.
+ * If found, it will allways be one of the VLC_CODEC_ defined above.
+ *
+ * You may use UNKNOWN_ES for the ES category if you don't have the information.
+ */
+VLC_EXPORT( vlc_fourcc_t, vlc_fourcc_GetCodec, ( int i_cat, vlc_fourcc_t i_fourcc ) );
+
+/**
+ * It returns the description of the given fourcc or NULL if not found.
+ *
+ * You may use UNKNOWN_ES for the ES category if you don't have the information.
+ */
+VLC_EXPORT( const char *, vlc_fourcc_GetDescription, ( int i_cat, vlc_fourcc_t i_fourcc ) );
+
+#endif /* _VLC_FOURCC_H */
+
index 0c6a4b4..7e3bd57 100644 (file)
@@ -58,6 +58,7 @@ pluginsinclude_HEADERS = \
        ../include/vlc_es_out.h \
        ../include/vlc_events.h \
        ../include/vlc_filter.h \
+       ../include/vlc_fourcc.h \
        ../include/vlc_gcrypt.h \
        ../include/vlc_httpd.h \
        ../include/vlc_image.h \
@@ -359,6 +360,7 @@ SOURCES_libvlc_common = \
        misc/rand.c \
        misc/mtime.c \
        misc/block.c \
+       misc/fourcc.c \
        misc/es_format.c \
        modules/modules.h \
        modules/modules.c \
index 3976c70..d4b5c80 100644 (file)
@@ -453,6 +453,8 @@ vlc_event_send
 __vlc_execve
 vlc_fastmem_register
 vlc_freeaddrinfo
+vlc_fourcc_GetClass
+vlc_fourcc_GetDescription
 vlc_gai_strerror
 vlc_gc_init
 vlc_getaddrinfo
diff --git a/src/misc/fourcc.c b/src/misc/fourcc.c
new file mode 100644 (file)
index 0000000..72ff105
--- /dev/null
@@ -0,0 +1,1149 @@
+/*****************************************************************************
+ * fourcc.c: fourcc helpers functions
+ *****************************************************************************
+ * Copyright (C) 2003-2004 the VideoLAN team
+ * $Id$
+ *
+ * Authors: Laurent Aimar <fenrir@videolan.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_fourcc.h>
+#include <assert.h>
+
+typedef struct
+{
+    char p_class[4];
+    char p_fourcc[4];
+    const char *psz_description;
+} entry_t;
+
+#define NULL4 "\x00\x00\x00\x00"
+
+/* XXX You don't want to see the preprocessor generated code ;) */
+#ifdef WORDS_BIGENDIAN
+#   define FCC2STR(f) { ((f)>>24)&0xff, ((f)>>16)&0xff, ((f)>>8)&0xff, ((f)>>0)&0xff }
+#else
+#   define FCC2STR(f) { ((f)>>0)&0xff, ((f)>>8)&0xff, ((f)>>16)&0xff, ((f)>>24)&0xff }
+#endif
+/* Begin a new class */
+#define B(a, c) { .p_class = FCC2STR(a), .p_fourcc = FCC2STR(a), .psz_description = c }
+/* Create a sub-class entry with description */
+#define E(b, c) { .p_class = NULL4, .p_fourcc = b, .psz_description = c }
+/* Create a sub-class entry without description (alias) */
+#define A(b) E(b, NULL4)
+
+
+/* */
+static const entry_t p_list_video[] = {
+    B(VLC_CODEC_MP1V, "MPEG-1 Video"),
+        A("mp1v"),
+        A("mpeg"),
+        A("mpg1"),
+        E("PIM1", "Pinnacle DC1000 (MPEG-1 Video)"),
+
+    B(VLC_CODEC_MP2V, "MPEG-2 Video"),
+        A("mp2v"),
+        A("MPEG"),
+        A("mpg2"),
+        E("hdv1", "HDV 720p30 (MPEG-2 Video)"),
+        E("hdv2", "Sony HDV (MPEG-2 Video)"),
+        E("hdv3", "FCP HDV (MPEG-2 Video)"),
+        E("hdv5", "HDV 720p25 (MPEG-2 Video)"),
+        E("hdv6", "HDV 1080p24 (MPEG-2 Video)"),
+        E("hdv7", "HDV 1080p25 (MPEG-2 Video)"),
+        E("hdv8", "HDV 1080p30 (MPEG-2 Video)"),
+
+        E("mx5n", "MPEG2 IMX NTSC 525/60 50mb/s (FCP)"),
+        E("mx5p", "MPEG2 IMX PAL 625/60 50mb/s (FCP)"),
+        E("mx4n", "MPEG2 IMX NTSC 525/60 40mb/s (FCP)"),
+        E("mx4p", "MPEG2 IMX PAL 625/50 40mb/s (FCP)"),
+        E("mx3n", "MPEG2 IMX NTSC 525/60 30mb/s (FCP)"),
+        E("mx3p", "MPEG2 IMX NTSC 625/50 30mb/s (FCP)"),
+        E("xdv2", "XDCAM HD 1080i60"),
+        E("AVmp", "AVID IMX PAL"),
+
+    B(VLC_CODEC_MPGV, "MPEG-1/2 Video"),
+        A("mpgv"),
+
+    B(VLC_CODEC_MP4V, "MPEG-4 Video"),
+        A("mp4v"),
+        A("DIVX"),
+        A("divx"),
+        A("MP4S"),
+        A("mp4s"),
+        A("M4S2"),
+        A("m4s2"),
+        A("mp4v"),
+        A("MP4V"),
+        A("\x04\x00\x00\x00"),
+        A("m4cc"),
+        A("M4CC"),
+        A("FMP4"),
+        A("fmp4"),
+        A("DCOD"),
+        A("fmp4"),
+        A("MVXM"),
+        A("PM4V"),
+        A("fmp4"),
+        A("M4T3"),
+        A("GEOX"),
+        A("DMK2"),
+        A("WV1F"),
+        A("DIGI"),
+        A("INMC"),
+        A("SN40"),
+        A("EPHV"),
+        /* XVID flavours */
+        E("xvid", "Xvid MPEG-4 Video"),
+        E("XVID", "Xvid MPEG-4 Video"),
+        E("XviD", "Xvid MPEG-4 Video"),
+        E("XVIX", "Xvid MPEG-4 Video"),
+        E("xvix", "Xvid MPEG-4 Video"),
+        /* DX50 */
+        E("DX50", "DivX MPEG-4 Video"),
+        E("dx50", "DivX MPEG-4 Video"),
+        E("BLZ0", "Blizzard MPEG-4 Video"),
+        E("DXGM", "Electronic Arts Game MPEG-4 Video"),
+        /* 3ivx delta 4 */
+        E("3IV2", "3ivx MPEG-4 Video"),
+        E("3iv2", "3ivx MPEG-4 Video"),
+        /* Various */
+        E("UMP4", "UB MPEG-4 Video"),
+        E("SEDG", "Samsung MPEG-4 Video"),
+        E("RMP4", "REALmagic MPEG-4 Video"),
+        E("HDX4", "Jomigo HDX4 (MPEG-4 Video)"),
+        E("hdx4", "Jomigo HDX4 (MPEG-4 Video)"),
+        E("SMP4", "Samsung SMP4 (MPEG-4 Video)"),
+        E("smp4", "Samsung SMP4 (MPEG-4 Video)"),
+        E("fvfw", "FFmpeg MPEG-4"),
+        E("FVFW", "FFmpeg MPEG-4"),
+        E("FFDS", "FFDShow MPEG-4"),
+        E("VIDM", "vidm 4.01 codec"),
+
+
+    /* MSMPEG4 v1 */
+    B(VLC_CODEC_DIV1, "MS MPEG-4 Video v1"),
+        A("DIV1"),
+        A("div1"),
+        A("MPG4"),
+        A("mpg4"),
+        A("mp41"),
+
+    /* MSMPEG4 v2 */
+    B(VLC_CODEC_DIV2, "MS MPEG-4 Video v2"),
+        A("DIV2"),
+        A("div2"),
+        A("MP42"),
+        A("mp42"),
+
+    /* MSMPEG4 v3 / M$ mpeg4 v3 */
+    B(VLC_CODEC_DIV3, "MS MPEG-4 Video v3"),
+        A("DIV3"),
+        A("MPG3"),
+        A("mpg3"),
+        A("div3"),
+        A("MP43"),
+        A("mp43"),
+        /* DivX 3.20 */
+        A("DIV4"),
+        A("div4"),
+        A("DIV5"),
+        A("div5"),
+        A("DIV6"),
+        A("div6"),
+        /* Cool Codec */
+        A("COL1"),
+        A("col1"),
+        A("COL0"),
+        A("col0"),
+        /* AngelPotion stuff */
+        A("AP41"),
+        /* 3ivx doctered divx files */
+        A("3IVD"),
+        A("3ivd"),
+        /* who knows? */
+        A("3VID"),
+        A("3vid"),
+
+    /* Sorenson v1 */
+    B(VLC_CODEC_SVQ1, "SVQ-1 (Sorenson Video v1)"),
+        A("SVQ1"),
+        A("svq1"),
+        A("svqi"),
+
+    /* Sorenson v3 */
+    B(VLC_CODEC_SVQ3, "SVQ-3 (Sorenson Video v3)"),
+        A("SVQ3"),
+
+    /* h264 */
+    B(VLC_CODEC_H264, "H264 - MPEG-4 AVC (part 10)"),
+        A("H264"),
+        A("h264"),
+        A("x264"),
+        A("X264"),
+        /* avc1: special case h264 */
+        A("avc1"),
+        A("AVC1"),
+        E("VSSH", "Vanguard VSS H264"),
+        E("VSSW", "Vanguard VSS H264"),
+        E("vssh", "Vanguard VSS H264"),
+        E("DAVC", "Dicas MPEGable H.264/MPEG-4 AVC"),
+        E("davc", "Dicas MPEGable H.264/MPEG-4 AVC"),
+
+    /* H263 and H263i */
+    /* H263(+) is also known as Real Video 1.0 */
+
+    /* H263 */
+    B(VLC_CODEC_H263, "H263"),
+        A("H263"),
+        A("h263"),
+        A("VX1K"),
+        A("s263"),
+        A("S263"),
+        A("U263"),
+        A("u263"),
+        E("D263", "DEC H263"),
+        E("L263", "LEAD H263"),
+        E("M263", "Microsoft H263"),
+        E("X263", "Xirlink H263"),
+        /* Zygo (partial) */
+        E("ZyGo", "ITU H263+"),
+
+    /* H263i */
+    B(VLC_CODEC_H263I, "I263.I"),
+        A("I263"),
+        A("i263"),
+
+    /* H263P */
+    B(VLC_CODEC_H263P, "ITU H263+"),
+        E("ILVR", "ITU H263+"),
+        E("viv1", "H263+"),
+        E("vivO", "H263+"),
+        E("viv2", "H263+"),
+        E("U263", "UB H263+"),
+
+    /* Flash (H263) variant */
+    B(VLC_CODEC_FLV1, "Flash Video"),
+        A("FLV1"),
+
+    /* H261 */
+    B(VLC_CODEC_H261, "H.261"),
+        A("H261"),
+        A("h261"),
+
+    B(VLC_CODEC_FLIC, "Flic Video"),
+        A("FLIC"),
+
+    /* MJPEG */
+    B(VLC_CODEC_MJPG, "Motion JPEG Video"),
+        A("MJPG"),
+        A("mjpg"),
+        A("mjpa"),
+        A("jpeg"),
+        A("JPEG"),
+        A("JFIF"),
+        A("JPGL"),
+        A("AVDJ"),
+        /* AVID MJPEG */
+        E("AVRn", "Avid Motion JPEG"),
+        E("ADJV", "Avid Motion JPEG"),
+        E("dmb1", "Motion JPEG OpenDML Video"),
+        E("IJPG", "Intergraph JPEG Video"),
+        E("ACDV", "ACD Systems Digital"),
+
+    B(VLC_CODEC_MJPGB, "Motion JPEG B Video"),
+        A("mjpb"),
+
+    B(VLC_CODEC_LJPG, "Lead Motion JPEG Video"),
+        A("LJPG"),
+
+    // ? from avcodec/fourcc.c but makes not sense.
+    //{ VLC_FOURCC( 'L','J','P','G' ), CODEC_ID_MJPEG,       VIDEO_ES, "Lead Motion JPEG Video" },
+
+    /* SP5x */
+    B(VLC_CODEC_SP5X, "Sunplus Motion JPEG Video"),
+        A("SP5X"),
+        A("SP53"),
+        A("SP54"),
+        A("SP55"),
+        A("SP56"),
+        A("SP57"),
+        A("SP58"),
+
+    /* DV */
+    B(VLC_CODEC_DV, "DV Video"),
+        A("dv  "),
+        A("dvsd"),
+        A("dvsl"),
+        A("DVSD"),
+        A("dvhd"),
+        A("dvhp"),
+        A("dvhq"),
+        A("dvh3"),
+        A("dvh5"),
+        A("dvh6"),
+        A("dv1n"),
+        A("dv1p"),
+        A("dvc "),
+        A("dv25"),
+        A("dvh1"),
+        E("dvcp", "DV Video PAL"),
+        E("dvp ", "DV Video Pro"),
+        E("dvpp", "DV Video Pro PAL"),
+        E("dv5p", "DV Video C Pro 50 PAL"),
+        E("dv5n", "DV Video C Pro 50 NTSC"),
+        E("AVdv", "AVID DV"),
+        E("AVd1", "AVID DV"),
+        E("CDVC", "Canopus DV Video"),
+        E("cdvc", "Canopus DV Video"),
+        E("CDVH", "Canopus DV Video"),
+
+    /* Windows Media Video */
+    B(VLC_CODEC_WMV1, "Windows Media Video 7"),
+        A("WMV1"),
+        A("wmv1"),
+
+    B(VLC_CODEC_WMV2, "Windows Media Video 8"),
+        A("WMV2"),
+        A("wmv2"),
+
+    B(VLC_CODEC_WMV3, "Windows Media Video 9"),
+        A("WMV3"),
+        A("wmv3"),
+
+    B(VLC_CODEC_WMVA, "Windows Media Video Advanced"),
+        A("WMVA"),
+        A("wmva"),
+        A("WVP2"),
+        A("wvp2"),
+
+    B(VLC_CODEC_VC1, "Windows Media Video VC1"),
+        A("WVC1"),
+        A("wvc1"),
+        A("vc-1"),
+        A("VC-1"),
+        /* WMVA is the VC-1 codec before the standardization proces,
+         * it is not bitstream compatible and deprecated  */
+        E("WMVA", "Windows Media Video Advanced Profile"),
+
+    /* Microsoft Video 1 */
+    B(VLC_CODEC_MSVIDEO1, "Microsoft Video 1"),
+        A("MSVC"),
+        A("msvc"),
+        A("CRAM"),
+        A("cram"),
+        A("WHAM"),
+        A("wham"),
+
+    /* Microsoft RLE */
+    B(VLC_CODEC_MSRLE, "Microsoft RLE Video"),
+        A("mrle"),
+        A("WRLE"),
+        A("\x01\x00\x00\x00"),
+        A("\x02\x00\x00\x00"),
+
+    /* Indeo Video Codecs (Quality of this decoder on ppc is not good) */
+    B(VLC_CODEC_INDEO3, "Indeo Video v3"),
+        A("IV31"),
+        A("iv31"),
+        A("IV32"),
+        A("iv32"),
+
+    /* Huff YUV */
+    B(VLC_CODEC_HUFFYUV, "Huff YUV Video"),
+        A("HFYU"),
+
+    B(VLC_CODEC_FFVHUFF, "Huff YUV Video"),
+        A("FFVH"),
+
+    /* On2 VP3 Video Codecs */
+    B(VLC_CODEC_VP3, "On2's VP3 Video"),
+        A("VP3 "),
+        A("VP30"),
+        A("VP31"),
+        A("vp31"),
+
+    /* On2  VP5, VP6 codecs */
+    B(VLC_CODEC_VP5, "On2's VP5 Video"),
+        A("VP5 "),
+        A("VP50"),
+
+    B(VLC_CODEC_VP6, "On2's VP6.2 Video"),
+        A("VP62"),
+        A("vp62"),
+        E("VP60", "On2's VP6.0 Video"),
+        E("VP61", "On2's VP6.1 Video"),
+
+    B(VLC_CODEC_VP6F, "On2's VP6.2 Video (Flash)"),
+        A("VP6F"),
+
+    B(VLC_CODEC_VP6A, "On2's VP6 A Video"),
+        A("VP6A"),
+
+    /* Xiph.org theora */
+    B(VLC_CODEC_THEORA, "Xiph.org's Theora Video"),
+        A("theo"),
+        A("Thra"),
+
+    /* Xiph.org tarkin */
+    B(VLC_CODEC_TARKIN, "Xiph.org's Tarkin Video"),
+        A("tark"),
+
+    /* Asus Video (Another thing that doesn't work on PPC) */
+    B(VLC_CODEC_ASV1, "Asus V1 Video"),
+        A("ASV1"),
+    B(VLC_CODEC_ASV2, "Asus V2 Video"),
+        A("ASV2"),
+
+    /* FFMPEG Video 1 (lossless codec) */
+    B(VLC_CODEC_FFV1, "FFMpeg Video 1"),
+        A("FFV1"),
+
+    /* ATI VCR1 */
+    B(VLC_CODEC_VCR1, "ATI VCR1 Video"),
+        A("VCR1"),
+
+    /* Cirrus Logic AccuPak */
+    B(VLC_CODEC_CLJR, "Creative Logic AccuPak"),
+        A("CLJR"),
+
+    /* Real Video */
+    B(VLC_CODEC_RV10, "Real Video 1.0"),
+        A("RV10"),
+        A("rv10"),
+
+    B(VLC_CODEC_RV13, "Real Video 1.3"),
+        A("RV13"),
+        A("rv13"),
+
+    B(VLC_CODEC_RV20, "Real Video 2.0"),
+        A("RV20"),
+        A("rv20"),
+
+    B(VLC_CODEC_RV30, "Real Video 3.0"),
+        A("RV30"),
+        A("rv30"),
+
+    B(VLC_CODEC_RV40, "Real Video 4.0"),
+        A("RV40"),
+        A("rv40"),
+
+    /* Apple Video */
+    B(VLC_CODEC_RPZA, "Apple Video"),
+        A("rpza"),
+        A("azpr"),
+
+    B(VLC_CODEC_SMC, "Apple graphics"),
+        A("smc "),
+
+    B(VLC_CODEC_CINEPAK, "Cinepak Video"),
+        A("CVID"),
+        A("cvid"),
+
+    /* Screen Capture Video Codecs */
+    B(VLC_CODEC_TSCC, "TechSmith Camtasia Screen Capture"),
+        A("TSCC"),
+        A("tscc"),
+
+    B(VLC_CODEC_CSCD, "CamStudio Screen Codec"),
+        A("CSCD"),
+        A("cscd"),
+
+    B(VLC_CODEC_ZMBV, "DosBox Capture Codec"),
+        A("ZMBV"),
+
+    B(VLC_CODEC_VMNC, "VMware Video"),
+        A("VMnc"),
+    B(VLC_CODEC_FRAPS, "FRAPS: Realtime Video Capture"),
+        A("FPS1"),
+        A("fps1"),
+
+    /* Duck TrueMotion */
+    B(VLC_CODEC_TRUEMOTION1, "Duck TrueMotion v1 Video"),
+        A("DUCK"),
+    B(VLC_CODEC_TRUEMOTION2, "Duck TrueMotion v2.0 Video"),
+        A("TM20"),
+
+    /* FFMPEG's SNOW wavelet codec */
+    B(VLC_CODEC_SNOW, "FFMpeg SNOW wavelet Video"),
+        A("SNOW"),
+        A("snow"),
+
+    B(VLC_CODEC_QTRLE, "Apple QuickTime RLE Video"),
+        A("rle "),
+
+    B(VLC_CODEC_QDRAW, "Apple QuickDraw Video"),
+        A("qdrw"),
+
+    B(VLC_CODEC_QPEG, "QPEG Video"),
+        A("QPEG"),
+        A("Q1.0"),
+        A("Q1.1"),
+
+    B(VLC_CODEC_ULTI, "IBM Ultimotion Video"),
+        A("ULTI"),
+
+    B(VLC_CODEC_VIXL, "Miro/Pinnacle VideoXL Video"),
+        A("VIXL"),
+        E("PIXL", "Pinnacle VideoXL Video"),
+
+    B(VLC_CODEC_LOCO, "LOCO Video"),
+        A("LOCO"),
+
+    B(VLC_CODEC_WNV1, "Winnov WNV1 Video"),
+        A("WNV1"),
+
+    B(VLC_CODEC_AASC, "Autodesc RLE Video"),
+        A("AASC"),
+
+    B(VLC_CODEC_INDEO2, "Indeo Video v2"),
+        A("IV20"),
+        A("RT21"),
+
+        /* Flash Screen Video */
+    B(VLC_CODEC_FLASHSV, "Flash Screen Video"),
+        A("FSV1"),
+    B(VLC_CODEC_KMVC, "Karl Morton's Video Codec (Worms)"),
+        A("KMVC"),
+
+    B(VLC_CODEC_NUV, "Nuppel Video"),
+        A("RJPG"),
+        A("NUV1"),
+
+    /* CODEC_ID_SMACKVIDEO */
+    B(VLC_CODEC_SMACKVIDEO, "Smacker Video"),
+        A("SMK2"),
+        A("SMK4"),
+
+    /* Chinese AVS - Untested */
+    B(VLC_CODEC_CAVS, "Chinese AVS"),
+        A("CAVS"),
+        A("AVs2"),
+
+    /* */
+    B(VLC_CODEC_DNXHD, "DNxHD"),
+        A("AVdn"),
+    B(VLC_CODEC_8BPS, "8BPS"),
+        A("8BPS"),
+    B(VLC_CODEC_MIMIC, "Mimic"),
+        A("ML2O"),
+
+    B(VLC_CODEC_CDG, "CD-G Video"),
+        A("CDG "),
+
+    /* */
+    B(VLC_CODEC_YV12, "Planar 4:2:0 YVU"),
+        A("YV12"),
+        A("yv12"),
+    B(VLC_CODEC_I420, "Planar 4:1:0 YUV"),
+        A("I410"),
+        A("YVU9"),
+    B(VLC_CODEC_I420, "Planar 4:1:1 YUV"),
+        A("I411"),
+    B(VLC_CODEC_I420, "Planar 4:2:0 YUV"),
+        A("I420"),
+        A("IYUV"),
+    B(VLC_CODEC_I422, "Planar 4:2:2 YUV"),
+        A("I422"),
+    B(VLC_CODEC_I444, "Planar 4:4:0 YUV"),
+        A("I440"),
+    B(VLC_CODEC_I444, "Planar 4:4:4 YUV"),
+        A("I444"),
+
+    B(VLC_CODEC_I420, "Planar 4:1:0 YUV full scale"),
+        A("J410"),
+    B(VLC_CODEC_I420, "Planar 4:1:1 YUV full scale"),
+        A("J411"),
+    B(VLC_CODEC_I420, "Planar 4:2:0 YUV full scale"),
+        A("J420"),
+    B(VLC_CODEC_I422, "Planar 4:2:2 YUV full scale"),
+        A("J422"),
+    B(VLC_CODEC_I444, "Planar 4:4:0 YUV full scale"),
+        A("J440"),
+    B(VLC_CODEC_I444, "Planar 4:4:4 YUV full scale"),
+        A("J444"),
+
+    B(VLC_CODEC_YUVP, "Palettized YUV with palette element Y:U:V:A"),
+        A("YUVP"),
+
+    B(VLC_CODEC_YUVA, "Planar YUV 4:4:4 Y:U:V:A"),
+        A("YUVA"),
+
+    B(VLC_CODEC_RGBP, "Palettized RGB with palette element R:G:B"),
+        A("RGBP"),
+
+    B(VLC_CODEC_RGB8, "8 bits RGB"),
+        A("RGB2"),
+    B(VLC_CODEC_RGB15, "15 bits RGB"),
+        A("RV15"),
+    B(VLC_CODEC_RGB16, "16 bits RGB"),
+        A("RV16"),
+    B(VLC_CODEC_RGB24, "24 bits RGB"),
+        A("RV24"),
+    B(VLC_CODEC_RGB32, "32 bits RGB"),
+        A("RV32"),
+    B(VLC_CODEC_RGBA, "32 bits RGBA"),
+        A("RGBA"),
+
+    B(VLC_CODEC_GREY, "8 bits greyscale"),
+        A("GREY"),
+        A("Y800"),
+        A("Y8  "),
+
+    B(VLC_CODEC_UYVY, "Packed YUV 4:2:2, U:Y:V:Y"),
+        A("UYVY"),
+        A("UYNV"),
+        A("Y422"),
+        A("2vuy"),
+        A("2Vuy"),
+        A("AVUI"),
+    B(VLC_CODEC_VYUY, "Packed YUV 4:2:2, V:Y:U:Y"),
+        A("VYUY"),
+    B(VLC_CODEC_YUYV, "Packed YUV 4:2:2, Y:U:Y:V"),
+        A("YUY2"),
+        A("YUYV"),
+        A("YUNV"),
+    B(VLC_CODEC_YVYU, "Packed YUV 4:2:2, Y:V:Y:U"),
+        A("YVYU"),
+
+    B(VLC_CODEC_Y211, "Packed YUV 2:1:1, Y:U:Y:V "),
+        A("Y211"),
+    B(VLC_CODEC_YMGA, "Planar Y, packed UV, from Matrox"),
+        A("YMGA"),
+    B(VLC_CODEC_CYUV, "Creative Packed YUV 4:2:2, U:Y:V:Y, reverted"),
+        A("cyuv"),
+        A("CYUV"),
+
+    /* Videogames Codecs */
+
+    /* Interplay MVE */
+    B(VLC_CODEC_INTERPLAY, "Interplay MVE Video"),
+        A("imve"),
+        A("INPV"),
+
+    /* Id Quake II CIN */
+    B(VLC_CODEC_IDCIN, "Id Quake II CIN Video"),
+        A("IDCI"),
+
+    /* 4X Technologies */
+    B(VLC_CODEC_4XM, "4X Technologies Video"),
+        A("4XMV"),
+        A("4xmv"),
+
+    /* Id RoQ */
+    B(VLC_CODEC_ROQ, "Id RoQ Video"),
+        A("RoQv"),
+
+    /* Sony Playstation MDEC */
+    B(VLC_CODEC_MDEC, "PSX MDEC Video"),
+        A("MDEC"),
+
+    /* Sierra VMD */
+    B(VLC_CODEC_VMDVIDEO, "Sierra VMD Video"),
+        A("VMDV"),
+        A("vmdv"),
+
+    B(VLC_CODEC_DIRAC, "Dirac" ),
+        A("drac"),
+
+    /* Image */
+    B(VLC_CODEC_PNG, "PNG Image"),
+        A("png "),
+
+    B(VLC_CODEC_PPM, "PPM Image"),
+        A("ppm "),
+
+    B(VLC_CODEC_PGM, "PGM Image"),
+        A("pgm "),
+
+    B(VLC_CODEC_PGMYUV, "PGM YUV Image"),
+        A("pgmy"),
+
+    B(VLC_CODEC_PAM, "PAM Image"),
+        A("pam "),
+
+    B(VLC_CODEC_JPEGLS, "Lossless JPEG"),
+        A("MJLS"),
+
+    B(VLC_CODEC_JPEG, "JPEG"),
+        A("jpeg"),
+        A("JPEG"),
+
+    B(VLC_CODEC_BMP, "BMP Image"),
+        A("bmp "),
+
+    B(VLC_CODEC_TIFF, "TIFF Image"),
+        A("tiff"),
+
+    B(VLC_CODEC_GIF, "GIF Image"),
+        A("gif "),
+
+
+    B(VLC_CODEC_TARGA, "Truevision Targa Image"),
+        A("tga "),
+        A("mtga"),
+        A("MTGA"),
+
+    B(VLC_CODEC_SGI, "SGI Image"),
+        A("sgi "),
+
+    B(VLC_CODEC_PNM, "Portable Anymap Image"),
+        A("pnm "),
+
+    B(VLC_CODEC_PCX, "Personal Computer Exchange Image"),
+        A("pcx "),
+
+    /* 3ivx delta 3.5 Unsupported
+     * putting it here gives extreme distorted images
+    { VLC_FOURCC('3','I','V','1'), CODEC_ID_MPEG4,
+      VIDEO_ES, "MPEG-4 Video" },
+    { VLC_FOURCC('3','i','v','1'), CODEC_ID_MPEG4,
+      VIDEO_ES, "MPEG-4 Video" }, */
+    B(0, "")
+};
+static const entry_t p_list_audio[] = {
+
+    /* Windows Media Audio 1 */
+    B(VLC_CODEC_WMA1, "Windows Media Audio 1"),
+        A("WMA1"),
+        A("wma1"),
+
+    /* Windows Media Audio 2 */
+    B(VLC_CODEC_WMA2, "Windows Media Audio 2"),
+        A("WMA2"),
+        A("wma2"),
+        A("wma "),
+
+    /* Windows Media Audio Professional */
+    B(VLC_CODEC_WMAP, "Windows Media Audio Professional"),
+        A("WMAP"),
+        A("wmap"),
+
+    /* Windows Media Audio Lossless */
+    B(VLC_CODEC_WMAL, "Windows Media Audio Lossless"),
+        A("WMAL"),
+        A("wmal"),
+
+    /* Windows Media Audio Speech */
+    B(VLC_CODEC_WMAS, "Windows Media Audio Speech"),
+        A("WMAS"),
+        A("wmas"),
+
+    /* DV Audio */
+    B(VLC_CODEC_DVAUDIO, "DV Audio"),
+        A("dvau"),
+        A("vdva"),
+        A("dvca"),
+        A("RADV"),
+
+    /* MACE-3 Audio */
+    B(VLC_CODEC_MACE3, "MACE-3 Audio"),
+        A("MAC3"),
+
+    /* MACE-6 Audio */
+    B(VLC_CODEC_MACE6, "MACE-6 Audio"),
+        A("MAC6"),
+
+    /* MUSEPACK7 Audio */
+    B(VLC_CODEC_MUSEPACK7, "MUSEPACK7 Audio"),
+        A("MPC "),
+
+    /* MUSEPACK8 Audio */
+    B(VLC_CODEC_MUSEPACK8, "MUSEPACK8 Audio"),
+        A("MPCK"),
+        A("MPC8"),
+
+    /* RealAudio 1.0 */
+    B(VLC_CODEC_RA_144, "RealAudio 1.0"),
+        A("14_4"),
+        A("lpcJ"),
+
+    /* RealAudio 2.0 */
+    B(VLC_CODEC_RA_288, "RealAudio 2.0"),
+        A("28_8"),
+
+    /* MPEG Audio layer 1/2/3 */
+    B(VLC_CODEC_MPGA, "MPEG Audio layer 1/2/3"),
+        A("mpga"),
+        A("mp3 "),
+        A(".mp3"),
+        A("MP3 "),
+        A("LAME"),
+        A("ms\x00\x50"),
+        A("ms\x00\x55"),
+
+    /* A52 Audio (aka AC3) */
+    B(VLC_CODEC_A52, "A52 Audio (aka AC3)"),
+        A("a52 "),
+        A("a52b"),
+        A("ac-3"),
+        A("ms\x20\x00"),
+
+    B(VLC_CODEC_EAC3, "A/52 B Audio (aka E-AC3)"),
+        A("eac3"),
+
+    /* DTS Audio */
+    B(VLC_CODEC_DTS, "DTS Audio"),
+        A("dts "),
+        A("dtsb"),
+        A("ms\x20\x01"),
+
+    /* AAC audio */
+    B(VLC_CODEC_MP4A, "MPEG AAC Audio"),
+        A("mp4a"),
+        A("aac "),
+
+    /* 4X Technologies */
+    B(VLC_CODEC_ADPCM_4XM, "4X Technologies Audio"),
+        A("4xma"),
+
+    /* EA ADPCM */
+    B(VLC_CODEC_ADPCM_EA, "EA ADPCM Audio"),
+        A("ADEA"),
+
+    /* Interplay DPCM */
+    B(VLC_CODEC_INTERPLAY_DPCM, "Interplay DPCM Audio"),
+        A("idpc"),
+
+    /* Id RoQ */
+    B(VLC_CODEC_ROQ_DPCM, "Id RoQ DPCM Audio"),
+        A("RoQa"),
+
+    /* DCIN Audio */
+    B(VLC_CODEC_DSICINAUDIO, "Delphine CIN Audio"),
+        A("DCIA"),
+
+    /* Sony Playstation XA ADPCM */
+    B(VLC_CODEC_ADPCM_XA, "PSX XA ADPCM Audio"),
+        A("xa  "),
+
+    /* ADX ADPCM */
+    B(VLC_CODEC_ADPCM_ADX, "ADX ADPCM Audio"),
+        A("adx "),
+
+    /* Westwood ADPCM */
+    B(VLC_CODEC_ADPCM_IMA_WS, "Westwood IMA ADPCM audio"),
+        A("AIWS"),
+
+    /* Sierra VMD */
+    B(VLC_CODEC_VMDAUDIO, "Sierra VMD Audio"),
+        A("vmda"),
+
+    /* G.726 ADPCM */
+    B(VLC_CODEC_ADPCM_G726, "G.726 ADPCM Audio"),
+        A("g726"),
+
+    /* AMR */
+    B(VLC_CODEC_AMR_NB, "AMR narrow band"),
+        A("samr"),
+
+    B(VLC_CODEC_AMR_WB, "AMR wide band"),
+        A("sawb"),
+
+    /* FLAC */
+    B(VLC_CODEC_FLAC, "FLAC (Free Lossless Audio Codec)"),
+        A("flac"),
+
+    /* ALAC */
+    B(VLC_CODEC_ALAC, "Apple Lossless Audio Codec"),
+        A("alac"),
+
+    /* QDM2 */
+    B(VLC_CODEC_QDM2, "QDM2 Audio"),
+        A("QDM2"),
+
+    /* COOK */
+    B(VLC_CODEC_COOK, "Cook Audio"),
+        A("cook"),
+
+    /* TTA: The Lossless True Audio */
+    B(VLC_CODEC_TTA, "The Lossless True Audio"),
+        A("TTA1"),
+
+    /* Shorten */
+    B(VLC_CODEC_SHORTEN, "Shorten Lossless Audio"),
+        A("shn "),
+        A("shrn"),
+
+    B(VLC_CODEC_WAVPACK, "WavPack"),
+        A("WVPK"),
+        A("wvpk"),
+
+    B(VLC_CODEC_GSM, "GSM Audio"),
+        A("gsm "),
+
+    B(VLC_CODEC_GSM_MS, "Microsoft GSM Audio"),
+        A("agsm"),
+
+    B(VLC_CODEC_ATRAC3, "atrac 3"),
+        A("atrc"),
+        A("\x70\x02\x00\x00"),
+
+    B(VLC_CODEC_SONIC, "Sonic"),
+        A("SONC"),
+
+    B(VLC_CODEC_IMC, "IMC" ),
+        A("\x01\x04\x00\x00"),
+
+    B(VLC_CODEC_TRUESPEECH,"TrueSpeech"),
+        A("\x22\x00\x00\x00"),
+
+    B(VLC_CODEC_NELLYMOSER, "NellyMoser ASAO"),
+        A("NELL"),
+
+    B(VLC_CODEC_APE, "Monkey's Audio"),
+        A("APE "),
+
+    B(VLC_CODEC_MLP, "MLP/TrueHD Audio"),
+        A("mlp "),
+
+    B(VLC_CODEC_QCELP, "QCELP Audio"),
+        A("Qclp"),
+
+    B(VLC_CODEC_SPEEX, "Speex Audio"),
+        A("spx "),
+        A("spxr"),
+
+    B(VLC_CODEC_VORBIS, "Vorbis Audio"),
+        A("vorb"),
+
+    B(VLC_CODEC_302M, "302M Audio"),
+        A("302m"),
+
+    B(VLC_CODEC_DVD_LPCM, "DVD LPCM Audio"),
+        A("lpcm"),
+
+    B(VLC_CODEC_BD_LPCM, "BD LPCM Audio"),
+        A("bpcm"),
+
+    B(VLC_CODEC_SDDS, "SDDS Audio"),
+        A("sdds"),
+        A("sddb"),
+
+    B(VLC_CODEC_MIDI, "MIDI Audio"),
+        A("MIDI"),
+
+    /* PCM */
+    B(VLC_CODEC_S8, "PCM S8"),
+        A("s8  "),
+
+    B(VLC_CODEC_U8, "PCM U8"),
+        A("u8  "),
+
+    B(VLC_CODEC_S16L, "PCM S16 LE"),
+        A("s16l"),
+
+    B(VLC_CODEC_S16B, "PCM S16 BE"),
+        A("s16b"),
+
+    B(VLC_CODEC_U16L, "PCM U16 LE"),
+        A("u16l"),
+
+    B(VLC_CODEC_U16B, "PCM U16 BE"),
+        A("u16b"),
+
+    B(VLC_CODEC_S24L, "PCM S24 LE"),
+        A("s24l"),
+        A("42ni"),  /* Quicktime */
+
+    B(VLC_CODEC_S24B, "PCM S24 BE"),
+        A("s24b"),
+        A("in24"),  /* Quicktime */
+
+    B(VLC_CODEC_U24L, "PCM U24 LE"),
+        A("u24l"),
+
+    B(VLC_CODEC_U24B, "PCM U24 BE"),
+        A("u24b"),
+
+    B(VLC_CODEC_S32L, "PCM S32 LE"),
+        A("s32l"),
+        A("23ni"),  /* Quicktime */
+
+    B(VLC_CODEC_S32B, "PCM S32 BE"),
+        A("s32b"),
+        A("in32"),  /* Quicktime */
+
+    B(VLC_CODEC_U32L, "PCM U32 LE"),
+        A("u32l"),
+
+    B(VLC_CODEC_U32B, "PCM U32 BE"),
+        A("u32b"),
+
+    B(VLC_CODEC_ALAW, "PCM ALAW"),
+        A("alaw"),
+
+    B(VLC_CODEC_MULAW, "PCM MU-LAW"),
+        A("mlaw"),
+        A("ulaw"),
+
+    B(VLC_CODEC_S24DAUD, "PCM DAUD"),
+        A("daud"),
+
+    B(VLC_CODEC_FI32, "32 bits fixed float"),
+        A("fi32"),
+
+    B(VLC_CODEC_FL32, "32 bits float"),
+        A("fl32"),
+
+    B(VLC_CODEC_FL32, "64 bits float"),
+        A("fl64"),
+
+    B(0, "")
+};
+static const entry_t p_list_spu[] = {
+
+    B(VLC_CODEC_SPU, "DVD Subtitles"),
+        A("spu "),
+        A("spub"),
+
+    B(VLC_CODEC_DVBS, "DVB Subtitles"),
+        A("dvbs"),
+
+    B(VLC_CODEC_SUBT, "Text subtitles with various tags"),
+        A("subt"),
+
+    B(VLC_CODEC_XSUB, "DivX XSUB subtitles"),
+        A("XSUB"),
+        A("xsub"),
+
+    B(VLC_CODEC_SSA, "SubStation Alpha subtitles"),
+        A("ssa "),
+
+    B(VLC_CODEC_TEXT, "Plain text subtitles"),
+        A("TEXT"),
+
+    B(VLC_CODEC_TELETEXT, "Teletext"),
+        A("telx"),
+
+    B(VLC_CODEC_TELETEXT, "Kate subtiles"),
+        A("kate"),
+
+    B(VLC_CODEC_CMML, "CMML annotations/metadata"),
+        A("cmml"),
+
+    B(VLC_CODEC_ITU_T140, "ITU T.140 subtitles"),
+        A("t140"),
+
+    B(VLC_CODEC_ITU_T140, "ITU T.140 subtitles"),
+        A("t140"),
+
+    B(VLC_CODEC_USF, "USF subtitles"),
+        A("usf "),
+
+    B(VLC_CODEC_OGT, "OGT subtitles"),
+        A("ogt "),
+
+    B(VLC_CODEC_CVD, "CVD subtitles"),
+        A("cvd "),
+
+    B(0, "")
+};
+
+/* Create a fourcc from a string.
+ * XXX it assumes that the string is at least four bytes */
+static inline vlc_fourcc_t CreateFourcc( const char *psz_fourcc )
+{
+    return VLC_FOURCC( psz_fourcc[0], psz_fourcc[1],
+                       psz_fourcc[2], psz_fourcc[3] );
+}
+
+/* */
+static entry_t Lookup( const entry_t p_list[], vlc_fourcc_t i_fourcc )
+{
+    const char *p_class = NULL;
+    const char *psz_description = NULL;
+
+    entry_t e = B(0, "");
+
+    for( int i = 0; ; i++ )
+    {
+        const entry_t *p = &p_list[i];
+        const vlc_fourcc_t i_entry_fourcc = CreateFourcc( p->p_fourcc );
+        const vlc_fourcc_t i_entry_class = CreateFourcc( p->p_class );
+
+        if( i_entry_fourcc == 0 )
+            break;
+
+        if( i_entry_class != 0 )
+        {
+            p_class = p->p_class;
+            psz_description = p->psz_description;
+        }
+
+        if( i_entry_fourcc == i_fourcc )
+        {
+            assert( p_class != NULL );
+
+            memcpy( e.p_class, p_class, 4 );
+            memcpy( e.p_fourcc, p->p_fourcc, 4 );
+            e.psz_description = p->psz_description ?: psz_description;
+            break;
+        }
+    }
+    return e;
+}
+
+/* */
+static entry_t Find( int i_cat, vlc_fourcc_t i_fourcc )
+{
+    entry_t e;
+
+    switch( i_cat )
+    {
+    case VIDEO_ES:
+        return Lookup( p_list_video, i_fourcc );
+    case AUDIO_ES:
+        return Lookup( p_list_audio, i_fourcc );
+    case SPU_ES:
+        return Lookup( p_list_spu, i_fourcc );
+
+    default:
+        e = Find( VIDEO_ES, i_fourcc );
+        if( CreateFourcc( e.p_class ) == 0 )
+            e = Find( AUDIO_ES, i_fourcc );
+        if( CreateFourcc( e.p_class ) == 0 )
+            e = Find( SPU_ES, i_fourcc );
+        return e;
+    }
+}
+
+/* */
+vlc_fourcc_t vlc_fourcc_GetCodec( int i_cat, vlc_fourcc_t i_fourcc )
+{
+    entry_t e = Find( i_cat, i_fourcc );
+
+    if( CreateFourcc( e.p_class ) == 0 )
+        return i_fourcc;
+    return CreateFourcc( e.p_class );
+}
+
+/* */
+const char *vlc_fourcc_GetDescription( int i_cat, vlc_fourcc_t i_fourcc )
+{
+    entry_t e = Find( i_cat, i_fourcc );
+
+    return e.psz_description;
+}
+