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

All decoders/encoders MUST set output format category (AUDIO/VIDEO/SPU_ES)

parent 4d7d9ec2
......@@ -209,6 +209,9 @@ 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');
return VLC_SUCCESS;
}
......
......@@ -128,6 +128,9 @@ static int OpenDecoder( vlc_object_t *p_this )
if( p_sys->p_intf )
intf_RunThread( p_sys->p_intf );
p_dec->fmt_out.i_cat = SPU_ES;
p_dec->fmt_out.i_codec = 0;
return VLC_SUCCESS;
}
......
......@@ -130,6 +130,9 @@ static int Create( vlc_object_t *p_this )
p_dec->fmt_in.p_extra,
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');
return VLC_SUCCESS;
}
......
......@@ -125,11 +125,12 @@ 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( 'c','v','d',' ' ) );
p_dec->pf_decode_sub = Decode;
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');
return VLC_SUCCESS;
}
......
......@@ -340,7 +340,8 @@ static int Open( vlc_object_t *p_this )
p_sys->i_spu_y = i_posy;
}
es_format_Init( &p_dec->fmt_out, SPU_ES, VLC_FOURCC( 'd','v','b','s' ) );
p_dec->fmt_out.i_cat = SPU_ES;
p_dec->fmt_out.i_codec = 0;
default_clut_init( p_dec );
......
......@@ -167,6 +167,9 @@ static int Create( vlc_object_t *p_this )
ass_process_codec_private( p_track, p_dec->fmt_in.p_extra, p_dec->fmt_in.i_extra );
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');
return VLC_SUCCESS;
}
......
......@@ -129,12 +129,10 @@ static int OpenDecoder( vlc_object_t *p_this )
}
/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys =
(decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
if( ( p_dec->p_sys = p_sys = calloc( 1, sizeof(*p_sys)) ) == NULL )
return VLC_ENOMEM;
/* Initialize the thread properties */
memset( p_sys, 0, sizeof(decoder_sys_t) );
p_sys->p_mpeg2dec = NULL;
p_sys->p_synchro = NULL;
p_sys->p_info = NULL;
......@@ -200,6 +198,8 @@ static int OpenDecoder( vlc_object_t *p_this )
p_sys->p_info = mpeg2_info( p_sys->p_mpeg2dec );
p_dec->pf_decode_video = DecodeBlock;
p_dec->fmt_out.i_cat = VIDEO_ES;
p_dec->fmt_out.i_codec = 0;
return VLC_SUCCESS;
}
......
......@@ -265,6 +265,7 @@ static int Open( vlc_object_t *p_this )
#ifdef LOADER
p_dec->p_sys = NULL;
p_dec->pf_decode_video = DecodeVideo;
p_dec->fmt_out.i_cat = VIDEO_ES;
return VLC_SUCCESS;
#else
return OpenVideo( p_dec );
......@@ -303,6 +304,7 @@ static int Open( vlc_object_t *p_this )
#ifdef LOADER
p_dec->p_sys = NULL;
p_dec->pf_decode_audio = DecodeAudio;
p_dec->fmt_out.i_cat = AUDIO_ES;
return VLC_SUCCESS;
#else
......
......@@ -96,10 +96,9 @@ static int OpenEncoder( vlc_object_t *p_this )
p_enc->fmt_out.i_bitrate, p_enc->fmt_out.audio.i_rate,
p_enc->fmt_out.audio.i_channels );
p_sys = p_enc->p_sys = malloc( sizeof( encoder_sys_t ) );
p_enc->p_sys = p_sys = calloc( 1, sizeof( *p_sys ) );
if( !p_sys )
return VLC_ENOMEM;
memset( p_sys, 0, sizeof( encoder_sys_t ) );
if( !( p_sys->p_fifo = block_FifoNew() ) )
{
......@@ -111,6 +110,7 @@ static int OpenEncoder( vlc_object_t *p_this )
p_enc->fmt_out.audio.i_channels, p_enc->fmt_out.i_bitrate / 1000 );
p_enc->pf_encode_audio = EncodeFrame;
p_enc->fmt_out.i_cat = AUDIO_ES;
return VLC_SUCCESS;
}
......
......@@ -156,14 +156,15 @@ static int OpenDecoder( vlc_object_t *p_this )
}
p_dec->pf_decode_sub = DecodeBlock;
p_dec->fmt_out.i_cat = SPU_ES;
p_dec->fmt_out.i_codec = 0;
/* Allocate the memory needed to store the decoder's structure */
p_dec->p_sys = p_sys = malloc( sizeof( *p_sys ) );
p_dec->p_sys = p_sys = calloc( 1, sizeof( *p_sys ) );
if( p_sys == NULL )
return VLC_ENOMEM;
/* init of p_sys */
memset( p_sys, 0, sizeof( *p_sys ) );
p_sys->i_align = 0;
p_sys->iconv_handle = (vlc_iconv_t)-1;
p_sys->b_autodetect_utf8 = false;
......
......@@ -76,6 +76,8 @@ static int OpenDecoder( vlc_object_t *p_this )
return VLC_ENOMEM;
p_dec->pf_decode_sub = DecodeBlock;
p_dec->fmt_out.i_cat = SPU_ES;
p_dec->fmt_out.i_codec = 0;
/* Unused fields of p_sys - not needed for USF decoding */
p_sys->b_ass = false;
......
......@@ -70,6 +70,7 @@ static int Open( vlc_object_t *p_this )
p_enc->p_sys = NULL;
p_enc->pf_encode_sub = Encode;
p_enc->fmt_out.i_cat = SPU_ES;
return VLC_SUCCESS;
}
......
......@@ -181,11 +181,11 @@ static int Open( vlc_object_t *p_this )
}
p_dec->pf_decode_sub = Decode;
p_sys = p_dec->p_sys = malloc( sizeof(decoder_sys_t) );
p_sys = p_dec->p_sys = calloc( 1, sizeof(*p_sys) );
if( p_sys == NULL )
return VLC_ENOMEM;
memset( p_sys, 0, sizeof(decoder_sys_t) );
p_dec->fmt_out.i_cat = SPU_ES;
p_dec->fmt_out.i_codec = 0;
p_sys->i_align = 0;
for ( i = 0; i < 9; i++ )
......
......@@ -165,6 +165,8 @@ static int OpenEncoder( vlc_object_t *p_this )
p_enc->pf_encode_audio = Encode;
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');
config_ChainParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg );
......
......@@ -780,6 +780,7 @@ 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');
......
......@@ -137,12 +137,11 @@ static int OpenDecoder( vlc_object_t *p_this )
msg_Dbg(p_dec, "OpenDecoder Entering");
/* Allocate the memory needed to store the decoder's structure */
p_dec->p_sys = p_sys = (decoder_sys_t *)malloc(sizeof(decoder_sys_t));
p_dec->p_sys = p_sys = calloc( 1, sizeof(*p_sys) );
if( !p_sys )
return VLC_ENOMEM;
/* Initialize the thread properties */
memset( p_sys, 0, sizeof(decoder_sys_t) );
p_sys->p_mpeg2dec = NULL;
p_sys->p_synchro = NULL;
p_sys->p_info = NULL;
......@@ -199,6 +198,8 @@ static int OpenDecoder( vlc_object_t *p_this )
p_sys->p_info = mpeg2_info( p_sys->p_mpeg2dec );
p_dec->pf_decode_video = DecodeBlock;
p_dec->fmt_out.i_cat = VIDEO_ES;
p_dec->fmt_out.i_codec = 0;
f_wd_dec = fopen("/vlc/dec_pid", "w");
if (f_wd_dec != NULL)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment