Used VLC_CODEC_* and vlc_fourcc_GetCodec when suitable.
authorLaurent Aimar <fenrir@videolan.org>
Mon, 11 May 2009 18:49:09 +0000 (20:49 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Wed, 13 May 2009 19:18:19 +0000 (21:18 +0200)
 There will be some regressions, I used automatic sed replacement with manual
checks but there was a lot to change.
 It's only the first pass.

230 files changed:
include/vlc_codecs.h
include/vlc_es.h
include/vlc_fourcc.h
modules/access/dc1394.c
modules/access/dshow/dshow.cpp
modules/access/dshow/filter.cpp
modules/access/jack.c
modules/access/oss.c
modules/access/qtcapture.m
modules/access/rtp/rtp.c
modules/access/rtp/xiph.c
modules/access/screen/beos.cpp
modules/access/screen/mac.c
modules/access/screen/screen.c
modules/access/screen/win32.c
modules/access/screen/x11.c
modules/access/v4l.c
modules/access/v4l2.c
modules/audio_filter/channel_mixer/dolby.c
modules/audio_filter/channel_mixer/headphone.c
modules/audio_filter/channel_mixer/simple.c
modules/audio_filter/channel_mixer/trivial.c
modules/audio_filter/converter/a52tofloat32.c
modules/audio_filter/converter/a52tospdif.c
modules/audio_filter/converter/dtstofloat32.c
modules/audio_filter/converter/dtstospdif.c
modules/audio_filter/converter/fixed.c
modules/audio_filter/converter/float.c
modules/audio_filter/converter/mpgatofixed32.c
modules/audio_filter/equalizer.c
modules/audio_filter/format.c
modules/audio_filter/normvol.c
modules/audio_filter/param_eq.c
modules/audio_filter/resampler/bandlimited.c
modules/audio_filter/resampler/linear.c
modules/audio_filter/resampler/trivial.c
modules/audio_filter/resampler/ugly.c
modules/audio_filter/scaletempo.c
modules/audio_filter/spatializer/spatializer.cpp
modules/audio_mixer/float32.c
modules/audio_mixer/trivial.c
modules/audio_output/alsa.c
modules/audio_output/auhal.c
modules/audio_output/directx.c
modules/audio_output/file.c
modules/audio_output/jack.c
modules/audio_output/oss.c
modules/audio_output/portaudio.c
modules/audio_output/pulse.c
modules/audio_output/sdl.c
modules/audio_output/waveout.c
modules/codec/a52.c
modules/codec/aes3.c
modules/codec/araw.c
modules/codec/avcodec/audio.c
modules/codec/avcodec/chroma.c
modules/codec/avcodec/encoder.c
modules/codec/avcodec/video.c
modules/codec/cc.c
modules/codec/cdg.c
modules/codec/csri.c
modules/codec/cvdsub.c
modules/codec/dirac.c
modules/codec/dmo/dmo.c
modules/codec/dts.c
modules/codec/dvbsub.c
modules/codec/faad.c
modules/codec/fake.c
modules/codec/flac.c
modules/codec/fluidsynth.c
modules/codec/invmem.c
modules/codec/kate.c
modules/codec/libass.c
modules/codec/libmpeg2.c
modules/codec/lpcm.c
modules/codec/mash.cpp
modules/codec/mpeg_audio.c
modules/codec/png.c
modules/codec/quicktime.c
modules/codec/rawvideo.c
modules/codec/realaudio.c
modules/codec/realvideo.c
modules/codec/schroedinger.c
modules/codec/sdl_image.c
modules/codec/speex.c
modules/codec/spudec/parse.c
modules/codec/spudec/spudec.c
modules/codec/subtitles/subsdec.c
modules/codec/subtitles/subsusf.c
modules/codec/subtitles/t140.c
modules/codec/svcdsub.c
modules/codec/tarkin.c
modules/codec/telx.c
modules/codec/theora.c
modules/codec/twolame.c
modules/codec/vorbis.c
modules/codec/wmafixed/wma.c
modules/codec/x264.c
modules/codec/xvmc/xxmc.c
modules/codec/zvbi.c
modules/demux/asf/asf.c
modules/demux/au.c
modules/demux/cdg.c
modules/demux/dirac.c
modules/demux/flac.c
modules/demux/live555.cpp
modules/demux/mjpeg.c
modules/demux/mkv/matroska_segment.cpp
modules/demux/mpc.c
modules/demux/mpeg/es.c
modules/demux/mpeg/h264.c
modules/demux/mpeg/mpgv.c
modules/demux/nuv.c
modules/demux/ogg.c
modules/demux/ps.c
modules/demux/ps.h
modules/demux/pva.c
modules/demux/rawdv.c
modules/demux/rawvid.c
modules/demux/smf.c
modules/demux/subtitle.c
modules/demux/subtitle_asa.c
modules/demux/ts.c
modules/demux/tta.c
modules/demux/ty.c
modules/demux/vobsub.c
modules/demux/voc.c
modules/demux/wav.c
modules/gui/beos/AudioOutput.cpp
modules/gui/beos/VideoWindow.h
modules/gui/fbosd.c
modules/gui/qnx/aout.c
modules/gui/qnx/vout.c
modules/gui/skins2/src/file_bitmap.cpp
modules/misc/dummy/aout.c
modules/misc/dummy/vout.c
modules/misc/freetype.c
modules/misc/osd/osd_menu.c
modules/misc/quartztext.c
modules/misc/rtsp.c
modules/misc/stats/vout.c
modules/misc/svg.c
modules/misc/win32text.c
modules/packetizer/copy.c
modules/packetizer/dirac.c
modules/packetizer/h264.c
modules/packetizer/mlp.c
modules/packetizer/mpeg4audio.c
modules/packetizer/mpeg4video.c
modules/packetizer/mpegvideo.c
modules/packetizer/vc1.c
modules/video_chroma/grey_yuv.c
modules/video_chroma/i420_rgb.c
modules/video_chroma/i420_ymga.c
modules/video_chroma/i420_yuy2.c
modules/video_chroma/i422_i420.c
modules/video_chroma/i422_yuy2.c
modules/video_chroma/yuy2_i420.c
modules/video_chroma/yuy2_i422.c
modules/video_filter/alphamask.c
modules/video_filter/atmo/atmo.cpp
modules/video_filter/blend.c
modules/video_filter/bluescreen.c
modules/video_filter/chain.c
modules/video_filter/crop.c
modules/video_filter/deinterlace.c
modules/video_filter/dynamicoverlay/dynamicoverlay.c
modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c
modules/video_filter/erase.c
modules/video_filter/extract.c
modules/video_filter/filter_picture.h
modules/video_filter/gaussianblur.c
modules/video_filter/invert.c
modules/video_filter/logo.c
modules/video_filter/magnify.c
modules/video_filter/marq.c
modules/video_filter/mosaic.c
modules/video_filter/motiondetect.c
modules/video_filter/opencv_example.cpp
modules/video_filter/opencv_wrapper.c
modules/video_filter/osdmenu.c
modules/video_filter/panoramix.c
modules/video_filter/postproc.c
modules/video_filter/remoteosd.c
modules/video_filter/rss.c
modules/video_filter/rv32.c
modules/video_filter/scale.c
modules/video_filter/swscale.c
modules/video_filter/swscale_maemo.c
modules/video_filter/transform.c
modules/video_filter/yuvp.c
modules/video_output/aa.c
modules/video_output/caca.c
modules/video_output/directfb.c
modules/video_output/fb.c
modules/video_output/ggi.c
modules/video_output/hd1000v.cpp
modules/video_output/mga.c
modules/video_output/msw/direct3d.c
modules/video_output/msw/directx.c
modules/video_output/msw/wingdi.c
modules/video_output/omapfb.c
modules/video_output/opengl.c
modules/video_output/opengllayer.m
modules/video_output/qte/qte.cpp
modules/video_output/sdl.c
modules/video_output/snapshot.c
modules/video_output/svgalib.c
modules/video_output/vmem.c
modules/video_output/x11/xcommon.c
modules/video_output/xcb/x11.c
modules/video_output/xcb/xvideo.c
modules/video_output/yuv.c
modules/visualization/galaktos/plugin.c
modules/visualization/goom.c
modules/visualization/visual/visual.c
src/audio_output/common.c
src/audio_output/output.c
src/input/decoder.c
src/input/es_out.c
src/misc/es_format.c
src/misc/image.c
src/osd/osd_text.c
src/osd/osd_widgets.c
src/video_output/video_output.c
src/video_output/video_text.c
src/video_output/vout_intf.c
src/video_output/vout_pictures.c
src/video_output/vout_pictures.h
src/video_output/vout_subpictures.c

index c9ff329..4236295 100644 (file)
@@ -24,6 +24,7 @@
 #ifndef VLC_CODECS_H
 #define VLC_CODECS_H 1
 
+#include <vlc_fourcc.h>
 /**
  * \file
  * This file defines codec related structures needed by the demuxers and decoders
@@ -302,35 +303,34 @@ wave_format_tag_to_fourcc[] =
     { WAVE_FORMAT_PCM,        VLC_FOURCC( 'a', 'r', 'a', 'w' ), "Raw audio" },
     { WAVE_FORMAT_ADPCM,      VLC_FOURCC( 'm', 's', 0x00,0x02), "ADPCM" },
     { WAVE_FORMAT_IEEE_FLOAT, VLC_FOURCC( 'a', 'f', 'l', 't' ), "IEEE Float audio" },
-    { WAVE_FORMAT_ALAW,       VLC_FOURCC( 'a', 'l', 'a', 'w' ), "A-Law" },
-    { WAVE_FORMAT_MULAW,      VLC_FOURCC( 'm', 'l', 'a', 'w' ), "Mu-Law" },
+    { WAVE_FORMAT_ALAW,       VLC_CODEC_ALAW,                   "A-Law" },
+    { WAVE_FORMAT_MULAW,      VLC_CODEC_MULAW,                  "Mu-Law" },
     { WAVE_FORMAT_IMA_ADPCM,  VLC_FOURCC( 'm', 's', 0x00,0x11), "Ima-ADPCM" },
-    { WAVE_FORMAT_GSM610,     VLC_FOURCC( 'a', 'g', 's', 'm' ), "Microsoft WAV GSM" },
-    { WAVE_FORMAT_G726,       VLC_FOURCC( 'g', '7', '2', '6' ), "G.726 ADPCM" },
-    { WAVE_FORMAT_MPEGLAYER3, VLC_FOURCC( 'm', 'p', 'g', 'a' ), "Mpeg Audio" },
-    { WAVE_FORMAT_MPEG,       VLC_FOURCC( 'm', 'p', 'g', 'a' ), "Mpeg Audio" },
-    { WAVE_FORMAT_A52,        VLC_FOURCC( 'a', '5', '2', ' ' ), "A/52" },
-    { WAVE_FORMAT_WMA1,       VLC_FOURCC( 'w', 'm', 'a', '1' ), "Window Media Audio v1" },
-    { WAVE_FORMAT_WMA2,       VLC_FOURCC( 'w', 'm', 'a', '2' ), "Window Media Audio v2" },
-    { WAVE_FORMAT_WMA2,       VLC_FOURCC( 'w', 'm', 'a', ' ' ), "Window Media Audio v2" },
-    { WAVE_FORMAT_WMAP,       VLC_FOURCC( 'w', 'm', 'a', 'p' ), "Window Media Audio 9 Professional" },
-    { WAVE_FORMAT_WMAL,       VLC_FOURCC( 'w', 'm', 'a', 'l' ), "Window Media Audio 9 Lossless" },
-    { WAVE_FORMAT_WMAS,       VLC_FOURCC( 'w', 'm', 'a', 's' ), "Window Media Audio 9 Speech" },
+    { WAVE_FORMAT_GSM610,     VLC_CODEC_GSM_MS,                 "Microsoft WAV GSM" },
+    { WAVE_FORMAT_G726,       VLC_CODEC_ADPCM_G726,             "G.726 ADPCM" },
+    { WAVE_FORMAT_MPEGLAYER3, VLC_CODEC_MPGA,                   "Mpeg Audio" },
+    { WAVE_FORMAT_MPEG,       VLC_CODEC_MPGA,                   "Mpeg Audio" },
+    { WAVE_FORMAT_A52,        VLC_CODEC_A52,                    "A/52" },
+    { WAVE_FORMAT_WMA1,       VLC_CODEC_WMA1,                   "Window Media Audio v1" },
+    { WAVE_FORMAT_WMA2,       VLC_CODEC_WMA2,                   "Window Media Audio v2" },
+    { WAVE_FORMAT_WMAP,       VLC_CODEC_WMAP,                   "Window Media Audio 9 Professional" },
+    { WAVE_FORMAT_WMAL,       VLC_CODEC_WMAL,                   "Window Media Audio 9 Lossless" },
+    { WAVE_FORMAT_WMAS,       VLC_CODEC_WMAS,                   "Window Media Audio 9 Speech" },
     { WAVE_FORMAT_DK3,        VLC_FOURCC( 'm', 's', 0x00,0x61), "Duck DK3" },
     { WAVE_FORMAT_DK4,        VLC_FOURCC( 'm', 's', 0x00,0x62), "Duck DK4" },
-    { WAVE_FORMAT_DTS,        VLC_FOURCC( 'd', 't', 's', ' ' ), "DTS Coherent Acoustics" },
-    { WAVE_FORMAT_DTS_MS,     VLC_FOURCC( 'd', 't', 's', ' ' ), "DTS Coherent Acoustics" },
-    { 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_DTS,        VLC_CODEC_DTS,                    "DTS Coherent Acoustics" },
+    { WAVE_FORMAT_DTS_MS,     VLC_CODEC_DTS,                    "DTS Coherent Acoustics" },
+    { WAVE_FORMAT_DIVIO_AAC,  VLC_CODEC_MP4A,                   "MPEG-4 Audio (Divio)" },
+    { WAVE_FORMAT_AAC,        VLC_CODEC_MP4A,                   "MPEG-4 Audio" },
+    { WAVE_FORMAT_FFMPEG_AAC, VLC_CODEC_MP4A,                   "MPEG-4 Audio" },
+    { WAVE_FORMAT_VORBIS,     VLC_CODEC_VORBIS,                 "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" },
     { WAVE_FORMAT_VORB_2PLUS, VLC_FOURCC( 'v', 'o', '2', '+' ), "Vorbis 2+ Audio" },
     { WAVE_FORMAT_VORB_3,     VLC_FOURCC( 'v', 'o', 'r', '3' ), "Vorbis 3 Audio" },
     { WAVE_FORMAT_VORB_3PLUS, VLC_FOURCC( 'v', 'o', '3', '+' ), "Vorbis 3+ Audio" },
-    { WAVE_FORMAT_SPEEX,      VLC_FOURCC( 's', 'p', 'x', ' ' ), "Speex Audio" },
+    { WAVE_FORMAT_SPEEX,      VLC_CODEC_SPEEX,                  "Speex Audio" },
     { WAVE_FORMAT_UNKNOWN,    VLC_FOURCC( 'u', 'n', 'd', 'f' ), "Unknown" }
 };
 
index ecaa843..ad19c51 100644 (file)
@@ -99,13 +99,8 @@ struct audio_format_t
     uint8_t      i_flavor;
 };
 
-#ifdef WORDS_BIGENDIAN
-#   define AUDIO_FMT_S16_NE VLC_FOURCC('s','1','6','b')
-#   define AUDIO_FMT_U16_NE VLC_FOURCC('u','1','6','b')
-#else
-#   define AUDIO_FMT_S16_NE VLC_FOURCC('s','1','6','l')
-#   define AUDIO_FMT_U16_NE VLC_FOURCC('u','1','6','l')
-#endif
+#define AUDIO_FMT_S16_NE VLC_CODEC_S16N
+#define AUDIO_FMT_U16_NE VLC_CODEC_U16N
 
 /**
  * video format description
index 6951228..c041a8e 100644 (file)
 #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, V:Y:U:Y */
+#define VLC_CODEC_VYUY      VLC_FOURCC('V','Y','U','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 */
index 9fa05aa..ab2cd1d 100644 (file)
@@ -478,11 +478,11 @@ static int Open( vlc_object_t *p_this )
     i_height = p_sys->camera.frame_height;
 
     i_aspect = vout_InitPicture( VLC_OBJECT(p_demux), &p_sys->pic,
-                    VLC_FOURCC('U', 'Y', 'V', 'Y'),
+                    VLC_CODEC_UYVY,
                     i_width, i_height,
                     i_width * VOUT_ASPECT_FACTOR / i_height );
 
-    es_format_Init( &fmt, VIDEO_ES, VLC_FOURCC('U', 'Y', 'V', 'Y') );
+    es_format_Init( &fmt, VIDEO_ES, VLC_CODEC_UYVY );
 
     fmt.video.i_width = i_width;
     fmt.video.i_height = i_height;
@@ -498,11 +498,11 @@ static int Open( vlc_object_t *p_this )
         if( p_sys->fd_audio >= 0 )
         {
             es_format_t fmt;
-            es_format_Init( &fmt, AUDIO_ES, VLC_FOURCC('a','r','a','w') );
+            es_format_Init( &fmt, AUDIO_ES, VLC_CODEC_S16L ); /* FIXME: hmm, ?? */
 
             fmt.audio.i_channels = p_sys->channels ? p_sys->channels : 1;
             fmt.audio.i_rate = p_sys->i_sample_rate;
-            fmt.audio.i_bitspersample = 16; /* FIXME: hmm, ?? */
+            fmt.audio.i_bitspersample = 16;
             fmt.audio.i_blockalign = fmt.audio.i_channels *
                                      fmt.audio.i_bitspersample / 8;
             fmt.i_bitrate = fmt.audio.i_channels * fmt.audio.i_rate *
index 5dbce84..729648a 100644 (file)
@@ -421,8 +421,9 @@ static int CommonOpen( vlc_object_t *p_this, access_sys_t *p_sys,
     var_Get( p_this, "dshow-chroma", &val );
     if( val.psz_string && strlen( val.psz_string ) >= 4 )
     {
-        i_chroma = VLC_FOURCC( val.psz_string[0], val.psz_string[1],
-                               val.psz_string[2], val.psz_string[3] );
+        i_chroma = vlc_fourcc_GetCodec( UNKNOWN_ES,
+                                        VLC_FOURCC( val.psz_string[0], val.psz_string[1],
+                                                    val.psz_string[2], val.psz_string[3] ) );
         p_sys->b_chroma = true;
     }
     free( val.psz_string );
@@ -488,11 +489,9 @@ static int CommonOpen( vlc_object_t *p_this, access_sys_t *p_sys,
         if( p_stream->mt.majortype == MEDIATYPE_Video )
         {
             if( /* Raw DV stream */
-                p_stream->i_fourcc == VLC_FOURCC('d','v','s','l') ||
-                p_stream->i_fourcc == VLC_FOURCC('d','v','s','d') ||
-                p_stream->i_fourcc == VLC_FOURCC('d','v','h','d') ||
+                p_stream->i_fourcc == VLC_CODEC_DV ||
                 /* Raw MPEG video stream */
-                p_stream->i_fourcc == VLC_FOURCC('m','p','2','v') )
+                p_stream->i_fourcc == VLC_CODEC_MP2V )
             {
                 b_use_audio = false;
 
@@ -668,7 +667,7 @@ static int DemuxOpen( vlc_object_t *p_this )
             }
 
             /* Setup rgb mask for RGB formats */
-            if( p_stream->i_fourcc == VLC_FOURCC('R','V','2','4') )
+            if( p_stream->i_fourcc == VLC_CODEC_RGB24 )
             {
                 /* This is in BGR format */
                 fmt.video.i_bmask = 0x00ff0000;
@@ -725,14 +724,12 @@ static int AccessOpen( vlc_object_t *p_this )
     /* Check if we need to force demuxers */
     if( !p_access->psz_demux || !*p_access->psz_demux )
     {
-        if( p_stream->i_fourcc == VLC_FOURCC('d','v','s','l') ||
-            p_stream->i_fourcc == VLC_FOURCC('d','v','s','d') ||
-            p_stream->i_fourcc == VLC_FOURCC('d','v','h','d') )
+        if( p_stream->i_fourcc == VLC_CODEC_DV )
         {
             free( p_access->psz_demux );
             p_access->psz_demux = strdup( "rawdv" );
         }
-        else if( p_stream->i_fourcc == VLC_FOURCC('m','p','2','v') )
+        else if( p_stream->i_fourcc == VLC_CODEC_MP2V )
         {
             free( p_access->psz_demux );
             p_access->psz_demux = strdup( "mpgv" );
@@ -912,17 +909,17 @@ static int GetFourCCPriority( int i_fourcc )
 {
     switch( i_fourcc )
     {
-    case VLC_FOURCC('I','4','2','0'):
-    case VLC_FOURCC('f','l','3','2'):
+    case VLC_CODEC_I420:
+    case VLC_CODEC_FL32:
         return 9;
-    case VLC_FOURCC('Y','V','1','2'):
+    case VLC_CODEC_YV12:
     case VLC_FOURCC('a','r','a','w'):
         return 8;
-    case VLC_FOURCC('R','V','2','4'):
+    case VLC_CODEC_RGB24:
         return 7;
-    case VLC_FOURCC('Y','U','Y','2'):
-    case VLC_FOURCC('R','V','3','2'):
-    case VLC_FOURCC('R','G','B','A'):
+    case VLC_CODEC_YUYV:
+    case VLC_CODEC_RGB32:
+    case VLC_CODEC_RGBA:
         return 6;
     }
 
@@ -1478,7 +1475,7 @@ static size_t EnumDeviceCaps( vlc_object_t *p_this, IBaseFilter *p_filter,
                                     val = i_bitspersample;
                                     if( ! val )
                                     {
-                                        if( VLC_FOURCC('f', 'l', '3', '2') == i_current_fourcc )
+                                        if( VLC_CODEC_FL32 == i_current_fourcc )
                                             val = 32;
                                         else
                                             val = 16;
@@ -1655,7 +1652,7 @@ static size_t EnumDeviceCaps( vlc_object_t *p_this, IBaseFilter *p_filter,
                 {
                     // output format for 'Hauppauge WinTV PVR PCI II Capture'
                     // try I420 as an input format
-                    i_current_fourcc = VLC_FOURCC('I','4','2','0');
+                    i_current_fourcc = VLC_CODEC_I420;
                     if( !i_fourcc || i_fourcc == i_current_fourcc )
                     {
                         // return alternative media type
@@ -1680,7 +1677,7 @@ static size_t EnumDeviceCaps( vlc_object_t *p_this, IBaseFilter *p_filter,
                             ((VIDEOINFOHEADER *)p_mt->pbFormat)->bmiHeader.biHeight;
                         vh.bmiHeader.biPlanes      = 3;
                         vh.bmiHeader.biBitCount    = 12;
-                        vh.bmiHeader.biCompression = VLC_FOURCC('I','4','2','0');
+                        vh.bmiHeader.biCompression = VLC_CODEC_I420;
                         vh.bmiHeader.biSizeImage   = vh.bmiHeader.biWidth * 12 *
                             vh.bmiHeader.biHeight / 8;
                         mtr.lSampleSize            = vh.bmiHeader.biSizeImage;
index 456aa87..8262e66 100644 (file)
@@ -242,67 +242,67 @@ int GetFourCCFromMediaType( const AM_MEDIA_TYPE &media_type )
             else if( media_type.subtype == MEDIASUBTYPE_RGB8 )
                i_fourcc = VLC_FOURCC( 'R', 'G', 'B', '8' );
             else if( media_type.subtype == MEDIASUBTYPE_RGB555 )
-               i_fourcc = VLC_FOURCC( 'R', 'V', '1', '5' );
+               i_fourcc = VLC_CODEC_RGB15;
             else if( media_type.subtype == MEDIASUBTYPE_RGB565 )
-               i_fourcc = VLC_FOURCC( 'R', 'V', '1', '6' );
+               i_fourcc = VLC_CODEC_RGB16;
             else if( media_type.subtype == MEDIASUBTYPE_RGB24 )
-               i_fourcc = VLC_FOURCC( 'R', 'V', '2', '4' );
+               i_fourcc = VLC_CODEC_RGB24;
             else if( media_type.subtype == MEDIASUBTYPE_RGB32 )
-               i_fourcc = VLC_FOURCC( 'R', 'V', '3', '2' );
+               i_fourcc = VLC_CODEC_RGB32;
             else if( media_type.subtype == MEDIASUBTYPE_ARGB32 )
-               i_fourcc = VLC_FOURCC( 'R', 'G', 'B', 'A' );
+               i_fourcc = VLC_CODEC_RGBA;
 
             /* Planar YUV formats */
             else if( media_type.subtype == MEDIASUBTYPE_I420 )
-               i_fourcc = VLC_FOURCC( 'I', '4', '2', '0' );
+               i_fourcc = VLC_CODEC_I420;
             else if( media_type.subtype == MEDIASUBTYPE_Y41P )
-               i_fourcc = VLC_FOURCC( 'I', '4', '1', '1' );
+               i_fourcc = VLC_CODEC_I411;
             else if( media_type.subtype == MEDIASUBTYPE_YV12 )
-               i_fourcc = VLC_FOURCC( 'Y', 'V', '1', '2' );
+               i_fourcc = VLC_CODEC_YV12;
             else if( media_type.subtype == MEDIASUBTYPE_IYUV )
-               i_fourcc = VLC_FOURCC( 'Y', 'V', '1', '2' );
+               i_fourcc = VLC_CODEC_YV12;
             else if( media_type.subtype == MEDIASUBTYPE_YVU9 )
-               i_fourcc = VLC_FOURCC( 'Y', 'V', 'U', '9' );
+               i_fourcc = VLC_CODEC_I410;
 
             /* Packed YUV formats */
             else if( media_type.subtype == MEDIASUBTYPE_YVYU )
-               i_fourcc = VLC_FOURCC( 'Y', 'V', 'Y', 'U' );
+               i_fourcc = VLC_CODEC_YVYU;
             else if( media_type.subtype == MEDIASUBTYPE_YUYV )
-               i_fourcc = VLC_FOURCC( 'Y', 'U', 'Y', '2' );
+               i_fourcc = VLC_CODEC_YUYV;
             else if( media_type.subtype == MEDIASUBTYPE_Y411 )
                i_fourcc = VLC_FOURCC( 'I', '4', '1', 'N' );
             else if( media_type.subtype == MEDIASUBTYPE_Y211 )
-               i_fourcc = VLC_FOURCC( 'Y', '2', '1', '1' );
+               i_fourcc = VLC_CODEC_Y211;
             else if( media_type.subtype == MEDIASUBTYPE_YUY2 )
-               i_fourcc = VLC_FOURCC( 'Y', 'U', 'Y', '2' );
+               i_fourcc = VLC_CODEC_YUYV;
             else if( media_type.subtype == MEDIASUBTYPE_UYVY )
-               i_fourcc = VLC_FOURCC( 'U', 'Y', 'V', 'Y' );
+               i_fourcc = VLC_CODEC_UYVY;
             /* HDYC uses UYVY sample positions but Rec709 colourimetry */
             /* FIXME: When VLC understands colourspace, something will need
              * to be added / changed here. Until then, just make it behave
              * like UYVY */
             else if( media_type.subtype == MEDIASUBTYPE_HDYC )
-                i_fourcc = VLC_FOURCC( 'U', 'Y', 'V', 'Y');
+                i_fourcc = VLC_CODEC_UYVY;
 
             /* MPEG2 video elementary stream */
             else if( media_type.subtype == MEDIASUBTYPE_MPEG2_VIDEO )
-               i_fourcc = VLC_FOURCC( 'm', 'p', '2', 'v' );
+               i_fourcc = VLC_CODEC_MP2V;
 
-        /* DivX video */
+            /* DivX video */
             else if( media_type.subtype == MEDIASUBTYPE_DIVX )
-               i_fourcc = VLC_FOURCC( 'D', 'I', 'V', 'X' );
+               i_fourcc = VLC_CODEC_MP4V;
 
             /* DV formats */
             else if( media_type.subtype == MEDIASUBTYPE_dvsl )
-               i_fourcc = VLC_FOURCC( 'd', 'v', 's', 'l' );
+               i_fourcc = VLC_CODEC_DV;
             else if( media_type.subtype == MEDIASUBTYPE_dvsd )
-               i_fourcc = VLC_FOURCC( 'd', 'v', 's', 'd' );
+               i_fourcc = VLC_CODEC_DV;
             else if( media_type.subtype == MEDIASUBTYPE_dvhd )
-               i_fourcc = VLC_FOURCC( 'd', 'v', 'h', 'd' );
+               i_fourcc = VLC_CODEC_DV;
 
             /* MJPEG format */
             else if( media_type.subtype == MEDIASUBTYPE_MJPG )
-                i_fourcc = VLC_FOURCC( 'M', 'J', 'P', 'G' );
+                i_fourcc = VLC_CODEC_MJPG;
 
         }
     }
@@ -314,7 +314,7 @@ int GetFourCCFromMediaType( const AM_MEDIA_TYPE &media_type )
             if( media_type.subtype == MEDIASUBTYPE_PCM )
                 i_fourcc = VLC_FOURCC( 'a', 'r', 'a', 'w' );
             else if( media_type.subtype == MEDIASUBTYPE_IEEE_FLOAT )
-                i_fourcc = VLC_FOURCC( 'f', 'l', '3', '2' );
+                i_fourcc = VLC_CODEC_FL32;
         }
     }
     else if( media_type.majortype == MEDIATYPE_Stream )
index 8e05040..ed87e88 100644 (file)
@@ -305,7 +305,7 @@ static int Open( vlc_object_t *p_this )
     p_sys->jack_sample_size = sizeof( jack_default_audio_sample_t );
 
     /* Define output format */
-    es_format_Init( &fmt, AUDIO_ES, VLC_FOURCC( 'f','l','3','2' ) );
+    es_format_Init( &fmt, AUDIO_ES, VLC_CODEC_FL32 );
     fmt.audio.i_channels =  p_sys->i_channels;
     fmt.audio.i_rate =  p_sys->jack_sample_rate;
     fmt.audio.i_bitspersample =  p_sys->jack_sample_size * 8;
index 7ea6527..140b0f9 100644 (file)
@@ -397,7 +397,7 @@ static int OpenAudioDev( demux_t *p_demux )
              p_sys->i_sample_rate );
 
     es_format_t fmt;
-    es_format_Init( &fmt, AUDIO_ES, VLC_FOURCC('a','r','a','w') );
+    es_format_Init( &fmt, AUDIO_ES, VLC_CODEC_S16L );
 
     fmt.audio.i_channels = p_sys->b_stereo ? 2 : 1;
     fmt.audio.i_rate = p_sys->i_sample_rate;
index 088378f..cc8f056 100644 (file)
@@ -171,8 +171,8 @@ static int qtchroma_to_fourcc( int i_qt )
     } qtchroma_to_fourcc[] =
     {
         /* Raw data types */
-        { k422YpCbCr8CodecType,    VLC_FOURCC('U','Y','V','Y') },
-        { kComponentVideoCodecType,VLC_FOURCC('Y','U','Y','2') },
+        { k422YpCbCr8CodecType,    VLC_CODEC_UYVY },
+        { kComponentVideoCodecType,VLC_CODEC_YUYV },
         { 0, 0 }
     };
     int i;
index 1f8c6f6..15075ad 100644 (file)
@@ -452,7 +452,7 @@ static void *pcmu_init (demux_t *demux)
 {
     es_format_t fmt;
 
-    es_format_Init (&fmt, AUDIO_ES, VLC_FOURCC ('u', 'l', 'a', 'w'));
+    es_format_Init (&fmt, AUDIO_ES, VLC_CODEC_MULAW);
     fmt.audio.i_rate = 8000;
     fmt.audio.i_channels = 1;
     return codec_init (demux, &fmt);
@@ -465,7 +465,7 @@ static void *gsm_init (demux_t *demux)
 {
     es_format_t fmt;
 
-    es_format_Init (&fmt, AUDIO_ES, VLC_FOURCC ('g', 's', 'm', ' '));
+    es_format_Init (&fmt, AUDIO_ES, VLC_CODEC_GSM);
     fmt.audio.i_rate = 8000;
     fmt.audio.i_channels = 1;
     return codec_init (demux, &fmt);
@@ -478,7 +478,7 @@ static void *pcma_init (demux_t *demux)
 {
     es_format_t fmt;
 
-    es_format_Init (&fmt, AUDIO_ES, VLC_FOURCC ('a', 'l', 'a', 'w'));
+    es_format_Init (&fmt, AUDIO_ES, VLC_CODEC_ALAW);
     fmt.audio.i_rate = 8000;
     fmt.audio.i_channels = 1;
     return codec_init (demux, &fmt);
@@ -491,7 +491,7 @@ static void *l16s_init (demux_t *demux)
 {
     es_format_t fmt;
 
-    es_format_Init (&fmt, AUDIO_ES, VLC_FOURCC ('s', '1', '6', 'b'));
+    es_format_Init (&fmt, AUDIO_ES, VLC_CODEC_S16B);
     fmt.audio.i_rate = 44100;
     fmt.audio.i_channels = 2;
     return codec_init (demux, &fmt);
@@ -501,7 +501,7 @@ static void *l16m_init (demux_t *demux)
 {
     es_format_t fmt;
 
-    es_format_Init (&fmt, AUDIO_ES, VLC_FOURCC ('s', '1', '6', 'b'));
+    es_format_Init (&fmt, AUDIO_ES, VLC_CODEC_S16B);
     fmt.audio.i_rate = 44100;
     fmt.audio.i_channels = 1;
     return codec_init (demux, &fmt);
@@ -514,7 +514,7 @@ static void *qcelp_init (demux_t *demux)
 {
     es_format_t fmt;
 
-    es_format_Init (&fmt, AUDIO_ES, VLC_FOURCC ('Q', 'c', 'l', 'p'));
+    es_format_Init (&fmt, AUDIO_ES, VLC_CODEC_QCELP);
     fmt.audio.i_rate = 8000;
     fmt.audio.i_channels = 1;
     return codec_init (demux, &fmt);
@@ -527,7 +527,7 @@ static void *mpa_init (demux_t *demux)
 {
     es_format_t fmt;
 
-    es_format_Init (&fmt, AUDIO_ES, VLC_FOURCC ('m', 'p', 'g', 'a'));
+    es_format_Init (&fmt, AUDIO_ES, VLC_CODEC_MPGA);
     fmt.audio.i_channels = 2;
     fmt.b_packetized = false;
     return codec_init (demux, &fmt);
@@ -555,7 +555,7 @@ static void *mpv_init (demux_t *demux)
 {
     es_format_t fmt;
 
-    es_format_Init (&fmt, VIDEO_ES, VLC_FOURCC ('m', 'p', 'g', 'v'));
+    es_format_Init (&fmt, VIDEO_ES, VLC_CODEC_MPGV);
     fmt.b_packetized = false;
     return codec_init (demux, &fmt);
 }
index 7f6492e..8a98bd6 100644 (file)
@@ -250,7 +250,7 @@ static void vorbis_decode (demux_t *demux, void *data, block_t *block)
                     break;
 
                 es_format_t fmt;
-                es_format_Init (&fmt, AUDIO_ES, VLC_FOURCC ('v','o','r','b'));
+                es_format_Init (&fmt, AUDIO_ES, VLC_CODEC_VORBIS);
                 fmt.p_extra = extv;
                 fmt.i_extra = extc;
                 codec_destroy (demux, self->id);
index 165250c..5f70cdc 100644 (file)
@@ -61,11 +61,11 @@ int screen_InitCapture( demux_t *p_demux )
     switch( p_data->p_screen->ColorSpace() )
     {
         case B_RGB32:
-            i_chroma = VLC_FOURCC('R','V','3','2');
+            i_chroma = VLC_CODEC_RGB32;
             i_bits_per_pixel = 32;
             break;
         case B_RGB16:
-            i_chroma = VLC_FOURCC('R','V','1','6');
+            i_chroma = VLC_CODEC_RGB16;
             i_bits_per_pixel = 16;
             break;
         default:
index 5b14fdd..f469bac 100644 (file)
@@ -129,7 +129,7 @@ int screen_InitCapture( demux_t *p_demux )
     CGLSetOffScreen( p_data->scaled, p_data->dest_width, p_data->dest_height,
                      p_data->dest_width * 4, p_data->scaled_image );
     
-    es_format_Init( &p_sys->fmt, VIDEO_ES, VLC_FOURCC( 'R','V','3','2' ) );
+    es_format_Init( &p_sys->fmt, VIDEO_ES, VLC_CODEC_RGB32 );
     
     /* p_sys->fmt.video.i_* must set to screen size, not subscreen size */
     p_sys->fmt.video.i_width = p_data->screen_width;
index e70b168..173823c 100644 (file)
@@ -212,7 +212,7 @@ static int Open( vlc_object_t *p_this )
         msg_Dbg( p_demux, "Using %s for the mouse pointer image", psz_mouse );
         memset( &fmt_in, 0, sizeof( fmt_in ) );
         memset( &fmt_out, 0, sizeof( fmt_out ) );
-        fmt_out.i_chroma = VLC_FOURCC('R','G','B','A');
+        fmt_out.i_chroma = VLC_CODEC_RGBA;
         p_image = image_HandlerCreate( p_demux );
         if( p_image )
         {
@@ -347,7 +347,7 @@ void RenderCursor( demux_t *p_demux, int i_x, int i_y,
         if( p_sys->p_blend )
         {
             es_format_Init( &p_sys->p_blend->fmt_in, VIDEO_ES,
-                            VLC_FOURCC('R','G','B','A') );
+                            VLC_CODEC_RGBA );
             p_sys->p_blend->fmt_in.video = p_sys->p_mouse->format;
             p_sys->p_blend->fmt_out = p_sys->fmt;
             p_sys->p_blend->p_module =
index e0cfd7a..01cac09 100644 (file)
@@ -81,14 +81,14 @@ int screen_InitCapture( demux_t *p_demux )
     switch( i_bits_per_pixel )
     {
     case 8: /* FIXME: set the palette */
-        i_chroma = VLC_FOURCC('R','G','B','2'); break;
+        i_chroma = VLC_CODEC_RGB8; break;
     case 15:
     case 16:    /* Yes it is really 15 bits (when using BI_RGB) */
-        i_chroma = VLC_FOURCC('R','V','1','5'); break;
+        i_chroma = VLC_CODEC_RGB15; break;
     case 24:
-        i_chroma = VLC_FOURCC('R','V','2','4'); break;
+        i_chroma = VLC_CODEC_RGB24; break;
     case 32:
-        i_chroma = VLC_FOURCC('R','V','3','2'); break;
+        i_chroma = VLC_CODEC_RGB32; break;
     default:
         msg_Err( p_demux, "unknown screen depth %i",
                  p_sys->fmt.video.i_bits_per_pixel );
@@ -108,17 +108,17 @@ int screen_InitCapture( demux_t *p_demux )
 
     switch( i_chroma )
     {
-    case VLC_FOURCC('R','V','1','5'):
+    case VLC_CODEC_RGB15:
         p_sys->fmt.video.i_rmask = 0x7c00;
         p_sys->fmt.video.i_gmask = 0x03e0;
         p_sys->fmt.video.i_bmask = 0x001f;
         break;
-    case VLC_FOURCC('R','V','2','4'):
+    case VLC_CODEC_RGB24:
         p_sys->fmt.video.i_rmask = 0x00ff0000;
         p_sys->fmt.video.i_gmask = 0x0000ff00;
         p_sys->fmt.video.i_bmask = 0x000000ff;
         break;
-    case VLC_FOURCC('R','V','3','2'):
+    case VLC_CODEC_RGB32:
         p_sys->fmt.video.i_rmask = 0x00ff0000;
         p_sys->fmt.video.i_gmask = 0x0000ff00;
         p_sys->fmt.video.i_bmask = 0x000000ff;
index 8723f15..1cb4a55 100644 (file)
@@ -68,14 +68,14 @@ int screen_InitCapture( demux_t *p_demux )
     switch( win_info.depth )
     {
     case 8: /* FIXME: set the palette */
-        i_chroma = VLC_FOURCC('R','G','B','2'); break;
+        i_chroma = VLC_CODEC_RGB8; break;
     case 15:
-        i_chroma = VLC_FOURCC('R','V','1','5'); break;
+        i_chroma = VLC_CODEC_RGB15; break;
     case 16:
-        i_chroma = VLC_FOURCC('R','V','1','6'); break;
+        i_chroma = VLC_CODEC_RGB16; break;
     case 24:
     case 32:
-        i_chroma = VLC_FOURCC('R','V','3','2');
+        i_chroma = VLC_CODEC_RGB32;
         win_info.depth = 32;
         break;
     default:
index 11261e7..197756c 100644 (file)
@@ -216,23 +216,21 @@ static const struct
 
 } v4lchroma_to_fourcc[] =
 {
-    { VIDEO_PALETTE_GREY, VLC_FOURCC( 'G', 'R', 'E', 'Y' ) },
+    { VIDEO_PALETTE_GREY, VLC_CODEC_GREY },
     { VIDEO_PALETTE_HI240, VLC_FOURCC( 'I', '2', '4', '0' ) },
-    { VIDEO_PALETTE_RGB565, VLC_FOURCC( 'R', 'V', '1', '6' ) },
-    { VIDEO_PALETTE_RGB555, VLC_FOURCC( 'R', 'V', '1', '5' ) },
-    { VIDEO_PALETTE_RGB24, VLC_FOURCC( 'R', 'V', '2', '4' ) },
-    { VIDEO_PALETTE_RGB32, VLC_FOURCC( 'R', 'V', '3', '2' ) },
-    { VIDEO_PALETTE_YUV422, VLC_FOURCC( 'Y', 'U', 'Y', '2' ) },
-    { VIDEO_PALETTE_YUV422, VLC_FOURCC( 'Y', 'U', 'Y', 'V' ) },
-    { VIDEO_PALETTE_YUYV, VLC_FOURCC( 'Y', 'U', 'Y', '2' ) },
-    { VIDEO_PALETTE_YUYV, VLC_FOURCC( 'Y', 'U', 'Y', 'V' ) },
-    { VIDEO_PALETTE_UYVY, VLC_FOURCC( 'U', 'Y', 'V', 'Y' ) },
+    { VIDEO_PALETTE_RGB565, VLC_CODEC_RGB16 },
+    { VIDEO_PALETTE_RGB555, VLC_CODEC_RGB15 },
+    { VIDEO_PALETTE_RGB24, VLC_CODEC_RGB24 },
+    { VIDEO_PALETTE_RGB32, VLC_CODEC_RGB32 },
+    { VIDEO_PALETTE_YUV422, VLC_CODEC_YUYV },
+    { VIDEO_PALETTE_YUYV, VLC_CODEC_YUYV },
+    { VIDEO_PALETTE_UYVY, VLC_CODEC_UYVY },
     { VIDEO_PALETTE_YUV420, VLC_FOURCC( 'I', '4', '2', 'N' ) },
     { VIDEO_PALETTE_YUV411, VLC_FOURCC( 'I', '4', '1', 'N' ) },
     { VIDEO_PALETTE_RAW, VLC_FOURCC( 'G', 'R', 'A', 'W' ) },
-    { VIDEO_PALETTE_YUV422P, VLC_FOURCC( 'I', '4', '2', '2' ) },
-    { VIDEO_PALETTE_YUV420P, VLC_FOURCC( 'I', '4', '2', '0' ) },
-    { VIDEO_PALETTE_YUV411P, VLC_FOURCC( 'I', '4', '1', '1' ) },
+    { VIDEO_PALETTE_YUV422P, VLC_CODEC_I422 },
+    { VIDEO_PALETTE_YUV420P, VLC_CODEC_I420 },
+    { VIDEO_PALETTE_YUV411P, VLC_CODEC_I411 },
     { 0, 0 }
 };
 
@@ -354,18 +352,18 @@ static int Open( vlc_object_t *p_this )
     /* Setup rgb mask for RGB formats */
     switch( p_sys->i_fourcc )
     {
-        case VLC_FOURCC('R','V','1','5'):
+        case VLC_CODEC_RGB15:
             fmt.video.i_rmask = 0x001f;
             fmt.video.i_gmask = 0x03e0;
             fmt.video.i_bmask = 0x7c00;
             break;
-        case VLC_FOURCC('R','V','1','6'):
+        case VLC_CODEC_RGB16:
             fmt.video.i_rmask = 0x001f;
             fmt.video.i_gmask = 0x07e0;
             fmt.video.i_bmask = 0xf800;
             break;
-        case VLC_FOURCC('R','V','2','4'):
-        case VLC_FOURCC('R','V','3','2'):
+        case VLC_CODEC_RGB24:
+        case VLC_CODEC_RGB32:
             fmt.video.i_rmask = 0x00ff0000;
             fmt.video.i_gmask = 0x0000ff00;
             fmt.video.i_bmask = 0x000000ff;
@@ -980,7 +978,8 @@ static int OpenVideoDev( demux_t *p_demux, char *psz_device )
             if( strlen( psz ) >= 4 )
             {
                 vid_picture.palette = 0;
-                int i_chroma = VLC_FOURCC( psz[0], psz[1], psz[2], psz[3] );
+                int i_chroma = vlc_fourcc_GetCodec( VIDEO_ES,
+                                                    VLC_FOURCC( psz[0], psz[1], psz[2], psz[3] ) );
 
                 /* Find out v4l chroma code */
                 for( i = 0; v4lchroma_to_fourcc[i].i_v4l != 0; i++ )
@@ -1056,7 +1055,7 @@ static int OpenVideoDev( demux_t *p_demux, char *psz_device )
             goto vdev_failed;
         }
 
-        p_sys->i_fourcc  = VLC_FOURCC( 'm','j','p','g' );
+        p_sys->i_fourcc  = VLC_CODEC_MJPG;
         p_sys->i_frame_pos = -1;
 
         /* queue up all the frames */
index 0e9b5b6..c6688d6 100644 (file)
@@ -400,35 +400,34 @@ static const struct
 } v4l2chroma_to_fourcc[] =
 {
     /* Raw data types */
-    { V4L2_PIX_FMT_GREY,    VLC_FOURCC('G','R','E','Y'), 0, 0, 0 },
+    { V4L2_PIX_FMT_GREY,    VLC_CODEC_GREY, 0, 0, 0 },
     { V4L2_PIX_FMT_HI240,   VLC_FOURCC('I','2','4','0'), 0, 0, 0 },
-    { V4L2_PIX_FMT_RGB555,  VLC_FOURCC('R','V','1','5'), 0x001f,0x03e0,0x7c00 },
-    { V4L2_PIX_FMT_RGB565,  VLC_FOURCC('R','V','1','6'), 0x001f,0x07e0,0xf800 },
+    { V4L2_PIX_FMT_RGB555,  VLC_CODEC_RGB15, 0x001f,0x03e0,0x7c00 },
+    { V4L2_PIX_FMT_RGB565,  VLC_CODEC_RGB16, 0x001f,0x07e0,0xf800 },
     /* Won't work since we don't know how to handle such gmask values
      * correctly
-    { V4L2_PIX_FMT_RGB555X, VLC_FOURCC('R','V','1','5'), 0x007c,0xe003,0x1f00 },
-    { V4L2_PIX_FMT_RGB565X, VLC_FOURCC('R','V','1','6'), 0x00f8,0xe007,0x1f00 },
+    { V4L2_PIX_FMT_RGB555X, VLC_CODEC_RGB15, 0x007c,0xe003,0x1f00 },
+    { V4L2_PIX_FMT_RGB565X, VLC_CODEC_RGB16, 0x00f8,0xe007,0x1f00 },
     */
-    { V4L2_PIX_FMT_BGR24,   VLC_FOURCC('R','V','2','4'), 0xff0000,0xff00,0xff },
-    { V4L2_PIX_FMT_RGB24,   VLC_FOURCC('R','V','2','4'), 0xff,0xff00,0xff0000 },
-    { V4L2_PIX_FMT_BGR32,   VLC_FOURCC('R','V','3','2'), 0xff0000,0xff00,0xff },
-    { V4L2_PIX_FMT_RGB32,   VLC_FOURCC('R','V','3','2'), 0xff,0xff00,0xff0000 },
-    { V4L2_PIX_FMT_YUYV,    VLC_FOURCC('Y','U','Y','2'), 0, 0, 0 },
-    { V4L2_PIX_FMT_YUYV,    VLC_FOURCC('Y','U','Y','V'), 0, 0, 0 },
-    { V4L2_PIX_FMT_UYVY,    VLC_FOURCC('U','Y','V','Y'), 0, 0, 0 },
+    { V4L2_PIX_FMT_BGR24,   VLC_CODEC_RGB24, 0xff0000,0xff00,0xff },
+    { V4L2_PIX_FMT_RGB24,   VLC_CODEC_RGB24, 0xff,0xff00,0xff0000 },
+    { V4L2_PIX_FMT_BGR32,   VLC_CODEC_RGB32, 0xff0000,0xff00,0xff },
+    { V4L2_PIX_FMT_RGB32,   VLC_CODEC_RGB32, 0xff,0xff00,0xff0000 },
+    { V4L2_PIX_FMT_YUYV,    VLC_CODEC_YUYV, 0, 0, 0 },
+    { V4L2_PIX_FMT_UYVY,    VLC_CODEC_UYVY, 0, 0, 0 },
     { V4L2_PIX_FMT_Y41P,    VLC_FOURCC('I','4','1','N'), 0, 0, 0 },
-    { V4L2_PIX_FMT_YUV422P, VLC_FOURCC('I','4','2','2'), 0, 0, 0 },
-    { V4L2_PIX_FMT_YVU420,  VLC_FOURCC('Y','V','1','2'), 0, 0, 0 },
-    { V4L2_PIX_FMT_YUV411P, VLC_FOURCC('I','4','1','1'), 0, 0, 0 },
-    { V4L2_PIX_FMT_YUV410,  VLC_FOURCC('I','4','1','0'), 0, 0, 0 },
+    { V4L2_PIX_FMT_YUV422P, VLC_CODEC_I422, 0, 0, 0 },
+    { V4L2_PIX_FMT_YVU420,  VLC_CODEC_YV12, 0, 0, 0 },
+    { V4L2_PIX_FMT_YUV411P, VLC_CODEC_I411, 0, 0, 0 },
+    { V4L2_PIX_FMT_YUV410,  VLC_CODEC_I410, 0, 0, 0 },
 
     /* Raw data types, not in V4L2 spec but still in videodev2.h and supported
      * by VLC */
-    { V4L2_PIX_FMT_YUV420,  VLC_FOURCC('I','4','2','0'), 0, 0, 0 },
-    /* FIXME { V4L2_PIX_FMT_RGB444,  VLC_FOURCC('R','V','3','2') }, */
+    { V4L2_PIX_FMT_YUV420,  VLC_CODEC_I420, 0, 0, 0 },
+    /* FIXME { V4L2_PIX_FMT_RGB444,  VLC_CODEC_RGB32 }, */
 
     /* Compressed data types */
-    { V4L2_PIX_FMT_MJPEG,   VLC_FOURCC('M','J','P','G'), 0, 0, 0 },
+    { V4L2_PIX_FMT_MJPEG,   VLC_CODEC_MJPG, 0, 0, 0 },
 #if 0
     { V4L2_PIX_FMT_JPEG,    VLC_FOURCC('J','P','E','G') },
     { V4L2_PIX_FMT_DV,      VLC_FOURCC('?','?','?','?') },
@@ -1951,9 +1950,10 @@ static int OpenVideoDev( vlc_object_t *p_obj, demux_sys_t *p_sys, bool b_demux )
         /* User specified chroma */
         if( strlen( p_sys->psz_requested_chroma ) >= 4 )
         {
-            int i_requested_fourcc = VLC_FOURCC(
+            int i_requested_fourcc = vlc_fourcc_GetCodec( VIDEO_ES,
+                                                          VLC_FOURCC(
                 p_sys->psz_requested_chroma[0], p_sys->psz_requested_chroma[1],
-                p_sys->psz_requested_chroma[2], p_sys->psz_requested_chroma[3] );
+                p_sys->psz_requested_chroma[2], p_sys->psz_requested_chroma[3] ) );
             for( int i = 0; v4l2chroma_to_fourcc[i].i_v4l2 != 0; i++ )
             {
                 if( v4l2chroma_to_fourcc[i].i_fourcc == i_requested_fourcc )
index 3b54cae..5e3810b 100644 (file)
@@ -97,8 +97,8 @@ static int Create( vlc_object_t *p_this )
         return VLC_EGENERIC;
     }
 
-    if ( p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
-          || p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
+    if ( p_filter->input.i_format != VLC_CODEC_FL32
+          || p_filter->output.i_format != VLC_CODEC_FL32 )
     {
         return VLC_EGENERIC;
     }
index 42d1bcd..c659cdf 100644 (file)
@@ -372,12 +372,12 @@ static int Create( vlc_object_t *p_this )
         p_filter->input.i_original_channels =
                                         p_filter->output.i_original_channels;
     }
-    if( p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
-          || p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
+    if( p_filter->input.i_format != VLC_CODEC_FL32
+          || p_filter->output.i_format != VLC_CODEC_FL32 )
     {
         b_fit = false;
-        p_filter->input.i_format = VLC_FOURCC('f','l','3','2');
-        p_filter->output.i_format = VLC_FOURCC('f','l','3','2');
+        p_filter->input.i_format = VLC_CODEC_FL32;
+        p_filter->output.i_format = VLC_CODEC_FL32;
     }
     if( p_filter->input.i_rate != p_filter->output.i_rate )
     {
@@ -580,12 +580,12 @@ static int OpenFilter( vlc_object_t *p_this )
         p_filter->fmt_in.audio.i_original_channels =
                                         p_filter->fmt_out.audio.i_original_channels;
     }
-    if( p_filter->fmt_in.audio.i_format != VLC_FOURCC('f','l','3','2')
-          || p_filter->fmt_out.audio.i_format != VLC_FOURCC('f','l','3','2') )
+    if( p_filter->fmt_in.audio.i_format != VLC_CODEC_FL32
+          || p_filter->fmt_out.audio.i_format != VLC_CODEC_FL32 )
     {
         b_fit = false;
-        p_filter->fmt_in.audio.i_format = VLC_FOURCC('f','l','3','2');
-        p_filter->fmt_out.audio.i_format = VLC_FOURCC('f','l','3','2');
+        p_filter->fmt_in.audio.i_format = VLC_CODEC_FL32;
+        p_filter->fmt_out.audio.i_format = VLC_CODEC_FL32;
     }
     if( p_filter->fmt_in.audio.i_rate != p_filter->fmt_out.audio.i_rate )
     {
index 02def5e..40edd92 100644 (file)
@@ -290,7 +290,7 @@ static block_t *Filter( filter_t *p_filter, block_t *p_block )
  *****************************************************************************/
 static bool IsSupported( const audio_format_t *p_input, const audio_format_t *p_output )
 {
-    if( p_input->i_format != VLC_FOURCC('f','l','3','2') ||
+    if( p_input->i_format != VLC_CODEC_FL32 ||
           p_input->i_format != p_output->i_format ||
           p_input->i_rate != p_output->i_rate )
         return false;
index ee393ed..42ac93e 100644 (file)
@@ -65,8 +65,8 @@ static int Create( vlc_object_t *p_this )
                == p_filter->output.i_original_channels)
           || p_filter->input.i_format != p_filter->output.i_format
           || p_filter->input.i_rate != p_filter->output.i_rate
-          || (p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
-               && p_filter->input.i_format != VLC_FOURCC('f','i','3','2')) )
+          || (p_filter->input.i_format != VLC_CODEC_FL32
+               && p_filter->input.i_format != VLC_CODEC_FI32) )
     {
         return -1;
     }
index ad18a0e..083caf7 100644 (file)
@@ -122,11 +122,11 @@ static int Create( vlc_object_t *p_this )
     filter_sys_t *p_sys = (filter_sys_t *)p_filter->p_sys;
     int i_ret;
 
-    if ( p_filter->input.i_format != VLC_FOURCC('a','5','2',' ')
+    if ( p_filter->input.i_format != VLC_CODEC_A52
 #ifdef LIBA52_FIXED
-          || p_filter->output.i_format != VLC_FOURCC('f','i','3','2') )
+          || p_filter->output.i_format != VLC_CODEC_FI32 )
 #else
-          || p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
+          || p_filter->output.i_format != VLC_CODEC_FL32 )
 #endif
     {
         return -1;
@@ -416,16 +416,16 @@ static int OpenFilter( vlc_object_t *p_this )
     filter_sys_t *p_sys;
     int i_ret;
 
-    if( p_filter->fmt_in.i_codec != VLC_FOURCC('a','5','2',' ')  )
+    if( p_filter->fmt_in.i_codec != VLC_CODEC_A52  )
     {
         return VLC_EGENERIC;
     }
 
     p_filter->fmt_out.audio.i_format =
 #ifdef LIBA52_FIXED
-        p_filter->fmt_out.i_codec = VLC_FOURCC('f','i','3','2');
+        p_filter->fmt_out.i_codec = VLC_CODEC_FI32;
 #else
-        p_filter->fmt_out.i_codec = VLC_FOURCC('f','l','3','2');
+        p_filter->fmt_out.i_codec = VLC_CODEC_FL32;
 #endif
     p_filter->fmt_out.audio.i_bitspersample =
         aout_BitsPerSample( p_filter->fmt_out.i_codec );
index f438551..7bfc580 100644 (file)
@@ -64,9 +64,9 @@ static int Create( vlc_object_t *p_this )
 {
     aout_filter_t * p_filter = (aout_filter_t *)p_this;
 
-    if ( p_filter->input.i_format != VLC_FOURCC('a','5','2',' ') ||
-         ( p_filter->output.i_format != VLC_FOURCC('s','p','d','b') &&
-           p_filter->output.i_format != VLC_FOURCC('s','p','d','i') ) )
+    if ( p_filter->input.i_format != VLC_CODEC_A52 ||
+         ( p_filter->output.i_format != VLC_CODEC_SPDIFB &&
+           p_filter->output.i_format != VLC_CODEC_SPDIFL ) )
     {
         return -1;
     }
@@ -95,7 +95,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
     uint8_t * p_out = p_out_buf->p_buffer;
 
     /* Copy the S/PDIF headers. */
-    if( p_filter->output.i_format == VLC_FOURCC('s','p','d','b') )
+    if( p_filter->output.i_format == VLC_CODEC_SPDIFB )
     {
         vlc_memcpy( p_out, p_sync_be, 6 );
         p_out[4] = p_in[5] & 0x7; /* bsmod */
index 0028e13..0d48406 100644 (file)
@@ -112,8 +112,8 @@ static int Create( vlc_object_t *p_this )
     filter_sys_t *p_sys;
     int i_ret;
 
-    if ( p_filter->input.i_format != VLC_FOURCC('d','t','s',' ')
-          || p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
+    if ( p_filter->input.i_format != VLC_CODEC_DTS
+          || p_filter->output.i_format != VLC_CODEC_FL32 )
     {
         return -1;
     }
@@ -385,13 +385,13 @@ static int OpenFilter( vlc_object_t *p_this )
     filter_sys_t *p_sys;
     int i_ret;
 
-    if( p_filter->fmt_in.i_codec != VLC_FOURCC('d','t','s',' ')  )
+    if( p_filter->fmt_in.i_codec != VLC_CODEC_DTS  )
     {
         return VLC_EGENERIC;
     }
 
     p_filter->fmt_out.audio.i_format =
-        p_filter->fmt_out.i_codec = VLC_FOURCC('f','l','3','2');
+        p_filter->fmt_out.i_codec = VLC_CODEC_FL32;
     p_filter->fmt_out.audio.i_bitspersample =
         aout_BitsPerSample( p_filter->fmt_out.i_codec );
 
index d55446d..7ae3932 100644 (file)
@@ -81,9 +81,9 @@ static int Create( vlc_object_t *p_this )
 {
     aout_filter_t * p_filter = (aout_filter_t *)p_this;
 
-    if( p_filter->input.i_format != VLC_FOURCC('d','t','s',' ') ||
-        ( p_filter->output.i_format != VLC_FOURCC('s','p','d','i') &&
-          p_filter->output.i_format != VLC_FOURCC('s','p','d','b') ) )
+    if( p_filter->input.i_format != VLC_CODEC_DTS ||
+        ( p_filter->output.i_format != VLC_CODEC_SPDIFL &&
+          p_filter->output.i_format != VLC_CODEC_SPDIFB ) )
     {
         return -1;
     }
@@ -170,7 +170,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
         }
 
         /* Copy the S/PDIF headers. */
-        if( p_filter->output.i_format == VLC_FOURCC('s','p','d','b') )
+        if( p_filter->output.i_format == VLC_CODEC_SPDIFB )
         {
             vlc_memcpy( p_out, p_sync_be, 6 );
             p_out[5] = i_ac5_spdif_type;
@@ -185,8 +185,8 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
             p_out[7] = (( i_length ) >> 5 ) & 0xFF;
         }
 
-        if( ( (p_in[0] == 0x1F || p_in[0] == 0x7F) && p_filter->output.i_format == VLC_FOURCC('s','p','d','i') ) ||
-            ( (p_in[0] == 0xFF || p_in[0] == 0xFE) && p_filter->output.i_format == VLC_FOURCC('s','p','d','b') ) )
+        if( ( (p_in[0] == 0x1F || p_in[0] == 0x7F) && p_filter->output.i_format == VLC_CODEC_SPDIFL ) ||
+            ( (p_in[0] == 0xFF || p_in[0] == 0xFE) && p_filter->output.i_format == VLC_CODEC_SPDIFB ) )
         {
             /* We are dealing with a big endian bitstream and a little endian output
              * or a little endian bitstream and a big endian output.
index 1282838..c4634b6 100644 (file)
@@ -73,7 +73,7 @@ static int Create_F32ToS16( vlc_object_t *p_this )
 {
     aout_filter_t * p_filter = (aout_filter_t *)p_this;
 
-    if ( p_filter->input.i_format != VLC_FOURCC('f','i','3','2')
+    if ( p_filter->input.i_format != VLC_CODEC_FI32
           || p_filter->output.i_format != AOUT_FMT_S16_NE )
     {
         return -1;
@@ -157,7 +157,7 @@ static int Create_S16ToF32( vlc_object_t *p_this )
 {
     aout_filter_t * p_filter = (aout_filter_t *)p_this;
 
-    if ( p_filter->output.i_format != VLC_FOURCC('f','i','3','2')
+    if ( p_filter->output.i_format != VLC_CODEC_FI32
           || p_filter->input.i_format != AOUT_FMT_S16_NE )
     {
         return -1;
@@ -203,8 +203,8 @@ static int Create_U8ToF32( vlc_object_t *p_this )
 {
     aout_filter_t * p_filter = (aout_filter_t *)p_this;
 
-    if ( p_filter->input.i_format != VLC_FOURCC('u','8',' ',' ')
-          || p_filter->output.i_format != VLC_FOURCC('f','i','3','2') )
+    if ( p_filter->input.i_format != VLC_CODEC_U8
+          || p_filter->output.i_format != VLC_CODEC_FI32 )
     {
         return -1;
     }
index 223aa1e..1664a7a 100644 (file)
@@ -132,10 +132,10 @@ static int Create_F32ToFL32( vlc_object_t *p_this )
 {
     aout_filter_t * p_filter = (aout_filter_t *)p_this;
 
-    if( ( p_filter->input.i_format != VLC_FOURCC('f','i','3','2')
-           || p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
-      && ( p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
-            || p_filter->output.i_format != VLC_FOURCC('f','i','3','2') ) )
+    if( ( p_filter->input.i_format != VLC_CODEC_FI32
+           || p_filter->output.i_format != VLC_CODEC_FL32 )
+      && ( p_filter->input.i_format != VLC_CODEC_FL32
+            || p_filter->output.i_format != VLC_CODEC_FI32 ) )
     {
         return -1;
     }
@@ -145,7 +145,7 @@ static int Create_F32ToFL32( vlc_object_t *p_this )
         return -1;
     }
 
-    if( p_filter->input.i_format == VLC_FOURCC('f','i','3','2') )
+    if( p_filter->input.i_format == VLC_CODEC_FI32 )
     {
         p_filter->pf_do_work = Do_F32ToFL32;
     }
@@ -202,7 +202,7 @@ static int Create_FL32ToS16( vlc_object_t *p_this )
 {
     aout_filter_t * p_filter = (aout_filter_t *)p_this;
 
-    if ( p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
+    if ( p_filter->input.i_format != VLC_CODEC_FL32
           || p_filter->output.i_format != AOUT_FMT_S16_NE )
     {
         return -1;
@@ -257,8 +257,8 @@ static int Create_FL32ToS8( vlc_object_t *p_this )
 {
     aout_filter_t * p_filter = (aout_filter_t *)p_this;
 
-    if ( p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
-          || p_filter->output.i_format != VLC_FOURCC('s','8',' ',' ') )
+    if ( p_filter->input.i_format != VLC_CODEC_FL32
+          || p_filter->output.i_format != VLC_CODEC_S8 )
     {
         return -1;
     }
@@ -302,7 +302,7 @@ static int Create_FL32ToU16( vlc_object_t *p_this )
 {
     aout_filter_t * p_filter = (aout_filter_t *)p_this;
 
-    if ( p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
+    if ( p_filter->input.i_format != VLC_CODEC_FL32
           || p_filter->output.i_format != AOUT_FMT_U16_NE )
     {
         return -1;
@@ -347,8 +347,8 @@ static int Create_FL32ToU8( vlc_object_t *p_this )
 {
     aout_filter_t * p_filter = (aout_filter_t *)p_this;
 
-    if ( p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
-          || p_filter->output.i_format != VLC_FOURCC('u','8',' ',' ') )
+    if ( p_filter->input.i_format != VLC_CODEC_FL32
+          || p_filter->output.i_format != VLC_CODEC_U8 )
     {
         return -1;
     }
@@ -395,7 +395,7 @@ static int Create_S16ToFL32( vlc_object_t *p_this )
     if ( ( p_filter->input.i_format != AOUT_FMT_S16_NE &&
            p_filter->input.i_format != AOUT_FMT_S24_NE &&
            p_filter->input.i_format != AOUT_FMT_S32_NE )
-          || p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
+          || p_filter->output.i_format != VLC_CODEC_FL32 )
     {
         return -1;
     }
@@ -505,9 +505,9 @@ static int Create_S16ToFL32_SW( vlc_object_t *p_this )
         return -1;
     }
 
-    if ( (p_filter->input.i_format == VLC_FOURCC('s','1','6','l') ||
-         p_filter->input.i_format == VLC_FOURCC('s','1','6','b'))
-         && p_filter->output.i_format == VLC_FOURCC('f','l','3','2')
+    if ( (p_filter->input.i_format == VLC_CODEC_S16L ||
+         p_filter->input.i_format == VLC_CODEC_S16B)
+         && p_filter->output.i_format == VLC_CODEC_FL32
          && p_filter->input.i_format != AOUT_FMT_S16_NE )
     {
         p_filter->pf_do_work = Do_S16ToFL32_SW;
@@ -516,9 +516,9 @@ static int Create_S16ToFL32_SW( vlc_object_t *p_this )
         return 0;
     }
 
-    if ( (p_filter->input.i_format == VLC_FOURCC('s','2','4','l') ||
-         p_filter->input.i_format == VLC_FOURCC('s','2','4','b'))
-         && p_filter->output.i_format == VLC_FOURCC('f','l','3','2')
+    if ( (p_filter->input.i_format == VLC_CODEC_S24L ||
+         p_filter->input.i_format == VLC_CODEC_S24B)
+         && p_filter->output.i_format == VLC_CODEC_FL32
          && p_filter->input.i_format != AOUT_FMT_S24_NE )
     {
         p_filter->pf_do_work = Do_S24ToFL32_SW;
@@ -527,9 +527,9 @@ static int Create_S16ToFL32_SW( vlc_object_t *p_this )
         return 0;
     }
 
-    if ( (p_filter->input.i_format == VLC_FOURCC('s','3','2','l') ||
-         p_filter->input.i_format == VLC_FOURCC('s','3','2','b'))
-         && p_filter->output.i_format == VLC_FOURCC('f','l','3','2')
+    if ( (p_filter->input.i_format == VLC_CODEC_S32L ||
+         p_filter->input.i_format == VLC_CODEC_S32B)
+         && p_filter->output.i_format == VLC_CODEC_FL32
          && p_filter->input.i_format != AOUT_FMT_S32_NE )
     {
         p_filter->pf_do_work = Do_S32ToFL32_SW;
@@ -623,8 +623,8 @@ static int Create_S8ToFL32( vlc_object_t *p_this )
 {
     aout_filter_t * p_filter = (aout_filter_t *)p_this;
 
-    if ( p_filter->input.i_format != VLC_FOURCC('s','8',' ',' ')
-          || p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
+    if ( p_filter->input.i_format != VLC_CODEC_S8
+          || p_filter->output.i_format != VLC_CODEC_FL32 )
     {
         return -1;
     }
@@ -667,8 +667,8 @@ static int Create_U8ToFL32( vlc_object_t *p_this )
 {
     aout_filter_t * p_filter = (aout_filter_t *)p_this;
 
-    if ( p_filter->input.i_format != VLC_FOURCC('u','8',' ',' ')
-          || p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
+    if ( p_filter->input.i_format != VLC_CODEC_U8
+          || p_filter->output.i_format != VLC_CODEC_FL32 )
     {
         return -1;
     }
index 357ccb8..1bee61d 100644 (file)
@@ -87,10 +87,10 @@ static int Create( vlc_object_t *p_this )
     aout_filter_t *p_filter = (aout_filter_t *)p_this;
     struct filter_sys_t *p_sys;
 
-    if ( (p_filter->input.i_format != VLC_FOURCC('m','p','g','a')
+    if ( (p_filter->input.i_format != VLC_CODEC_MPGA
            && p_filter->input.i_format != VLC_FOURCC('m','p','g','3'))
-            || (p_filter->output.i_format != VLC_FOURCC('f','l','3','2')
-                 && p_filter->output.i_format != VLC_FOURCC('f','i','3','2')) )
+            || (p_filter->output.i_format != VLC_CODEC_FL32
+                 && p_filter->output.i_format != VLC_CODEC_FI32) )
     {
         return -1;
     }
@@ -147,7 +147,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
 
     if( p_sys->i_reject_count > 0 )
     {
-        if( p_filter->output.i_format == VLC_FOURCC('f','l','3','2') )
+        if( p_filter->output.i_format == VLC_CODEC_FL32 )
         {
             int i;
             int i_size = p_out_buf->i_nb_bytes / sizeof(float);
@@ -167,7 +167,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
 
     mad_synth_frame( &p_sys->mad_synth, &p_sys->mad_frame );
 
-    if ( p_filter->output.i_format == VLC_FOURCC('f','i','3','2') )
+    if ( p_filter->output.i_format == VLC_CODEC_FI32 )
     {
         /* Interleave and keep buffers in mad_fixed_t format */
         mad_fixed_t * p_samples = (mad_fixed_t *)p_out_buf->p_buffer;
@@ -304,7 +304,7 @@ static int OpenFilter( vlc_object_t *p_this )
     filter_t *p_filter = (filter_t *)p_this;
     filter_sys_t *p_sys;
 
-    if( p_filter->fmt_in.i_codec != VLC_FOURCC('m','p','g','a') &&
+    if( p_filter->fmt_in.i_codec != VLC_CODEC_MPGA &&
         p_filter->fmt_in.i_codec != VLC_FOURCC('m','p','g','3') )
     {
         return VLC_EGENERIC;
@@ -325,9 +325,9 @@ static int OpenFilter( vlc_object_t *p_this )
     mad_stream_options( &p_sys->mad_stream, MAD_OPTION_IGNORECRC );
 
     if( vlc_CPU() & CPU_CAPABILITY_FPU )
-        p_filter->fmt_out.i_codec = VLC_FOURCC('f','l','3','2');
+        p_filter->fmt_out.i_codec = VLC_CODEC_FL32;
     else
-        p_filter->fmt_out.i_codec = VLC_FOURCC('f','i','3','2');
+        p_filter->fmt_out.i_codec = VLC_CODEC_FI32;
     p_filter->fmt_out.audio.i_format = p_filter->fmt_out.i_codec;
     p_filter->fmt_out.audio.i_bitspersample =
         aout_BitsPerSample( p_filter->fmt_out.i_codec );
index 33b6469..e10696f 100644 (file)
@@ -147,12 +147,12 @@ static int Open( vlc_object_t *p_this )
     aout_filter_sys_t *p_sys;
     bool         b_fit = true;
 
-    if( p_filter->input.i_format != VLC_FOURCC('f','l','3','2' ) ||
-        p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
+    if( p_filter->input.i_format != VLC_CODEC_FL32 ||
+        p_filter->output.i_format != VLC_CODEC_FL32 )
     {
         b_fit = false;
-        p_filter->input.i_format = VLC_FOURCC('f','l','3','2');
-        p_filter->output.i_format = VLC_FOURCC('f','l','3','2');
+        p_filter->input.i_format = VLC_CODEC_FL32;
+        p_filter->output.i_format = VLC_CODEC_FL32;
         msg_Warn( p_filter, "bad input or output format" );
     }
     if ( !AOUT_FMTS_SIMILAR( &p_filter->input, &p_filter->output ) )
index 0811231..242900b 100644 (file)
 #include "vlc_filter.h"
 
 #ifdef WORDS_BIGENDIAN
-#   define AOUT_FMT_S24_IE VLC_FOURCC('s','2','4','l')
-#   define AOUT_FMT_S16_IE VLC_FOURCC('s','1','6','l')
-#   define AOUT_FMT_U16_IE VLC_FOURCC('u','1','6','l')
+#   define AOUT_FMT_S24_IE VLC_CODEC_S24L
+#   define AOUT_FMT_S16_IE VLC_CODEC_S16L
+#   define AOUT_FMT_U16_IE VLC_CODEC_U16L
 #else
-#   define AOUT_FMT_S24_IE VLC_FOURCC('s','2','4','b')
-#   define AOUT_FMT_S16_IE VLC_FOURCC('s','1','6','b')
-#   define AOUT_FMT_U16_IE VLC_FOURCC('u','1','6','b')
+#   define AOUT_FMT_S24_IE VLC_CODEC_S24B
+#   define AOUT_FMT_S16_IE VLC_CODEC_S16B
+#   define AOUT_FMT_U16_IE VLC_CODEC_U16B
 #endif
 
 
@@ -125,74 +125,74 @@ static const struct
 } ConvertTable[] =
 {
     /* From fl32 */
-    { VLC_FOURCC('f','l','3','2'), AOUT_FMT_S24_NE, Float32toS24 },
-    { VLC_FOURCC('f','l','3','2'), AOUT_FMT_S16_NE, Float32toS16 },
-    { VLC_FOURCC('f','l','3','2'), AOUT_FMT_U16_NE, Float32toU16 },
-    { VLC_FOURCC('f','l','3','2'), AOUT_FMT_S24_IE, Float32toS24Invert },
-    { VLC_FOURCC('f','l','3','2'), AOUT_FMT_S16_IE, Float32toS16Invert },
-    { VLC_FOURCC('f','l','3','2'), AOUT_FMT_U16_IE, Float32toU16Invert },
-    { VLC_FOURCC('f','l','3','2'), VLC_FOURCC('s','8',' ',' '), Float32toS8 },
-    { VLC_FOURCC('f','l','3','2'), VLC_FOURCC('u','8',' ',' '), Float32toU8 },
+    { VLC_CODEC_FL32, AOUT_FMT_S24_NE, Float32toS24 },
+    { VLC_CODEC_FL32, AOUT_FMT_S16_NE, Float32toS16 },
+    { VLC_CODEC_FL32, AOUT_FMT_U16_NE, Float32toU16 },
+    { VLC_CODEC_FL32, AOUT_FMT_S24_IE, Float32toS24Invert },
+    { VLC_CODEC_FL32, AOUT_FMT_S16_IE, Float32toS16Invert },
+    { VLC_CODEC_FL32, AOUT_FMT_U16_IE, Float32toU16Invert },
+    { VLC_CODEC_FL32, VLC_CODEC_S8, Float32toS8 },
+    { VLC_CODEC_FL32, VLC_CODEC_U8, Float32toU8 },
 
     /* From s24 invert */
-    { AOUT_FMT_S24_NE, VLC_FOURCC('f','l','3','2'), S24toFloat32 },
+    { AOUT_FMT_S24_NE, VLC_CODEC_FL32, S24toFloat32 },
     { AOUT_FMT_S24_NE, AOUT_FMT_S24_IE,             Swap24 },
     { AOUT_FMT_S24_NE, AOUT_FMT_S16_NE,             S24toS16 },
     { AOUT_FMT_S24_NE, AOUT_FMT_S16_IE,             S24toS16Invert },
 
     /* From s16 */
-    { AOUT_FMT_S16_NE, VLC_FOURCC('f','l','3','2'), S16toFloat32 },
+    { AOUT_FMT_S16_NE, VLC_CODEC_FL32, S16toFloat32 },
     { AOUT_FMT_S16_NE, AOUT_FMT_S24_NE,             S16toS24 },
     { AOUT_FMT_S16_NE, AOUT_FMT_S24_IE,             S16toS24Invert },
     { AOUT_FMT_S16_NE, AOUT_FMT_S16_IE,             Swap16 },
     { AOUT_FMT_S16_NE, AOUT_FMT_U16_IE,             S16toU16 },
-    { AOUT_FMT_S16_NE, VLC_FOURCC('s','8',' ',' '), S16toS8 },
-    { AOUT_FMT_S16_NE, VLC_FOURCC('u','8',' ',' '), S16toU8 },
+    { AOUT_FMT_S16_NE, VLC_CODEC_S8, S16toS8 },
+    { AOUT_FMT_S16_NE, VLC_CODEC_U8, S16toU8 },
 
     /* From u16 */
-    { AOUT_FMT_U16_NE, VLC_FOURCC('f','l','3','2'), U16toFloat32 },
+    { AOUT_FMT_U16_NE, VLC_CODEC_FL32, U16toFloat32 },
     { AOUT_FMT_U16_NE, AOUT_FMT_U16_IE,             Swap16 },
     { AOUT_FMT_U16_NE, AOUT_FMT_S16_IE,             U16toS16 },
-    { AOUT_FMT_U16_NE, VLC_FOURCC('s','8',' ',' '), U16toS8 },
-    { AOUT_FMT_U16_NE, VLC_FOURCC('u','8',' ',' '), U16toU8 },
+    { AOUT_FMT_U16_NE, VLC_CODEC_S8, U16toS8 },
+    { AOUT_FMT_U16_NE, VLC_CODEC_U8, U16toU8 },
 
     /* From s8 */
-    { VLC_FOURCC('s','8',' ',' '), VLC_FOURCC('f','l','3','2'), S8toFloat32 },
-    { VLC_FOURCC('s','8',' ',' '), AOUT_FMT_S16_NE,             S8toS16 },
-    { VLC_FOURCC('s','8',' ',' '), AOUT_FMT_S16_IE,             S8toS16Invert },
-    { VLC_FOURCC('s','8',' ',' '), AOUT_FMT_U16_NE,             S8toU16 },
-    { VLC_FOURCC('s','8',' ',' '), AOUT_FMT_U16_IE,             S8toU16Invert },
-    { VLC_FOURCC('s','8',' ',' '), VLC_FOURCC('u','8',' ',' '), S8toU8 },
+    { VLC_CODEC_S8, VLC_CODEC_FL32, S8toFloat32 },
+    { VLC_CODEC_S8, AOUT_FMT_S16_NE,             S8toS16 },
+    { VLC_CODEC_S8, AOUT_FMT_S16_IE,             S8toS16Invert },
+    { VLC_CODEC_S8, AOUT_FMT_U16_NE,             S8toU16 },
+    { VLC_CODEC_S8, AOUT_FMT_U16_IE,             S8toU16Invert },
+    { VLC_CODEC_S8, VLC_CODEC_U8, S8toU8 },
  
     /* From u8 */
-    { VLC_FOURCC('u','8',' ',' '), VLC_FOURCC('f','l','3','2'), U8toFloat32 },
-    { VLC_FOURCC('u','8',' ',' '), AOUT_FMT_S16_NE,             U8toS16 },
-    { VLC_FOURCC('u','8',' ',' '), AOUT_FMT_S16_IE,             U8toS16Invert },
-    { VLC_FOURCC('u','8',' ',' '), AOUT_FMT_U16_NE,             U8toU16 },
-    { VLC_FOURCC('u','8',' ',' '), AOUT_FMT_U16_IE,             U8toU16Invert },
-    { VLC_FOURCC('u','8',' ',' '), VLC_FOURCC('s','8',' ',' '), U8toS8 },
+    { VLC_CODEC_U8, VLC_CODEC_FL32, U8toFloat32 },
+    { VLC_CODEC_U8, AOUT_FMT_S16_NE,             U8toS16 },
+    { VLC_CODEC_U8, AOUT_FMT_S16_IE,             U8toS16Invert },
+    { VLC_CODEC_U8, AOUT_FMT_U16_NE,             U8toU16 },
+    { VLC_CODEC_U8, AOUT_FMT_U16_IE,             U8toU16Invert },
+    { VLC_CODEC_U8, VLC_CODEC_S8, U8toS8 },
 
     /* From s24 invert */
-    { AOUT_FMT_S24_IE, VLC_FOURCC('f','l','3','2'), S24InverttoFloat32 },
+    { AOUT_FMT_S24_IE, VLC_CODEC_FL32, S24InverttoFloat32 },
     { AOUT_FMT_S24_IE, AOUT_FMT_S24_NE,             Swap24 },
     { AOUT_FMT_S24_IE, AOUT_FMT_S16_NE,             S24InverttoS16 },
     { AOUT_FMT_S24_IE, AOUT_FMT_S16_IE,             S24InverttoS16Invert },
 
     /* From s16 invert */
-    { AOUT_FMT_S16_IE, VLC_FOURCC('f','l','3','2'), S16InverttoFloat32 },
+    { AOUT_FMT_S16_IE, VLC_CODEC_FL32, S16InverttoFloat32 },
     { AOUT_FMT_S16_IE, AOUT_FMT_S24_NE,             S16InverttoS24 },
     { AOUT_FMT_S16_IE, AOUT_FMT_S24_IE,             S16InverttoS24Invert },
     { AOUT_FMT_S16_IE, AOUT_FMT_S16_NE,             Swap16 },
     { AOUT_FMT_S16_IE, AOUT_FMT_U16_NE,             S16InverttoU16 },
-    { AOUT_FMT_S16_IE, VLC_FOURCC('s','8',' ',' '), S16InverttoS8 },
-    { AOUT_FMT_S16_IE, VLC_FOURCC('u','8',' ',' '), S16InverttoU8 },
+    { AOUT_FMT_S16_IE, VLC_CODEC_S8, S16InverttoS8 },
+    { AOUT_FMT_S16_IE, VLC_CODEC_U8, S16InverttoU8 },
 
     /* From u16 invert */
-    { AOUT_FMT_U16_IE, VLC_FOURCC('f','l','3','2'), U16InverttoFloat32 },
+    { AOUT_FMT_U16_IE, VLC_CODEC_FL32, U16InverttoFloat32 },
     { AOUT_FMT_U16_IE, AOUT_FMT_U16_NE,             Swap16 },
     { AOUT_FMT_U16_IE, AOUT_FMT_S16_NE,             U16InverttoS16 },
-    { AOUT_FMT_U16_IE, VLC_FOURCC('s','8',' ',' '), U16InverttoS8 },
-    { AOUT_FMT_U16_IE, VLC_FOURCC('u','8',' ',' '), U16InverttoU8 },
+    { AOUT_FMT_U16_IE, VLC_CODEC_S8, U16InverttoS8 },
+    { AOUT_FMT_U16_IE, VLC_CODEC_U8, U16InverttoU8 },
 
     { 0, 0, NULL },
 };
index d0a2e35..7ec974e 100644 (file)
@@ -103,12 +103,12 @@ static int Open( vlc_object_t *p_this )
     int i_channels;
     aout_filter_sys_t *p_sys;
 
-    if( p_filter->input.i_format != VLC_FOURCC('f','l','3','2' ) ||
-        p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
+    if( p_filter->input.i_format != VLC_CODEC_FL32 ||
+        p_filter->output.i_format != VLC_CODEC_FL32 )
     {
         b_fit = false;
-        p_filter->input.i_format = VLC_FOURCC('f','l','3','2');
-        p_filter->output.i_format = VLC_FOURCC('f','l','3','2');
+        p_filter->input.i_format = VLC_CODEC_FL32;
+        p_filter->output.i_format = VLC_CODEC_FL32;
         msg_Warn( p_filter, "bad input or output format" );
     }
 
index b20a84a..fa8c194 100644 (file)
@@ -110,12 +110,12 @@ static int Open( vlc_object_t *p_this )
     bool         b_fit = true;
     int                i_samplerate;
 
-    if( p_filter->input.i_format != VLC_FOURCC('f','l','3','2' ) ||
-        p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
+    if( p_filter->input.i_format != VLC_CODEC_FL32 ||
+        p_filter->output.i_format != VLC_CODEC_FL32 )
     {
         b_fit = false;
-        p_filter->input.i_format = VLC_FOURCC('f','l','3','2');
-        p_filter->output.i_format = VLC_FOURCC('f','l','3','2');
+        p_filter->input.i_format = VLC_CODEC_FL32;
+        p_filter->output.i_format = VLC_CODEC_FL32;
         msg_Warn( p_filter, "bad input or output format" );
     }
     if ( !AOUT_FMTS_SIMILAR( &p_filter->input, &p_filter->output ) )
index 9ec0714..485f320 100644 (file)
@@ -121,7 +121,7 @@ static int Create( vlc_object_t *p_this )
               != p_filter->output.i_physical_channels
           || p_filter->input.i_original_channels
               != p_filter->output.i_original_channels
-          || p_filter->input.i_format != VLC_FOURCC('f','l','3','2') )
+          || p_filter->input.i_format != VLC_CODEC_FL32 )
     {
         return VLC_EGENERIC;
     }
@@ -475,7 +475,7 @@ static int OpenFilter( vlc_object_t *p_this )
     int i_filter_wing;
 
     if( p_filter->fmt_in.audio.i_rate == p_filter->fmt_out.audio.i_rate ||
-        p_filter->fmt_in.i_codec != VLC_FOURCC('f','l','3','2') )
+        p_filter->fmt_in.i_codec != VLC_CODEC_FL32 )
     {
         return VLC_EGENERIC;
     }
index 161b754..41be20b 100644 (file)
@@ -90,7 +90,7 @@ static int Create( vlc_object_t *p_this )
               != p_filter->output.i_physical_channels
           || p_filter->input.i_original_channels
               != p_filter->output.i_original_channels
-          || p_filter->input.i_format != VLC_FOURCC('f','l','3','2') )
+          || p_filter->input.i_format != VLC_CODEC_FL32 )
     {
         return VLC_EGENERIC;
     }
@@ -248,7 +248,7 @@ static int OpenFilter( vlc_object_t *p_this )
     int i_out_rate  = p_filter->fmt_out.audio.i_rate;
 
     if( p_filter->fmt_in.audio.i_rate == p_filter->fmt_out.audio.i_rate ||
-        p_filter->fmt_in.i_codec != VLC_FOURCC('f','l','3','2') )
+        p_filter->fmt_in.i_codec != VLC_CODEC_FL32 )
     {
         return VLC_EGENERIC;
     }
index 7558604..1691868 100644 (file)
@@ -65,8 +65,8 @@ static int Create( vlc_object_t *p_this )
               != p_filter->output.i_physical_channels
           || p_filter->input.i_original_channels
               != p_filter->output.i_original_channels
-          || (p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
-               && p_filter->input.i_format != VLC_FOURCC('f','i','3','2')) )
+          || (p_filter->input.i_format != VLC_CODEC_FL32
+               && p_filter->input.i_format != VLC_CODEC_FI32) )
     {
         return -1;
     }
index 28e38e7..059d007 100644 (file)
@@ -65,8 +65,8 @@ static int Create( vlc_object_t *p_this )
               != p_filter->output.i_physical_channels
           || p_filter->input.i_original_channels
               != p_filter->output.i_original_channels
-          || (p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
-               && p_filter->input.i_format != VLC_FOURCC('f','i','3','2')) )
+          || (p_filter->input.i_format != VLC_CODEC_FL32
+               && p_filter->input.i_format != VLC_CODEC_FI32) )
     {
         return VLC_EGENERIC;
     }
index a40435d..3137bf1 100644 (file)
@@ -392,11 +392,11 @@ static int Open( vlc_object_t *p_this )
     aout_filter_sys_t *p_sys;
     bool b_fit = true;
 
-    if( p_filter->input.i_format != VLC_FOURCC('f','l','3','2' ) ||
-        p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
+    if( p_filter->input.i_format != VLC_CODEC_FL32 ||
+        p_filter->output.i_format != VLC_CODEC_FL32 )
     {
         b_fit = false;
-        p_filter->input.i_format = p_filter->output.i_format = VLC_FOURCC('f','l','3','2');
+        p_filter->input.i_format = p_filter->output.i_format = VLC_CODEC_FL32;
         msg_Warn( p_filter, "bad input or output format" );
     }
     if( ! AOUT_FMTS_SIMILAR( &p_filter->input, &p_filter->output ) )
index 5ed460b..34a6c45 100644 (file)
@@ -133,12 +133,12 @@ static int Open( vlc_object_t *p_this )
     bool         b_fit = true;
     msg_Dbg(p_this, "Opening filter spatializer %s %s %d", __FILE__,__func__,__LINE__);
 
-    if( p_filter->input.i_format != VLC_FOURCC('f','l','3','2' ) ||
-        p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
+    if( p_filter->input.i_format != VLC_CODEC_FL32 ||
+        p_filter->output.i_format != VLC_CODEC_FL32 )
     {
         b_fit = false;
-        p_filter->input.i_format = VLC_FOURCC('f','l','3','2');
-        p_filter->output.i_format = VLC_FOURCC('f','l','3','2');
+        p_filter->input.i_format = VLC_CODEC_FL32;
+        p_filter->output.i_format = VLC_CODEC_FL32;
         msg_Warn( p_filter, "bad input or output format" );
     }
     if ( !AOUT_FMTS_SIMILAR( &p_filter->input, &p_filter->output ) )
index e3f9054..474dd52 100644 (file)
@@ -59,7 +59,7 @@ static int Create( vlc_object_t *p_this )
 {
     aout_instance_t * p_aout = (aout_instance_t *)p_this;
 
-    if ( p_aout->mixer.mixer.i_format != VLC_FOURCC('f','l','3','2') )
+    if ( p_aout->mixer.mixer.i_format != VLC_CODEC_FL32 )
     {
         return -1;
     }
index 2512981..3cdd04c 100644 (file)
@@ -59,8 +59,8 @@ static int Create( vlc_object_t *p_this )
 {
     aout_instance_t * p_aout = (aout_instance_t *)p_this;
 
-    if ( p_aout->mixer.mixer.i_format != VLC_FOURCC('f','l','3','2')
-          && p_aout->mixer.mixer.i_format != VLC_FOURCC('f','i','3','2') )
+    if ( p_aout->mixer.mixer.i_format != VLC_CODEC_FL32
+          && p_aout->mixer.mixer.i_format != VLC_CODEC_FI32 )
     {
         return -1;
     }
index 2d03d1d..03fd35b 100644 (file)
@@ -360,7 +360,7 @@ static int Open( vlc_object_t *p_this )
        and float32) */
     if( vlc_CPU() & CPU_CAPABILITY_FPU )
     {
-        i_vlc_pcm_format = VLC_FOURCC('f','l','3','2');
+        i_vlc_pcm_format = VLC_CODEC_FL32;
         i_snd_pcm_format = SND_PCM_FORMAT_FLOAT;
     }
     else
@@ -442,7 +442,7 @@ static int Open( vlc_object_t *p_this )
         i_snd_pcm_format = SND_PCM_FORMAT_S16;
         i_channels = 2;
 
-        i_vlc_pcm_format = VLC_FOURCC('s','p','d','i');
+        i_vlc_pcm_format = VLC_CODEC_SPDIFL;
         p_aout->output.i_nb_samples = i_period_size = ALSA_SPDIF_PERIOD_SIZE;
         p_aout->output.output.i_bytes_per_frame = AOUT_SPDIF_SIZE;
         p_aout->output.output.i_frame_length = A52_FRAME_NB;
@@ -540,11 +540,11 @@ static int Open( vlc_object_t *p_this )
                 goto error;
             }
         }
-        if( i_vlc_pcm_format != VLC_FOURCC('s','p','d','i') )
+        if( i_vlc_pcm_format != VLC_CODEC_SPDIFL )
         switch( i_snd_pcm_format )
         {
         case SND_PCM_FORMAT_FLOAT:
-            i_vlc_pcm_format = VLC_FOURCC('f','l','3','2');
+            i_vlc_pcm_format = VLC_CODEC_FL32;
             break;
         case SND_PCM_FORMAT_S16:
             i_vlc_pcm_format = AOUT_FMT_S16_NE;
@@ -865,7 +865,7 @@ static void ALSAFill( aout_instance_t * p_aout )
     }
 
     p_buffer = aout_OutputNextBuffer( p_aout, next_date,
-           (p_aout->output.output.i_format ==  VLC_FOURCC('s','p','d','i')) );
+           (p_aout->output.output.i_format ==  VLC_CODEC_SPDIFL) );
 
     /* Audio output buffer shortage -> stop the fill process and wait */
     if( p_buffer == NULL )
index 1effe5b..edb438c 100644 (file)
@@ -513,7 +513,7 @@ static int OpenAnalog( aout_instance_t *p_aout )
     DeviceFormat.mFormatID = kAudioFormatLinearPCM;
 
     /* We use float 32. It's the best supported format by both VLC and Coreaudio */
-    p_aout->output.output.i_format = VLC_FOURCC( 'f','l','3','2');
+    p_aout->output.output.i_format = VLC_CODEC_FL32;
     DeviceFormat.mFormatFlags = kAudioFormatFlagsNativeFloatPacked;
     DeviceFormat.mBitsPerChannel = 32;
     DeviceFormat.mChannelsPerFrame = aout_FormatNbChannels( &p_aout->output.output );
@@ -768,9 +768,9 @@ static int OpenSPDIF( aout_instance_t * p_aout )
 
     /* Set the format flags */
     if( p_sys->stream_format.mFormatFlags & kAudioFormatFlagIsBigEndian )
-        p_aout->output.output.i_format = VLC_FOURCC('s','p','d','b');
+        p_aout->output.output.i_format = VLC_CODEC_SPDIFB;
     else
-        p_aout->output.output.i_format = VLC_FOURCC('s','p','d','i');
+        p_aout->output.output.i_format = VLC_CODEC_SPDIFL;
     p_aout->output.output.i_bytes_per_frame = AOUT_SPDIF_SIZE;
     p_aout->output.output.i_frame_length = A52_FRAME_NB;
     p_aout->output.i_nb_samples = p_aout->output.output.i_frame_length;
index c05d3cb..98ce314 100644 (file)
@@ -331,7 +331,7 @@ static int OpenAudio( vlc_object_t *p_this )
     /* Open the device */
     if( val.i_int == AOUT_VAR_SPDIF )
     {
-        p_aout->output.output.i_format = VLC_FOURCC('s','p','d','i');
+        p_aout->output.output.i_format = VLC_CODEC_SPDIFL;
 
         /* Calculate the frame size in bytes */
         p_aout->output.i_nb_samples = A52_FRAME_NB;
@@ -340,7 +340,7 @@ static int OpenAudio( vlc_object_t *p_this )
         p_aout->output.p_sys->i_frame_size =
             p_aout->output.output.i_bytes_per_frame;
 
-        if( CreateDSBuffer( p_aout, VLC_FOURCC('s','p','d','i'),
+        if( CreateDSBuffer( p_aout, VLC_CODEC_SPDIFL,
                             p_aout->output.output.i_physical_channels,
                             aout_FormatNbChannels( &p_aout->output.output ),
                             p_aout->output.output.i_rate,
@@ -647,7 +647,7 @@ static void Probe( aout_instance_t * p_aout )
     /* Test for SPDIF support */
     if ( AOUT_FMT_NON_LINEAR( &p_aout->output.output ) )
     {
-        if( CreateDSBuffer( p_aout, VLC_FOURCC('s','p','d','i'),
+        if( CreateDSBuffer( p_aout, VLC_CODEC_SPDIFL,
                             p_aout->output.output.i_physical_channels,
                             aout_FormatNbChannels( &p_aout->output.output ),
                             p_aout->output.output.i_rate,
@@ -870,7 +870,7 @@ static int CreateDSBuffer( aout_instance_t *p_aout, int i_format,
 
     switch( i_format )
     {
-    case VLC_FOURCC('s','p','d','i'):
+    case VLC_CODEC_SPDIFL:
         i_nb_channels = 2;
         /* To prevent channel re-ordering */
         waveformat.dwChannelMask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT;
@@ -881,7 +881,7 @@ static int CreateDSBuffer( aout_instance_t *p_aout, int i_format,
         waveformat.SubFormat = _KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF;
         break;
 
-    case VLC_FOURCC('f','l','3','2'):
+    case VLC_CODEC_FL32:
         waveformat.Format.wBitsPerSample = sizeof(float) * 8;
         waveformat.Samples.wValidBitsPerSample =
             waveformat.Format.wBitsPerSample;
@@ -889,7 +889,7 @@ static int CreateDSBuffer( aout_instance_t *p_aout, int i_format,
         waveformat.SubFormat = _KSDATAFORMAT_SUBTYPE_IEEE_FLOAT;
         break;
 
-    case VLC_FOURCC('s','1','6','l'):
+    case VLC_CODEC_S16L:
         waveformat.Format.wBitsPerSample = 16;
         waveformat.Samples.wValidBitsPerSample =
             waveformat.Format.wBitsPerSample;
@@ -991,12 +991,12 @@ static int CreateDSBufferPCM( aout_instance_t *p_aout, int *i_format,
     /* Float32 audio samples are not supported for 5.1 output on the emu101k */
     if( !var_GetBool( p_aout, "directx-audio-float32" ) ||
         i_nb_channels > 2 ||
-        CreateDSBuffer( p_aout, VLC_FOURCC('f','l','3','2'),
+        CreateDSBuffer( p_aout, VLC_CODEC_FL32,
                         i_channels, i_nb_channels, i_rate,
                         FRAME_SIZE * 4 * i_nb_channels, b_probe )
         != VLC_SUCCESS )
     {
-        if ( CreateDSBuffer( p_aout, VLC_FOURCC('s','1','6','l'),
+        if ( CreateDSBuffer( p_aout, VLC_CODEC_S16L,
                              i_channels, i_nb_channels, i_rate,
                              FRAME_SIZE * 2 * i_nb_channels, b_probe )
              != VLC_SUCCESS )
@@ -1005,13 +1005,13 @@ static int CreateDSBufferPCM( aout_instance_t *p_aout, int *i_format,
         }
         else
         {
-            *i_format = VLC_FOURCC('s','1','6','l');
+            *i_format = VLC_CODEC_S16L;
             return VLC_SUCCESS;
         }
     }
     else
     {
-        *i_format = VLC_FOURCC('f','l','3','2');
+        *i_format = VLC_CODEC_FL32;
         return VLC_SUCCESS;
     }
 }
@@ -1117,7 +1117,7 @@ static void* DirectSoundThread( vlc_object_t *p_this )
     int canc = vlc_savecancel ();
 
     /* We don't want any resampling when using S/PDIF output */
-    b_sleek = p_aout->output.output.i_format == VLC_FOURCC('s','p','d','i');
+    b_sleek = p_aout->output.output.i_format == VLC_CODEC_SPDIFL;
 
     msg_Dbg( p_notif, "DirectSoundThread ready" );
 
index f6f851a..366fe82 100644 (file)
@@ -95,16 +95,16 @@ static void    Play        ( aout_instance_t * );
 static const char *const format_list[] = { "u8", "s8", "u16", "s16", "u16_le",
                                      "s16_le", "u16_be", "s16_be", "fixed32",
                                      "float32", "spdif" };
-static const int format_int[] = { VLC_FOURCC('u','8',' ',' '),
-                                  VLC_FOURCC('s','8',' ',' '),
+static const int format_int[] = { VLC_CODEC_U8,
+                                  VLC_CODEC_S8,
                                   AOUT_FMT_U16_NE, AOUT_FMT_S16_NE,
-                                  VLC_FOURCC('u','1','6','l'),
-                                  VLC_FOURCC('s','1','6','l'),
-                                  VLC_FOURCC('u','1','6','b'),
-                                  VLC_FOURCC('s','1','6','b'),
-                                  VLC_FOURCC('f','i','3','2'),
-                                  VLC_FOURCC('f','l','3','2'),
-                                  VLC_FOURCC('s','p','i','f') };
+                                  VLC_CODEC_U16L,
+                                  VLC_CODEC_S16L,
+                                  VLC_CODEC_U16B,
+                                  VLC_CODEC_S16B,
+                                  VLC_CODEC_FI32,
+                                  VLC_CODEC_FL32,
+                                  VLC_CODEC_SPDIFL };
 
 #define FILE_TEXT N_("Output file")
 #define FILE_LONGTEXT N_("File to which the audio samples will be written to. (\"-\" for stdout")
@@ -227,15 +227,15 @@ static int Open( vlc_object_t * p_this )
 
         switch( p_aout->output.output.i_format )
         {
-        case VLC_FOURCC('f','l','3','2'):
+        case VLC_CODEC_FL32:
             wh->Format     = WAVE_FORMAT_IEEE_FLOAT;
             wh->BitsPerSample = sizeof(float) * 8;
             break;
-        case VLC_FOURCC('u','8',' ',' '):
+        case VLC_CODEC_U8:
             wh->Format     = WAVE_FORMAT_PCM;
             wh->BitsPerSample = 8;
             break;
-        case VLC_FOURCC('s','1','6','l'):
+        case VLC_CODEC_S16L:
         default:
             wh->Format     = WAVE_FORMAT_PCM;
             wh->BitsPerSample = 16;
index aeb203f..db5d044 100644 (file)
@@ -131,7 +131,7 @@ static int Open( vlc_object_t *p_this )
     aout_VolumeSoftInit( p_aout );
 
     /* JACK only supports fl32 format */
-    p_aout->output.output.i_format = VLC_FOURCC('f','l','3','2');
+    p_aout->output.output.i_format = VLC_CODEC_FL32;
     // TODO add buffer size callback
     p_aout->output.i_nb_samples = jack_get_buffer_size( p_sys->p_jack_client );
     p_aout->output.output.i_rate = jack_get_sample_rate( p_sys->p_jack_client );
index e615465..3688e6f 100644 (file)
@@ -326,7 +326,7 @@ static int Open( vlc_object_t *p_this )
 
     if ( val.i_int == AOUT_VAR_SPDIF )
     {
-        p_aout->output.output.i_format = VLC_FOURCC('s','p','d','i');
+        p_aout->output.output.i_format = VLC_CODEC_SPDIFL;
     }
     else if ( val.i_int == AOUT_VAR_5_1 )
     {
@@ -388,7 +388,7 @@ static int Open( vlc_object_t *p_this )
             return VLC_EGENERIC;
         }
 
-        p_aout->output.output.i_format = VLC_FOURCC('s','p','d','i');
+        p_aout->output.output.i_format = VLC_CODEC_SPDIFL;
         p_aout->output.i_nb_samples = A52_FRAME_NB;
         p_aout->output.output.i_bytes_per_frame = AOUT_SPDIF_SIZE;
         p_aout->output.output.i_frame_length = A52_FRAME_NB;
@@ -415,22 +415,22 @@ static int Open( vlc_object_t *p_this )
         switch ( i_format )
         {
         case AFMT_U8:
-            p_aout->output.output.i_format = VLC_FOURCC('u','8',' ',' ');
+            p_aout->output.output.i_format = VLC_CODEC_U8;
             break;
         case AFMT_S8:
-            p_aout->output.output.i_format = VLC_FOURCC('s','8',' ',' ');
+            p_aout->output.output.i_format = VLC_CODEC_S8;
             break;
         case AFMT_U16_LE:
-            p_aout->output.output.i_format = VLC_FOURCC('u','1','6','l');
+            p_aout->output.output.i_format = VLC_CODEC_U16L;
             break;
         case AFMT_S16_LE:
-            p_aout->output.output.i_format = VLC_FOURCC('s','1','6','l');
+            p_aout->output.output.i_format = VLC_CODEC_S16L;
             break;
         case AFMT_U16_BE:
-            p_aout->output.output.i_format = VLC_FOURCC('u','1','6','b');
+            p_aout->output.output.i_format = VLC_CODEC_U16B;
             break;
         case AFMT_S16_BE:
-            p_aout->output.output.i_format = VLC_FOURCC('s','1','6','b');
+            p_aout->output.output.i_format = VLC_CODEC_S16B;
             break;
         default:
             msg_Err( p_aout, "OSS fell back to an unknown format (%d)",
@@ -598,7 +598,7 @@ static void* OSSThread( vlc_object_t *p_this )
         int i_tmp, i_size;
         uint8_t * p_bytes;
 
-        if ( p_aout->output.output.i_format != VLC_FOURCC('s','p','d','i') )
+        if ( p_aout->output.output.i_format != VLC_CODEC_SPDIFL )
         {
             mtime_t buffered = BufferDuration( p_aout );
 
index f73ce9b..9611a22 100644 (file)
@@ -434,7 +434,7 @@ static int PAOpenDevice( aout_instance_t *p_aout )
     }
 
     /* Audio format is paFloat32 (always supported by portaudio v19) */
-    p_aout->output.output.i_format = VLC_FOURCC('f','l','3','2');
+    p_aout->output.output.i_format = VLC_CODEC_FL32;
 
     return VLC_SUCCESS;
 
index 86bd6dd..bacd55c 100644 (file)
@@ -169,7 +169,7 @@ static int Open ( vlc_object_t *p_this )
 
     ss.rate = p_aout->output.output.i_rate;
     ss.format = PA_SAMPLE_FLOAT32NE;
-    p_aout->output.output.i_format = VLC_FOURCC('f','l','3','2');
+    p_aout->output.output.i_format = VLC_CODEC_FL32;
 
     if (!pa_sample_spec_valid(&ss)) {
         msg_Err(p_aout,"Invalid sample spec");
index 10d6eb7..f8425fa 100644 (file)
@@ -151,17 +151,17 @@ static int Open ( vlc_object_t *p_this )
     switch ( obtained.format )
     {
     case AUDIO_S16LSB:
-        p_aout->output.output.i_format = VLC_FOURCC('s','1','6','l'); break;
+        p_aout->output.output.i_format = VLC_CODEC_S16L; break;
     case AUDIO_S16MSB:
-        p_aout->output.output.i_format = VLC_FOURCC('s','1','6','b'); break;
+        p_aout->output.output.i_format = VLC_CODEC_S16B; break;
     case AUDIO_U16LSB:
-        p_aout->output.output.i_format = VLC_FOURCC('u','1','6','l'); break;
+        p_aout->output.output.i_format = VLC_CODEC_U16L; break;
     case AUDIO_U16MSB:
-        p_aout->output.output.i_format = VLC_FOURCC('u','1','6','b'); break;
+        p_aout->output.output.i_format = VLC_CODEC_U16B; break;
     case AUDIO_S8:
-        p_aout->output.output.i_format = VLC_FOURCC('s','8',' ',' '); break;
+        p_aout->output.output.i_format = VLC_CODEC_S8; break;
     case AUDIO_U8:
-        p_aout->output.output.i_format = VLC_FOURCC('u','8',' ',' '); break;
+        p_aout->output.output.i_format = VLC_CODEC_U8; break;
     }
     /* Volume is entirely done in software. */
     aout_VolumeSoftInit( p_aout );
index 8bea3e3..27f2561 100644 (file)
@@ -313,11 +313,11 @@ static int Open( vlc_object_t *p_this )
     /* Open the device */
     if( val.i_int == AOUT_VAR_SPDIF )
     {
-        p_aout->output.output.i_format = VLC_FOURCC('s','p','d','i');
+        p_aout->output.output.i_format = VLC_CODEC_SPDIFL;
 
         if( OpenWaveOut( p_aout,
                          p_aout->output.p_sys->i_wave_device_id,
-                         VLC_FOURCC('s','p','d','i'),
+                         VLC_CODEC_SPDIFL,
                          p_aout->output.output.i_physical_channels,
                          aout_FormatNbChannels( &p_aout->output.output ),
                          p_aout->output.output.i_rate, false )
@@ -539,7 +539,7 @@ static void Probe( aout_instance_t * p_aout )
     {
         if( OpenWaveOut( p_aout,
                          p_aout->output.p_sys->i_wave_device_id,
-                         VLC_FOURCC('s','p','d','i'),
+                         VLC_CODEC_SPDIFL,
                          p_aout->output.output.i_physical_channels,
                          aout_FormatNbChannels( &p_aout->output.output ),
                          p_aout->output.output.i_rate, true )
@@ -692,7 +692,7 @@ static int OpenWaveOut( aout_instance_t *p_aout, uint32_t i_device_id, int i_for
 
     switch( i_format )
     {
-    case VLC_FOURCC('s','p','d','i'):
+    case VLC_CODEC_SPDIFL:
         i_nb_channels = 2;
         /* To prevent channel re-ordering */
         waveformat.dwChannelMask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT;
@@ -703,7 +703,7 @@ static int OpenWaveOut( aout_instance_t *p_aout, uint32_t i_device_id, int i_for
         waveformat.SubFormat = __KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF;
         break;
 
-    case VLC_FOURCC('f','l','3','2'):
+    case VLC_CODEC_FL32:
         waveformat.Format.wBitsPerSample = sizeof(float) * 8;
         waveformat.Samples.wValidBitsPerSample =
             waveformat.Format.wBitsPerSample;
@@ -711,7 +711,7 @@ static int OpenWaveOut( aout_instance_t *p_aout, uint32_t i_device_id, int i_for
         waveformat.SubFormat = __KSDATAFORMAT_SUBTYPE_IEEE_FLOAT;
         break;
 
-    case VLC_FOURCC('s','1','6','l'):
+    case VLC_CODEC_S16L:
         waveformat.Format.wBitsPerSample = 16;
         waveformat.Samples.wValidBitsPerSample =
             waveformat.Format.wBitsPerSample;
@@ -809,11 +809,11 @@ static int OpenWaveOutPCM( aout_instance_t *p_aout, uint32_t i_device_id, int *i
 {
     bool b_use_float32 = var_CreateGetBool( p_aout, "waveout-float32");
 
-    if( !b_use_float32 || OpenWaveOut( p_aout, i_device_id, VLC_FOURCC('f','l','3','2'),
+    if( !b_use_float32 || OpenWaveOut( p_aout, i_device_id, VLC_CODEC_FL32,
                                    i_channels, i_nb_channels, i_rate, b_probe )
         != VLC_SUCCESS )
     {
-        if ( OpenWaveOut( p_aout, i_device_id, VLC_FOURCC('s','1','6','l'),
+        if ( OpenWaveOut( p_aout, i_device_id, VLC_CODEC_S16L,
                           i_channels, i_nb_channels, i_rate, b_probe )
              != VLC_SUCCESS )
         {
@@ -821,13 +821,13 @@ static int OpenWaveOutPCM( aout_instance_t *p_aout, uint32_t i_device_id, int *i
         }
         else
         {
-            *i_format = VLC_FOURCC('s','1','6','l');
+            *i_format = VLC_CODEC_S16L;
             return VLC_SUCCESS;
         }
     }
     else
     {
-        *i_format = VLC_FOURCC('f','l','3','2');
+        *i_format = VLC_CODEC_FL32;
         return VLC_SUCCESS;
     }
 }
@@ -982,7 +982,7 @@ static void* WaveOutThread( vlc_object_t *p_this )
     int canc = vlc_savecancel ();
 
     /* We don't want any resampling when using S/PDIF */
-    b_sleek = p_aout->output.output.i_format == VLC_FOURCC('s','p','d','i');
+    b_sleek = p_aout->output.output.i_format == VLC_CODEC_SPDIFL;
 
     // wait for first call to "play()"
     while( !p_sys->start_date && vlc_object_alive (p_aout) )
index 474a1d0..cafbb56 100644 (file)
@@ -114,16 +114,16 @@ static int OpenCommon( vlc_object_t *p_this, bool b_packetizer )
 
     switch( p_dec->fmt_in.i_codec )
     {
-    case VLC_FOURCC('a','5','2',' '):
+    case VLC_CODEC_A52:
     case VLC_FOURCC('a','5','2','b'):
-        i_codec = VLC_FOURCC('a','5','2',' ');
+        i_codec = VLC_CODEC_A52;
         break;
-    case VLC_FOURCC('e','a','c','3'):
+    case VLC_CODEC_EAC3:
         /* XXX ugly hack, a52 does not support eac3 so no eac3 pass-through
          * support */
         if( !b_packetizer )
             return VLC_EGENERIC;
-        i_codec = VLC_FOURCC('e','a','c','3');
+        i_codec = VLC_CODEC_EAC3;
         break;
     default:
         return VLC_EGENERIC;
index 986fa78..5c278b1 100644 (file)
@@ -345,7 +345,7 @@ static block_t *Parse( decoder_t *p_dec, int *pi_frame_length, int *pi_bits,
     }
     else
     {
-        p_dec->fmt_out.i_codec = i_bits == 16 ? VLC_FOURCC('s','1','6','l') : VLC_FOURCC('s','2','4','l');
+        p_dec->fmt_out.i_codec = i_bits == 16 ? VLC_CODEC_S16L : VLC_CODEC_S24L;
         p_dec->fmt_out.audio.i_bitspersample = i_bits == 16 ? 16 : 24;
     }
 
index 7a5ec82..f57cd22 100644 (file)
@@ -188,20 +188,20 @@ static int DecoderOpen( vlc_object_t *p_this )
     /* _signed_ little endian samples (mov)*/
     case VLC_FOURCC('s','o','w','t'):
 
-    case VLC_FOURCC('a','l','a','w'):
+    case VLC_CODEC_ALAW:
     case VLC_FOURCC('u','l','a','w'):
-    case VLC_FOURCC('m','l','a','w'):
-
-    case VLC_FOURCC('f','l','6','4'):
-    case VLC_FOURCC('f','l','3','2'):
-    case VLC_FOURCC('s','3','2','l'):
-    case VLC_FOURCC('s','3','2','b'):
-    case VLC_FOURCC('s','2','4','l'):
-    case VLC_FOURCC('s','2','4','b'):
-    case VLC_FOURCC('s','1','6','l'):
-    case VLC_FOURCC('s','1','6','b'):
-    case VLC_FOURCC('s','8',' ',' '):
-    case VLC_FOURCC('u','8',' ',' '):
+    case VLC_CODEC_MULAW:
+
+    case VLC_CODEC_FL64:
+    case VLC_CODEC_FL32:
+    case VLC_CODEC_S32L:
+    case VLC_CODEC_S32B:
+    case VLC_CODEC_S24L:
+    case VLC_CODEC_S24B:
+    case VLC_CODEC_S16L:
+    case VLC_CODEC_S16B:
+    case VLC_CODEC_S8:
+    case VLC_CODEC_U8:
     case VLC_FOURCC('i','n','2','4'): /* Quicktime in24, bigendian int24 */
     case VLC_FOURCC('4','2','n','i'): /* Quicktime in24, little-endian int24 */
     case VLC_FOURCC('i','n','3','2'): /* Quicktime in32, bigendian int32 */
@@ -236,18 +236,18 @@ static int DecoderOpen( vlc_object_t *p_this )
              p_dec->fmt_in.audio.i_rate, p_dec->fmt_in.audio.i_channels,
              p_dec->fmt_in.audio.i_bitspersample );
 
-    if( p_dec->fmt_in.i_codec == VLC_FOURCC( 'f', 'l', '6', '4' ) )
+    if( p_dec->fmt_in.i_codec == VLC_CODEC_FL64 )
     {
         p_dec->fmt_out.i_codec = p_dec->fmt_in.i_codec;
         p_dec->fmt_in.audio.i_bitspersample = 64;
     }
-    else if( p_dec->fmt_in.i_codec == VLC_FOURCC( 'f', 'l', '3', '2' ) )
+    else if( p_dec->fmt_in.i_codec == VLC_CODEC_FL32 )
     {
         p_dec->fmt_out.i_codec = p_dec->fmt_in.i_codec;
         p_dec->fmt_in.audio.i_bitspersample = 32;
     }
-    else if( p_dec->fmt_in.i_codec == VLC_FOURCC( 's', '3', '2', 'l' ) ||
-             p_dec->fmt_in.i_codec == VLC_FOURCC( 's', '3', '2', 'b' ) )
+    else if( p_dec->fmt_in.i_codec == VLC_CODEC_S32L ||
+             p_dec->fmt_in.i_codec == VLC_CODEC_S32B )
     {
         p_dec->fmt_out.i_codec = p_dec->fmt_in.i_codec;
         p_dec->fmt_in.audio.i_bitspersample = 32;
@@ -256,33 +256,33 @@ static int DecoderOpen( vlc_object_t *p_this )
     {
         /* FIXME: mplayer uses bigendian for in24 .... but here it works
          * with little endian ... weird */
-        p_dec->fmt_out.i_codec = VLC_FOURCC( 's', '3', '2', 'l' );
+        p_dec->fmt_out.i_codec = VLC_CODEC_S32L;
         p_dec->fmt_in.audio.i_bitspersample = 32;
     }
-    else if( p_dec->fmt_in.i_codec == VLC_FOURCC( 's', '2', '4', 'l' ) ||
-             p_dec->fmt_in.i_codec == VLC_FOURCC( 's', '2', '4', 'b' ) )
+    else if( p_dec->fmt_in.i_codec == VLC_CODEC_S24L ||
+             p_dec->fmt_in.i_codec == VLC_CODEC_S24B )
     {
         p_dec->fmt_out.i_codec = p_dec->fmt_in.i_codec;
         p_dec->fmt_in.audio.i_bitspersample = 24;
     }
     else if( p_dec->fmt_in.i_codec == VLC_FOURCC( 'i', 'n', '2', '4' ) )
     {
-        p_dec->fmt_out.i_codec = VLC_FOURCC( 's', '2', '4', 'b' );
+        p_dec->fmt_out.i_codec = VLC_CODEC_S24B;
         p_dec->fmt_in.audio.i_bitspersample = 24;
     }
     else if( p_dec->fmt_in.i_codec == VLC_FOURCC( '4', '2', 'n', 'i' ) )
     {
-        p_dec->fmt_out.i_codec = VLC_FOURCC( 's', '2', '4', 'l' );
+        p_dec->fmt_out.i_codec = VLC_CODEC_S24L;
         p_dec->fmt_in.audio.i_bitspersample = 24;
     }
-    else if( p_dec->fmt_in.i_codec == VLC_FOURCC( 's', '1', '6', 'l' ) ||
-             p_dec->fmt_in.i_codec == VLC_FOURCC( 's', '1', '6', 'b' ) )
+    else if( p_dec->fmt_in.i_codec == VLC_CODEC_S16L ||
+             p_dec->fmt_in.i_codec == VLC_CODEC_S16B )
     {
         p_dec->fmt_out.i_codec = p_dec->fmt_in.i_codec;
         p_dec->fmt_in.audio.i_bitspersample = 16;
     }
-    else if( p_dec->fmt_in.i_codec == VLC_FOURCC( 's', '8', ' ', ' ' ) ||
-             p_dec->fmt_in.i_codec == VLC_FOURCC( 'u', '8', ' ', ' ' ) )
+    else if( p_dec->fmt_in.i_codec == VLC_CODEC_S8 ||
+             p_dec->fmt_in.i_codec == VLC_CODEC_U8 )
     {
         p_dec->fmt_out.i_codec = p_dec->fmt_in.i_codec;
         p_dec->fmt_in.audio.i_bitspersample = 8;
@@ -292,10 +292,10 @@ static int DecoderOpen( vlc_object_t *p_this )
         switch( ( p_dec->fmt_in.audio.i_bitspersample + 7 ) / 8 )
         {
         case 4:
-            p_dec->fmt_out.i_codec = VLC_FOURCC('f','l','3','2');
+            p_dec->fmt_out.i_codec = VLC_CODEC_FL32;
             break;
         case 8:
-            p_dec->fmt_out.i_codec = VLC_FOURCC('f','l','6','4');
+            p_dec->fmt_out.i_codec = VLC_CODEC_FL64;
             break;
         default:
             msg_Err( p_dec, "bad parameters(bits/sample)" );
@@ -308,16 +308,16 @@ static int DecoderOpen( vlc_object_t *p_this )
         switch( ( p_dec->fmt_in.audio.i_bitspersample + 7 ) / 8 )
         {
         case 1:
-            p_dec->fmt_out.i_codec = VLC_FOURCC('u','8',' ',' ');
+            p_dec->fmt_out.i_codec = VLC_CODEC_U8;
             break;
         case 2:
-            p_dec->fmt_out.i_codec = VLC_FOURCC('s','1','6','l');
+            p_dec->fmt_out.i_codec = VLC_CODEC_S16L;
             break;
         case 3:
-            p_dec->fmt_out.i_codec = VLC_FOURCC('s','2','4','l');
+            p_dec->fmt_out.i_codec = VLC_CODEC_S24L;
             break;
         case 4:
-            p_dec->fmt_out.i_codec = VLC_FOURCC('s','3','2','l');
+            p_dec->fmt_out.i_codec = VLC_CODEC_S32L;
             break;
         default:
             msg_Err( p_dec, "bad parameters(bits/sample)" );
@@ -329,16 +329,16 @@ static int DecoderOpen( vlc_object_t *p_this )
         switch( ( p_dec->fmt_in.audio.i_bitspersample + 7 ) / 8 )
         {
         case 1:
-            p_dec->fmt_out.i_codec = VLC_FOURCC('s','8',' ',' ');
+            p_dec->fmt_out.i_codec = VLC_CODEC_S8;
             break;
         case 2:
-            p_dec->fmt_out.i_codec = VLC_FOURCC('s','1','6','b');
+            p_dec->fmt_out.i_codec = VLC_CODEC_S16B;
             break;
         case 3:
-            p_dec->fmt_out.i_codec = VLC_FOURCC('s','2','4','b');
+            p_dec->fmt_out.i_codec = VLC_CODEC_S24B;
             break;
         case 4:
-            p_dec->fmt_out.i_codec = VLC_FOURCC('s','3','2','b');
+            p_dec->fmt_out.i_codec = VLC_CODEC_S32B;
             break;
         default:
             msg_Err( p_dec, "bad parameters(bits/sample)" );
@@ -350,30 +350,30 @@ static int DecoderOpen( vlc_object_t *p_this )
         switch( ( p_dec->fmt_in.audio.i_bitspersample + 7 ) / 8 )
         {
         case 1:
-            p_dec->fmt_out.i_codec = VLC_FOURCC('s','8',' ',' ');
+            p_dec->fmt_out.i_codec = VLC_CODEC_S8;
             break;
         case 2:
-            p_dec->fmt_out.i_codec = VLC_FOURCC('s','1','6','l');
+            p_dec->fmt_out.i_codec = VLC_CODEC_S16L;
             break;
         case 3:
-            p_dec->fmt_out.i_codec = VLC_FOURCC('s','2','4','l');
+            p_dec->fmt_out.i_codec = VLC_CODEC_S24L;
             break;
         case 4:
-            p_dec->fmt_out.i_codec = VLC_FOURCC('s','3','2','l');
+            p_dec->fmt_out.i_codec = VLC_CODEC_S32L;
             break;
         default:
             msg_Err( p_dec, "bad parameters(bits/sample)" );
             return VLC_EGENERIC;
         }
     }
-    else if( p_dec->fmt_in.i_codec == VLC_FOURCC( 'a', 'l', 'a', 'w' ) )
+    else if( p_dec->fmt_in.i_codec == VLC_CODEC_ALAW )
     {
         p_dec->fmt_out.i_codec = AOUT_FMT_S16_NE;
         p_sys->p_logtos16  = alawtos16;
         p_dec->fmt_in.audio.i_bitspersample = 8;
     }
     else if( p_dec->fmt_in.i_codec == VLC_FOURCC( 'u', 'l', 'a', 'w' ) ||
-             p_dec->fmt_in.i_codec == VLC_FOURCC( 'm', 'l', 'a', 'w' ) )
+             p_dec->fmt_in.i_codec == VLC_CODEC_MULAW )
     {
         p_dec->fmt_out.i_codec = AOUT_FMT_S16_NE;
         p_sys->p_logtos16  = ulawtos16;
@@ -396,9 +396,9 @@ static int DecoderOpen( vlc_object_t *p_this )
         p_dec->fmt_out.audio.i_original_channels =
             p_dec->fmt_in.audio.i_original_channels;
 
-    if( p_dec->fmt_in.i_codec == VLC_FOURCC( 'a', 'l', 'a', 'w' ) ||
+    if( p_dec->fmt_in.i_codec == VLC_CODEC_ALAW ||
         p_dec->fmt_in.i_codec == VLC_FOURCC( 'u', 'l', 'a', 'w' ) ||
-        p_dec->fmt_in.i_codec == VLC_FOURCC( 'm', 'l', 'a', 'w' ) )
+        p_dec->fmt_in.i_codec == VLC_CODEC_MULAW )
     {
         p_dec->fmt_out.audio.i_bitspersample = 16;
     }
@@ -1378,40 +1378,40 @@ static int EncoderOpen( vlc_object_t *p_this )
     encoder_t *p_enc = (encoder_t *)p_this;
     encoder_sys_t *p_sys;
 
-    if( p_enc->fmt_out.i_codec == VLC_FOURCC('u','8',' ',' ') ||
-        p_enc->fmt_out.i_codec == VLC_FOURCC('s','8',' ',' ') ||
-        p_enc->fmt_out.i_codec == VLC_FOURCC('a','l','a','w') ||
+    if( p_enc->fmt_out.i_codec == VLC_CODEC_U8 ||
+        p_enc->fmt_out.i_codec == VLC_CODEC_S8 ||
+        p_enc->fmt_out.i_codec == VLC_CODEC_ALAW ||
         p_enc->fmt_out.i_codec == VLC_FOURCC('u','l','a','w') ||
-        p_enc->fmt_out.i_codec == VLC_FOURCC('m','l','a','w'))
+        p_enc->fmt_out.i_codec == VLC_CODEC_MULAW)
     {
         p_enc->fmt_out.audio.i_bitspersample = 8;
     }
-    else if( p_enc->fmt_out.i_codec == VLC_FOURCC('u','1','6','l') ||
-             p_enc->fmt_out.i_codec == VLC_FOURCC('u','1','6','b') ||
-             p_enc->fmt_out.i_codec == VLC_FOURCC('s','1','6','l') ||
-             p_enc->fmt_out.i_codec == VLC_FOURCC('s','1','6','b') )
+    else if( p_enc->fmt_out.i_codec == VLC_CODEC_U16L ||
+             p_enc->fmt_out.i_codec == VLC_CODEC_U16B ||
+             p_enc->fmt_out.i_codec == VLC_CODEC_S16L ||
+             p_enc->fmt_out.i_codec == VLC_CODEC_S16B )
     {
         p_enc->fmt_out.audio.i_bitspersample = 16;
     }
-    else if( p_enc->fmt_out.i_codec == VLC_FOURCC('u','2','4','l') ||
-             p_enc->fmt_out.i_codec == VLC_FOURCC('u','2','4','b') ||
-             p_enc->fmt_out.i_codec == VLC_FOURCC('s','2','4','l') ||
-             p_enc->fmt_out.i_codec == VLC_FOURCC('s','2','4','b') ||
+    else if( p_enc->fmt_out.i_codec == VLC_CODEC_U24L ||
+             p_enc->fmt_out.i_codec == VLC_CODEC_U24B ||
+             p_enc->fmt_out.i_codec == VLC_CODEC_S24L ||
+             p_enc->fmt_out.i_codec == VLC_CODEC_S24B ||
              p_enc->fmt_out.i_codec == VLC_FOURCC('i','n','2','4') )
     {
         p_enc->fmt_out.audio.i_bitspersample = 24;
     }
-    else if( p_enc->fmt_out.i_codec == VLC_FOURCC('u','3','2','l') ||
-             p_enc->fmt_out.i_codec == VLC_FOURCC('u','3','2','b') ||
-             p_enc->fmt_out.i_codec == VLC_FOURCC('s','3','2','l') ||
-             p_enc->fmt_out.i_codec == VLC_FOURCC('s','3','2','b') ||
+    else if( p_enc->fmt_out.i_codec == VLC_CODEC_U32L ||
+             p_enc->fmt_out.i_codec == VLC_CODEC_U32B ||
+             p_enc->fmt_out.i_codec == VLC_CODEC_S32L ||
+             p_enc->fmt_out.i_codec == VLC_CODEC_S32B ||
              p_enc->fmt_out.i_codec == VLC_FOURCC('i','n','3','2') ||
-             p_enc->fmt_out.i_codec == VLC_FOURCC('f','i','3','2') ||
-             p_enc->fmt_out.i_codec == VLC_FOURCC('f','l','3','2') )
+             p_enc->fmt_out.i_codec == VLC_CODEC_FI32 ||
+             p_enc->fmt_out.i_codec == VLC_CODEC_FL32 )
     {
         p_enc->fmt_out.audio.i_bitspersample = 32;
     }
-    else if( p_enc->fmt_out.i_codec == VLC_FOURCC('f','l','6','4') )
+    else if( p_enc->fmt_out.i_codec == VLC_CODEC_FL64 )
     {
         p_enc->fmt_out.audio.i_bitspersample = 64;
     }
@@ -1429,14 +1429,14 @@ static int EncoderOpen( vlc_object_t *p_this )
     p_enc->fmt_in.i_codec = p_enc->fmt_out.i_codec;
     p_sys->i_s16tolog = 0;
 
-    if( p_enc->fmt_out.i_codec == VLC_FOURCC( 'a', 'l', 'a', 'w' ))
+    if( p_enc->fmt_out.i_codec == VLC_CODEC_ALAW)
     {
         p_enc->fmt_in.audio.i_bitspersample = 16;
         p_enc->fmt_in.i_codec = AOUT_FMT_S16_NE;
         p_sys->i_s16tolog = ALAW;
     }
     else if( p_enc->fmt_out.i_codec == VLC_FOURCC( 'u', 'l', 'a', 'w' ) ||
-             p_enc->fmt_out.i_codec == VLC_FOURCC( 'm', 'l', 'a', 'w' ) )
+             p_enc->fmt_out.i_codec == VLC_CODEC_MULAW )
     {
         p_enc->fmt_in.audio.i_bitspersample = 16;
         p_enc->fmt_in.i_codec = AOUT_FMT_S16_NE;
index cb89dd1..bb680e3 100644 (file)
@@ -120,12 +120,12 @@ int InitAudioDec( decoder_t *p_dec, AVCodecContext *p_context,
         int i_offset;
         int i_size;
 
-        if( p_dec->fmt_in.i_codec == VLC_FOURCC( 'f', 'l', 'a', 'c' ) )
+        if( p_dec->fmt_in.i_codec == VLC_CODEC_FLAC )
         {
             i_offset = 8;
             i_size = p_dec->fmt_in.i_extra - 8;
         }
-        else if( p_dec->fmt_in.i_codec == VLC_FOURCC( 'a', 'l', 'a', 'c' ) )
+        else if( p_dec->fmt_in.i_codec == VLC_CODEC_ALAC )
         {
             static const uint8_t p_pattern[] = { 0, 0, 0, 36, 'a', 'l', 'a', 'c' };
             /* Find alac atom XXX it is a bit ugly */
@@ -454,7 +454,7 @@ static void SetupOutputFormat( decoder_t *p_dec, bool b_trust )
     switch( p_sys->p_context->sample_fmt )
     {
     case SAMPLE_FMT_U8:
-        p_dec->fmt_out.i_codec = VLC_FOURCC('u','8',' ',' ');
+        p_dec->fmt_out.i_codec = VLC_CODEC_U8;
         p_dec->fmt_out.audio.i_bitspersample = 8;
         break;
     case SAMPLE_FMT_S32:
@@ -462,11 +462,11 @@ static void SetupOutputFormat( decoder_t *p_dec, bool b_trust )
         p_dec->fmt_out.audio.i_bitspersample = 32;
         break;
     case SAMPLE_FMT_FLT:
-        p_dec->fmt_out.i_codec = VLC_FOURCC('f','l','3','2');
+        p_dec->fmt_out.i_codec = VLC_CODEC_FL32;
         p_dec->fmt_out.audio.i_bitspersample = 32;
         break;
     case SAMPLE_FMT_DBL:
-        p_dec->fmt_out.i_codec = VLC_FOURCC('f','l','6','4');
+        p_dec->fmt_out.i_codec = VLC_CODEC_FL64;
         p_dec->fmt_out.audio.i_bitspersample = 64;
         break;
 
index 6913a42..6e13170 100644 (file)
@@ -66,52 +66,52 @@ static const struct
 } chroma_table[] =
 {
     /* Planar YUV formats */
-    {VLC_FOURCC('I','4','4','4'), PIX_FMT_YUV444P, 0, 0, 0 },
-    {VLC_FOURCC('J','4','4','4'), PIX_FMT_YUVJ444P, 0, 0, 0 },
+    {VLC_CODEC_I444, PIX_FMT_YUV444P, 0, 0, 0 },
+    {VLC_CODEC_J444, PIX_FMT_YUVJ444P, 0, 0, 0 },
 
 #if LIBAVUTIL_VERSION_INT >= ((49<<16)+(5<<8)+0)
-    {VLC_FOURCC('I','4','4','0'), PIX_FMT_YUV440P, 0, 0, 0 },
-    {VLC_FOURCC('J','4','4','0'), PIX_FMT_YUVJ440P, 0, 0, 0 },
+    {VLC_CODEC_I440, PIX_FMT_YUV440P, 0, 0, 0 },
+    {VLC_CODEC_J440, PIX_FMT_YUVJ440P, 0, 0, 0 },
 #endif
 
-    {VLC_FOURCC('I','4','2','2'), PIX_FMT_YUV422P, 0, 0, 0 },
-    {VLC_FOURCC('J','4','2','2'), PIX_FMT_YUVJ422P, 0, 0, 0 },
+    {VLC_CODEC_I422, PIX_FMT_YUV422P, 0, 0, 0 },
+    {VLC_CODEC_J422, PIX_FMT_YUVJ422P, 0, 0, 0 },
 
-    {VLC_FOURCC('I','4','2','0'), PIX_FMT_YUV420P, 0, 0, 0 },
-    {VLC_FOURCC('Y','V','1','2'), PIX_FMT_YUV420P, 0, 0, 0 },
+    {VLC_CODEC_I420, PIX_FMT_YUV420P, 0, 0, 0 },
+    {VLC_CODEC_YV12, PIX_FMT_YUV420P, 0, 0, 0 },
     {VLC_FOURCC('I','Y','U','V'), PIX_FMT_YUV420P, 0, 0, 0 },
-    {VLC_FOURCC('J','4','2','0'), PIX_FMT_YUVJ420P, 0, 0, 0 },
-    {VLC_FOURCC('I','4','1','1'), PIX_FMT_YUV411P, 0, 0, 0 },
-    {VLC_FOURCC('I','4','1','0'), PIX_FMT_YUV410P, 0, 0, 0 },
+    {VLC_CODEC_J420, PIX_FMT_YUVJ420P, 0, 0, 0 },
+    {VLC_CODEC_I411, PIX_FMT_YUV411P, 0, 0, 0 },
+    {VLC_CODEC_I410, PIX_FMT_YUV410P, 0, 0, 0 },
     {VLC_FOURCC('Y','V','U','9'), PIX_FMT_YUV410P, 0, 0, 0 },
 
     {VLC_FOURCC('N','V','1','2'), PIX_FMT_NV12, 0, 0, 0 },
     {VLC_FOURCC('N','V','2','1'), PIX_FMT_NV21, 0, 0, 0 },
 
     /* Packed YUV formats */
-    {VLC_FOURCC('Y','U','Y','2'), PIX_FMT_YUYV422, 0, 0, 0 },
+    {VLC_CODEC_YUYV, PIX_FMT_YUYV422, 0, 0, 0 },
     {VLC_FOURCC('Y','U','Y','V'), PIX_FMT_YUYV422, 0, 0, 0 },
-    {VLC_FOURCC('U','Y','V','Y'), PIX_FMT_UYVY422, 0, 0, 0 },
+    {VLC_CODEC_UYVY, PIX_FMT_UYVY422, 0, 0, 0 },
     {VLC_FOURCC('Y','4','1','1'), PIX_FMT_UYYVYY411, 0, 0, 0 },
 
     /* Packed RGB formats */
     VLC_RGB( VLC_FOURCC('R','G','B','4'), PIX_FMT_RGB4, PIX_FMT_BGR4, 0x10, 0x06, 0x01 )
     VLC_RGB( VLC_FOURCC('R','G','B','8'), PIX_FMT_RGB8, PIX_FMT_BGR8, 0xC0, 0x38, 0x07 )
 
-    VLC_RGB( VLC_FOURCC('R','V','1','5'), PIX_FMT_BGR555, PIX_FMT_RGB555, 0x7c00, 0x03e0, 0x001f )
-    VLC_RGB( VLC_FOURCC('R','V','1','6'), PIX_FMT_BGR565, PIX_FMT_RGB565, 0xf800, 0x07e0, 0x001f )
-    VLC_RGB( VLC_FOURCC('R','V','2','4'), PIX_FMT_BGR24, PIX_FMT_RGB24, 0xff0000, 0x00ff00, 0x0000ff )
+    VLC_RGB( VLC_CODEC_RGB15, PIX_FMT_BGR555, PIX_FMT_RGB555, 0x7c00, 0x03e0, 0x001f )
+    VLC_RGB( VLC_CODEC_RGB16, PIX_FMT_BGR565, PIX_FMT_RGB565, 0xf800, 0x07e0, 0x001f )
+    VLC_RGB( VLC_CODEC_RGB24, PIX_FMT_BGR24, PIX_FMT_RGB24, 0xff0000, 0x00ff00, 0x0000ff )
 
-    VLC_RGB( VLC_FOURCC('R','V','3','2'), PIX_FMT_RGB32, PIX_FMT_BGR32, 0x00ff0000, 0x0000ff00, 0x000000ff )
-    VLC_RGB( VLC_FOURCC('R','V','3','2'), PIX_FMT_RGB32_1, PIX_FMT_BGR32_1, 0xff000000, 0x00ff0000, 0x0000ff00 )
+    VLC_RGB( VLC_CODEC_RGB32, PIX_FMT_RGB32, PIX_FMT_BGR32, 0x00ff0000, 0x0000ff00, 0x000000ff )
+    VLC_RGB( VLC_CODEC_RGB32, PIX_FMT_RGB32_1, PIX_FMT_BGR32_1, 0xff000000, 0x00ff0000, 0x0000ff00 )
 
 #if defined(PIX_FMT_RGBA)
-    {VLC_FOURCC('R','G','B','A'), PIX_FMT_RGBA, 0xff000000, 0x00ff0000, 0x0000ff00},
+    {VLC_CODEC_RGBA, PIX_FMT_RGBA, 0xff000000, 0x00ff0000, 0x0000ff00},
 #endif
-    {VLC_FOURCC('G','R','E','Y'), PIX_FMT_GRAY8, 0, 0, 0},
+    {VLC_CODEC_GREY, PIX_FMT_GRAY8, 0, 0, 0},
 
      /* Paletized RGB */
-    {VLC_FOURCC('R','G','B','P'), PIX_FMT_PAL8, 0, 0, 0},
+    {VLC_CODEC_RGBP, PIX_FMT_PAL8, 0, 0, 0},
 
 
     { 0, 0, 0, 0, 0 }
index 092090d..3894755 100644 (file)
@@ -453,8 +453,8 @@ int OpenEncoder( vlc_object_t *p_this )
             __MAX( __MIN( p_sys->i_b_frames, FF_MAX_B_FRAMES ), 0 );
         p_context->b_frame_strategy = 0;
         if( !p_context->max_b_frames  &&
-            (  p_enc->fmt_out.i_codec == VLC_FOURCC('m', 'p', '2', 'v') ||
-               p_enc->fmt_out.i_codec == VLC_FOURCC('m', 'p', '1', 'v') ) )
+            (  p_enc->fmt_out.i_codec == VLC_CODEC_MP2V ||
+               p_enc->fmt_out.i_codec == VLC_CODEC_MP1V ) )
             p_context->flags |= CODEC_FLAG_LOW_DELAY;
 
         av_reduce( &i_aspect_num, &i_aspect_den,
@@ -470,7 +470,7 @@ int OpenEncoder( vlc_object_t *p_this )
             p_sys->i_buffer_out = FF_MIN_BUFFER_SIZE;
         p_sys->p_buffer_out = malloc( p_sys->i_buffer_out );
 
-        p_enc->fmt_in.i_codec = VLC_FOURCC('I','4','2','0');
+        p_enc->fmt_in.i_codec = VLC_CODEC_I420;
         p_enc->fmt_in.video.i_chroma = p_enc->fmt_in.i_codec;
         GetFfmpegChroma( &p_context->pix_fmt, p_enc->fmt_in.video );
 
@@ -587,7 +587,7 @@ int OpenEncoder( vlc_object_t *p_this )
         p_context->sample_rate = p_enc->fmt_out.audio.i_rate;
         p_context->channels    = p_enc->fmt_out.audio.i_channels;
 
-        if ( p_enc->fmt_out.i_codec == VLC_FOURCC('m','p','4','a') )
+        if ( p_enc->fmt_out.i_codec == VLC_CODEC_MP4A )
         {
             /* XXX: FAAC does resample only when setting the INPUT samplerate
              * to the desired value (-R option of the faac frontend)
@@ -872,7 +872,7 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
     frame.top_field_first = !!p_pict->b_top_field_first;
 
     /* Set the pts of the frame being encoded (segfaults with mpeg4!)*/
-    if( p_enc->fmt_out.i_codec != VLC_FOURCC( 'm', 'p', '4', 'v' ) )
+    if( p_enc->fmt_out.i_codec != VLC_CODEC_MP4V )
     {
         frame.pts = p_pict->date ? p_pict->date : (int64_t)AV_NOPTS_VALUE;
 
index 1c2a2ef..951470b 100644 (file)
@@ -128,7 +128,7 @@ static inline picture_t *ffmpeg_NewPictBuf( decoder_t *p_dec,
     if( GetVlcChroma( &p_dec->fmt_out.video, p_context->pix_fmt ) != VLC_SUCCESS )
     {
         /* we are doomed, but not really, because most codecs set their pix_fmt much later */
-        p_dec->fmt_out.i_codec = VLC_FOURCC('I','4','2','0');
+        p_dec->fmt_out.i_codec = VLC_CODEC_I420;
     }
     p_dec->fmt_out.i_codec = p_dec->fmt_out.video.i_chroma;
 
@@ -340,7 +340,7 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
     if( GetVlcChroma( &p_dec->fmt_out.video, p_context->pix_fmt ) != VLC_SUCCESS )
     {
         /* we are doomed. but not really, because most codecs set their pix_fmt later on */
-        p_dec->fmt_out.i_codec = VLC_FOURCC('I','4','2','0');
+        p_dec->fmt_out.i_codec = VLC_CODEC_I420;
     }
     p_dec->fmt_out.i_codec = p_dec->fmt_out.video.i_chroma;
 
index 419d576..bf312fd 100644 (file)
@@ -210,7 +210,7 @@ static int Open( vlc_object_t *p_this )
     Eia608Init( &p_sys->eia608 );
 
     p_dec->fmt_out.i_cat = SPU_ES;
-    p_dec->fmt_out.i_codec = VLC_FOURCC('T','E','X','T');
+    p_dec->fmt_out.i_codec = VLC_CODEC_TEXT;
 
     return VLC_SUCCESS;
 }
@@ -340,7 +340,7 @@ static subpicture_t *Subtitle( decoder_t *p_dec, char *psz_subtitle, char *psz_h
 
     /* Create a new subpicture region */
     memset( &fmt, 0, sizeof(video_format_t) );
-    fmt.i_chroma = VLC_FOURCC('T','E','X','T');
+    fmt.i_chroma = VLC_CODEC_TEXT;
     fmt.i_aspect = 0;
     fmt.i_width = fmt.i_height = 0;
     fmt.i_x_offset = fmt.i_y_offset = 0;
index c1a3e75..974021e 100644 (file)
@@ -99,7 +99,7 @@ static int Open( vlc_object_t *p_this )
     decoder_t *p_dec = (decoder_t*)p_this;
     decoder_sys_t *p_sys;
 
-    if( p_dec->fmt_in.i_codec != VLC_FOURCC('C','D','G',' ') )
+    if( p_dec->fmt_in.i_codec != VLC_CODEC_CDG )
         return VLC_EGENERIC;
 
     /* Allocate the memory needed to store the decoder's structure */
@@ -114,7 +114,7 @@ static int Open( vlc_object_t *p_this )
     /* Set output properties
      * TODO maybe it would be better to use RV16 or RV24 ? */
     p_dec->fmt_out.i_cat = VIDEO_ES;
-    p_dec->fmt_out.i_codec = VLC_FOURCC('R','V','3','2');
+    p_dec->fmt_out.i_codec = VLC_CODEC_RGB32;
     p_dec->fmt_out.video.i_width = CDG_DISPLAY_WIDTH;
     p_dec->fmt_out.video.i_height = CDG_DISPLAY_HEIGHT;
     p_dec->fmt_out.video.i_aspect =
index 3802f4a..d09e16a 100644 (file)
@@ -102,7 +102,7 @@ static int Create( vlc_object_t *p_this )
     csri_rend *p_render;
     struct csri_stream_ext *p_stream_ext;
 
-    if( p_dec->fmt_in.i_codec != VLC_FOURCC('s','s','a',' ') )
+    if( p_dec->fmt_in.i_codec != VLC_CODEC_SSA )
         return VLC_EGENERIC;
 
     p_render = csri_renderer_default();
@@ -131,7 +131,7 @@ static int Create( vlc_object_t *p_this )
                                                    p_dec->fmt_in.p_extra ? strnlen( p_dec->fmt_in.p_extra, p_dec->fmt_in.i_extra ) : 0,
                                                    NULL);
     p_dec->fmt_out.i_cat = SPU_ES;
-    p_dec->fmt_out.i_codec = VLC_FOURCC('R','G','B','A');
+    p_dec->fmt_out.i_codec = VLC_CODEC_RGBA;
 
     return VLC_SUCCESS;
 }
@@ -268,7 +268,7 @@ static void UpdateRegions( spu_t *p_spu, subpicture_t *p_subpic,
     /* XXX On x86 at least our RGBA is mapped to their BGRA
      * TODO confirm that is the same on big endian cpu */
     fmt = *p_fmt;
-    fmt.i_chroma = VLC_FOURCC('R','G','B','A');
+    fmt.i_chroma = VLC_CODEC_RGBA;
     fmt.i_width = fmt.i_visible_width;
     fmt.i_height = fmt.i_visible_height;
     fmt.i_bits_per_pixel = 0;
index dbd5916..4570710 100644 (file)
@@ -129,7 +129,7 @@ static int DecoderOpen( vlc_object_t *p_this )
     p_dec->pf_packetize  = Packetize;
 
     p_dec->fmt_out.i_cat = SPU_ES;
-    p_dec->fmt_out.i_codec = VLC_FOURCC('Y','U','V','P');
+    p_dec->fmt_out.i_codec = VLC_CODEC_YUVP;
 
     return VLC_SUCCESS;
 }
@@ -512,7 +512,7 @@ static subpicture_t *DecodePacket( decoder_t *p_dec, block_t *p_data )
 
     /* Create new SPU region */
     memset( &fmt, 0, sizeof(video_format_t) );
-    fmt.i_chroma = VLC_FOURCC('Y','U','V','P');
+    fmt.i_chroma = VLC_CODEC_YUVP;
     fmt.i_aspect = VOUT_ASPECT_FACTOR;
     fmt.i_width = fmt.i_visible_width = p_sys->i_width;
     fmt.i_height = fmt.i_visible_height = p_sys->i_height;
index f397ba2..7e11878 100644 (file)
@@ -443,7 +443,7 @@ static int OpenEncoder( vlc_object_t *p_this )
     float f_tmp;
     char *psz_tmp;
 
-    if( p_enc->fmt_out.i_codec != VLC_FOURCC('d','r','a','c') &&
+    if( p_enc->fmt_out.i_codec != VLC_CODEC_DIRAC &&
         !p_enc->b_force )
     {
         return VLC_EGENERIC;
@@ -462,7 +462,7 @@ static int OpenEncoder( vlc_object_t *p_this )
 
     p_enc->p_sys = p_sys;
     p_enc->pf_encode_video = Encode;
-    p_enc->fmt_out.i_codec = VLC_FOURCC('d','r','a','c');
+    p_enc->fmt_out.i_codec = VLC_CODEC_DIRAC;
     p_enc->fmt_out.i_cat = VIDEO_ES;
 
     if( ( p_sys->p_dts_fifo = block_FifoNew() ) == NULL )
@@ -519,19 +519,19 @@ static int OpenEncoder( vlc_object_t *p_this )
     if( !psz_tmp )
         goto error;
     else if( !strcmp( psz_tmp, "420" ) ) {
-        p_enc->fmt_in.i_codec = VLC_FOURCC('I','4','2','0');
+        p_enc->fmt_in.i_codec = VLC_CODEC_I420;
         p_enc->fmt_in.video.i_bits_per_pixel = 12;
         p_sys->ctx.src_params.chroma = format420;
         p_sys->i_buffer_in = p_enc->fmt_in.video.i_width * p_enc->fmt_in.video.i_height * 3 / 2;
     }
     else if( !strcmp( psz_tmp, "422" ) ) {
-        p_enc->fmt_in.i_codec = VLC_FOURCC('I','4','2','2');
+        p_enc->fmt_in.i_codec = VLC_CODEC_I422;
         p_enc->fmt_in.video.i_bits_per_pixel = 16;
         p_sys->ctx.src_params.chroma = format422;
         p_sys->i_buffer_in = p_enc->fmt_in.video.i_width * p_enc->fmt_in.video.i_height * 2;
     }
     else if( !strcmp( psz_tmp, "444" ) ) {
-        p_enc->fmt_in.i_codec = VLC_FOURCC('I','4','4','4');
+        p_enc->fmt_in.i_codec = VLC_CODEC_I444;
         p_enc->fmt_in.video.i_bits_per_pixel = 24;
         p_sys->ctx.src_params.chroma = format444;
         p_sys->i_buffer_in = p_enc->fmt_in.video.i_width * p_enc->fmt_in.video.i_height * 3;
index 0c10fba..236015f 100644 (file)
@@ -187,15 +187,15 @@ static const codec_dll decoders_table[] =
     { VLC_FOURCC('W','V','C','1'), "wvc1dmod.dll", &guid_wvc1 },
     { VLC_FOURCC('w','v','c','1'), "wvc1dmod.dll", &guid_wvc1 },
     /* WMV3 */
-    { VLC_FOURCC('W','M','V','3'), "wmv9dmod.dll", &guid_wmv9 },
+    { VLC_CODEC_WMV3, "wmv9dmod.dll", &guid_wmv9 },
     { VLC_FOURCC('w','m','v','3'), "wmv9dmod.dll", &guid_wmv9 },
     { VLC_FOURCC('W','M','V','P'), "wmv9dmod.dll", &guid_wmv9 },
     { VLC_FOURCC('w','m','v','p'), "wmv9dmod.dll", &guid_wmv9 },
     /* WMV2 */
-    { VLC_FOURCC('W','M','V','2'), "wmvdmod.dll", &guid_wmv },
+    { VLC_CODEC_WMV2, "wmvdmod.dll", &guid_wmv },
     { VLC_FOURCC('w','m','v','2'), "wmvdmod.dll", &guid_wmv },
     /* WMV1 */
-    { VLC_FOURCC('W','M','V','1'), "wmvdmod.dll", &guid_wmv },
+    { VLC_CODEC_WMV1, "wmvdmod.dll", &guid_wmv },
     { VLC_FOURCC('w','m','v','1'), "wmvdmod.dll", &guid_wmv },
     /* Screen codecs */
     { VLC_FOURCC('M','S','S','2'), "wmsdmod.dll", &guid_wms },
@@ -211,14 +211,14 @@ static const codec_dll decoders_table[] =
     /* WMA 3 */
     { VLC_FOURCC('W','M','A','3'), "wma9dmod.dll", &guid_wma9 },
     { VLC_FOURCC('w','m','a','3'), "wma9dmod.dll", &guid_wma9 },
-    { VLC_FOURCC('W','M','A','P'), "wma9dmod.dll", &guid_wma9 },
+    { VLC_CODEC_WMAP, "wma9dmod.dll", &guid_wma9 },
     { VLC_FOURCC('w','m','a','p'), "wma9dmod.dll", &guid_wma9 },
     /* WMA 2 */
-    { VLC_FOURCC('W','M','A','2'), "wma9dmod.dll", &guid_wma9 },
+    { VLC_CODEC_WMA2, "wma9dmod.dll", &guid_wma9 },
     { VLC_FOURCC('w','m','a','2'), "wma9dmod.dll", &guid_wma9 },
 
     /* WMA Speech */
-    { VLC_FOURCC('W','M','A','S'), "wmspdmod.dll", &guid_wma },
+    { VLC_CODEC_WMAS, "wmspdmod.dll", &guid_wma },
     { VLC_FOURCC('w','m','a','s'), "wmspdmod.dll", &guid_wma },
 
     /* */
@@ -228,20 +228,20 @@ static const codec_dll decoders_table[] =
 static const codec_dll encoders_table[] =
 {
     /* WMV3 */
-    { VLC_FOURCC('W','M','V','3'), "wmvdmoe2.dll", &guid_wmv_enc2 },
+    { VLC_CODEC_WMV3, "wmvdmoe2.dll", &guid_wmv_enc2 },
     { VLC_FOURCC('w','m','v','3'), "wmvdmoe2.dll", &guid_wmv_enc2 },
     /* WMV2 */
-    { VLC_FOURCC('W','M','V','2'), "wmvdmoe2.dll", &guid_wmv_enc2 },
+    { VLC_CODEC_WMV2, "wmvdmoe2.dll", &guid_wmv_enc2 },
     { VLC_FOURCC('w','m','v','2'), "wmvdmoe2.dll", &guid_wmv_enc2 },
     /* WMV1 */
-    { VLC_FOURCC('W','M','V','1'), "wmvdmoe2.dll", &guid_wmv_enc2 },
+    { VLC_CODEC_WMV1, "wmvdmoe2.dll", &guid_wmv_enc2 },
     { VLC_FOURCC('w','m','v','1'), "wmvdmoe2.dll", &guid_wmv_enc2 },
 
     /* WMA 3 */
     { VLC_FOURCC('W','M','A','3'), "wmadmoe.dll", &guid_wma_enc },
     { VLC_FOURCC('w','m','a','3'), "wmadmoe.dll", &guid_wma_enc },
     /* WMA 2 */
-    { VLC_FOURCC('W','M','A','2'), "wmadmoe.dll", &guid_wma_enc },
+    { VLC_CODEC_WMA2, "wmadmoe.dll", &guid_wma_enc },
     { VLC_FOURCC('w','m','a','2'), "wmadmoe.dll", &guid_wma_enc },
 
     /* */
@@ -502,14 +502,14 @@ static int DecOpen( decoder_t *p_dec )
     {
         BITMAPINFOHEADER *p_bih;
         DMO_MEDIA_TYPE mt;
-        unsigned i_chroma = VLC_FOURCC('Y','U','Y','2');
+        unsigned i_chroma = VLC_CODEC_YUYV;
         int i_planes = 1, i_bpp = 16;
         int i = 0;
 
         /* Find out which chroma to use */
         while( !p_dmo->vt->GetOutputType( p_dmo, 0, i++, &mt ) )
         {
-            if( mt.subtype.Data1 == VLC_FOURCC('Y','V','1','2') )
+            if( mt.subtype.Data1 == VLC_CODEC_YV12 )
             {
                 i_chroma = mt.subtype.Data1;
                 i_planes = 3; i_bpp = 12;
@@ -518,8 +518,8 @@ static int DecOpen( decoder_t *p_dec )
             DMOFreeMediaType( &mt );
         }
 
-        p_dec->fmt_out.i_codec = i_chroma == VLC_FOURCC('Y','V','1','2') ?
-            VLC_FOURCC('I','4','2','0') : i_chroma;
+        p_dec->fmt_out.i_codec = i_chroma == VLC_CODEC_YV12 ?
+            VLC_CODEC_I420 : i_chroma;
         p_dec->fmt_out.video.i_width = p_dec->fmt_in.video.i_width;
         p_dec->fmt_out.video.i_height = p_dec->fmt_in.video.i_height;
         p_dec->fmt_out.video.i_bits_per_pixel = i_bpp;
@@ -1122,7 +1122,7 @@ static int EncoderSetVideoType( encoder_t *p_enc, IMediaObject *p_dmo )
     memset( &vih, 0, sizeof(VIDEOINFOHEADER) );
 
     p_bih = &vih.bmiHeader;
-    p_bih->biCompression = VLC_FOURCC('I','4','2','0');
+    p_bih->biCompression = VLC_CODEC_I420;
     p_bih->biWidth = p_enc->fmt_in.video.i_width;
     p_bih->biHeight = p_enc->fmt_in.video.i_height;
     p_bih->biBitCount = p_enc->fmt_in.video.i_bits_per_pixel;
@@ -1237,7 +1237,7 @@ static int EncoderSetVideoType( encoder_t *p_enc, IMediaObject *p_dmo )
     i_err = p_dmo->vt->SetOutputType( p_dmo, 0, &dmo_type, 0 );
 
     p_vih = (VIDEOINFOHEADER *)dmo_type.pbFormat;
-    p_enc->fmt_in.i_codec = VLC_FOURCC('I','4','2','0');
+    p_enc->fmt_in.i_codec = VLC_CODEC_I420;
 
     DMOFreeMediaType( &dmo_type );
     if( i_err )
index 9b4ac47..3a565bd 100644 (file)
@@ -140,7 +140,7 @@ static int OpenCommon( vlc_object_t *p_this, bool b_packetizer )
     decoder_t *p_dec = (decoder_t*)p_this;
     decoder_sys_t *p_sys;
 
-    if( p_dec->fmt_in.i_codec != VLC_FOURCC('d','t','s',' ') &&
+    if( p_dec->fmt_in.i_codec != VLC_CODEC_DTS &&
         p_dec->fmt_in.i_codec != VLC_FOURCC('d','t','s','b') )
     {
         return VLC_EGENERIC;
@@ -160,7 +160,7 @@ static int OpenCommon( vlc_object_t *p_this, bool b_packetizer )
 
     /* Set output properties */
     p_dec->fmt_out.i_cat = AUDIO_ES;
-    p_dec->fmt_out.i_codec = VLC_FOURCC('d','t','s',' ');
+    p_dec->fmt_out.i_codec = VLC_CODEC_DTS;
     p_dec->fmt_out.audio.i_rate = 0; /* So end_date gets initialized */
 
     /* Set callback */
index b102cd0..f546e71 100644 (file)
@@ -296,7 +296,7 @@ static int Open( vlc_object_t *p_this )
     vlc_value_t    val;
     int i_posx, i_posy;
 
-    if( p_dec->fmt_in.i_codec != VLC_FOURCC('d','v','b','s') )
+    if( p_dec->fmt_in.i_codec != VLC_CODEC_DVBS )
     {
         return VLC_EGENERIC;
     }
@@ -1542,7 +1542,7 @@ static subpicture_t *render( decoder_t *p_dec )
 
         /* Create new SPU region */
         memset( &fmt, 0, sizeof(video_format_t) );
-        fmt.i_chroma = VLC_FOURCC('Y','U','V','P');
+        fmt.i_chroma = VLC_CODEC_YUVP;
         fmt.i_aspect = 0; /* 0 means use aspect ratio of background video */
         fmt.i_width = fmt.i_visible_width = p_region->i_width;
         fmt.i_height = fmt.i_visible_height = p_region->i_height;
@@ -1595,7 +1595,7 @@ static subpicture_t *render( decoder_t *p_dec )
 
             /* Create new SPU region */
             memset( &fmt, 0, sizeof(video_format_t) );
-            fmt.i_chroma = VLC_FOURCC('T','E','X','T');
+            fmt.i_chroma = VLC_CODEC_TEXT;
             fmt.i_aspect = VOUT_ASPECT_FACTOR;
             fmt.i_width = fmt.i_visible_width = p_region->i_width;
             fmt.i_height = fmt.i_visible_height = p_region->i_height;
@@ -1659,7 +1659,7 @@ static int OpenEncoder( vlc_object_t *p_this )
     encoder_sys_t *p_sys;
     vlc_value_t val;
 
-    if( ( p_enc->fmt_out.i_codec != VLC_FOURCC('d','v','b','s') ) &&
+    if( ( p_enc->fmt_out.i_codec != VLC_CODEC_DVBS ) &&
         !p_enc->b_force )
     {
         return VLC_EGENERIC;
@@ -1671,7 +1671,7 @@ static int OpenEncoder( vlc_object_t *p_this )
     p_enc->p_sys = p_sys;
 
     p_enc->pf_encode_sub = Encode;
-    p_enc->fmt_out.i_codec = VLC_FOURCC('d','v','b','s');
+    p_enc->fmt_out.i_codec = VLC_CODEC_DVBS;
     p_enc->fmt_out.subs.dvb.i_id  = 1 << 16 | 1;
 
     config_ChainParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg );
@@ -1692,8 +1692,8 @@ static int OpenEncoder( vlc_object_t *p_this )
     return VLC_SUCCESS;
 }
 
-/* FIXME: this routine is a hack to convert VLC_FOURCC('Y','U','V','A')
- *        into VLC_FOURCC('Y','U','V','P')
+/* FIXME: this routine is a hack to convert VLC_CODEC_YUVA
+ *        into VLC_CODEC_YUVP
  */
 static subpicture_t *YuvaYuvp( subpicture_t *p_subpic )
 {
@@ -1722,7 +1722,7 @@ static subpicture_t *YuvaYuvp( subpicture_t *p_subpic )
 #ifdef DEBUG_DVBSUB
         msg_Dbg( p_enc, "YuvaYuvp: i_pixels=%d, i_iterator=%d", i_pixels, i_iterator );
 #endif
-        p_fmt->i_chroma = VLC_FOURCC('Y','U','V','P');
+        p_fmt->i_chroma = VLC_CODEC_YUVP;
         p_fmt->p_palette = (video_palette_t *) malloc( sizeof( video_palette_t ) );
         if( !p_fmt->p_palette ) break;
         p_fmt->p_palette->i_entries = 0;
@@ -1909,11 +1909,11 @@ static block_t *Encode( encoder_t *p_enc, subpicture_t *p_subpic )
 
     if( !p_subpic || !p_subpic->p_region ) return NULL;
 
-    /* FIXME: this is a hack to convert VLC_FOURCC('Y','U','V','A') into
-     *  VLC_FOURCC('Y','U','V','P')
+    /* FIXME: this is a hack to convert VLC_CODEC_YUVA into
+     *  VLC_CODEC_YUVP
      */
     p_region = p_subpic->p_region;
-    if( p_region->fmt.i_chroma == VLC_FOURCC('Y','U','V','A') )
+    if( p_region->fmt.i_chroma == VLC_CODEC_YUVA )
     {
         p_temp = YuvaYuvp( p_subpic );
         if( !p_temp )
@@ -1927,8 +1927,8 @@ static block_t *Encode( encoder_t *p_enc, subpicture_t *p_subpic )
     /* Sanity check */
     if( !p_region ) return NULL;
 
-    if( ( p_region->fmt.i_chroma != VLC_FOURCC('T','E','X','T') ) &&
-        ( p_region->fmt.i_chroma != VLC_FOURCC('Y','U','V','P') ) )
+    if( ( p_region->fmt.i_chroma != VLC_CODEC_TEXT ) &&
+        ( p_region->fmt.i_chroma != VLC_CODEC_YUVP ) )
     {
         char psz_fourcc[5];
         memset( &psz_fourcc, 0, sizeof( psz_fourcc ) );
@@ -2113,7 +2113,7 @@ static void encode_clut( encoder_t *p_enc, bs_t *s, subpicture_t *p_subpic )
     /* Sanity check */
     if( !p_region ) return;
 
-    if( p_region->fmt.i_chroma == VLC_FOURCC('Y','U','V','P') )
+    if( p_region->fmt.i_chroma == VLC_CODEC_YUVP )
     {
         p_pal = p_region->fmt.p_palette;
     }
@@ -2167,7 +2167,7 @@ static void encode_region_composition( encoder_t *p_enc, bs_t *s,
     {
         int i_entries = 4, i_depth = 0x1, i_bg = 0;
         bool b_text =
-            ( p_region->fmt.i_chroma == VLC_FOURCC('T','E','X','T') );
+            ( p_region->fmt.i_chroma == VLC_CODEC_TEXT );
 
         if( !b_text )
         {
@@ -2253,10 +2253,10 @@ static void encode_object( encoder_t *p_enc, bs_t *s, subpicture_t *p_subpic )
         /* object coding method */
         switch( p_region->fmt.i_chroma )
         {
-        case VLC_FOURCC( 'Y','U','V','P' ):
+        case VLC_CODEC_YUVP:
             bs_write( s, 2, 0 );
             break;
-        case VLC_FOURCC( 'T','E','X','T' ):
+        case VLC_CODEC_TEXT:
             bs_write( s, 2, 1 );
             break;
         default:
@@ -2267,7 +2267,7 @@ static void encode_object( encoder_t *p_enc, bs_t *s, subpicture_t *p_subpic )
         bs_write( s, 1, 0 ); /* non modifying color flag */
         bs_write( s, 1, 0 ); /* Reserved */
 
-        if( p_region->fmt.i_chroma == VLC_FOURCC( 'T','E','X','T' ) )
+        if( p_region->fmt.i_chroma == VLC_CODEC_TEXT )
         {
             int i_size, i;
 
@@ -2326,7 +2326,7 @@ static void encode_pixel_data( encoder_t *p_enc, bs_t *s,
     unsigned int i_line;
 
     /* Sanity check */
-    if( p_region->fmt.i_chroma != VLC_FOURCC('Y','U','V','P') ) return;
+    if( p_region->fmt.i_chroma != VLC_CODEC_YUVP ) return;
 
     /* Encode line by line */
     for( i_line = !b_top; i_line < p_region->fmt.i_visible_height;
index e050a94..1f4f079 100644 (file)
@@ -117,7 +117,7 @@ static int Open( vlc_object_t *p_this )
     decoder_sys_t *p_sys = p_dec->p_sys;
     faacDecConfiguration *cfg;
 
-    if( p_dec->fmt_in.i_codec != VLC_FOURCC('m','p','4','a') )
+    if( p_dec->fmt_in.i_codec != VLC_CODEC_MP4A )
     {
         return VLC_EGENERIC;
     }
@@ -138,7 +138,7 @@ static int Open( vlc_object_t *p_this )
     p_dec->fmt_out.i_cat = AUDIO_ES;
 
     if (vlc_CPU() & CPU_CAPABILITY_FPU)
-        p_dec->fmt_out.i_codec = VLC_FOURCC('f','l','3','2');
+        p_dec->fmt_out.i_codec = VLC_CODEC_FL32;
     else
         p_dec->fmt_out.i_codec = AOUT_FMT_S16_NE;
     p_dec->pf_decode_audio = DecodeBlock;
index 0696eb1..b978785 100644 (file)
@@ -172,14 +172,15 @@ static int OpenDecoder( vlc_object_t *p_this )
     if( strlen( psz_chroma ) != 4 )
     {
         msg_Warn( p_dec, "Invalid chroma (%s). Using I420.", psz_chroma );
-        fmt_out.i_chroma = VLC_FOURCC('I','4','2','0');
+        fmt_out.i_chroma = VLC_CODEC_I420;
     }
     else
     {
-        fmt_out.i_chroma = VLC_FOURCC( psz_chroma[0],
-                                       psz_chroma[1],
-                                       psz_chroma[2],
-                                       psz_chroma[3] );
+        fmt_out.i_chroma = vlc_fourcc_GetCodec( VIDEO_ES,
+                                                VLC_FOURCC( psz_chroma[0],
+                                                            psz_chroma[1],
+                                                            psz_chroma[2],
+                                                            psz_chroma[3] ) );
     }
     free( psz_chroma );
 
index be411d5..b250cc3 100644 (file)
@@ -210,7 +210,7 @@ static int OpenDecoder( vlc_object_t *p_this )
     decoder_t *p_dec = (decoder_t*)p_this;
     decoder_sys_t *p_sys;
 
-    if( p_dec->fmt_in.i_codec != VLC_FOURCC('f','l','a','c') )
+    if( p_dec->fmt_in.i_codec != VLC_CODEC_FLAC )
     {
         return VLC_EGENERIC;
     }
@@ -270,7 +270,7 @@ static int OpenDecoder( vlc_object_t *p_this )
 
     /* Set output properties */
     p_dec->fmt_out.i_cat = AUDIO_ES;
-    p_dec->fmt_out.i_codec = VLC_FOURCC('f','l','3','2');
+    p_dec->fmt_out.i_codec = VLC_CODEC_FL32;
 
     /* Set callbacks */
 #ifdef USE_LIBFLAC
@@ -294,7 +294,7 @@ static int OpenPacketizer( vlc_object_t *p_this )
     p_dec->pf_packetize    = PacketizeBlock;
 
     /* Set output properties */
-    p_dec->fmt_out.i_codec = VLC_FOURCC('f','l','a','c');
+    p_dec->fmt_out.i_codec = VLC_CODEC_FLAC;
 
     if( i_ret != VLC_SUCCESS )
     {
@@ -359,7 +359,7 @@ static void ProcessHeader( decoder_t *p_dec )
 
     if( !p_sys->b_stream_info ) return;
 
-    if( p_dec->fmt_out.i_codec == VLC_FOURCC('f','l','a','c') )
+    if( p_dec->fmt_out.i_codec == VLC_CODEC_FLAC )
     {
         p_dec->fmt_out.i_extra = p_dec->fmt_in.i_extra;
         p_dec->fmt_out.p_extra =
@@ -685,7 +685,7 @@ static void DecoderMetadataCallback( const FLAC__StreamDecoder *decoder,
         switch( metadata->data.stream_info.bits_per_sample )
         {
         case 8:
-            p_dec->fmt_out.i_codec = VLC_FOURCC('s','8',' ',' ');
+            p_dec->fmt_out.i_codec = VLC_CODEC_S8;
             break;
         case 16:
             p_dec->fmt_out.i_codec = AOUT_FMT_S16_NE;
@@ -696,7 +696,7 @@ static void DecoderMetadataCallback( const FLAC__StreamDecoder *decoder,
         default:
             msg_Dbg( p_dec, "strange bit/sample value: %d",
                      metadata->data.stream_info.bits_per_sample );
-            p_dec->fmt_out.i_codec = VLC_FOURCC('f','i','3','2');
+            p_dec->fmt_out.i_codec = VLC_CODEC_FI32;
             break;
         }
     }
@@ -1284,7 +1284,7 @@ static int OpenEncoder( vlc_object_t *p_this )
     encoder_t *p_enc = (encoder_t *)p_this;
     encoder_sys_t *p_sys;
 
-    if( p_enc->fmt_out.i_codec != VLC_FOURCC('f','l','a','c') &&
+    if( p_enc->fmt_out.i_codec != VLC_CODEC_FLAC &&
         !p_enc->b_force )
     {
         return VLC_EGENERIC;
@@ -1295,7 +1295,7 @@ static int OpenEncoder( vlc_object_t *p_this )
         return VLC_ENOMEM;
     p_enc->p_sys = p_sys;
     p_enc->pf_encode_audio = Encode;
-    p_enc->fmt_out.i_codec = VLC_FOURCC('f','l','a','c');
+    p_enc->fmt_out.i_codec = VLC_CODEC_FLAC;
 
     p_sys->i_headers = 0;
     p_sys->p_buffer = 0;
index f0ef618..ae08aef 100644 (file)
@@ -66,7 +66,7 @@ static int Open (vlc_object_t *p_this)
     decoder_t *p_dec = (decoder_t *)p_this;
     decoder_sys_t *p_sys;
 
-    if (p_dec->fmt_in.i_codec != VLC_FOURCC ('M', 'I', 'D', 'I'))
+    if (p_dec->fmt_in.i_codec != VLC_CODEC_MIDI)
         return VLC_EGENERIC;
 
     char *font_path = var_CreateGetNonEmptyString (p_this, "soundfont");
@@ -82,7 +82,7 @@ static int Open (vlc_object_t *p_this)
     p_dec->fmt_out.audio.i_original_channels =
     p_dec->fmt_out.audio.i_physical_channels =
         AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT;
-    p_dec->fmt_out.i_codec = VLC_FOURCC('f', 'l', '3', '2');
+    p_dec->fmt_out.i_codec = VLC_CODEC_FL32;
     p_dec->fmt_out.audio.i_bitspersample = 32;
 
     p_dec->pf_decode_audio = DecodeBlock;
index 396e80c..4a6ed8f 100644 (file)
@@ -151,8 +151,8 @@ static int OpenDecoder( vlc_object_t *p_this )
     }
 
     /* Set output properties */
-    //p_dec->fmt_out.i_codec = VLC_FOURCC('R','G','B','A');
-    p_dec->fmt_out.i_codec = VLC_FOURCC('R','V','2','4');
+    //p_dec->fmt_out.i_codec = VLC_CODEC_RGBA;
+    p_dec->fmt_out.i_codec = VLC_CODEC_RGB24;
     p_dec->fmt_out.video.i_width = p_dec->p_sys->i_width;
     p_dec->fmt_out.video.i_height = p_dec->p_sys->i_height;
     p_dec->fmt_out.video.i_aspect = VOUT_ASPECT_FACTOR * p_dec->p_sys->i_width / p_dec->p_sys->i_height;
index a6d8ef4..146c40f 100644 (file)
@@ -952,7 +952,7 @@ static void TigerUpdateRegions( spu_t *p_spu, subpicture_t *p_subpic, const vide
 
     /* create a full frame region - this will also tell Tiger the size of the frame */
     fmt = *p_fmt;
-    fmt.i_chroma = VLC_FOURCC('R','G','B','A');
+    fmt.i_chroma = VLC_CODEC_RGBA;
     fmt.i_width = fmt.i_visible_width;
     fmt.i_height = fmt.i_visible_height;
     fmt.i_bits_per_pixel = 0;
@@ -1348,7 +1348,7 @@ static subpicture_t *SetupSimpleKateSPU( decoder_t *p_dec, subpicture_t *p_spu,
 
         /* create a separate region for the bitmap */
         memset( &fmt, 0, sizeof(video_format_t) );
-        fmt.i_chroma = VLC_FOURCC('Y','U','V','P');
+        fmt.i_chroma = VLC_CODEC_YUVP;
         fmt.i_aspect = 0;
         fmt.i_width = fmt.i_visible_width = ev->bitmap->width;
         fmt.i_height = fmt.i_visible_height = ev->bitmap->height;
@@ -1371,7 +1371,7 @@ static subpicture_t *SetupSimpleKateSPU( decoder_t *p_dec, subpicture_t *p_spu,
     }
 
     /* text region */
-    fmt.i_chroma = VLC_FOURCC('T','E','X','T');
+    fmt.i_chroma = VLC_CODEC_TEXT;
     fmt.i_aspect = 0;
     fmt.i_width = fmt.i_height = 0;
     fmt.i_x_offset = fmt.i_y_offset = 0;
index 70d9c52..7ae8c53 100644 (file)
@@ -136,7 +136,7 @@ static int Create( vlc_object_t *p_this )
     decoder_sys_t *p_sys;
     ass_track_t *p_track;
 
-    if( p_dec->fmt_in.i_codec != VLC_FOURCC('s','s','a',' ') )
+    if( p_dec->fmt_in.i_codec != VLC_CODEC_SSA )
         return VLC_EGENERIC;
 
     p_dec->pf_decode_sub = DecodeBlock;
@@ -168,7 +168,7 @@ static int Create( vlc_object_t *p_this )
     vlc_mutex_unlock( &libass_lock );
 
     p_dec->fmt_out.i_cat = SPU_ES;
-    p_dec->fmt_out.i_codec = VLC_FOURCC('R','G','B','A');
+    p_dec->fmt_out.i_codec = VLC_CODEC_RGBA;
 
     return VLC_SUCCESS;
 }
@@ -332,7 +332,7 @@ static void UpdateRegions( spu_t *p_spu, subpicture_t *p_subpic,
 
     /* */
     fmt = *p_fmt;
-    fmt.i_chroma = VLC_FOURCC('R','G','B','A');
+    fmt.i_chroma = VLC_CODEC_RGBA;
     fmt.i_width = fmt.i_visible_width;
     fmt.i_height = fmt.i_visible_height;
     fmt.i_bits_per_pixel = 0;
index 5a2ef6f..7b6620d 100644 (file)
@@ -119,11 +119,11 @@ static int OpenDecoder( vlc_object_t *p_this )
     decoder_sys_t *p_sys;
     uint32_t i_accel = 0;
 
-    if( p_dec->fmt_in.i_codec != VLC_FOURCC('m','p','g','v') &&
+    if( p_dec->fmt_in.i_codec != VLC_CODEC_MPGV &&
         p_dec->fmt_in.i_codec != VLC_FOURCC('m','p','g','1') &&
         /* Pinnacle hardware-mpeg1 */
         p_dec->fmt_in.i_codec != VLC_FOURCC('P','I','M','1') &&
-        p_dec->fmt_in.i_codec != VLC_FOURCC('m','p','2','v') &&
+        p_dec->fmt_in.i_codec != VLC_CODEC_MP2V &&
         p_dec->fmt_in.i_codec != VLC_FOURCC('m','p','g','2') &&
         p_dec->fmt_in.i_codec != VLC_FOURCC('h','d','v','2') )
     {
@@ -665,7 +665,7 @@ static picture_t *GetNewPicture( decoder_t *p_dec, uint8_t **pp_buf )
     p_dec->fmt_out.i_codec =
         ( p_sys->p_info->sequence->chroma_height <
           p_sys->p_info->sequence->height ) ?
-        VLC_FOURCC('I','4','2','0') : VLC_FOURCC('I','4','2','2');
+        VLC_CODEC_I420 : VLC_CODEC_I422;
 
     /* Get a new picture */
     p_pic = decoder_NewPicture( p_dec );
index 52adfc9..5af17eb 100644 (file)
@@ -131,12 +131,12 @@ static int OpenCommon( vlc_object_t *p_this, bool b_packetizer )
     switch( p_dec->fmt_in.i_codec )
     {
     /* DVD LPCM */
-    case VLC_FOURCC('l','p','c','m'):
+    case VLC_CODEC_DVD_LPCM:
     case VLC_FOURCC('l','p','c','b'):
         b_dvd = true;
         break;
     /* BD LPCM */
-    case VLC_FOURCC('b','p','c','m'):
+    case VLC_CODEC_BD_LPCM:
         b_dvd = false;
         break;
     default:
@@ -158,7 +158,7 @@ static int OpenCommon( vlc_object_t *p_this, bool b_packetizer )
 
     if( b_packetizer )
     {
-        p_dec->fmt_out.i_codec = b_dvd ? VLC_FOURCC('l','p','c','m') : VLC_FOURCC('b','p','c','m');
+        p_dec->fmt_out.i_codec = b_dvd ? VLC_CODEC_DVD_LPCM : VLC_CODEC_BD_LPCM;
     }
     else
     {
@@ -166,11 +166,11 @@ static int OpenCommon( vlc_object_t *p_this, bool b_packetizer )
         {
         case 24:
         case 20:
-            p_dec->fmt_out.i_codec = VLC_FOURCC('s','2','4','b');
+            p_dec->fmt_out.i_codec = VLC_CODEC_S24B;
             p_dec->fmt_out.audio.i_bitspersample = 24;
             break;
         default:
-            p_dec->fmt_out.i_codec = VLC_FOURCC('s','1','6','b');
+            p_dec->fmt_out.i_codec = VLC_CODEC_S16B;
             p_dec->fmt_out.audio.i_bitspersample = 16;
             break;
         }
@@ -274,12 +274,12 @@ static void *DecodeFrame( decoder_t *p_dec, block_t **pp_block )
         /* */
         if( i_bits == 16 )
         {
-            p_dec->fmt_out.i_codec = VLC_FOURCC('s','1','6','b');
+            p_dec->fmt_out.i_codec = VLC_CODEC_S16B;
             p_dec->fmt_out.audio.i_bitspersample = 16;
         }
         else
         {
-            p_dec->fmt_out.i_codec = VLC_FOURCC('s','2','4','b');
+            p_dec->fmt_out.i_codec = VLC_CODEC_S24B;
             p_dec->fmt_out.audio.i_bitspersample = 24;
         }
 
index 88533cb..ea97951 100644 (file)
@@ -86,7 +86,7 @@ static int OpenDecoder( vlc_object_t *p_this )
     switch( p_dec->fmt_in.i_codec )
     {
         /* Planar YUV */
-        case VLC_FOURCC('h','2','6','1'):
+        case VLC_CODEC_H261:
         case VLC_FOURCC('H','2','6','1'):
             break;
 
@@ -105,7 +105,7 @@ static int OpenDecoder( vlc_object_t *p_this )
 
     /* Set output properties */
     p_dec->fmt_out.i_cat = VIDEO_ES;
-    p_dec->fmt_out.i_codec = VLC_FOURCC('I','4','2','0');
+    p_dec->fmt_out.i_codec = VLC_CODEC_I420;
 
     /* Set callbacks */
     p_dec->pf_decode_video = (picture_t *(*)(decoder_t *, block_t **))
@@ -192,7 +192,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
     {
         msg_Dbg( p_dec, "video size is perhaps %dx%d", i_width,
                   i_height);
-        vout_InitFormat( &p_dec->fmt_out.video, VLC_FOURCC('I','4','2','0'),
+        vout_InitFormat( &p_dec->fmt_out.video, VLC_CODEC_I420,
                          i_width, i_height,
                          VOUT_ASPECT_FACTOR * i_width / i_height );
         p_sys->b_inited = true;
index 306bf07..f025be5 100644 (file)
@@ -134,7 +134,7 @@ static int Open( vlc_object_t *p_this )
     decoder_t *p_dec = (decoder_t*)p_this;
     decoder_sys_t *p_sys;
 
-    if( p_dec->fmt_in.i_codec != VLC_FOURCC('m','p','g','a') )
+    if( p_dec->fmt_in.i_codec != VLC_CODEC_MPGA )
     {
         return VLC_EGENERIC;
     }
@@ -153,7 +153,7 @@ static int Open( vlc_object_t *p_this )
 
     /* Set output properties */
     p_dec->fmt_out.i_cat = AUDIO_ES;
-    p_dec->fmt_out.i_codec = VLC_FOURCC('m','p','g','a');
+    p_dec->fmt_out.i_codec = VLC_CODEC_MPGA;
     p_dec->fmt_out.audio.i_rate = 0; /* So end_date gets initialized */
 
     /* Set callback */
index c604f01..4b48843 100644 (file)
@@ -70,7 +70,7 @@ static int OpenDecoder( vlc_object_t *p_this )
     decoder_t *p_dec = (decoder_t*)p_this;
     decoder_sys_t *p_sys;
 
-    if( p_dec->fmt_in.i_codec != VLC_FOURCC('p','n','g',' ') &&
+    if( p_dec->fmt_in.i_codec != VLC_CODEC_PNG &&
         p_dec->fmt_in.i_codec != VLC_FOURCC('M','P','N','G') )
     {
         return VLC_EGENERIC;
@@ -83,7 +83,7 @@ static int OpenDecoder( vlc_object_t *p_this )
 
     /* Set output properties */
     p_dec->fmt_out.i_cat = VIDEO_ES;
-    p_dec->fmt_out.i_codec = VLC_FOURCC('R','G','B','A');
+    p_dec->fmt_out.i_codec = VLC_CODEC_RGBA;
 
     /* Set callbacks */
     p_dec->pf_decode_video = DecodeBlock;
@@ -184,7 +184,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
     if( p_sys->b_error ) goto error;
 
     /* Set output properties */
-    p_dec->fmt_out.i_codec = VLC_FOURCC('R','G','B','A');
+    p_dec->fmt_out.i_codec = VLC_CODEC_RGBA;
     p_dec->fmt_out.video.i_width = i_width;
     p_dec->fmt_out.video.i_height = i_height;
     p_dec->fmt_out.video.i_aspect = VOUT_ASPECT_FACTOR * i_width / i_height;
@@ -208,7 +208,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
     }
     else if( !(i_color_type & PNG_COLOR_MASK_ALPHA) )
     {
-        p_dec->fmt_out.i_codec = VLC_FOURCC('R','V','2','4');
+        p_dec->fmt_out.i_codec = VLC_CODEC_RGB24;
     }
 
     /* Get a new picture */
index e5b5778..f61c4ff 100644 (file)
@@ -245,7 +245,7 @@ static int Open( vlc_object_t *p_this )
 
     switch( p_dec->fmt_in.i_codec )
     {
-        case VLC_FOURCC('h','2','6','4'): /* H.264 */
+        case VLC_CODEC_H264: /* H.264 */
         case VLC_FOURCC('c','v','i','d'): /* Cinepak */
         case VLC_FOURCC('I','V','4','1'): /* Indeo Video IV */
         case VLC_FOURCC('i','v','4','1'): /* dto. */
@@ -258,13 +258,13 @@ static int Open( vlc_object_t *p_this )
         case VLC_FOURCC('d','v','h','6'): /* DVC PRO HD 1080i 60 */
         case VLC_FOURCC('d','v','h','5'): /* DVC PRO HD 1080i 50 */
 
-        case VLC_FOURCC('S','V','Q','3'): /* Sorenson v3 */
-    /*    case VLC_FOURCC('S','V','Q','1'):  Sorenson v1
+        case VLC_CODEC_SVQ3: /* Sorenson v3 */
+    /*    case VLC_CODEC_SVQ1:  Sorenson v1
         case VLC_FOURCC('Z','y','G','o'):
         case VLC_FOURCC('V','P','3','1'):
         case VLC_FOURCC('3','I','V','1'): */
-        case VLC_FOURCC('r','l','e',' '): /* QuickTime animation (RLE) */
-        case VLC_FOURCC('r','p','z','a'): /* QuickTime Apple Video */
+        case VLC_CODEC_QTRLE: /* QuickTime animation (RLE) */
+        case VLC_CODEC_RPZA: /* QuickTime Apple Video */
         case VLC_FOURCC('a','z','p','r'): /* QuickTime animation (RLE) */
 #ifdef LOADER
         p_dec->p_sys = NULL;
@@ -283,23 +283,23 @@ static int Open( vlc_object_t *p_this )
             if ((err != noErr) || (qtVersion < 0x07500000)) 
                 return VLC_EGENERIC;
 #endif
-        case VLC_FOURCC('s','a','m','r'): /* 3GPP AMR audio */
+        case VLC_CODEC_AMR_NB: /* 3GPP AMR audio */
         case VLC_FOURCC('s','a','m','b'): /* 3GPP AMR-WB audio */
-        case VLC_FOURCC('m','p','4','a'): /* MPEG-4 audio */
+        case VLC_CODEC_MP4A: /* MPEG-4 audio */
         case VLC_FOURCC('Q','D','M','C'): /* QDesign */
-        case VLC_FOURCC('Q','D','M','2'): /* QDesign* 2 */
-        case VLC_FOURCC('Q','c','l','p'): /* Qualcomm Purevoice Codec */
+        case VLC_CODEC_QDM2: /* QDesign* 2 */
+        case VLC_CODEC_QCELP: /* Qualcomm Purevoice Codec */
         case VLC_FOURCC('Q','C','L','P'): /* Qualcomm Purevoice Codec */
-        case VLC_FOURCC('M','A','C','3'): /* MACE3 audio decoder */
-        case VLC_FOURCC('M','A','C','6'): /* MACE6 audio decoder */
+        case VLC_CODEC_MACE3: /* MACE3 audio decoder */
+        case VLC_CODEC_MACE6: /* MACE6 audio decoder */
         case VLC_FOURCC('d','v','c','a'): /* DV Audio */
         case VLC_FOURCC('s','o','w','t'): /* 16-bit Little Endian */
         case VLC_FOURCC('t','w','o','s'): /* 16-bit Big Endian */
-        case VLC_FOURCC('a','l','a','w'): /* ALaw 2:1 */
+        case VLC_CODEC_ALAW: /* ALaw 2:1 */
         case VLC_FOURCC('u','l','a','w'): /* mu-Law 2:1 */
         case VLC_FOURCC('r','a','w',' '): /* 8-bit offset binaries */
-        case VLC_FOURCC('f','l','3','2'): /* 32-bit Floating Point */
-        case VLC_FOURCC('f','l','6','4'): /* 64-bit Floating Point */
+        case VLC_CODEC_FL32: /* 32-bit Floating Point */
+        case VLC_CODEC_FL64: /* 64-bit Floating Point */
         case VLC_FOURCC('i','n','2','4'): /* 24-bit Interger */
         case VLC_FOURCC('i','n','3','2'): /* 32-bit Integer */
         case 0x0011:                            /* DVI IMA */
@@ -836,7 +836,7 @@ static int OpenVideo( decoder_t *p_dec )
     msg_Dbg( p_dec, "quicktime_video: ImageCodecPreDecompress cres=0x%X",
              (int)cres );
 
-    es_format_Init( &p_dec->fmt_out, VIDEO_ES, VLC_FOURCC( 'Y', 'U', 'Y', '2' ));
+    es_format_Init( &p_dec->fmt_out, VIDEO_ES, VLC_CODEC_YUYV);
     p_dec->fmt_out.video.i_width = p_dec->fmt_in.video.i_width;
     p_dec->fmt_out.video.i_height= p_dec->fmt_in.video.i_height;
     p_dec->fmt_out.video.i_aspect = VOUT_ASPECT_FACTOR * p_dec->fmt_in.video.i_width / p_dec->fmt_in.video.i_height;
index e79e2ed..a43b73e 100644 (file)
@@ -92,36 +92,36 @@ static int OpenDecoder( vlc_object_t *p_this )
     switch( p_dec->fmt_in.i_codec )
     {
         /* Planar YUV */
-        case VLC_FOURCC('I','4','4','4'):
-        case VLC_FOURCC('I','4','2','2'):
-        case VLC_FOURCC('I','4','2','0'):
-        case VLC_FOURCC('Y','V','1','2'):
+        case VLC_CODEC_I444:
+        case VLC_CODEC_I422:
+        case VLC_CODEC_I420:
+        case VLC_CODEC_YV12:
         case VLC_FOURCC('I','Y','U','V'):
-        case VLC_FOURCC('I','4','1','1'):
-        case VLC_FOURCC('I','4','1','0'):
+        case VLC_CODEC_I411:
+        case VLC_CODEC_I410:
         case VLC_FOURCC('Y','V','U','9'):
         case VLC_FOURCC('Y','4','2','B'):
         case VLC_FOURCC('Y','4','1','B'):
 
         /* Packed YUV */
-        case VLC_FOURCC('Y','U','Y','2'):
+        case VLC_CODEC_YUYV:
         case VLC_FOURCC('Y','8','0','0'):
-        case VLC_FOURCC('U','Y','V','Y'):
+        case VLC_CODEC_UYVY:
         case VLC_FOURCC('H','D','Y','C'):
 
         /* RGB */
-        case VLC_FOURCC('R','V','3','2'):
-        case VLC_FOURCC('R','V','2','4'):
-        case VLC_FOURCC('R','V','1','6'):
-        case VLC_FOURCC('R','V','1','5'):
+        case VLC_CODEC_RGB32:
+        case VLC_CODEC_RGB24:
+        case VLC_CODEC_RGB16:
+        case VLC_CODEC_RGB15:
             break;
         case VLC_FOURCC('2','V','u','y'):
         case VLC_FOURCC('2','v','u','y'):
         case VLC_FOURCC('A','V','U','I'):
-            p_dec->fmt_in.i_codec = VLC_FOURCC('U','Y','V','Y');
+            p_dec->fmt_in.i_codec = VLC_CODEC_UYVY;
             break;
         case VLC_FOURCC('y','v','1','2'):
-            p_dec->fmt_in.i_codec = VLC_FOURCC('Y','V','1','2');
+            p_dec->fmt_in.i_codec = VLC_CODEC_YV12;
             break;
 
         default:
index aa1d133..af169aa 100644 (file)
@@ -182,8 +182,8 @@ static int Open( vlc_object_t *p_this )
 
     switch( p_dec->fmt_in.i_codec )
     {
-    case VLC_FOURCC('c','o','o','k'):
-    case VLC_FOURCC('a','t','r','c'):
+    case VLC_CODEC_COOK:
+    case VLC_CODEC_ATRAC3:
     case VLC_FOURCC('s','i','p','r'):
         break;
 
index 23ea612..c890681 100644 (file)
@@ -327,7 +327,7 @@ static int InitVideo(decoder_t *p_dec)
     }
 
     /* setup rv30 codec (codec sub-type and image dimensions): */
-    /*if ( p_dec->fmt_in.i_codec == VLC_FOURCC('R','V','3','0') )*/
+    /*if ( p_dec->fmt_in.i_codec == VLC_CODEC_RV30 )*/
     if (p_vide[1]>=0x20200002)
     {
         int i, cmsg_cnt;
@@ -347,10 +347,10 @@ static int InitVideo(decoder_t *p_dec)
             (*rvyuv_custom_message)(&cmsg_data,p_sys->handle);
     }
     /*
-    es_format_Init( &p_dec->fmt_out, VIDEO_ES, VLC_FOURCC( 'Y','V','1','2' ));
-    es_format_Init( &p_dec->fmt_out, VIDEO_ES, VLC_FOURCC( 'Y','U','Y','2' ));
+    es_format_Init( &p_dec->fmt_out, VIDEO_ES, VLC_CODEC_YV12);
+    es_format_Init( &p_dec->fmt_out, VIDEO_ES, VLC_CODEC_YUYV);
      */
-    es_format_Init( &p_dec->fmt_out, VIDEO_ES, VLC_FOURCC( 'I', '4', '2', '0'));
+    es_format_Init( &p_dec->fmt_out, VIDEO_ES, VLC_CODEC_I420);
      
     p_dec->fmt_out.video.i_width = p_dec->fmt_in.video.i_width;
     p_dec->fmt_out.video.i_height= p_dec->fmt_in.video.i_height;
@@ -376,10 +376,10 @@ static int Open( vlc_object_t *p_this )
 
     switch ( p_dec->fmt_in.i_codec )
     {
-    case VLC_FOURCC('R','V','1','0')
-    case VLC_FOURCC('R','V','2','0')
-    case VLC_FOURCC('R','V','3','0'):
-    case VLC_FOURCC('R','V','4','0')
+    case VLC_CODEC_RV10
+    case VLC_CODEC_RV20
+    case VLC_CODEC_RV30:
+    case VLC_CODEC_RV40
         p_dec->p_sys = NULL;
         p_dec->pf_decode_video = DecodeVideo;
         return InitVideo(p_dec);
index 8b7abb5..bc08984 100644 (file)
@@ -88,7 +88,7 @@ static int OpenDecoder( vlc_object_t *p_this )
     decoder_sys_t *p_sys;
     SchroDecoder *p_schro;
 
-    if( p_dec->fmt_in.i_codec != VLC_FOURCC('d','r','a','c') )
+    if( p_dec->fmt_in.i_codec != VLC_CODEC_DIRAC )
     {
         return VLC_EGENERIC;
     }
@@ -117,7 +117,7 @@ static int OpenDecoder( vlc_object_t *p_this )
 
     /* Set output properties */
     p_dec->fmt_out.i_cat = VIDEO_ES;
-    p_dec->fmt_out.i_codec = VLC_FOURCC('I','4','2','0');
+    p_dec->fmt_out.i_codec = VLC_CODEC_I420;
 
     /* Set callbacks */
     p_dec->pf_decode_video = DecodeBlock;
@@ -142,9 +142,9 @@ static void SetVideoFormat( decoder_t *p_dec )
 
     switch( p_sys->p_format->chroma_format )
     {
-    case SCHRO_CHROMA_420: p_dec->fmt_out.i_codec = VLC_FOURCC('I','4','2','0'); break;
-    case SCHRO_CHROMA_422: p_dec->fmt_out.i_codec = VLC_FOURCC('I','4','2','2'); break;
-    case SCHRO_CHROMA_444: p_dec->fmt_out.i_codec = VLC_FOURCC('I','4','4','4'); break;
+    case SCHRO_CHROMA_420: p_dec->fmt_out.i_codec = VLC_CODEC_I420; break;
+    case SCHRO_CHROMA_422: p_dec->fmt_out.i_codec = VLC_CODEC_I422; break;
+    case SCHRO_CHROMA_444: p_dec->fmt_out.i_codec = VLC_CODEC_I444; break;
     default:
         p_dec->fmt_out.i_codec = 0;
         break;
index d4eb387..1258238 100644 (file)
@@ -70,17 +70,17 @@ static const struct supported_fmt_t
     const char *psz_sdl_type;
 } p_supported_fmt[] =
 {
-    { VLC_FOURCC('t','g','a',' '), "TGA" },
-    { VLC_FOURCC('b','m','p',' '), "BMP" },
-    { VLC_FOURCC('p','n','m',' '), "PNM" },
+    { VLC_CODEC_TARGA, "TGA" },
+    { VLC_CODEC_BMP, "BMP" },
+    { VLC_CODEC_PNM, "PNM" },
     { VLC_FOURCC('x','p','m',' '), "XPM" },
     { VLC_FOURCC('x','c','f',' '), "XCF" },
-    { VLC_FOURCC('p','c','x',' '), "PCX" },
-    { VLC_FOURCC('g','i','f',' '), "GIF" },
-    { VLC_FOURCC('j','p','e','g'), "JPG" },
-    { VLC_FOURCC('t','i','f','f'), "TIF" },
+    { VLC_CODEC_PCX, "PCX" },
+    { VLC_CODEC_GIF, "GIF" },
+    { VLC_CODEC_JPEG, "JPG" },
+    { VLC_CODEC_TIFF, "TIF" },
     { VLC_FOURCC('l','b','m',' '), "LBM" },
-    { VLC_FOURCC('p','n','g',' '), "PNG" }
+    { VLC_CODEC_PNG, "PNG" }
 };
 
 /*****************************************************************************
@@ -113,7 +113,7 @@ static int OpenDecoder( vlc_object_t *p_this )
 
     /* Set output properties - this is a decoy and isn't used anywhere */
     p_dec->fmt_out.i_cat = VIDEO_ES;
-    p_dec->fmt_out.i_codec = VLC_FOURCC('R','V','3','2');
+    p_dec->fmt_out.i_codec = VLC_CODEC_RGB32;
 
     /* Set callbacks */
     p_dec->pf_decode_video = DecodeBlock;
@@ -157,14 +157,14 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
     switch ( p_surface->format->BitsPerPixel )
     {
     case 16:
-        p_dec->fmt_out.i_codec = VLC_FOURCC('R','V','1','6');
+        p_dec->fmt_out.i_codec = VLC_CODEC_RGB16;
         break;
     case 8:
     case 24:
-        p_dec->fmt_out.i_codec = VLC_FOURCC('R','V','2','4');
+        p_dec->fmt_out.i_codec = VLC_CODEC_RGB24;
         break;
     case 32:
-        p_dec->fmt_out.i_codec = VLC_FOURCC('R','V','3','2');
+        p_dec->fmt_out.i_codec = VLC_CODEC_RGB32;
         break;
     default:
         msg_Warn( p_dec, "unknown bits/pixel format (%d)",
index af1ea6b..23b102b 100644 (file)
@@ -205,7 +205,7 @@ static int OpenDecoder( vlc_object_t *p_this )
     decoder_t *p_dec = (decoder_t*)p_this;
     decoder_sys_t *p_sys = p_dec->p_sys;
 
-    if( p_dec->fmt_in.i_codec != VLC_FOURCC('s','p','x',' ') 
+    if( p_dec->fmt_in.i_codec != VLC_CODEC_SPEEX 
         && p_dec->fmt_in.i_codec != VLC_FOURCC('s', 'p', 'x', 'r') )
     {
         return VLC_EGENERIC;
@@ -263,7 +263,7 @@ static int OpenPacketizer( vlc_object_t *p_this )
     if( i_ret == VLC_SUCCESS )
     {
         p_dec->p_sys->b_packetizer = true;
-        p_dec->fmt_out.i_codec = VLC_FOURCC('s','p','x',' ');
+        p_dec->fmt_out.i_codec = VLC_CODEC_SPEEX;
     }
 
     return i_ret;
@@ -915,7 +915,7 @@ static int OpenEncoder( vlc_object_t *p_this )
     int pi_header[2];
     uint8_t *p_extra;
 
-    if( p_enc->fmt_out.i_codec != VLC_FOURCC('s','p','x',' ') &&
+    if( p_enc->fmt_out.i_codec != VLC_CODEC_SPEEX &&
         !p_enc->b_force )
     {
         return VLC_EGENERIC;
@@ -944,7 +944,7 @@ static int OpenEncoder( vlc_object_t *p_this )
     p_enc->p_sys = p_sys;
     p_enc->pf_encode_audio = Encode;
     p_enc->fmt_in.i_codec = AOUT_FMT_S16_NE;
-    p_enc->fmt_out.i_codec = VLC_FOURCC('s','p','x',' ');
+    p_enc->fmt_out.i_codec = VLC_CODEC_SPEEX;
 
     speex_init_header( &p_sys->header, p_enc->fmt_in.audio.i_rate,
                        1, p_speex_mode );
index 84db8df..0a572d9 100644 (file)
@@ -686,7 +686,7 @@ static void Render( decoder_t *p_dec, subpicture_t *p_spu,
 
     /* Create a new subpicture region */
     memset( &fmt, 0, sizeof(video_format_t) );
-    fmt.i_chroma = VLC_FOURCC('Y','U','V','P');
+    fmt.i_chroma = VLC_CODEC_YUVP;
     fmt.i_aspect = 0; /* 0 means use aspect ratio of background video */
     fmt.i_width = fmt.i_visible_width = p_spu_properties->i_width;
     fmt.i_height = fmt.i_visible_height = p_spu_properties->i_height -
index f527a9c..eb2d8e1 100644 (file)
@@ -73,7 +73,7 @@ static int DecoderOpen( vlc_object_t *p_this )
     decoder_t     *p_dec = (decoder_t*)p_this;
     decoder_sys_t *p_sys;
 
-    if( p_dec->fmt_in.i_codec != VLC_FOURCC( 's','p','u',' ' ) &&
+    if( p_dec->fmt_in.i_codec != VLC_CODEC_SPU &&
         p_dec->fmt_in.i_codec != VLC_FOURCC( 's','p','u','b' ) )
     {
         return VLC_EGENERIC;
@@ -86,7 +86,7 @@ static int DecoderOpen( vlc_object_t *p_this )
     p_sys->i_spu      = 0;
     p_sys->p_block    = NULL;
 
-    es_format_Init( &p_dec->fmt_out, SPU_ES, VLC_FOURCC( 's','p','u',' ' ) );
+    es_format_Init( &p_dec->fmt_out, SPU_ES, VLC_CODEC_SPU );
 
     p_dec->pf_decode_sub = Decode;
     p_dec->pf_packetize  = NULL;
@@ -111,7 +111,7 @@ static int PacketizerOpen( vlc_object_t *p_this )
     p_dec->pf_packetize  = Packetize;
     p_dec->p_sys->b_packetizer = true;
     es_format_Copy( &p_dec->fmt_out, &p_dec->fmt_in );
-    p_dec->fmt_out.i_codec = VLC_FOURCC( 's','p','u',' ' );
+    p_dec->fmt_out.i_codec = VLC_CODEC_SPU;
 
     return VLC_SUCCESS;
 }
index 5bd43a5..5dbc847 100644 (file)
@@ -232,8 +232,8 @@ static int OpenDecoder( vlc_object_t *p_this )
 
     switch( p_dec->fmt_in.i_codec )
     {
-        case VLC_FOURCC('s','u','b','t'):
-        case VLC_FOURCC('s','s','a',' '):
+        case VLC_CODEC_SUBT:
+        case VLC_CODEC_SSA:
         case VLC_FOURCC('t','1','4','0'):
             break;
         default:
@@ -315,7 +315,7 @@ static int OpenDecoder( vlc_object_t *p_this )
     var_Get( p_dec, "subsdec-align", &val );
     p_sys->i_align = val.i_int;
 
-    if( p_dec->fmt_in.i_codec == VLC_FOURCC('s','s','a',' ')
+    if( p_dec->fmt_in.i_codec == VLC_CODEC_SSA
      && var_CreateGetBool( p_dec, "subsdec-formatted" ) )
     {
         if( p_dec->fmt_in.i_extra > 0 )
@@ -492,7 +492,7 @@ static subpicture_t *ParseText( decoder_t *p_dec, block_t *p_block )
 
     /* Create a new subpicture region */
     memset( &fmt, 0, sizeof(video_format_t) );
-    fmt.i_chroma = VLC_FOURCC('T','E','X','T');
+    fmt.i_chroma = VLC_CODEC_TEXT;
     fmt.i_aspect = 0;
     fmt.i_width = fmt.i_height = 0;
     fmt.i_x_offset = fmt.i_y_offset = 0;
@@ -506,7 +506,7 @@ static subpicture_t *ParseText( decoder_t *p_dec, block_t *p_block )
     }
 
     /* Decode and format the subpicture unit */
-    if( p_dec->fmt_in.i_codec != VLC_FOURCC('s','s','a',' ') )
+    if( p_dec->fmt_in.i_codec != VLC_CODEC_SSA )
     {
         /* Normal text subs, easy markup */
         p_spu->p_region->i_align = SUBPICTURE_ALIGN_BOTTOM | p_sys->i_align;
index 717f8da..7333dac 100644 (file)
@@ -383,7 +383,7 @@ static subpicture_region_t *CreateTextRegion( decoder_t *p_dec,
 
     /* Create a new subpicture region */
     memset( &fmt, 0, sizeof(video_format_t) );
-    fmt.i_chroma = VLC_FOURCC('T','E','X','T');
+    fmt.i_chroma = VLC_CODEC_TEXT;
     fmt.i_aspect = 0;
     fmt.i_width = fmt.i_height = 0;
     fmt.i_x_offset = fmt.i_y_offset = 0;
@@ -488,7 +488,7 @@ static int ParseImageAttachments( decoder_t *p_dec )
                     memset( &fmt_out, 0, sizeof( video_format_t));
 
                     fmt_in.i_chroma  = type;
-                    fmt_out.i_chroma = VLC_FOURCC('Y','U','V','A');
+                    fmt_out.i_chroma = VLC_CODEC_YUVA;
 
                     /* Find a suitable decoder module */
                     if( module_exists( "sdl_image" ) )
@@ -1167,7 +1167,7 @@ static subpicture_region_t *LoadEmbeddedImage( decoder_t *p_dec,
     /* Display the feed's image */
     memset( &fmt_out, 0, sizeof( video_format_t));
 
-    fmt_out.i_chroma = VLC_FOURCC('Y','U','V','A');
+    fmt_out.i_chroma = VLC_CODEC_YUVA;
     fmt_out.i_aspect = VOUT_ASPECT_FACTOR;
     fmt_out.i_sar_num = fmt_out.i_sar_den = 1;
     fmt_out.i_width =
@@ -1181,7 +1181,7 @@ static subpicture_region_t *LoadEmbeddedImage( decoder_t *p_dec,
         msg_Err( p_dec, "cannot allocate SPU region" );
         return NULL;
     }
-    assert( p_pic->format.i_chroma == VLC_FOURCC('Y','U','V','A') );
+    assert( p_pic->format.i_chroma == VLC_CODEC_YUVA );
     /* FIXME the copy is probably not needed anymore */
     picture_CopyPixels( p_region->p_picture, p_pic );
 
@@ -1201,7 +1201,7 @@ static subpicture_region_t *LoadEmbeddedImage( decoder_t *p_dec,
         int i_u =   ( ( -38 * i_r -  74 * i_g + 112 * i_b + 128 ) >> 8 ) + 128 ;
         int i_v =   ( ( 112 * i_r -  94 * i_g -  18 * i_b + 128 ) >> 8 ) + 128 ;
 
-        assert( p_region->fmt.i_chroma == VLC_FOURCC('Y','U','V','A') );
+        assert( p_region->fmt.i_chroma == VLC_CODEC_YUVA );
         for( unsigned int y = 0; y < p_region->fmt.i_height; y++ )
         {
             for( unsigned int x = 0; x < p_region->fmt.i_width; x++ )
index 5e0c25a..3560c51 100644 (file)
@@ -49,7 +49,7 @@ static int Open( vlc_object_t *p_this )
 
     switch( p_enc->fmt_out.i_codec )
     {
-        case VLC_FOURCC('s','u','b','t'):
+        case VLC_CODEC_SUBT:
             if( ( p_enc->fmt_out.subs.psz_encoding != NULL )
              && strcasecmp( p_enc->fmt_out.subs.psz_encoding, "utf8" )
              && strcasecmp( p_enc->fmt_out.subs.psz_encoding, "UTF-8" ) )
@@ -92,7 +92,7 @@ static block_t *Encode( encoder_t *p_enc, subpicture_t *p_spu )
 
     p_region = p_spu->p_region;
     if( ( p_region == NULL )
-     || ( p_region->fmt.i_chroma != VLC_FOURCC('T','E','X','T') )
+     || ( p_region->fmt.i_chroma != VLC_CODEC_TEXT )
      || ( p_region->psz_text == NULL ) )
         return NULL;
 
index c6d9ee9..0b20b73 100644 (file)
@@ -480,7 +480,7 @@ static subpicture_t *DecodePacket( decoder_t *p_dec, block_t *p_data )
 
     /* Create new subtitle region */
     memset( &fmt, 0, sizeof(video_format_t) );
-    fmt.i_chroma = VLC_FOURCC('Y','U','V','P');
+    fmt.i_chroma = VLC_CODEC_YUVP;
 
     /**
        The video on which the subtitle sits, is scaled, probably
index 8c00db5..20e5d94 100644 (file)
@@ -93,7 +93,7 @@ static int OpenDecoder( vlc_object_t *p_this )
     decoder_t *p_dec = (decoder_t*)p_this;
     decoder_sys_t *p_sys;
 
-    if( p_dec->fmt_in.i_codec != VLC_FOURCC('t','a','r','k') )
+    if( p_dec->fmt_in.i_codec != VLC_CODEC_TARKIN )
     {
         return VLC_EGENERIC;
     }
@@ -240,19 +240,19 @@ static picture_t *DecodePacket( decoder_t *p_dec, block_t **pp_block,
         switch( p_sys->tarkin_stream->layer->desc.format )
         {
         case TARKIN_RGB24:
-            i_chroma = VLC_FOURCC('R','V','2','4');
+            i_chroma = VLC_CODEC_RGB24;
             i_stride = i_width * 3;
             break;
         case TARKIN_RGB32:
-            i_chroma = VLC_FOURCC('R','V','3','2');
+            i_chroma = VLC_CODEC_RGB32;
             i_stride = i_width * 4;
             break;
         case TARKIN_RGBA:
-            i_chroma = VLC_FOURCC('R','G','B','A');
+            i_chroma = VLC_CODEC_RGBA;
             i_stride = i_width * 4;
             break;
         default:
-            i_chroma = VLC_FOURCC('I','4','2','0');
+            i_chroma = VLC_CODEC_I420;
             i_stride = i_width;
             break;
         }
index 07fd4cf..9f2c263 100644 (file)
@@ -175,7 +175,7 @@ static int Open( vlc_object_t *p_this )
     vlc_value_t    val;
     int            i;
 
-    if( p_dec->fmt_in.i_codec != VLC_FOURCC('t','e','l','x'))
+    if( p_dec->fmt_in.i_codec != VLC_CODEC_TELETEXT)
     {
         return VLC_EGENERIC;
     }
@@ -701,7 +701,7 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block )
  
     /* Create a new subpicture region */
     memset( &fmt, 0, sizeof(video_format_t) );
-    fmt.i_chroma = VLC_FOURCC('T','E','X','T');
+    fmt.i_chroma = VLC_CODEC_TEXT;
     fmt.i_aspect = 0;
     fmt.i_width = fmt.i_height = 0;
     fmt.i_x_offset = fmt.i_y_offset = 0;
index 17bf9a7..dda5000 100644 (file)
@@ -135,7 +135,7 @@ static int OpenDecoder( vlc_object_t *p_this )
     decoder_t *p_dec = (decoder_t*)p_this;
     decoder_sys_t *p_sys;
 
-    if( p_dec->fmt_in.i_codec != VLC_FOURCC('t','h','e','o') )
+    if( p_dec->fmt_in.i_codec != VLC_CODEC_THEORA )
     {
         return VLC_EGENERIC;
     }
@@ -150,7 +150,7 @@ static int OpenDecoder( vlc_object_t *p_this )
 
     /* Set output properties */
     p_dec->fmt_out.i_cat = VIDEO_ES;
-    p_dec->fmt_out.i_codec = VLC_FOURCC('I','4','2','0');
+    p_dec->fmt_out.i_codec = VLC_CODEC_I420;
 
     /* Set callbacks */
     p_dec->pf_decode_video = (picture_t *(*)(decoder_t *, block_t **))
@@ -176,7 +176,7 @@ static int OpenPacketizer( vlc_object_t *p_this )
     if( i_ret == VLC_SUCCESS )
     {
         p_dec->p_sys->b_packetizer = true;
-        p_dec->fmt_out.i_codec = VLC_FOURCC( 't', 'h', 'e', 'o' );
+        p_dec->fmt_out.i_codec = VLC_CODEC_THEORA;
     }
 
     return i_ret;
@@ -287,13 +287,13 @@ static int ProcessHeaders( decoder_t *p_dec )
     switch( p_sys->ti.pixelformat )
     {
       case OC_PF_420:
-        p_dec->fmt_out.i_codec = VLC_FOURCC( 'I','4','2','0' );
+        p_dec->fmt_out.i_codec = VLC_CODEC_I420;
         break;
       case OC_PF_422:
-        p_dec->fmt_out.i_codec = VLC_FOURCC( 'I','4','2','2' );
+        p_dec->fmt_out.i_codec = VLC_CODEC_I422;
         break;
       case OC_PF_444:
-        p_dec->fmt_out.i_codec = VLC_FOURCC( 'I','4','4','4' );
+        p_dec->fmt_out.i_codec = VLC_CODEC_I444;
         break;
       case OC_PF_RSVD:
       default:
@@ -609,7 +609,7 @@ static int OpenEncoder( vlc_object_t *p_this )
     vlc_value_t val;
     int i_quality, i;
 
-    if( p_enc->fmt_out.i_codec != VLC_FOURCC('t','h','e','o') &&
+    if( p_enc->fmt_out.i_codec != VLC_CODEC_THEORA &&
         !p_enc->b_force )
     {
         return VLC_EGENERIC;
@@ -621,8 +621,8 @@ static int OpenEncoder( vlc_object_t *p_this )
     p_enc->p_sys = p_sys;
 
     p_enc->pf_encode_video = Encode;
-    p_enc->fmt_in.i_codec = VLC_FOURCC('I','4','2','0');
-    p_enc->fmt_out.i_codec = VLC_FOURCC('t','h','e','o');
+    p_enc->fmt_in.i_codec = VLC_CODEC_I420;
+    p_enc->fmt_out.i_codec = VLC_CODEC_THEORA;
 
     config_ChainParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg );
 
index 787cbf8..6f2caf4 100644 (file)
@@ -132,7 +132,7 @@ static int OpenEncoder( vlc_object_t *p_this )
     vlc_value_t val;
     int i_frequency;
 
-    if( p_enc->fmt_out.i_codec != VLC_FOURCC('m','p','g','a') &&
+    if( p_enc->fmt_out.i_codec != VLC_CODEC_MPGA &&
         p_enc->fmt_out.i_codec != VLC_FOURCC('m','p','2','a') &&
         p_enc->fmt_out.i_codec != VLC_FOURCC('m','p','2',' ') &&
         !p_enc->b_force )
@@ -167,7 +167,7 @@ static int OpenEncoder( vlc_object_t *p_this )
     p_enc->fmt_in.i_codec = AOUT_FMT_S16_NE;
 
     p_enc->fmt_out.i_cat = AUDIO_ES;
-    p_enc->fmt_out.i_codec = VLC_FOURCC('m','p','g','a');
+    p_enc->fmt_out.i_codec = VLC_CODEC_MPGA;
 
     config_ChainParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg );
 
index 5d25be9..62cb4d2 100644 (file)
@@ -229,7 +229,7 @@ static int OpenDecoder( vlc_object_t *p_this )
     decoder_t *p_dec = (decoder_t*)p_this;
     decoder_sys_t *p_sys;
 
-    if( p_dec->fmt_in.i_codec != VLC_FOURCC('v','o','r','b') )
+    if( p_dec->fmt_in.i_codec != VLC_CODEC_VORBIS )
     {
         return VLC_EGENERIC;
     }
@@ -251,9 +251,9 @@ static int OpenDecoder( vlc_object_t *p_this )
     /* Set output properties */
     p_dec->fmt_out.i_cat = AUDIO_ES;
 #ifdef MODULE_NAME_IS_tremor
-    p_dec->fmt_out.i_codec = VLC_FOURCC('f','i','3','2');
+    p_dec->fmt_out.i_codec = VLC_CODEC_FI32;
 #else
-    p_dec->fmt_out.i_codec = VLC_FOURCC('f','l','3','2');
+    p_dec->fmt_out.i_codec = VLC_CODEC_FL32;
 #endif
 
     /* Set callbacks */
@@ -274,7 +274,7 @@ static int OpenPacketizer( vlc_object_t *p_this )
     if( i_ret == VLC_SUCCESS )
     {
         p_dec->p_sys->b_packetizer = true;
-        p_dec->fmt_out.i_codec = VLC_FOURCC('v','o','r','b');
+        p_dec->fmt_out.i_codec = VLC_CODEC_VORBIS;
     }
 
     return i_ret;
@@ -794,7 +794,7 @@ static int OpenEncoder( vlc_object_t *p_this )
     vlc_value_t val;
     uint8_t *p_extra;
 
-    if( p_enc->fmt_out.i_codec != VLC_FOURCC('v','o','r','b') &&
+    if( p_enc->fmt_out.i_codec != VLC_CODEC_VORBIS &&
         !p_enc->b_force )
     {
         return VLC_EGENERIC;
@@ -806,8 +806,8 @@ static int OpenEncoder( vlc_object_t *p_this )
     p_enc->p_sys = p_sys;
 
     p_enc->pf_encode_audio = Encode;
-    p_enc->fmt_in.i_codec = VLC_FOURCC('f','l','3','2');
-    p_enc->fmt_out.i_codec = VLC_FOURCC('v','o','r','b');
+    p_enc->fmt_in.i_codec = VLC_CODEC_FL32;
+    p_enc->fmt_out.i_codec = VLC_CODEC_VORBIS;
 
     config_ChainParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg );
 
index e57b9ce..ef6cdb9 100644 (file)
@@ -120,9 +120,9 @@ static int OpenDecoder( vlc_object_t *p_this )
     decoder_sys_t *p_sys;
 
     if( p_dec->fmt_in.i_codec != VLC_FOURCC('w','m','a','1') &&
-        p_dec->fmt_in.i_codec != VLC_FOURCC('W','M','A','1') &&
+        p_dec->fmt_in.i_codec != VLC_CODEC_WMA1 &&
         p_dec->fmt_in.i_codec != VLC_FOURCC('w','m','a','2') &&
-        p_dec->fmt_in.i_codec != VLC_FOURCC('W','M','A','2') )
+        p_dec->fmt_in.i_codec != VLC_CODEC_WMA2 )
     {
         return VLC_EGENERIC;
     }
@@ -139,7 +139,7 @@ static int OpenDecoder( vlc_object_t *p_this )
 
     /* Set output properties */
     p_dec->fmt_out.i_cat = AUDIO_ES;
-    p_dec->fmt_out.i_codec = VLC_FOURCC('f','i','3','2');
+    p_dec->fmt_out.i_codec = VLC_CODEC_FI32;
     p_dec->fmt_out.audio.i_bitspersample = p_dec->fmt_in.audio.i_bitspersample;
     p_dec->fmt_out.audio.i_rate = p_dec->fmt_in.audio.i_rate;
 
@@ -167,9 +167,9 @@ static int OpenDecoder( vlc_object_t *p_this )
         wfx.bitspersample );
 
     if( p_dec->fmt_in.i_codec == VLC_FOURCC('w','m','a','1')
-        || p_dec->fmt_in.i_codec == VLC_FOURCC('W','M','A','1') )
+        || p_dec->fmt_in.i_codec == VLC_CODEC_WMA1 )
         wfx.codec_id = ASF_CODEC_ID_WMAV1;
-    else if( p_dec->fmt_in.i_codec == VLC_FOURCC('W','M','A','2')
+    else if( p_dec->fmt_in.i_codec == VLC_CODEC_WMA2
         || p_dec->fmt_in.i_codec == VLC_FOURCC('w','m','a','2') )
         wfx.codec_id = ASF_CODEC_ID_WMAV2;
 
index 5004c2c..2a82903 100644 (file)
@@ -761,7 +761,7 @@ static int  Open ( vlc_object_t *p_this )
     x264_nal_t    *nal;
     int i, i_nal;
 
-    if( p_enc->fmt_out.i_codec != VLC_FOURCC( 'h', '2', '6', '4' ) &&
+    if( p_enc->fmt_out.i_codec != VLC_CODEC_H264 &&
         !p_enc->b_force )
     {
         return VLC_EGENERIC;
@@ -793,8 +793,8 @@ static int  Open ( vlc_object_t *p_this )
     config_ChainParse( p_enc, SOUT_CFG_PREFIX, ppsz_sout_options, p_enc->p_cfg );
 
     p_enc->fmt_out.i_cat = VIDEO_ES;
-    p_enc->fmt_out.i_codec = VLC_FOURCC( 'h', '2', '6', '4' );
-    p_enc->fmt_in.i_codec = VLC_FOURCC('I','4','2','0');
+    p_enc->fmt_out.i_codec = VLC_CODEC_H264;
+    p_enc->fmt_in.i_codec = VLC_CODEC_I420;
 
     p_enc->pf_encode_video = Encode;
     p_enc->pf_encode_audio = NULL;
index edfe1cc..7b8a87a 100644 (file)
@@ -121,7 +121,7 @@ static int OpenDecoder( vlc_object_t *p_this )
 #ifdef __GLIBC__
     mtrace();
 #endif
-    if( p_dec->fmt_in.i_codec != VLC_FOURCC('m','p','g','v') &&
+    if( p_dec->fmt_in.i_codec != VLC_CODEC_MPGV &&
         p_dec->fmt_in.i_codec != VLC_FOURCC('m','p','g','1') &&
         /* Pinnacle hardware-mpeg1 */
         p_dec->fmt_in.i_codec != VLC_FOURCC('P','I','M','1') &&
@@ -693,7 +693,7 @@ static picture_t *GetNewPicture( decoder_t *p_dec, uint8_t **pp_buf )
     p_dec->fmt_out.i_codec =
         ( p_sys->p_info->sequence->chroma_height <
           p_sys->p_info->sequence->height ) ?
-        VLC_FOURCC('I','4','2','0') : VLC_FOURCC('I','4','2','2');
+        VLC_CODEC_I420 : VLC_CODEC_I422;
 
 #if 0
     p_sys->f_wd_nb = fopen("/vlc/dec_nb", "w");
index 8d5509a..3563a66 100644 (file)
@@ -203,7 +203,7 @@ static int Open( vlc_object_t *p_this )
     decoder_t     *p_dec = (decoder_t *) p_this;
     decoder_sys_t *p_sys = NULL;
 
-    if( p_dec->fmt_in.i_codec != VLC_FOURCC('t','e','l','x') )
+    if( p_dec->fmt_in.i_codec != VLC_CODEC_TELETEXT )
         return VLC_EGENERIC;
 
     p_dec->pf_decode_sub = Decode;
@@ -271,11 +271,11 @@ static int Open( vlc_object_t *p_this )
     /* Listen for keys */
     var_AddCallback( p_dec->p_libvlc, "key-pressed", EventKey, p_dec );
 
-    es_format_Init( &p_dec->fmt_out, SPU_ES, VLC_FOURCC( 's','p','u',' ' ) );
+    es_format_Init( &p_dec->fmt_out, SPU_ES, VLC_CODEC_SPU );
     if( p_sys->b_text )
-        p_dec->fmt_out.video.i_chroma = VLC_FOURCC('T','E','X','T');
+        p_dec->fmt_out.video.i_chroma = VLC_CODEC_TEXT;
     else
-        p_dec->fmt_out.video.i_chroma = VLC_FOURCC('R','G','B','A');
+        p_dec->fmt_out.video.i_chroma = VLC_CODEC_RGBA;
     return VLC_SUCCESS;
 }
 
@@ -466,8 +466,8 @@ static subpicture_t *Subpicture( decoder_t *p_dec, video_format_t *p_fmt,
     }
 
     memset( &fmt, 0, sizeof(video_format_t) );
-    fmt.i_chroma = b_text ? VLC_FOURCC('T','E','X','T') :
-                                   VLC_FOURCC('R','G','B','A');
+    fmt.i_chroma = b_text ? VLC_CODEC_TEXT :
+                                   VLC_CODEC_RGBA;
     fmt.i_aspect = b_text ? 0 : VOUT_ASPECT_FACTOR;
     if( b_text )
     {
@@ -556,7 +556,7 @@ static int OpaquePage( picture_t *p_src, const vbi_page p_page,
 {
     unsigned int    x, y;
 
-    assert( fmt.i_chroma == VLC_FOURCC('R','G','B','A' ) );
+    assert( fmt.i_chroma == VLC_CODEC_RGBA );
 
     /* Kludge since zvbi doesn't provide an option to specify opacity. */
     for( y = 0; y < fmt.i_height; y++ )
index fb5de97..18c293d 100644 (file)
@@ -923,7 +923,7 @@ static int DemuxInit( demux_t *p_demux )
                 es_format_Init( &fmt, AUDIO_ES, 0 );
                 i_format = GetWLE( &p_data[0] );
                 if( i_format == 0 )
-                    fmt.i_codec = VLC_FOURCC( 'a','5','2',' ');
+                    fmt.i_codec = VLC_CODEC_A52;
                 else
                     wf_tag_to_fourcc( i_format, &fmt.i_codec, NULL );
                 fmt.audio.i_channels        = GetWLE(  &p_data[2] );
index 08f7e98..bccf2ea 100644 (file)
@@ -156,14 +156,14 @@ static int Open( vlc_object_t *p_this )
     switch( GetDWBE( &hdr[8] ) )
     {
         case AU_ALAW_8:        /* 8-bit ISDN A-law */
-            p_sys->fmt.i_codec               = VLC_FOURCC( 'a','l','a','w' );
+            p_sys->fmt.i_codec               = VLC_CODEC_ALAW;
             p_sys->fmt.audio.i_bitspersample = 8;
             p_sys->fmt.audio.i_blockalign    = 1 * p_sys->fmt.audio.i_channels;
             i_cat                    = AU_CAT_PCM;
             break;
 
         case AU_MULAW_8:       /* 8-bit ISDN u-law */
-            p_sys->fmt.i_codec               = VLC_FOURCC( 'u','l','a','w' );
+            p_sys->fmt.i_codec               = VLC_CODEC_MULAW;
             p_sys->fmt.audio.i_bitspersample = 8;
             p_sys->fmt.audio.i_blockalign    = 1 * p_sys->fmt.audio.i_channels;
             i_cat                    = AU_CAT_PCM;
index d910288..4b6e59d 100644 (file)
@@ -94,7 +94,7 @@ static int Open( vlc_object_t * p_this )
     p_demux->p_sys      = p_sys = malloc( sizeof( demux_sys_t ) );
 
     /* */
-    es_format_Init( &p_sys->fmt, VIDEO_ES, VLC_FOURCC('C','D','G', ' ' ) );
+    es_format_Init( &p_sys->fmt, VIDEO_ES, VLC_CODEC_CDG );
     p_sys->fmt.video.i_width  = 300-2*6;
     p_sys->fmt.video.i_height = 216-2*12 ;
 
index 84e6691..4cfd537 100644 (file)
@@ -110,7 +110,7 @@ static int Open( vlc_object_t * p_this )
     p_sys->i_dtsoffset = var_CreateGetInteger( p_demux, DEMUX_CFG_PREFIX DEMUX_DTSOFFSET );
 
     /* Load the packetizer */
-    es_format_Init( &fmt, VIDEO_ES, VLC_FOURCC( 'd','r','a','c' ) );
+    es_format_Init( &fmt, VIDEO_ES, VLC_CODEC_DIRAC );
     p_sys->p_packetizer = demux_PacketizerNew( p_demux, &fmt, "dirac" );
     if( !p_sys->p_packetizer )
     {
index 17b45ff..91a2ccc 100644 (file)
@@ -144,7 +144,7 @@ static int Open( vlc_object_t * p_this )
     /* Load the FLAC packetizer */
     /* Store STREAMINFO for the decoder and packetizer */
     p_streaminfo[4] |= 0x80; /* Fake this as the last metadata block */
-    es_format_Init( &fmt, AUDIO_ES, VLC_FOURCC( 'f', 'l', 'a', 'c' ) );
+    es_format_Init( &fmt, AUDIO_ES, VLC_CODEC_FLAC );
     fmt.i_extra = i_streaminfo;
     fmt.p_extra = p_streaminfo;
 
index 414c51f..cd9c4f7 100644 (file)
@@ -808,12 +808,12 @@ static int SessionsSetup( demux_t *p_demux )
                     !strcmp( sub->codecName(), "MPA-ROBUST" ) ||
                     !strcmp( sub->codecName(), "X-MP3-DRAFT-00" ) )
                 {
-                    tk->fmt.i_codec = VLC_FOURCC( 'm', 'p', 'g', 'a' );
+                    tk->fmt.i_codec = VLC_CODEC_MPGA;
                     tk->fmt.audio.i_rate = 0;
                 }
                 else if( !strcmp( sub->codecName(), "AC3" ) )
                 {
-                    tk->fmt.i_codec = VLC_FOURCC( 'a', '5', '2', ' ' );
+                    tk->fmt.i_codec = VLC_CODEC_A52;
                     tk->fmt.audio.i_rate = 0;
                 }
                 else if( !strcmp( sub->codecName(), "L16" ) )
@@ -828,15 +828,15 @@ static int SessionsSetup( demux_t *p_demux )
                 }
                 else if( !strcmp( sub->codecName(), "PCMU" ) )
                 {
-                    tk->fmt.i_codec = VLC_FOURCC( 'u', 'l', 'a', 'w' );
+                    tk->fmt.i_codec = VLC_CODEC_MULAW;
                 }
                 else if( !strcmp( sub->codecName(), "PCMA" ) )
                 {
-                    tk->fmt.i_codec = VLC_FOURCC( 'a', 'l', 'a', 'w' );
+                    tk->fmt.i_codec = VLC_CODEC_ALAW;
                 }
                 else if( !strncmp( sub->codecName(), "G726", 4 ) )
                 {
-                    tk->fmt.i_codec = VLC_FOURCC( 'g', '7', '2', '6' );
+                    tk->fmt.i_codec = VLC_CODEC_ADPCM_G726;
                     tk->fmt.audio.i_rate = 8000;
                     tk->fmt.audio.i_channels = 1;
                     if( !strcmp( sub->codecName()+5, "40" ) )
@@ -850,18 +850,18 @@ static int SessionsSetup( demux_t *p_demux )
                 }
                 else if( !strcmp( sub->codecName(), "AMR" ) )
                 {
-                    tk->fmt.i_codec = VLC_FOURCC( 's', 'a', 'm', 'r' );
+                    tk->fmt.i_codec = VLC_CODEC_AMR_NB;
                 }
                 else if( !strcmp( sub->codecName(), "AMR-WB" ) )
                 {
-                    tk->fmt.i_codec = VLC_FOURCC( 's', 'a', 'w', 'b' );
+                    tk->fmt.i_codec = VLC_CODEC_AMR_WB;
                 }
                 else if( !strcmp( sub->codecName(), "MP4A-LATM" ) )
                 {
                     unsigned int i_extra;
                     uint8_t      *p_extra;
 
-                    tk->fmt.i_codec = VLC_FOURCC( 'm', 'p', '4', 'a' );
+                    tk->fmt.i_codec = VLC_CODEC_MP4A;
 
                     if( ( p_extra = parseStreamMuxConfigStr( sub->fmtp_config(),
                                                              i_extra ) ) )
@@ -880,7 +880,7 @@ static int SessionsSetup( demux_t *p_demux )
                     unsigned int i_extra;
                     uint8_t      *p_extra;
 
-                    tk->fmt.i_codec = VLC_FOURCC( 'm', 'p', '4', 'a' );
+                    tk->fmt.i_codec = VLC_CODEC_MP4A;
 
                     if( ( p_extra = parseGeneralConfigStr( sub->fmtp_config(),
                                                            i_extra ) ) )
@@ -920,24 +920,24 @@ static int SessionsSetup( demux_t *p_demux )
                 es_format_Init( &tk->fmt, VIDEO_ES, VLC_FOURCC('u','n','d','f') );
                 if( !strcmp( sub->codecName(), "MPV" ) )
                 {
-                    tk->fmt.i_codec = VLC_FOURCC( 'm', 'p', 'g', 'v' );
+                    tk->fmt.i_codec = VLC_CODEC_MPGV;
                 }
                 else if( !strcmp( sub->codecName(), "H263" ) ||
                          !strcmp( sub->codecName(), "H263-1998" ) ||
                          !strcmp( sub->codecName(), "H263-2000" ) )
                 {
-                    tk->fmt.i_codec = VLC_FOURCC( 'H', '2', '6', '3' );
+                    tk->fmt.i_codec = VLC_CODEC_H263;
                 }
                 else if( !strcmp( sub->codecName(), "H261" ) )
                 {
-                    tk->fmt.i_codec = VLC_FOURCC( 'H', '2', '6', '1' );
+                    tk->fmt.i_codec = VLC_CODEC_H261;
                 }
                 else if( !strcmp( sub->codecName(), "H264" ) )
                 {
                     unsigned int i_extra = 0;
                     uint8_t      *p_extra = NULL;
 
-                    tk->fmt.i_codec = VLC_FOURCC( 'h', '2', '6', '4' );
+                    tk->fmt.i_codec = VLC_CODEC_H264;
                     tk->fmt.b_packetized = false;
 
                     if((p_extra=parseH264ConfigStr( sub->fmtp_spropparametersets(),
@@ -952,14 +952,14 @@ static int SessionsSetup( demux_t *p_demux )
                 }
                 else if( !strcmp( sub->codecName(), "JPEG" ) )
                 {
-                    tk->fmt.i_codec = VLC_FOURCC( 'M', 'J', 'P', 'G' );
+                    tk->fmt.i_codec = VLC_CODEC_MJPG;
                 }
                 else if( !strcmp( sub->codecName(), "MP4V-ES" ) )
                 {
                     unsigned int i_extra;
                     uint8_t      *p_extra;
 
-                    tk->fmt.i_codec = VLC_FOURCC( 'm', 'p', '4', 'v' );
+                    tk->fmt.i_codec = VLC_CODEC_MP4V;
 
                     if( ( p_extra = parseGeneralConfigStr( sub->fmtp_config(),
                                                            i_extra ) ) )
@@ -1631,8 +1631,8 @@ static void StreamRead( void *p_private, unsigned int i_size,
         msg_Warn( p_demux, "buffer overflow" );
     }
     /* FIXME could i_size be > buffer size ? */
-    if( tk->fmt.i_codec == VLC_FOURCC('s','a','m','r') ||
-        tk->fmt.i_codec == VLC_FOURCC('s','a','w','b') )
+    if( tk->fmt.i_codec == VLC_CODEC_AMR_NB ||
+        tk->fmt.i_codec == VLC_CODEC_AMR_WB )
     {
         AMRAudioSource *amrSource = (AMRAudioSource*)tk->sub->readSource();
 
@@ -1640,7 +1640,7 @@ static void StreamRead( void *p_private, unsigned int i_size,
         p_block->p_buffer[0] = amrSource->lastFrameHeader();
         memcpy( p_block->p_buffer + 1, tk->p_buffer, i_size );
     }
-    else if( tk->fmt.i_codec == VLC_FOURCC('H','2','6','1') )
+    else if( tk->fmt.i_codec == VLC_CODEC_H261 )
     {
         H261VideoRTPSource *h261Source = (H261VideoRTPSource*)tk->sub->rtpSource();
         uint32_t header = h261Source->lastSpecialHeader();
@@ -1651,7 +1651,7 @@ static void StreamRead( void *p_private, unsigned int i_size,
         if( tk->sub->rtpSource()->curPacketMarkerBit() )
             p_block->i_flags |= BLOCK_FLAG_END_OF_FRAME;
     }
-    else if( tk->fmt.i_codec == VLC_FOURCC('h','2','6','4') )
+    else if( tk->fmt.i_codec == VLC_CODEC_H264 )
     {
         if( (tk->p_buffer[0] & 0x1f) >= 24 )
             msg_Warn( p_demux, "unsupported NAL type for H264" );
@@ -1694,7 +1694,7 @@ static void StreamRead( void *p_private, unsigned int i_size,
     if( !tk->b_muxed )
     {
         /*FIXME: for h264 you should check that packetization-mode=1 in sdp-file */
-        p_block->i_dts = ( tk->fmt.i_codec == VLC_FOURCC( 'm', 'p', 'g', 'v' ) ) ? 0 : i_pts;
+        p_block->i_dts = ( tk->fmt.i_codec == VLC_CODEC_MPGV ) ? 0 : i_pts;
     }
 
     if( tk->b_muxed )
index 69d54db..406ac6e 100644 (file)
@@ -367,7 +367,7 @@ static int Open( vlc_object_t * p_this )
     }
 
     es_format_Init( &p_sys->fmt, VIDEO_ES, 0 );
-    p_sys->fmt.i_codec = VLC_FOURCC('m','j','p','g');
+    p_sys->fmt.i_codec = VLC_CODEC_MJPG;
 
     p_sys->p_es = es_out_Add( p_demux->out, &p_sys->fmt );
     return VLC_SUCCESS;
index 26d43b4..5ec05d5 100644 (file)
@@ -669,12 +669,12 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
         else if( !strcmp( tracks[i_track]->psz_codec, "V_MPEG1" ) ||
                  !strcmp( tracks[i_track]->psz_codec, "V_MPEG2" ) )
         {
-            tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'm', 'p', 'g', 'v' );
+            tracks[i_track]->fmt.i_codec = VLC_CODEC_MPGV;
         }
         else if( !strncmp( tracks[i_track]->psz_codec, "V_THEORA", 8 ) )
         {
             uint8_t *p_data = tracks[i_track]->p_extra_data;
-            tracks[i_track]->fmt.i_codec = VLC_FOURCC( 't', 'h', 'e', 'o' );
+            tracks[i_track]->fmt.i_codec = VLC_CODEC_THEORA;
             if( tracks[i_track]->i_extra_data >= 4 ) {
                 if( p_data[0] == 2 ) {
                     int i = 1;
@@ -744,13 +744,13 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
         else if( !strncmp( tracks[i_track]->psz_codec, "V_REAL/RV", 9 ) )
         {
             if( !strcmp( p_tk->psz_codec, "V_REAL/RV10" ) )
-                p_fmt->i_codec = VLC_FOURCC( 'R', 'V', '1', '0' );
+                p_fmt->i_codec = VLC_CODEC_RV10;
             else if( !strcmp( p_tk->psz_codec, "V_REAL/RV20" ) )
-                p_fmt->i_codec = VLC_FOURCC( 'R', 'V', '2', '0' );
+                p_fmt->i_codec = VLC_CODEC_RV20;
             else if( !strcmp( p_tk->psz_codec, "V_REAL/RV30" ) )
-                p_fmt->i_codec = VLC_FOURCC( 'R', 'V', '3', '0' );
+                p_fmt->i_codec = VLC_CODEC_RV30;
             else if( !strcmp( p_tk->psz_codec, "V_REAL/RV40" ) )
-                p_fmt->i_codec = VLC_FOURCC( 'R', 'V', '4', '0' );
+                p_fmt->i_codec = VLC_CODEC_RV40;
 
             if( p_tk->i_extra_data > 26 )
             {
@@ -765,13 +765,13 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
         }
         else if( !strncmp( tracks[i_track]->psz_codec, "V_DIRAC", 7 ) )
         {
-            tracks[i_track]->fmt.i_codec = VLC_FOURCC('d', 'r', 'a', 'c' );
+            tracks[i_track]->fmt.i_codec = VLC_CODEC_DIRAC;
         }
         else if( !strncmp( tracks[i_track]->psz_codec, "V_MPEG4", 7 ) )
         {
             if( !strcmp( tracks[i_track]->psz_codec, "V_MPEG4/MS/V3" ) )
             {
-                tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'D', 'I', 'V', '3' );
+                tracks[i_track]->fmt.i_codec = VLC_CODEC_DIV3;
             }
             else if( !strncmp( tracks[i_track]->psz_codec, "V_MPEG4/ISO", 11 ) )
             {
@@ -779,7 +779,7 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
                 if( !strcmp( tracks[i_track]->psz_codec, "V_MPEG4/ISO/AVC" ) )
                     tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'a', 'v', 'c', '1' );
                 else
-                    tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'm', 'p', '4', 'v' );
+                    tracks[i_track]->fmt.i_codec = VLC_CODEC_MP4V;
                 tracks[i_track]->fmt.i_extra = tracks[i_track]->i_extra_data;
                 tracks[i_track]->fmt.p_extra = malloc( tracks[i_track]->i_extra_data );
                 memcpy( tracks[i_track]->fmt.p_extra,tracks[i_track]->p_extra_data, tracks[i_track]->i_extra_data );
@@ -840,33 +840,33 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
                  !strcmp( tracks[i_track]->psz_codec, "A_MPEG/L2" ) ||
                  !strcmp( tracks[i_track]->psz_codec, "A_MPEG/L1" ) )
         {
-            tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'm', 'p', 'g', 'a' );
+            tracks[i_track]->fmt.i_codec = VLC_CODEC_MPGA;
         }
         else if( !strcmp( tracks[i_track]->psz_codec, "A_AC3" ) )
         {
-            tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'a', '5', '2', ' ' );
+            tracks[i_track]->fmt.i_codec = VLC_CODEC_A52;
         }
         else if( !strcmp( tracks[i_track]->psz_codec, "A_EAC3" ) )
         {
-            tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'e', 'a', 'c', '3' );
+            tracks[i_track]->fmt.i_codec = VLC_CODEC_EAC3;
         }
         else if( !strcmp( tracks[i_track]->psz_codec, "A_DTS" ) )
         {
-            tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'd', 't', 's', ' ' );
+            tracks[i_track]->fmt.i_codec = VLC_CODEC_DTS;
         }
         else if( !strcmp( tracks[i_track]->psz_codec, "A_MLP" ) )
         {
-            tracks[i_track]->fmt.i_codec = VLC_FOURCC('m', 'l', 'p', ' ' );
+            tracks[i_track]->fmt.i_codec = VLC_CODEC_MLP;
         }
         else if( !strcmp( tracks[i_track]->psz_codec, "A_TRUEHD" ) )
         {
             /* FIXME when more samples arrive */
-            tracks[i_track]->fmt.i_codec = VLC_FOURCC('t', 'r', 'h', 'd' );
+            tracks[i_track]->fmt.i_codec = VLC_CODEC_TRUEHD;
             p_fmt->b_packetized = false;
         }
         else if( !strcmp( tracks[i_track]->psz_codec, "A_FLAC" ) )
         {
-            tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'f', 'l', 'a', 'c' );
+            tracks[i_track]->fmt.i_codec = VLC_CODEC_FLAC;
             tracks[i_track]->fmt.i_extra = tracks[i_track]->i_extra_data;
             tracks[i_track]->fmt.p_extra = malloc( tracks[i_track]->i_extra_data );
             memcpy( tracks[i_track]->fmt.p_extra,tracks[i_track]->p_extra_data, tracks[i_track]->i_extra_data );
@@ -876,7 +876,7 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
             int i, i_offset = 1, i_size[3], i_extra;
             uint8_t *p_extra;
 
-            tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'v', 'o', 'r', 'b' );
+            tracks[i_track]->fmt.i_codec = VLC_CODEC_VORBIS;
 
             /* Split the 3 headers */
             if( tracks[i_track]->p_extra_data[0] != 0x02 )
@@ -919,7 +919,7 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
                         16000, 12000, 11025, 8000,  7350,  0,     0,     0
             };
 
-            tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'm', 'p', '4', 'a' );
+            tracks[i_track]->fmt.i_codec = VLC_CODEC_MP4A;
             /* create data for faad (MP4DecSpecificDescrTag)*/
 
             if( !strcmp( &tracks[i_track]->psz_codec[12], "MAIN" ) )
@@ -971,21 +971,21 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
         }
         else if( !strcmp( tracks[i_track]->psz_codec, "A_AAC" ) )
         {
-            tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'm', 'p', '4', 'a' );
+            tracks[i_track]->fmt.i_codec = VLC_CODEC_MP4A;
             tracks[i_track]->fmt.i_extra = tracks[i_track]->i_extra_data;
             tracks[i_track]->fmt.p_extra = malloc( tracks[i_track]->i_extra_data );
             memcpy( tracks[i_track]->fmt.p_extra, tracks[i_track]->p_extra_data, tracks[i_track]->i_extra_data );
         }
         else if( !strcmp( tracks[i_track]->psz_codec, "A_WAVPACK4" ) )
         {
-            tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'W', 'V', 'P', 'K' );
+            tracks[i_track]->fmt.i_codec = VLC_CODEC_WAVPACK;
             tracks[i_track]->fmt.i_extra = tracks[i_track]->i_extra_data;
             tracks[i_track]->fmt.p_extra = malloc( tracks[i_track]->i_extra_data );
             memcpy( tracks[i_track]->fmt.p_extra, tracks[i_track]->p_extra_data, tracks[i_track]->i_extra_data );
         }
         else if( !strcmp( tracks[i_track]->psz_codec, "A_TTA1" ) )
         {
-            tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'T', 'T', 'A', '1' );
+            tracks[i_track]->fmt.i_codec = VLC_CODEC_TTA;
             tracks[i_track]->fmt.i_extra = tracks[i_track]->i_extra_data;
             tracks[i_track]->fmt.p_extra = malloc( tracks[i_track]->i_extra_data );
             memcpy( tracks[i_track]->fmt.p_extra, tracks[i_track]->p_extra_data, tracks[i_track]->i_extra_data );
@@ -1010,7 +1010,7 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
             int i, i_offset = 1, i_extra, num_headers, size_so_far;
             uint8_t *p_extra;
 
-            tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'k', 'a', 't', 'e' );
+            tracks[i_track]->fmt.i_codec = VLC_CODEC_KATE;
             tracks[i_track]->fmt.subs.psz_encoding = strdup( "UTF-8" );
 
             /* Recover the number of headers to expect */
@@ -1057,12 +1057,12 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
         }
         else if( !strcmp( tracks[i_track]->psz_codec, "S_TEXT/ASCII" ) )
         {
-            p_fmt->i_codec = VLC_FOURCC( 's', 'u', 'b', 't' );
+            p_fmt->i_codec = VLC_CODEC_SUBT;
             p_fmt->subs.psz_encoding = NULL; /* Is there a place where it is stored ? */
         }
         else if( !strcmp( tracks[i_track]->psz_codec, "S_TEXT/UTF8" ) )
         {
-            tracks[i_track]->fmt.i_codec = VLC_FOURCC( 's', 'u', 'b', 't' );
+            tracks[i_track]->fmt.i_codec = VLC_CODEC_SUBT;
             tracks[i_track]->fmt.subs.psz_encoding = strdup( "UTF-8" );
         }
         else if( !strcmp( tracks[i_track]->psz_codec, "S_TEXT/USF" ) )
@@ -1081,7 +1081,7 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
                  !strcmp( tracks[i_track]->psz_codec, "S_SSA" ) ||
                  !strcmp( tracks[i_track]->psz_codec, "S_ASS" ))
         {
-            tracks[i_track]->fmt.i_codec = VLC_FOURCC( 's', 's', 'a', ' ' );
+            tracks[i_track]->fmt.i_codec = VLC_CODEC_SSA;
             tracks[i_track]->fmt.subs.psz_encoding = strdup( "UTF-8" );
             if( tracks[i_track]->i_extra_data )
             {
@@ -1092,7 +1092,7 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
         }
         else if( !strcmp( tracks[i_track]->psz_codec, "S_VOBSUB" ) )
         {
-            tracks[i_track]->fmt.i_codec = VLC_FOURCC( 's','p','u',' ' );
+            tracks[i_track]->fmt.i_codec = VLC_CODEC_SPU;
             if( tracks[i_track]->i_extra_data )
             {
                 char *p_start;
@@ -1120,7 +1120,7 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
         }
         else if( !strcmp( p_tk->psz_codec, "A_REAL/14_4" ) )
         {
-            p_fmt->i_codec = VLC_FOURCC( '1', '4', '_', '4');
+            p_fmt->i_codec = VLC_CODEC_RA_144;
             p_fmt->audio.i_channels = 1;
             p_fmt->audio.i_rate = 8000;
             p_fmt->audio.i_blockalign = 0x14;
index b02e4cd..a1aff2d 100644 (file)
@@ -150,12 +150,12 @@ static int Open( vlc_object_t * p_this )
 
     /* */
 #ifndef MPC_FIXED_POINT
-    es_format_Init( &fmt, AUDIO_ES, VLC_FOURCC( 'f', 'l', '3', '2' ) );
+    es_format_Init( &fmt, AUDIO_ES, VLC_CODEC_FL32 );
 #else
 #   ifdef WORDS_BIGENDIAN
-    es_format_Init( &fmt, AUDIO_ES, VLC_FOURCC( 's', '3', '2', 'b' ) );
+    es_format_Init( &fmt, AUDIO_ES, VLC_CODEC_S32B );
 #   else
-    es_format_Init( &fmt, AUDIO_ES, VLC_FOURCC( 's', '3', '2', 'l' ) );
+    es_format_Init( &fmt, AUDIO_ES, VLC_CODEC_S32L );
 #   endif
 #endif
     fmt.audio.i_channels = p_sys->info.channels;
index abe04dc..3a23281 100644 (file)
@@ -133,12 +133,12 @@ static int MlpProbe( demux_t *p_demux, int64_t *pi_offset );
 static int MlpInit( demux_t *p_demux );
 
 static const codec_t p_codec[] = {
-    { VLC_FOURCC( 'm', 'p', '4', 'a' ), false, "mp4 audio",  AacProbe,  AacInit },
-    { VLC_FOURCC( 'm', 'p', 'g', 'a' ), false, "mpeg audio", MpgaProbe, MpgaInit },
-    { VLC_FOURCC( 'a', '5', '2', ' ' ), true,  "a52 audio",  A52Probe,  A52Init },
-    { VLC_FOURCC( 'e', 'a', 'c', '3' ), true,  "eac3 audio", EA52Probe, A52Init },
-    { VLC_FOURCC( 'd', 't', 's', ' ' ), false, "dts audio",  DtsProbe,  DtsInit },
-    { VLC_FOURCC( 'm', 'l', 'p', ' ' ), false, "mlp audio",  MlpProbe,  MlpInit },
+    { VLC_CODEC_MP4A, false, "mp4 audio",  AacProbe,  AacInit },
+    { VLC_CODEC_MPGA, false, "mpeg audio", MpgaProbe, MpgaInit },
+    { VLC_CODEC_A52, true,  "a52 audio",  A52Probe,  A52Init },
+    { VLC_CODEC_EAC3, true,  "eac3 audio", EA52Probe, A52Init },
+    { VLC_CODEC_DTS, false, "dts audio",  DtsProbe,  DtsInit },
+    { VLC_CODEC_MLP, false, "mlp audio",  MlpProbe,  MlpInit },
 
     { 0, false, NULL, NULL, NULL }
 };
index 5f6071c..1bcf6f0 100644 (file)
@@ -109,7 +109,7 @@ static int Open( vlc_object_t * p_this )
     msg_Dbg( p_demux, "using %.2f fps", p_sys->f_fps );
 
     /* Load the mpegvideo packetizer */
-    es_format_Init( &fmt, VIDEO_ES, VLC_FOURCC( 'h', '2', '6', '4' ) );
+    es_format_Init( &fmt, VIDEO_ES, VLC_CODEC_H264 );
     p_sys->p_packetizer = demux_PacketizerNew( p_demux, &fmt, "h264" );
     if( !p_sys->p_packetizer )
     {
index 946739a..e9cbd8e 100644 (file)
@@ -108,7 +108,7 @@ static int Open( vlc_object_t * p_this )
     p_sys->p_es        = NULL;
 
     /* Load the mpegvideo packetizer */
-    es_format_Init( &fmt, VIDEO_ES, VLC_FOURCC( 'm', 'p', 'g', 'v' ) );
+    es_format_Init( &fmt, VIDEO_ES, VLC_CODEC_MPGV );
     p_sys->p_packetizer = demux_PacketizerNew( p_demux, &fmt, "mpeg video" );
     if( !p_sys->p_packetizer )
     {
@@ -117,7 +117,7 @@ static int Open( vlc_object_t * p_this )
     }
 
     /* create the output */
-    es_format_Init( &fmt, VIDEO_ES, VLC_FOURCC( 'm', 'p', 'g', 'v' ) );
+    es_format_Init( &fmt, VIDEO_ES, VLC_CODEC_MPGV );
     p_sys->p_es = es_out_Add( p_demux->out, &fmt );
 
     return VLC_SUCCESS;
index c6a87b4..99cad83 100644 (file)
@@ -314,7 +314,7 @@ static int Open( vlc_object_t * p_this )
     {
         es_format_t fmt;
 
-        es_format_Init( &fmt, AUDIO_ES, VLC_FOURCC('m','p','g','a') );
+        es_format_Init( &fmt, AUDIO_ES, VLC_CODEC_MPGA );
         fmt.audio.i_rate = p_sys->exh.i_audio_sample_rate;
         fmt.audio.i_bitspersample = p_sys->exh.i_audio_bits_per_sample;
 
index 2580c6a..5e50b7a 100644 (file)
@@ -360,21 +360,21 @@ static int Demux( demux_t * p_demux )
             /* Read info from any secondary header packets, if there are any */
             if( p_stream->i_secondary_header_packets > 0 )
             {
-                if( p_stream->fmt.i_codec == VLC_FOURCC('t','h','e','o') &&
+                if( p_stream->fmt.i_codec == VLC_CODEC_THEORA &&
                         oggpacket.bytes >= 7 &&
                         ! memcmp( oggpacket.packet, "\x80theora", 7 ) )
                 {
                     Ogg_ReadTheoraHeader( p_stream, &oggpacket );
                     p_stream->i_secondary_header_packets = 0;
                 }
-                else if( p_stream->fmt.i_codec == VLC_FOURCC('v','o','r','b') &&
+                else if( p_stream->fmt.i_codec == VLC_CODEC_VORBIS &&
                         oggpacket.bytes >= 7 &&
                         ! memcmp( oggpacket.packet, "\x01vorbis", 7 ) )
                 {
                     Ogg_ReadVorbisHeader( p_stream, &oggpacket );
                     p_stream->i_secondary_header_packets = 0;
                 }
-                else if( p_stream->fmt.i_codec == VLC_FOURCC('c','m','m','l') )
+                else if( p_stream->fmt.i_codec == VLC_CODEC_CMML )
                 {
                     p_stream->i_secondary_header_packets = 0;
                 }
@@ -397,9 +397,9 @@ static int Demux( demux_t * p_demux )
                 }
 
                 /* An Ogg/vorbis packet contains an end date granulepos */
-                if( p_stream->fmt.i_codec == VLC_FOURCC( 'v','o','r','b' ) ||
-                    p_stream->fmt.i_codec == VLC_FOURCC( 's','p','x',' ' ) ||
-                    p_stream->fmt.i_codec == VLC_FOURCC( 'f','l','a','c' ) )
+                if( p_stream->fmt.i_codec == VLC_CODEC_VORBIS ||
+                    p_stream->fmt.i_codec == VLC_CODEC_SPEEX ||
+                    p_stream->fmt.i_codec == VLC_CODEC_FLAC )
                 {
                     if( ogg_stream_packetout( &p_stream->os, &oggpacket ) > 0 )
                     {
@@ -541,8 +541,8 @@ static void Ogg_UpdatePCR( logical_stream_t *p_stream,
     /* Convert the granulepos into a pcr */
     if( p_oggpacket->granulepos >= 0 )
     {
-        if( p_stream->fmt.i_codec == VLC_FOURCC( 't','h','e','o' ) ||
-            p_stream->fmt.i_codec == VLC_FOURCC( 'k','a','t','e' ) )
+        if( p_stream->fmt.i_codec == VLC_CODEC_THEORA ||
+            p_stream->fmt.i_codec == VLC_CODEC_KATE )
         {
             ogg_int64_t iframe = p_oggpacket->granulepos >>
               p_stream->i_granule_shift;
@@ -552,7 +552,7 @@ static void Ogg_UpdatePCR( logical_stream_t *p_stream,
             p_stream->i_pcr = ( iframe + pframe ) * INT64_C(1000000)
                               / p_stream->f_rate;
         }
-        else if( p_stream->fmt.i_codec == VLC_FOURCC( 'd','r','a','c' ) )
+        else if( p_stream->fmt.i_codec == VLC_CODEC_DIRAC )
         {
             ogg_int64_t i_dts = p_oggpacket->granulepos >> 31;
             /* NB, OggDirac granulepos values are in units of 2*picturerate */
@@ -616,7 +616,7 @@ static void Ogg_DecodePacket( demux_t *p_demux,
         return;
     }
 
-    if( p_stream->fmt.i_codec == VLC_FOURCC( 's','u','b','t' ) &&
+    if( p_stream->fmt.i_codec == VLC_CODEC_SUBT &&
         p_oggpacket->packet[0] & PACKET_TYPE_BITS ) return;
 
     /* Check the ES is selected */
@@ -632,13 +632,13 @@ static void Ogg_DecodePacket( demux_t *p_demux,
         p_stream->i_packets_backup++;
         switch( p_stream->fmt.i_codec )
         {
-        case VLC_FOURCC( 'v','o','r','b' ):
-        case VLC_FOURCC( 's','p','x',' ' ):
-        case VLC_FOURCC( 't','h','e','o' ):
+        case VLC_CODEC_VORBIS:
+        case VLC_CODEC_SPEEX:
+        case VLC_CODEC_THEORA:
             if( p_stream->i_packets_backup == 3 ) p_stream->b_force_backup = 0;
             break;
 
-        case VLC_FOURCC( 'f','l','a','c' ):
+        case VLC_CODEC_FLAC:
             if( !p_stream->fmt.audio.i_rate && p_stream->i_packets_backup == 2 )
             {
                 Ogg_ReadFlacHeader( p_demux, p_stream, p_oggpacket );
@@ -656,7 +656,7 @@ static void Ogg_DecodePacket( demux_t *p_demux,
             b_store_size = false;
             break;
 
-        case VLC_FOURCC( 'k','a','t','e' ):
+        case VLC_CODEC_KATE:
             if( p_stream->i_packets_backup == 1)
                 b_store_num_headers = true;
             if( p_stream->i_packets_backup == p_stream->i_kate_num_headers ) p_stream->b_force_backup = 0;
@@ -723,9 +723,9 @@ static void Ogg_DecodePacket( demux_t *p_demux,
     }
 
     /* Convert the pcr into a pts */
-    if( p_stream->fmt.i_codec == VLC_FOURCC( 'v','o','r','b' ) ||
-        p_stream->fmt.i_codec == VLC_FOURCC( 's','p','x',' ' ) ||
-        p_stream->fmt.i_codec == VLC_FOURCC( 'f','l','a','c' ) )
+    if( p_stream->fmt.i_codec == VLC_CODEC_VORBIS ||
+        p_stream->fmt.i_codec == VLC_CODEC_SPEEX ||
+        p_stream->fmt.i_codec == VLC_CODEC_FLAC )
     {
         if( p_stream->i_pcr >= 0 )
         {
@@ -770,9 +770,9 @@ static void Ogg_DecodePacket( demux_t *p_demux,
         }
     }
 
-    if( p_stream->fmt.i_codec != VLC_FOURCC( 'v','o','r','b' ) &&
-        p_stream->fmt.i_codec != VLC_FOURCC( 's','p','x',' ' ) &&
-        p_stream->fmt.i_codec != VLC_FOURCC( 'f','l','a','c' ) &&
+    if( p_stream->fmt.i_codec != VLC_CODEC_VORBIS &&
+        p_stream->fmt.i_codec != VLC_CODEC_SPEEX &&
+        p_stream->fmt.i_codec != VLC_CODEC_FLAC &&
         p_stream->i_pcr >= 0 )
     {
         p_stream->i_previous_pcr = p_stream->i_pcr;
@@ -805,9 +805,9 @@ static void Ogg_DecodePacket( demux_t *p_demux,
         p_block->i_dts = p_block->i_pts = i_pts;
         p_block->i_length = 0;
     }
-    else if( p_stream->fmt.i_codec == VLC_FOURCC( 't','h','e','o' ) )
+    else if( p_stream->fmt.i_codec == VLC_CODEC_THEORA )
         p_block->i_dts = p_block->i_pts = i_pts;
-    else if( p_stream->fmt.i_codec == VLC_FOURCC( 'd','r','a','c' ) )
+    else if( p_stream->fmt.i_codec == VLC_CODEC_DIRAC )
     {
         ogg_int64_t dts = p_oggpacket->granulepos >> 31;
         ogg_int64_t delay = (p_oggpacket->granulepos >> 9) & 0x1fff;
@@ -826,20 +826,20 @@ static void Ogg_DecodePacket( demux_t *p_demux,
         p_block->i_pts = 0;
     }
 
-    if( p_stream->fmt.i_codec != VLC_FOURCC( 'v','o','r','b' ) &&
-        p_stream->fmt.i_codec != VLC_FOURCC( 's','p','x',' ' ) &&
-        p_stream->fmt.i_codec != VLC_FOURCC( 'f','l','a','c' ) &&
-        p_stream->fmt.i_codec != VLC_FOURCC( 't','a','r','k' ) &&
-        p_stream->fmt.i_codec != VLC_FOURCC( 't','h','e','o' ) &&
-        p_stream->fmt.i_codec != VLC_FOURCC( 'c','m','m','l' ) &&
-        p_stream->fmt.i_codec != VLC_FOURCC( 'd','r','a','c' ) &&
-        p_stream->fmt.i_codec != VLC_FOURCC( 'k','a','t','e' ) )
+    if( p_stream->fmt.i_codec != VLC_CODEC_VORBIS &&
+        p_stream->fmt.i_codec != VLC_CODEC_SPEEX &&
+        p_stream->fmt.i_codec != VLC_CODEC_FLAC &&
+        p_stream->fmt.i_codec != VLC_CODEC_TARKIN &&
+        p_stream->fmt.i_codec != VLC_CODEC_THEORA &&
+        p_stream->fmt.i_codec != VLC_CODEC_CMML &&
+        p_stream->fmt.i_codec != VLC_CODEC_DIRAC &&
+        p_stream->fmt.i_codec != VLC_CODEC_KATE )
     {
         /* We remove the header from the packet */
         i_header_len = (*p_oggpacket->packet & PACKET_LEN_BITS01) >> 6;
         i_header_len |= (*p_oggpacket->packet & PACKET_LEN_BITS2) << 1;
 
-        if( p_stream->fmt.i_codec == VLC_FOURCC( 's','u','b','t' ))
+        if( p_stream->fmt.i_codec == VLC_CODEC_SUBT)
         {
             /* But with subtitles we need to retrieve the duration first */
             int i, lenbytes = 0;
@@ -869,7 +869,7 @@ static void Ogg_DecodePacket( demux_t *p_demux,
             p_block->i_buffer = 0;
     }
 
-    if( p_stream->fmt.i_codec == VLC_FOURCC( 't','a','r','k' ) )
+    if( p_stream->fmt.i_codec == VLC_CODEC_TARKIN )
     {
         /* FIXME: the biggest hack I've ever done */
         msg_Warn( p_demux, "tarkin pts: %"PRId64", granule: %"PRId64,
@@ -970,7 +970,7 @@ static int Ogg_FindLogicalStreams( demux_t *p_demux )
                     p_stream->b_force_backup = 1;
 
                     p_stream->fmt.i_cat = AUDIO_ES;
-                    p_stream->fmt.i_codec = VLC_FOURCC( 'f','l','a','c' );
+                    p_stream->fmt.i_codec = VLC_CODEC_FLAC;
                 }
                 /* Check for Flac header (>= version 1.1.1) */
                 else if( oggpacket.bytes >= 13 && oggpacket.packet[0] ==0x7F &&
@@ -987,7 +987,7 @@ static int Ogg_FindLogicalStreams( demux_t *p_demux )
                     p_stream->b_force_backup = 1;
 
                     p_stream->fmt.i_cat = AUDIO_ES;
-                    p_stream->fmt.i_codec = VLC_FOURCC( 'f','l','a','c' );
+                    p_stream->fmt.i_codec = VLC_CODEC_FLAC;
                     oggpacket.packet += 13; oggpacket.bytes -= 13;
                     Ogg_ReadFlacHeader( p_demux, p_stream, &oggpacket );
                 }
@@ -1022,7 +1022,7 @@ static int Ogg_FindLogicalStreams( demux_t *p_demux )
 
                     msg_Dbg( p_demux, "found tarkin header" );
                     p_stream->fmt.i_cat = VIDEO_ES;
-                    p_stream->fmt.i_codec = VLC_FOURCC( 't','a','r','k' );
+                    p_stream->fmt.i_codec = VLC_CODEC_TARKIN;
 
                     /* Cheat and get additionnal info ;) */
                     oggpack_readinit( &opb, oggpacket.packet, oggpacket.bytes);
@@ -1280,7 +1280,7 @@ static int Ogg_FindLogicalStreams( demux_t *p_demux )
 
                         msg_Dbg( p_demux, "found text subtitles header" );
                         p_stream->fmt.i_cat = SPU_ES;
-                        p_stream->fmt.i_codec = VLC_FOURCC('s','u','b','t');
+                        p_stream->fmt.i_codec = VLC_CODEC_SUBT;
                         p_stream->f_rate = 1000; /* granulepos is in millisec */
                     }
                     else
@@ -1385,15 +1385,15 @@ static int Ogg_BeginningOfStream( demux_t *p_demux )
         if( !p_stream->p_es )
         {
             /* Better be safe than sorry when possible with ogm */
-            if( p_stream->fmt.i_codec == VLC_FOURCC( 'm', 'p', 'g', 'a' ) ||
-                p_stream->fmt.i_codec == VLC_FOURCC( 'a', '5', '2', ' ' ) )
+            if( p_stream->fmt.i_codec == VLC_CODEC_MPGA ||
+                p_stream->fmt.i_codec == VLC_CODEC_A52 )
                 p_stream->fmt.b_packetized = false;
 
             p_stream->p_es = es_out_Add( p_demux->out, &p_stream->fmt );
         }
 
         // TODO: something to do here ?
-        if( p_stream->fmt.i_codec == VLC_FOURCC('c','m','m','l') )
+        if( p_stream->fmt.i_codec == VLC_CODEC_CMML )
         {
             /* Set the CMML stream active */
             es_out_Control( p_demux->out, ES_OUT_SET_ES, p_stream->p_es );
@@ -1496,7 +1496,7 @@ static bool Ogg_LogicalStreamResetEsFormat( demux_t *p_demux, logical_stream_t *
         return true;
 
     /* Only vorbis is supported */
-    if( p_stream->fmt.i_codec == VLC_FOURCC( 'v','o','r','b' ) )
+    if( p_stream->fmt.i_codec == VLC_CODEC_VORBIS )
         b_compatible = Ogg_IsVorbisFormatCompatible( &p_stream->fmt, &p_stream->fmt_old );
 
     if( !b_compatible )
@@ -1550,30 +1550,30 @@ static void Ogg_ExtractMeta( demux_t *p_demux, vlc_fourcc_t i_codec, const uint8
     switch( i_codec )
     {
     /* 3 headers with the 2° one being the comments */
-    case VLC_FOURCC( 'v','o','r','b' ):
+    case VLC_CODEC_VORBIS:
         Ogg_ExtractXiphMeta( p_demux, p_headers, i_headers, 1+6, false );
         break;
-    case VLC_FOURCC( 't','h','e','o' ):
+    case VLC_CODEC_THEORA:
         Ogg_ExtractXiphMeta( p_demux, p_headers, i_headers, 1+6, false );
         break;
-    case VLC_FOURCC( 's','p','x',' ' ):
+    case VLC_CODEC_SPEEX:
         Ogg_ExtractXiphMeta( p_demux, p_headers, i_headers, 0, false );
         break;
 
     /* N headers with the 2° one being the comments */
-    case VLC_FOURCC( 'k','a','t','e' ):
+    case VLC_CODEC_KATE:
         /* 1 byte for header type, 7 bit for magic, 1 reserved zero byte */
         Ogg_ExtractXiphMeta( p_demux, p_headers, i_headers, 1+7+1, true );
         break;
 
     /* TODO */
-    case VLC_FOURCC( 'f','l','a','c' ):
+    case VLC_CODEC_FLAC:
         msg_Warn( p_demux, "Ogg_ExtractMeta does not support %4.4s", (const char*)&i_codec );
         break;
 
     /* No meta data */
-    case VLC_FOURCC( 'c','m','m','l' ): /* CMML is XML text, doesn't have Vorbis comments */
-    case VLC_FOURCC( 'd','r','a','c' ):
+    case VLC_CODEC_CMML: /* CMML is XML text, doesn't have Vorbis comments */
+    case VLC_CODEC_DIRAC:
     default:
         break;
     }
@@ -1590,7 +1590,7 @@ static void Ogg_ReadTheoraHeader( logical_stream_t *p_stream,
     int i_keyframe_frequency_force;
 
     p_stream->fmt.i_cat = VIDEO_ES;
-    p_stream->fmt.i_codec = VLC_FOURCC( 't','h','e','o' );
+    p_stream->fmt.i_codec = VLC_CODEC_THEORA;
 
     /* Signal that we want to keep a backup of the theora
      * stream headers. They will be used when switching between