Commit 724461bd authored by Laurent Aimar's avatar Laurent Aimar

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.
parent a2552da3
......@@ -24,6 +24,7 @@
#ifndef VLC_CODECS_H
#define VLC_CODECS_H 1
#include <vlc_fourcc.h>
/**
* \file
* This file defines codec related structures needed by the demuxers and decoders
......@@ -302,35 +303,34 @@ wave_format_tag_to_fourcc[] =
{ WAVE_FORMAT_PCM, VLC_FOURCC( 'a', 'r', 'a', 'w' ), "Raw audio" },
{ WAVE_FORMAT_ADPCM, VLC_FOURCC( 'm', 's', 0x00,0x02), "ADPCM" },
{ WAVE_FORMAT_IEEE_FLOAT, VLC_FOURCC( 'a', 'f', 'l', 't' ), "IEEE Float audio" },
{ WAVE_FORMAT_ALAW, VLC_FOURCC( 'a', 'l', 'a', 'w' ), "A-Law" },
{ WAVE_FORMAT_MULAW, VLC_FOURCC( 'm', 'l', 'a', 'w' ), "Mu-Law" },
{ WAVE_FORMAT_ALAW, VLC_CODEC_ALAW, "A-Law" },
{ WAVE_FORMAT_MULAW, VLC_CODEC_MULAW, "Mu-Law" },
{ WAVE_FORMAT_IMA_ADPCM, VLC_FOURCC( 'm', 's', 0x00,0x11), "Ima-ADPCM" },
{ WAVE_FORMAT_GSM610, VLC_FOURCC( 'a', 'g', 's', 'm' ), "Microsoft WAV GSM" },
{ WAVE_FORMAT_G726, VLC_FOURCC( 'g', '7', '2', '6' ), "G.726 ADPCM" },
{ WAVE_FORMAT_MPEGLAYER3, VLC_FOURCC( 'm', 'p', 'g', 'a' ), "Mpeg Audio" },
{ WAVE_FORMAT_MPEG, VLC_FOURCC( 'm', 'p', 'g', 'a' ), "Mpeg Audio" },
{ WAVE_FORMAT_A52, VLC_FOURCC( 'a', '5', '2', ' ' ), "A/52" },
{ WAVE_FORMAT_WMA1, VLC_FOURCC( 'w', 'm', 'a', '1' ), "Window Media Audio v1" },
{ WAVE_FORMAT_WMA2, VLC_FOURCC( 'w', 'm', 'a', '2' ), "Window Media Audio v2" },
{ WAVE_FORMAT_WMA2, VLC_FOURCC( 'w', 'm', 'a', ' ' ), "Window Media Audio v2" },
{ WAVE_FORMAT_WMAP, VLC_FOURCC( 'w', 'm', 'a', 'p' ), "Window Media Audio 9 Professional" },
{ WAVE_FORMAT_WMAL, VLC_FOURCC( 'w', 'm', 'a', 'l' ), "Window Media Audio 9 Lossless" },
{ WAVE_FORMAT_WMAS, VLC_FOURCC( 'w', 'm', 'a', 's' ), "Window Media Audio 9 Speech" },
{ WAVE_FORMAT_GSM610, VLC_CODEC_GSM_MS, "Microsoft WAV GSM" },
{ WAVE_FORMAT_G726, VLC_CODEC_ADPCM_G726, "G.726 ADPCM" },
{ WAVE_FORMAT_MPEGLAYER3, VLC_CODEC_MPGA, "Mpeg Audio" },
{ WAVE_FORMAT_MPEG, VLC_CODEC_MPGA, "Mpeg Audio" },
{ WAVE_FORMAT_A52, VLC_CODEC_A52, "A/52" },
{ WAVE_FORMAT_WMA1, VLC_CODEC_WMA1, "Window Media Audio v1" },
{ WAVE_FORMAT_WMA2, VLC_CODEC_WMA2, "Window Media Audio v2" },
{ WAVE_FORMAT_WMAP, VLC_CODEC_WMAP, "Window Media Audio 9 Professional" },
{ WAVE_FORMAT_WMAL, VLC_CODEC_WMAL, "Window Media Audio 9 Lossless" },
{ WAVE_FORMAT_WMAS, VLC_CODEC_WMAS, "Window Media Audio 9 Speech" },
{ WAVE_FORMAT_DK3, VLC_FOURCC( 'm', 's', 0x00,0x61), "Duck DK3" },
{ WAVE_FORMAT_DK4, VLC_FOURCC( 'm', 's', 0x00,0x62), "Duck DK4" },
{ WAVE_FORMAT_DTS, VLC_FOURCC( 'd', 't', 's', ' ' ), "DTS Coherent Acoustics" },
{ WAVE_FORMAT_DTS_MS, VLC_FOURCC( 'd', 't', 's', ' ' ), "DTS Coherent Acoustics" },
{ WAVE_FORMAT_DIVIO_AAC, VLC_FOURCC( 'm', 'p', '4', 'a' ), "MPEG-4 Audio (Divio)" },
{ WAVE_FORMAT_AAC, VLC_FOURCC( 'm', 'p', '4', 'a' ), "MPEG-4 Audio" },
{ WAVE_FORMAT_FFMPEG_AAC, VLC_FOURCC( 'm', 'p', '4', 'a' ), "MPEG-4 Audio" },
{ WAVE_FORMAT_VORBIS, VLC_FOURCC( 'v', 'o', 'r', 'b' ), "Vorbis Audio" },
{ WAVE_FORMAT_DTS, VLC_CODEC_DTS, "DTS Coherent Acoustics" },
{ WAVE_FORMAT_DTS_MS, VLC_CODEC_DTS, "DTS Coherent Acoustics" },
{ WAVE_FORMAT_DIVIO_AAC, VLC_CODEC_MP4A, "MPEG-4 Audio (Divio)" },
{ WAVE_FORMAT_AAC, VLC_CODEC_MP4A, "MPEG-4 Audio" },
{ WAVE_FORMAT_FFMPEG_AAC, VLC_CODEC_MP4A, "MPEG-4 Audio" },
{ WAVE_FORMAT_VORBIS, VLC_CODEC_VORBIS, "Vorbis Audio" },
{ WAVE_FORMAT_VORB_1, VLC_FOURCC( 'v', 'o', 'r', '1' ), "Vorbis 1 Audio" },
{ WAVE_FORMAT_VORB_1PLUS, VLC_FOURCC( 'v', 'o', '1', '+' ), "Vorbis 1+ Audio" },
{ WAVE_FORMAT_VORB_2, VLC_FOURCC( 'v', 'o', 'r', '2' ), "Vorbis 2 Audio" },
{ WAVE_FORMAT_VORB_2PLUS, VLC_FOURCC( 'v', 'o', '2', '+' ), "Vorbis 2+ Audio" },
{ WAVE_FORMAT_VORB_3, VLC_FOURCC( 'v', 'o', 'r', '3' ), "Vorbis 3 Audio" },
{ WAVE_FORMAT_VORB_3PLUS, VLC_FOURCC( 'v', 'o', '3', '+' ), "Vorbis 3+ Audio" },
{ WAVE_FORMAT_SPEEX, VLC_FOURCC( 's', 'p', 'x', ' ' ), "Speex Audio" },
{ WAVE_FORMAT_SPEEX, VLC_CODEC_SPEEX, "Speex Audio" },
{ WAVE_FORMAT_UNKNOWN, VLC_FOURCC( 'u', 'n', 'd', 'f' ), "Unknown" }
};
......
......@@ -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
......
......@@ -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 */
......
......@@ -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 *
......
......@@ -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;
......
......@@ -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 )
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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);
}
......
......@@ -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);
......
......@@ -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:
......
......@@ -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;
......
......@@ -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 =
......
......@@ -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;
......
......@@ -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:
......
......@@ -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: