Commit 7b452ff3 authored by Laurent Aimar's avatar Laurent Aimar

Used VLC_CODEC_* and i_original_fourcc when applicable.

parent 99d6464f
......@@ -115,7 +115,6 @@ static int OpenCommon( vlc_object_t *p_this, bool b_packetizer )
switch( p_dec->fmt_in.i_codec )
{
case VLC_CODEC_A52:
case VLC_FOURCC('a','5','2','b'):
i_codec = VLC_CODEC_A52;
break;
case VLC_CODEC_EAC3:
......
......@@ -233,7 +233,7 @@ static int Open( decoder_t *p_dec, bool b_packetizer )
{
decoder_sys_t *p_sys;
if( p_dec->fmt_in.i_codec != VLC_FOURCC('a','e','s','3') )
if( p_dec->fmt_in.i_codec != VLC_CODEC_302M )
return VLC_EGENERIC;
/* Allocate the memory needed to store the decoder's structure */
......@@ -253,7 +253,7 @@ static int Open( decoder_t *p_dec, bool b_packetizer )
/* Set callback */
if( b_packetizer )
{
p_dec->fmt_out.i_codec = VLC_FOURCC('a','e','s','3');
p_dec->fmt_out.i_codec = VLC_CODEC_302M;
p_dec->pf_decode_audio = NULL;
p_dec->pf_packetize = Packetize;
......
......@@ -189,7 +189,6 @@ static int DecoderOpen( vlc_object_t *p_this )
case VLC_FOURCC('s','o','w','t'):
case VLC_CODEC_ALAW:
case VLC_FOURCC('u','l','a','w'):
case VLC_CODEC_MULAW:
case VLC_CODEC_FL64:
......@@ -202,9 +201,6 @@ static int DecoderOpen( vlc_object_t *p_this )
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 */
break;
default:
......@@ -252,29 +248,12 @@ static int DecoderOpen( vlc_object_t *p_this )
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( 'i', 'n', '3', '2' ) )
{
/* FIXME: mplayer uses bigendian for in24 .... but here it works
* with little endian ... weird */
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_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_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_CODEC_S24L;
p_dec->fmt_in.audio.i_bitspersample = 24;
}
else if( p_dec->fmt_in.i_codec == VLC_CODEC_S16L ||
p_dec->fmt_in.i_codec == VLC_CODEC_S16B )
{
......@@ -372,8 +351,7 @@ static int DecoderOpen( vlc_object_t *p_this )
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_CODEC_MULAW )
else if( p_dec->fmt_in.i_codec == VLC_CODEC_MULAW )
{
p_dec->fmt_out.i_codec = AOUT_FMT_S16_NE;
p_sys->p_logtos16 = ulawtos16;
......@@ -397,7 +375,6 @@ static int DecoderOpen( vlc_object_t *p_this )
p_dec->fmt_in.audio.i_original_channels;
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_CODEC_MULAW )
{
p_dec->fmt_out.audio.i_bitspersample = 16;
......@@ -1381,7 +1358,6 @@ static int EncoderOpen( vlc_object_t *p_this )
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_CODEC_MULAW)
{
p_enc->fmt_out.audio.i_bitspersample = 8;
......@@ -1396,8 +1372,7 @@ static int EncoderOpen( vlc_object_t *p_this )
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.i_codec == VLC_CODEC_S24B )
{
p_enc->fmt_out.audio.i_bitspersample = 24;
}
......@@ -1405,7 +1380,6 @@ static int EncoderOpen( vlc_object_t *p_this )
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_CODEC_FI32 ||
p_enc->fmt_out.i_codec == VLC_CODEC_FL32 )
{
......@@ -1435,8 +1409,7 @@ static int EncoderOpen( vlc_object_t *p_this )
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_CODEC_MULAW )
else if( 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;
......
......@@ -195,7 +195,7 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
p_sys->b_delayed_open = true;
/* ***** Fill p_context with init values ***** */
p_sys->p_context->codec_tag = ffmpeg_CodecTag( p_dec->fmt_in.i_codec );
p_sys->p_context->codec_tag = ffmpeg_CodecTag( p_dec->fmt_in.i_original_fourcc ?: p_dec->fmt_in.i_codec );
/* ***** Get configuration of ffmpeg plugin ***** */
p_sys->p_context->workaround_bugs =
......
......@@ -93,7 +93,7 @@ static int OpenDecoder( vlc_object_t *p_this )
input_thread_t * p_input;
decoder_sys_t *p_sys;
if( p_dec->fmt_in.i_codec != VLC_FOURCC('c','m','m','l') )
if( p_dec->fmt_in.i_codec != VLC_CODEC_CMML )
return VLC_EGENERIC;
p_dec->pf_decode_sub = DecodeBlock;
......
......@@ -111,10 +111,8 @@ 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( 'c','v','d',' ' ) )
{
if( p_dec->fmt_in.i_codec != VLC_CODEC_CVD )
return VLC_EGENERIC;
}
p_dec->p_sys = p_sys = malloc( sizeof( decoder_sys_t ) );
if( !p_sys )
......
......@@ -184,42 +184,29 @@ typedef struct
static const codec_dll decoders_table[] =
{
/* WVC1 */
{ VLC_FOURCC('W','V','C','1'), "wvc1dmod.dll", &guid_wvc1 },
{ VLC_FOURCC('w','v','c','1'), "wvc1dmod.dll", &guid_wvc1 },
{ VLC_CODEC_VC1, "wvc1dmod.dll", &guid_wvc1 },
/* WMV3 */
{ 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 },
{ VLC_CODEC_WMV3, "wmv9dmod.dll", &guid_wmv9 },
/* WMV2 */
{ VLC_CODEC_WMV2, "wmvdmod.dll", &guid_wmv },
{ VLC_FOURCC('w','m','v','2'), "wmvdmod.dll", &guid_wmv },
{ VLC_CODEC_WMV2, "wmvdmod.dll", &guid_wmv },
/* WMV1 */
{ VLC_CODEC_WMV1, "wmvdmod.dll", &guid_wmv },
{ VLC_FOURCC('w','m','v','1'), "wmvdmod.dll", &guid_wmv },
{ VLC_CODEC_WMV1, "wmvdmod.dll", &guid_wmv },
/* Screen codecs */
{ VLC_FOURCC('M','S','S','2'), "wmsdmod.dll", &guid_wms },
{ VLC_FOURCC('m','s','s','2'), "wmsdmod.dll", &guid_wms },
{ VLC_FOURCC('M','S','S','1'), "wmsdmod.dll", &guid_wms },
{ VLC_FOURCC('m','s','s','1'), "wmsdmod.dll", &guid_wms },
/* Windows Media Video Adv */
{ VLC_FOURCC('W','M','V','A'), "wmvadvd.dll", &guid_wmva },
{ VLC_FOURCC('w','m','v','a'), "wmvadvd.dll", &guid_wmva },
{ VLC_FOURCC('W','V','P','2'), "wmvadvd.dll", &guid_wmva },
{ VLC_FOURCC('w','v','p','2'), "wmvadvd.dll", &guid_wmva },
{ VLC_CODEC_WMVA, "wmvadvd.dll", &guid_wmva },
/* WMA 3 */
{ VLC_FOURCC('W','M','A','3'), "wma9dmod.dll", &guid_wma9 },
{ VLC_FOURCC('w','m','a','3'), "wma9dmod.dll", &guid_wma9 },
{ VLC_CODEC_WMAP, "wma9dmod.dll", &guid_wma9 },
{ VLC_FOURCC('w','m','a','p'), "wma9dmod.dll", &guid_wma9 },
{ VLC_CODEC_WMA3, "wma9dmod.dll", &guid_wma9 },
{ VLC_CODEC_WMAP, "wma9dmod.dll", &guid_wma9 },
/* WMA 2 */
{ VLC_CODEC_WMA2, "wma9dmod.dll", &guid_wma9 },
{ VLC_FOURCC('w','m','a','2'), "wma9dmod.dll", &guid_wma9 },
{ VLC_CODEC_WMA2, "wma9dmod.dll", &guid_wma9 },
/* WMA Speech */
{ VLC_CODEC_WMAS, "wmspdmod.dll", &guid_wma },
{ VLC_FOURCC('w','m','a','s'), "wmspdmod.dll", &guid_wma },
{ VLC_CODEC_WMAS, "wmspdmod.dll", &guid_wma },
/* */
{ 0, NULL, NULL }
......@@ -229,20 +216,15 @@ static const codec_dll encoders_table[] =
{
/* WMV3 */
{ VLC_CODEC_WMV3, "wmvdmoe2.dll", &guid_wmv_enc2 },
{ VLC_FOURCC('w','m','v','3'), "wmvdmoe2.dll", &guid_wmv_enc2 },
/* WMV2 */
{ VLC_CODEC_WMV2, "wmvdmoe2.dll", &guid_wmv_enc2 },
{ VLC_FOURCC('w','m','v','2'), "wmvdmoe2.dll", &guid_wmv_enc2 },
/* WMV1 */
{ 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 },
{ VLC_CODEC_WMA3, "wmadmoe.dll", &guid_wma_enc },
/* WMA 2 */
{ VLC_CODEC_WMA2, "wmadmoe.dll", &guid_wma_enc },
{ VLC_FOURCC('w','m','a','2'), "wmadmoe.dll", &guid_wma_enc },
/* */
{ 0, NULL, NULL }
......@@ -403,7 +385,7 @@ static int DecOpen( decoder_t *p_dec )
dmo_input_type.majortype = MEDIATYPE_Audio;
dmo_input_type.subtype = dmo_input_type.majortype;
dmo_input_type.subtype.Data1 = p_dec->fmt_in.i_codec;
dmo_input_type.subtype.Data1 = p_dec->fmt_in.i_original_fourcc ?: p_dec->fmt_in.i_codec;
fourcc_to_wf_tag( p_dec->fmt_in.i_codec, &i_tag );
if( i_tag ) dmo_input_type.subtype.Data1 = i_tag;
......@@ -434,7 +416,7 @@ static int DecOpen( decoder_t *p_dec )
memcpy( &p_vih[1], p_dec->fmt_in.p_extra, p_dec->fmt_in.i_extra );
p_bih = &p_vih->bmiHeader;
p_bih->biCompression = p_dec->fmt_in.i_codec;
p_bih->biCompression = p_dec->fmt_in.i_original_fourcc ?: p_dec->fmt_in.i_codec;
p_bih->biWidth = p_dec->fmt_in.video.i_width;
p_bih->biHeight = p_dec->fmt_in.video.i_height;
p_bih->biBitCount = p_dec->fmt_in.video.i_bits_per_pixel;
......@@ -449,7 +431,7 @@ static int DecOpen( decoder_t *p_dec )
dmo_input_type.majortype = MEDIATYPE_Video;
dmo_input_type.subtype = dmo_input_type.majortype;
dmo_input_type.subtype.Data1 = p_dec->fmt_in.i_codec;
dmo_input_type.subtype.Data1 = p_dec->fmt_in.i_original_fourcc ?: p_dec->fmt_in.i_codec
dmo_input_type.formattype = FORMAT_VideoInfo;
dmo_input_type.bFixedSizeSamples = 0;
dmo_input_type.bTemporalCompression = 1;
......@@ -681,7 +663,7 @@ static int LoadDMO( vlc_object_t *p_this, HINSTANCE *p_hmsdmo_dll,
uint16_t i_tag;
dmo_partial_type.type = MEDIATYPE_Audio;
dmo_partial_type.subtype = dmo_partial_type.type;
dmo_partial_type.subtype.Data1 = p_fmt->i_codec;
dmo_partial_type.subtype.Data1 = p_fmt->i_original_fourcc ?: p_fmt->i_codec;
fourcc_to_wf_tag( p_fmt->i_codec, &i_tag );
if( i_tag ) dmo_partial_type.subtype.Data1 = i_tag;
}
......@@ -689,7 +671,7 @@ static int LoadDMO( vlc_object_t *p_this, HINSTANCE *p_hmsdmo_dll,
{
dmo_partial_type.type = MEDIATYPE_Video;
dmo_partial_type.subtype = dmo_partial_type.type;
dmo_partial_type.subtype.Data1 = p_fmt->i_codec;
dmo_partial_type.subtype.Data1 = p_fmt->i_original_fourcc ?: p_fmt->i_codec;
}
#ifndef LOADER
......
......@@ -140,11 +140,8 @@ 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_CODEC_DTS &&
p_dec->fmt_in.i_codec != VLC_FOURCC('d','t','s','b') )
{
if( p_dec->fmt_in.i_codec != VLC_CODEC_DTS )
return VLC_EGENERIC;
}
/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys = malloc(sizeof(*p_sys)) ) == NULL )
......
......@@ -1537,7 +1537,7 @@ static subpicture_t *render( decoder_t *p_dec )
continue;
}
/* FIXME: don't create a subpicture region with VLC_FOURCC YUVP
/* FIXME: don't create a subpicture region with VLC CODEC YUVP
* when it actually is a TEXT region */
/* Create new SPU region */
......
......@@ -346,7 +346,7 @@ static int OpenDecoder( vlc_object_t *p_this )
decoder_sys_t *p_sys;
int i_ret;
if( p_dec->fmt_in.i_codec != VLC_FOURCC('k','a','t','e') )
if( p_dec->fmt_in.i_codec != VLC_CODEC_KATE )
{
return VLC_EGENERIC;
}
......@@ -450,7 +450,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( 'k', 'a', 't', 'e' );
p_dec->fmt_out.i_codec = VLC_CODEC_KATE;
}
return i_ret;
......
......@@ -119,15 +119,21 @@ 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_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_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') )
{
if( p_dec->fmt_in.i_codec != VLC_CODEC_MPGV )
return VLC_EGENERIC;
/* Select onl recognized original format (standard mpeg video) */
switch( p_dec->fmt_in.i_original_fourcc )
{
case VLC_FOURCC('m','p','g','1'):
case VLC_FOURCC('m','p','g','2'):
case VLC_FOURCC('m','p','g','v'):
case VLC_FOURCC('P','I','M','1'):
case VLC_FOURCC('h','d','v','2'):
break;
default:
if( p_dec->fmt_in.i_original_fourcc )
return VLC_EGENERIC;
break;
}
/* Allocate the memory needed to store the decoder's structure */
......
......@@ -132,7 +132,6 @@ static int OpenCommon( vlc_object_t *p_this, bool b_packetizer )
{
/* DVD LPCM */
case VLC_CODEC_DVD_LPCM:
case VLC_FOURCC('l','p','c','b'):
b_dvd = true;
break;
/* BD LPCM */
......
......@@ -87,7 +87,6 @@ static int OpenDecoder( vlc_object_t *p_this )
{
/* Planar YUV */
case VLC_CODEC_H261:
case VLC_FOURCC('H','2','6','1'):
break;
default:
......
......@@ -245,27 +245,21 @@ static int Open( vlc_object_t *p_this )
switch( p_dec->fmt_in.i_codec )
{
case VLC_CODEC_H264: /* H.264 */
case VLC_FOURCC('c','v','i','d'): /* Cinepak */
case VLC_CODEC_H264:
case VLC_CODEC_CINEPAK:
case VLC_FOURCC('I','V','4','1'): /* Indeo Video IV */
case VLC_FOURCC('i','v','4','1'): /* dto. */
#ifdef __APPLE__
case VLC_FOURCC('p','x','l','t'): /* Pixlet */
#endif
case VLC_FOURCC('d','v','1','n'): /* DVC Pro 100 NTSC */
case VLC_FOURCC('d','v','1','p'): /* DVC Pro 100 PAL */
case VLC_FOURCC('d','v','h','p'): /* DVC PRO HD 720p */
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_CODEC_DV:
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_CODEC_QTRLE: /* QuickTime animation (RLE) */
case VLC_CODEC_RPZA: /* QuickTime Apple Video */
case VLC_FOURCC('a','z','p','r'): /* QuickTime animation (RLE) */
case VLC_CODEC_QTRLE:
case VLC_CODEC_RPZA:
#ifdef LOADER
p_dec->p_sys = NULL;
p_dec->pf_decode_video = DecodeVideo;
......@@ -394,7 +388,10 @@ static int OpenAudio( decoder_t *p_dec )
p_dec->p_sys = p_sys;
p_dec->pf_decode_audio = DecodeAudio;
memcpy( fcc, &p_dec->fmt_in.i_codec, 4 );
if( p_dec->fmt_in.i_original_fourcc )
memcpy( fcc, &p_dec->fmt_in.i_original_fourcc, 4 );
else
memcpy( fcc, &p_dec->fmt_in.i_codec, 4 );
#ifdef __APPLE__
EnterMovies();
......@@ -694,7 +691,11 @@ static int OpenVideo( decoder_t *p_dec )
return VLC_EGENERIC;
}
memcpy( fcc, &p_dec->fmt_in.i_codec, 4 );
if( p_dec->fmt_in.i_original_fourcc )
memcpy( fcc, &p_dec->fmt_in.i_original_fourcc, 4 );
else
memcpy( fcc, &p_dec->fmt_in.i_codec, 4 );
msg_Dbg( p_dec, "quicktime_video %4.4s %dx%d",
fcc, p_dec->fmt_in.video.i_width, p_dec->fmt_in.video.i_height );
......
......@@ -96,32 +96,24 @@ static int OpenDecoder( vlc_object_t *p_this )
case VLC_CODEC_I422:
case VLC_CODEC_I420:
case VLC_CODEC_YV12:
case VLC_FOURCC('I','Y','U','V'):
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'):
case VLC_CODEC_GREY:
case VLC_CODEC_YUVP:
/* Packed YUV */
case VLC_CODEC_YUYV:
case VLC_FOURCC('Y','8','0','0'):
case VLC_CODEC_YVYU:
case VLC_CODEC_UYVY:
case VLC_FOURCC('H','D','Y','C'):
case VLC_CODEC_VYUY:
/* RGB */
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_CODEC_UYVY;
break;
case VLC_FOURCC('y','v','1','2'):
p_dec->fmt_in.i_codec = VLC_CODEC_YV12;
case VLC_CODEC_RGB8:
case VLC_CODEC_RGBP:
break;
default:
......
......@@ -205,11 +205,8 @@ 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_CODEC_SPEEX
&& p_dec->fmt_in.i_codec != VLC_FOURCC('s', 'p', 'x', 'r') )
{
if( p_dec->fmt_in.i_codec != VLC_CODEC_SPEEX )
return VLC_EGENERIC;
}
/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys =
......@@ -231,7 +228,7 @@ static int OpenDecoder( vlc_object_t *p_this )
being invoked on a Speex stream arriving via RTP.
A special decoder callback is used.
*/
if (p_dec->fmt_in.i_codec == VLC_FOURCC('s', 'p', 'x', 'r'))
if (p_dec->fmt_in.i_original_fourcc == VLC_FOURCC('s', 'p', 'x', 'r'))
{
msg_Dbg( p_dec, "Using RTP version of Speex decoder @ rate %d.",
p_dec->fmt_in.audio.i_rate );
......
......@@ -73,11 +73,8 @@ 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_CODEC_SPU &&
p_dec->fmt_in.i_codec != VLC_FOURCC( 's','p','u','b' ) )
{
if( p_dec->fmt_in.i_codec != VLC_CODEC_SPU )
return VLC_EGENERIC;
}
p_dec->p_sys = p_sys = malloc( sizeof( decoder_sys_t ) );
......
......@@ -234,7 +234,7 @@ static int OpenDecoder( vlc_object_t *p_this )
{
case VLC_CODEC_SUBT:
case VLC_CODEC_SSA:
case VLC_FOURCC('t','1','4','0'):
case VLC_CODEC_ITU_T140:
break;
default:
return VLC_EGENERIC;
......@@ -262,7 +262,7 @@ static int OpenDecoder( vlc_object_t *p_this )
char *psz_charset = NULL;
/* First try demux-specified encoding */
if( p_dec->fmt_in.i_codec == VLC_FOURCC('t','1','4','0') )
if( p_dec->fmt_in.i_codec == VLC_CODEC_ITU_T140 )
psz_charset = strdup( "UTF-8" ); /* IUT T.140 is always using UTF-8 */
else
if( p_dec->fmt_in.subs.psz_encoding && *p_dec->fmt_in.subs.psz_encoding )
......
......@@ -68,7 +68,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('u','s','f',' ') )
if( p_dec->fmt_in.i_codec != VLC_CODEC_USF )
return VLC_EGENERIC;
/* Allocate the memory needed to store the decoder's structure */
......
......@@ -57,14 +57,14 @@ static int Open( vlc_object_t *p_this )
msg_Err( p_this, "Only UTF-8 encoding supported" );
return VLC_EGENERIC;
}
case VLC_FOURCC('t','1','4','0'):
case VLC_CODEC_ITU_T140:
break;
default:
if( !p_enc->b_force )
return VLC_EGENERIC;
p_enc->fmt_out.i_codec = VLC_FOURCC('t','1','4','0');
p_enc->fmt_out.i_codec = VLC_CODEC_ITU_T140;
}
p_enc->p_sys = NULL;
......
......@@ -142,10 +142,8 @@ 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( 'o','g','t',' ' ) )
{
if( p_dec->fmt_in.i_codec != VLC_CODEC_OGT )
return VLC_EGENERIC;
}
p_dec->p_sys = p_sys = calloc( 1, sizeof( decoder_sys_t ) );
if( p_sys == NULL )
......@@ -158,7 +156,7 @@ static int DecoderOpen( vlc_object_t *p_this )
p_sys->i_state = SUBTITLE_BLOCK_EMPTY;
p_sys->p_spu = NULL;
es_format_Init( &p_dec->fmt_out, SPU_ES, VLC_FOURCC( 'o','g','t',' ' ) );
es_format_Init( &p_dec->fmt_out, SPU_ES, VLC_CODEC_OGT );
p_dec->pf_decode_sub = Decode;
p_dec->pf_packetize = Packetize;
......
......@@ -119,9 +119,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('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') &&
if( p_dec->fmt_in.i_codec != VLC_CODEC_WMA1 &&
p_dec->fmt_in.i_codec != VLC_CODEC_WMA2 )
{
return VLC_EGENERIC;
......@@ -166,11 +164,9 @@ static int OpenDecoder( vlc_object_t *p_this )
wfx.rate, wfx.bitrate, wfx.channels, wfx.blockalign,
wfx.bitspersample );
if( p_dec->fmt_in.i_codec == VLC_FOURCC('w','m','a','1')
|| p_dec->fmt_in.i_codec == VLC_CODEC_WMA1 )
if( 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_CODEC_WMA2
|| p_dec->fmt_in.i_codec == VLC_FOURCC('w','m','a','2') )
else if( p_dec->fmt_in.i_codec == VLC_CODEC_WMA2 )
wfx.codec_id = ASF_CODEC_ID_WMAV2;
wfx.datalen = p_dec->fmt_in.i_extra;
......
......@@ -121,17 +121,26 @@ static int OpenDecoder( vlc_object_t *p_this )
#ifdef __GLIBC__
mtrace();
#endif
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') &&
/* VIA hardware-mpeg2 */
p_dec->fmt_in.i_codec != VLC_FOURCC('X','x','M','C') &&
/* ATI Video */
p_dec->fmt_in.i_codec != VLC_FOURCC('V','C','R','2') &&
p_dec->fmt_in.i_codec != VLC_FOURCC('m','p','g','2') )
{
if( p_dec->fmt_in.i_codec != VLC_CODEC_MPGV )
return VLC_EGENERIC;
/* Select onl recognized original format (standard mpeg video) */
switch( p_dec->fmt_in.i_original_fourcc )
{
case VLC_FOURCC('m','p','g','1'):
case VLC_FOURCC('m','p','g','2'):
case VLC_FOURCC('m','p','g','v'):
/* Pinnacle hardware-mpeg1 */
case VLC_FOURCC('P','I','M','1'):
/* VIA hardware-mpeg2 */
case VLC_FOURCC('X','x','M','C'):
/* ATI Video */
case VLC_FOURCC('V','C','R','2'):
case VLC_FOURCC('m','p','g','2'):
break;
default:
if( p_dec->fmt_in.i_original_fourcc )
return VLC_EGENERIC;
break;
}
msg_Dbg(p_dec, "OpenDecoder Entering");
......
......@@ -278,7 +278,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
/* This is a hack */
if( i_codec_id == CODEC_ID_MP2 )
i_codec_id = CODEC_ID_MP3;
codec->codec_tag = p_input->p_fmt->i_codec;
codec->codec_tag = p_input->p_fmt->i_original_fourcc ?: p_input->p_fmt->i_codec;
#endif
codec->codec_id = i_codec_id;
......
......@@ -402,7 +402,7 @@ static int Open( vlc_object_t * p_this )
tk->i_samplesize = tk->i_blocksize;
}
if( tk->i_codec == VLC_FOURCC( 'v', 'o', 'r', 'b' ) )
if( tk->i_codec == VLC_CODEC_VORBIS )
{
tk->i_blocksize = 0; /* fix vorbis VBR decoding */
}
......@@ -445,7 +445,7 @@ static int Open( vlc_object_t * p_this )
* - Size of the next packet, and so on ...
*/
if( tk->i_codec == VLC_FOURCC( 'v', 'o', 'r', 'b' ) )
if( tk->i_codec == VLC_CODEC_VORBIS )
{
uint8_t *p_extra = fmt.p_extra;
size_t i_extra = fmt.i_extra;
......@@ -511,33 +511,33 @@ static int Open( vlc_object_t * p_this )
switch( p_vids->p_bih->biBitCount )
{
case 32:
tk->i_codec = VLC_FOURCC('R','V','3','2');
tk->i_codec = VLC_CODEC_RGB32;
break;
case 24:
tk->i_codec = VLC_FOURCC('R','V','2','4');
tk->i_codec = VLC_CODEC_RGB24;
break;
case 16: /* Yes it is RV15 */
case 15:
tk->i_codec = VLC_FOURCC('R','V','1','5');
tk->i_codec = VLC_CODEC_RGB15;
break;
case 9: /* <- TODO check that */
tk->i_codec = VLC_FOURCC( 'Y', 'V', 'U', '9' );
tk->i_codec = VLC_CODEC_I410;
break;
case 8: /* <- TODO check that */
tk->i_codec = VLC_FOURCC('Y','8','0','0');
tk->i_codec = VLC_CODEC_GREY;
break;
}
es_format_Init( &fmt, VIDEO_ES, tk->i_codec );
switch( tk->i_codec )
{
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;
break;
case VLC_FOURCC('R','V','1','5'):
case VLC_CODEC_RGB15:
fmt.video.i_rmask = 0x7c00;