Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

ffmpeg.c

00001 /*****************************************************************************
00002  * ffmpeg.c: video decoder using ffmpeg library
00003  *****************************************************************************
00004  * Copyright (C) 1999-2001 the VideoLAN team
00005  * $Id: ffmpeg.c 13661 2005-12-10 15:41:01Z gbazin $
00006  *
00007  * Authors: Laurent Aimar <[email protected]>
00008  *          Gildas Bazin <[email protected]>
00009  *
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
00023  *****************************************************************************/
00024 
00025 /*****************************************************************************
00026  * Preamble
00027  *****************************************************************************/
00028 #include <vlc/vlc.h>
00029 #include <vlc/decoder.h>
00030 
00031 /* ffmpeg header */
00032 #define HAVE_MMX 1
00033 #ifdef HAVE_FFMPEG_AVCODEC_H
00034 #   include <ffmpeg/avcodec.h>
00035 #else
00036 #   include <avcodec.h>
00037 #endif
00038 
00039 #if LIBAVCODEC_BUILD < 4680
00040 #   error You must have a libavcodec >= 4680 (get CVS)
00041 #endif
00042 
00043 #include "ffmpeg.h"
00044 
00045 #ifdef LIBAVCODEC_PP
00046 #   ifdef HAVE_POSTPROC_POSTPROCESS_H
00047 #       include <postproc/postprocess.h>
00048 #   else
00049 #       include <libpostproc/postprocess.h>
00050 #   endif
00051 #endif
00052 
00053 /*****************************************************************************
00054  * decoder_sys_t: decoder descriptor
00055  *****************************************************************************/
00056 struct decoder_sys_t
00057 {
00058     /* Common part between video and audio decoder */
00059     int i_cat;
00060     int i_codec_id;
00061     char *psz_namecodec;
00062 
00063     AVCodecContext *p_context;
00064     AVCodec        *p_codec;
00065 };
00066 
00067 /****************************************************************************
00068  * Local prototypes
00069  ****************************************************************************/
00070 static int OpenDecoder( vlc_object_t * );
00071 static void CloseDecoder( vlc_object_t * );
00072 
00073 static char *enc_hq_list[] = { "rd", "bits", "simple" };
00074 static char *enc_hq_list_text[] = { N_("rd"), N_("bits"), N_("simple") };
00075 /*****************************************************************************
00076  * Module descriptor
00077  *****************************************************************************/
00078 vlc_module_begin();
00079     set_shortname( "FFmpeg");
00080     set_category( CAT_INPUT );
00081     set_subcategory( SUBCAT_INPUT_SCODEC );
00082     /* decoder main module */
00083 #if defined(MODULE_NAME_is_ffmpegaltivec) \
00084      || (defined(CAN_COMPILE_ALTIVEC) && !defined(NO_ALTIVEC_IN_FFMPEG))
00085     set_description( _("AltiVec ffmpeg audio/video decoder/encoder ((MS)MPEG4,SVQ1,H263,WMV,WMA)") );
00086     /*add_requirement( ALTIVEC );*/
00087     set_capability( "decoder", 71 );
00088 #else
00089     set_description( _("ffmpeg audio/video decoder/encoder ((MS)MPEG4,SVQ1,H263,WMV,WMA)") );
00090     set_capability( "decoder", 70 );
00091 #endif
00092     set_section( N_("Decoding") , NULL );
00093     set_callbacks( OpenDecoder, CloseDecoder );
00094 
00095     add_bool( "ffmpeg-dr", 1, NULL, DR_TEXT, DR_TEXT, VLC_TRUE );
00096     add_integer ( "ffmpeg-error-resilience", 1, NULL, ERROR_TEXT,
00097         ERROR_LONGTEXT, VLC_TRUE );
00098     add_integer ( "ffmpeg-workaround-bugs", 1, NULL, BUGS_TEXT, BUGS_LONGTEXT,
00099         VLC_FALSE );
00100     add_bool( "ffmpeg-hurry-up", 0, NULL, HURRYUP_TEXT, HURRYUP_LONGTEXT,
00101         VLC_FALSE );
00102     add_integer ( "ffmpeg-vismv", 0, NULL, VISMV_TEXT, VISMV_LONGTEXT,
00103         VLC_TRUE );
00104     add_integer ( "ffmpeg-lowres", 0, NULL, LOWRES_TEXT, LOWRES_LONGTEXT,
00105         VLC_TRUE );
00106         change_integer_range( 0, 2 );
00107 
00108 #ifdef LIBAVCODEC_PP
00109     add_integer( "ffmpeg-pp-q", 0, NULL, PP_Q_TEXT, PP_Q_LONGTEXT, VLC_FALSE );
00110     add_string( "ffmpeg-pp-name", "default", NULL, LIBAVCODEC_PP_TEXT,
00111         LIBAVCODEC_PP_LONGTEXT, VLC_TRUE );
00112 #endif
00113     add_integer( "ffmpeg-debug", 0, NULL, DEBUG_TEXT, DEBUG_LONGTEXT,
00114                  VLC_TRUE );
00115 
00116     /* chroma conversion submodule */
00117     add_submodule();
00118     set_capability( "chroma", 50 );
00119     set_callbacks( E_(OpenChroma), E_(CloseChroma) );
00120     set_description( _("ffmpeg chroma conversion") );
00121 
00122     /* encoder submodule */
00123     add_submodule();
00124     set_section( N_("Encoding") , NULL );
00125     set_description( _("ffmpeg audio/video encoder") );
00126     set_capability( "encoder", 100 );
00127     set_callbacks( E_(OpenEncoder), E_(CloseEncoder) );
00128 
00129     add_string( ENC_CFG_PREFIX "hq", "simple", NULL, ENC_HQ_TEXT,
00130                 ENC_HQ_LONGTEXT, VLC_FALSE );
00131         change_string_list( enc_hq_list, enc_hq_list_text, 0 );
00132     add_integer( ENC_CFG_PREFIX "keyint", 0, NULL, ENC_KEYINT_TEXT,
00133                  ENC_KEYINT_LONGTEXT, VLC_FALSE );
00134     add_integer( ENC_CFG_PREFIX "bframes", 0, NULL, ENC_BFRAMES_TEXT,
00135                  ENC_BFRAMES_LONGTEXT, VLC_FALSE );
00136     add_bool( ENC_CFG_PREFIX "hurry-up", 0, NULL, ENC_HURRYUP_TEXT,
00137               ENC_HURRYUP_LONGTEXT, VLC_FALSE );
00138     add_bool( ENC_CFG_PREFIX "interlace", 0, NULL, ENC_INTERLACE_TEXT,
00139               ENC_INTERLACE_LONGTEXT, VLC_TRUE );
00140     add_bool( ENC_CFG_PREFIX "interlace-me", 1, NULL, ENC_INTERLACE_ME_TEXT,
00141               ENC_INTERLACE_ME_LONGTEXT, VLC_TRUE );
00142     add_integer( ENC_CFG_PREFIX "vt", 0, NULL, ENC_VT_TEXT,
00143                  ENC_VT_LONGTEXT, VLC_TRUE );
00144     add_bool( ENC_CFG_PREFIX "pre-me", 0, NULL, ENC_PRE_ME_TEXT,
00145               ENC_PRE_ME_LONGTEXT, VLC_TRUE );
00146     add_bool( ENC_CFG_PREFIX "strict-rc", 0, NULL, ENC_RC_STRICT_TEXT,
00147               ENC_RC_STRICT_LONGTEXT, VLC_TRUE );
00148     add_integer( ENC_CFG_PREFIX "rc-buffer-size", 224*1024*8, NULL,
00149                  ENC_RC_BUF_TEXT, ENC_RC_BUF_LONGTEXT, VLC_TRUE );
00150     add_float( ENC_CFG_PREFIX "rc-buffer-aggressivity", 1.0, NULL,
00151                ENC_RC_BUF_AGGR_TEXT, ENC_RC_BUF_AGGR_LONGTEXT, VLC_TRUE );
00152     add_float( ENC_CFG_PREFIX "i-quant-factor", 0, NULL,
00153                ENC_IQUANT_FACTOR_TEXT, ENC_IQUANT_FACTOR_LONGTEXT, VLC_TRUE );
00154     add_integer( ENC_CFG_PREFIX "noise-reduction", 0, NULL,
00155                  ENC_NOISE_RED_TEXT, ENC_NOISE_RED_LONGTEXT, VLC_TRUE );
00156     add_bool( ENC_CFG_PREFIX "mpeg4-matrix", 0, NULL,
00157               ENC_MPEG4_MATRIX_TEXT, ENC_MPEG4_MATRIX_LONGTEXT, VLC_TRUE );
00158     add_integer( ENC_CFG_PREFIX "qmin", 0, NULL,
00159                  ENC_QMIN_TEXT, ENC_QMIN_LONGTEXT, VLC_TRUE );
00160     add_integer( ENC_CFG_PREFIX "qmax", 0, NULL,
00161                  ENC_QMAX_TEXT, ENC_QMAX_LONGTEXT, VLC_TRUE );
00162     add_bool( ENC_CFG_PREFIX "trellis", 0, NULL,
00163               ENC_TRELLIS_TEXT, ENC_TRELLIS_LONGTEXT, VLC_TRUE );
00164     add_float( ENC_CFG_PREFIX "qscale", 0, NULL,
00165                ENC_QSCALE_TEXT, ENC_QSCALE_LONGTEXT, VLC_TRUE );
00166     add_integer( ENC_CFG_PREFIX "strict", 0, NULL,
00167                  ENC_STRICT_TEXT, ENC_STRICT_LONGTEXT, VLC_TRUE );
00168     add_float( ENC_CFG_PREFIX "lumi-masking", 0.0, NULL,
00169                ENC_LUMI_MASKING_TEXT, ENC_LUMI_MASKING_LONGTEXT, VLC_TRUE );
00170     add_float( ENC_CFG_PREFIX "dark-masking", 0.0, NULL,
00171                ENC_DARK_MASKING_TEXT, ENC_DARK_MASKING_LONGTEXT, VLC_TRUE );
00172     add_float( ENC_CFG_PREFIX "p-masking", 0.0, NULL,
00173                ENC_P_MASKING_TEXT, ENC_P_MASKING_LONGTEXT, VLC_TRUE );
00174     add_float( ENC_CFG_PREFIX "border-masking", 0.0, NULL,
00175                ENC_BORDER_MASKING_TEXT, ENC_BORDER_MASKING_LONGTEXT, VLC_TRUE );
00176     add_integer( ENC_CFG_PREFIX "luma-elim-threshold", 0, NULL,
00177                  ENC_LUMA_ELIM_TEXT, ENC_LUMA_ELIM_LONGTEXT, VLC_TRUE );
00178     add_integer( ENC_CFG_PREFIX "chroma-elim-threshold", 0, NULL,
00179                  ENC_CHROMA_ELIM_TEXT, ENC_CHROMA_ELIM_LONGTEXT, VLC_TRUE );
00180 
00181     /* demux submodule */
00182     add_submodule();
00183     set_description( _("ffmpeg demuxer" ) );
00184     set_capability( "demux2", 2 );
00185     set_callbacks( E_(OpenDemux), E_(CloseDemux) );
00186 
00187     /* video filter submodule */
00188     add_submodule();
00189     set_capability( "video filter2", 50 );
00190     set_callbacks( E_(OpenFilter), E_(CloseFilter) );
00191     set_description( _("ffmpeg video filter") );
00192 
00193     /* video filter submodule */
00194     add_submodule();
00195     set_capability( "video filter2", 0 );
00196     set_callbacks( E_(OpenDeinterlace), E_(CloseDeinterlace) );
00197     set_description( _("ffmpeg deinterlace video filter") );
00198     add_shortcut( "ffmpeg-deinterlace" );
00199 
00200     var_Create( p_module->p_libvlc, "avcodec", VLC_VAR_MUTEX );
00201 vlc_module_end();
00202 
00203 /*****************************************************************************
00204  * OpenDecoder: probe the decoder and return score
00205  *****************************************************************************/
00206 static int OpenDecoder( vlc_object_t *p_this )
00207 {
00208     decoder_t *p_dec = (decoder_t*) p_this;
00209     int i_cat, i_codec_id, i_result;
00210     char *psz_namecodec;
00211 
00212     AVCodecContext *p_context;
00213     AVCodec        *p_codec;
00214 
00215     /* *** determine codec type *** */
00216     if( !E_(GetFfmpegCodec)( p_dec->fmt_in.i_codec, &i_cat, &i_codec_id,
00217                              &psz_namecodec ) )
00218     {
00219         return VLC_EGENERIC;
00220     }
00221 
00222     /* Bail out if buggy decoder */
00223     if( i_codec_id == CODEC_ID_AAC )
00224     {
00225         msg_Dbg( p_dec, "refusing to use ffmpeg's (%s) decoder which is buggy",
00226                  psz_namecodec );
00227         return VLC_EGENERIC;
00228     }
00229 
00230     /* Initialization must be done before avcodec_find_decoder() */
00231     E_(InitLibavcodec)(p_this);
00232 
00233     /* *** ask ffmpeg for a decoder *** */
00234     if( !( p_codec = avcodec_find_decoder( i_codec_id ) ) )
00235     {
00236         msg_Dbg( p_dec, "codec not found (%s)", psz_namecodec );
00237         return VLC_EGENERIC;
00238     }
00239 
00240     /* *** get a p_context *** */
00241     p_context = avcodec_alloc_context();
00242     p_context->debug = config_GetInt( p_dec, "ffmpeg-debug" );
00243     p_context->opaque = (void *)p_this;
00244 
00245     /* Set CPU capabilities */
00246     p_context->dsp_mask = 0;
00247     if( !(p_dec->p_libvlc->i_cpu & CPU_CAPABILITY_MMX) )
00248     {
00249         p_context->dsp_mask |= FF_MM_MMX;
00250     }
00251     if( !(p_dec->p_libvlc->i_cpu & CPU_CAPABILITY_MMXEXT) )
00252     {
00253         p_context->dsp_mask |= FF_MM_MMXEXT;
00254     }
00255     if( !(p_dec->p_libvlc->i_cpu & CPU_CAPABILITY_3DNOW) )
00256     {
00257         p_context->dsp_mask |= FF_MM_3DNOW;
00258     }
00259     if( !(p_dec->p_libvlc->i_cpu & CPU_CAPABILITY_SSE) )
00260     {
00261         p_context->dsp_mask |= FF_MM_SSE;
00262     }
00263     if( !(p_dec->p_libvlc->i_cpu & CPU_CAPABILITY_SSE2) )
00264     {
00265         p_context->dsp_mask |= FF_MM_SSE2;
00266     }
00267 
00268     switch( i_cat )
00269     {
00270     case VIDEO_ES:
00271         p_dec->b_need_packetized = VLC_TRUE;
00272         p_dec->pf_decode_video = E_(DecodeVideo);
00273         i_result = E_( InitVideoDec )( p_dec, p_context, p_codec,
00274                                        i_codec_id, psz_namecodec );
00275         break;
00276     case AUDIO_ES:
00277         p_dec->pf_decode_audio = E_(DecodeAudio);
00278         i_result = E_( InitAudioDec )( p_dec, p_context, p_codec,
00279                                        i_codec_id, psz_namecodec );
00280         break;
00281     default:
00282         i_result = VLC_EGENERIC;
00283     }
00284 
00285     if( i_result == VLC_SUCCESS ) p_dec->p_sys->i_cat = i_cat;
00286 
00287     return i_result;
00288 }
00289 
00290 /*****************************************************************************
00291  * CloseDecoder: decoder destruction
00292  *****************************************************************************/
00293 static void CloseDecoder( vlc_object_t *p_this )
00294 {
00295     decoder_t *p_dec = (decoder_t *)p_this;
00296     decoder_sys_t *p_sys = p_dec->p_sys;
00297     vlc_value_t lockval;
00298 
00299     var_Get( p_dec->p_libvlc, "avcodec", &lockval );
00300 
00301     switch( p_sys->i_cat )
00302     {
00303     case AUDIO_ES:
00304         E_( EndAudioDec )( p_dec );
00305         break;
00306     case VIDEO_ES:
00307         E_( EndVideoDec )( p_dec );
00308         break;
00309     }
00310 
00311     if( p_sys->p_context )
00312     {
00313         if( p_sys->p_context->extradata )
00314             free( p_sys->p_context->extradata );
00315 
00316         vlc_mutex_lock( lockval.p_address );
00317         avcodec_close( p_sys->p_context );
00318         vlc_mutex_unlock( lockval.p_address );
00319         msg_Dbg( p_dec, "ffmpeg codec (%s) stopped", p_sys->psz_namecodec );
00320         av_free( p_sys->p_context );
00321     }
00322 
00323     free( p_sys );
00324 }
00325 
00326 /*****************************************************************************
00327  * local Functions
00328  *****************************************************************************/
00329 static void LibavcodecCallback( void *p_opaque, int i_level,
00330                                 const char *psz_format, va_list va )
00331 {
00332     int i_vlc_level;
00333     AVCodecContext *p_avctx = (AVCodecContext *)p_opaque;
00334     AVClass *p_avc;
00335     vlc_object_t *p_this;
00336     char *psz_new_format;
00337     const char *psz_item_name;
00338 
00339     p_avc = p_avctx ? p_avctx->av_class : 0;
00340 
00341 #define cln p_avc->class_name
00342     /* Make sure we can get p_this back */
00343     if( !p_avctx || !p_avc || !cln ||
00344         cln[0]!='A' || cln[1]!='V' || cln[2]!='C' || cln[3]!='o' ||
00345         cln[4]!='d' || cln[5]!='e' || cln[6]!='c' )
00346     {
00347         if( i_level == AV_LOG_ERROR ) vfprintf( stderr, psz_format, va );
00348         return;
00349     }
00350 #undef cln
00351 
00352     p_this = (vlc_object_t *)p_avctx->opaque;
00353 
00354     switch( i_level )
00355     {
00356     case AV_LOG_QUIET:
00357         i_vlc_level = VLC_MSG_ERR;
00358         break;
00359     case AV_LOG_ERROR:
00360         i_vlc_level = VLC_MSG_WARN;
00361         break;
00362     case AV_LOG_INFO:
00363         i_vlc_level = VLC_MSG_DBG;
00364         break;
00365     case AV_LOG_DEBUG:
00366     default:
00367         return;
00368     }
00369 
00370     psz_item_name = p_avc->item_name(p_opaque);
00371     psz_new_format = malloc( strlen(psz_format) + strlen(psz_item_name)
00372                               + 18 + 5 );
00373     snprintf( psz_new_format, strlen(psz_format) + strlen(psz_item_name)
00374               + 18 + 5, "%s (%s@%p)", psz_format, p_avc->item_name(p_opaque), p_opaque );
00375     msg_GenericVa( p_this, i_vlc_level, MODULE_STRING, psz_new_format, va );
00376     free( psz_new_format );
00377 }
00378 
00379 void E_(InitLibavcodec)( vlc_object_t *p_object )
00380 {
00381     static int b_ffmpeginit = 0;
00382     vlc_value_t lockval;
00383 
00384     var_Get( p_object->p_libvlc, "avcodec", &lockval );
00385     vlc_mutex_lock( lockval.p_address );
00386 
00387     /* *** init ffmpeg library (libavcodec) *** */
00388     if( !b_ffmpeginit )
00389     {
00390         avcodec_init();
00391         avcodec_register_all();
00392         av_log_set_callback( LibavcodecCallback );
00393         b_ffmpeginit = 1;
00394 
00395         msg_Dbg( p_object, "libavcodec initialized (interface %d )",
00396                  LIBAVCODEC_BUILD );
00397     }
00398     else
00399     {
00400         msg_Dbg( p_object, "libavcodec already initialized" );
00401     }
00402 
00403     vlc_mutex_unlock( lockval.p_address );
00404 }
00405 
00406 /*****************************************************************************
00407  * Chroma fourcc -> ffmpeg_id mapping
00408  *****************************************************************************/
00409 static struct
00410 {
00411     vlc_fourcc_t  i_chroma;
00412     int  i_chroma_id;
00413 
00414 } chroma_table[] =
00415 {
00416     /* Planar YUV formats */
00417     { VLC_FOURCC('Y','U','V','A'), PIX_FMT_YUV444P }, /* Hack */
00418     { VLC_FOURCC('I','4','4','4'), PIX_FMT_YUV444P },
00419     { VLC_FOURCC('J','4','4','4'), PIX_FMT_YUVJ444P },
00420     { VLC_FOURCC('I','4','2','2'), PIX_FMT_YUV422P },
00421     { VLC_FOURCC('J','4','2','2'), PIX_FMT_YUVJ422P },
00422     { VLC_FOURCC('I','4','2','0'), PIX_FMT_YUV420P },
00423     { VLC_FOURCC('Y','V','1','2'), PIX_FMT_YUV420P },
00424     { VLC_FOURCC('I','Y','U','V'), PIX_FMT_YUV420P },
00425     { VLC_FOURCC('J','4','2','0'), PIX_FMT_YUVJ420P },
00426     { VLC_FOURCC('I','4','1','1'), PIX_FMT_YUV411P },
00427     { VLC_FOURCC('I','4','1','0'), PIX_FMT_YUV410P },
00428     { VLC_FOURCC('Y','V','U','9'), PIX_FMT_YUV410P },
00429 
00430     /* Packed YUV formats */
00431     { VLC_FOURCC('Y','U','Y','2'), PIX_FMT_YUV422 },
00432 #if LIBAVCODEC_BUILD >= 4720
00433     { VLC_FOURCC('U','Y','V','Y'), PIX_FMT_UYVY422 },
00434 #endif
00435 
00436     /* Packed RGB formats */
00437     { VLC_FOURCC('R','V','1','5'), PIX_FMT_RGB555 },
00438     { VLC_FOURCC('R','V','1','6'), PIX_FMT_RGB565 },
00439     { VLC_FOURCC('R','V','2','4'), PIX_FMT_RGB24 },
00440     { VLC_FOURCC('R','V','3','2'), PIX_FMT_RGBA32 },
00441     { VLC_FOURCC('G','R','E','Y'), PIX_FMT_GRAY8 },
00442 
00443     {0}
00444 };
00445 
00446 int E_(GetFfmpegChroma)( vlc_fourcc_t i_chroma )
00447 {
00448     int i;
00449 
00450     for( i = 0; chroma_table[i].i_chroma != 0; i++ )
00451     {
00452         if( chroma_table[i].i_chroma == i_chroma )
00453             return chroma_table[i].i_chroma_id;
00454     }
00455     return -1;
00456 }
00457 
00458 vlc_fourcc_t E_(GetVlcChroma)( int i_ffmpeg_chroma )
00459 {
00460     int i;
00461 
00462     for( i = 0; chroma_table[i].i_chroma != 0; i++ )
00463     {
00464         if( chroma_table[i].i_chroma_id == i_ffmpeg_chroma )
00465             return chroma_table[i].i_chroma;
00466     }
00467     return 0;
00468 }
00469 
00470 /*****************************************************************************
00471  * Codec fourcc -> ffmpeg_id mapping
00472  *****************************************************************************/
00473 static struct
00474 {
00475     vlc_fourcc_t  i_fourcc;
00476     int  i_codec;
00477     int  i_cat;
00478     char *psz_name;
00479 
00480 } codecs_table[] =
00481 {
00482     /* MPEG-1 Video */
00483     { VLC_FOURCC('m','p','1','v'), CODEC_ID_MPEG1VIDEO,
00484       VIDEO_ES, "MPEG-1 Video" },
00485 
00486     /* MPEG-2 Video */
00487     { VLC_FOURCC('m','p','2','v'), CODEC_ID_MPEG2VIDEO,
00488       VIDEO_ES, "MPEG-2 Video" },
00489     { VLC_FOURCC('m','p','g','v'), CODEC_ID_MPEG2VIDEO,
00490       VIDEO_ES, "MPEG-2 Video" },
00491 
00492     /* MPEG-4 Video */
00493     { VLC_FOURCC('D','I','V','X'), CODEC_ID_MPEG4,
00494       VIDEO_ES, "MPEG-4 Video" },
00495     { VLC_FOURCC('d','i','v','x'), CODEC_ID_MPEG4,
00496       VIDEO_ES, "MPEG-4 Video" },
00497     { VLC_FOURCC('M','P','4','S'), CODEC_ID_MPEG4,
00498       VIDEO_ES, "MPEG-4 Video" },
00499     { VLC_FOURCC('m','p','4','s'), CODEC_ID_MPEG4,
00500       VIDEO_ES, "MPEG-4 Video" },
00501     { VLC_FOURCC('M','4','S','2'), CODEC_ID_MPEG4,
00502       VIDEO_ES, "MPEG-4 Video" },
00503     { VLC_FOURCC('m','4','s','2'), CODEC_ID_MPEG4,
00504       VIDEO_ES, "MPEG-4 Video" },
00505     { VLC_FOURCC('x','v','i','d'), CODEC_ID_MPEG4,
00506       VIDEO_ES, "MPEG-4 Video" },
00507     { VLC_FOURCC('X','V','I','D'), CODEC_ID_MPEG4,
00508       VIDEO_ES, "MPEG-4 Video" },
00509     { VLC_FOURCC('X','v','i','D'), CODEC_ID_MPEG4,
00510       VIDEO_ES, "MPEG-4 Video" },
00511     { VLC_FOURCC('X','V','I','X'), CODEC_ID_MPEG4,
00512       VIDEO_ES, "MPEG-4 Video" },
00513     { VLC_FOURCC('x','v','i','x'), CODEC_ID_MPEG4,
00514       VIDEO_ES, "MPEG-4 Video" },
00515     { VLC_FOURCC('D','X','5','0'), CODEC_ID_MPEG4,
00516       VIDEO_ES, "MPEG-4 Video" },
00517     { VLC_FOURCC('d','x','5','0'), CODEC_ID_MPEG4,
00518       VIDEO_ES, "MPEG-4 Video" },
00519     { VLC_FOURCC('m','p','4','v'), CODEC_ID_MPEG4,
00520       VIDEO_ES, "MPEG-4 Video" },
00521     { VLC_FOURCC('M','P','4','V'), CODEC_ID_MPEG4,
00522       VIDEO_ES, "MPEG-4 Video" },
00523     { VLC_FOURCC( 4,  0,  0,  0 ), CODEC_ID_MPEG4,
00524       VIDEO_ES, "MPEG-4 Video" },
00525     { VLC_FOURCC('m','4','c','c'), CODEC_ID_MPEG4,
00526       VIDEO_ES, "MPEG-4 Video" },
00527     { VLC_FOURCC('M','4','C','C'), CODEC_ID_MPEG4,
00528       VIDEO_ES, "MPEG-4 Video" },
00529     { VLC_FOURCC('F','M','P','4'), CODEC_ID_MPEG4,
00530       VIDEO_ES, "MPEG-4 Video" },
00531     /* 3ivx delta 3.5 Unsupported
00532      * putting it here gives extreme distorted images
00533     { VLC_FOURCC('3','I','V','1'), CODEC_ID_MPEG4,
00534       VIDEO_ES, "MPEG-4 Video" },
00535     { VLC_FOURCC('3','i','v','1'), CODEC_ID_MPEG4,
00536       VIDEO_ES, "MPEG-4 Video" }, */
00537     /* 3ivx delta 4 */
00538     { VLC_FOURCC('3','I','V','2'), CODEC_ID_MPEG4,
00539       VIDEO_ES, "MPEG-4 Video" },
00540     { VLC_FOURCC('3','i','v','2'), CODEC_ID_MPEG4,
00541       VIDEO_ES, "MPEG-4 Video" },
00542 
00543     /* MSMPEG4 v1 */
00544     { VLC_FOURCC('D','I','V','1'), CODEC_ID_MSMPEG4V1,
00545       VIDEO_ES, "MS MPEG-4 Video v1" },
00546     { VLC_FOURCC('d','i','v','1'), CODEC_ID_MSMPEG4V1,
00547       VIDEO_ES, "MS MPEG-4 Video v1" },
00548     { VLC_FOURCC('M','P','G','4'), CODEC_ID_MSMPEG4V1,
00549       VIDEO_ES, "MS MPEG-4 Video v1" },
00550     { VLC_FOURCC('m','p','g','4'), CODEC_ID_MSMPEG4V1,
00551       VIDEO_ES, "MS MPEG-4 Video v1" },
00552 
00553     /* MSMPEG4 v2 */
00554     { VLC_FOURCC('D','I','V','2'), CODEC_ID_MSMPEG4V2,
00555       VIDEO_ES, "MS MPEG-4 Video v2" },
00556     { VLC_FOURCC('d','i','v','2'), CODEC_ID_MSMPEG4V2,
00557       VIDEO_ES, "MS MPEG-4 Video v2" },
00558     { VLC_FOURCC('M','P','4','2'), CODEC_ID_MSMPEG4V2,
00559       VIDEO_ES, "MS MPEG-4 Video v2" },
00560     { VLC_FOURCC('m','p','4','2'), CODEC_ID_MSMPEG4V2,
00561       VIDEO_ES, "MS MPEG-4 Video v2" },
00562 
00563     /* MSMPEG4 v3 / M$ mpeg4 v3 */
00564     { VLC_FOURCC('M','P','G','3'), CODEC_ID_MSMPEG4V3,
00565       VIDEO_ES, "MS MPEG-4 Video v3" },
00566     { VLC_FOURCC('m','p','g','3'), CODEC_ID_MSMPEG4V3,
00567       VIDEO_ES, "MS MPEG-4 Video v3" },
00568     { VLC_FOURCC('d','i','v','3'), CODEC_ID_MSMPEG4V3,
00569       VIDEO_ES, "MS MPEG-4 Video v3" },
00570     { VLC_FOURCC('M','P','4','3'), CODEC_ID_MSMPEG4V3,
00571       VIDEO_ES, "MS MPEG-4 Video v3" },
00572     { VLC_FOURCC('m','p','4','3'), CODEC_ID_MSMPEG4V3,
00573       VIDEO_ES, "MS MPEG-4 Video v3" },
00574     /* DivX 3.20 */
00575     { VLC_FOURCC('D','I','V','3'), CODEC_ID_MSMPEG4V3,
00576       VIDEO_ES, "MS MPEG-4 Video v3" },
00577     { VLC_FOURCC('D','I','V','4'), CODEC_ID_MSMPEG4V3,
00578       VIDEO_ES, "MS MPEG-4 Video v3" },
00579     { VLC_FOURCC('d','i','v','4'), CODEC_ID_MSMPEG4V3,
00580       VIDEO_ES, "MS MPEG-4 Video v3" },
00581     { VLC_FOURCC('D','I','V','5'), CODEC_ID_MSMPEG4V3,
00582       VIDEO_ES, "MS MPEG-4 Video v3" },
00583     { VLC_FOURCC('d','i','v','5'), CODEC_ID_MSMPEG4V3,
00584       VIDEO_ES, "MS MPEG-4 Video v3" },
00585     { VLC_FOURCC('D','I','V','6'), CODEC_ID_MSMPEG4V3,
00586       VIDEO_ES, "MS MPEG-4 Video v3" },
00587     { VLC_FOURCC('d','i','v','6'), CODEC_ID_MSMPEG4V3,
00588       VIDEO_ES, "MS MPEG-4 Video v3" },
00589     /* AngelPotion stuff */
00590     { VLC_FOURCC('A','P','4','1'), CODEC_ID_MSMPEG4V3,
00591       VIDEO_ES, "MS MPEG-4 Video v3" },
00592     /* 3ivx doctered divx files */
00593     { VLC_FOURCC('3','I','V','D'), CODEC_ID_MSMPEG4V3,
00594       VIDEO_ES, "MS MPEG-4 Video v3" },
00595     { VLC_FOURCC('3','i','v','d'), CODEC_ID_MSMPEG4V3,
00596       VIDEO_ES, "MS MPEG-4 Video v3" },
00597     /* who knows? */
00598     { VLC_FOURCC('3','V','I','D'), CODEC_ID_MSMPEG4V3,
00599       VIDEO_ES, "MS MPEG-4 Video v3" },
00600     { VLC_FOURCC('3','v','i','d'), CODEC_ID_MSMPEG4V3,
00601       VIDEO_ES, "MS MPEG-4 Video v3" },
00602 
00603     /* Sorenson v1 */
00604     { VLC_FOURCC('S','V','Q','1'), CODEC_ID_SVQ1,
00605       VIDEO_ES, "SVQ-1 (Sorenson Video v1)" },
00606 
00607     /* Sorenson v3 */
00608     { VLC_FOURCC('S','V','Q','3'), CODEC_ID_SVQ3,
00609       VIDEO_ES, "SVQ-3 (Sorenson Video v3)" },
00610 
00611     /* h264 */
00612     { VLC_FOURCC('h','2','6','4'), CODEC_ID_H264,
00613       VIDEO_ES, "h264" },
00614     { VLC_FOURCC('H','2','6','4'), CODEC_ID_H264,
00615       VIDEO_ES, "h264" },
00616     { VLC_FOURCC('x','2','6','4'), CODEC_ID_H264,
00617       VIDEO_ES, "h264" },
00618     /* avc1: special case h264 */
00619     { VLC_FOURCC('a','v','c','1'), CODEC_ID_H264,
00620       VIDEO_ES, "h264" },
00621     { VLC_FOURCC('V','S','S','H'), CODEC_ID_H264,
00622       VIDEO_ES, "h264" },
00623     { VLC_FOURCC('v','s','s','h'), CODEC_ID_H264,
00624       VIDEO_ES, "h264" },
00625 
00626 /* H263 and H263i */
00627 /* H263(+) is also known as Real Video 1.0 */
00628 
00629 /* FIXME FOURCC_H263P exist but what fourcc ? */
00630 
00631     /* H263 */
00632     { VLC_FOURCC('H','2','6','3'), CODEC_ID_H263,
00633       VIDEO_ES, "H263" },
00634     { VLC_FOURCC('h','2','6','3'), CODEC_ID_H263,
00635       VIDEO_ES, "H263" },
00636     { VLC_FOURCC('U','2','6','3'), CODEC_ID_H263,
00637       VIDEO_ES, "H263" },
00638     { VLC_FOURCC('M','2','6','3'), CODEC_ID_H263,
00639       VIDEO_ES, "H263" },
00640 
00641     /* H263i */
00642     { VLC_FOURCC('I','2','6','3'), CODEC_ID_H263I,
00643       VIDEO_ES, "I263.I" },
00644     { VLC_FOURCC('i','2','6','3'), CODEC_ID_H263I,
00645       VIDEO_ES, "I263.I" },
00646 
00647     /* Flash (H263) variant */
00648     { VLC_FOURCC('F','L','V','1'), CODEC_ID_FLV1,
00649       VIDEO_ES, "Flash Video" },
00650 
00651 #if LIBAVCODEC_BUILD > 4716
00652     { VLC_FOURCC('H','2','6','1'), CODEC_ID_H261,
00653       VIDEO_ES, "H.261" },
00654 #endif
00655 
00656 #if LIBAVCODEC_BUILD > 4680
00657     { VLC_FOURCC('F','L','I','C'), CODEC_ID_FLIC,
00658       VIDEO_ES, "Flic Video" },
00659 #endif
00660 
00661     /* MJPEG */
00662     { VLC_FOURCC( 'M', 'J', 'P', 'G' ), CODEC_ID_MJPEG,
00663       VIDEO_ES, "Motion JPEG Video" },
00664     { VLC_FOURCC( 'm', 'j', 'p', 'g' ), CODEC_ID_MJPEG,
00665       VIDEO_ES, "Motion JPEG Video" },
00666     { VLC_FOURCC( 'm', 'j', 'p', 'a' ), CODEC_ID_MJPEG, /* for mov file */
00667       VIDEO_ES, "Motion JPEG Video" },
00668     { VLC_FOURCC( 'j', 'p', 'e', 'g' ), CODEC_ID_MJPEG,
00669       VIDEO_ES, "Motion JPEG Video" },
00670     { VLC_FOURCC( 'J', 'P', 'E', 'G' ), CODEC_ID_MJPEG,
00671       VIDEO_ES, "Motion JPEG Video" },
00672     { VLC_FOURCC( 'J', 'F', 'I', 'F' ), CODEC_ID_MJPEG,
00673       VIDEO_ES, "Motion JPEG Video" },
00674     { VLC_FOURCC( 'J', 'P', 'G', 'L' ), CODEC_ID_MJPEG,
00675       VIDEO_ES, "Motion JPEG Video" },
00676 
00677     { VLC_FOURCC( 'm', 'j', 'p', 'b' ), CODEC_ID_MJPEGB, /* for mov file */
00678       VIDEO_ES, "Motion JPEG B Video" },
00679 
00680 #if LIBAVCODEC_BUILD > 4680
00681     { VLC_FOURCC( 'S', 'P', '5', 'X' ), CODEC_ID_SP5X,
00682       VIDEO_ES, "Sunplus Motion JPEG Video" },
00683 #endif
00684 
00685     /* DV */
00686     { VLC_FOURCC('d','v','s','l'), CODEC_ID_DVVIDEO,
00687       VIDEO_ES, "DV Video" },
00688     { VLC_FOURCC('d','v','s','d'), CODEC_ID_DVVIDEO,
00689       VIDEO_ES, "DV Video" },
00690     { VLC_FOURCC('D','V','S','D'), CODEC_ID_DVVIDEO,
00691       VIDEO_ES, "DV Video" },
00692     { VLC_FOURCC('d','v','h','d'), CODEC_ID_DVVIDEO,
00693       VIDEO_ES, "DV Video" },
00694     { VLC_FOURCC('d','v','c',' '), CODEC_ID_DVVIDEO,
00695       VIDEO_ES, "DV Video" },
00696     { VLC_FOURCC('d','v','p',' '), CODEC_ID_DVVIDEO,
00697       VIDEO_ES, "DV Video" },
00698     { VLC_FOURCC('C','D','V','C'), CODEC_ID_DVVIDEO,
00699       VIDEO_ES, "DV Video" },
00700 
00701     /* Windows Media Video */
00702     { VLC_FOURCC('W','M','V','1'), CODEC_ID_WMV1,
00703       VIDEO_ES, "Windows Media Video 1" },
00704     { VLC_FOURCC('W','M','V','2'), CODEC_ID_WMV2,
00705       VIDEO_ES, "Windows Media Video 2" },
00706 #if 0
00707     { VLC_FOURCC('W','M','V','3'), CODEC_ID_WMV3,
00708       VIDEO_ES, "Windows Media Video 3" },
00709     { VLC_FOURCC('V','C','9',' '), CODEC_ID_VC9,
00710       VIDEO_ES, "Windows Media Video VC9" },
00711 #endif
00712 
00713 #if LIBAVCODEC_BUILD >= 4683
00714     /* Microsoft Video 1 */
00715     { VLC_FOURCC('M','S','V','C'), CODEC_ID_MSVIDEO1,
00716       VIDEO_ES, "Microsoft Video 1" },
00717     { VLC_FOURCC('m','s','v','c'), CODEC_ID_MSVIDEO1,
00718       VIDEO_ES, "Microsoft Video 1" },
00719     { VLC_FOURCC('C','R','A','M'), CODEC_ID_MSVIDEO1,
00720       VIDEO_ES, "Microsoft Video 1" },
00721     { VLC_FOURCC('c','r','a','m'), CODEC_ID_MSVIDEO1,
00722       VIDEO_ES, "Microsoft Video 1" },
00723     { VLC_FOURCC('W','H','A','M'), CODEC_ID_MSVIDEO1,
00724       VIDEO_ES, "Microsoft Video 1" },
00725     { VLC_FOURCC('w','h','a','m'), CODEC_ID_MSVIDEO1,
00726       VIDEO_ES, "Microsoft Video 1" },
00727 
00728     /* Microsoft RLE */
00729     { VLC_FOURCC('m','r','l','e'), CODEC_ID_MSRLE,
00730       VIDEO_ES, "Microsoft RLE Video" },
00731     { VLC_FOURCC(0x1,0x0,0x0,0x0), CODEC_ID_MSRLE,
00732       VIDEO_ES, "Microsoft RLE Video" },
00733 #endif
00734 
00735     /* Indeo Video Codecs (Quality of this decoder on ppc is not good) */
00736     { VLC_FOURCC('I','V','3','1'), CODEC_ID_INDEO3,
00737       VIDEO_ES, "Indeo Video v3" },
00738     { VLC_FOURCC('i','v','3','1'), CODEC_ID_INDEO3,
00739       VIDEO_ES, "Indeo Video v3" },
00740     { VLC_FOURCC('I','V','3','2'), CODEC_ID_INDEO3,
00741       VIDEO_ES, "Indeo Video v3" },
00742     { VLC_FOURCC('i','v','3','2'), CODEC_ID_INDEO3,
00743       VIDEO_ES, "Indeo Video v3" },
00744 
00745 #if LIBAVCODEC_BUILD >= 4721
00746     { VLC_FOURCC('t','s','c','c'), CODEC_ID_TSCC,
00747       VIDEO_ES, "TechSmith Camtasia Screen Capture Video" },
00748 #endif
00749 
00750     /* Huff YUV */
00751     { VLC_FOURCC('H','F','Y','U'), CODEC_ID_HUFFYUV,
00752       VIDEO_ES, "Huff YUV Video" },
00753 
00754     /* Creative YUV */
00755     { VLC_FOURCC('C','Y','U','V'), CODEC_ID_CYUV,
00756       VIDEO_ES, "Creative YUV Video" },
00757 
00758     /* On2 VP3 Video Codecs */
00759     { VLC_FOURCC('V','P','3','1'), CODEC_ID_VP3,
00760       VIDEO_ES, "On2's VP3 Video" },
00761     { VLC_FOURCC('v','p','3','1'), CODEC_ID_VP3,
00762       VIDEO_ES, "On2's VP3 Video" },
00763 
00764 #if LIBAVCODEC_BUILD >= 4685
00765     /* Xiph.org theora */
00766     { VLC_FOURCC('t','h','e','o'), CODEC_ID_THEORA,
00767       VIDEO_ES, "Xiph.org's Theora Video" },
00768 #endif
00769 
00770 #if ( !defined( WORDS_BIGENDIAN ) )
00771     /* Asus Video (Another thing that doesn't work on PPC) */
00772     { VLC_FOURCC('A','S','V','1'), CODEC_ID_ASV1,
00773       VIDEO_ES, "Asus V1 Video" },
00774     { VLC_FOURCC('A','S','V','2'), CODEC_ID_ASV2,
00775       VIDEO_ES, "Asus V2 Video" },
00776 #endif
00777 
00778     /* FFMPEG Video 1 (lossless codec) */
00779     { VLC_FOURCC('F','F','V','1'), CODEC_ID_FFV1,
00780       VIDEO_ES, "FFMpeg Video 1" },
00781 
00782     /* ATI VCR1 */
00783     { VLC_FOURCC('V','C','R','1'), CODEC_ID_VCR1,
00784       VIDEO_ES, "ATI VCR1 Video" },
00785 
00786     /* Cirrus Logic AccuPak */
00787     { VLC_FOURCC('C','L','J','R'), CODEC_ID_CLJR,
00788       VIDEO_ES, "Creative Logic AccuPak" },
00789 
00790     /* Real Video */
00791     { VLC_FOURCC('R','V','1','0'), CODEC_ID_RV10,
00792       VIDEO_ES, "Real Video 10" },
00793     { VLC_FOURCC('R','V','1','3'), CODEC_ID_RV10,
00794       VIDEO_ES, "Real Video 13" },
00795 
00796 #if LIBAVCODEC_BUILD >= 4684
00797     /* Apple Video */
00798     { VLC_FOURCC('r','p','z','a'), CODEC_ID_RPZA,
00799       VIDEO_ES, "Apple Video" },
00800 
00801     { VLC_FOURCC('s','m','c',' '), CODEC_ID_SMC,
00802       VIDEO_ES, "Apple graphics" },
00803 
00804     /* Cinepak */
00805     { VLC_FOURCC('c','v','i','d'), CODEC_ID_CINEPAK,
00806       VIDEO_ES, "Cinepak Video" },
00807 
00808     /* Id Quake II CIN */
00809     { VLC_FOURCC('I','D','C','I'), CODEC_ID_IDCIN,
00810       VIDEO_ES, "Id Quake II CIN Video" },
00811 #endif
00812 
00813     /* 4X Technologies */
00814     { VLC_FOURCC('4','x','m','v'), CODEC_ID_4XM,
00815       VIDEO_ES, "4X Technologies Video" },
00816 
00817 #if LIBAVCODEC_BUILD >= 4694
00818     /* Duck TrueMotion */
00819     { VLC_FOURCC('D','U','C','K'), CODEC_ID_TRUEMOTION1,
00820       VIDEO_ES, "Duck TrueMotion v1 Video" },
00821 #endif
00822 
00823     /* Interplay MVE */
00824     { VLC_FOURCC('i','m','v','e'), CODEC_ID_INTERPLAY_VIDEO,
00825       VIDEO_ES, "Interplay MVE Video" },
00826 
00827     /* Id RoQ */
00828     { VLC_FOURCC('R','o','Q','v'), CODEC_ID_ROQ,
00829       VIDEO_ES, "Id RoQ Video" },
00830 
00831     /* Sony Playstation MDEC */
00832     { VLC_FOURCC('M','D','E','C'), CODEC_ID_MDEC,
00833       VIDEO_ES, "PSX MDEC Video" },
00834 
00835 #if LIBAVCODEC_BUILD >= 4699
00836     /* Sierra VMD */
00837     { VLC_FOURCC('v','m','d','v'), CODEC_ID_VMDVIDEO,
00838       VIDEO_ES, "Sierra VMD Video" },
00839 #endif
00840 
00841 #if LIBAVCODEC_BUILD >= 4719
00842     /* FFMPEG's SNOW wavelet codec */
00843     { VLC_FOURCC('S','N','O','W'), CODEC_ID_SNOW,
00844       VIDEO_ES, "FFMpeg SNOW wavelet Video" },
00845 #endif
00846 
00847 #if LIBAVCODEC_BUILD >= 4752
00848     { VLC_FOURCC('r','l','e',' '), CODEC_ID_QTRLE,
00849       VIDEO_ES, "Apple QuickTime RLE Video" },
00850 
00851     { VLC_FOURCC('q','d','r','w'), CODEC_ID_QDRAW,
00852       VIDEO_ES, "Apple QuickDraw Video" },
00853 
00854     { VLC_FOURCC('Q','P','E','G'), CODEC_ID_QPEG,
00855       VIDEO_ES, "QPEG Video" },
00856     { VLC_FOURCC('Q','1','.','0'), CODEC_ID_QPEG,
00857       VIDEO_ES, "QPEG Video" },
00858     { VLC_FOURCC('Q','1','.','1'), CODEC_ID_QPEG,
00859       VIDEO_ES, "QPEG Video" },
00860 
00861     { VLC_FOURCC('U','L','T','I'), CODEC_ID_ULTI,
00862       VIDEO_ES, "IBM Ultimotion Video" },
00863 
00864     { VLC_FOURCC('V','I','X','L'), CODEC_ID_VIXL,
00865       VIDEO_ES, "Miro/Pinnacle VideoXL Video" },
00866 
00867     { VLC_FOURCC('L','O','C','O'), CODEC_ID_LOCO,
00868       VIDEO_ES, "LOCO Video" },
00869 
00870     { VLC_FOURCC('W','N','V','1'), CODEC_ID_WNV1,
00871       VIDEO_ES, "Winnov WNV1 Video" },
00872 
00873     { VLC_FOURCC('A','A','S','C'), CODEC_ID_AASC,
00874       VIDEO_ES, "Autodesc RLE Video" },
00875 #endif
00876 #if LIBAVCODEC_BUILD >= 4753
00877     { VLC_FOURCC('I','V','2','0'), CODEC_ID_INDEO2,
00878       VIDEO_ES, "Indeo Video v2" },
00879     { VLC_FOURCC('R','T','2','1'), CODEC_ID_INDEO2,
00880       VIDEO_ES, "Indeo Video v2" },
00881 #endif
00882 
00883     /*
00884      *  Image codecs
00885      */
00886 
00887 #if LIBAVCODEC_BUILD >= 4731
00888     { VLC_FOURCC('p','n','g',' '), CODEC_ID_PNG,
00889       VIDEO_ES, "PNG Image" },
00890     { VLC_FOURCC('p','p','m',' '), CODEC_ID_PPM,
00891       VIDEO_ES, "PPM Image" },
00892     { VLC_FOURCC('p','g','m',' '), CODEC_ID_PGM,
00893       VIDEO_ES, "PGM Image" },
00894     { VLC_FOURCC('p','g','m','y'), CODEC_ID_PGMYUV,
00895       VIDEO_ES, "PGM YUV Image" },
00896     { VLC_FOURCC('p','a','m',' '), CODEC_ID_PAM,
00897       VIDEO_ES, "PAM Image" },
00898 #endif
00899 
00900 #if LIBAVCODEC_BUILD >= ((51<<16)+(0<<8)+0)
00901     { VLC_FOURCC('b','m','p',' '), CODEC_ID_BMP,
00902       VIDEO_ES, "BMP Image" },
00903 #endif
00904 
00905     /*
00906      *  Audio Codecs
00907      */
00908 
00909     /* Windows Media Audio 1 */
00910     { VLC_FOURCC('W','M','A','1'), CODEC_ID_WMAV1,
00911       AUDIO_ES, "Windows Media Audio 1" },
00912     { VLC_FOURCC('w','m','a','1'), CODEC_ID_WMAV1,
00913       AUDIO_ES, "Windows Media Audio 1" },
00914 
00915     /* Windows Media Audio 2 */
00916     { VLC_FOURCC('W','M','A','2'), CODEC_ID_WMAV2,
00917       AUDIO_ES, "Windows Media Audio 2" },
00918     { VLC_FOURCC('w','m','a','2'), CODEC_ID_WMAV2,
00919       AUDIO_ES, "Windows Media Audio 2" },
00920 
00921     /* DV Audio */
00922     { VLC_FOURCC('d','v','a','u'), CODEC_ID_DVAUDIO,
00923       AUDIO_ES, "DV Audio" },
00924 
00925     /* MACE-3 Audio */
00926     { VLC_FOURCC('M','A','C','3'), CODEC_ID_MACE3,
00927       AUDIO_ES, "MACE-3 Audio" },
00928 
00929     /* MACE-6 Audio */
00930     { VLC_FOURCC('M','A','C','6'), CODEC_ID_MACE6,
00931       AUDIO_ES, "MACE-6 Audio" },
00932 
00933     /* RealAudio 1.0 */
00934     { VLC_FOURCC('1','4','_','4'), CODEC_ID_RA_144,
00935       AUDIO_ES, "RealAudio 1.0" },
00936 
00937     /* RealAudio 2.0 */
00938     { VLC_FOURCC('2','8','_','8'), CODEC_ID_RA_288,
00939       AUDIO_ES, "RealAudio 2.0" },
00940 
00941     /* MPEG Audio layer 1/2/3 */
00942     { VLC_FOURCC('m','p','g','a'), CODEC_ID_MP2,
00943       AUDIO_ES, "MPEG Audio layer 1/2" },
00944     { VLC_FOURCC('m','p','3',' '), CODEC_ID_MP3,
00945       AUDIO_ES, "MPEG Audio layer 1/2/3" },
00946 
00947     /* A52 Audio (aka AC3) */
00948     { VLC_FOURCC('a','5','2',' '), CODEC_ID_AC3,
00949       AUDIO_ES, "A52 Audio (aka AC3)" },
00950     { VLC_FOURCC('a','5','2','b'), CODEC_ID_AC3, /* VLC specific hack */
00951       AUDIO_ES, "A52 Audio (aka AC3)" },
00952 
00953 #if LIBAVCODEC_BUILD >= 4719
00954     /* DTS Audio */
00955     { VLC_FOURCC('d','t','s',' '), CODEC_ID_DTS,
00956       AUDIO_ES, "DTS Audio" },
00957 #endif
00958 
00959     /* AAC audio */
00960     { VLC_FOURCC('m','p','4','a'), CODEC_ID_AAC,
00961       AUDIO_ES, "MPEG AAC Audio" },
00962 
00963     /* 4X Technologies */
00964     { VLC_FOURCC('4','x','m','a'), CODEC_ID_ADPCM_4XM,
00965       AUDIO_ES, "4X Technologies Audio" },
00966 
00967     /* Interplay DPCM */
00968     { VLC_FOURCC('i','d','p','c'), CODEC_ID_INTERPLAY_DPCM,
00969       AUDIO_ES, "Interplay DPCM Audio" },
00970 
00971     /* Id RoQ */
00972     { VLC_FOURCC('R','o','Q','a'), CODEC_ID_ROQ_DPCM,
00973       AUDIO_ES, "Id RoQ DPCM Audio" },
00974 
00975 #if LIBAVCODEC_BUILD >= 4685
00976     /* Sony Playstation XA ADPCM */
00977     { VLC_FOURCC('x','a',' ',' '), CODEC_ID_ADPCM_XA,
00978       AUDIO_ES, "PSX XA ADPCM Audio" },
00979 
00980     /* ADX ADPCM */
00981     { VLC_FOURCC('a','d','x',' '), CODEC_ID_ADPCM_ADX,
00982       AUDIO_ES, "ADX ADPCM Audio" },
00983 #endif
00984 
00985 #if LIBAVCODEC_BUILD >= 4699
00986     /* Sierra VMD */
00987     { VLC_FOURCC('v','m','d','a'), CODEC_ID_VMDAUDIO,
00988       AUDIO_ES, "Sierra VMD Audio" },
00989 #endif
00990 
00991 #if LIBAVCODEC_BUILD >= 4706
00992     /* G.726 ADPCM */
00993     { VLC_FOURCC('g','7','2','6'), CODEC_ID_ADPCM_G726,
00994       AUDIO_ES, "G.726 ADPCM Audio" },
00995 #endif
00996 
00997 #if LIBAVCODEC_BUILD >= 4683
00998     /* AMR */
00999     { VLC_FOURCC('s','a','m','r'), CODEC_ID_AMR_NB,
01000       AUDIO_ES, "AMR narrow band" },
01001     { VLC_FOURCC('s','a','w','b'), CODEC_ID_AMR_WB,
01002       AUDIO_ES, "AMR wide band" },
01003 #endif
01004 
01005 #if LIBAVCODEC_BUILD >= 4703
01006     /* FLAC */
01007     { VLC_FOURCC('f','l','a','c'), CODEC_ID_FLAC,
01008       AUDIO_ES, "FLAC (Free Lossless Audio Codec)" },
01009 #endif
01010 
01011 #if LIBAVCODEC_BUILD >= 4745
01012     /* ALAC */
01013     { VLC_FOURCC('a','l','a','c'), CODEC_ID_ALAC,
01014       AUDIO_ES, "Apple Lossless Audio Codec" },
01015 #endif
01016 
01017 #if LIBAVCODEC_BUILD >= ((50<<16)+(0<<8)+1)
01018     /* QDM2 */
01019     { VLC_FOURCC('Q','D','M','2'), CODEC_ID_QDM2,
01020       AUDIO_ES, "QDM2 Audio" },
01021 #endif
01022 
01023 #if LIBAVCODEC_BUILD >= ((51<<16)+(0<<8)+0)
01024     /* COOK */
01025     { VLC_FOURCC('c','o','o','k'), CODEC_ID_COOK,
01026       AUDIO_ES, "Cook Audio" },
01027 #endif
01028 
01029     /* PCM */
01030     { VLC_FOURCC('s','8',' ',' '), CODEC_ID_PCM_S8,
01031       AUDIO_ES, "PCM S8" },
01032     { VLC_FOURCC('u','8',' ',' '), CODEC_ID_PCM_U8,
01033       AUDIO_ES, "PCM U8" },
01034     { VLC_FOURCC('s','1','6','l'), CODEC_ID_PCM_S16LE,
01035       AUDIO_ES, "PCM S16 LE" },
01036     { VLC_FOURCC('s','1','6','b'), CODEC_ID_PCM_S16BE,
01037       AUDIO_ES, "PCM S16 BE" },
01038     { VLC_FOURCC('u','1','6','l'), CODEC_ID_PCM_U16LE,
01039       AUDIO_ES, "PCM U16 LE" },
01040     { VLC_FOURCC('u','1','6','b'), CODEC_ID_PCM_U16BE,
01041       AUDIO_ES, "PCM U16 BE" },
01042     { VLC_FOURCC('a','l','a','w'), CODEC_ID_PCM_ALAW,
01043       AUDIO_ES, "PCM ALAW" },
01044     { VLC_FOURCC('u','l','a','w'), CODEC_ID_PCM_MULAW,
01045       AUDIO_ES, "PCM ULAW" },
01046 
01047     {0}
01048 };
01049 
01050 int E_(GetFfmpegCodec)( vlc_fourcc_t i_fourcc, int *pi_cat,
01051                         int *pi_ffmpeg_codec, char **ppsz_name )
01052 {
01053     int i;
01054 
01055     for( i = 0; codecs_table[i].i_fourcc != 0; i++ )
01056     {
01057         if( codecs_table[i].i_fourcc == i_fourcc )
01058         {
01059             if( pi_cat ) *pi_cat = codecs_table[i].i_cat;
01060             if( pi_ffmpeg_codec ) *pi_ffmpeg_codec = codecs_table[i].i_codec;
01061             if( ppsz_name ) *ppsz_name = codecs_table[i].psz_name;
01062 
01063             return VLC_TRUE;
01064         }
01065     }
01066     return VLC_FALSE;
01067 }
01068 
01069 int E_(GetVlcFourcc)( int i_ffmpeg_codec, int *pi_cat,
01070                       vlc_fourcc_t *pi_fourcc, char **ppsz_name )
01071 {
01072     int i;
01073 
01074     for( i = 0; codecs_table[i].i_codec != 0; i++ )
01075     {
01076         if( codecs_table[i].i_codec == i_ffmpeg_codec )
01077         {
01078             if( pi_cat ) *pi_cat = codecs_table[i].i_cat;
01079             if( pi_fourcc ) *pi_fourcc = codecs_table[i].i_fourcc;
01080             if( ppsz_name ) *ppsz_name = codecs_table[i].psz_name;
01081 
01082             return VLC_TRUE;
01083         }
01084     }
01085     return VLC_FALSE;
01086 }

Generated on Tue Dec 20 10:14:29 2005 for vlc-0.8.4a by  doxygen 1.4.2