From 724461bdf250e856eb32f6c0b7c51b065e482982 Mon Sep 17 00:00:00 2001 From: Laurent Aimar Date: Mon, 11 May 2009 20:49:09 +0200 Subject: [PATCH] Used VLC_CODEC_* and vlc_fourcc_GetCodec when suitable. 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. --- include/vlc_codecs.h | 40 +++--- include/vlc_es.h | 9 +- include/vlc_fourcc.h | 2 + modules/access/dc1394.c | 8 +- modules/access/dshow/dshow.cpp | 39 +++-- modules/access/dshow/filter.cpp | 48 +++---- modules/access/jack.c | 2 +- modules/access/oss.c | 2 +- modules/access/qtcapture.m | 4 +- modules/access/rtp/rtp.c | 16 +-- modules/access/rtp/xiph.c | 2 +- modules/access/screen/beos.cpp | 4 +- modules/access/screen/mac.c | 2 +- modules/access/screen/screen.c | 4 +- modules/access/screen/win32.c | 14 +- modules/access/screen/x11.c | 8 +- modules/access/v4l.c | 37 +++-- modules/access/v4l2.c | 42 +++--- modules/audio_filter/channel_mixer/dolby.c | 4 +- .../audio_filter/channel_mixer/headphone.c | 16 +-- modules/audio_filter/channel_mixer/simple.c | 2 +- modules/audio_filter/channel_mixer/trivial.c | 4 +- modules/audio_filter/converter/a52tofloat32.c | 12 +- modules/audio_filter/converter/a52tospdif.c | 8 +- modules/audio_filter/converter/dtstofloat32.c | 8 +- modules/audio_filter/converter/dtstospdif.c | 12 +- modules/audio_filter/converter/fixed.c | 8 +- modules/audio_filter/converter/float.c | 50 +++---- .../audio_filter/converter/mpgatofixed32.c | 16 +-- modules/audio_filter/equalizer.c | 8 +- modules/audio_filter/format.c | 80 +++++------ modules/audio_filter/normvol.c | 8 +- modules/audio_filter/param_eq.c | 8 +- modules/audio_filter/resampler/bandlimited.c | 4 +- modules/audio_filter/resampler/linear.c | 4 +- modules/audio_filter/resampler/trivial.c | 4 +- modules/audio_filter/resampler/ugly.c | 4 +- modules/audio_filter/scaletempo.c | 6 +- .../audio_filter/spatializer/spatializer.cpp | 8 +- modules/audio_mixer/float32.c | 2 +- modules/audio_mixer/trivial.c | 4 +- modules/audio_output/alsa.c | 10 +- modules/audio_output/auhal.c | 6 +- modules/audio_output/directx.c | 22 +-- modules/audio_output/file.c | 24 ++-- modules/audio_output/jack.c | 2 +- modules/audio_output/oss.c | 18 +-- modules/audio_output/portaudio.c | 2 +- modules/audio_output/pulse.c | 2 +- modules/audio_output/sdl.c | 12 +- modules/audio_output/waveout.c | 22 +-- modules/codec/a52.c | 8 +- modules/codec/aes3.c | 2 +- modules/codec/araw.c | 130 ++++++++--------- modules/codec/avcodec/audio.c | 10 +- modules/codec/avcodec/chroma.c | 42 +++--- modules/codec/avcodec/encoder.c | 10 +- modules/codec/avcodec/video.c | 4 +- modules/codec/cc.c | 4 +- modules/codec/cdg.c | 4 +- modules/codec/csri.c | 6 +- modules/codec/cvdsub.c | 4 +- modules/codec/dirac.c | 10 +- modules/codec/dmo/dmo.c | 32 ++--- modules/codec/dts.c | 4 +- modules/codec/dvbsub.c | 38 ++--- modules/codec/faad.c | 4 +- modules/codec/fake.c | 11 +- modules/codec/flac.c | 16 +-- modules/codec/fluidsynth.c | 4 +- modules/codec/invmem.c | 4 +- modules/codec/kate.c | 6 +- modules/codec/libass.c | 6 +- modules/codec/libmpeg2.c | 6 +- modules/codec/lpcm.c | 14 +- modules/codec/mash.cpp | 6 +- modules/codec/mpeg_audio.c | 4 +- modules/codec/png.c | 8 +- modules/codec/quicktime.c | 30 ++-- modules/codec/rawvideo.c | 28 ++-- modules/codec/realaudio.c | 4 +- modules/codec/realvideo.c | 16 +-- modules/codec/schroedinger.c | 10 +- modules/codec/sdl_image.c | 24 ++-- modules/codec/speex.c | 8 +- modules/codec/spudec/parse.c | 2 +- modules/codec/spudec/spudec.c | 6 +- modules/codec/subtitles/subsdec.c | 10 +- modules/codec/subtitles/subsusf.c | 10 +- modules/codec/subtitles/t140.c | 4 +- modules/codec/svcdsub.c | 2 +- modules/codec/tarkin.c | 10 +- modules/codec/telx.c | 4 +- modules/codec/theora.c | 18 +-- modules/codec/twolame.c | 4 +- modules/codec/vorbis.c | 14 +- modules/codec/wmafixed/wma.c | 10 +- modules/codec/x264.c | 6 +- modules/codec/xvmc/xxmc.c | 4 +- modules/codec/zvbi.c | 14 +- modules/demux/asf/asf.c | 2 +- modules/demux/au.c | 4 +- modules/demux/cdg.c | 2 +- modules/demux/dirac.c | 2 +- modules/demux/flac.c | 2 +- modules/demux/live555.cpp | 40 +++--- modules/demux/mjpeg.c | 2 +- modules/demux/mkv/matroska_segment.cpp | 54 +++---- modules/demux/mpc.c | 6 +- modules/demux/mpeg/es.c | 12 +- modules/demux/mpeg/h264.c | 2 +- modules/demux/mpeg/mpgv.c | 4 +- modules/demux/nuv.c | 2 +- modules/demux/ogg.c | 116 +++++++-------- modules/demux/ps.c | 2 +- modules/demux/ps.h | 30 ++-- modules/demux/pva.c | 4 +- modules/demux/rawdv.c | 10 +- modules/demux/rawvid.c | 24 ++-- modules/demux/smf.c | 2 +- modules/demux/subtitle.c | 4 +- modules/demux/subtitle_asa.c | 4 +- modules/demux/ts.c | 72 +++++----- modules/demux/tta.c | 2 +- modules/demux/ty.c | 6 +- modules/demux/vobsub.c | 2 +- modules/demux/voc.c | 14 +- modules/demux/wav.c | 10 +- modules/gui/beos/AudioOutput.cpp | 2 +- modules/gui/beos/VideoWindow.h | 8 +- modules/gui/fbosd.c | 22 +-- modules/gui/qnx/aout.c | 2 +- modules/gui/qnx/vout.c | 26 ++-- modules/gui/skins2/src/file_bitmap.cpp | 2 +- modules/misc/dummy/aout.c | 2 +- modules/misc/dummy/vout.c | 7 +- modules/misc/freetype.c | 4 +- modules/misc/osd/osd_menu.c | 2 +- modules/misc/quartztext.c | 2 +- modules/misc/rtsp.c | 22 +-- modules/misc/stats/vout.c | 2 +- modules/misc/svg.c | 4 +- modules/misc/win32text.c | 2 +- modules/packetizer/copy.c | 46 +++--- modules/packetizer/dirac.c | 2 +- modules/packetizer/h264.c | 4 +- modules/packetizer/mlp.c | 4 +- modules/packetizer/mpeg4audio.c | 4 +- modules/packetizer/mpeg4video.c | 4 +- modules/packetizer/mpegvideo.c | 4 +- modules/packetizer/vc1.c | 2 +- modules/video_chroma/grey_yuv.c | 8 +- modules/video_chroma/i420_rgb.c | 43 +++--- modules/video_chroma/i420_ymga.c | 7 +- modules/video_chroma/i420_yuy2.c | 18 +-- modules/video_chroma/i422_i420.c | 13 +- modules/video_chroma/i422_yuy2.c | 16 +-- modules/video_chroma/yuy2_i420.c | 13 +- modules/video_chroma/yuy2_i422.c | 13 +- modules/video_filter/alphamask.c | 4 +- modules/video_filter/atmo/atmo.cpp | 7 +- modules/video_filter/blend.c | 26 ++-- modules/video_filter/bluescreen.c | 4 +- modules/video_filter/chain.c | 8 +- modules/video_filter/crop.c | 35 ++--- modules/video_filter/deinterlace.c | 36 +++-- .../dynamicoverlay/dynamicoverlay.c | 2 +- .../dynamicoverlay/dynamicoverlay_commands.c | 4 +- modules/video_filter/erase.c | 17 ++- modules/video_filter/extract.c | 22 ++- modules/video_filter/filter_picture.h | 44 +++--- modules/video_filter/gaussianblur.c | 11 +- modules/video_filter/invert.c | 2 +- modules/video_filter/logo.c | 6 +- modules/video_filter/magnify.c | 2 +- modules/video_filter/marq.c | 2 +- modules/video_filter/mosaic.c | 8 +- modules/video_filter/motiondetect.c | 11 +- modules/video_filter/opencv_example.cpp | 2 +- modules/video_filter/opencv_wrapper.c | 8 +- modules/video_filter/osdmenu.c | 8 +- modules/video_filter/panoramix.c | 88 +++++------- modules/video_filter/postproc.c | 19 ++- modules/video_filter/remoteosd.c | 6 +- modules/video_filter/rss.c | 8 +- modules/video_filter/rv32.c | 6 +- modules/video_filter/scale.c | 16 +-- modules/video_filter/swscale.c | 22 +-- modules/video_filter/swscale_maemo.c | 5 +- modules/video_filter/transform.c | 6 +- modules/video_filter/yuvp.c | 12 +- modules/video_output/aa.c | 2 +- modules/video_output/caca.c | 2 +- modules/video_output/directfb.c | 8 +- modules/video_output/fb.c | 19 +-- modules/video_output/ggi.c | 10 +- modules/video_output/hd1000v.cpp | 12 +- modules/video_output/mga.c | 2 +- modules/video_output/msw/direct3d.c | 47 +++--- modules/video_output/msw/directx.c | 74 +++++----- modules/video_output/msw/wingdi.c | 10 +- modules/video_output/omapfb.c | 7 +- modules/video_output/opengl.c | 10 +- modules/video_output/opengllayer.m | 4 +- modules/video_output/qte/qte.cpp | 2 +- modules/video_output/sdl.c | 39 +++-- modules/video_output/snapshot.c | 13 +- modules/video_output/svgalib.c | 2 +- modules/video_output/vmem.c | 13 +- modules/video_output/x11/xcommon.c | 50 +++---- modules/video_output/xcb/x11.c | 12 +- modules/video_output/xcb/xvideo.c | 26 ++-- modules/video_output/yuv.c | 14 +- modules/visualization/galaktos/plugin.c | 7 +- modules/visualization/goom.c | 8 +- modules/visualization/visual/visual.c | 6 +- src/audio_output/common.c | 30 ++-- src/audio_output/output.c | 3 +- src/input/decoder.c | 4 +- src/input/es_out.c | 10 +- src/misc/es_format.c | 8 +- src/misc/image.c | 54 +++---- src/osd/osd_text.c | 2 +- src/osd/osd_widgets.c | 2 +- src/video_output/video_output.c | 8 +- src/video_output/video_text.c | 2 +- src/video_output/vout_intf.c | 4 +- src/video_output/vout_pictures.c | 135 ++++++++---------- src/video_output/vout_pictures.h | 84 ----------- src/video_output/vout_subpictures.c | 23 ++- 230 files changed, 1553 insertions(+), 1736 deletions(-) diff --git a/include/vlc_codecs.h b/include/vlc_codecs.h index c9ff3292d9..4236295469 100644 --- a/include/vlc_codecs.h +++ b/include/vlc_codecs.h @@ -24,6 +24,7 @@ #ifndef VLC_CODECS_H #define VLC_CODECS_H 1 +#include /** * \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" } }; diff --git a/include/vlc_es.h b/include/vlc_es.h index ecaa843f65..ad19c51350 100644 --- a/include/vlc_es.h +++ b/include/vlc_es.h @@ -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 diff --git a/include/vlc_fourcc.h b/include/vlc_fourcc.h index 6951228ed8..c041a8e6c9 100644 --- a/include/vlc_fourcc.h +++ b/include/vlc_fourcc.h @@ -157,6 +157,8 @@ #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 */ diff --git a/modules/access/dc1394.c b/modules/access/dc1394.c index 9fa05aa8f5..ab2cd1d424 100644 --- a/modules/access/dc1394.c +++ b/modules/access/dc1394.c @@ -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 * diff --git a/modules/access/dshow/dshow.cpp b/modules/access/dshow/dshow.cpp index 5dbce84fa6..729648aa58 100644 --- a/modules/access/dshow/dshow.cpp +++ b/modules/access/dshow/dshow.cpp @@ -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; diff --git a/modules/access/dshow/filter.cpp b/modules/access/dshow/filter.cpp index 456aa87597..8262e66ba4 100644 --- a/modules/access/dshow/filter.cpp +++ b/modules/access/dshow/filter.cpp @@ -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 ) diff --git a/modules/access/jack.c b/modules/access/jack.c index 8e05040d4a..ed87e881d3 100644 --- a/modules/access/jack.c +++ b/modules/access/jack.c @@ -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; diff --git a/modules/access/oss.c b/modules/access/oss.c index 7ea6527588..140b0f9e31 100644 --- a/modules/access/oss.c +++ b/modules/access/oss.c @@ -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; diff --git a/modules/access/qtcapture.m b/modules/access/qtcapture.m index 088378f749..cc8f05687c 100644 --- a/modules/access/qtcapture.m +++ b/modules/access/qtcapture.m @@ -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; diff --git a/modules/access/rtp/rtp.c b/modules/access/rtp/rtp.c index 1f8c6f6871..15075ad617 100644 --- a/modules/access/rtp/rtp.c +++ b/modules/access/rtp/rtp.c @@ -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); } diff --git a/modules/access/rtp/xiph.c b/modules/access/rtp/xiph.c index 7f6492e644..8a98bd624a 100644 --- a/modules/access/rtp/xiph.c +++ b/modules/access/rtp/xiph.c @@ -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); diff --git a/modules/access/screen/beos.cpp b/modules/access/screen/beos.cpp index 165250c9c3..5f70cdc66b 100644 --- a/modules/access/screen/beos.cpp +++ b/modules/access/screen/beos.cpp @@ -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: diff --git a/modules/access/screen/mac.c b/modules/access/screen/mac.c index 5b14fdd610..f469bac994 100644 --- a/modules/access/screen/mac.c +++ b/modules/access/screen/mac.c @@ -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; diff --git a/modules/access/screen/screen.c b/modules/access/screen/screen.c index e70b168e28..173823c433 100644 --- a/modules/access/screen/screen.c +++ b/modules/access/screen/screen.c @@ -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 = diff --git a/modules/access/screen/win32.c b/modules/access/screen/win32.c index e0cfd7abfb..01cac097c9 100644 --- a/modules/access/screen/win32.c +++ b/modules/access/screen/win32.c @@ -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; diff --git a/modules/access/screen/x11.c b/modules/access/screen/x11.c index 8723f15014..1cb4a55644 100644 --- a/modules/access/screen/x11.c +++ b/modules/access/screen/x11.c @@ -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: diff --git a/modules/access/v4l.c b/modules/access/v4l.c index 11261e7c30..197756cf37 100644 --- a/modules/access/v4l.c +++ b/modules/access/v4l.c @@ -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 */ diff --git a/modules/access/v4l2.c b/modules/access/v4l2.c index 0e9b5b6a9b..c6688d6b11 100644 --- a/modules/access/v4l2.c +++ b/modules/access/v4l2.c @@ -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 ) diff --git a/modules/audio_filter/channel_mixer/dolby.c b/modules/audio_filter/channel_mixer/dolby.c index 3b54cae2c2..5e3810b19a 100644 --- a/modules/audio_filter/channel_mixer/dolby.c +++ b/modules/audio_filter/channel_mixer/dolby.c @@ -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; } diff --git a/modules/audio_filter/channel_mixer/headphone.c b/modules/audio_filter/channel_mixer/headphone.c index 42d1bcdb47..c659cdf11d 100644 --- a/modules/audio_filter/channel_mixer/headphone.c +++ b/modules/audio_filter/channel_mixer/headphone.c @@ -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 ) { diff --git a/modules/audio_filter/channel_mixer/simple.c b/modules/audio_filter/channel_mixer/simple.c index 02def5eee4..40edd92d28 100644 --- a/modules/audio_filter/channel_mixer/simple.c +++ b/modules/audio_filter/channel_mixer/simple.c @@ -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; diff --git a/modules/audio_filter/channel_mixer/trivial.c b/modules/audio_filter/channel_mixer/trivial.c index ee393ed48d..42ac93e623 100644 --- a/modules/audio_filter/channel_mixer/trivial.c +++ b/modules/audio_filter/channel_mixer/trivial.c @@ -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; } diff --git a/modules/audio_filter/converter/a52tofloat32.c b/modules/audio_filter/converter/a52tofloat32.c index ad18a0ed90..083caf79a9 100644 --- a/modules/audio_filter/converter/a52tofloat32.c +++ b/modules/audio_filter/converter/a52tofloat32.c @@ -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 ); diff --git a/modules/audio_filter/converter/a52tospdif.c b/modules/audio_filter/converter/a52tospdif.c index f438551359..7bfc5809a2 100644 --- a/modules/audio_filter/converter/a52tospdif.c +++ b/modules/audio_filter/converter/a52tospdif.c @@ -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 */ diff --git a/modules/audio_filter/converter/dtstofloat32.c b/modules/audio_filter/converter/dtstofloat32.c index 0028e13cab..0d48406bd7 100644 --- a/modules/audio_filter/converter/dtstofloat32.c +++ b/modules/audio_filter/converter/dtstofloat32.c @@ -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 ); diff --git a/modules/audio_filter/converter/dtstospdif.c b/modules/audio_filter/converter/dtstospdif.c index d55446d11b..7ae39323ca 100644 --- a/modules/audio_filter/converter/dtstospdif.c +++ b/modules/audio_filter/converter/dtstospdif.c @@ -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. diff --git a/modules/audio_filter/converter/fixed.c b/modules/audio_filter/converter/fixed.c index 1282838fef..c4634b6051 100644 --- a/modules/audio_filter/converter/fixed.c +++ b/modules/audio_filter/converter/fixed.c @@ -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; } diff --git a/modules/audio_filter/converter/float.c b/modules/audio_filter/converter/float.c index 223aa1e3ad..1664a7a420 100644 --- a/modules/audio_filter/converter/float.c +++ b/modules/audio_filter/converter/float.c @@ -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; } diff --git a/modules/audio_filter/converter/mpgatofixed32.c b/modules/audio_filter/converter/mpgatofixed32.c index 357ccb8b6c..1bee61dc33 100644 --- a/modules/audio_filter/converter/mpgatofixed32.c +++ b/modules/audio_filter/converter/mpgatofixed32.c @@ -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 ); diff --git a/modules/audio_filter/equalizer.c b/modules/audio_filter/equalizer.c index 33b6469437..e10696f82a 100644 --- a/modules/audio_filter/equalizer.c +++ b/modules/audio_filter/equalizer.c @@ -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 ) ) diff --git a/modules/audio_filter/format.c b/modules/audio_filter/format.c index 0811231b10..242900b0e8 100644 --- a/modules/audio_filter/format.c +++ b/modules/audio_filter/format.c @@ -37,13 +37,13 @@ #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 }, }; diff --git a/modules/audio_filter/normvol.c b/modules/audio_filter/normvol.c index d0a2e351f3..7ec974e853 100644 --- a/modules/audio_filter/normvol.c +++ b/modules/audio_filter/normvol.c @@ -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" ); } diff --git a/modules/audio_filter/param_eq.c b/modules/audio_filter/param_eq.c index b20a84a6e5..fa8c19417a 100644 --- a/modules/audio_filter/param_eq.c +++ b/modules/audio_filter/param_eq.c @@ -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 ) ) diff --git a/modules/audio_filter/resampler/bandlimited.c b/modules/audio_filter/resampler/bandlimited.c index 9ec0714af3..485f320150 100644 --- a/modules/audio_filter/resampler/bandlimited.c +++ b/modules/audio_filter/resampler/bandlimited.c @@ -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; } diff --git a/modules/audio_filter/resampler/linear.c b/modules/audio_filter/resampler/linear.c index 161b754a0f..41be20b4e1 100644 --- a/modules/audio_filter/resampler/linear.c +++ b/modules/audio_filter/resampler/linear.c @@ -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; } diff --git a/modules/audio_filter/resampler/trivial.c b/modules/audio_filter/resampler/trivial.c index 75586041e7..16918681e1 100644 --- a/modules/audio_filter/resampler/trivial.c +++ b/modules/audio_filter/resampler/trivial.c @@ -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; } diff --git a/modules/audio_filter/resampler/ugly.c b/modules/audio_filter/resampler/ugly.c index 28e38e7f76..059d0074c0 100644 --- a/modules/audio_filter/resampler/ugly.c +++ b/modules/audio_filter/resampler/ugly.c @@ -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; } diff --git a/modules/audio_filter/scaletempo.c b/modules/audio_filter/scaletempo.c index a40435d45e..3137bf1cd7 100644 --- a/modules/audio_filter/scaletempo.c +++ b/modules/audio_filter/scaletempo.c @@ -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 ) ) diff --git a/modules/audio_filter/spatializer/spatializer.cpp b/modules/audio_filter/spatializer/spatializer.cpp index 5ed460b83a..34a6c45438 100644 --- a/modules/audio_filter/spatializer/spatializer.cpp +++ b/modules/audio_filter/spatializer/spatializer.cpp @@ -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 ) ) diff --git a/modules/audio_mixer/float32.c b/modules/audio_mixer/float32.c index e3f905464d..474dd520a6 100644 --- a/modules/audio_mixer/float32.c +++ b/modules/audio_mixer/float32.c @@ -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; } diff --git a/modules/audio_mixer/trivial.c b/modules/audio_mixer/trivial.c index 2512981ae5..3cdd04c16c 100644 --- a/modules/audio_mixer/trivial.c +++ b/modules/audio_mixer/trivial.c @@ -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; } diff --git a/modules/audio_output/alsa.c b/modules/audio_output/alsa.c index 2d03d1da27..03fd35bdbd 100644 --- a/modules/audio_output/alsa.c +++ b/modules/audio_output/alsa.c @@ -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 ) diff --git a/modules/audio_output/auhal.c b/modules/audio_output/auhal.c index 1effe5b26b..edb438cbd5 100644 --- a/modules/audio_output/auhal.c +++ b/modules/audio_output/auhal.c @@ -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; diff --git a/modules/audio_output/directx.c b/modules/audio_output/directx.c index c05d3cbdd0..98ce3147fd 100644 --- a/modules/audio_output/directx.c +++ b/modules/audio_output/directx.c @@ -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" ); diff --git a/modules/audio_output/file.c b/modules/audio_output/file.c index f6f851aa43..366fe825fa 100644 --- a/modules/audio_output/file.c +++ b/modules/audio_output/file.c @@ -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; diff --git a/modules/audio_output/jack.c b/modules/audio_output/jack.c index aeb203fc0a..db5d0445b4 100644 --- a/modules/audio_output/jack.c +++ b/modules/audio_output/jack.c @@ -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 ); diff --git a/modules/audio_output/oss.c b/modules/audio_output/oss.c index e6154656b8..3688e6ff39 100644 --- a/modules/audio_output/oss.c +++ b/modules/audio_output/oss.c @@ -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 ); diff --git a/modules/audio_output/portaudio.c b/modules/audio_output/portaudio.c index f73ce9bf7e..9611a22c80 100644 --- a/modules/audio_output/portaudio.c +++ b/modules/audio_output/portaudio.c @@ -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; diff --git a/modules/audio_output/pulse.c b/modules/audio_output/pulse.c index 86bd6dd4c7..bacd55ca23 100644 --- a/modules/audio_output/pulse.c +++ b/modules/audio_output/pulse.c @@ -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"); diff --git a/modules/audio_output/sdl.c b/modules/audio_output/sdl.c index 10d6eb7f72..f8425fadb9 100644 --- a/modules/audio_output/sdl.c +++ b/modules/audio_output/sdl.c @@ -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 ); diff --git a/modules/audio_output/waveout.c b/modules/audio_output/waveout.c index 8bea3e3495..27f2561f4b 100644 --- a/modules/audio_output/waveout.c +++ b/modules/audio_output/waveout.c @@ -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) ) diff --git a/modules/codec/a52.c b/modules/codec/a52.c index 474a1d0063..cafbb562e8 100644 --- a/modules/codec/a52.c +++ b/modules/codec/a52.c @@ -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; diff --git a/modules/codec/aes3.c b/modules/codec/aes3.c index 986fa787cd..5c278b15a2 100644 --- a/modules/codec/aes3.c +++ b/modules/codec/aes3.c @@ -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; } diff --git a/modules/codec/araw.c b/modules/codec/araw.c index 7a5ec825eb..f57cd225b1 100644 --- a/modules/codec/araw.c +++ b/modules/codec/araw.c @@ -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; diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c index cb89dd1922..bb680e3842 100644 --- a/modules/codec/avcodec/audio.c +++ b/modules/codec/avcodec/audio.c @@ -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; diff --git a/modules/codec/avcodec/chroma.c b/modules/codec/avcodec/chroma.c index 6913a427a6..6e13170a34 100644 --- a/modules/codec/avcodec/chroma.c +++ b/modules/codec/avcodec/chroma.c @@ -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 } diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c index 092090d731..389475573a 100644 --- a/modules/codec/avcodec/encoder.c +++ b/modules/codec/avcodec/encoder.c @@ -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; diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c index 1c2a2efc8e..951470bc8d 100644 --- a/modules/codec/avcodec/video.c +++ b/modules/codec/avcodec/video.c @@ -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; diff --git a/modules/codec/cc.c b/modules/codec/cc.c index 419d576626..bf312fd967 100644 --- a/modules/codec/cc.c +++ b/modules/codec/cc.c @@ -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; diff --git a/modules/codec/cdg.c b/modules/codec/cdg.c index c1a3e754a0..974021ea7d 100644 --- a/modules/codec/cdg.c +++ b/modules/codec/cdg.c @@ -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 = diff --git a/modules/codec/csri.c b/modules/codec/csri.c index 3802f4a332..d09e16a5c6 100644 --- a/modules/codec/csri.c +++ b/modules/codec/csri.c @@ -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; diff --git a/modules/codec/cvdsub.c b/modules/codec/cvdsub.c index dbd59164dc..4570710c58 100644 --- a/modules/codec/cvdsub.c +++ b/modules/codec/cvdsub.c @@ -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; diff --git a/modules/codec/dirac.c b/modules/codec/dirac.c index f397ba281a..7e11878783 100644 --- a/modules/codec/dirac.c +++ b/modules/codec/dirac.c @@ -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; diff --git a/modules/codec/dmo/dmo.c b/modules/codec/dmo/dmo.c index 0c10fba0a6..236015f86b 100644 --- a/modules/codec/dmo/dmo.c +++ b/modules/codec/dmo/dmo.c @@ -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 ) diff --git a/modules/codec/dts.c b/modules/codec/dts.c index 9b4ac47f8d..3a565bdcb6 100644 --- a/modules/codec/dts.c +++ b/modules/codec/dts.c @@ -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 */ diff --git a/modules/codec/dvbsub.c b/modules/codec/dvbsub.c index b102cd069c..f546e7182f 100644 --- a/modules/codec/dvbsub.c +++ b/modules/codec/dvbsub.c @@ -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; diff --git a/modules/codec/faad.c b/modules/codec/faad.c index e050a94bc0..1f4f079d7c 100644 --- a/modules/codec/faad.c +++ b/modules/codec/faad.c @@ -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; diff --git a/modules/codec/fake.c b/modules/codec/fake.c index 0696eb1b8d..b9787851c7 100644 --- a/modules/codec/fake.c +++ b/modules/codec/fake.c @@ -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 ); diff --git a/modules/codec/flac.c b/modules/codec/flac.c index be411d5489..b250cc3c3b 100644 --- a/modules/codec/flac.c +++ b/modules/codec/flac.c @@ -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; diff --git a/modules/codec/fluidsynth.c b/modules/codec/fluidsynth.c index f0ef618cf9..ae08aeff7c 100644 --- a/modules/codec/fluidsynth.c +++ b/modules/codec/fluidsynth.c @@ -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; diff --git a/modules/codec/invmem.c b/modules/codec/invmem.c index 396e80c58a..4a6ed8f7fc 100644 --- a/modules/codec/invmem.c +++ b/modules/codec/invmem.c @@ -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; diff --git a/modules/codec/kate.c b/modules/codec/kate.c index a6d8ef4156..146c40f0e1 100644 --- a/modules/codec/kate.c +++ b/modules/codec/kate.c @@ -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; diff --git a/modules/codec/libass.c b/modules/codec/libass.c index 70d9c52fc3..7ae8c53da1 100644 --- a/modules/codec/libass.c +++ b/modules/codec/libass.c @@ -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; diff --git a/modules/codec/libmpeg2.c b/modules/codec/libmpeg2.c index 5a2ef6fe79..7b6620d697 100644 --- a/modules/codec/libmpeg2.c +++ b/modules/codec/libmpeg2.c @@ -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 ); diff --git a/modules/codec/lpcm.c b/modules/codec/lpcm.c index 52adfc9a92..5af17ebc73 100644 --- a/modules/codec/lpcm.c +++ b/modules/codec/lpcm.c @@ -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; } diff --git a/modules/codec/mash.cpp b/modules/codec/mash.cpp index 88533cb479..ea97951555 100644 --- a/modules/codec/mash.cpp +++ b/modules/codec/mash.cpp @@ -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; diff --git a/modules/codec/mpeg_audio.c b/modules/codec/mpeg_audio.c index 306bf0737b..f025be51f9 100644 --- a/modules/codec/mpeg_audio.c +++ b/modules/codec/mpeg_audio.c @@ -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 */ diff --git a/modules/codec/png.c b/modules/codec/png.c index c604f014a1..4b48843523 100644 --- a/modules/codec/png.c +++ b/modules/codec/png.c @@ -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 */ diff --git a/modules/codec/quicktime.c b/modules/codec/quicktime.c index e5b5778160..f61c4ffa39 100644 --- a/modules/codec/quicktime.c +++ b/modules/codec/quicktime.c @@ -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; diff --git a/modules/codec/rawvideo.c b/modules/codec/rawvideo.c index e79e2edff1..a43b73ee12 100644 --- a/modules/codec/rawvideo.c +++ b/modules/codec/rawvideo.c @@ -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: diff --git a/modules/codec/realaudio.c b/modules/codec/realaudio.c index aa1d1334c3..af169aacab 100644 --- a/modules/codec/realaudio.c +++ b/modules/codec/realaudio.c @@ -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; diff --git a/modules/codec/realvideo.c b/modules/codec/realvideo.c index 23ea612ae5..c890681045 100644 --- a/modules/codec/realvideo.c +++ b/modules/codec/realvideo.c @@ -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); diff --git a/modules/codec/schroedinger.c b/modules/codec/schroedinger.c index 8b7abb5f37..bc08984c7f 100644 --- a/modules/codec/schroedinger.c +++ b/modules/codec/schroedinger.c @@ -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; diff --git a/modules/codec/sdl_image.c b/modules/codec/sdl_image.c index d4eb387ab1..1258238017 100644 --- a/modules/codec/sdl_image.c +++ b/modules/codec/sdl_image.c @@ -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)", diff --git a/modules/codec/speex.c b/modules/codec/speex.c index af1ea6bd1b..23b102b80f 100644 --- a/modules/codec/speex.c +++ b/modules/codec/speex.c @@ -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 ); diff --git a/modules/codec/spudec/parse.c b/modules/codec/spudec/parse.c index 84db8df8ac..0a572d9e74 100644 --- a/modules/codec/spudec/parse.c +++ b/modules/codec/spudec/parse.c @@ -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 - diff --git a/modules/codec/spudec/spudec.c b/modules/codec/spudec/spudec.c index f527a9c2b3..eb2d8e1314 100644 --- a/modules/codec/spudec/spudec.c +++ b/modules/codec/spudec/spudec.c @@ -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; } diff --git a/modules/codec/subtitles/subsdec.c b/modules/codec/subtitles/subsdec.c index 5bd43a51eb..5dbc847196 100644 --- a/modules/codec/subtitles/subsdec.c +++ b/modules/codec/subtitles/subsdec.c @@ -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; diff --git a/modules/codec/subtitles/subsusf.c b/modules/codec/subtitles/subsusf.c index 717f8da127..7333dac988 100644 --- a/modules/codec/subtitles/subsusf.c +++ b/modules/codec/subtitles/subsusf.c @@ -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++ ) diff --git a/modules/codec/subtitles/t140.c b/modules/codec/subtitles/t140.c index 5e0c25a0a8..3560c510df 100644 --- a/modules/codec/subtitles/t140.c +++ b/modules/codec/subtitles/t140.c @@ -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; diff --git a/modules/codec/svcdsub.c b/modules/codec/svcdsub.c index c6d9ee9229..0b20b73350 100644 --- a/modules/codec/svcdsub.c +++ b/modules/codec/svcdsub.c @@ -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 diff --git a/modules/codec/tarkin.c b/modules/codec/tarkin.c index 8c00db5763..20e5d94627 100644 --- a/modules/codec/tarkin.c +++ b/modules/codec/tarkin.c @@ -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; } diff --git a/modules/codec/telx.c b/modules/codec/telx.c index 07fd4cf883..9f2c263008 100644 --- a/modules/codec/telx.c +++ b/modules/codec/telx.c @@ -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; diff --git a/modules/codec/theora.c b/modules/codec/theora.c index 17bf9a7cf0..dda5000b3e 100644 --- a/modules/codec/theora.c +++ b/modules/codec/theora.c @@ -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 ); diff --git a/modules/codec/twolame.c b/modules/codec/twolame.c index 787cbf87fe..6f2caf4251 100644 --- a/modules/codec/twolame.c +++ b/modules/codec/twolame.c @@ -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 ); diff --git a/modules/codec/vorbis.c b/modules/codec/vorbis.c index 5d25be9d51..62cb4d2595 100644 --- a/modules/codec/vorbis.c +++ b/modules/codec/vorbis.c @@ -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 ); diff --git a/modules/codec/wmafixed/wma.c b/modules/codec/wmafixed/wma.c index e57b9cef57..ef6cdb9ec7 100644 --- a/modules/codec/wmafixed/wma.c +++ b/modules/codec/wmafixed/wma.c @@ -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; diff --git a/modules/codec/x264.c b/modules/codec/x264.c index 5004c2c724..2a82903f4f 100644 --- a/modules/codec/x264.c +++ b/modules/codec/x264.c @@ -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; diff --git a/modules/codec/xvmc/xxmc.c b/modules/codec/xvmc/xxmc.c index edfe1cc27b..7b8a87a16a 100644 --- a/modules/codec/xvmc/xxmc.c +++ b/modules/codec/xvmc/xxmc.c @@ -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"); diff --git a/modules/codec/zvbi.c b/modules/codec/zvbi.c index 8d5509a6b4..3563a66406 100644 --- a/modules/codec/zvbi.c +++ b/modules/codec/zvbi.c @@ -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++ ) diff --git a/modules/demux/asf/asf.c b/modules/demux/asf/asf.c index fb5de970c2..18c293d3ca 100644 --- a/modules/demux/asf/asf.c +++ b/modules/demux/asf/asf.c @@ -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] ); diff --git a/modules/demux/au.c b/modules/demux/au.c index 08f7e98641..bccf2ea6cf 100644 --- a/modules/demux/au.c +++ b/modules/demux/au.c @@ -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; diff --git a/modules/demux/cdg.c b/modules/demux/cdg.c index d9102884bc..4b6e59d440 100644 --- a/modules/demux/cdg.c +++ b/modules/demux/cdg.c @@ -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 ; diff --git a/modules/demux/dirac.c b/modules/demux/dirac.c index 84e6691383..4cfd537fdc 100644 --- a/modules/demux/dirac.c +++ b/modules/demux/dirac.c @@ -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 ) { diff --git a/modules/demux/flac.c b/modules/demux/flac.c index 17b45ff6cc..91a2cccb40 100644 --- a/modules/demux/flac.c +++ b/modules/demux/flac.c @@ -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; diff --git a/modules/demux/live555.cpp b/modules/demux/live555.cpp index 414c51fcda..cd9c4f751a 100644 --- a/modules/demux/live555.cpp +++ b/modules/demux/live555.cpp @@ -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 ) diff --git a/modules/demux/mjpeg.c b/modules/demux/mjpeg.c index 69d54db80d..406ac6e7a3 100644 --- a/modules/demux/mjpeg.c +++ b/modules/demux/mjpeg.c @@ -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; diff --git a/modules/demux/mkv/matroska_segment.cpp b/modules/demux/mkv/matroska_segment.cpp index 26d43b4bdc..5ec05d5243 100644 --- a/modules/demux/mkv/matroska_segment.cpp +++ b/modules/demux/mkv/matroska_segment.cpp @@ -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; diff --git a/modules/demux/mpc.c b/modules/demux/mpc.c index b02e4cdf51..a1aff2d97c 100644 --- a/modules/demux/mpc.c +++ b/modules/demux/mpc.c @@ -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; diff --git a/modules/demux/mpeg/es.c b/modules/demux/mpeg/es.c index abe04dcbc5..3a23281fd6 100644 --- a/modules/demux/mpeg/es.c +++ b/modules/demux/mpeg/es.c @@ -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 } }; diff --git a/modules/demux/mpeg/h264.c b/modules/demux/mpeg/h264.c index 5f6071c482..1bcf6f06c8 100644 --- a/modules/demux/mpeg/h264.c +++ b/modules/demux/mpeg/h264.c @@ -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 ) { diff --git a/modules/demux/mpeg/mpgv.c b/modules/demux/mpeg/mpgv.c index 946739aa3c..e9cbd8e356 100644 --- a/modules/demux/mpeg/mpgv.c +++ b/modules/demux/mpeg/mpgv.c @@ -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; diff --git a/modules/demux/nuv.c b/modules/demux/nuv.c index c6a87b45ac..99cad8397b 100644 --- a/modules/demux/nuv.c +++ b/modules/demux/nuv.c @@ -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; diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c index 2580c6aba6..5e50b7a552 100644 --- a/modules/demux/ogg.c +++ b/modules/demux/ogg.c @@ -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 @@ -1642,7 +1642,7 @@ static void Ogg_ReadVorbisHeader( logical_stream_t *p_stream, oggpack_buffer opb; p_stream->fmt.i_cat = AUDIO_ES; - p_stream->fmt.i_codec = VLC_FOURCC( 'v','o','r','b' ); + p_stream->fmt.i_codec = VLC_CODEC_VORBIS; /* Signal that we want to keep a backup of the vorbis * stream headers. They will be used when switching between @@ -1665,7 +1665,7 @@ static void Ogg_ReadSpeexHeader( logical_stream_t *p_stream, oggpack_buffer opb; p_stream->fmt.i_cat = AUDIO_ES; - p_stream->fmt.i_codec = VLC_FOURCC( 's','p','x',' ' ); + p_stream->fmt.i_codec = VLC_CODEC_SPEEX; /* Signal that we want to keep a backup of the speex * stream headers. They will be used when switching between @@ -1729,7 +1729,7 @@ static void Ogg_ReadKateHeader( logical_stream_t *p_stream, char *psz_desc; p_stream->fmt.i_cat = SPU_ES; - p_stream->fmt.i_codec = VLC_FOURCC( 'k','a','t','e' ); + p_stream->fmt.i_codec = VLC_CODEC_KATE; /* Signal that we want to keep a backup of the kate * stream headers. They will be used when switching between @@ -1848,21 +1848,21 @@ static void Ogg_ReadAnnodexHeader( vlc_object_t *p_this, else if( !strncmp(content_type_string, "audio/x-vorbis", 14) ) { p_stream->fmt.i_cat = AUDIO_ES; - p_stream->fmt.i_codec = VLC_FOURCC( 'v','o','r','b' ); + p_stream->fmt.i_codec = VLC_CODEC_VORBIS; p_stream->b_force_backup = 1; } else if( !strncmp(content_type_string, "audio/x-speex", 14) ) { p_stream->fmt.i_cat = AUDIO_ES; - p_stream->fmt.i_codec = VLC_FOURCC( 's','p','x',' ' ); + p_stream->fmt.i_codec = VLC_CODEC_SPEEX; p_stream->b_force_backup = 1; } else if( !strncmp(content_type_string, "video/x-theora", 14) ) { 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; p_stream->b_force_backup = 1; } @@ -1877,13 +1877,13 @@ static void Ogg_ReadAnnodexHeader( vlc_object_t *p_this, { /* n.b. MPEG streams are unsupported right now */ p_stream->fmt.i_cat = VIDEO_ES; - p_stream->fmt.i_codec = VLC_FOURCC( 'm','p','g','v' ); + p_stream->fmt.i_codec = VLC_CODEC_MPGV; } else if( !strncmp(content_type_string, "text/x-cmml", 11) ) { ogg_stream_packetout( &p_stream->os, p_oggpacket ); p_stream->fmt.i_cat = SPU_ES; - p_stream->fmt.i_codec = VLC_FOURCC( 'c','m','m','l' ); + p_stream->fmt.i_codec = VLC_CODEC_CMML; } } } @@ -1985,7 +1985,7 @@ static bool Ogg_ReadDiracHeader( logical_stream_t *p_stream, /* probably is an ogg dirac es */ p_stream->fmt.i_cat = VIDEO_ES; - p_stream->fmt.i_codec = VLC_FOURCC( 'd','r','a','c' ); + p_stream->fmt.i_codec = VLC_CODEC_DIRAC; return true; } diff --git a/modules/demux/ps.c b/modules/demux/ps.c index aad1e52971..66b289219b 100644 --- a/modules/demux/ps.c +++ b/modules/demux/ps.c @@ -388,7 +388,7 @@ static int Demux( demux_t *p_demux ) if( tk->b_seen && tk->es && ( #ifdef ZVBI_COMPILED /* FIXME!! */ - tk->fmt.i_codec == VLC_FOURCC('t','e','l','x') || + tk->fmt.i_codec == VLC_CODEC_TELETEXT || #endif !ps_pkt_parse_pes( p_pkt, tk->i_skip ) ) ) { diff --git a/modules/demux/ps.h b/modules/demux/ps.h index fed3ab0ac9..d0b4cc4a02 100644 --- a/modules/demux/ps.h +++ b/modules/demux/ps.h @@ -70,28 +70,28 @@ static inline int ps_track_fill( ps_track_t *tk, ps_psm_t *p_psm, int i_id ) { if( ( i_id&0xf8 ) == 0x88 || (i_id&0xf8) == 0x98 ) { - es_format_Init( &tk->fmt, AUDIO_ES, VLC_FOURCC('d','t','s',' ') ); + es_format_Init( &tk->fmt, AUDIO_ES, VLC_CODEC_DTS ); tk->i_skip = 4; } else if( ( i_id&0xf0 ) == 0x80 || (i_id&0xf0) == 0xc0 ) /* AC-3, Can also be used for DD+/E-AC-3 */ { - es_format_Init( &tk->fmt, AUDIO_ES, VLC_FOURCC('a','5','2',' ') ); + es_format_Init( &tk->fmt, AUDIO_ES, VLC_CODEC_A52 ); tk->i_skip = 4; } else if( (i_id&0xf0) == 0xb0 ) { - es_format_Init( &tk->fmt, AUDIO_ES, VLC_FOURCC('m','l','p',' ') ); + es_format_Init( &tk->fmt, AUDIO_ES, VLC_CODEC_MLP ); /* FIXME / untested ... no known decoder (at least not in VLC/ffmpeg) */ } else if( ( i_id&0xe0 ) == 0x20 ) { - es_format_Init( &tk->fmt, SPU_ES, VLC_FOURCC('s','p','u',' ') ); + es_format_Init( &tk->fmt, SPU_ES, VLC_CODEC_SPU ); tk->i_skip = 1; } else if( ( i_id&0xf0 ) == 0xa0 ) { - es_format_Init( &tk->fmt, AUDIO_ES, VLC_FOURCC('l','p','c','m') ); + es_format_Init( &tk->fmt, AUDIO_ES, VLC_CODEC_DVD_LPCM ); tk->i_skip = 1; } else if( ( i_id&0xff ) == 0x70 ) @@ -104,7 +104,7 @@ static inline int ps_track_fill( ps_track_t *tk, ps_psm_t *p_psm, int i_id ) } else if( ( i_id&0xff ) == 0x10 ) { - es_format_Init( &tk->fmt, SPU_ES, VLC_FOURCC('t','e','l','x') ); + es_format_Init( &tk->fmt, SPU_ES, VLC_CODEC_TELETEXT ); } else { @@ -117,7 +117,7 @@ static inline int ps_track_fill( ps_track_t *tk, ps_psm_t *p_psm, int i_id ) uint8_t i_sub_id = i_id & 0xff; if( i_sub_id >= 0x55 && i_sub_id <= 0x5f ) { - es_format_Init( &tk->fmt, VIDEO_ES, VLC_FOURCC('W','V','C','1') ); + es_format_Init( &tk->fmt, VIDEO_ES, VLC_CODEC_VC1 ); } else { @@ -133,36 +133,36 @@ static inline int ps_track_fill( ps_track_t *tk, ps_psm_t *p_psm, int i_id ) if( (i_id&0xf0) == 0xe0 && i_type == 0x1b ) { - es_format_Init( &tk->fmt, VIDEO_ES, VLC_FOURCC('h','2','6','4') ); + es_format_Init( &tk->fmt, VIDEO_ES, VLC_CODEC_H264 ); } else if( (i_id&0xf0) == 0xe0 && i_type == 0x10 ) { - es_format_Init( &tk->fmt, VIDEO_ES, VLC_FOURCC('m','p','4','v') ); + es_format_Init( &tk->fmt, VIDEO_ES, VLC_CODEC_MP4V ); } else if( (i_id&0xf0) == 0xe0 && i_type == 0x02 ) { - es_format_Init( &tk->fmt, VIDEO_ES, VLC_FOURCC('m','p','g','v') ); + es_format_Init( &tk->fmt, VIDEO_ES, VLC_CODEC_MPGV ); } else if( ( i_id&0xe0 ) == 0xc0 && i_type == 0x0f ) { - es_format_Init( &tk->fmt, AUDIO_ES, VLC_FOURCC('m','p','4','a') ); + es_format_Init( &tk->fmt, AUDIO_ES, VLC_CODEC_MP4A ); } else if( ( i_id&0xe0 ) == 0xc0 && i_type == 0x11 ) { - es_format_Init( &tk->fmt, AUDIO_ES, VLC_FOURCC('m','p','4','a') ); + es_format_Init( &tk->fmt, AUDIO_ES, VLC_CODEC_MP4A ); } else if( ( i_id&0xe0 ) == 0xc0 && i_type == 0x03 ) { - es_format_Init( &tk->fmt, AUDIO_ES, VLC_FOURCC('m','p','g','a') ); + es_format_Init( &tk->fmt, AUDIO_ES, VLC_CODEC_MPGA ); } if( tk->fmt.i_cat == UNKNOWN_ES && ( i_id&0xf0 ) == 0xe0 ) { - es_format_Init( &tk->fmt, VIDEO_ES, VLC_FOURCC('m','p','g','v') ); + es_format_Init( &tk->fmt, VIDEO_ES, VLC_CODEC_MPGV ); } else if( tk->fmt.i_cat == UNKNOWN_ES && ( i_id&0xe0 ) == 0xc0 ) { - es_format_Init( &tk->fmt, AUDIO_ES, VLC_FOURCC('m','p','g','a') ); + es_format_Init( &tk->fmt, AUDIO_ES, VLC_CODEC_MPGA ); } else if( tk->fmt.i_cat == UNKNOWN_ES ) return VLC_EGENERIC; } diff --git a/modules/demux/pva.c b/modules/demux/pva.c index 68093d98df..d5ceafb6b9 100644 --- a/modules/demux/pva.c +++ b/modules/demux/pva.c @@ -98,10 +98,10 @@ static int Open( vlc_object_t *p_this ) p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) ); /* Register one audio and one video stream */ - es_format_Init( &fmt, AUDIO_ES, VLC_FOURCC( 'm', 'p', 'g', 'a' ) ); + es_format_Init( &fmt, AUDIO_ES, VLC_CODEC_MPGA ); p_sys->p_audio = es_out_Add( p_demux->out, &fmt ); - es_format_Init( &fmt, VIDEO_ES, VLC_FOURCC( 'm', 'p', 'g', 'v' ) ); + es_format_Init( &fmt, VIDEO_ES, VLC_CODEC_MPGV ); p_sys->p_video = es_out_Add( p_demux->out, &fmt ); p_sys->i_vc = -1; diff --git a/modules/demux/rawdv.c b/modules/demux/rawdv.c index 611be06aec..527056d7da 100644 --- a/modules/demux/rawdv.c +++ b/modules/demux/rawdv.c @@ -222,7 +222,7 @@ static int Open( vlc_object_t * p_this ) p_sys->i_bitrate = 0; - es_format_Init( &p_sys->fmt_video, VIDEO_ES, VLC_FOURCC('d','v','s','d') ); + es_format_Init( &p_sys->fmt_video, VIDEO_ES, VLC_CODEC_DV ); p_sys->fmt_video.video.i_width = 720; p_sys->fmt_video.video.i_height= dv_header.dsf ? 576 : 480;; @@ -239,9 +239,10 @@ static int Open( vlc_object_t * p_this ) p_peek = p_peek_backup + 80*6+80*16*3 + 3; /* beginning of AAUX pack */ if( *p_peek == 0x50 ) { - es_format_Init( &p_sys->fmt_audio, AUDIO_ES, - VLC_FOURCC('a','r','a','w') ); + /* 12 bits non-linear will be converted to 16 bits linear */ + es_format_Init( &p_sys->fmt_audio, AUDIO_ES, VLC_CODEC_S16L ); + p_sys->fmt_audio.audio.i_bitspersample = 16; p_sys->fmt_audio.audio.i_channels = 2; switch( (p_peek[4] >> 3) & 0x07 ) { @@ -257,9 +258,6 @@ static int Open( vlc_object_t * p_this ) break; } - /* 12 bits non-linear will be converted to 16 bits linear */ - p_sys->fmt_audio.audio.i_bitspersample = 16; - p_sys->p_es_audio = es_out_Add( p_demux->out, &p_sys->fmt_audio ); } diff --git a/modules/demux/rawvid.c b/modules/demux/rawvid.c index 22ded17b8e..8a127275a0 100644 --- a/modules/demux/rawvid.c +++ b/modules/demux/rawvid.c @@ -113,12 +113,12 @@ struct preset_t static const struct preset_t p_presets[] = { - { "sqcif", 128, 96, 30000, 1001, 4,3, VLC_FOURCC('Y','V','1','2') }, - { "qcif", 176, 144, 30000, 1001, 4,3, VLC_FOURCC('Y','V','1','2') }, - { "cif", 352, 288, 30000, 1001, 4,3, VLC_FOURCC('Y','V','1','2') }, - { "4cif", 704, 576, 30000, 1001, 4,3, VLC_FOURCC('Y','V','1','2') }, - { "16cif", 1408, 1152, 30000, 1001, 4,3, VLC_FOURCC('Y','V','1','2') }, - { "yuv", 176, 144, 25, 1, 4,3, VLC_FOURCC('Y','V','1','2') }, + { "sqcif", 128, 96, 30000, 1001, 4,3, VLC_CODEC_YV12 }, + { "qcif", 176, 144, 30000, 1001, 4,3, VLC_CODEC_YV12 }, + { "cif", 352, 288, 30000, 1001, 4,3, VLC_CODEC_YV12 }, + { "4cif", 704, 576, 30000, 1001, 4,3, VLC_CODEC_YV12 }, + { "16cif", 1408, 1152, 30000, 1001, 4,3, VLC_CODEC_YV12 }, + { "yuv", 176, 144, 25, 1, 4,3, VLC_CODEC_YV12 }, { NULL, 0, 0, 0, 0, 0,0, 0 } }; @@ -238,12 +238,12 @@ static int Open( vlc_object_t * p_this ) { static const struct { const char *psz_name; vlc_fourcc_t i_fcc; } formats[] = { - { "420jpeg", VLC_FOURCC('I','4','2','0') }, - { "420paldv", VLC_FOURCC('I','4','2','0') }, - { "420", VLC_FOURCC('I','4','2','0') }, - { "422", VLC_FOURCC('I','4','2','2') }, - { "444", VLC_FOURCC('I','4','4','4') }, - { "mono", VLC_FOURCC('G','R','E','Y') }, + { "420jpeg", VLC_CODEC_I420 }, + { "420paldv", VLC_CODEC_I420 }, + { "420", VLC_CODEC_I420 }, + { "422", VLC_CODEC_I422 }, + { "444", VLC_CODEC_I444 }, + { "mono", VLC_CODEC_GREY }, { NULL, 0 } }; bool b_found = false; diff --git a/modules/demux/smf.c b/modules/demux/smf.c index ec02487ead..2f8e93aaf9 100644 --- a/modules/demux/smf.c +++ b/modules/demux/smf.c @@ -230,7 +230,7 @@ static int Open (vlc_object_t * p_this) } es_format_t fmt; - es_format_Init (&fmt, AUDIO_ES, VLC_FOURCC('M', 'I', 'D', 'I')); + es_format_Init (&fmt, AUDIO_ES, VLC_CODEC_MIDI); fmt.audio.i_channels = 2; fmt.audio.i_original_channels = fmt.audio.i_physical_channels = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT; diff --git a/modules/demux/subtitle.c b/modules/demux/subtitle.c index 426659c924..4faaa9cdcc 100644 --- a/modules/demux/subtitle.c +++ b/modules/demux/subtitle.c @@ -518,11 +518,11 @@ static int Open ( vlc_object_t *p_this ) p_sys->i_type == SUB_TYPE_SSA2_4 || p_sys->i_type == SUB_TYPE_ASS ) { - es_format_Init( &fmt, SPU_ES, VLC_FOURCC( 's','s','a',' ' ) ); + es_format_Init( &fmt, SPU_ES, VLC_CODEC_SSA ); } else { - es_format_Init( &fmt, SPU_ES, VLC_FOURCC( 's','u','b','t' ) ); + es_format_Init( &fmt, SPU_ES, VLC_CODEC_SUBT ); } if( p_sys->psz_header != NULL ) { diff --git a/modules/demux/subtitle_asa.c b/modules/demux/subtitle_asa.c index 7a654f302a..4882206a3c 100644 --- a/modules/demux/subtitle_asa.c +++ b/modules/demux/subtitle_asa.c @@ -252,11 +252,11 @@ static int Open ( vlc_object_t *p_this ) /* *** add subtitle ES *** */ if( p_detect->fmt->target == ASAI_TARGET_SSA ) { - es_format_Init( &fmt, SPU_ES, VLC_FOURCC( 's','s','a',' ' ) ); + es_format_Init( &fmt, SPU_ES, VLC_CODEC_SSA ); } else { - es_format_Init( &fmt, SPU_ES, VLC_FOURCC( 's','u','b','t' ) ); + es_format_Init( &fmt, SPU_ES, VLC_CODEC_SUBT ); } p_sys->es = es_out_Add( p_demux->out, &fmt ); diff --git a/modules/demux/ts.c b/modules/demux/ts.c index 5493c47ef8..18fe5e460b 100644 --- a/modules/demux/ts.c +++ b/modules/demux/ts.c @@ -1737,7 +1737,7 @@ static void ParsePES( demux_t *p_demux, ts_pid_t *pid ) { i_skip += 1; } - else if( pid->es->fmt.i_codec == VLC_FOURCC( 's', 'u', 'b', 't' ) && + else if( pid->es->fmt.i_codec == VLC_CODEC_SUBT && pid->es->p_mpeg4desc ) { decoder_config_descriptor_t *dcd = &pid->es->p_mpeg4desc->dec_descr; @@ -1762,7 +1762,7 @@ static void ParsePES( demux_t *p_demux, ts_pid_t *pid ) i_skip += 2; } #ifdef ZVBI_COMPILED - else if( pid->es->fmt.i_codec == VLC_FOURCC( 't', 'e', 'l', 'x' ) ) + else if( pid->es->fmt.i_codec == VLC_CODEC_TELETEXT ) i_skip = 0; /*hack for zvbi support */ #endif /* skip header */ @@ -1804,7 +1804,7 @@ static void ParsePES( demux_t *p_demux, ts_pid_t *pid ) p_pes->i_length = i_length * 100 / 9; p_block = block_ChainGather( p_pes ); - if( pid->es->fmt.i_codec == VLC_FOURCC( 's', 'u', 'b', 't' ) ) + if( pid->es->fmt.i_codec == VLC_CODEC_SUBT ) { if( i_pes_size > 0 && p_block->i_buffer > i_pes_size ) { @@ -2048,38 +2048,38 @@ static int PIDFillFormat( ts_pid_t *pid, int i_stream_type ) case 0x01: /* MPEG-1 video */ case 0x02: /* MPEG-2 video */ case 0x80: /* MPEG-2 MOTO video */ - es_format_Init( fmt, VIDEO_ES, VLC_FOURCC( 'm', 'p', 'g', 'v' ) ); + es_format_Init( fmt, VIDEO_ES, VLC_CODEC_MPGV ); break; case 0x03: /* MPEG-1 audio */ case 0x04: /* MPEG-2 audio */ - es_format_Init( fmt, AUDIO_ES, VLC_FOURCC( 'm', 'p', 'g', 'a' ) ); + es_format_Init( fmt, AUDIO_ES, VLC_CODEC_MPGA ); break; case 0x11: /* MPEG4 (audio) */ case 0x0f: /* ISO/IEC 13818-7 Audio with ADTS transport syntax */ - es_format_Init( fmt, AUDIO_ES, VLC_FOURCC( 'm', 'p', '4', 'a' ) ); + es_format_Init( fmt, AUDIO_ES, VLC_CODEC_MP4A ); break; case 0x10: /* MPEG4 (video) */ - es_format_Init( fmt, VIDEO_ES, VLC_FOURCC( 'm', 'p', '4', 'v' ) ); + es_format_Init( fmt, VIDEO_ES, VLC_CODEC_MP4V ); pid->es->b_gather = true; break; case 0x1B: /* H264 <- check transport syntax/needed descriptor */ - es_format_Init( fmt, VIDEO_ES, VLC_FOURCC( 'h', '2', '6', '4' ) ); + es_format_Init( fmt, VIDEO_ES, VLC_CODEC_H264 ); break; case 0x81: /* A52 (audio) */ - es_format_Init( fmt, AUDIO_ES, VLC_FOURCC( 'a', '5', '2', ' ' ) ); + es_format_Init( fmt, AUDIO_ES, VLC_CODEC_A52 ); break; case 0x82: /* DVD_SPU (sub) */ - es_format_Init( fmt, SPU_ES, VLC_FOURCC( 's', 'p', 'u', ' ' ) ); + es_format_Init( fmt, SPU_ES, VLC_CODEC_SPU ); break; case 0x83: /* LPCM (audio) */ - es_format_Init( fmt, AUDIO_ES, VLC_FOURCC( 'l', 'p', 'c', 'm' ) ); + es_format_Init( fmt, AUDIO_ES, VLC_CODEC_DVD_LPCM ); break; case 0x84: /* SDDS (audio) */ - es_format_Init( fmt, AUDIO_ES, VLC_FOURCC( 's', 'd', 'd', 's' ) ); + es_format_Init( fmt, AUDIO_ES, VLC_CODEC_SDDS ); break; case 0x85: /* DTS (audio) */ - es_format_Init( fmt, AUDIO_ES, VLC_FOURCC( 'd', 't', 's', ' ' ) ); + es_format_Init( fmt, AUDIO_ES, VLC_CODEC_DTS ); break; case 0x91: /* A52 vls (audio) */ @@ -3103,14 +3103,14 @@ static void PMTSetupEsISO14496( demux_t *p_demux, ts_pid_t *pid, { case 0x0B: /* mpeg4 sub */ p_fmt->i_cat = SPU_ES; - p_fmt->i_codec = VLC_FOURCC('s','u','b','t'); + p_fmt->i_codec = VLC_CODEC_SUBT; break; case 0x20: /* mpeg4 */ - p_fmt->i_codec = VLC_FOURCC('m','p','4','v'); + p_fmt->i_codec = VLC_CODEC_MP4V; break; case 0x21: /* h264 */ - p_fmt->i_codec = VLC_FOURCC('h','2','6','4'); + p_fmt->i_codec = VLC_CODEC_H264; break; case 0x60: case 0x61: @@ -3118,13 +3118,13 @@ static void PMTSetupEsISO14496( demux_t *p_demux, ts_pid_t *pid, case 0x63: case 0x64: case 0x65: /* mpeg2 */ - p_fmt->i_codec = VLC_FOURCC( 'm','p','g','v' ); + p_fmt->i_codec = VLC_CODEC_MPGV; break; case 0x6a: /* mpeg1 */ - p_fmt->i_codec = VLC_FOURCC( 'm','p','g','v' ); + p_fmt->i_codec = VLC_CODEC_MPGV; break; case 0x6c: /* mpeg1 */ - p_fmt->i_codec = VLC_FOURCC( 'j','p','e','g' ); + p_fmt->i_codec = VLC_CODEC_JPEG; break; default: p_fmt->i_cat = UNKNOWN_ES; @@ -3137,18 +3137,18 @@ static void PMTSetupEsISO14496( demux_t *p_demux, ts_pid_t *pid, switch( dcd->i_objectTypeIndication ) { case 0x40: /* mpeg4 */ - p_fmt->i_codec = VLC_FOURCC('m','p','4','a'); + p_fmt->i_codec = VLC_CODEC_MP4A; break; case 0x66: case 0x67: case 0x68: /* mpeg2 aac */ - p_fmt->i_codec = VLC_FOURCC('m','p','4','a'); + p_fmt->i_codec = VLC_CODEC_MP4A; break; case 0x69: /* mpeg2 */ - p_fmt->i_codec = VLC_FOURCC('m','p','g','a'); + p_fmt->i_codec = VLC_CODEC_MPGA; break; case 0x6b: /* mpeg1 */ - p_fmt->i_codec = VLC_FOURCC('m','p','g','a'); + p_fmt->i_codec = VLC_CODEC_MPGA; break; default: p_fmt->i_cat = UNKNOWN_ES; @@ -3258,7 +3258,7 @@ static void PMTSetupEsTeletext( demux_t *p_demux, ts_pid_t *pid, #endif /* */ - es_format_Init( p_fmt, SPU_ES, VLC_FOURCC( 't', 'e', 'l', 'x' ) ); + es_format_Init( p_fmt, SPU_ES, VLC_CODEC_TELETEXT ); /* In stream output mode, do not separate the stream by page */ if( p_demux->out->b_sout || i_page <= 0 ) @@ -3337,7 +3337,7 @@ static void PMTSetupEsDvbSubtitle( demux_t *p_demux, ts_pid_t *pid, { es_format_t *p_fmt = &pid->es->fmt; - es_format_Init( p_fmt, SPU_ES, VLC_FOURCC( 'd', 'v', 'b', 's' ) ); + es_format_Init( p_fmt, SPU_ES, VLC_CODEC_DVBS ); dvbpsi_descriptor_t *p_dr = PMTEsFindDescriptor( p_es, 0x59 ); int i_page = 0; @@ -3442,13 +3442,13 @@ static void PMTSetupEs0x06( demux_t *p_demux, ts_pid_t *pid, PMTEsFindDescriptor( p_es, 0x81 ) ) { p_fmt->i_cat = AUDIO_ES; - p_fmt->i_codec = VLC_FOURCC('a','5','2',' '); + p_fmt->i_codec = VLC_CODEC_A52; } else if( PMTEsFindDescriptor( p_es, 0x7a ) ) { /* DVB with stream_type 0x06 (ETS EN 300 468) */ p_fmt->i_cat = AUDIO_ES; - p_fmt->i_codec = VLC_FOURCC( 'e', 'a', 'c', '3' ); + p_fmt->i_codec = VLC_CODEC_EAC3; } else if( PMTEsHasRegistration( p_demux, p_es, "DTS1" ) || PMTEsHasRegistration( p_demux, p_es, "DTS2" ) || @@ -3457,7 +3457,7 @@ static void PMTSetupEs0x06( demux_t *p_demux, ts_pid_t *pid, { /*registration descriptor(ETSI TS 101 154 Annex F)*/ p_fmt->i_cat = AUDIO_ES; - p_fmt->i_codec = VLC_FOURCC('d','t','s',' '); + p_fmt->i_codec = VLC_CODEC_DTS; } else if( PMTEsHasRegistration( p_demux, p_es, "BSSD" ) ) { @@ -3542,7 +3542,7 @@ static void PMTSetupEs0xEA( demux_t *p_demux, ts_pid_t *pid, /* registration descriptor for VC-1 (SMPTE rp227) */ p_fmt->i_cat = VIDEO_ES; - p_fmt->i_codec = VLC_FOURCC('W','V','C','1'); + p_fmt->i_codec = VLC_CODEC_VC1; /* XXX With Simple and Main profile the SEQUENCE * header is modified: video width and height are @@ -3565,7 +3565,7 @@ static void PMTSetupEs0xD1( demux_t *p_demux, ts_pid_t *pid, /* registration descriptor for Dirac * (backwards compatable with VC-2 (SMPTE Sxxxx:2008)) */ p_fmt->i_cat = VIDEO_ES; - p_fmt->i_codec = VLC_FOURCC('d','r','a','c'); + p_fmt->i_codec = VLC_CODEC_DIRAC; } static void PMTSetupEs0xA0( demux_t *p_demux, ts_pid_t *pid, @@ -3613,26 +3613,26 @@ static void PMTSetupEsHDMV( demux_t *p_demux, ts_pid_t *pid, { case 0x80: p_fmt->i_cat = AUDIO_ES; - p_fmt->i_codec = VLC_FOURCC( 'b', 'p', 'c', 'm' ); + p_fmt->i_codec = VLC_CODEC_BD_LPCM; break; case 0x82: case 0x85: /* DTS-HD High resolution audio */ case 0x86: /* DTS-HD Master audio */ case 0xA2: /* Secondary DTS audio */ p_fmt->i_cat = AUDIO_ES; - p_fmt->i_codec = VLC_FOURCC( 'd', 't', 's', ' ' ); + p_fmt->i_codec = VLC_CODEC_DTS; break; case 0x83: /* TrueHD AC3 */ p_fmt->i_cat = AUDIO_ES; - p_fmt->i_codec = VLC_FOURCC( 'm', 'l', 'p', ' ' ); + p_fmt->i_codec = VLC_CODEC_MLP; break; case 0x84: /* E-AC3 */ case 0x87: /* E-AC3 */ case 0xA1: /* Secondary E-AC3 */ p_fmt->i_cat = AUDIO_ES; - p_fmt->i_codec = VLC_FOURCC( 'e', 'a', 'c', '3' ); + p_fmt->i_codec = VLC_CODEC_EAC3; break; case 0x90: /* Presentation graphics */ case 0x91: /* Interactive graphics */ @@ -3934,8 +3934,8 @@ static void PMTCallBack( demux_t *p_demux, dvbpsi_pmt_t *p_pmt ) if( pid->es->fmt.i_cat == AUDIO_ES || ( pid->es->fmt.i_cat == SPU_ES && - pid->es->fmt.i_codec != VLC_FOURCC('d','v','b','s') && - pid->es->fmt.i_codec != VLC_FOURCC('t','e','l','x') ) ) + pid->es->fmt.i_codec != VLC_CODEC_DVBS && + pid->es->fmt.i_codec != VLC_CODEC_TELETEXT ) ) { PMTParseEsIso639( p_demux, pid, p_es ); } diff --git a/modules/demux/tta.c b/modules/demux/tta.c index 0922f38953..dd32597172 100644 --- a/modules/demux/tta.c +++ b/modules/demux/tta.c @@ -117,7 +117,7 @@ static int Open( vlc_object_t * p_this ) p_sys->pi_seektable = NULL; /* Read the metadata */ - es_format_Init( &fmt, AUDIO_ES, VLC_FOURCC( 'T', 'T', 'A', '1' ) ); + es_format_Init( &fmt, AUDIO_ES, VLC_CODEC_TTA ); fmt.audio.i_channels = GetWLE( &p_header[6] ); fmt.audio.i_bitspersample = GetWLE( &p_header[8] ); fmt.audio.i_rate = GetDWLE( &p_header[10] ); diff --git a/modules/demux/ty.c b/modules/demux/ty.c index 63d8402dc9..0c93a351e8 100644 --- a/modules/demux/ty.c +++ b/modules/demux/ty.c @@ -352,15 +352,15 @@ static int Open(vlc_object_t *p_this) /* register the proper audio codec */ if (p_sys->audio_type == TIVO_AUDIO_MPEG) { - es_format_Init( &fmt, AUDIO_ES, VLC_FOURCC( 'm', 'p', 'g', 'a' ) ); + es_format_Init( &fmt, AUDIO_ES, VLC_CODEC_MPGA ); } else { - es_format_Init( &fmt, AUDIO_ES, VLC_FOURCC( 'a', '5', '2', ' ' ) ); + es_format_Init( &fmt, AUDIO_ES, VLC_CODEC_A52 ); } fmt.i_group = TY_ES_GROUP; p_sys->p_audio = es_out_Add( p_demux->out, &fmt ); /* register the video stream */ - es_format_Init( &fmt, VIDEO_ES, VLC_FOURCC( 'm', 'p', 'g', 'v' ) ); + es_format_Init( &fmt, VIDEO_ES, VLC_CODEC_MPGV ); fmt.i_group = TY_ES_GROUP; p_sys->p_video = es_out_Add( p_demux->out, &fmt ); diff --git a/modules/demux/vobsub.c b/modules/demux/vobsub.c index 3b90e2da5b..a371b5e2be 100644 --- a/modules/demux/vobsub.c +++ b/modules/demux/vobsub.c @@ -557,7 +557,7 @@ static int ParseVobSubIDX( demux_t *p_demux ) current_tk->i_track_id = i_track_id; current_tk->i_delay = (int64_t)0; - es_format_Init( &fmt, SPU_ES, VLC_FOURCC( 's','p','u',' ' ) ); + es_format_Init( &fmt, SPU_ES, VLC_CODEC_SPU ); fmt.subs.spu.i_original_frame_width = p_sys->i_original_frame_width; fmt.subs.spu.i_original_frame_height = p_sys->i_original_frame_height; fmt.psz_language = strdup( language ); diff --git a/modules/demux/voc.c b/modules/demux/voc.c index 13d86d1b28..ccdb63a73f 100644 --- a/modules/demux/voc.c +++ b/modules/demux/voc.c @@ -196,7 +196,7 @@ static int ReadBlockHeader( demux_t *p_demux ) return VLC_EGENERIC; } - new_fmt.i_codec = VLC_FOURCC('u','8',' ',' '); + new_fmt.i_codec = VLC_CODEC_U8; new_fmt.audio.i_rate = fix_voc_sr( 1000000L / (256L - buf[0]) ); new_fmt.audio.i_bytes_per_frame = 1; new_fmt.audio.i_frame_length = 1; @@ -221,7 +221,7 @@ static int ReadBlockHeader( demux_t *p_demux ) i_block_size = 0; p_sys->i_silence_countdown = GetWLE( buf ); - new_fmt.i_codec = VLC_FOURCC('u','8',' ',' '); + new_fmt.i_codec = VLC_CODEC_U8; new_fmt.audio.i_rate = fix_voc_sr( 1000000L / (256L - buf[0]) ); new_fmt.audio.i_bytes_per_frame = 1; new_fmt.audio.i_frame_length = 1; @@ -272,7 +272,7 @@ static int ReadBlockHeader( demux_t *p_demux ) return VLC_EGENERIC; } - new_fmt.i_codec = VLC_FOURCC('u','8',' ',' '); + new_fmt.i_codec = VLC_CODEC_U8; new_fmt.audio.i_channels = buf[3] + 1; /* can't be nul */ new_fmt.audio.i_rate = 256000000L / ((65536L - GetWLE(buf)) * new_fmt.audio.i_channels); @@ -323,11 +323,11 @@ static int ReadBlockHeader( demux_t *p_demux ) switch( new_fmt.audio.i_bitspersample ) { case 8: - new_fmt.i_codec = VLC_FOURCC('u','8',' ',' '); + new_fmt.i_codec = VLC_CODEC_U8; break; case 16: - new_fmt.i_codec = VLC_FOURCC('u','1','6','l'); + new_fmt.i_codec = VLC_CODEC_U16L; break; default: @@ -341,11 +341,11 @@ static int ReadBlockHeader( demux_t *p_demux ) switch( new_fmt.audio.i_bitspersample ) { case 8: - new_fmt.i_codec = VLC_FOURCC('s','8',' ',' '); + new_fmt.i_codec = VLC_CODEC_S8; break; case 16: - new_fmt.i_codec = VLC_FOURCC('s','1','6','l'); + new_fmt.i_codec = VLC_CODEC_S16L; break; default: diff --git a/modules/demux/wav.c b/modules/demux/wav.c index ff5367a008..9f4c832e01 100644 --- a/modules/demux/wav.c +++ b/modules/demux/wav.c @@ -310,8 +310,8 @@ static int Open( vlc_object_t * p_this ) case VLC_FOURCC( 'a', 'r', 'a', 'w' ): case VLC_FOURCC( 'a', 'f', 'l', 't' ): case VLC_FOURCC( 'u', 'l', 'a', 'w' ): - case VLC_FOURCC( 'a', 'l', 'a', 'w' ): - case VLC_FOURCC( 'm', 'l', 'a', 'w' ): + case VLC_CODEC_ALAW: + case VLC_CODEC_MULAW: case VLC_FOURCC( 'p', 'c', 'm', ' ' ): if( FrameInfo_PCM( &p_sys->i_frame_size, &p_sys->i_frame_samples, &p_sys->fmt ) ) @@ -334,11 +334,11 @@ static int Open( vlc_object_t * p_this ) &p_sys->fmt ) ) goto error; break; - case VLC_FOURCC( 'm', 'p', 'g', 'a' ): - case VLC_FOURCC( 'a', '5', '2', ' ' ): + case VLC_CODEC_MPGA: + case VLC_CODEC_A52: /* FIXME set end of area FIXME */ goto error; - case VLC_FOURCC( 'a', 'g', 's', 'm' ): + case VLC_CODEC_GSM_MS: if( FrameInfo_MSGSM( &p_sys->i_frame_size, &p_sys->i_frame_samples, &p_sys->fmt ) ) goto error; diff --git a/modules/gui/beos/AudioOutput.cpp b/modules/gui/beos/AudioOutput.cpp index 1202ef04da..51cee51993 100644 --- a/modules/gui/beos/AudioOutput.cpp +++ b/modules/gui/beos/AudioOutput.cpp @@ -97,7 +97,7 @@ int OpenAudio ( vlc_object_t * p_this ) #endif p_format->buffer_size = 8192; - p_aout->output.output.i_format = VLC_FOURCC('f','l','3','2'); + p_aout->output.output.i_format = VLC_CODEC_FL32; p_aout->output.i_nb_samples = 2048 / i_nb_channels; p_aout->output.pf_play = DoNothing; diff --git a/modules/gui/beos/VideoWindow.h b/modules/gui/beos/VideoWindow.h index 4f874d31ae..aaffae5e8d 100644 --- a/modules/gui/beos/VideoWindow.h +++ b/modules/gui/beos/VideoWindow.h @@ -45,11 +45,11 @@ typedef struct colorcombo colorcombo colspace[]= { - {B_YCbCr420, "B_YCbCr420", VLC_FOURCC('I','4','2','0'), 3, 2}, + {B_YCbCr420, "B_YCbCr420", VLC_CODEC_I420, 3, 2}, {B_YUV422, "B_YUV422", VLC_FOURCC('Y','4','2','2'), 3, 2}, - {B_YCbCr422, "B_YCbCr422", VLC_FOURCC('Y','U','Y','2'), 3, 2}, - {B_RGB32, "B_RGB32", VLC_FOURCC('R','V','3','2'), 1, 4}, - {B_RGB16, "B_RGB16", VLC_FOURCC('R','V','1','6'), 1, 2} + {B_YCbCr422, "B_YCbCr422", VLC_CODEC_YUYV, 3, 2}, + {B_RGB32, "B_RGB32", VLC_CODEC_RGB32, 1, 4}, + {B_RGB16, "B_RGB16", VLC_CODEC_RGB16, 1, 2} }; #define COLOR_COUNT 5 diff --git a/modules/gui/fbosd.c b/modules/gui/fbosd.c index 47ae92dca5..739137939b 100644 --- a/modules/gui/fbosd.c +++ b/modules/gui/fbosd.c @@ -537,10 +537,10 @@ static int OpenBlending( intf_thread_t *p_intf ) p_intf->p_sys->fmt_out.i_chroma; if( config_GetInt( p_intf, "freetype-yuvp" ) ) p_intf->p_sys->p_blend->fmt_in.video.i_chroma = - VLC_FOURCC('Y','U','V','P'); + VLC_CODEC_YUVP; else p_intf->p_sys->p_blend->fmt_in.video.i_chroma = - VLC_FOURCC('Y','U','V','A'); + VLC_CODEC_YUVA; p_intf->p_sys->p_blend->p_module = module_need( p_intf->p_sys->p_blend, "video blending", NULL, false ); @@ -628,7 +628,7 @@ static picture_t *AllocatePicture( video_format_t *p_fmt ) return NULL; if( !p_fmt->p_palette && - ( p_fmt->i_chroma == VLC_FOURCC('Y','U','V','P') ) ) + ( p_fmt->i_chroma == VLC_CODEC_YUVP ) ) { p_fmt->p_palette = malloc( sizeof(video_palette_t) ); if( !p_fmt->p_palette ) @@ -737,13 +737,13 @@ static int InvertAlpha( intf_thread_t *p_intf, picture_t **p_pic, video_format_t switch( fmt.i_chroma ) { - case VLC_FOURCC('R','V','2','4'): + case VLC_CODEC_RGB24: p_begin = (uint8_t *)(*p_pic)->p[Y_PLANE].p_pixels; p_end = (uint8_t *)(*p_pic)->p[Y_PLANE].p_pixels + ( fmt.i_height * (*p_pic)->p[Y_PLANE].i_pitch ); i_skip = 3; break; - case VLC_FOURCC('R','V','3','2'): + case VLC_CODEC_RGB32: p_begin = (uint8_t *)(*p_pic)->p[Y_PLANE].p_pixels; p_end = (uint8_t *)(*p_pic)->p[Y_PLANE].p_pixels + ( fmt.i_height * (*p_pic)->p[Y_PLANE].i_pitch ); @@ -845,7 +845,7 @@ static picture_t *RenderText( intf_thread_t *p_intf, const char *psz_string, video_format_t fmt; memset( &fmt, 0, sizeof(fmt) ); - fmt.i_chroma = VLC_FOURCC('T','E','X','T'); + fmt.i_chroma = VLC_CODEC_TEXT; fmt.i_aspect = 0; fmt.i_width = fmt.i_visible_width = 0; fmt.i_height = fmt.i_visible_height = 0; @@ -960,15 +960,15 @@ static int Init( intf_thread_t *p_intf ) switch( p_sys->var_info.bits_per_pixel ) { case 8: /* FIXME: set the palette */ - p_sys->fmt_out.i_chroma = VLC_FOURCC('R','G','B','2'); break; + p_sys->fmt_out.i_chroma = VLC_CODEC_RGB8; break; case 15: - p_sys->fmt_out.i_chroma = VLC_FOURCC('R','V','1','5'); break; + p_sys->fmt_out.i_chroma = VLC_CODEC_RGB15; break; case 16: - p_sys->fmt_out.i_chroma = VLC_FOURCC('R','V','1','6'); break; + p_sys->fmt_out.i_chroma = VLC_CODEC_RGB16; break; case 24: - p_sys->fmt_out.i_chroma = VLC_FOURCC('R','V','2','4'); break; + p_sys->fmt_out.i_chroma = VLC_CODEC_RGB24; break; case 32: - p_sys->fmt_out.i_chroma = VLC_FOURCC('R','V','3','2'); break; + p_sys->fmt_out.i_chroma = VLC_CODEC_RGB32; break; default: msg_Err( p_intf, "unknown screen depth %i", p_sys->var_info.bits_per_pixel ); diff --git a/modules/gui/qnx/aout.c b/modules/gui/qnx/aout.c index f0f8297cb7..12fa0cc555 100644 --- a/modules/gui/qnx/aout.c +++ b/modules/gui/qnx/aout.c @@ -270,7 +270,7 @@ static void* QNXaoutThread( 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 next_date = 0; diff --git a/modules/gui/qnx/vout.c b/modules/gui/qnx/vout.c index f5a01cb72d..ef775d1c28 100644 --- a/modules/gui/qnx/vout.c +++ b/modules/gui/qnx/vout.c @@ -592,13 +592,13 @@ static int QNXInitDisplay( vout_thread_t * p_vout ) switch( p_vout->p_sys->i_screen_depth ) { case 8: - p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2'); + p_vout->output.i_chroma = VLC_CODEC_RGB8; p_vout->p_sys->i_bytes_per_pixel = 1; p_vout->output.pf_setpalette = SetPalette; break; case 15: - p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5'); + p_vout->output.i_chroma = VLC_CODEC_RGB15; p_vout->p_sys->i_bytes_per_pixel = 2; p_vout->output.i_rmask = 0x7c00; p_vout->output.i_gmask = 0x03e0; @@ -606,7 +606,7 @@ static int QNXInitDisplay( vout_thread_t * p_vout ) break; case 16: - p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6'); + p_vout->output.i_chroma = VLC_CODEC_RGB16; p_vout->p_sys->i_bytes_per_pixel = 2; p_vout->output.i_rmask = 0xf800; p_vout->output.i_gmask = 0x07e0; @@ -614,7 +614,7 @@ static int QNXInitDisplay( vout_thread_t * p_vout ) break; case 24: - p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4'); + p_vout->output.i_chroma = VLC_CODEC_RGB24; p_vout->p_sys->i_bytes_per_pixel = 3; p_vout->output.i_rmask = 0xff0000; p_vout->output.i_gmask = 0x00ff00; @@ -623,7 +623,7 @@ static int QNXInitDisplay( vout_thread_t * p_vout ) case 32: default: - p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2'); + p_vout->output.i_chroma = VLC_CODEC_RGB32; p_vout->p_sys->i_bytes_per_pixel = 4; p_vout->output.i_rmask = 0xff0000; p_vout->output.i_gmask = 0x00ff00; @@ -819,7 +819,7 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic, int index ) switch (p_vout->p_sys->i_vc_format) { case Pg_VIDEO_FORMAT_YUV420: - p_vout->output.i_chroma = VLC_FOURCC('I','4','2','0'); + p_vout->output.i_chroma = VLC_CODEC_I420; p_pic->p_sys->p_buf[U_PLANE] = PdGetOffscreenContextPtr( p_pic->p_sys->p_ctx[U_PLANE] ); p_pic->p_sys->p_buf[V_PLANE] = PdGetOffscreenContextPtr( p_pic->p_sys->p_ctx[V_PLANE] ); @@ -856,7 +856,7 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic, int index ) break; case Pg_VIDEO_FORMAT_YV12: - p_vout->output.i_chroma = VLC_FOURCC('Y','V','1','2'); + p_vout->output.i_chroma = VLC_CODEC_YV12; p_pic->p_sys->p_buf[U_PLANE] = PdGetOffscreenContextPtr( p_pic->p_sys->p_ctx[U_PLANE] ); p_pic->p_sys->p_buf[V_PLANE] = PdGetOffscreenContextPtr( p_pic->p_sys->p_ctx[V_PLANE] ); @@ -896,11 +896,11 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic, int index ) case Pg_VIDEO_FORMAT_YUY2: if (p_vout->p_sys->i_vc_format == Pg_VIDEO_FORMAT_UYVY) { - p_vout->output.i_chroma = VLC_FOURCC('U','Y','V','Y'); + p_vout->output.i_chroma = VLC_CODEC_UYVY; } else { - p_vout->output.i_chroma = VLC_FOURCC('Y','U','Y','2'); + p_vout->output.i_chroma = VLC_CODEC_YUYV; } p_pic->p->p_pixels = p_pic->p_sys->p_buf[Y_PLANE]; @@ -914,7 +914,7 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic, int index ) break; case Pg_VIDEO_FORMAT_RGB555: - p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5'); + p_vout->output.i_chroma = VLC_CODEC_RGB15; p_vout->output.i_rmask = 0x001f; p_vout->output.i_gmask = 0x03e0; p_vout->output.i_bmask = 0x7c00; @@ -930,7 +930,7 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic, int index ) break; case Pg_VIDEO_FORMAT_RGB565: - p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6'); + p_vout->output.i_chroma = VLC_CODEC_RGB16; p_vout->output.i_rmask = 0x001f; p_vout->output.i_gmask = 0x07e0; p_vout->output.i_bmask = 0xf800; @@ -946,7 +946,7 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic, int index ) break; case Pg_VIDEO_FORMAT_RGB8888: - p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2'); + p_vout->output.i_chroma = VLC_CODEC_RGB32; p_vout->output.i_rmask = 0x000000ff; p_vout->output.i_gmask = 0x0000ff00; p_vout->output.i_bmask = 0x00ff0000; @@ -966,7 +966,7 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic, int index ) switch( p_vout->output.i_chroma ) { #ifdef MODULE_NAME_IS_xvideo - case VLC_FOURCC('Y','2','1','1'): + case VLC_CODEC_Y211: p_pic->p->p_pixels = p_pic->p_sys->p_image->data + p_pic->p_sys->p_image->offsets[0]; diff --git a/modules/gui/skins2/src/file_bitmap.cpp b/modules/gui/skins2/src/file_bitmap.cpp index 1724b49844..5ab377d5cd 100644 --- a/modules/gui/skins2/src/file_bitmap.cpp +++ b/modules/gui/skins2/src/file_bitmap.cpp @@ -39,7 +39,7 @@ FileBitmap::FileBitmap( intf_thread_t *pIntf, image_handler_t *pImageHandler, video_format_t fmt_in = {0}, fmt_out = {0}; picture_t *pPic; - fmt_out.i_chroma = VLC_FOURCC('R','G','B','A'); + fmt_out.i_chroma = VLC_CODEC_RGBA; pPic = image_ReadUrl( pImageHandler, fileName.c_str(), &fmt_in, &fmt_out ); if( !pPic ) return; diff --git a/modules/misc/dummy/aout.c b/modules/misc/dummy/aout.c index a5b62d37b1..e648a335d2 100644 --- a/modules/misc/dummy/aout.c +++ b/modules/misc/dummy/aout.c @@ -52,7 +52,7 @@ int OpenAudio ( vlc_object_t * p_this ) p_aout->output.pf_play = Play; aout_VolumeSoftInit( p_aout ); - if ( p_aout->output.output.i_format == VLC_FOURCC('s','p','d','i') ) + if ( 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; diff --git a/modules/misc/dummy/vout.c b/modules/misc/dummy/vout.c index 0b4cdbb481..5d5e7aced5 100644 --- a/modules/misc/dummy/vout.c +++ b/modules/misc/dummy/vout.c @@ -93,8 +93,9 @@ static int Init( vout_thread_t *p_vout ) { if( strlen( psz_chroma ) >= 4 ) { - i_chroma = VLC_FOURCC( psz_chroma[0], psz_chroma[1], - psz_chroma[2], psz_chroma[3] ); + i_chroma = vlc_fourcc_GetCodec( VIDEO_ES, + VLC_FOURCC( psz_chroma[0], psz_chroma[1], + psz_chroma[2], psz_chroma[3] ) ); b_chroma = 1; } @@ -109,7 +110,7 @@ static int Init( vout_thread_t *p_vout ) msg_Dbg( p_vout, "forcing chroma 0x%.8x (%4.4s)", i_chroma, (char*)&i_chroma ); p_vout->output.i_chroma = i_chroma; - if ( i_chroma == VLC_FOURCC( 'R', 'G', 'B', '2' ) ) + if ( i_chroma == VLC_CODEC_RGB8 ) { p_vout->output.pf_setpalette = SetPalette; } diff --git a/modules/misc/freetype.c b/modules/misc/freetype.c index 7e458663d7..11d7bb8c5d 100644 --- a/modules/misc/freetype.c +++ b/modules/misc/freetype.c @@ -655,7 +655,7 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region, /* 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; fmt.i_width = fmt.i_visible_width = i_width + 4; fmt.i_height = fmt.i_visible_height = i_height + 4; @@ -921,7 +921,7 @@ static int RenderYUVA( filter_t *p_filter, subpicture_region_t *p_region, /* Create a new subpicture region */ memset( &fmt, 0, sizeof(video_format_t) ); - fmt.i_chroma = VLC_FOURCC('Y','U','V','A'); + fmt.i_chroma = VLC_CODEC_YUVA; fmt.i_aspect = 0; fmt.i_width = fmt.i_visible_width = i_width + 6; fmt.i_height = fmt.i_visible_height = i_height + 6; diff --git a/modules/misc/osd/osd_menu.c b/modules/misc/osd/osd_menu.c index f5d8704f05..f7b95d3ac8 100644 --- a/modules/misc/osd/osd_menu.c +++ b/modules/misc/osd/osd_menu.c @@ -199,7 +199,7 @@ osd_state_t *osd_StateNew( osd_menu_t *p_menu, const char *psz_file, memset( &fmt_in, 0, sizeof(video_format_t) ); 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; if( p_menu->p_image ) { p_state->p_pic = image_ReadUrl( p_menu->p_image, psz_file, diff --git a/modules/misc/quartztext.c b/modules/misc/quartztext.c index a19c2a3cfd..b3b92445c7 100644 --- a/modules/misc/quartztext.c +++ b/modules/misc/quartztext.c @@ -838,7 +838,7 @@ static int RenderYUVA( filter_t *p_filter, subpicture_region_t *p_region, UniCha // Create a new subpicture region memset( &fmt, 0, sizeof(video_format_t) ); - fmt.i_chroma = VLC_FOURCC('Y','U','V','A'); + fmt.i_chroma = VLC_CODEC_YUVA; fmt.i_aspect = 0; fmt.i_width = fmt.i_visible_width = i_width; fmt.i_height = fmt.i_visible_height = i_textblock_height + VERTICAL_MARGIN * 2; diff --git a/modules/misc/rtsp.c b/modules/misc/rtsp.c index 0dd3e93cce..9e7f97fb98 100644 --- a/modules/misc/rtsp.c +++ b/modules/misc/rtsp.c @@ -517,7 +517,7 @@ static int MediaAddES( vod_t *p_vod, vod_media_t *p_media, es_format_t *p_fmt ) switch( p_fmt->i_codec ) { - case VLC_FOURCC( 's', '1', '6', 'b' ): + case VLC_CODEC_S16B: if( p_fmt->audio.i_channels == 1 && p_fmt->audio.i_rate == 44100 ) { p_es->i_payload_type = 11; @@ -535,31 +535,31 @@ static int MediaAddES( vod_t *p_vod, vod_media_t *p_media, es_format_t *p_fmt ) p_fmt->audio.i_channels ) == -1 ) p_es->psz_rtpmap = NULL; break; - case VLC_FOURCC( 'u', '8', ' ', ' ' ): + case VLC_CODEC_U8: p_es->i_payload_type = p_media->i_payload_type++; if( asprintf( &p_es->psz_rtpmap, "L8/%d/%d", p_fmt->audio.i_rate, p_fmt->audio.i_channels ) == -1 ) p_es->psz_rtpmap = NULL; break; - case VLC_FOURCC( 'm', 'p', 'g', 'a' ): + case VLC_CODEC_MPGA: case VLC_FOURCC( 'm', 'p', '3', ' ' ): p_es->i_payload_type = 14; p_es->psz_rtpmap = strdup( "MPA/90000" ); break; - case VLC_FOURCC( 'm', 'p', 'g', 'v' ): + case VLC_CODEC_MPGV: p_es->i_payload_type = 32; p_es->psz_rtpmap = strdup( "MPV/90000" ); break; - case VLC_FOURCC( 'a', '5', '2', ' ' ): + case VLC_CODEC_A52: p_es->i_payload_type = p_media->i_payload_type++; if( asprintf( &p_es->psz_rtpmap, "ac3/%d", p_fmt->audio.i_rate ) == -1 ) p_es->psz_rtpmap = NULL; break; - case VLC_FOURCC( 'H', '2', '6', '3' ): + case VLC_CODEC_H263: p_es->i_payload_type = p_media->i_payload_type++; p_es->psz_rtpmap = strdup( "H263-1998/90000" ); break; - case VLC_FOURCC( 'h', '2', '6', '4' ): + case VLC_CODEC_H264: p_es->i_payload_type = p_media->i_payload_type++; p_es->psz_rtpmap = strdup( "H264/90000" ); p_es->psz_fmtp = NULL; @@ -625,7 +625,7 @@ static int MediaAddES( vod_t *p_vod, vod_media_t *p_media, es_format_t *p_fmt ) if( !p_es->psz_fmtp ) p_es->psz_fmtp = strdup( "packetization-mode=1" ); break; - case VLC_FOURCC( 'm', 'p', '4', 'v' ): + case VLC_CODEC_MP4V: p_es->i_payload_type = p_media->i_payload_type++; p_es->psz_rtpmap = strdup( "MP4V-ES/90000" ); if( p_fmt->i_extra > 0 ) @@ -638,7 +638,7 @@ static int MediaAddES( vod_t *p_vod, vod_media_t *p_media, es_format_t *p_fmt ) free( p_hexa ); } break; - case VLC_FOURCC( 'm', 'p', '4', 'a' ): + case VLC_CODEC_MP4A: p_es->i_payload_type = p_media->i_payload_type++; if( asprintf( &p_es->psz_rtpmap, "mpeg4-generic/%d", p_fmt->audio.i_rate ) == -1 ) p_es->psz_rtpmap = NULL; @@ -664,13 +664,13 @@ static int MediaAddES( vod_t *p_vod, vod_media_t *p_media, es_format_t *p_fmt ) p_es->i_payload_type = p_media->i_payload_type++; p_es->psz_rtpmap = strdup( "MP2P/90000" ); break; - case VLC_FOURCC( 's', 'a', 'm', 'r' ): + case VLC_CODEC_AMR_NB: p_es->i_payload_type = p_media->i_payload_type++; p_es->psz_rtpmap = strdup( p_fmt->audio.i_channels == 2 ? "AMR/8000/2" : "AMR/8000" ); p_es->psz_fmtp = strdup( "octet-align=1" ); break; - case VLC_FOURCC( 's', 'a', 'w', 'b' ): + case VLC_CODEC_AMR_WB: p_es->i_payload_type = p_media->i_payload_type++; p_es->psz_rtpmap = strdup( p_fmt->audio.i_channels == 2 ? "AMR-WB/16000/2" : "AMR-WB/16000" ); diff --git a/modules/misc/stats/vout.c b/modules/misc/stats/vout.c index a765e3dd8a..a9236f50f3 100644 --- a/modules/misc/stats/vout.c +++ b/modules/misc/stats/vout.c @@ -109,7 +109,7 @@ static int Init( vout_thread_t *p_vout ) msg_Dbg( p_vout, "forcing chroma 0x%.8x (%4.4s)", i_chroma, (char*)&i_chroma ); p_vout->output.i_chroma = i_chroma; - if ( i_chroma == VLC_FOURCC( 'R', 'G', 'B', '2' ) ) + if ( i_chroma == VLC_CODEC_RGB8 ) { p_vout->output.pf_setpalette = SetPalette; } diff --git a/modules/misc/svg.c b/modules/misc/svg.c index 28e1b77b89..c6cf3d140c 100644 --- a/modules/misc/svg.c +++ b/modules/misc/svg.c @@ -277,7 +277,7 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region, /* Create a new subpicture region */ memset( &fmt, 0, sizeof( video_format_t ) ); - fmt.i_chroma = VLC_FOURCC( 'Y','U','V','A' ); + fmt.i_chroma = VLC_CODEC_YUVA; fmt.i_aspect = VOUT_ASPECT_FACTOR; fmt.i_width = fmt.i_visible_width = i_width; fmt.i_height = fmt.i_visible_height = i_height; @@ -481,7 +481,7 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out, } p_svg->i_width = p_sys->i_width; p_svg->i_height = p_sys->i_height; - p_svg->i_chroma = VLC_FOURCC( 'Y','U','V','A' ); + p_svg->i_chroma = VLC_CODEC_YUVA; /* Render the SVG. The input data is stored in the p_string structure, diff --git a/modules/misc/win32text.c b/modules/misc/win32text.c index 4475a7aef6..b48f856645 100644 --- a/modules/misc/win32text.c +++ b/modules/misc/win32text.c @@ -221,7 +221,7 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region, /* 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_width = fmt.i_visible_width = i_width + (b_outline ? 4 : 0); fmt.i_height = fmt.i_visible_height = i_height + (b_outline ? 4 : 0); fmt.i_x_offset = fmt.i_y_offset = 0; diff --git a/modules/packetizer/copy.c b/modules/packetizer/copy.c index 661e406c14..11461d5d36 100644 --- a/modules/packetizer/copy.c +++ b/modules/packetizer/copy.c @@ -103,26 +103,26 @@ static int Open( vlc_object_t *p_this ) case VLC_FOURCC( 'D', 'X', '5', '0'): case VLC_FOURCC( 0x04, 0, 0, 0): case VLC_FOURCC( '3', 'I', 'V', '2'): - p_dec->fmt_out.i_codec = VLC_FOURCC( 'm', 'p', '4', 'v'); + p_dec->fmt_out.i_codec = VLC_CODEC_MP4V; break; case VLC_FOURCC( 'm', 'p', 'g', '1' ): case VLC_FOURCC( 'm', 'p', 'g', '2' ): - case VLC_FOURCC( 'm', 'p', '1', 'v' ): - case VLC_FOURCC( 'm', 'p', '2', 'v' ): - p_dec->fmt_out.i_codec = VLC_FOURCC( 'm', 'p', 'g', 'v' ); + case VLC_CODEC_MP1V: + case VLC_CODEC_MP2V: + p_dec->fmt_out.i_codec = VLC_CODEC_MPGV; break; case VLC_FOURCC( 'd', 'i', 'v', '1' ): case VLC_FOURCC( 'M', 'P', 'G', '4' ): case VLC_FOURCC( 'm', 'p', 'g', '4' ): - p_dec->fmt_out.i_codec = VLC_FOURCC( 'D', 'I', 'V', '1' ); + p_dec->fmt_out.i_codec = VLC_CODEC_DIV1; break; case VLC_FOURCC( 'd', 'i', 'v', '2' ): case VLC_FOURCC( 'M', 'P', '4', '2' ): case VLC_FOURCC( 'm', 'p', '4', '2' ): - p_dec->fmt_out.i_codec = VLC_FOURCC( 'D', 'I', 'V', '2' ); + p_dec->fmt_out.i_codec = VLC_CODEC_DIV2; break; case VLC_FOURCC( 'd', 'i', 'v', '3' ): @@ -137,25 +137,25 @@ static int Open( vlc_object_t *p_this ) case VLC_FOURCC( 'm', 'p', 'g', '3' ): case VLC_FOURCC( 'M', 'P', 'G', '3' ): case VLC_FOURCC( 'A', 'P', '4', '1' ): - p_dec->fmt_out.i_codec = VLC_FOURCC( 'D', 'I', 'V', '3' ); + p_dec->fmt_out.i_codec = VLC_CODEC_DIV3; break; - case VLC_FOURCC( 'h', '2', '6', '3' ): + case VLC_CODEC_H263: case VLC_FOURCC( 'U', '2', '6', '3' ): case VLC_FOURCC( 'u', '2', '6', '3' ): p_dec->fmt_out.i_codec = VLC_FOURCC( 'H', '2', '6', '3' ); break; case VLC_FOURCC( 'i', '2', '6', '3' ): - p_dec->fmt_out.i_codec = VLC_FOURCC( 'I', '2', '6', '3' ); + p_dec->fmt_out.i_codec = VLC_CODEC_H263I; break; case VLC_FOURCC( 'm', 'j', 'p', 'g' ): case VLC_FOURCC( 'm', 'j', 'p', 'a' ): - case VLC_FOURCC( 'j', 'p', 'e', 'g' ): + case VLC_CODEC_JPEG: case VLC_FOURCC( 'J', 'P', 'E', 'G' ): case VLC_FOURCC( 'J', 'F', 'I', 'F' ): - p_dec->fmt_out.i_codec = VLC_FOURCC( 'M', 'J', 'P', 'G' ); + p_dec->fmt_out.i_codec = VLC_CODEC_MJPG; break; case VLC_FOURCC( 'd', 'v', 's', 'd' ): @@ -169,16 +169,16 @@ static int Open( 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, "unknown raw audio sample size" ); @@ -190,16 +190,16 @@ static int Open( 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, "unknown raw audio sample size" ); @@ -211,16 +211,16 @@ static int Open( 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, "unknown raw audio sample size" ); diff --git a/modules/packetizer/dirac.c b/modules/packetizer/dirac.c index 75f9ce5796..39c48185a6 100644 --- a/modules/packetizer/dirac.c +++ b/modules/packetizer/dirac.c @@ -1349,7 +1349,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( 'd','r','a','c' ) ) + if( p_dec->fmt_in.i_codec != VLC_CODEC_DIRAC ) return VLC_EGENERIC; p_dec->pf_packetize = Packetize; diff --git a/modules/packetizer/h264.c b/modules/packetizer/h264.c index 534ee7bcbe..bc942fafa2 100644 --- a/modules/packetizer/h264.c +++ b/modules/packetizer/h264.c @@ -183,7 +183,7 @@ static int Open( vlc_object_t *p_this ) decoder_sys_t *p_sys; int i; - if( p_dec->fmt_in.i_codec != VLC_FOURCC( 'h', '2', '6', '4') && + if( p_dec->fmt_in.i_codec != VLC_CODEC_H264 && p_dec->fmt_in.i_codec != VLC_FOURCC( 'H', '2', '6', '4') && p_dec->fmt_in.i_codec != VLC_FOURCC( 'V', 'S', 'S', 'H') && p_dec->fmt_in.i_codec != VLC_FOURCC( 'v', 's', 's', 'h') && @@ -233,7 +233,7 @@ static int Open( vlc_object_t *p_this ) /* Setup properties */ es_format_Copy( &p_dec->fmt_out, &p_dec->fmt_in ); - p_dec->fmt_out.i_codec = VLC_FOURCC( 'h', '2', '6', '4' ); + p_dec->fmt_out.i_codec = VLC_CODEC_H264; if( p_dec->fmt_in.i_codec == VLC_FOURCC( 'a', 'v', 'c', '1' ) ) { diff --git a/modules/packetizer/mlp.c b/modules/packetizer/mlp.c index 5722c0cb4e..09abbcb757 100644 --- a/modules/packetizer/mlp.c +++ b/modules/packetizer/mlp.c @@ -120,7 +120,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','l','p',' ') ) + if( p_dec->fmt_in.i_codec != VLC_CODEC_MLP ) return VLC_EGENERIC; /* */ @@ -137,7 +137,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','l','p',' '); + p_dec->fmt_out.i_codec = VLC_CODEC_MLP; p_dec->fmt_out.audio.i_rate = 0; /* Set callback */ diff --git a/modules/packetizer/mpeg4audio.c b/modules/packetizer/mpeg4audio.c index e0f99d4012..222678f140 100644 --- a/modules/packetizer/mpeg4audio.c +++ b/modules/packetizer/mpeg4audio.c @@ -193,7 +193,7 @@ static int OpenPacketizer( 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', '4', 'a' ) ) + if( p_dec->fmt_in.i_codec != VLC_CODEC_MP4A ) { return VLC_EGENERIC; } @@ -211,7 +211,7 @@ static int OpenPacketizer( 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','4','a'); + p_dec->fmt_out.i_codec = VLC_CODEC_MP4A; msg_Dbg( p_dec, "running MPEG4 audio packetizer" ); diff --git a/modules/packetizer/mpeg4video.c b/modules/packetizer/mpeg4video.c index 018846c998..3a0965be17 100644 --- a/modules/packetizer/mpeg4video.c +++ b/modules/packetizer/mpeg4video.c @@ -137,7 +137,7 @@ static int Open( vlc_object_t *p_this ) case VLC_FOURCC( 'M', '4', 'S', '2'): case VLC_FOURCC( 'm', 'p', '4', 's'): case VLC_FOURCC( 'M', 'P', '4', 'S'): - case VLC_FOURCC( 'm', 'p', '4', 'v'): + case VLC_CODEC_MP4V: case VLC_FOURCC( 'M', 'P', '4', 'V'): case VLC_FOURCC( 'D', 'I', 'V', 'X'): case VLC_FOURCC( 'd', 'i', 'v', 'x'): @@ -172,7 +172,7 @@ static int Open( vlc_object_t *p_this ) /* Setup properties */ es_format_Copy( &p_dec->fmt_out, &p_dec->fmt_in ); - p_dec->fmt_out.i_codec = VLC_FOURCC( 'm', 'p', '4', 'v' ); + p_dec->fmt_out.i_codec = VLC_CODEC_MP4V; if( p_dec->fmt_in.i_extra ) { diff --git a/modules/packetizer/mpegvideo.c b/modules/packetizer/mpegvideo.c index a3a4020cfb..ac0c823ef4 100644 --- a/modules/packetizer/mpegvideo.c +++ b/modules/packetizer/mpegvideo.c @@ -155,12 +155,12 @@ static int Open( vlc_object_t *p_this ) if( p_dec->fmt_in.i_codec != VLC_FOURCC( 'm', 'p', 'g', '1' ) && p_dec->fmt_in.i_codec != VLC_FOURCC( 'm', 'p', 'g', '2' ) && - p_dec->fmt_in.i_codec != VLC_FOURCC( 'm', 'p', 'g', 'v' ) ) + p_dec->fmt_in.i_codec != VLC_CODEC_MPGV ) { return VLC_EGENERIC; } - es_format_Init( &p_dec->fmt_out, VIDEO_ES, VLC_FOURCC('m','p','g','v') ); + es_format_Init( &p_dec->fmt_out, VIDEO_ES, VLC_CODEC_MPGV ); p_dec->pf_packetize = Packetize; p_dec->pf_get_cc = GetCc; diff --git a/modules/packetizer/vc1.c b/modules/packetizer/vc1.c index c422f7a3dc..83c7f50082 100644 --- a/modules/packetizer/vc1.c +++ b/modules/packetizer/vc1.c @@ -130,7 +130,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( 'W', 'V', 'C', '1' ) ) + if( p_dec->fmt_in.i_codec != VLC_CODEC_VC1 ) return VLC_EGENERIC; p_dec->pf_packetize = Packetize; diff --git a/modules/video_chroma/grey_yuv.c b/modules/video_chroma/grey_yuv.c index 99e150c99f..5d382f6612 100644 --- a/modules/video_chroma/grey_yuv.c +++ b/modules/video_chroma/grey_yuv.c @@ -78,15 +78,13 @@ static int Activate( vlc_object_t *p_this ) switch( p_filter->fmt_in.video.i_chroma ) { - case VLC_FOURCC('Y','8','0','0'): - p_filter->fmt_in.video.i_chroma = VLC_FOURCC('G','R','E','Y'); - case VLC_FOURCC('G','R','E','Y'): + case VLC_CODEC_GREY: switch( p_filter->fmt_out.video.i_chroma ) { - case VLC_FOURCC('I','4','2','0'): + case VLC_CODEC_I420: p_filter->pf_video_filter = GREY_I420_Filter; break; - case VLC_FOURCC('Y','U','Y','2'): + case VLC_CODEC_YUYV: p_filter->pf_video_filter = GREY_YUY2_Filter; break; default: diff --git a/modules/video_chroma/i420_rgb.c b/modules/video_chroma/i420_rgb.c index 1d56f9d5f1..f39f806b40 100644 --- a/modules/video_chroma/i420_rgb.c +++ b/modules/video_chroma/i420_rgb.c @@ -107,18 +107,17 @@ static int Activate( vlc_object_t *p_this ) switch( p_filter->fmt_in.video.i_chroma ) { - case VLC_FOURCC('Y','V','1','2'): - case VLC_FOURCC('I','4','2','0'): - case VLC_FOURCC('I','Y','U','V'): + case VLC_CODEC_YV12: + case VLC_CODEC_I420: switch( p_filter->fmt_out.video.i_chroma ) { #if defined (MODULE_NAME_IS_i420_rgb) - case VLC_FOURCC('R','G','B','2'): + case VLC_CODEC_RGB8: p_filter->pf_video_filter = I420_RGB8_Filter; break; #endif - case VLC_FOURCC('R','V','1','5'): - case VLC_FOURCC('R','V','1','6'): + case VLC_CODEC_RGB15: + case VLC_CODEC_RGB16: #if ! defined (MODULE_NAME_IS_i420_rgb) /* If we don't have support for the bitmasks, bail out */ if( ( p_filter->fmt_out.video.i_rmask == 0x7c00 @@ -147,10 +146,10 @@ static int Activate( vlc_object_t *p_this ) #if 0 /* Hmmm, is there only X11 using 32bits per pixel for RV24 ? */ - case VLC_FOURCC('R','V','2','4'): + case VLC_CODEC_RGB24: #endif - case VLC_FOURCC('R','V','3','2'): + case VLC_CODEC_RGB32: #if ! defined (MODULE_NAME_IS_i420_rgb) /* If we don't have support for the bitmasks, bail out */ if( p_filter->fmt_out.video.i_rmask == 0x00ff0000 @@ -211,18 +210,18 @@ static int Activate( vlc_object_t *p_this ) switch( p_filter->fmt_out.video.i_chroma ) { #if defined (MODULE_NAME_IS_i420_rgb) - case VLC_FOURCC('R','G','B','2'): + case VLC_CODEC_RGB8: p_filter->p_sys->p_buffer = malloc( VOUT_MAX_WIDTH ); break; #endif - case VLC_FOURCC('R','V','1','5'): - case VLC_FOURCC('R','V','1','6'): + case VLC_CODEC_RGB15: + case VLC_CODEC_RGB16: p_filter->p_sys->p_buffer = malloc( VOUT_MAX_WIDTH * 2 ); break; - case VLC_FOURCC('R','V','2','4'): - case VLC_FOURCC('R','V','3','2'): + case VLC_CODEC_RGB24: + case VLC_CODEC_RGB32: p_filter->p_sys->p_buffer = malloc( VOUT_MAX_WIDTH * 4 ); break; @@ -239,7 +238,7 @@ static int Activate( vlc_object_t *p_this ) p_filter->p_sys->p_offset = malloc( p_filter->fmt_out.video.i_width * ( ( p_filter->fmt_out.video.i_chroma - == VLC_FOURCC('R','G','B','2') ) ? 2 : 1 ) + == VLC_CODEC_RGB8 ) ? 2 : 1 ) * sizeof( int ) ); if( p_filter->p_sys->p_offset == NULL ) { @@ -251,11 +250,11 @@ static int Activate( vlc_object_t *p_this ) #if defined (MODULE_NAME_IS_i420_rgb) switch( p_filter->fmt_out.video.i_chroma ) { - case VLC_FOURCC('R','G','B','2'): + case VLC_CODEC_RGB8: i_tables_size = sizeof( uint8_t ) * PALETTE_TABLE_SIZE; break; - case VLC_FOURCC('R','V','1','5'): - case VLC_FOURCC('R','V','1','6'): + case VLC_CODEC_RGB15: + case VLC_CODEC_RGB16: i_tables_size = sizeof( uint16_t ) * RGB_TABLE_SIZE; break; default: /* RV24, RV32 */ @@ -348,13 +347,13 @@ static void SetYUV( filter_t *p_filter ) /* Color: build red, green and blue tables */ switch( p_filter->fmt_out.video.i_chroma ) { - case VLC_FOURCC('R','G','B','2'): + case VLC_CODEC_RGB8: p_filter->p_sys->p_rgb8 = (uint8_t *)p_filter->p_sys->p_base; Set8bppPalette( p_filter, p_filter->p_sys->p_rgb8 ); break; - case VLC_FOURCC('R','V','1','5'): - case VLC_FOURCC('R','V','1','6'): + case VLC_CODEC_RGB15: + case VLC_CODEC_RGB16: p_filter->p_sys->p_rgb16 = (uint16_t *)p_filter->p_sys->p_base; for( i_index = 0; i_index < RED_MARGIN; i_index++ ) { @@ -379,8 +378,8 @@ static void SetYUV( filter_t *p_filter ) } break; - case VLC_FOURCC('R','V','2','4'): - case VLC_FOURCC('R','V','3','2'): + case VLC_CODEC_RGB24: + case VLC_CODEC_RGB32: p_filter->p_sys->p_rgb32 = (uint32_t *)p_filter->p_sys->p_base; for( i_index = 0; i_index < RED_MARGIN; i_index++ ) { diff --git a/modules/video_chroma/i420_ymga.c b/modules/video_chroma/i420_ymga.c index 6e0f77c8a1..ac5b412ed3 100644 --- a/modules/video_chroma/i420_ymga.c +++ b/modules/video_chroma/i420_ymga.c @@ -82,12 +82,11 @@ static int Activate( vlc_object_t *p_this ) switch( p_filter->fmt_in.video.i_chroma ) { - case VLC_FOURCC('Y','V','1','2'): - case VLC_FOURCC('I','4','2','0'): - case VLC_FOURCC('I','Y','U','V'): + case VLC_CODEC_YV12: + case VLC_CODEC_I420: switch( p_filter->fmt_out.video.i_chroma ) { - case VLC_FOURCC('Y','M','G','A'): + case VLC_CODEC_YMGA: p_filter->pf_video_filter = I420_YMGA_Filter; break; diff --git a/modules/video_chroma/i420_yuy2.c b/modules/video_chroma/i420_yuy2.c index 15f5ac2fee..ff9f62d30e 100644 --- a/modules/video_chroma/i420_yuy2.c +++ b/modules/video_chroma/i420_yuy2.c @@ -126,23 +126,19 @@ static int Activate( vlc_object_t *p_this ) switch( p_filter->fmt_in.video.i_chroma ) { - case VLC_FOURCC('Y','V','1','2'): - case VLC_FOURCC('I','4','2','0'): - case VLC_FOURCC('I','Y','U','V'): + case VLC_CODEC_YV12: + case VLC_CODEC_I420: switch( p_filter->fmt_out.video.i_chroma ) { - case VLC_FOURCC('Y','U','Y','2'): - case VLC_FOURCC('Y','U','N','V'): + case VLC_CODEC_YUYV: p_filter->pf_video_filter = I420_YUY2_Filter; break; - case VLC_FOURCC('Y','V','Y','U'): + case VLC_CODEC_YVYU: p_filter->pf_video_filter = I420_YVYU_Filter; break; - case VLC_FOURCC('U','Y','V','Y'): - case VLC_FOURCC('U','Y','N','V'): - case VLC_FOURCC('Y','4','2','2'): + case VLC_CODEC_UYVY: p_filter->pf_video_filter = I420_UYVY_Filter; break; #if !defined (MODULE_NAME_IS_i420_yuy2_altivec) @@ -150,13 +146,13 @@ static int Activate( vlc_object_t *p_this ) p_filter->pf_video_filter = I420_IUYV_Filter; break; - case VLC_FOURCC('c','y','u','v'): + case VLC_CODEC_CYUV: p_filter->pf_video_filter = I420_cyuv_Filter; break; #endif #if defined (MODULE_NAME_IS_i420_yuy2) - case VLC_FOURCC('Y','2','1','1'): + case VLC_CODEC_Y211: p_filter->pf_video_filter = I420_Y211_Filter; break; #endif diff --git a/modules/video_chroma/i422_i420.c b/modules/video_chroma/i422_i420.c index 7cb40e3b90..a3efe77aea 100644 --- a/modules/video_chroma/i422_i420.c +++ b/modules/video_chroma/i422_i420.c @@ -80,21 +80,20 @@ static int Activate( vlc_object_t *p_this ) switch( p_filter->fmt_in.video.i_chroma ) { - case VLC_FOURCC('I','4','2','2'): - case VLC_FOURCC('J','4','2','2'): + case VLC_CODEC_I422: + case VLC_CODEC_J422: switch( p_filter->fmt_out.video.i_chroma ) { - case VLC_FOURCC('I','4','2','0'): - case VLC_FOURCC('I','Y','U','V'): - case VLC_FOURCC('J','4','2','0'): + case VLC_CODEC_I420: + case VLC_CODEC_J420: p_filter->pf_video_filter = I422_I420_Filter; break; - case VLC_FOURCC('Y','V','1','2'): + case VLC_CODEC_YV12: p_filter->pf_video_filter = I422_YV12_Filter; break; - case VLC_FOURCC('Y','U','V','A'): + case VLC_CODEC_YUVA: p_filter->pf_video_filter = I422_YUVA_Filter; break; diff --git a/modules/video_chroma/i422_yuy2.c b/modules/video_chroma/i422_yuy2.c index 53dd4fd200..931a1f222b 100644 --- a/modules/video_chroma/i422_yuy2.c +++ b/modules/video_chroma/i422_yuy2.c @@ -100,34 +100,30 @@ static int Activate( vlc_object_t *p_this ) switch( p_filter->fmt_in.video.i_chroma ) { - case VLC_FOURCC('I','4','2','2'): + case VLC_CODEC_I422: switch( p_filter->fmt_out.video.i_chroma ) { - case VLC_FOURCC('Y','U','Y','2'): - case VLC_FOURCC('Y','U','N','V'): + case VLC_CODEC_YUYV: p_filter->pf_video_filter = I422_YUY2_Filter; break; - case VLC_FOURCC('Y','V','Y','U'): + case VLC_CODEC_YVYU: p_filter->pf_video_filter = I422_YVYU_Filter; break; - case VLC_FOURCC('U','Y','V','Y'): - case VLC_FOURCC('U','Y','N','V'): - case VLC_FOURCC('Y','4','2','2'): + case VLC_CODEC_UYVY: p_filter->pf_video_filter = I422_UYVY_Filter; break; - case VLC_FOURCC('I','U','Y','V'): p_filter->pf_video_filter = I422_IUYV_Filter; break; - case VLC_FOURCC('c','y','u','v'): + case VLC_CODEC_CYUV: p_filter->pf_video_filter = I422_cyuv_Filter; break; #if defined (MODULE_NAME_IS_i422_yuy2) - case VLC_FOURCC('Y','2','1','1'): + case VLC_CODEC_Y211: p_filter->pf_video_filter = I422_Y211_Filter; break; #endif diff --git a/modules/video_chroma/yuy2_i420.c b/modules/video_chroma/yuy2_i420.c index 3f3e8822ce..36919482ea 100644 --- a/modules/video_chroma/yuy2_i420.c +++ b/modules/video_chroma/yuy2_i420.c @@ -82,25 +82,22 @@ static int Activate( vlc_object_t *p_this ) switch( p_filter->fmt_out.video.i_chroma ) { - case VLC_FOURCC('I','4','2','0'): + case VLC_CODEC_I420: switch( p_filter->fmt_in.video.i_chroma ) { - case VLC_FOURCC('Y','U','Y','2'): - case VLC_FOURCC('Y','U','N','V'): + case VLC_CODEC_YUYV: p_filter->pf_video_filter = YUY2_I420_Filter; break; - case VLC_FOURCC('Y','V','Y','U'): + case VLC_CODEC_YVYU: p_filter->pf_video_filter = YVYU_I420_Filter; break; - case VLC_FOURCC('U','Y','V','Y'): - case VLC_FOURCC('U','Y','N','V'): - case VLC_FOURCC('Y','4','2','2'): + case VLC_CODEC_UYVY: p_filter->pf_video_filter = UYVY_I420_Filter; break; - case VLC_FOURCC('c','y','u','v'): + case VLC_CODEC_CYUV: p_filter->pf_video_filter = cyuv_I420_Filter; break; diff --git a/modules/video_chroma/yuy2_i422.c b/modules/video_chroma/yuy2_i422.c index 03d47fd541..c9128eb260 100644 --- a/modules/video_chroma/yuy2_i422.c +++ b/modules/video_chroma/yuy2_i422.c @@ -81,25 +81,22 @@ static int Activate( vlc_object_t *p_this ) switch( p_filter->fmt_out.video.i_chroma ) { - case VLC_FOURCC('I','4','2','2'): + case VLC_CODEC_I422: switch( p_filter->fmt_in.video.i_chroma ) { - case VLC_FOURCC('Y','U','Y','2'): - case VLC_FOURCC('Y','U','N','V'): + case VLC_CODEC_YUYV: p_filter->pf_video_filter = YUY2_I422_Filter; break; - case VLC_FOURCC('Y','V','Y','U'): + case VLC_CODEC_YVYU: p_filter->pf_video_filter = YVYU_I422_Filter; break; - case VLC_FOURCC('U','Y','V','Y'): - case VLC_FOURCC('U','Y','N','V'): - case VLC_FOURCC('Y','4','2','2'): + case VLC_CODEC_UYVY: p_filter->pf_video_filter = UYVY_I422_Filter; break; - case VLC_FOURCC('c','y','u','v'): + case VLC_CODEC_CYUV: p_filter->pf_video_filter = cyuv_I422_Filter; break; diff --git a/modules/video_filter/alphamask.c b/modules/video_filter/alphamask.c index 79999cda56..7b8806dfec 100644 --- a/modules/video_filter/alphamask.c +++ b/modules/video_filter/alphamask.c @@ -90,7 +90,7 @@ static int Create( vlc_object_t *p_this ) filter_sys_t *p_sys; char *psz_string; - if( p_filter->fmt_in.video.i_chroma != VLC_FOURCC('Y','U','V','A') ) + if( p_filter->fmt_in.video.i_chroma != VLC_CODEC_YUVA ) { msg_Err( p_filter, "Unsupported input chroma \"%4s\". " @@ -178,7 +178,7 @@ static void LoadMask( filter_t *p_filter, const char *psz_filename ) video_format_t fmt_in, fmt_out; memset( &fmt_in, 0, sizeof( video_format_t ) ); 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; if( p_filter->p_sys->p_mask ) picture_Release( p_filter->p_sys->p_mask ); p_image = image_HandlerCreate( p_filter ); diff --git a/modules/video_filter/atmo/atmo.cpp b/modules/video_filter/atmo/atmo.cpp index 2e78693a61..5c07f2ed5f 100644 --- a/modules/video_filter/atmo/atmo.cpp +++ b/modules/video_filter/atmo/atmo.cpp @@ -1192,11 +1192,8 @@ static void Atmo_SetupParameters(filter_t *p_filter) switch( p_filter->fmt_in.video.i_chroma ) { - case VLC_FOURCC('I','4','2','0'): - case VLC_FOURCC('I','Y','U','V'): - case VLC_FOURCC('Y','V','1','2'): - case VLC_FOURCC('Y','V','1','6'): - case VLC_FOURCC('Y','V','U','9'): + case VLC_CODEC_I420: + case VLC_CODEC_YV12: // simple enough? Dionoea? p_sys->pf_extract_mini_image = ExtractMiniImage_YUV; break; diff --git a/modules/video_filter/blend.c b/modules/video_filter/blend.c index 08fe36f55b..d3a86392bc 100644 --- a/modules/video_filter/blend.c +++ b/modules/video_filter/blend.c @@ -56,19 +56,19 @@ struct filter_sys_t int i_dummy; }; -#define FCC_YUVA VLC_FOURCC('Y','U','V','A') -#define FCC_YUVP VLC_FOURCC('Y','U','V','P') -#define FCC_RGBA VLC_FOURCC('R','G','B','A') - -#define FCC_I420 VLC_FOURCC('I','4','2','0') -#define FCC_YV12 VLC_FOURCC('Y','V','1','2') -#define FCC_YUY2 VLC_FOURCC('Y','U','Y','2') -#define FCC_UYVY VLC_FOURCC('U','Y','V','Y') -#define FCC_YVYU VLC_FOURCC('Y','V','Y','U') -#define FCC_RV15 VLC_FOURCC('R','V','1','5') -#define FCC_RV16 VLC_FOURCC('R','V','1','6') -#define FCC_RV24 VLC_FOURCC('R','V','2','4') -#define FCC_RV32 VLC_FOURCC('R','V','3','2') +#define FCC_YUVA VLC_CODEC_YUVA +#define FCC_YUVP VLC_CODEC_YUVP +#define FCC_RGBA VLC_CODEC_RGBA + +#define FCC_I420 VLC_CODEC_I420 +#define FCC_YV12 VLC_CODEC_YV12 +#define FCC_YUY2 VLC_CODEC_YUYV +#define FCC_UYVY VLC_CODEC_UYVY +#define FCC_YVYU VLC_CODEC_YVYU +#define FCC_RV15 VLC_CODEC_RGB15 +#define FCC_RV16 VLC_CODEC_RGB16 +#define FCC_RV24 VLC_CODEC_RGB24 +#define FCC_RV32 VLC_CODEC_RGB32 /**************************************************************************** * Local prototypes diff --git a/modules/video_filter/bluescreen.c b/modules/video_filter/bluescreen.c index e2b4442007..0316013a1a 100644 --- a/modules/video_filter/bluescreen.c +++ b/modules/video_filter/bluescreen.c @@ -112,7 +112,7 @@ static int Create( vlc_object_t *p_this ) filter_t *p_filter = (filter_t *)p_this; filter_sys_t *p_sys; - if( p_filter->fmt_in.video.i_chroma != VLC_FOURCC('Y','U','V','A') ) + if( p_filter->fmt_in.video.i_chroma != VLC_CODEC_YUVA ) { msg_Err( p_filter, "Unsupported input chroma \"%4s\". " @@ -174,7 +174,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic ) uint8_t *p_v = p_pic->p[ V_PLANE ].p_pixels; uint8_t umin, umax, vmin, vmax; - if( p_pic->format.i_chroma != VLC_FOURCC('Y','U','V','A') ) + if( p_pic->format.i_chroma != VLC_CODEC_YUVA ) { msg_Err( p_filter, "Unsupported input chroma \"%4s\". " diff --git a/modules/video_filter/chain.c b/modules/video_filter/chain.c index d56f67e5e8..fa8650b2e0 100644 --- a/modules/video_filter/chain.c +++ b/modules/video_filter/chain.c @@ -60,10 +60,10 @@ static void EsFormatMergeSize( es_format_t *p_dst, const es_format_t *p_size ); static const vlc_fourcc_t pi_allowed_chromas[] = { - VLC_FOURCC('I','4','2','0'), - VLC_FOURCC('I','4','2','2'), - VLC_FOURCC('R','V','3','2'), - VLC_FOURCC('R','V','2','4'), + VLC_CODEC_I420, + VLC_CODEC_I422, + VLC_CODEC_RGB32, + VLC_CODEC_RGB24, 0 }; diff --git a/modules/video_filter/crop.c b/modules/video_filter/crop.c index 355b0292f8..e27a77121a 100644 --- a/modules/video_filter/crop.c +++ b/modules/video_filter/crop.c @@ -554,15 +554,13 @@ static bool NonBlackLine(uint8_t *p_in, int i_line, int i_pitch, switch(i_chroma) { // 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_FOURCC('I','Y','U','V'): - case VLC_FOURCC('I','4','1','1'): - case VLC_FOURCC('I','4','1','0'): - case VLC_FOURCC('Y','V','U','9'): - case VLC_FOURCC('Y','U','V','A'): + case VLC_CODEC_I444: + case VLC_CODEC_I422: + case VLC_CODEC_I420: + case VLC_CODEC_YV12: + case VLC_CODEC_I411: + case VLC_CODEC_I410: + case VLC_CODEC_YUVA: i_skipCount = (i_pitch * i_skipCountPercent) / 100; for (i_index = i_col/2 + i_skipCount/2; i_index <= i_visible_pitch/2 + i_col/2 - i_skipCount/2; @@ -573,7 +571,7 @@ static bool NonBlackLine(uint8_t *p_in, int i_line, int i_pitch, } break; // packed RGB - case VLC_FOURCC('R','G','B','2'): // packed by 1 + case VLC_CODEC_RGB8: // packed by 1 i_skipCount = (i_pitch * i_skipCountPercent) / 100; for (i_index = i_col/2 + i_skipCount/2; i_index <= i_visible_pitch/2 + i_col/2 - i_skipCount/2; @@ -583,8 +581,8 @@ static bool NonBlackLine(uint8_t *p_in, int i_line, int i_pitch, if (i_count > i_nonBlackPixel) break; } break; - case VLC_FOURCC('R','V','1','5'): // packed by 2 - case VLC_FOURCC('R','V','1','6'): // packed by 2 + case VLC_CODEC_RGB15: // packed by 2 + case VLC_CODEC_RGB16: // packed by 2 i_skipCount = (i_pitch * i_skipCountPercent) / 100; for (i_index = i_col/2 + i_skipCount/2 - (i_col/2 + i_skipCount/2) % 2; @@ -596,7 +594,7 @@ static bool NonBlackLine(uint8_t *p_in, int i_line, int i_pitch, if (i_count > i_nonBlackPixel) break; } break; - case VLC_FOURCC('R','V','2','4'): // packed by 3 + case VLC_CODEC_RGB24: // packed by 3 i_skipCount = (i_pitch * i_skipCountPercent) / 100; for (i_index = i_col/2 + i_skipCount/2 - (i_col/2 + i_skipCount/2) % 3; i_index <= i_visible_pitch/2 + i_col/2 - i_skipCount/2; i_index+=3) { @@ -606,7 +604,7 @@ static bool NonBlackLine(uint8_t *p_in, int i_line, int i_pitch, if (i_count > i_nonBlackPixel) break; } break; - case VLC_FOURCC('R','V','3','2'): // packed by 4 + case VLC_CODEC_RGB32: // packed by 4 i_skipCount = (i_pitch * i_skipCountPercent) / 100; for (i_index = i_col/2 + i_skipCount/2 - (i_col/2 + i_skipCount/2) % 4; i_index <= i_visible_pitch/2 + i_col/2 - i_skipCount/2; i_index+=4) { @@ -615,11 +613,8 @@ static bool NonBlackLine(uint8_t *p_in, int i_line, int i_pitch, } break; // packed YUV - case VLC_FOURCC('Y','U','Y','2'): // packed by 2 - case VLC_FOURCC('Y','U','N','V'): // packed by 2 - case VLC_FOURCC('U','Y','V','Y'): // packed by 2 - case VLC_FOURCC('U','Y','N','V'): // packed by 2 - case VLC_FOURCC('Y','4','2','2'): // packed by 2 + case VLC_CODEC_YUYV: // packed by 2 + case VLC_CODEC_UYVY: // packed by 2 i_skipCount = (i_pitch * i_skipCountPercent) / 100; for (i_index = (i_col/2 + i_skipCount/2) - (i_col/2 + i_skipCount/2) % 2; @@ -736,7 +731,7 @@ static void UpdateStats( vout_thread_t *p_vout, picture_t *p_pic ) /* Determine where black borders are */ switch( p_vout->output.i_chroma ) { - case VLC_FOURCC('I','4','2','0'): + case VLC_CODEC_I420: /* XXX: Do not laugh ! I know this is very naive. But it's just a * proof of concept code snippet... */ for( i = i_lines ; i-- ; ) diff --git a/modules/video_filter/deinterlace.c b/modules/video_filter/deinterlace.c index 08f135d870..0460fd952e 100644 --- a/modules/video_filter/deinterlace.c +++ b/modules/video_filter/deinterlace.c @@ -310,7 +310,7 @@ static void SetFilterMethod( vout_thread_t *p_vout, char *psz_method ) } else { - const bool b_i422 = p_vout->render.i_chroma == VLC_FOURCC('I','4','2','2'); + const bool b_i422 = p_vout->render.i_chroma == VLC_CODEC_I422; if( strcmp( psz_method, "discard" ) ) msg_Err( p_vout, "no valid deinterlace mode provided, " "using \"discard\"" ); @@ -336,17 +336,17 @@ static void GetOutputFormat( vout_thread_t *p_vout, p_dst->i_sar_den *= 2; } - if( p_src->i_chroma == VLC_FOURCC('I','4','2','2') ) + if( p_src->i_chroma == VLC_CODEC_I422 ) { switch( p_vout->p_sys->i_mode ) { case DEINTERLACE_MEAN: case DEINTERLACE_LINEAR: case DEINTERLACE_X: - p_dst->i_chroma = VLC_FOURCC('I','4','2','2'); + p_dst->i_chroma = VLC_CODEC_I422; break; default: - p_dst->i_chroma = VLC_FOURCC('I','4','2','0'); + p_dst->i_chroma = VLC_CODEC_I420; break; } } @@ -354,10 +354,9 @@ static void GetOutputFormat( vout_thread_t *p_vout, static bool IsChromaSupported( vlc_fourcc_t i_chroma ) { - return i_chroma == VLC_FOURCC('I','4','2','0') || - i_chroma == VLC_FOURCC('I','Y','U','V') || - i_chroma == VLC_FOURCC('Y','V','1','2') || - i_chroma == VLC_FOURCC('I','4','2','2'); + return i_chroma == VLC_CODEC_I420 || + i_chroma == VLC_CODEC_YV12 || + i_chroma == VLC_CODEC_I422; } /***************************************************************************** @@ -608,9 +607,8 @@ static void RenderDiscard( vout_thread_t *p_vout, switch( p_vout->render.i_chroma ) { - case VLC_FOURCC('I','4','2','0'): - case VLC_FOURCC('I','Y','U','V'): - case VLC_FOURCC('Y','V','1','2'): + case VLC_CODEC_I420: + case VLC_CODEC_YV12: for( ; p_out < p_out_end ; ) { @@ -621,7 +619,7 @@ static void RenderDiscard( vout_thread_t *p_vout, } break; - case VLC_FOURCC('I','4','2','2'): + case VLC_CODEC_I422: i_increment = 2 * p_pic->p[i_plane].i_pitch; @@ -673,9 +671,8 @@ static void RenderBob( vout_thread_t *p_vout, switch( p_vout->render.i_chroma ) { - case VLC_FOURCC('I','4','2','0'): - case VLC_FOURCC('I','Y','U','V'): - case VLC_FOURCC('Y','V','1','2'): + case VLC_CODEC_I420: + case VLC_CODEC_YV12: /* For BOTTOM field we need to add the first line */ if( i_field == 1 ) { @@ -709,7 +706,7 @@ static void RenderBob( vout_thread_t *p_vout, } break; - case VLC_FOURCC('I','4','2','2'): + case VLC_CODEC_I422: /* For BOTTOM field we need to add the first line */ if( i_field == 1 ) { @@ -863,9 +860,8 @@ static void RenderBlend( vout_thread_t *p_vout, switch( p_vout->render.i_chroma ) { - case VLC_FOURCC('I','4','2','0'): - case VLC_FOURCC('I','Y','U','V'): - case VLC_FOURCC('Y','V','1','2'): + case VLC_CODEC_I420: + case VLC_CODEC_YV12: /* First line: simple copy */ vlc_memcpy( p_out, p_in, p_pic->p[i_plane].i_pitch ); p_out += p_outpic->p[i_plane].i_pitch; @@ -881,7 +877,7 @@ static void RenderBlend( vout_thread_t *p_vout, } break; - case VLC_FOURCC('I','4','2','2'): + case VLC_CODEC_I422: /* First line: simple copy */ vlc_memcpy( p_out, p_in, p_pic->p[i_plane].i_pitch ); p_out += p_outpic->p[i_plane].i_pitch; diff --git a/modules/video_filter/dynamicoverlay/dynamicoverlay.c b/modules/video_filter/dynamicoverlay/dynamicoverlay.c index 8d2fce48f1..da647e2555 100644 --- a/modules/video_filter/dynamicoverlay/dynamicoverlay.c +++ b/modules/video_filter/dynamicoverlay/dynamicoverlay.c @@ -355,7 +355,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date ) (char*)&p_overlay->format.i_chroma, p_overlay->i_x, p_overlay->i_y, p_overlay->i_alpha ); - if( p_overlay->format.i_chroma == VLC_FOURCC('T','E','X','T') ) + if( p_overlay->format.i_chroma == VLC_CODEC_TEXT ) { p_region->psz_text = strdup( p_overlay->data.p_text ); p_region->p_style = text_style_Duplicate( p_overlay->p_fontstyle ); diff --git a/modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c b/modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c index 95bdd85d95..02710b94af 100644 --- a/modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c +++ b/modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c @@ -437,7 +437,7 @@ static int exec_DataSharedMem( filter_t *p_filter, } i_size = shminfo.shm_segsz; - if( p_params->fourcc == VLC_FOURCC('T','E','X','T') ) + if( p_params->fourcc == VLC_CODEC_TEXT ) { char *p_data; @@ -465,7 +465,7 @@ static int exec_DataSharedMem( filter_t *p_filter, return VLC_ENOMEM; } - vout_InitFormat( &p_ovl->format, VLC_FOURCC('T','E','X','T'), + vout_InitFormat( &p_ovl->format, VLC_CODEC_TEXT, 0, 0, 0 ); p_data = shmat( p_params->i_shmid, NULL, SHM_RDONLY ); diff --git a/modules/video_filter/erase.c b/modules/video_filter/erase.c index faddc8ea36..0a80eb74c9 100644 --- a/modules/video_filter/erase.c +++ b/modules/video_filter/erase.c @@ -100,7 +100,7 @@ static void LoadMask( filter_t *p_filter, const char *psz_filename ) picture_t *p_old_mask = p_filter->p_sys->p_mask; memset( &fmt_in, 0, sizeof( video_format_t ) ); 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; p_image = image_HandlerCreate( p_filter ); p_filter->p_sys->p_mask = image_ReadUrl( p_image, psz_filename, &fmt_in, &fmt_out ); @@ -128,13 +128,12 @@ static int Create( vlc_object_t *p_this ) switch( p_filter->fmt_in.video.i_chroma ) { - case VLC_FOURCC('I','4','2','0'): - case VLC_FOURCC('I','Y','U','V'): - case VLC_FOURCC('J','4','2','0'): - case VLC_FOURCC('Y','V','1','2'): + case VLC_CODEC_I420: + case VLC_CODEC_J420: + case VLC_CODEC_YV12: - case VLC_FOURCC('I','4','2','2'): - case VLC_FOURCC('J','4','2','2'): + case VLC_CODEC_I422: + case VLC_CODEC_J422: break; default: @@ -248,8 +247,8 @@ static void FilterErase( filter_t *p_filter, picture_t *p_inpic, int i_width = i_mask_visible_pitch; const bool b_line_factor = ( i_plane /* U_PLANE or V_PLANE */ && - !( p_inpic->format.i_chroma == VLC_FOURCC('I','4','2','2') - || p_inpic->format.i_chroma == VLC_FOURCC('J','4','2','2') ) ); + !( p_inpic->format.i_chroma == VLC_CODEC_I422 + || p_inpic->format.i_chroma == VLC_CODEC_J422 ) ); if( i_plane ) /* U_PLANE or V_PLANE */ { diff --git a/modules/video_filter/extract.c b/modules/video_filter/extract.c index 5515bfddc8..fc8407b7f0 100644 --- a/modules/video_filter/extract.c +++ b/modules/video_filter/extract.c @@ -106,13 +106,12 @@ static int Create( vlc_object_t *p_this ) switch( p_filter->fmt_in.video.i_chroma ) { - case VLC_FOURCC('I','4','2','0'): - case VLC_FOURCC('I','Y','U','V'): - case VLC_FOURCC('J','4','2','0'): - case VLC_FOURCC('Y','V','1','2'): + case VLC_CODEC_I420: + case VLC_CODEC_J420: + case VLC_CODEC_YV12: - case VLC_FOURCC('I','4','2','2'): - case VLC_FOURCC('J','4','2','2'): + case VLC_CODEC_I422: + case VLC_CODEC_J422: CASE_PACKED_YUV_422 break; @@ -181,10 +180,9 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic ) switch( p_pic->format.i_chroma ) { - case VLC_FOURCC('I','4','2','0'): - case VLC_FOURCC('I','Y','U','V'): - case VLC_FOURCC('J','4','2','0'): - case VLC_FOURCC('Y','V','1','2'): + case VLC_CODEC_I420: + case VLC_CODEC_J420: + case VLC_CODEC_YV12: switch( p_filter->p_sys->i_color ) { case RED: @@ -207,8 +205,8 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic ) } break; - case VLC_FOURCC('I','4','2','2'): - case VLC_FOURCC('J','4','2','2'): + case VLC_CODEC_I422: + case VLC_CODEC_J422: switch( p_filter->p_sys->i_color ) { case RED: diff --git a/modules/video_filter/filter_picture.h b/modules/video_filter/filter_picture.h index b39a26637c..c5b4473aa2 100644 --- a/modules/video_filter/filter_picture.h +++ b/modules/video_filter/filter_picture.h @@ -23,56 +23,48 @@ /* FIXME: do all of these really have square pixels? */ #define CASE_PLANAR_YUV_SQUARE \ - case VLC_FOURCC('I','4','2','0'): \ - case VLC_FOURCC('I','Y','U','V'): \ - case VLC_FOURCC('J','4','2','0'): \ - case VLC_FOURCC('Y','V','1','2'): \ - case VLC_FOURCC('I','4','1','1'): \ - case VLC_FOURCC('I','4','1','0'): \ - case VLC_FOURCC('Y','V','U','9'): \ - case VLC_FOURCC('I','4','4','4'): \ - case VLC_FOURCC('J','4','4','4'): \ - case VLC_FOURCC('Y','U','V','A'): + case VLC_CODEC_I420: \ + case VLC_CODEC_J420: \ + case VLC_CODEC_YV12: \ + case VLC_CODEC_I411: \ + case VLC_CODEC_I410: \ + case VLC_CODEC_I444: \ + case VLC_CODEC_J444: \ + case VLC_CODEC_YUVA: #define CASE_PLANAR_YUV_NONSQUARE \ - case VLC_FOURCC('I','4','2','2'): \ - case VLC_FOURCC('J','4','2','2'): + case VLC_CODEC_I422: \ + case VLC_CODEC_J422: #define CASE_PLANAR_YUV \ CASE_PLANAR_YUV_SQUARE \ CASE_PLANAR_YUV_NONSQUARE \ #define CASE_PACKED_YUV_422 \ - case VLC_FOURCC('U','Y','V','Y'): \ - case VLC_FOURCC('U','Y','N','V'): \ - case VLC_FOURCC('Y','4','2','2'): \ - case VLC_FOURCC('c','y','u','v'): \ - case VLC_FOURCC('Y','U','Y','2'): \ - case VLC_FOURCC('Y','U','N','V'): \ - case VLC_FOURCC('Y','V','Y','U'): + case VLC_CODEC_UYVY: \ + case VLC_CODEC_CYUV: \ + case VLC_CODEC_YUYV: \ + case VLC_CODEC_YVYU: static inline int GetPackedYuvOffsets( vlc_fourcc_t i_chroma, int *i_y_offset, int *i_u_offset, int *i_v_offset ) { switch( i_chroma ) { - case VLC_FOURCC('U','Y','V','Y'): - case VLC_FOURCC('U','Y','N','V'): - case VLC_FOURCC('Y','4','2','2'): - case VLC_FOURCC('c','y','u','v'): /* <-- FIXME: reverted, whatever that means */ + case VLC_CODEC_UYVY: + case VLC_CODEC_CYUV: /* <-- FIXME: reverted, whatever that means */ /* UYVY */ *i_y_offset = 1; *i_u_offset = 0; *i_v_offset = 2; return VLC_SUCCESS; - case VLC_FOURCC('Y','U','Y','2'): - case VLC_FOURCC('Y','U','N','V'): + case VLC_CODEC_YUYV: /* YUYV */ *i_y_offset = 0; *i_u_offset = 1; *i_v_offset = 3; return VLC_SUCCESS; - case VLC_FOURCC('Y','V','Y','U'): + case VLC_CODEC_YVYU: /* YVYU */ *i_y_offset = 0; *i_u_offset = 3; diff --git a/modules/video_filter/gaussianblur.c b/modules/video_filter/gaussianblur.c index a8f96efc68..8f62c315dc 100644 --- a/modules/video_filter/gaussianblur.c +++ b/modules/video_filter/gaussianblur.c @@ -123,13 +123,12 @@ static int Create( vlc_object_t *p_this ) { filter_t *p_filter = (filter_t *)p_this; - if( p_filter->fmt_in.video.i_chroma != VLC_FOURCC('I','4','2','0') - && p_filter->fmt_in.video.i_chroma != VLC_FOURCC('I','Y','U','V') - && p_filter->fmt_in.video.i_chroma != VLC_FOURCC('J','4','2','0') - && p_filter->fmt_in.video.i_chroma != VLC_FOURCC('Y','V','1','2') + if( p_filter->fmt_in.video.i_chroma != VLC_CODEC_I420 + && p_filter->fmt_in.video.i_chroma != VLC_CODEC_J420 + && p_filter->fmt_in.video.i_chroma != VLC_CODEC_YV12 - && p_filter->fmt_in.video.i_chroma != VLC_FOURCC('I','4','2','2') - && p_filter->fmt_in.video.i_chroma != VLC_FOURCC('J','4','2','2') + && p_filter->fmt_in.video.i_chroma != VLC_CODEC_I422 + && p_filter->fmt_in.video.i_chroma != VLC_CODEC_J422 ) { /* We only want planar YUV 4:2:0 or 4:2:2 */ diff --git a/modules/video_filter/invert.c b/modules/video_filter/invert.c index 1f1cd71aae..3eb6bf7037 100644 --- a/modules/video_filter/invert.c +++ b/modules/video_filter/invert.c @@ -121,7 +121,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic ) return NULL; } - if( p_pic->format.i_chroma == VLC_FOURCC('Y','U','V','A') ) + if( p_pic->format.i_chroma == VLC_CODEC_YUVA ) { /* We don't want to invert the alpha plane */ i_planes = p_pic->i_planes - 1; diff --git a/modules/video_filter/logo.c b/modules/video_filter/logo.c index ebc137a048..5613a9bc02 100644 --- a/modules/video_filter/logo.c +++ b/modules/video_filter/logo.c @@ -179,7 +179,7 @@ static picture_t *LoadImage( vlc_object_t *p_this, char *psz_filename ) memset( &fmt_in, 0, sizeof(video_format_t) ); 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; p_image = image_HandlerCreate( p_this ); p_pic = image_ReadUrl( p_image, psz_filename, &fmt_in, &fmt_out ); image_HandlerDelete( p_image ); @@ -392,7 +392,7 @@ static int Init( vout_thread_t *p_vout ) p_sys->p_blend->fmt_in.video.i_y_offset = 0; p_sys->p_blend->fmt_out.video.i_aspect = p_vout->render.i_aspect; p_sys->p_blend->fmt_out.video.i_chroma = p_vout->output.i_chroma; - p_sys->p_blend->fmt_in.video.i_chroma = VLC_FOURCC('Y','U','V','A'); + p_sys->p_blend->fmt_in.video.i_chroma = VLC_CODEC_YUVA; p_sys->p_blend->fmt_in.video.i_aspect = VOUT_ASPECT_FACTOR; p_sys->i_width = p_sys->p_blend->fmt_in.video.i_width = @@ -821,7 +821,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date ) /* Create new SPU region */ memset( &fmt, 0, sizeof(video_format_t) ); - fmt.i_chroma = VLC_FOURCC('Y','U','V','A'); + fmt.i_chroma = VLC_CODEC_YUVA; fmt.i_aspect = VOUT_ASPECT_FACTOR; fmt.i_sar_num = fmt.i_sar_den = 1; fmt.i_width = fmt.i_visible_width = p_pic->p[Y_PLANE].i_visible_pitch; diff --git a/modules/video_filter/magnify.c b/modules/video_filter/magnify.c index aef6837a77..b5c080cd2e 100644 --- a/modules/video_filter/magnify.c +++ b/modules/video_filter/magnify.c @@ -114,7 +114,7 @@ static int Create( vlc_object_t *p_this ) switch( p_vout->fmt_in.i_chroma ) { CASE_PLANAR_YUV - case VLC_FOURCC('G','R','E','Y'): + case VLC_CODEC_GREY: break; default: msg_Err( p_vout, "Unsupported chroma" ); diff --git a/modules/video_filter/marq.c b/modules/video_filter/marq.c index 1d8388b7a7..8c18c30f03 100644 --- a/modules/video_filter/marq.c +++ b/modules/video_filter/marq.c @@ -283,7 +283,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date ) goto out; 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 = 0; diff --git a/modules/video_filter/mosaic.c b/modules/video_filter/mosaic.c index fdc506c31b..c01810f687 100644 --- a/modules/video_filter/mosaic.c +++ b/modules/video_filter/mosaic.c @@ -598,11 +598,11 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date ) fmt_in.i_height = p_es->p_picture->format.i_height; fmt_in.i_width = p_es->p_picture->format.i_width; - if( fmt_in.i_chroma == VLC_FOURCC('Y','U','V','A') || - fmt_in.i_chroma == VLC_FOURCC('R','G','B','A') ) - fmt_out.i_chroma = VLC_FOURCC('Y','U','V','A'); + if( fmt_in.i_chroma == VLC_CODEC_YUVA || + fmt_in.i_chroma == VLC_CODEC_RGBA ) + fmt_out.i_chroma = VLC_CODEC_YUVA; else - fmt_out.i_chroma = VLC_FOURCC('I','4','2','0'); + fmt_out.i_chroma = VLC_CODEC_I420; fmt_out.i_width = col_inner_width; fmt_out.i_height = row_inner_height; diff --git a/modules/video_filter/motiondetect.c b/modules/video_filter/motiondetect.c index aaf8f3149d..04052251d9 100644 --- a/modules/video_filter/motiondetect.c +++ b/modules/video_filter/motiondetect.c @@ -198,16 +198,15 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_inpic ) int i_chroma_dy; switch( p_inpic->format.i_chroma ) { - case VLC_FOURCC('I','4','2','0'): - case VLC_FOURCC('I','Y','U','V'): - case VLC_FOURCC('J','4','2','0'): - case VLC_FOURCC('Y','V','1','2'): + case VLC_CODEC_I420: + case VLC_CODEC_J420: + case VLC_CODEC_YV12: i_chroma_dx = 2; i_chroma_dy = 2; break; - case VLC_FOURCC('I','4','2','2'): - case VLC_FOURCC('J','4','2','2'): + case VLC_CODEC_I422: + case VLC_CODEC_J422: i_chroma_dx = 2; i_chroma_dy = 1; break; diff --git a/modules/video_filter/opencv_example.cpp b/modules/video_filter/opencv_example.cpp index e1fe03e2f1..3d899e55d3 100644 --- a/modules/video_filter/opencv_example.cpp +++ b/modules/video_filter/opencv_example.cpp @@ -174,7 +174,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic ) msg_Err( p_filter, "no image" ); return NULL; } - if ((p_pic->format.i_chroma != VLC_FOURCC('I','4','2','0'))) + if ((p_pic->format.i_chroma != VLC_CODEC_I420)) { msg_Err( p_filter, "wrong chroma - use I420" ); return NULL; diff --git a/modules/video_filter/opencv_wrapper.c b/modules/video_filter/opencv_wrapper.c index ca48f23c5e..6825ba38ed 100644 --- a/modules/video_filter/opencv_wrapper.c +++ b/modules/video_filter/opencv_wrapper.c @@ -318,9 +318,9 @@ static int Init( vout_thread_t *p_vout ) fmt.i_y_offset = fmt.i_y_offset * p_sys->f_scale; if (p_sys->i_internal_chroma == GREY) - fmt.i_chroma = VLC_FOURCC('I','4','2','0'); + fmt.i_chroma = VLC_CODEC_I420; else if (p_sys->i_internal_chroma == RGB) - fmt.i_chroma = VLC_FOURCC('R','V','3','2'); + fmt.i_chroma = VLC_CODEC_RGB32; } /* Load the internal opencv filter */ @@ -463,13 +463,13 @@ static void VlcPictureToIplImage( vout_thread_t *p_vout, picture_t *p_in ) //rgb2 gives 3 separate planes, this gives 1 interleaved plane //rv24 gives is about 20% faster but gives r&b the wrong way round //and I cant think of an easy way to fix this - fmt_out.i_chroma = VLC_FOURCC('R','V','3','2'); + fmt_out.i_chroma = VLC_CODEC_RGB32; } else if (p_sys->i_internal_chroma == GREY) { //take the I (gray) plane (video seems to commonly be in this fmt so usually the //conversion does nothing) - fmt_out.i_chroma = VLC_FOURCC('I','4','2','0'); + fmt_out.i_chroma = VLC_CODEC_I420; } //convert from the input image diff --git a/modules/video_filter/osdmenu.c b/modules/video_filter/osdmenu.c index 82816578b1..25e5f3b8e7 100644 --- a/modules/video_filter/osdmenu.c +++ b/modules/video_filter/osdmenu.c @@ -262,7 +262,7 @@ static int CreateFilter ( vlc_object_t *p_this ) MouseEvent, p_sys ); } - es_format_Init( &p_filter->fmt_out, SPU_ES, VLC_FOURCC( 's','p','u',' ' ) ); + es_format_Init( &p_filter->fmt_out, SPU_ES, VLC_CODEC_SPU ); p_filter->fmt_out.i_priority = 0; return VLC_SUCCESS; @@ -369,7 +369,7 @@ static subpicture_region_t *create_text_region( filter_t *p_filter, subpicture_t /* 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_sar_num = fmt.i_sar_den = 1; fmt.i_width = fmt.i_visible_width = i_width; @@ -407,13 +407,13 @@ static subpicture_region_t *create_picture_region( filter_t *p_filter, subpictur /* Create new SPU region */ memset( &fmt, 0, sizeof(video_format_t) ); - fmt.i_chroma = (p_pic == NULL) ? VLC_FOURCC('Y','U','V','P') : VLC_FOURCC('Y','U','V','A'); + fmt.i_chroma = (p_pic == NULL) ? VLC_CODEC_YUVP : VLC_CODEC_YUVA; fmt.i_aspect = VOUT_ASPECT_FACTOR; fmt.i_sar_num = fmt.i_sar_den = 1; fmt.i_width = fmt.i_visible_width = i_width; fmt.i_height = fmt.i_visible_height = i_height; fmt.i_x_offset = fmt.i_y_offset = 0; - if( fmt.i_chroma == VLC_FOURCC('Y','U','V','P') ) + if( fmt.i_chroma == VLC_CODEC_YUVP ) { fmt.p_palette = &palette; fmt.p_palette->i_entries = 0; diff --git a/modules/video_filter/panoramix.c b/modules/video_filter/panoramix.c index 73c92814fb..8b4467a379 100644 --- a/modules/video_filter/panoramix.c +++ b/modules/video_filter/panoramix.c @@ -307,43 +307,38 @@ static int Create( vlc_object_t *p_this ) p_vout->pf_manage = NULL; /* Color Format not supported // Planar Y, packed UV -case VLC_FOURCC('Y','M','G','A'): +case VLC_CODEC_YMGA: // Packed YUV 4:2:2, U:Y:V:Y, interlaced case VLC_FOURCC('I','U','Y','V'): // packed by 2 // Packed YUV 2:1:1, Y:U:Y:V -case VLC_FOURCC('Y','2','1','1'): // packed by 4 +case VLC_CODEC_Y211: // packed by 4 // Packed YUV Reverted -case VLC_FOURCC('c','y','u','v'): // packed by 2 +case VLC_CODEC_CYUV: // packed by 2 */ switch (p_vout->render.i_chroma) { // 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_FOURCC('I','Y','U','V'): - case VLC_FOURCC('I','4','1','1'): - case VLC_FOURCC('I','4','1','0'): - case VLC_FOURCC('Y','V','U','9'): - case VLC_FOURCC('Y','U','V','A'): + case VLC_CODEC_I444: + case VLC_CODEC_I422: + case VLC_CODEC_I420: + case VLC_CODEC_YV12: + case VLC_CODEC_I411: + case VLC_CODEC_I410: + case VLC_CODEC_YUVA: p_vout->pf_render = RenderPlanarYUV; break; // packed RGB - case VLC_FOURCC('R','G','B','2'): // packed by 1 - case VLC_FOURCC('R','V','1','5'): // packed by 2 - case VLC_FOURCC('R','V','1','6'): // packed by 2 - case VLC_FOURCC('R','V','2','4'): // packed by 3 - case VLC_FOURCC('R','V','3','2'): // packed by 4 + case VLC_CODEC_RGB8: // packed by 1 + case VLC_CODEC_RGB15: // packed by 2 + case VLC_CODEC_RGB16: // packed by 2 + case VLC_CODEC_RGB24: // packed by 3 + case VLC_CODEC_RGB32: // packed by 4 p_vout->pf_render = RenderPackedRGB; break; #ifdef PACKED_YUV // packed YUV - case VLC_FOURCC('Y','U','Y','2'): // packed by 2 - case VLC_FOURCC('Y','U','N','V'): // packed by 2 - case VLC_FOURCC('U','Y','V','Y'): // packed by 2 - case VLC_FOURCC('U','Y','N','V'): // packed by 2 - case VLC_FOURCC('Y','4','2','2'): // packed by 2 + case VLC_CODEC_YUYV: // packed by 2 + case VLC_CODEC_UYVY: // packed by 2 p_vout->pf_render = RenderPackedYUV; break; #endif @@ -700,29 +695,24 @@ static int Init( vout_thread_t *p_vout ) switch (p_vout->render.i_chroma) { // planar YVU - case VLC_FOURCC('Y','V','1','2'): - case VLC_FOURCC('Y','V','U','9'): + case VLC_CODEC_YV12: // packed UYV - case VLC_FOURCC('U','Y','V','Y'): // packed by 2 - case VLC_FOURCC('U','Y','N','V'): // packed by 2 - case VLC_FOURCC('Y','4','2','2'): // packed by 2 - // case VLC_FOURCC('c','y','u','v'): // packed by 2 + case VLC_CODEC_UYVY: // packed by 2 + // case VLC_CODEC_CYUV: // packed by 2 VLC_XCHG( float, p_vout->p_sys->f_gamma[1], p_vout->p_sys->f_gamma[2] ); VLC_XCHG( float, f_BlackCrush[1], f_BlackCrush[2] ); VLC_XCHG( float, f_WhiteCrush[1], f_WhiteCrush[2] ); VLC_XCHG( float, f_BlackLevel[1], f_BlackLevel[2] ); VLC_XCHG( float, f_WhiteLevel[1], f_WhiteLevel[2] ); // 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('I','4','1','1'): - case VLC_FOURCC('I','4','1','0'): - case VLC_FOURCC('I','Y','U','V'): - case VLC_FOURCC('Y','U','V','A'): + case VLC_CODEC_I444: + case VLC_CODEC_I422: + case VLC_CODEC_I420: + case VLC_CODEC_I411: + case VLC_CODEC_I410: + case VLC_CODEC_YUVA: // packed YUV - case VLC_FOURCC('Y','U','Y','2'): // packed by 2 - case VLC_FOURCC('Y','U','N','V'): // packed by 2 + case VLC_CODEC_YUYV: // packed by 2 for (i_index = 0; i_index < 256; i_index++) for (i_index2 = 0; i_index2 <= ACCURACY; i_index2++) for (i_plane = 0; i_plane < VOUT_MAX_PLANES; i_plane++) @@ -735,11 +725,11 @@ static int Init( vout_thread_t *p_vout ) } break; // packed RGB - case VLC_FOURCC('R','G','B','2'): // packed by 1 - case VLC_FOURCC('R','V','1','5'): // packed by 2 - case VLC_FOURCC('R','V','1','6'): // packed by 2 - case VLC_FOURCC('R','V','2','4'): // packed by 3 - case VLC_FOURCC('R','V','3','2'): // packed by 4 + case VLC_CODEC_RGB8: // packed by 1 + case VLC_CODEC_RGB15: // packed by 2 + case VLC_CODEC_RGB16: // packed by 2 + case VLC_CODEC_RGB24: // packed by 3 + case VLC_CODEC_RGB32: // packed by 4 for (i_index = 0; i_index < 256; i_index++) for (i_index2 = 0; i_index2 <= ACCURACY; i_index2++) for (i_plane = 0; i_plane < VOUT_MAX_PLANES; i_plane++) @@ -1651,8 +1641,7 @@ static void RenderPackedYUV( vout_thread_t *p_vout, picture_t *p_pic ) #endif switch (p_vout->output.i_chroma) { - case VLC_FOURCC('Y','U','Y','2'): // packed by 2 - case VLC_FOURCC('Y','U','N','V'): // packed by 2 + case VLC_CODEC_YUYV: // packed by 2 Denom = F2(length / p_pic->p->i_pixel_pitch); a_2 = p_vout->p_sys->a_2 * (ACCURACY / 100); a_1 = p_vout->p_sys->a_1 * 2 * p_vout->p_sys->i_halfLength * (ACCURACY / 100); @@ -1672,9 +1661,7 @@ static void RenderPackedYUV( vout_thread_t *p_vout, picture_t *p_pic ) p_vout->p_sys->cstYUV[i_col][1][i_index + 1] = p_vout->p_sys->cstYUV[i_col][1][i_index]; } break; - case VLC_FOURCC('U','Y','V','Y'): // packed by 2 - case VLC_FOURCC('U','Y','N','V'): // packed by 2 - case VLC_FOURCC('Y','4','2','2'): // packed by 2 + case VLC_CODEC_UYVY: // packed by 2 Denom = F2(length / p_pic->p->i_pixel_pitch); a_2 = p_vout->p_sys->a_2 * (ACCURACY / 100); a_1 = p_vout->p_sys->a_1 * 2 * p_vout->p_sys->i_halfLength * (ACCURACY / 100); @@ -1740,8 +1727,7 @@ static void RenderPackedYUV( vout_thread_t *p_vout, picture_t *p_pic ) #endif switch (p_vout->output.i_chroma) { - case VLC_FOURCC('Y','U','Y','2'): // packed by 2 - case VLC_FOURCC('Y','U','N','V'): // packed by 2 + case VLC_CODEC_YUYV: // packed by 2 Denom = F2(length / p_pic->p->i_pixel_pitch); a_2 = p_vout->p_sys->a_2 * (ACCURACY / 100); a_1 = p_vout->p_sys->a_1 * 2 * p_vout->p_sys->i_halfHeight * (ACCURACY / 100); @@ -1761,9 +1747,7 @@ static void RenderPackedYUV( vout_thread_t *p_vout, picture_t *p_pic ) p_vout->p_sys->cstYUV2[i_row][1][i_index + 1] = p_vout->p_sys->cstYUV2[i_row][1][i_index]; } break; - case VLC_FOURCC('U','Y','V','Y'): // packed by 2 - case VLC_FOURCC('U','Y','N','V'): // packed by 2 - case VLC_FOURCC('Y','4','2','2'): // packed by 2 + case VLC_CODEC_UYVY: // packed by 2 Denom = F2(length / p_pic->p->i_pixel_pitch); a_2 = p_vout->p_sys->a_2 * (ACCURACY / 100); a_1 = p_vout->p_sys->a_1 * 2 * p_vout->p_sys->i_halfHeight * (ACCURACY / 100); diff --git a/modules/video_filter/postproc.c b/modules/video_filter/postproc.c index db9e56d0e5..2779c098a1 100644 --- a/modules/video_filter/postproc.c +++ b/modules/video_filter/postproc.c @@ -140,22 +140,21 @@ static int OpenPostproc( vlc_object_t *p_this ) switch( p_filter->fmt_in.video.i_chroma ) { - case VLC_FOURCC('I','4','4','4'): - case VLC_FOURCC('J','4','4','4'): - /* case VLC_FOURCC('Y','U','V','A'): FIXME Should work but alpha plane needs to be copied manually and I'm kind of feeling too lazy to write the code to do that ATM (i_pitch vs i_visible_pitch...). */ + case VLC_CODEC_I444: + case VLC_CODEC_J444: + /* case VLC_CODEC_YUVA: FIXME Should work but alpha plane needs to be copied manually and I'm kind of feeling too lazy to write the code to do that ATM (i_pitch vs i_visible_pitch...). */ i_flags |= PP_FORMAT_444; break; - case VLC_FOURCC('I','4','2','2'): - case VLC_FOURCC('J','4','2','2'): + case VLC_CODEC_I422: + case VLC_CODEC_J422: i_flags |= PP_FORMAT_422; break; - case VLC_FOURCC('I','4','1','1'): + case VLC_CODEC_I411: i_flags |= PP_FORMAT_411; break; - case VLC_FOURCC('I','4','2','0'): - case VLC_FOURCC('I','Y','U','V'): - case VLC_FOURCC('J','4','2','0'): - case VLC_FOURCC('Y','V','1','2'): + case VLC_CODEC_I420: + case VLC_CODEC_J420: + case VLC_CODEC_YV12: i_flags |= PP_FORMAT_420; break; default: diff --git a/modules/video_filter/remoteosd.c b/modules/video_filter/remoteosd.c index 8b0e02ece3..5bc22dc36f 100644 --- a/modules/video_filter/remoteosd.c +++ b/modules/video_filter/remoteosd.c @@ -323,7 +323,7 @@ static int CreateFilter ( vlc_object_t *p_this ) KeyEvent, p_this ); } - es_format_Init( &p_filter->fmt_out, SPU_ES, VLC_FOURCC( 's','p','u',' ' ) ); + es_format_Init( &p_filter->fmt_out, SPU_ES, VLC_CODEC_SPU ); p_filter->fmt_out.i_priority = 0; vlc_gcrypt_init(); @@ -697,7 +697,7 @@ static void* vnc_worker_thread( vlc_object_t *p_thread_obj ) /* Create an empty picture for VNC the data */ vlc_mutex_lock( &p_sys->lock ); - p_sys->p_pic = picture_New( VLC_FOURCC('Y','U','V','A'), + p_sys->p_pic = picture_New( VLC_CODEC_YUVA, p_sys->i_vnc_width, p_sys->i_vnc_height, VOUT_ASPECT_FACTOR ); if( !p_sys->p_pic ) { @@ -1154,7 +1154,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date ) /* Create new SPU region */ memset( &fmt, 0, sizeof(video_format_t) ); - fmt.i_chroma = VLC_FOURCC('Y','U','V','A'); + fmt.i_chroma = VLC_CODEC_YUVA; fmt.i_aspect = VOUT_ASPECT_FACTOR; fmt.i_sar_num = fmt.i_sar_den = 1; fmt.i_width = fmt.i_visible_width = p_pic->p[Y_PLANE].i_visible_pitch; diff --git a/modules/video_filter/rss.c b/modules/video_filter/rss.c index c08083aa64..10cf8ca4e9 100644 --- a/modules/video_filter/rss.c +++ b/modules/video_filter/rss.c @@ -440,7 +440,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date ) return NULL; } - fmt.i_chroma = VLC_FOURCC('T','E','X','T'); + fmt.i_chroma = VLC_CODEC_TEXT; p_spu->p_region = subpicture_region_New( &fmt ); if( !p_spu->p_region ) @@ -539,7 +539,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date ) 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 = @@ -593,7 +593,7 @@ static picture_t *LoadImage( filter_t *p_filter, const char *psz_url ) memset( &fmt_in, 0, sizeof(video_format_t) ); 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; p_orig = image_ReadUrl( p_handler, psz_url, &fmt_in, &fmt_out ); if( !p_orig ) @@ -603,7 +603,7 @@ static picture_t *LoadImage( filter_t *p_filter, const char *psz_url ) else if( p_sys->p_style->i_font_size > 0 ) { - fmt_in.i_chroma = VLC_FOURCC('Y','U','V','A'); + fmt_in.i_chroma = VLC_CODEC_YUVA; fmt_in.i_height = p_orig->p[Y_PLANE].i_visible_lines; fmt_in.i_width = p_orig->p[Y_PLANE].i_visible_pitch; fmt_out.i_width = p_orig->p[Y_PLANE].i_visible_pitch diff --git a/modules/video_filter/rv32.c b/modules/video_filter/rv32.c index 68ef70f346..5dc81eff74 100644 --- a/modules/video_filter/rv32.c +++ b/modules/video_filter/rv32.c @@ -68,9 +68,9 @@ static int OpenFilter( vlc_object_t *p_this ) filter_sys_t *p_sys; /* XXX Only support RV24 -> RV32 conversion */ - if( p_filter->fmt_in.video.i_chroma != VLC_FOURCC('R','V','2','4') || - (p_filter->fmt_out.video.i_chroma != VLC_FOURCC('R', 'V', '3', '2') && - p_filter->fmt_out.video.i_chroma != VLC_FOURCC('R', 'G', 'B', 'A')) ) + if( p_filter->fmt_in.video.i_chroma != VLC_CODEC_RGB24 || + (p_filter->fmt_out.video.i_chroma != VLC_CODEC_RGB32 && + p_filter->fmt_out.video.i_chroma != VLC_CODEC_RGBA) ) { return VLC_EGENERIC; } diff --git a/modules/video_filter/scale.c b/modules/video_filter/scale.c index 159bd180fc..7c095136ac 100644 --- a/modules/video_filter/scale.c +++ b/modules/video_filter/scale.c @@ -69,12 +69,12 @@ 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.video.i_chroma != VLC_FOURCC('Y','U','V','P') && - p_filter->fmt_in.video.i_chroma != VLC_FOURCC('Y','U','V','A') && - p_filter->fmt_in.video.i_chroma != VLC_FOURCC('I','4','2','0') && - p_filter->fmt_in.video.i_chroma != VLC_FOURCC('Y','V','1','2') && - p_filter->fmt_in.video.i_chroma != VLC_FOURCC('R','V','3','2') && - p_filter->fmt_in.video.i_chroma != VLC_FOURCC('R','G','B','A') ) || + if( ( p_filter->fmt_in.video.i_chroma != VLC_CODEC_YUVP && + p_filter->fmt_in.video.i_chroma != VLC_CODEC_YUVA && + p_filter->fmt_in.video.i_chroma != VLC_CODEC_I420 && + p_filter->fmt_in.video.i_chroma != VLC_CODEC_YV12 && + p_filter->fmt_in.video.i_chroma != VLC_CODEC_RGB32 && + p_filter->fmt_in.video.i_chroma != VLC_CODEC_RGBA ) || p_filter->fmt_in.video.i_chroma != p_filter->fmt_out.video.i_chroma ) { return VLC_EGENERIC; @@ -131,8 +131,8 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic ) return NULL; } - if( p_filter->fmt_in.video.i_chroma != VLC_FOURCC('R','G','B','A') && - p_filter->fmt_in.video.i_chroma != VLC_FOURCC('R','V','3','2') ) + if( p_filter->fmt_in.video.i_chroma != VLC_CODEC_RGBA && + p_filter->fmt_in.video.i_chroma != VLC_CODEC_RGB32 ) { for( i_plane = 0; i_plane < p_pic_dst->i_planes; i_plane++ ) { diff --git a/modules/video_filter/swscale.c b/modules/video_filter/swscale.c index 61d0d82504..66249395df 100644 --- a/modules/video_filter/swscale.c +++ b/modules/video_filter/swscale.c @@ -272,30 +272,30 @@ static int GetParameters( ScalerConfiguration *p_cfg, if( p_fmti->i_chroma == p_fmto->i_chroma ) { - if( p_fmti->i_chroma == VLC_FOURCC( 'Y', 'U', 'V', 'P' ) && ALLOW_YUVP ) + if( p_fmti->i_chroma == VLC_CODEC_YUVP && ALLOW_YUVP ) { i_fmti = i_fmto = PIX_FMT_GRAY8; i_sws_flags = SWS_POINT; } } - if( p_fmti->i_chroma == VLC_FOURCC( 'Y', 'U', 'V', 'A' ) ) + if( p_fmti->i_chroma == VLC_CODEC_YUVA ) { i_fmti = PIX_FMT_YUV444P; b_has_ai = true; } - else if( p_fmti->i_chroma == VLC_FOURCC( 'R', 'G', 'B', 'A' ) ) + else if( p_fmti->i_chroma == VLC_CODEC_RGBA ) { i_fmti = PIX_FMT_BGR32; b_has_ai = true; } - if( p_fmto->i_chroma == VLC_FOURCC( 'Y', 'U', 'V', 'A' ) ) + if( p_fmto->i_chroma == VLC_CODEC_YUVA ) { i_fmto = PIX_FMT_YUV444P; b_has_ao = true; } - else if( p_fmto->i_chroma == VLC_FOURCC( 'R', 'G', 'B', 'A' ) ) + else if( p_fmto->i_chroma == VLC_CODEC_RGBA ) { i_fmto = PIX_FMT_BGR32; b_has_ao = true; @@ -379,8 +379,8 @@ static int Init( filter_t *p_filter ) } if( p_sys->ctxA ) { - p_sys->p_src_a = picture_New( VLC_FOURCC( 'G', 'R', 'E', 'Y' ), i_fmti_width, p_fmti->i_height, 0 ); - p_sys->p_dst_a = picture_New( VLC_FOURCC( 'G', 'R', 'E', 'Y' ), i_fmto_width, p_fmto->i_height, 0 ); + p_sys->p_src_a = picture_New( VLC_CODEC_GREY, i_fmti_width, p_fmti->i_height, 0 ); + p_sys->p_dst_a = picture_New( VLC_CODEC_GREY, i_fmto_width, p_fmto->i_height, 0 ); } if( p_sys->i_extend_factor != 1 ) { @@ -509,7 +509,7 @@ static void Convert( filter_t *p_filter, struct SwsContext *ctx, uint8_t *dst[3]; int dst_stride[3]; GetPixels( src, src_stride, p_src, i_plane_start, i_plane_count ); - if( p_filter->fmt_in.video.i_chroma == VLC_FOURCC( 'R', 'G', 'B', 'P' ) ) + if( p_filter->fmt_in.video.i_chroma == VLC_CODEC_RGBP ) { memset( palette, 0, sizeof(palette) ); if( p_filter->fmt_in.video.p_palette ) @@ -575,13 +575,13 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic ) if( p_sys->ctxA ) { /* We extract the A plane to rescale it, and then we reinject it. */ - if( p_fmti->i_chroma == VLC_FOURCC( 'R', 'G', 'B', 'A' ) ) + if( p_fmti->i_chroma == VLC_CODEC_RGBA ) ExtractA( p_sys->p_src_a, p_src, p_fmti->i_width * p_sys->i_extend_factor, p_fmti->i_height ); else plane_CopyPixels( p_sys->p_src_a->p, p_src->p+A_PLANE ); Convert( p_filter, p_sys->ctxA, p_sys->p_dst_a, p_sys->p_src_a, p_fmti->i_height, 0, 1 ); - if( p_fmto->i_chroma == VLC_FOURCC( 'R', 'G', 'B', 'A' ) ) + if( p_fmto->i_chroma == VLC_CODEC_RGBA ) InjectA( p_dst, p_sys->p_dst_a, p_fmto->i_width * p_sys->i_extend_factor, p_fmto->i_height ); else plane_CopyPixels( p_dst->p+A_PLANE, p_sys->p_dst_a->p ); @@ -589,7 +589,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic ) else if( p_sys->b_add_a ) { /* We inject a complete opaque alpha plane */ - if( p_fmto->i_chroma == VLC_FOURCC( 'R', 'G', 'B', 'A' ) ) + if( p_fmto->i_chroma == VLC_CODEC_RGBA ) FillA( &p_dst->p[0], OFFSET_A ); else FillA( &p_dst->p[A_PLANE], 0 ); diff --git a/modules/video_filter/swscale_maemo.c b/modules/video_filter/swscale_maemo.c index 6afd21000c..c882b8752c 100644 --- a/modules/video_filter/swscale_maemo.c +++ b/modules/video_filter/swscale_maemo.c @@ -138,9 +138,8 @@ static int Init( filter_t *p_filter ) return VLC_SUCCESS; } - if( ( p_filter->fmt_in.video.i_chroma != VLC_FOURCC('I','4','2','0') && - p_filter->fmt_in.video.i_chroma != VLC_FOURCC('I','Y','U','V') && - p_filter->fmt_in.video.i_chroma != VLC_FOURCC('Y','V','1','2') ) || + if( ( p_filter->fmt_in.video.i_chroma != VLC_CODEC_I420 && + p_filter->fmt_in.video.i_chroma != VLC_CODEC_YV12 ) || p_filter->fmt_out.video.i_chroma != VLC_FOURCC('Y','4','2','0') ) { msg_Err( p_filter, "format not supported" ); diff --git a/modules/video_filter/transform.c b/modules/video_filter/transform.c index 0409cf1acb..0ecd450084 100644 --- a/modules/video_filter/transform.c +++ b/modules/video_filter/transform.c @@ -145,12 +145,12 @@ static int Create( vlc_object_t *p_this ) switch( p_vout->fmt_in.i_chroma ) { CASE_PLANAR_YUV_SQUARE - case VLC_FOURCC('G','R','E','Y'): + case VLC_CODEC_GREY: p_vout->p_sys->pf_filter = FilterPlanar; break; - case VLC_FOURCC('I','4','2','2'): - case VLC_FOURCC('J','4','2','2'): + case VLC_CODEC_I422: + case VLC_CODEC_J422: p_vout->p_sys->pf_filter = FilterI422; break; diff --git a/modules/video_filter/yuvp.c b/modules/video_filter/yuvp.c index 72c6fb8898..87125ba6ef 100644 --- a/modules/video_filter/yuvp.c +++ b/modules/video_filter/yuvp.c @@ -65,9 +65,9 @@ static int Open( vlc_object_t *p_this ) /* It only supports YUVP to YUVA/RGBA without scaling * (if scaling is required another filter can do it) */ - if( p_filter->fmt_in.video.i_chroma != VLC_FOURCC('Y','U','V','P') || - ( p_filter->fmt_out.video.i_chroma != VLC_FOURCC('Y','U','V','A') && - p_filter->fmt_out.video.i_chroma != VLC_FOURCC('R','G','B','A') ) || + if( p_filter->fmt_in.video.i_chroma != VLC_CODEC_YUVP || + ( p_filter->fmt_out.video.i_chroma != VLC_CODEC_YUVA && + p_filter->fmt_out.video.i_chroma != VLC_CODEC_RGBA ) || p_filter->fmt_in.video.i_width != p_filter->fmt_out.video.i_width || p_filter->fmt_in.video.i_height != p_filter->fmt_out.video.i_height ) { @@ -103,7 +103,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic ) const video_palette_t *p_yuvp = p_filter->fmt_in.video.p_palette; assert( p_yuvp != NULL ); - assert( p_filter->fmt_in.video.i_chroma == VLC_FOURCC('Y','U','V','P') ); + assert( p_filter->fmt_in.video.i_chroma == VLC_CODEC_YUVP ); assert( p_filter->fmt_in.video.i_width == p_filter->fmt_out.video.i_width ); assert( p_filter->fmt_in.video.i_height == p_filter->fmt_out.video.i_height ); @@ -115,7 +115,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic ) return NULL; } - if( p_filter->fmt_out.video.i_chroma == VLC_FOURCC('Y','U','V','A') ) + if( p_filter->fmt_out.video.i_chroma == VLC_CODEC_YUVA ) { for( unsigned int y = 0; y < p_filter->fmt_in.video.i_height; y++ ) { @@ -141,7 +141,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic ) } else { - assert( p_filter->fmt_out.video.i_chroma == VLC_FOURCC('R','G','B','A') ); + assert( p_filter->fmt_out.video.i_chroma == VLC_CODEC_RGBA ); /* Create a RGBA palette */ video_palette_t rgbp; diff --git a/modules/video_output/aa.c b/modules/video_output/aa.c index 9777707117..a46998fb02 100644 --- a/modules/video_output/aa.c +++ b/modules/video_output/aa.c @@ -127,7 +127,7 @@ static int Init( vout_thread_t *p_vout ) I_OUTPUTPICTURES = 0; - p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2'); + p_vout->output.i_chroma = VLC_CODEC_RGB8; p_vout->output.i_width = p_vout->p_sys->i_width; p_vout->output.i_height = p_vout->p_sys->i_height; p_vout->output.i_aspect = p_vout->p_sys->i_width diff --git a/modules/video_output/caca.c b/modules/video_output/caca.c index 63e437f263..d044a3d5ea 100644 --- a/modules/video_output/caca.c +++ b/modules/video_output/caca.c @@ -215,7 +215,7 @@ static int Init( vout_thread_t *p_vout ) I_OUTPUTPICTURES = 0; - p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2'); + p_vout->output.i_chroma = VLC_CODEC_RGB32; p_vout->output.i_width = p_vout->render.i_width; p_vout->output.i_height = p_vout->render.i_height; p_vout->output.i_aspect = p_vout->render.i_aspect; diff --git a/modules/video_output/directfb.c b/modules/video_output/directfb.c index dce0dfadc2..83d753810d 100644 --- a/modules/video_output/directfb.c +++ b/modules/video_output/directfb.c @@ -140,7 +140,7 @@ static int Init( vout_thread_t *p_vout ) i_goffset = 2; i_blength = 2; i_boffset = 0; - p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2'); + p_vout->output.i_chroma = VLC_CODEC_RGB8; break; case DSPF_RGB16: @@ -152,7 +152,7 @@ static int Init( vout_thread_t *p_vout ) i_goffset = 5; i_blength = 5; i_boffset = 0; - p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6'); + p_vout->output.i_chroma = VLC_CODEC_RGB16 break; case DSPF_RGB24: @@ -164,7 +164,7 @@ static int Init( vout_thread_t *p_vout ) i_goffset = 8; i_blength = 8; i_boffset = 0; - p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4'); + p_vout->output.i_chroma = VLC_CODEC_RGB24; break; case DSPF_RGB32: @@ -176,7 +176,7 @@ static int Init( vout_thread_t *p_vout ) i_goffset = 8; i_blength = 8; i_boffset = 0; - p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2'); + p_vout->output.i_chroma = VLC_CODEC_RGB32; break; default: diff --git a/modules/video_output/fb.c b/modules/video_output/fb.c index 1796b70f7b..36bf04e2ae 100644 --- a/modules/video_output/fb.c +++ b/modules/video_output/fb.c @@ -227,10 +227,11 @@ static int Create( vlc_object_t *p_this ) { if( strlen( psz_chroma ) == 4 ) { - p_sys->i_chroma = VLC_FOURCC( psz_chroma[0], - psz_chroma[1], - psz_chroma[2], - psz_chroma[3] ); + p_sys->i_chroma = vlc_fourcc_GetCodec( VIDEO_ES, + VLC_FOURCC( psz_chroma[0], + psz_chroma[1], + psz_chroma[2], + psz_chroma[3] ) ); msg_Dbg( p_vout, "forcing chroma '%s'", psz_chroma ); } else @@ -487,15 +488,15 @@ static int Init( vout_thread_t *p_vout ) switch( p_sys->var_info.bits_per_pixel ) { case 8: /* FIXME: set the palette */ - p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2'); break; + p_vout->output.i_chroma = VLC_CODEC_RGB8; break; case 15: - p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5'); break; + p_vout->output.i_chroma = VLC_CODEC_RGB15; break; case 16: - p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6'); break; + p_vout->output.i_chroma = VLC_CODEC_RGB16; break; case 24: - p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4'); break; + p_vout->output.i_chroma = VLC_CODEC_RGB24; break; case 32: - p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2'); break; + p_vout->output.i_chroma = VLC_CODEC_RGB32; break; default: msg_Err( p_vout, "unknown screen depth %i", p_vout->p_sys->var_info.bits_per_pixel ); diff --git a/modules/video_output/ggi.c b/modules/video_output/ggi.c index a5a0e6c398..7f7c5d5464 100644 --- a/modules/video_output/ggi.c +++ b/modules/video_output/ggi.c @@ -145,17 +145,17 @@ static int Init( vout_thread_t *p_vout ) switch( p_vout->p_sys->i_bits_per_pixel ) { case 8: - p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2'); + p_vout->output.i_chroma = VLC_CODEC_RGB8; p_vout->output.pf_setpalette = SetPalette; break; case 15: - p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5'); break; + p_vout->output.i_chroma = VLC_CODEC_RGB15; break; case 16: - p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6'); break; + p_vout->output.i_chroma = VLC_CODEC_RGB16; break; case 24: - p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4'); break; + p_vout->output.i_chroma = VLC_CODEC_RGB24; break; case 32: - p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2'); break; + p_vout->output.i_chroma = VLC_CODEC_RGB32; break; default: msg_Err( p_vout, "unknown screen depth %i", p_vout->p_sys->i_bits_per_pixel ); diff --git a/modules/video_output/hd1000v.cpp b/modules/video_output/hd1000v.cpp index fa6b2058a9..37695a3b42 100644 --- a/modules/video_output/hd1000v.cpp +++ b/modules/video_output/hd1000v.cpp @@ -171,7 +171,7 @@ static int Init( vout_thread_t *p_vout ) I_OUTPUTPICTURES = 0; - p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2'); + p_vout->output.i_chroma = VLC_CODEC_RGB8; p_vout->output.i_width = p_vout->p_sys->i_width; p_vout->output.i_height = p_vout->p_sys->i_height; p_vout->output.i_aspect = p_vout->p_sys->i_width @@ -181,15 +181,15 @@ static int Init( vout_thread_t *p_vout ) switch( p_vout->p_sys->i_screen_depth ) { case 8: /* FIXME: set the palette */ - p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2'); break; + p_vout->output.i_chroma = VLC_CODEC_RGB8; break; case 15: - p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5'); break; + p_vout->output.i_chroma = VLC_CODEC_RGB15; break; case 16: - p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6'); break; + p_vout->output.i_chroma = VLC_CODEC_RGB16; break; case 24: - p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4'); break; + p_vout->output.i_chroma = VLC_CODEC_RGB24; break; case 32: - p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2'); break; + p_vout->output.i_chroma = VLC_CODEC_RGB32; break; default: msg_Err( p_vout, "unknown screen depth %i", p_vout->p_sys->i_screen_depth ); diff --git a/modules/video_output/mga.c b/modules/video_output/mga.c index 7ebcefcd8b..65ed9eee09 100644 --- a/modules/video_output/mga.c +++ b/modules/video_output/mga.c @@ -188,7 +188,7 @@ static int Init( vout_thread_t *p_vout ) /* Assume we only do YMGA for the moment. XXX: mga_vid calls this * YV12, but it's actually some strange format with packed UV. */ - p_vout->output.i_chroma = VLC_FOURCC('Y','M','G','A'); + p_vout->output.i_chroma = VLC_CODEC_YMGA; p_vout->p_sys->mga.format = MGA_VID_FORMAT_YV12; if( ioctl(p_vout->p_sys->i_fd, MGA_VID_CONFIG, &p_vout->p_sys->mga) ) diff --git a/modules/video_output/msw/direct3d.c b/modules/video_output/msw/direct3d.c index dcb73107bc..4503e27165 100644 --- a/modules/video_output/msw/direct3d.c +++ b/modules/video_output/msw/direct3d.c @@ -883,17 +883,15 @@ static D3DFORMAT Direct3DVoutFindFormat(vout_thread_t *p_vout, int i_chroma, D3D /* it sounds like vista does not support YUV surfaces at all */ switch( i_chroma ) { - case VLC_FOURCC('U','Y','V','Y'): - case VLC_FOURCC('U','Y','N','V'): - case VLC_FOURCC('Y','4','2','2'): + case VLC_CODEC_UYVY: { static const D3DFORMAT formats[] = { D3DFMT_UYVY, D3DFMT_YUY2, D3DFMT_X8R8G8B8, D3DFMT_A8R8G8B8, D3DFMT_R5G6B5, D3DFMT_X1R5G5B5 }; return Direct3DVoutSelectFormat(p_vout, target, formats, sizeof(formats)/sizeof(D3DFORMAT)); } - case VLC_FOURCC('I','4','2','0'): - case VLC_FOURCC('I','4','2','2'): - case VLC_FOURCC('Y','V','1','2'): + case VLC_CODEC_I420: + case VLC_CODEC_I422: + case VLC_CODEC_YV12: { /* typically 3D textures don't support planar format ** fallback to packed version and use CPU for the conversion @@ -902,8 +900,7 @@ static D3DFORMAT Direct3DVoutFindFormat(vout_thread_t *p_vout, int i_chroma, D3D { D3DFMT_YUY2, D3DFMT_UYVY, D3DFMT_X8R8G8B8, D3DFMT_A8R8G8B8, D3DFMT_R5G6B5, D3DFMT_X1R5G5B5 }; return Direct3DVoutSelectFormat(p_vout, target, formats, sizeof(formats)/sizeof(D3DFORMAT)); } - case VLC_FOURCC('Y','U','Y','2'): - case VLC_FOURCC('Y','U','N','V'): + case VLC_CODEC_YUYV: { static const D3DFORMAT formats[] = { D3DFMT_YUY2, D3DFMT_UYVY, D3DFMT_X8R8G8B8, D3DFMT_A8R8G8B8, D3DFMT_R5G6B5, D3DFMT_X1R5G5B5 }; @@ -914,25 +911,25 @@ static D3DFORMAT Direct3DVoutFindFormat(vout_thread_t *p_vout, int i_chroma, D3D switch( i_chroma ) { - case VLC_FOURCC('R', 'V', '1', '5'): + case VLC_CODEC_RGB15: { static const D3DFORMAT formats[] = { D3DFMT_X1R5G5B5 }; return Direct3DVoutSelectFormat(p_vout, target, formats, sizeof(formats)/sizeof(D3DFORMAT)); } - case VLC_FOURCC('R', 'V', '1', '6'): + case VLC_CODEC_RGB16: { static const D3DFORMAT formats[] = { D3DFMT_R5G6B5 }; return Direct3DVoutSelectFormat(p_vout, target, formats, sizeof(formats)/sizeof(D3DFORMAT)); } - case VLC_FOURCC('R', 'V', '2', '4'): + case VLC_CODEC_RGB24: { static const D3DFORMAT formats[] = { D3DFMT_R8G8B8, D3DFMT_X8R8G8B8, D3DFMT_A8R8G8B8 }; return Direct3DVoutSelectFormat(p_vout, target, formats, sizeof(formats)/sizeof(D3DFORMAT)); } - case VLC_FOURCC('R', 'V', '3', '2'): + case VLC_CODEC_RGB32: { static const D3DFORMAT formats[] = { D3DFMT_A8R8G8B8, D3DFMT_X8R8G8B8 }; @@ -980,32 +977,32 @@ static int Direct3DVoutSetOutputFormat(vout_thread_t *p_vout, D3DFORMAT format) switch( format ) { case D3DFMT_YUY2: - p_vout->output.i_chroma = VLC_FOURCC('Y', 'U', 'Y', '2'); + p_vout->output.i_chroma = VLC_CODEC_YUYV; break; case D3DFMT_UYVY: - p_vout->output.i_chroma = VLC_FOURCC('U', 'Y', 'V', 'Y'); + p_vout->output.i_chroma = VLC_CODEC_UYVY; break; case D3DFMT_R8G8B8: - p_vout->output.i_chroma = VLC_FOURCC('R', 'V', '2', '4'); + p_vout->output.i_chroma = VLC_CODEC_RGB24; p_vout->output.i_rmask = 0xff0000; p_vout->output.i_gmask = 0x00ff00; p_vout->output.i_bmask = 0x0000ff; break; case D3DFMT_X8R8G8B8: case D3DFMT_A8R8G8B8: - p_vout->output.i_chroma = VLC_FOURCC('R', 'V', '3', '2'); + p_vout->output.i_chroma = VLC_CODEC_RGB32; p_vout->output.i_rmask = 0x00ff0000; p_vout->output.i_gmask = 0x0000ff00; p_vout->output.i_bmask = 0x000000ff; break; case D3DFMT_R5G6B5: - p_vout->output.i_chroma = VLC_FOURCC('R', 'V', '1', '6'); + p_vout->output.i_chroma = VLC_CODEC_RGB16; p_vout->output.i_rmask = (0x1fL)<<11; p_vout->output.i_gmask = (0x3fL)<<5; p_vout->output.i_bmask = (0x1fL)<<0; break; case D3DFMT_X1R5G5B5: - p_vout->output.i_chroma = VLC_FOURCC('R', 'V', '1', '5'); + p_vout->output.i_chroma = VLC_CODEC_RGB15; p_vout->output.i_rmask = (0x1fL)<<10; p_vout->output.i_gmask = (0x1fL)<<5; p_vout->output.i_bmask = (0x1fL)<<0; @@ -1077,7 +1074,7 @@ static int Direct3DVoutCreatePictures( vout_thread_t *p_vout, size_t i_num_pics * picture_t structures */ switch( p_vout->output.i_chroma ) { - case VLC_FOURCC('R','G','B','2'): + case VLC_CODEC_RGB8: p_pic->p->i_lines = p_vout->output.i_height; p_pic->p->i_visible_lines = p_vout->output.i_height; p_pic->p->i_pixel_pitch = 1; @@ -1085,8 +1082,8 @@ static int Direct3DVoutCreatePictures( vout_thread_t *p_vout, size_t i_num_pics p_pic->p->i_pixel_pitch; p_pic->i_planes = 1; break; - case VLC_FOURCC('R','V','1','5'): - case VLC_FOURCC('R','V','1','6'): + case VLC_CODEC_RGB15: + case VLC_CODEC_RGB16: p_pic->p->i_lines = p_vout->output.i_height; p_pic->p->i_visible_lines = p_vout->output.i_height; p_pic->p->i_pixel_pitch = 2; @@ -1094,7 +1091,7 @@ static int Direct3DVoutCreatePictures( vout_thread_t *p_vout, size_t i_num_pics p_pic->p->i_pixel_pitch; p_pic->i_planes = 1; break; - case VLC_FOURCC('R','V','2','4'): + case VLC_CODEC_RGB24: p_pic->p->i_lines = p_vout->output.i_height; p_pic->p->i_visible_lines = p_vout->output.i_height; p_pic->p->i_pixel_pitch = 3; @@ -1102,7 +1099,7 @@ static int Direct3DVoutCreatePictures( vout_thread_t *p_vout, size_t i_num_pics p_pic->p->i_pixel_pitch; p_pic->i_planes = 1; break; - case VLC_FOURCC('R','V','3','2'): + case VLC_CODEC_RGB32: p_pic->p->i_lines = p_vout->output.i_height; p_pic->p->i_visible_lines = p_vout->output.i_height; p_pic->p->i_pixel_pitch = 4; @@ -1110,8 +1107,8 @@ static int Direct3DVoutCreatePictures( vout_thread_t *p_vout, size_t i_num_pics p_pic->p->i_pixel_pitch; p_pic->i_planes = 1; break; - case VLC_FOURCC('U','Y','V','Y'): - case VLC_FOURCC('Y','U','Y','2'): + case VLC_CODEC_UYVY: + case VLC_CODEC_YUYV: p_pic->p->i_lines = p_vout->output.i_height; p_pic->p->i_visible_lines = p_vout->output.i_height; p_pic->p->i_pixel_pitch = 2; diff --git a/modules/video_output/msw/directx.c b/modules/video_output/msw/directx.c index 3d2ba7cec1..5844a6f53c 100644 --- a/modules/video_output/msw/directx.c +++ b/modules/video_output/msw/directx.c @@ -407,20 +407,17 @@ static int Init( vout_thread_t *p_vout ) /* Choose the chroma we will try first. */ switch( p_vout->render.i_chroma ) { - case VLC_FOURCC('Y','U','Y','2'): - case VLC_FOURCC('Y','U','N','V'): - p_vout->output.i_chroma = VLC_FOURCC('Y','U','Y','2'); + case VLC_CODEC_YUYV: + p_vout->output.i_chroma = VLC_CODEC_YUYV; break; - case VLC_FOURCC('U','Y','V','Y'): - case VLC_FOURCC('U','Y','N','V'): - case VLC_FOURCC('Y','4','2','2'): - p_vout->output.i_chroma = VLC_FOURCC('U','Y','V','Y'); + case VLC_CODEC_UYVY: + p_vout->output.i_chroma = VLC_CODEC_UYVY; break; - case VLC_FOURCC('Y','V','Y','U'): - p_vout->output.i_chroma = VLC_FOURCC('Y','V','Y','U'); + case VLC_CODEC_YVYU: + p_vout->output.i_chroma = VLC_CODEC_YVYU; break; default: - p_vout->output.i_chroma = VLC_FOURCC('Y','V','1','2'); + p_vout->output.i_chroma = VLC_CODEC_YV12; break; } @@ -431,15 +428,15 @@ static int Init( vout_thread_t *p_vout ) if( !I_OUTPUTPICTURES ) { /* hmmm, it didn't work! Let's try commonly supported chromas */ - if( p_vout->output.i_chroma != VLC_FOURCC('I','4','2','0') ) + if( p_vout->output.i_chroma != VLC_CODEC_I420 ) { - p_vout->output.i_chroma = VLC_FOURCC('Y','V','1','2'); + p_vout->output.i_chroma = VLC_CODEC_YV12; NewPictureVec( p_vout, p_vout->p_picture, MAX_DIRECTBUFFERS ); } if( !I_OUTPUTPICTURES ) { /* hmmm, it still didn't work! Let's try another one */ - p_vout->output.i_chroma = VLC_FOURCC('Y','U','Y','2'); + p_vout->output.i_chroma = VLC_CODEC_YUYV; NewPictureVec( p_vout, p_vout->p_picture, MAX_DIRECTBUFFERS ); } } @@ -1196,11 +1193,11 @@ static int DirectXCreateSurface( vout_thread_t *p_vout, if( !b_overlay ) { bool b_rgb_surface = - ( i_chroma == VLC_FOURCC('R','G','B','2') ) - || ( i_chroma == VLC_FOURCC('R','V','1','5') ) - || ( i_chroma == VLC_FOURCC('R','V','1','6') ) - || ( i_chroma == VLC_FOURCC('R','V','2','4') ) - || ( i_chroma == VLC_FOURCC('R','V','3','2') ); + ( i_chroma == VLC_CODEC_RGB8 ) + || ( i_chroma == VLC_CODEC_RGB15 ) + || ( i_chroma == VLC_CODEC_RGB16 ) + || ( i_chroma == VLC_CODEC_RGB24 ) + || ( i_chroma == VLC_CODEC_RGB32 ); memset( &ddsd, 0, sizeof( DDSURFACEDESC ) ); ddsd.dwSize = sizeof(DDSURFACEDESC); @@ -1551,20 +1548,20 @@ static int NewPictureVec( vout_thread_t *p_vout, picture_t *p_pic, switch( ddpfPixelFormat.dwRGBBitCount ) { case 8: - p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2'); + p_vout->output.i_chroma = VLC_CODEC_RGB8; p_vout->output.pf_setpalette = SetPalette; break; case 15: - p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5'); + p_vout->output.i_chroma = VLC_CODEC_RGB15; break; case 16: - p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6'); + p_vout->output.i_chroma = VLC_CODEC_RGB16; break; case 24: - p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4'); + p_vout->output.i_chroma = VLC_CODEC_RGB24; break; case 32: - p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2'); + p_vout->output.i_chroma = VLC_CODEC_RGB32; break; default: msg_Err( p_vout, "unknown screen depth" ); @@ -1678,28 +1675,28 @@ static int UpdatePictureStruct( vout_thread_t *p_vout, picture_t *p_pic, { switch( p_vout->output.i_chroma ) { - case VLC_FOURCC('R','G','B','2'): - case VLC_FOURCC('R','V','1','5'): - case VLC_FOURCC('R','V','1','6'): - case VLC_FOURCC('R','V','2','4'): - case VLC_FOURCC('R','V','3','2'): + case VLC_CODEC_RGB8: + case VLC_CODEC_RGB15: + case VLC_CODEC_RGB16: + case VLC_CODEC_RGB24: + case VLC_CODEC_RGB32: p_pic->p->p_pixels = p_pic->p_sys->ddsd.lpSurface; p_pic->p->i_lines = p_vout->output.i_height; p_pic->p->i_visible_lines = p_vout->output.i_height; p_pic->p->i_pitch = p_pic->p_sys->ddsd.lPitch; switch( p_vout->output.i_chroma ) { - case VLC_FOURCC('R','G','B','2'): + case VLC_CODEC_RGB8: p_pic->p->i_pixel_pitch = 1; break; - case VLC_FOURCC('R','V','1','5'): - case VLC_FOURCC('R','V','1','6'): + case VLC_CODEC_RGB15: + case VLC_CODEC_RGB16: p_pic->p->i_pixel_pitch = 2; break; - case VLC_FOURCC('R','V','2','4'): + case VLC_CODEC_RGB24: p_pic->p->i_pixel_pitch = 3; break; - case VLC_FOURCC('R','V','3','2'): + case VLC_CODEC_RGB32: p_pic->p->i_pixel_pitch = 4; break; default: @@ -1710,12 +1707,11 @@ static int UpdatePictureStruct( vout_thread_t *p_vout, picture_t *p_pic, p_pic->i_planes = 1; break; - case VLC_FOURCC('Y','V','1','2'): - case VLC_FOURCC('I','4','2','0'): + case VLC_CODEC_YV12: /* U and V inverted compared to I420 * Fixme: this should be handled by the vout core */ - p_vout->output.i_chroma = VLC_FOURCC('I','4','2','0'); + p_vout->output.i_chroma = VLC_CODEC_I420; p_pic->Y_PIXELS = p_pic->p_sys->ddsd.lpSurface; p_pic->p[Y_PLANE].i_lines = p_vout->output.i_height; @@ -1746,7 +1742,7 @@ static int UpdatePictureStruct( vout_thread_t *p_vout, picture_t *p_pic, p_pic->i_planes = 3; break; - case VLC_FOURCC('I','Y','U','V'): + case VLC_CODEC_I420: p_pic->Y_PIXELS = p_pic->p_sys->ddsd.lpSurface; p_pic->p[Y_PLANE].i_lines = p_vout->output.i_height; @@ -1777,8 +1773,8 @@ static int UpdatePictureStruct( vout_thread_t *p_vout, picture_t *p_pic, p_pic->i_planes = 3; break; - case VLC_FOURCC('U','Y','V','Y'): - case VLC_FOURCC('Y','U','Y','2'): + case VLC_CODEC_UYVY: + case VLC_CODEC_YUYV: p_pic->p->p_pixels = p_pic->p_sys->ddsd.lpSurface; p_pic->p->i_lines = p_vout->output.i_height; diff --git a/modules/video_output/msw/wingdi.c b/modules/video_output/msw/wingdi.c index c725d66110..706aded172 100644 --- a/modules/video_output/msw/wingdi.c +++ b/modules/video_output/msw/wingdi.c @@ -379,29 +379,29 @@ static int Init( vout_thread_t *p_vout ) switch( p_vout->p_sys->i_depth ) { case 8: - p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2'); + p_vout->output.i_chroma = VLC_CODEC_RGB8; p_vout->output.pf_setpalette = SetPalette; break; case 15: - p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5'); + p_vout->output.i_chroma = VLC_CODEC_RGB15; p_vout->output.i_rmask = 0x7c00; p_vout->output.i_gmask = 0x03e0; p_vout->output.i_bmask = 0x001f; break; case 16: - p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6'); + p_vout->output.i_chroma = VLC_CODEC_RGB16; p_vout->output.i_rmask = 0xf800; p_vout->output.i_gmask = 0x07e0; p_vout->output.i_bmask = 0x001f; break; case 24: - p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4'); + p_vout->output.i_chroma = VLC_CODEC_RGB24; p_vout->output.i_rmask = 0x00ff0000; p_vout->output.i_gmask = 0x0000ff00; p_vout->output.i_bmask = 0x000000ff; break; case 32: - p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2'); + p_vout->output.i_chroma = VLC_CODEC_RGB32; p_vout->output.i_rmask = 0x00ff0000; p_vout->output.i_gmask = 0x0000ff00; p_vout->output.i_bmask = 0x000000ff; diff --git a/modules/video_output/omapfb.c b/modules/video_output/omapfb.c index 95c2eaf2e6..9d895645f4 100644 --- a/modules/video_output/omapfb.c +++ b/modules/video_output/omapfb.c @@ -185,9 +185,8 @@ static int Create( vlc_object_t *p_this ) vout_thread_t *p_vout = (vout_thread_t *)p_this; vout_sys_t *p_sys; - if( p_vout->fmt_in.i_chroma != VLC_FOURCC('I','4','2','0') && - p_vout->fmt_in.i_chroma != VLC_FOURCC('I','Y','U','V') && - p_vout->fmt_in.i_chroma != VLC_FOURCC('Y','V','1','2') ) + if( p_vout->fmt_in.i_chroma != VLC_CODEC_I420 && + p_vout->fmt_in.i_chroma != VLC_CODEC_YV12 ) return VLC_EGENERIC; /* Allocate instance and initialize some members */ @@ -308,7 +307,7 @@ static int Init( vout_thread_t *p_vout ) } p_vout->output.i_chroma = - p_vout->fmt_out.i_chroma = VLC_FOURCC( 'Y','4','2','0' ); + p_vout->fmt_out.i_chroma = VLC_CODEC_I420; p_sys->i_color_format = OMAPFB_COLOR_YUV420; // place in the framebuffer where we have to write diff --git a/modules/video_output/opengl.c b/modules/video_output/opengl.c index 3fbe5e642f..2a3ca2b6a4 100644 --- a/modules/video_output/opengl.c +++ b/modules/video_output/opengl.c @@ -250,16 +250,16 @@ static int Init( vout_thread_t *p_vout ) /* TODO: We use YCbCr on Mac which is Y422, but on OSX it seems to == YUY2. Verify */ #if ( defined( WORDS_BIGENDIAN ) && VLCGL_FORMAT == GL_YCBCR_422_APPLE ) || (VLCGL_FORMAT == YCBCR_MESA) - p_vout->output.i_chroma = VLC_FOURCC('Y','U','Y','2'); + p_vout->output.i_chroma = VLC_CODEC_YUYV; i_pixel_pitch = 2; #elif (VLCGL_FORMAT == GL_YCBCR_422_APPLE) - p_vout->output.i_chroma = VLC_FOURCC('U','Y','V','Y'); + p_vout->output.i_chroma = VLC_CODEC_UYVY; i_pixel_pitch = 2; #elif VLCGL_FORMAT == GL_RGB # if VLCGL_TYPE == GL_UNSIGNED_BYTE - p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4'); + p_vout->output.i_chroma = VLC_CODEC_RGB24; # if defined( WORDS_BIGENDIAN ) p_vout->output.i_rmask = 0x00ff0000; p_vout->output.i_gmask = 0x0000ff00; @@ -271,7 +271,7 @@ static int Init( vout_thread_t *p_vout ) # endif i_pixel_pitch = 3; # else - p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6'); + p_vout->output.i_chroma = VLC_CODEC_RGB16; # if defined( WORDS_BIGENDIAN ) p_vout->output.i_rmask = 0x001f; p_vout->output.i_gmask = 0x07e0; @@ -284,7 +284,7 @@ static int Init( vout_thread_t *p_vout ) i_pixel_pitch = 2; # endif #else - p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2'); + p_vout->output.i_chroma = VLC_CODEC_RGB32; # if defined( WORDS_BIGENDIAN ) p_vout->output.i_rmask = 0xff000000; p_vout->output.i_gmask = 0x00ff0000; diff --git a/modules/video_output/opengllayer.m b/modules/video_output/opengllayer.m index fe7518f052..fe5717c03b 100644 --- a/modules/video_output/opengllayer.m +++ b/modules/video_output/opengllayer.m @@ -170,10 +170,10 @@ static int Init( vout_thread_t *p_vout ) vlc_value_t val; #if ( defined( WORDS_BIGENDIAN ) && VLCGL_FORMAT == GL_YCBCR_422_APPLE ) || (VLCGL_FORMAT == YCBCR_MESA) - p_vout->output.i_chroma = VLC_FOURCC('Y','U','Y','2'); + p_vout->output.i_chroma = VLC_CODEC_YUYV; i_pixel_pitch = 2; #elif (VLCGL_FORMAT == GL_YCBCR_422_APPLE) - p_vout->output.i_chroma = VLC_FOURCC('U','Y','V','Y'); + p_vout->output.i_chroma = VLC_CODEC_UYVY; i_pixel_pitch = 2; #endif diff --git a/modules/video_output/qte/qte.cpp b/modules/video_output/qte/qte.cpp index 1c310bc5a4..f91acd7b3e 100644 --- a/modules/video_output/qte/qte.cpp +++ b/modules/video_output/qte/qte.cpp @@ -218,7 +218,7 @@ static int Init( vout_thread_t *p_vout ) I_OUTPUTPICTURES = 0; - p_vout->output.i_chroma = (dd == 16) ? VLC_FOURCC('R','V','1','6'): VLC_FOURCC('R','V','3','2'); + p_vout->output.i_chroma = (dd == 16) ? VLC_CODEC_RGB16 : VLC_CODEC_RGB32; p_vout->output.i_rmask = 0xf800; p_vout->output.i_gmask = 0x07e0; p_vout->output.i_bmask = 0x001f; diff --git a/modules/video_output/sdl.c b/modules/video_output/sdl.c index ac19b28590..f2cfa7449a 100644 --- a/modules/video_output/sdl.c +++ b/modules/video_output/sdl.c @@ -799,6 +799,7 @@ static int OpenDisplay( vout_thread_t *p_vout ) if( strlen( psz_chroma ) >= 4 ) { memcpy(&i_chroma, psz_chroma, 4); + i_chroma = vlc_fourcc_GetCodec( VIDEO_ES, i_chroma ); msg_Dbg( p_vout, "Forcing chroma to 0x%.8x (%4.4s)", i_chroma, (char*)&i_chroma ); } else @@ -816,26 +817,22 @@ static int OpenDisplay( vout_thread_t *p_vout ) if( !psz_chroma ) i_chroma = 0; switch( i_chroma ? i_chroma : p_vout->render.i_chroma ) { - case VLC_FOURCC('Y','U','Y','2'): - case VLC_FOURCC('Y','U','N','V'): - p_vout->output.i_chroma = VLC_FOURCC('Y','U','Y','2'); + case VLC_CODEC_YUYV: + p_vout->output.i_chroma = VLC_CODEC_YUYV; i_sdl_chroma = SDL_YUY2_OVERLAY; break; - case VLC_FOURCC('U','Y','V','Y'): - case VLC_FOURCC('U','Y','N','V'): - case VLC_FOURCC('Y','4','2','2'): - p_vout->output.i_chroma = VLC_FOURCC('U','Y','V','Y'); + case VLC_CODEC_UYVY: + p_vout->output.i_chroma = VLC_CODEC_UYVY; i_sdl_chroma = SDL_UYVY_OVERLAY; break; - case VLC_FOURCC('Y','V','Y','U'): - p_vout->output.i_chroma = VLC_FOURCC('Y','V','Y','U'); + case VLC_CODEC_YVYU: + p_vout->output.i_chroma = VLC_CODEC_YVYU; i_sdl_chroma = SDL_YVYU_OVERLAY; break; - case VLC_FOURCC('Y','V','1','2'): - case VLC_FOURCC('I','4','2','0'): - case VLC_FOURCC('I','Y','U','V'): + case VLC_CODEC_YV12: + case VLC_CODEC_I420: default: - p_vout->output.i_chroma = VLC_FOURCC('Y','V','1','2'); + p_vout->output.i_chroma = VLC_CODEC_YV12; i_sdl_chroma = SDL_YV12_OVERLAY; break; } @@ -853,7 +850,7 @@ static int OpenDisplay( vout_thread_t *p_vout ) /* If this best choice failed, fall back to other chromas */ if( p_vout->p_sys->p_overlay == NULL ) { - p_vout->output.i_chroma = VLC_FOURCC('I','Y','U','V'); + p_vout->output.i_chroma = VLC_CODEC_I420; p_vout->p_sys->p_overlay = SDL_CreateYUVOverlay( 32, 32, SDL_IYUV_OVERLAY, p_vout->p_sys->p_display ); @@ -861,7 +858,7 @@ static int OpenDisplay( vout_thread_t *p_vout ) if( p_vout->p_sys->p_overlay == NULL ) { - p_vout->output.i_chroma = VLC_FOURCC('Y','V','1','2'); + p_vout->output.i_chroma = VLC_CODEC_YV12; p_vout->p_sys->p_overlay = SDL_CreateYUVOverlay( 32, 32, SDL_YV12_OVERLAY, p_vout->p_sys->p_display ); @@ -869,7 +866,7 @@ static int OpenDisplay( vout_thread_t *p_vout ) if( p_vout->p_sys->p_overlay == NULL ) { - p_vout->output.i_chroma = VLC_FOURCC('Y','U','Y','2'); + p_vout->output.i_chroma = VLC_CODEC_YUYV; p_vout->p_sys->p_overlay = SDL_CreateYUVOverlay( 32, 32, SDL_YUY2_OVERLAY, p_vout->p_sys->p_display ); @@ -888,20 +885,20 @@ static int OpenDisplay( vout_thread_t *p_vout ) switch( p_vout->p_sys->p_display->format->BitsPerPixel ) { case 8: - p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2'); + p_vout->output.i_chroma = VLC_CODEC_RGB8; p_vout->output.pf_setpalette = SetPalette; break; case 15: - p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5'); + p_vout->output.i_chroma = VLC_CODEC_RGB15; break; case 16: - p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6'); + p_vout->output.i_chroma = VLC_CODEC_RGB16; break; case 24: - p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4'); + p_vout->output.i_chroma = VLC_CODEC_RGB24; break; case 32: - p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2'); + p_vout->output.i_chroma = VLC_CODEC_RGB32; break; default: msg_Err( p_vout, "unknown screen depth %i", diff --git a/modules/video_output/snapshot.c b/modules/video_output/snapshot.c index b5dce2551f..49bf815c37 100644 --- a/modules/video_output/snapshot.c +++ b/modules/video_output/snapshot.c @@ -168,8 +168,9 @@ static int Init( vout_thread_t *p_vout ) msg_Err( p_vout, "snapshot-chroma should be 4 characters long" ); return VLC_EGENERIC; } - i_chroma = VLC_FOURCC( psz_chroma[0], psz_chroma[1], - psz_chroma[2], psz_chroma[3] ); + i_chroma = vlc_fourcc_GetCodec( VIDEO_ES, + VLC_FOURCC( psz_chroma[0], psz_chroma[1], + psz_chroma[2], psz_chroma[3] ) ); free( psz_chroma ); } else @@ -192,25 +193,25 @@ static int Init( vout_thread_t *p_vout ) /* Define the bitmasks */ switch( i_chroma ) { - case VLC_FOURCC( 'R','V','1','5' ): + case VLC_CODEC_RGB15; p_vout->output.i_rmask = 0x001f; p_vout->output.i_gmask = 0x03e0; p_vout->output.i_bmask = 0x7c00; break; - case VLC_FOURCC( 'R','V','1','6' ): + case VLC_CODEC_RGB16; p_vout->output.i_rmask = 0x001f; p_vout->output.i_gmask = 0x07e0; p_vout->output.i_bmask = 0xf800; break; - case VLC_FOURCC( 'R','V','2','4' ): + case VLC_CODEC_RGB24; p_vout->output.i_rmask = 0xff0000; p_vout->output.i_gmask = 0x00ff00; p_vout->output.i_bmask = 0x0000ff; break; - case VLC_FOURCC( 'R','V','3','2' ): + case VLC_CODEC_RGB32: p_vout->output.i_rmask = 0xff0000; p_vout->output.i_gmask = 0x00ff00; p_vout->output.i_bmask = 0x0000ff; diff --git a/modules/video_output/svgalib.c b/modules/video_output/svgalib.c index ae99b34529..fbe3fda623 100644 --- a/modules/video_output/svgalib.c +++ b/modules/video_output/svgalib.c @@ -155,7 +155,7 @@ static int Init( vout_thread_t *p_vout ) /* Initialize the output structure: RGB with square pixels, whatever * the input format is, since it's the only format we know */ - p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2'); + p_vout->output.i_chroma = VLC_CODEC_RGB8; p_vout->output.pf_setpalette = SetPalette; p_vout->output.i_width = vga_getxdim(); p_vout->output.i_height = vga_getydim(); diff --git a/modules/video_output/vmem.c b/modules/video_output/vmem.c index f132021a2d..17ba736ff3 100644 --- a/modules/video_output/vmem.c +++ b/modules/video_output/vmem.c @@ -148,8 +148,9 @@ static int Init( vout_thread_t *p_vout ) free( psz_chroma ); return VLC_EGENERIC; } - i_chroma = VLC_FOURCC( psz_chroma[0], psz_chroma[1], - psz_chroma[2], psz_chroma[3] ); + i_chroma = vlc_fourcc_GetCodec( VIDEO_ES, + VLC_FOURCC( psz_chroma[0], psz_chroma[1], + psz_chroma[2], psz_chroma[3] ) ); free( psz_chroma ); } else @@ -189,25 +190,25 @@ static int Init( vout_thread_t *p_vout ) /* Define the bitmasks */ switch( i_chroma ) { - case VLC_FOURCC( 'R','V','1','5' ): + case VLC_CODEC_RGB15: p_vout->output.i_rmask = 0x001f; p_vout->output.i_gmask = 0x03e0; p_vout->output.i_bmask = 0x7c00; break; - case VLC_FOURCC( 'R','V','1','6' ): + case VLC_CODEC_RGB16: p_vout->output.i_rmask = 0x001f; p_vout->output.i_gmask = 0x07e0; p_vout->output.i_bmask = 0xf800; break; - case VLC_FOURCC( 'R','V','2','4' ): + case VLC_CODEC_RGB24: p_vout->output.i_rmask = 0xff0000; p_vout->output.i_gmask = 0x00ff00; p_vout->output.i_bmask = 0x0000ff; break; - case VLC_FOURCC( 'R','V','3','2' ): + case VLC_CODEC_RGB32: p_vout->output.i_rmask = 0xff0000; p_vout->output.i_gmask = 0x00ff00; p_vout->output.i_bmask = 0x0000ff; diff --git a/modules/video_output/x11/xcommon.c b/modules/video_output/x11/xcommon.c index ea973d8663..e142ae1692 100644 --- a/modules/video_output/x11/xcommon.c +++ b/modules/video_output/x11/xcommon.c @@ -286,7 +286,7 @@ int Activate ( vlc_object_t *p_this ) } } } - p_vout->output.i_chroma = X112VLC_FOURCC(p_vout->output.i_chroma); + p_vout->output.i_chroma = vlc_fourcc_GetCodec( VIDEO_ES, X112VLC_FOURCC(p_vout->output.i_chroma) ); #elif defined(MODULE_NAME_IS_glx) { int i_opcode, i_evt, i_err = 0; @@ -812,7 +812,7 @@ static int InitVideo( vout_thread_t *p_vout ) #if XvVersion < 2 || ( XvVersion == 2 && XvRevision < 2 ) switch( p_vout->output.i_chroma ) { - case VLC_FOURCC('R','V','1','6'): + case VLC_CODEC_RGB16: #if defined( WORDS_BIGENDIAN ) p_vout->output.i_rmask = 0xf800; p_vout->output.i_gmask = 0x07e0; @@ -823,7 +823,7 @@ static int InitVideo( vout_thread_t *p_vout ) p_vout->output.i_bmask = 0xf800; #endif break; - case VLC_FOURCC('R','V','1','5'): + case VLC_CODEC_RGB15: #if defined( WORDS_BIGENDIAN ) p_vout->output.i_rmask = 0x7c00; p_vout->output.i_gmask = 0x03e0; @@ -843,14 +843,14 @@ static int InitVideo( vout_thread_t *p_vout ) switch( p_vout->p_sys->i_screen_depth ) { case 8: /* FIXME: set the palette */ - p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2'); break; + p_vout->output.i_chroma = VLC_CODEC_RGB8; break; case 15: - p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5'); break; + p_vout->output.i_chroma = VLC_CODEC_RGB15; break; case 16: - p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6'); break; + p_vout->output.i_chroma = VLC_CODEC_RGB16; break; case 24: case 32: - p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2'); break; + p_vout->output.i_chroma = VLC_CODEC_RGB32; break; default: msg_Err( p_vout, "unknown screen depth %i", p_vout->p_sys->i_screen_depth ); @@ -926,12 +926,12 @@ static int InitVideo( vout_thread_t *p_vout ) I_OUTPUTPICTURES++; } - if( p_vout->output.i_chroma == VLC_FOURCC('Y','V','1','2') ) + if( p_vout->output.i_chroma == VLC_CODEC_YV12 ) { /* U and V inverted compared to I420 * Fixme: this should be handled by the vout core */ - p_vout->output.i_chroma = VLC_FOURCC('I','4','2','0'); - p_vout->fmt_out.i_chroma = VLC_FOURCC('I','4','2','0'); + p_vout->output.i_chroma = VLC_CODEC_I420; + p_vout->fmt_out.i_chroma = VLC_CODEC_I420; } return VLC_SUCCESS; @@ -1958,15 +1958,15 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic ) switch( p_vout->output.i_chroma ) { #if defined(MODULE_NAME_IS_xvideo) || defined(MODULE_NAME_IS_xvmc) - case VLC_FOURCC('I','4','2','0'): - case VLC_FOURCC('Y','V','1','2'): - case VLC_FOURCC('Y','2','1','1'): - case VLC_FOURCC('Y','U','Y','2'): - case VLC_FOURCC('U','Y','V','Y'): - case VLC_FOURCC('R','V','1','5'): - case VLC_FOURCC('R','V','1','6'): - case VLC_FOURCC('R','V','2','4'): /* Fixme: pixel pitch == 4 ? */ - case VLC_FOURCC('R','V','3','2'): + case VLC_CODEC_I420: + case VLC_CODEC_YV12: + case VLC_CODEC_Y211: + case VLC_CODEC_YUYV: + case VLC_CODEC_UYVY: + case VLC_CODEC_RGB15: + case VLC_CODEC_RGB16: + case VLC_CODEC_RGB24: /* Fixme: pixel pitch == 4 ? */ + case VLC_CODEC_RGB32: for( i_plane = 0; i_plane < p_pic->p_sys->p_image->num_planes; i_plane++ ) @@ -1976,7 +1976,7 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic ) p_pic->p[i_plane].i_pitch = p_pic->p_sys->p_image->pitches[i_plane]; } - if( p_vout->output.i_chroma == VLC_FOURCC('Y','V','1','2') ) + if( p_vout->output.i_chroma == VLC_CODEC_YV12 ) { /* U and V inverted compared to I420 * Fixme: this should be handled by the vout core */ @@ -1989,11 +1989,11 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic ) break; #else - case VLC_FOURCC('R','G','B','2'): - case VLC_FOURCC('R','V','1','6'): - case VLC_FOURCC('R','V','1','5'): - case VLC_FOURCC('R','V','2','4'): - case VLC_FOURCC('R','V','3','2'): + case VLC_CODEC_RGB8: + case VLC_CODEC_RGB16: + case VLC_CODEC_RGB15: + case VLC_CODEC_RGB24: + case VLC_CODEC_RGB32: p_pic->p->i_lines = p_pic->p_sys->p_image->height; p_pic->p->i_visible_lines = p_pic->p_sys->p_image->height; diff --git a/modules/video_output/xcb/x11.c b/modules/video_output/xcb/x11.c index 0c5a1234e7..6ee3f963d3 100644 --- a/modules/video_output/xcb/x11.c +++ b/modules/video_output/xcb/x11.c @@ -148,26 +148,26 @@ static int Open (vlc_object_t *obj) { case 24: if (fmt->bits_per_pixel == 32) - chroma = VLC_FOURCC ('R', 'V', '3', '2'); + chroma = VLC_CODEC_RGB32; else if (fmt->bits_per_pixel == 24) - chroma = VLC_FOURCC ('R', 'V', '2', '4'); + chroma = VLC_CODEC_RGB24; else continue; break; case 16: if (fmt->bits_per_pixel != 16) continue; - chroma = VLC_FOURCC ('R', 'V', '1', '6'); + chroma = VLC_CODEC_RGB16; break; case 15: if (fmt->bits_per_pixel != 16) continue; - chroma = VLC_FOURCC ('R', 'V', '1', '5'); + chroma = VLC_CODEC_RGB15; break; case 8: if (fmt->bits_per_pixel != 8) continue; - chroma = VLC_FOURCC ('R', 'G', 'B', '2'); + chroma = VLC_CODEC_RGB8; break; default: continue; @@ -202,7 +202,7 @@ static int Open (vlc_object_t *obj) if (!gray) continue; /* Prefer color over gray scale */ vid = vt->visual_id; - chroma = VLC_FOURCC ('G', 'R', 'E', 'Y'); + chroma = VLC_CODEC_GREY; } } diff --git a/modules/video_output/xcb/xvideo.c b/modules/video_output/xcb/xvideo.c index 0e99035be8..ceffaf979c 100644 --- a/modules/video_output/xcb/xvideo.c +++ b/modules/video_output/xcb/xvideo.c @@ -249,21 +249,21 @@ static vlc_fourcc_t ParseFormat (vout_thread_t *vout, { case 32: if (f->depth == 24) - return VLC_FOURCC ('R', 'V', '3', '2'); + return VLC_CODEC_RGB32; break; case 24: if (f->depth == 24) - return VLC_FOURCC ('R', 'V', '2', '4'); + return VLC_CODEC_RGB24; break; case 16: if (f->depth == 16) - return VLC_FOURCC ('R', 'V', '1', '6'); + return VLC_CODEC_RGB16; if (f->depth == 15) - return VLC_FOURCC ('R', 'V', '1', '5'); + return VLC_CODEC_RGB15; break; case 8: if (f->depth == 8) - return VLC_FOURCC ('R', 'G', 'B', '2'); + return VLC_CODEC_RGB8; break; } break; @@ -288,15 +288,15 @@ static vlc_fourcc_t ParseFormat (vout_thread_t *vout, { /*untested: case 24: if (f->vhorz_u_period == 1 && f->vvert_u_period == 1) - return VLC_FOURCC ('I', '4', '4', '4'); + return VLC_CODEC_I444; break;*/ case 16: if (f->vhorz_u_period == 2 && f->vvert_u_period == 1) { if (!strcmp ((const char *)f->vcomp_order, "YUYV")) - return VLC_FOURCC ('Y', 'U', 'Y', '2'); + return VLC_CODEC_YUYV; if (!strcmp ((const char *)f->vcomp_order, "UYVY")) - return VLC_FOURCC ('U', 'Y', 'V', 'Y'); + return VLC_CODEC_UYVY; } break; } @@ -308,9 +308,9 @@ static vlc_fourcc_t ParseFormat (vout_thread_t *vout, if (f->vhorz_u_period == 2 && f->vvert_u_period == 2) { if (!strcmp ((const char *)f->vcomp_order, "YVU")) - return VLC_FOURCC ('Y', 'V', '1', '2'); + return VLC_CODEC_YV12; if (!strcmp ((const char *)f->vcomp_order, "YUV")) - return VLC_FOURCC ('I', '4', '2', '0'); + return VLC_CODEC_I420; } } break; @@ -401,9 +401,9 @@ static int Init (vout_thread_t *vout) /* Video chroma in preference order */ const vlc_fourcc_t chromas[] = { vout->fmt_in.i_chroma, - VLC_FOURCC ('Y', 'U', 'Y', '2'), - VLC_FOURCC ('R', 'V', '2', '4'), - VLC_FOURCC ('R', 'V', '1', '5'), + VLC_CODEC_YUYV, + VLC_CODEC_RGB24, + VLC_CODEC_RGB15, }; for (size_t i = 0; i < sizeof (chromas) / sizeof (chromas[0]); i++) { diff --git a/modules/video_output/yuv.c b/modules/video_output/yuv.c index cd73fb8645..fffb6009b8 100644 --- a/modules/video_output/yuv.c +++ b/modules/video_output/yuv.c @@ -121,7 +121,7 @@ static int Create( vlc_object_t *p_this ) p_sys->p_fd = NULL; p_sys->b_yuv4mpeg2 = var_CreateGetBool( p_this, CFG_PREFIX "yuv4mpeg2" ); - p_sys->i_chroma = VLC_FOURCC('I','4','2','0'); + p_sys->i_chroma = VLC_CODEC_I420; p_sys->psz_file = var_CreateGetString( p_this, CFG_PREFIX "file" ); @@ -136,8 +136,9 @@ static int Create( vlc_object_t *p_this ) psz_fcc = var_CreateGetNonEmptyString( p_this, CFG_PREFIX "chroma" ); if( psz_fcc && (strlen( psz_fcc ) == 4) ) { - p_sys->i_chroma = VLC_FOURCC( psz_fcc[0], psz_fcc[1], - psz_fcc[2], psz_fcc[3] ); + p_sys->i_chroma = vlc_fourcc_GetCodec( VIDEO_ES, + VLC_FOURCC( psz_fcc[0], psz_fcc[1], + psz_fcc[2], psz_fcc[3] ) ); } free( psz_fcc ); @@ -145,10 +146,9 @@ static int Create( vlc_object_t *p_this ) { switch( p_sys->i_chroma ) { - case VLC_FOURCC('Y','V','1','2'): - case VLC_FOURCC('I','4','2','0'): - case VLC_FOURCC('I','Y','U','V'): - case VLC_FOURCC('J','4','2','0'): + case VLC_CODEC_YV12: + case VLC_CODEC_I420: + case VLC_CODEC_J420: break; default: msg_Err( p_this, diff --git a/modules/visualization/galaktos/plugin.c b/modules/visualization/galaktos/plugin.c index 285ae50995..97cfca3ec6 100644 --- a/modules/visualization/galaktos/plugin.c +++ b/modules/visualization/galaktos/plugin.c @@ -79,8 +79,8 @@ static int Open( vlc_object_t *p_this ) aout_filter_sys_t *p_sys; galaktos_thread_t *p_thread; - 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 ) { msg_Warn( p_filter, "bad input or output format" ); return VLC_EGENERIC; @@ -211,8 +211,7 @@ static void* Thread( vlc_object_t *p_this ) /* Initialize vout parameters */ vout_InitFormat( &p_thread->p_opengl->fmt_in, - VLC_FOURCC('R','V','3','2'), - p_thread->i_width, p_thread->i_height, 1 ); + VLC_CODEC_RGB32, p_thread->i_width, p_thread->i_height, 1 ); p_thread->p_opengl->i_window_width = p_thread->i_width; p_thread->p_opengl->i_window_height = p_thread->i_height; p_thread->p_opengl->render.i_width = p_thread->i_width; diff --git a/modules/visualization/goom.c b/modules/visualization/goom.c index 0dce4b7a6f..08b1d6c0a6 100644 --- a/modules/visualization/goom.c +++ b/modules/visualization/goom.c @@ -137,13 +137,13 @@ static int Open( vlc_object_t *p_this ) video_format_t fmt; - 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 ) { msg_Warn( p_filter, "bad input or output format" ); return VLC_EGENERIC; } - if ( !AOUT_FMTS_SIMILAR( &p_filter->input, &p_filter->output ) ) + if( !AOUT_FMTS_SIMILAR( &p_filter->input, &p_filter->output ) ) { msg_Warn( p_filter, "input and output formats are not similar" ); return VLC_EGENERIC; @@ -167,7 +167,7 @@ static int Open( vlc_object_t *p_this ) fmt.i_width = fmt.i_visible_width = width; fmt.i_height = fmt.i_visible_height = height; - fmt.i_chroma = VLC_FOURCC('R','V','3','2'); + fmt.i_chroma = VLC_CODEC_RGB32; fmt.i_aspect = VOUT_ASPECT_FACTOR * width/height; fmt.i_sar_num = fmt.i_sar_den = 1; diff --git a/modules/visualization/visual/visual.c b/modules/visualization/visual/visual.c index 4702a98952..c26d3b2612 100644 --- a/modules/visualization/visual/visual.c +++ b/modules/visualization/visual/visual.c @@ -193,8 +193,8 @@ static int Open( vlc_object_t *p_this ) char *psz_effects, *psz_parser; video_format_t fmt; - if( ( p_filter->input.i_format != VLC_FOURCC('f','l','3','2') && - p_filter->input.i_format != VLC_FOURCC('f','i','3','2') ) ) + if( ( p_filter->input.i_format != VLC_CODEC_FL32 && + p_filter->input.i_format != VLC_CODEC_FI32 ) ) { return VLC_EGENERIC; } @@ -303,7 +303,7 @@ static int Open( vlc_object_t *p_this ) fmt.i_width = fmt.i_visible_width = p_sys->i_width; fmt.i_height = fmt.i_visible_height = p_sys->i_height; - fmt.i_chroma = VLC_FOURCC('I','4','2','0'); + fmt.i_chroma = VLC_CODEC_I420; fmt.i_aspect = VOUT_ASPECT_FACTOR * p_sys->i_width/p_sys->i_height; fmt.i_sar_num = fmt.i_sar_den = 1; diff --git a/src/audio_output/common.c b/src/audio_output/common.c index 806cb99835..fde38b3ab7 100644 --- a/src/audio_output/common.c +++ b/src/audio_output/common.c @@ -144,29 +144,29 @@ unsigned int aout_BitsPerSample( vlc_fourcc_t i_format ) { switch( i_format ) { - case VLC_FOURCC('u','8',' ',' '): - case VLC_FOURCC('s','8',' ',' '): + case VLC_CODEC_U8: + case VLC_CODEC_S8: return 8; - case VLC_FOURCC('u','1','6','l'): - case VLC_FOURCC('s','1','6','l'): - case VLC_FOURCC('u','1','6','b'): - case VLC_FOURCC('s','1','6','b'): + case VLC_CODEC_U16L: + case VLC_CODEC_S16L: + case VLC_CODEC_U16B: + case VLC_CODEC_S16B: return 16; - case VLC_FOURCC('u','2','4','l'): - case VLC_FOURCC('s','2','4','l'): - case VLC_FOURCC('u','2','4','b'): - case VLC_FOURCC('s','2','4','b'): + case VLC_CODEC_U24L: + case VLC_CODEC_S24L: + case VLC_CODEC_U24B: + case VLC_CODEC_S24B: return 24; - case VLC_FOURCC('s','3','2','l'): - case VLC_FOURCC('s','3','2','b'): - case VLC_FOURCC('f','l','3','2'): - case VLC_FOURCC('f','i','3','2'): + case VLC_CODEC_S32L: + case VLC_CODEC_S32B: + case VLC_CODEC_FL32: + case VLC_CODEC_FI32: return 32; - case VLC_FOURCC('f','l','6','4'): + case VLC_CODEC_FL64: return 64; default: diff --git a/src/audio_output/output.c b/src/audio_output/output.c index 0b0ebfa507..8271868079 100644 --- a/src/audio_output/output.c +++ b/src/audio_output/output.c @@ -177,8 +177,7 @@ int aout_OutputNew( aout_instance_t * p_aout, /* Non-S/PDIF mixer only deals with float32 or fixed32. */ p_aout->mixer.mixer.i_format = (vlc_CPU() & CPU_CAPABILITY_FPU) ? - VLC_FOURCC('f','l','3','2') : - VLC_FOURCC('f','i','3','2'); + VLC_CODEC_FL32 : VLC_CODEC_FI32; aout_FormatPrepare( &p_aout->mixer.mixer ); } else diff --git a/src/input/decoder.c b/src/input/decoder.c index dd2946067a..591c2c17ea 100644 --- a/src/input/decoder.c +++ b/src/input/decoder.c @@ -1694,7 +1694,7 @@ static void DecoderFlushBuffering( decoder_t *p_dec ) static void DecoderProcessSout( decoder_t *p_dec, block_t *p_block ) { decoder_owner_sys_t *p_owner = (decoder_owner_sys_t *)p_dec->p_owner; - const bool b_telx = p_dec->fmt_in.i_codec == VLC_FOURCC('t','e','l','x'); + const bool b_telx = p_dec->fmt_in.i_codec == VLC_CODEC_TELETEXT; block_t *p_sout_block; while( ( p_sout_block = @@ -1850,7 +1850,7 @@ static void DecoderProcessAudio( decoder_t *p_dec, block_t *p_block, bool b_flus static void DecoderProcessSpu( decoder_t *p_dec, block_t *p_block, bool b_flush ) { decoder_owner_sys_t *p_owner = p_dec->p_owner; - const bool b_telx = p_dec->fmt_in.i_codec == VLC_FOURCC('t','e','l','x'); + const bool b_telx = p_dec->fmt_in.i_codec == VLC_CODEC_TELETEXT; input_thread_t *p_input = p_owner->p_input; vout_thread_t *p_vout; diff --git a/src/input/es_out.c b/src/input/es_out.c index 7f8b108cec..c20972a578 100644 --- a/src/input/es_out.c +++ b/src/input/es_out.c @@ -212,7 +212,7 @@ static inline int EsOutGetClosedCaptionsChannel( vlc_fourcc_t fcc ) } static inline bool EsFmtIsTeletext( const es_format_t *p_fmt ) { - return p_fmt->i_cat == SPU_ES && p_fmt->i_codec == VLC_FOURCC( 't', 'e', 'l', 'x' ); + return p_fmt->i_cat == SPU_ES && p_fmt->i_codec == VLC_CODEC_TELETEXT; } /***************************************************************************** @@ -1921,19 +1921,13 @@ static int EsOutSend( es_out_t *out, es_out_id_t *es, block_t *p_block ) input_DecoderIsCcPresent( es->p_dec, pb_cc ); for( int i = 0; i < 4; i++ ) { - static const vlc_fourcc_t fcc[4] = { - VLC_FOURCC('c', 'c', '1', ' '), - VLC_FOURCC('c', 'c', '2', ' '), - VLC_FOURCC('c', 'c', '3', ' '), - VLC_FOURCC('c', 'c', '4', ' '), - }; es_format_t fmt; if( es->pb_cc_present[i] || !pb_cc[i] ) continue; msg_Dbg( p_input, "Adding CC track %d for es[%d]", 1+i, es->i_id ); - es_format_Init( &fmt, SPU_ES, fcc[i] ); + es_format_Init( &fmt, SPU_ES, EsOutFourccClosedCaptions[i] ); fmt.i_group = es->fmt.i_group; if( asprintf( &fmt.psz_description, _("Closed captions %u"), 1 + i ) == -1 ) diff --git a/src/misc/es_format.c b/src/misc/es_format.c index 6b521374c7..e6a81cf95c 100644 --- a/src/misc/es_format.c +++ b/src/misc/es_format.c @@ -92,24 +92,24 @@ void video_format_FixRgb( video_format_t *p_fmt ) { switch( p_fmt->i_chroma ) { - case VLC_FOURCC('R','V','1','5'): + case VLC_CODEC_RGB15: p_fmt->i_rmask = 0x7c00; p_fmt->i_gmask = 0x03e0; p_fmt->i_bmask = 0x001f; break; - case VLC_FOURCC('R','V','1','6'): + case VLC_CODEC_RGB16: p_fmt->i_rmask = 0xf800; p_fmt->i_gmask = 0x07e0; p_fmt->i_bmask = 0x001f; break; - case VLC_FOURCC('R','V','2','4'): + case VLC_CODEC_RGB24: p_fmt->i_rmask = 0xff0000; p_fmt->i_gmask = 0x00ff00; p_fmt->i_bmask = 0x0000ff; break; - case VLC_FOURCC('R','V','3','2'): + case VLC_CODEC_RGB32: p_fmt->i_rmask = 0x00ff0000; p_fmt->i_gmask = 0x0000ff00; p_fmt->i_bmask = 0x000000ff; diff --git a/src/misc/image.c b/src/misc/image.c index b0a808f82d..ba567af1b2 100644 --- a/src/misc/image.c +++ b/src/misc/image.c @@ -523,23 +523,23 @@ static const struct } ext_table[] = { - { VLC_FOURCC('j','p','e','g'), "jpeg" }, - { VLC_FOURCC('j','p','e','g'), "jpg" }, - { VLC_FOURCC('l','j','p','g'), "ljpg" }, - { VLC_FOURCC('p','n','g',' '), "png" }, - { VLC_FOURCC('p','g','m',' '), "pgm" }, - { VLC_FOURCC('p','g','m','y'), "pgmyuv" }, + { VLC_CODEC_JPEG, "jpeg" }, + { VLC_CODEC_JPEG, "jpg" }, + { VLC_CODEC_JPEGLS, "ljpg" }, + { VLC_CODEC_PNG, "png" }, + { VLC_CODEC_PGM, "pgm" }, + { VLC_CODEC_PGMYUV, "pgmyuv" }, { VLC_FOURCC('p','b','m',' '), "pbm" }, { VLC_FOURCC('p','a','m',' '), "pam" }, - { 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('t','i','f','f'), "tif" }, - { VLC_FOURCC('t','i','f','f'), "tiff" }, + { VLC_CODEC_PCX, "pcx" }, + { VLC_CODEC_GIF, "gif" }, + { VLC_CODEC_TIFF, "tif" }, + { VLC_CODEC_TIFF, "tiff" }, { VLC_FOURCC('l','b','m',' '), "lbm" }, { 0, NULL } }; @@ -584,20 +584,20 @@ static const struct const char *psz_mime; } mime_table[] = { - { VLC_FOURCC('b','m','p',' '), "image/bmp" }, - { VLC_FOURCC('b','m','p',' '), "image/x-bmp" }, - { VLC_FOURCC('b','m','p',' '), "image/x-bitmap" }, - { VLC_FOURCC('b','m','p',' '), "image/x-ms-bmp" }, - { VLC_FOURCC('p','n','m',' '), "image/x-portable-anymap" }, - { VLC_FOURCC('p','n','m',' '), "image/x-portable-bitmap" }, - { VLC_FOURCC('p','n','m',' '), "image/x-portable-graymap" }, - { VLC_FOURCC('p','n','m',' '), "image/x-portable-pixmap" }, - { VLC_FOURCC('g','i','f',' '), "image/gif" }, - { VLC_FOURCC('j','p','e','g'), "image/jpeg" }, - { VLC_FOURCC('p','c','x',' '), "image/pcx" }, - { VLC_FOURCC('p','n','g',' '), "image/png" }, - { VLC_FOURCC('t','i','f','f'), "image/tiff" }, - { VLC_FOURCC('t','g','a',' '), "iamge/x-tga" }, + { VLC_CODEC_BMP, "image/bmp" }, + { VLC_CODEC_BMP, "image/x-bmp" }, + { VLC_CODEC_BMP, "image/x-bitmap" }, + { VLC_CODEC_BMP, "image/x-ms-bmp" }, + { VLC_CODEC_PNM, "image/x-portable-anymap" }, + { VLC_CODEC_PNM, "image/x-portable-bitmap" }, + { VLC_CODEC_PNM, "image/x-portable-graymap" }, + { VLC_CODEC_PNM, "image/x-portable-pixmap" }, + { VLC_CODEC_GIF, "image/gif" }, + { VLC_CODEC_JPEG, "image/jpeg" }, + { VLC_CODEC_PCX, "image/pcx" }, + { VLC_CODEC_PNG, "image/png" }, + { VLC_CODEC_TIFF, "image/tiff" }, + { VLC_CODEC_TARGA, "iamge/x-tga" }, { VLC_FOURCC('x','p','m',' '), "image/x-xpixmap" }, { 0, NULL } }; diff --git a/src/osd/osd_text.c b/src/osd/osd_text.c index 7ae4be9b5d..375a02af97 100644 --- a/src/osd/osd_text.c +++ b/src/osd/osd_text.c @@ -90,7 +90,7 @@ int osd_ShowTextAbsolute( spu_t *p_spu_channel, int i_channel, /* 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; diff --git a/src/osd/osd_widgets.c b/src/osd/osd_widgets.c index 5e880ead03..32af4b8428 100644 --- a/src/osd/osd_widgets.c +++ b/src/osd/osd_widgets.c @@ -159,7 +159,7 @@ static int CreatePicture( spu_t *p_spu, subpicture_t *p_subpic, /* Create a new subpicture region */ memset( &fmt, 0, sizeof(video_format_t) ); - fmt.i_chroma = VLC_FOURCC('Y','U','V','A'); + fmt.i_chroma = VLC_CODEC_YUVA; fmt.i_aspect = 0; fmt.i_width = fmt.i_visible_width = i_width; fmt.i_height = fmt.i_visible_height = i_height; diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c index e2dcfdb113..a2110d5cbe 100644 --- a/src/video_output/video_output.c +++ b/src/video_output/video_output.c @@ -816,10 +816,10 @@ static bool ChromaIsEqual( const picture_heap_t *p_output, const picture_heap_t if( !vout_ChromaCmp( p_output->i_chroma, p_render->i_chroma ) ) return false; - if( p_output->i_chroma != FOURCC_RV15 && - p_output->i_chroma != FOURCC_RV16 && - p_output->i_chroma != FOURCC_RV24 && - p_output->i_chroma != FOURCC_RV32 ) + if( p_output->i_chroma != VLC_CODEC_RGB15 && + p_output->i_chroma != VLC_CODEC_RGB16 && + p_output->i_chroma != VLC_CODEC_RGB24 && + p_output->i_chroma != VLC_CODEC_RGB32 ) return true; return p_output->i_rmask == p_render->i_rmask && diff --git a/src/video_output/video_text.c b/src/video_output/video_text.c index d153b20179..d5a8f6244b 100644 --- a/src/video_output/video_text.c +++ b/src/video_output/video_text.c @@ -92,7 +92,7 @@ int vout_ShowTextAbsolute( vout_thread_t *p_vout, int i_channel, /* 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; diff --git a/src/video_output/vout_intf.c b/src/video_output/vout_intf.c index 80f23e94cf..095101ac0f 100644 --- a/src/video_output/vout_intf.c +++ b/src/video_output/vout_intf.c @@ -469,7 +469,7 @@ static int VoutSnapshotPip( vout_thread_t *p_vout, picture_t *p_pic ) /* */ memset( &fmt_out, 0, sizeof(fmt_out) ); fmt_out = fmt_in; - fmt_out.i_chroma = VLC_FOURCC('Y','U','V','A'); + fmt_out.i_chroma = VLC_CODEC_YUVA; /* */ image_handler_t *p_image = image_HandlerCreate( p_vout ); @@ -752,7 +752,7 @@ int vout_GetSnapshot( vout_thread_t *p_vout, if( pp_image ) { - vlc_fourcc_t i_format = VLC_FOURCC('p','n','g',' '); + vlc_fourcc_t i_format = VLC_CODEC_PNG; if( psz_format && image_Type2Fourcc( psz_format ) ) i_format = image_Type2Fourcc( psz_format ); diff --git a/src/video_output/vout_pictures.c b/src/video_output/vout_pictures.c index d0da611c43..844fc42f06 100644 --- a/src/video_output/vout_pictures.c +++ b/src/video_output/vout_pictures.c @@ -619,62 +619,60 @@ void vout_InitFormat( video_frame_format_t *p_format, vlc_fourcc_t i_chroma, p_format->i_aspect = 0; #endif - switch( i_chroma ) + switch( vlc_fourcc_GetCodec( VIDEO_ES, i_chroma ) ) { - case FOURCC_YUVA: + case VLC_CODEC_YUVA: p_format->i_bits_per_pixel = 32; break; - case FOURCC_I444: - case FOURCC_J444: + case VLC_CODEC_I444: + case VLC_CODEC_J444: p_format->i_bits_per_pixel = 24; break; - case FOURCC_I422: - case FOURCC_YUY2: - case FOURCC_UYVY: - case FOURCC_J422: + case VLC_CODEC_I422: + case VLC_CODEC_YUYV: + case VLC_CODEC_YVYU: + case VLC_CODEC_UYVY: + case VLC_CODEC_VYUY: + case VLC_CODEC_J422: p_format->i_bits_per_pixel = 16; break; - case FOURCC_I440: - case FOURCC_J440: + case VLC_CODEC_I440: + case VLC_CODEC_J440: p_format->i_bits_per_pixel = 16; break; - case FOURCC_I411: - case FOURCC_YV12: - case FOURCC_I420: - case FOURCC_J420: - case FOURCC_IYUV: + case VLC_CODEC_I411: + case VLC_CODEC_YV12: + case VLC_CODEC_I420: + case VLC_CODEC_J420: p_format->i_bits_per_pixel = 12; break; - case FOURCC_I410: - case FOURCC_YVU9: + case VLC_CODEC_I410: p_format->i_bits_per_pixel = 9; break; - case FOURCC_Y211: + case VLC_CODEC_Y211: p_format->i_bits_per_pixel = 8; break; - case FOURCC_YUVP: + case VLC_CODEC_YUVP: p_format->i_bits_per_pixel = 8; break; - case FOURCC_RV32: - case FOURCC_RGBA: + case VLC_CODEC_RGB32: + case VLC_CODEC_RGBA: p_format->i_bits_per_pixel = 32; break; - case FOURCC_RV24: + case VLC_CODEC_RGB24: p_format->i_bits_per_pixel = 24; break; - case FOURCC_RV15: - case FOURCC_RV16: + case VLC_CODEC_RGB15: + case VLC_CODEC_RGB16: p_format->i_bits_per_pixel = 16; break; - case FOURCC_RGB2: + case VLC_CODEC_RGB8: p_format->i_bits_per_pixel = 8; break; - case FOURCC_GREY: - case FOURCC_Y800: - case FOURCC_Y8: - case FOURCC_RGBP: + case VLC_CODEC_GREY: + case VLC_CODEC_RGBP: p_format->i_bits_per_pixel = 8; break; @@ -725,9 +723,9 @@ int __vout_InitPicture( vlc_object_t *p_this, picture_t *p_pic, i_height_aligned = (i_height + 15) >> 4 << 4; /* Calculate coordinates */ - switch( i_chroma ) + switch( vlc_fourcc_GetCodec( VIDEO_ES, i_chroma ) ) { - case FOURCC_I411: + case VLC_CODEC_I411: p_pic->p[ Y_PLANE ].i_lines = i_height_aligned; p_pic->p[ Y_PLANE ].i_visible_lines = i_height; p_pic->p[ Y_PLANE ].i_pitch = i_width_aligned; @@ -743,8 +741,7 @@ int __vout_InitPicture( vlc_object_t *p_this, picture_t *p_pic, p_pic->i_planes = 3; break; - case FOURCC_I410: - case FOURCC_YVU9: + case VLC_CODEC_I410: p_pic->p[ Y_PLANE ].i_lines = i_height_aligned; p_pic->p[ Y_PLANE ].i_visible_lines = i_height; p_pic->p[ Y_PLANE ].i_pitch = i_width_aligned; @@ -760,10 +757,9 @@ int __vout_InitPicture( vlc_object_t *p_this, picture_t *p_pic, p_pic->i_planes = 3; break; - case FOURCC_YV12: - case FOURCC_I420: - case FOURCC_IYUV: - case FOURCC_J420: + case VLC_CODEC_YV12: + case VLC_CODEC_I420: + case VLC_CODEC_J420: p_pic->p[ Y_PLANE ].i_lines = i_height_aligned; p_pic->p[ Y_PLANE ].i_visible_lines = i_height; p_pic->p[ Y_PLANE ].i_pitch = i_width_aligned; @@ -779,8 +775,8 @@ int __vout_InitPicture( vlc_object_t *p_this, picture_t *p_pic, p_pic->i_planes = 3; break; - case FOURCC_I422: - case FOURCC_J422: + case VLC_CODEC_I422: + case VLC_CODEC_J422: p_pic->p[ Y_PLANE ].i_lines = i_height_aligned; p_pic->p[ Y_PLANE ].i_visible_lines = i_height; p_pic->p[ Y_PLANE ].i_pitch = i_width_aligned; @@ -796,8 +792,8 @@ int __vout_InitPicture( vlc_object_t *p_this, picture_t *p_pic, p_pic->i_planes = 3; break; - case FOURCC_I440: - case FOURCC_J440: + case VLC_CODEC_I440: + case VLC_CODEC_J440: p_pic->p[ Y_PLANE ].i_lines = i_height_aligned; p_pic->p[ Y_PLANE ].i_visible_lines = i_height; p_pic->p[ Y_PLANE ].i_pitch = i_width_aligned; @@ -813,8 +809,8 @@ int __vout_InitPicture( vlc_object_t *p_this, picture_t *p_pic, p_pic->i_planes = 3; break; - case FOURCC_I444: - case FOURCC_J444: + case VLC_CODEC_I444: + case VLC_CODEC_J444: p_pic->p[ Y_PLANE ].i_lines = i_height_aligned; p_pic->p[ Y_PLANE ].i_visible_lines = i_height; p_pic->p[ Y_PLANE ].i_pitch = i_width_aligned; @@ -830,7 +826,7 @@ int __vout_InitPicture( vlc_object_t *p_this, picture_t *p_pic, p_pic->i_planes = 3; break; - case FOURCC_YUVA: + case VLC_CODEC_YUVA: p_pic->p[ Y_PLANE ].i_lines = i_height_aligned; p_pic->p[ Y_PLANE ].i_visible_lines = i_height; p_pic->p[ Y_PLANE ].i_pitch = i_width_aligned; @@ -850,7 +846,7 @@ int __vout_InitPicture( vlc_object_t *p_this, picture_t *p_pic, p_pic->i_planes = 4; break; - case FOURCC_YUVP: + case VLC_CODEC_YUVP: p_pic->p->i_lines = i_height_aligned; p_pic->p->i_visible_lines = i_height; p_pic->p->i_pitch = i_width_aligned; @@ -859,7 +855,7 @@ int __vout_InitPicture( vlc_object_t *p_this, picture_t *p_pic, p_pic->i_planes = 1; break; - case FOURCC_Y211: + case VLC_CODEC_Y211: p_pic->p->i_lines = i_height_aligned; p_pic->p->i_visible_lines = i_height; p_pic->p->i_pitch = i_width_aligned; @@ -868,8 +864,10 @@ int __vout_InitPicture( vlc_object_t *p_this, picture_t *p_pic, p_pic->i_planes = 1; break; - case FOURCC_UYVY: - case FOURCC_YUY2: + case VLC_CODEC_UYVY: + case VLC_CODEC_VYUY: + case VLC_CODEC_YUYV: + case VLC_CODEC_YVYU: p_pic->p->i_lines = i_height_aligned; p_pic->p->i_visible_lines = i_height; p_pic->p->i_pitch = i_width_aligned * 2; @@ -878,7 +876,7 @@ int __vout_InitPicture( vlc_object_t *p_this, picture_t *p_pic, p_pic->i_planes = 1; break; - case FOURCC_RGB2: + case VLC_CODEC_RGB8: p_pic->p->i_lines = i_height_aligned; p_pic->p->i_visible_lines = i_height; p_pic->p->i_pitch = i_width_aligned; @@ -887,7 +885,7 @@ int __vout_InitPicture( vlc_object_t *p_this, picture_t *p_pic, p_pic->i_planes = 1; break; - case FOURCC_RV15: + case VLC_CODEC_RGB15: p_pic->p->i_lines = i_height_aligned; p_pic->p->i_visible_lines = i_height; p_pic->p->i_pitch = i_width_aligned * 2; @@ -896,7 +894,7 @@ int __vout_InitPicture( vlc_object_t *p_this, picture_t *p_pic, p_pic->i_planes = 1; break; - case FOURCC_RV16: + case VLC_CODEC_RGB16: p_pic->p->i_lines = i_height_aligned; p_pic->p->i_visible_lines = i_height; p_pic->p->i_pitch = i_width_aligned * 2; @@ -905,7 +903,7 @@ int __vout_InitPicture( vlc_object_t *p_this, picture_t *p_pic, p_pic->i_planes = 1; break; - case FOURCC_RV24: + case VLC_CODEC_RGB24: p_pic->p->i_lines = i_height_aligned; p_pic->p->i_visible_lines = i_height; p_pic->p->i_pitch = i_width_aligned * 3; @@ -914,8 +912,8 @@ int __vout_InitPicture( vlc_object_t *p_this, picture_t *p_pic, p_pic->i_planes = 1; break; - case FOURCC_RV32: - case FOURCC_RGBA: + case VLC_CODEC_RGB32: + case VLC_CODEC_RGBA: p_pic->p->i_lines = i_height_aligned; p_pic->p->i_visible_lines = i_height; p_pic->p->i_pitch = i_width_aligned * 4; @@ -924,10 +922,8 @@ int __vout_InitPicture( vlc_object_t *p_this, picture_t *p_pic, p_pic->i_planes = 1; break; - case FOURCC_GREY: - case FOURCC_Y800: - case FOURCC_Y8: - case FOURCC_RGBP: + case VLC_CODEC_GREY: + case VLC_CODEC_RGBP: p_pic->p->i_lines = i_height_aligned; p_pic->p->i_visible_lines = i_height; p_pic->p->i_pitch = i_width_aligned; @@ -956,30 +952,25 @@ int __vout_InitPicture( vlc_object_t *p_this, picture_t *p_pic, int vout_ChromaCmp( vlc_fourcc_t i_chroma, vlc_fourcc_t i_amorhc ) { static const vlc_fourcc_t p_I420[] = { - FOURCC_I420, FOURCC_IYUV, FOURCC_YV12, FOURCC_J420, 0 + VLC_CODEC_I420, VLC_CODEC_YV12, VLC_CODEC_J420, 0 }; static const vlc_fourcc_t p_I422[] = { - FOURCC_I422, FOURCC_J422, 0 + VLC_CODEC_I422, VLC_CODEC_J422, 0 }; static const vlc_fourcc_t p_I440[] = { - FOURCC_I440, FOURCC_J440, 0 + VLC_CODEC_I440, VLC_CODEC_J440, 0 }; static const vlc_fourcc_t p_I444[] = { - FOURCC_I444, FOURCC_J444, 0 - }; - static const vlc_fourcc_t p_UYVY[] = { - FOURCC_UYVY, FOURCC_UYNV, FOURCC_Y422, 0 - }; - static const vlc_fourcc_t p_YUYV[] = { - FOURCC_YUY2, FOURCC_YUNV, 0 - }; - static const vlc_fourcc_t p_GREY[] = { - FOURCC_GREY, FOURCC_Y800, FOURCC_Y8, 0 + VLC_CODEC_I444, VLC_CODEC_J444, 0 }; static const vlc_fourcc_t *pp_fcc[] = { - p_I420, p_I422, p_I440, p_I444, p_UYVY, p_YUYV, p_GREY, NULL + p_I420, p_I422, p_I440, p_I444, NULL }; + /* */ + i_chroma = vlc_fourcc_GetCodec( VIDEO_ES, i_chroma ); + i_amorhc = vlc_fourcc_GetCodec( VIDEO_ES, i_amorhc ); + /* If they are the same, they are the same ! */ if( i_chroma == i_amorhc ) return 1; diff --git a/src/video_output/vout_pictures.h b/src/video_output/vout_pictures.h index e9144b38a9..8d41545b56 100644 --- a/src/video_output/vout_pictures.h +++ b/src/video_output/vout_pictures.h @@ -25,90 +25,6 @@ * Fourcc definitions that we can handle internally *****************************************************************************/ -/* Packed RGB for 8bpp */ -#define FOURCC_RGB2 VLC_FOURCC('R','G','B','2') - -/* Packed RGB 15bpp, usually 0x7c00, 0x03e0, 0x001f */ -#define FOURCC_RV15 VLC_FOURCC('R','V','1','5') - -/* Packed RGB 16bpp, usually 0xf800, 0x07e0, 0x001f */ -#define FOURCC_RV16 VLC_FOURCC('R','V','1','6') - -/* Packed RGB 24bpp, usually 0x00ff0000, 0x0000ff00, 0x000000ff */ -#define FOURCC_RV24 VLC_FOURCC('R','V','2','4') - -/* Packed RGB 32bpp, usually 0x00ff0000, 0x0000ff00, 0x000000ff */ -#define FOURCC_RV32 VLC_FOURCC('R','V','3','2') - -/* Packed RGBA 32bpp, like RV32 with 0xff000000 used for alpha */ -#define FOURCC_RGBA VLC_FOURCC('R','G','B','A') - -/* Planar YUV 4:2:0, Y:U:V */ -#define FOURCC_I420 VLC_FOURCC('I','4','2','0') -#define FOURCC_IYUV VLC_FOURCC('I','Y','U','V') -#define FOURCC_J420 VLC_FOURCC('J','4','2','0') - -/* Planar YUV 4:2:0, Y:V:U */ -#define FOURCC_YV12 VLC_FOURCC('Y','V','1','2') - -/* Packed YUV 4:2:2, U:Y:V:Y, interlaced */ -#define FOURCC_IUYV VLC_FOURCC('I','U','Y','V') - -/* Packed YUV 4:2:2, U:Y:V:Y */ -#define FOURCC_UYVY VLC_FOURCC('U','Y','V','Y') -#define FOURCC_UYNV VLC_FOURCC('U','Y','N','V') -#define FOURCC_Y422 VLC_FOURCC('Y','4','2','2') - -/* Packed YUV 4:2:2, U:Y:V:Y, reverted */ -#define FOURCC_cyuv VLC_FOURCC('c','y','u','v') - -/* Packed YUV 4:2:2, Y:U:Y:V */ -#define FOURCC_YUY2 VLC_FOURCC('Y','U','Y','2') -#define FOURCC_YUNV VLC_FOURCC('Y','U','N','V') - -/* Packed YUV 4:2:2, Y:V:Y:U */ -#define FOURCC_YVYU VLC_FOURCC('Y','V','Y','U') - -/* Packed YUV 2:1:1, Y:U:Y:V */ -#define FOURCC_Y211 VLC_FOURCC('Y','2','1','1') - -/* Planar YUV 4:1:1, Y:U:V */ -#define FOURCC_I411 VLC_FOURCC('I','4','1','1') - -/* Planar YUV 4:1:0, Y:U:V */ -#define FOURCC_I410 VLC_FOURCC('I','4','1','0') -#define FOURCC_YVU9 VLC_FOURCC('Y','V','U','9') - -/* Planar Y, packed UV, from Matrox */ -#define FOURCC_YMGA VLC_FOURCC('Y','M','G','A') - -/* Planar 4:2:2, Y:U:V */ -#define FOURCC_I422 VLC_FOURCC('I','4','2','2') -#define FOURCC_J422 VLC_FOURCC('J','4','2','2') - -/* Planar 4:4:0, Y:U:V */ -#define FOURCC_I440 VLC_FOURCC('I','4','4','0') -#define FOURCC_J440 VLC_FOURCC('J','4','4','0') - -/* Planar 4:4:4, Y:U:V */ -#define FOURCC_I444 VLC_FOURCC('I','4','4','4') -#define FOURCC_J444 VLC_FOURCC('J','4','4','4') - -/* Planar 4:4:4:4 Y:U:V:A */ -#define FOURCC_YUVA VLC_FOURCC('Y','U','V','A') - -/* Palettized YUV with palette element Y:U:V:A */ -#define FOURCC_YUVP VLC_FOURCC('Y','U','V','P') - -/* Palettized RGB with palette element R:G:B */ -#define FOURCC_RGBP VLC_FOURCC('R','G','B','P') - - -/* Planar 8-bit grayscale */ -#define FOURCC_GREY VLC_FOURCC('G','R','E','Y') -#define FOURCC_Y800 VLC_FOURCC('Y','8','0','0') -#define FOURCC_Y8 VLC_FOURCC('Y','8',' ',' ') - /* Alignment of critical dynamic data structure * * Not all platforms support memalign so we provide a vlc_memalign wrapper diff --git a/src/video_output/vout_subpictures.c b/src/video_output/vout_subpictures.c index 104a9b2f6f..84ac9996fe 100644 --- a/src/video_output/vout_subpictures.c +++ b/src/video_output/vout_subpictures.c @@ -47,11 +47,6 @@ /* Number of simultaneous subpictures */ #define VOUT_MAX_SUBPICTURES (VOUT_MAX_PICTURES) -#define VLC_FOURCC_YUVP VLC_FOURCC('Y','U','V','P') -#define VLC_FOURCC_YUVA VLC_FOURCC('Y','U','V','A') -#define VLC_FOURCC_RGBA VLC_FOURCC('R','G','B','A') -#define VLC_FOURCC_TEXT VLC_FOURCC('T','E','X','T') - /* */ typedef struct { @@ -735,7 +730,7 @@ subpicture_region_t *subpicture_region_New( const video_format_t *p_fmt ) p_region->fmt = *p_fmt; p_region->fmt.p_palette = NULL; - if( p_fmt->i_chroma == VLC_FOURCC_YUVP ) + if( p_fmt->i_chroma == VLC_CODEC_YUVP ) { p_region->fmt.p_palette = calloc( 1, sizeof(*p_region->fmt.p_palette) ); if( p_fmt->p_palette ) @@ -748,7 +743,7 @@ subpicture_region_t *subpicture_region_New( const video_format_t *p_fmt ) p_region->p_style = NULL; p_region->p_picture = NULL; - if( p_fmt->i_chroma == VLC_FOURCC_TEXT ) + if( p_fmt->i_chroma == VLC_CODEC_TEXT ) return p_region; p_region->p_picture = picture_New( p_fmt->i_chroma, p_fmt->i_width, p_fmt->i_height, @@ -1036,11 +1031,11 @@ static void SpuRenderCreateAndLoadScale( spu_t *p_spu ) /* XXX p_spu->p_scale is used for all conversion/scaling except yuvp to * yuva/rgba */ p_spu->p->p_scale = CreateAndLoadScale( VLC_OBJECT(p_spu), - VLC_FOURCC_YUVA, VLC_FOURCC_YUVA, true ); + VLC_CODEC_YUVA, VLC_CODEC_YUVA, true ); /* This one is used for YUVP to YUVA/RGBA without scaling * FIXME rename it */ p_spu->p->p_scale_yuvp = CreateAndLoadScale( VLC_OBJECT(p_spu), - VLC_FOURCC_YUVP, VLC_FOURCC_YUVA, false ); + VLC_CODEC_YUVP, VLC_CODEC_YUVA, false ); } static void SpuRenderText( spu_t *p_spu, bool *pb_rerender_text, @@ -1049,7 +1044,7 @@ static void SpuRenderText( spu_t *p_spu, bool *pb_rerender_text, { filter_t *p_text = p_spu->p->p_text; - assert( p_region->fmt.i_chroma == VLC_FOURCC_TEXT ); + assert( p_region->fmt.i_chroma == VLC_CODEC_TEXT ); if( !p_text || !p_text->p_module ) goto exit; @@ -1354,14 +1349,14 @@ static void SpuRenderRegion( spu_t *p_spu, *p_area = spu_area_create( 0,0, 0,0, scale_size ); /* Render text region */ - if( p_region->fmt.i_chroma == VLC_FOURCC_TEXT ) + if( p_region->fmt.i_chroma == VLC_CODEC_TEXT ) { const int i_min_scale_ratio = SCALE_UNIT; /* FIXME what is the right value? (scale_size is not) */ SpuRenderText( p_spu, &b_rerender_text, p_subpic, p_region, i_min_scale_ratio ); b_restore_format = b_rerender_text; /* Check if the rendering has failed ... */ - if( p_region->fmt.i_chroma == VLC_FOURCC_TEXT ) + if( p_region->fmt.i_chroma == VLC_CODEC_TEXT ) goto exit; } @@ -1369,7 +1364,7 @@ static void SpuRenderRegion( spu_t *p_spu, * FIXME b_force_palette and b_force_crop are applied to all subpictures using palette * instead of only the right one (being the dvd spu). */ - const bool b_using_palette = p_region->fmt.i_chroma == VLC_FOURCC_YUVP; + const bool b_using_palette = p_region->fmt.i_chroma == VLC_CODEC_YUVP; const bool b_force_palette = b_using_palette && p_sys->b_force_palette; const bool b_force_crop = b_force_palette && p_sys->b_force_crop; bool b_changed_palette = false; @@ -1484,7 +1479,7 @@ static void SpuRenderRegion( spu_t *p_spu, /* TODO converting to RGBA for RGB video output is better */ p_scale_yuvp->fmt_out.video = p_region->fmt; - p_scale_yuvp->fmt_out.video.i_chroma = VLC_FOURCC_YUVA; + p_scale_yuvp->fmt_out.video.i_chroma = VLC_CODEC_YUVA; p_picture = p_scale_yuvp->pf_video_filter( p_scale_yuvp, p_picture ); if( !p_picture ) -- 2.39.2