Commit 5dbd54ec authored by Steve Lhomme's avatar Steve Lhomme Committed by Jean-Baptiste Kempf

decoder/packetizer: no need to set the output ES category anymore

It's done when loading the decoder/packetizer.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 669d8ad9
......@@ -352,7 +352,6 @@ static int Open( vlc_object_t *p_this )
p_dec->fmt_in.audio.i_physical_channels,
p_sys->pi_chan_table );
p_dec->fmt_out.i_cat = AUDIO_ES;
p_dec->fmt_out.audio = p_dec->fmt_in.audio;
#ifdef LIBA52_FIXED
p_dec->fmt_out.audio.i_format = VLC_CODEC_S32N;
......
......@@ -275,7 +275,6 @@ static int OpenDecoder( vlc_object_t *p_this )
}
p_dec->p_sys = p_sys;
p_dec->fmt_out.i_cat = AUDIO_ES;
p_dec->fmt_out.i_codec = VLC_CODEC_S16N;
p_dec->fmt_out.audio.i_rate = p_dec->fmt_in.audio.i_rate;
p_dec->fmt_out.audio.i_channels = i_channels;
......
......@@ -282,7 +282,6 @@ static int Open( decoder_t *p_dec, bool b_packetizer )
date_Set( &p_sys->end_date, 0 );
/* Set output properties */
p_dec->fmt_out.i_cat = AUDIO_ES;
p_dec->fmt_out.audio.i_rate = 48000;
/* Set callback */
......
......@@ -281,7 +281,6 @@ static int OpenDecoder(vlc_object_t *p_this)
dec->pf_decode = Decode;
dec->fmt_out.i_cat = VIDEO_ES;
dec->fmt_out.video.i_width = dec->fmt_in.video.i_width;
dec->fmt_out.video.i_height = dec->fmt_in.video.i_height;
dec->fmt_out.i_codec = VLC_CODEC_I420;
......
......@@ -271,7 +271,6 @@ static int DecoderOpen( vlc_object_t *p_this )
return VLC_ENOMEM;
/* Set output properties */
p_dec->fmt_out.i_cat = AUDIO_ES;
p_dec->fmt_out.i_codec = format;
p_dec->fmt_out.audio.i_format = format;
p_dec->fmt_out.audio.i_rate = p_dec->fmt_in.audio.i_rate;
......
......@@ -118,7 +118,6 @@ static int Open( vlc_object_t *p_this )
p_dec->p_sys = p_sys;
p_dec->pf_decode = Decode;
p_dec->fmt_out.i_cat = SPU_ES;
p_dec->fmt_out.i_codec = 0;
p_sys->b_a_profile = ( p_dec->fmt_in.i_codec == VLC_CODEC_ARIB_A );
......
......@@ -250,7 +250,6 @@ int InitAudioDec( vlc_object_t *obj )
p_sys->i_previous_layout = 0;
/* */
p_dec->fmt_out.i_cat = AUDIO_ES;
/* Try to set as much information as possible but do not trust it */
SetupOutputFormat( p_dec, false );
......
......@@ -122,7 +122,6 @@ int InitSubtitleDec(vlc_object_t *obj)
/* */
msg_Dbg(dec, "libavcodec codec (%s) started", codec->name);
dec->fmt_out.i_cat = SPU_ES;
dec->pf_decode = DecodeSubtitle;
dec->pf_flush = Flush;
......
......@@ -571,7 +571,6 @@ int InitVideoDec( vlc_object_t *obj )
p_sys->b_from_preroll = false;
/* Set output properties */
p_dec->fmt_out.i_cat = VIDEO_ES;
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 */
......
......@@ -76,9 +76,6 @@ static int OpenDecoder(vlc_object_t *p_this)
return VLC_EGENERIC;
}
/* Set output properties */
p_dec->fmt_out.i_cat = VIDEO_ES;
/* Set callbacks */
p_dec->pf_decode = DecodeBlock;
......
......@@ -278,7 +278,6 @@ static int Open( vlc_object_t *p_this )
p_sys->b_opaque = var_InheritBool( p_dec, "cc-opaque" );
p_sys->i_reorder_depth = p_dec->fmt_in.subs.cc.i_reorder_depth;
p_dec->fmt_out.i_cat = SPU_ES;
p_dec->fmt_out.i_codec = VLC_CODEC_TEXT;
return VLC_SUCCESS;
......
......@@ -113,7 +113,6 @@ 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_CODEC_RGB32;
p_dec->fmt_out.video.i_width = CDG_DISPLAY_WIDTH;
p_dec->fmt_out.video.i_height = CDG_DISPLAY_HEIGHT;
......
......@@ -344,7 +344,6 @@ 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_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;
......
......@@ -125,7 +125,6 @@ static int DecoderOpen( vlc_object_t *p_this )
p_dec->pf_decode = Decode;
p_dec->pf_packetize = Packetize;
p_dec->fmt_out.i_cat = SPU_ES;
p_dec->fmt_out.i_codec = VLC_CODEC_YUVP;
return VLC_SUCCESS;
......
......@@ -180,7 +180,6 @@ static int OpenDecoder( vlc_object_t *p_this )
p_sys->dcx = NULL;
/* Set output properties */
p_dec->fmt_out.i_cat = VIDEO_ES;
p_dec->fmt_out.i_codec = VLC_CODEC_I420;
/* Set callbacks */
......
......@@ -322,7 +322,6 @@ static int Open( vlc_object_t *p_this )
p_dec->fmt_in.audio.i_physical_channels,
p_sys->pi_chan_table );
p_dec->fmt_out.i_cat = AUDIO_ES;
p_dec->fmt_out.audio = p_dec->fmt_in.audio;
p_dec->fmt_out.audio.i_format = VLC_CODEC_FL32;
p_dec->fmt_out.i_codec = p_dec->fmt_out.audio.i_format;
......
......@@ -367,7 +367,6 @@ static int Open( vlc_object_t *p_this )
p_sys->i_spu_y = i_posy;
}
p_dec->fmt_out.i_cat = SPU_ES;
p_dec->fmt_out.i_codec = 0;
default_clut_init( p_dec );
......
......@@ -129,7 +129,6 @@ static int Open( vlc_object_t *p_this )
/* Misc init */
date_Set( &p_sys->date, 0 );
p_dec->fmt_out.i_cat = AUDIO_ES;
p_dec->fmt_out.i_codec = HAVE_FPU ? VLC_CODEC_FL32 : VLC_CODEC_S16N;
......
......@@ -488,7 +488,6 @@ static int OpenDecoder( vlc_object_t *p_this )
#endif
/* Set output properties */
p_dec->fmt_out.i_cat = AUDIO_ES;
p_dec->fmt_out.i_codec = VLC_CODEC_S32N;
/* Set callbacks */
......
......@@ -167,7 +167,6 @@ static int Open (vlc_object_t *p_this)
fluid_synth_set_reverb_on (p_sys->synth,
var_InheritBool (p_this, "synth-reverb"));
p_dec->fmt_out.i_cat = AUDIO_ES;
p_dec->fmt_out.audio.i_rate =
var_InheritInteger (p_this, "synth-sample-rate");;
fluid_synth_set_sample_rate (p_sys->synth, p_dec->fmt_out.audio.i_rate);
......
......@@ -188,7 +188,6 @@ static int DecoderOpen( vlc_object_t *p_this )
p_dec->pf_flush = Flush;
p_dec->p_sys = p_sys;
p_dec->fmt_out.i_cat = AUDIO_ES;
p_dec->fmt_out.i_codec = VLC_CODEC_S16N;
p_dec->fmt_out.audio.i_format = VLC_CODEC_S16N;
p_dec->fmt_out.audio.i_rate = p_dec->fmt_in.audio.i_rate;
......
......@@ -600,8 +600,6 @@ static int OpenDecoder( vlc_object_t *p_this )
VLC_EGENERIC );
}
p_dec->fmt_out.i_cat = p_dec->fmt_in.i_cat;
/* set the pipeline to playing */
i_ret = gst_element_set_state( p_sys->p_decoder, GST_STATE_PLAYING );
VLC_GST_CHECK( i_ret, GST_STATE_CHANGE_FAILURE,
......
......@@ -174,9 +174,6 @@ static int OpenDecoder(vlc_object_t *p_this)
p_sys->err.error_exit = user_error_exit;
p_sys->err.output_message = user_error_message;
/* Set output properties */
p_dec->fmt_out.i_cat = VIDEO_ES;
/* Set callbacks */
p_dec->pf_decode = DecodeBlock;
......
......@@ -252,7 +252,6 @@ 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 );
p_dec->fmt_out.i_cat = SPU_ES;
p_dec->fmt_out.i_codec = VLC_CODEC_RGBA;
return VLC_SUCCESS;
......
......@@ -242,7 +242,6 @@ static int OpenDecoder( vlc_object_t *p_this )
p_dec->pf_decode = DecodeVideo;
p_dec->pf_flush = Reset;
p_dec->fmt_out.i_cat = VIDEO_ES;
p_dec->fmt_out.i_codec = 0;
return VLC_SUCCESS;
......
......@@ -259,8 +259,6 @@ static int OpenCommon( vlc_object_t *p_this, bool b_packetizer )
p_sys->i_chans_to_reorder = 0;
/* Set output properties */
p_dec->fmt_out.i_cat = AUDIO_ES;
if( b_packetizer )
{
switch( i_type )
......
......@@ -267,7 +267,6 @@ static int Open( vlc_object_t *p_this )
mad_synth_init( &p_sys->mad_synth );
mad_stream_options( &p_sys->mad_stream, MAD_OPTION_IGNORECRC );
p_dec->fmt_out.i_cat = AUDIO_ES;
p_dec->fmt_out.audio = p_dec->fmt_in.audio;
p_dec->fmt_out.audio.i_format = VLC_CODEC_FL32;
p_dec->fmt_out.i_codec = p_dec->fmt_out.audio.i_format;
......
......@@ -1141,7 +1141,6 @@ static int Open(vlc_object_t *p_this)
goto error;
p_dec->pf_decode = p_sys->is_async ? DecodeAsync : DecodeSync;
p_dec->fmt_out.i_cat = p_dec->fmt_in.i_cat;
return VLC_SUCCESS;
......
......@@ -372,7 +372,6 @@ static int OpenDecoder( vlc_object_t *p_this )
p_dec->fmt_in.i_codec != VLC_CODEC_MP3 )
return VLC_EGENERIC;
p_dec->fmt_out.i_cat = AUDIO_ES;
p_dec->fmt_out.i_codec = VLC_CODEC_FL32;
/* Initialize libmpg123 */
......
......@@ -118,7 +118,6 @@ static int OpenDecoder(vlc_object_t* p_this)
p_sys->i_pts = VLC_TS_INVALID;
/* Set output properties */
p_dec->fmt_out.i_cat = VIDEO_ES;
p_dec->fmt_out.i_codec = VLC_CODEC_RGBA;
/* Initialize image handler */
......
......@@ -614,7 +614,6 @@ static int OpenDecoder(vlc_object_t *p_this, pf_MediaCodecApi_init pf_init)
p_dec->p_sys = p_sys;
p_dec->fmt_out.i_cat = p_dec->fmt_in.i_cat;
p_dec->fmt_out.video = p_dec->fmt_in.video;
p_dec->fmt_out.audio = p_dec->fmt_in.audio;
p_dec->fmt_out.video.i_visible_width = p_dec->fmt_out.video.i_width;
......
......@@ -1078,7 +1078,6 @@ static int OpenGeneric( vlc_object_t *p_this, bool b_encode )
/* Initialise the thread properties */
if(!b_encode)
{
p_dec->fmt_out.i_cat = p_dec->fmt_in.i_cat;
p_dec->fmt_out.video = p_dec->fmt_in.video;
p_dec->fmt_out.audio = p_dec->fmt_in.audio;
p_dec->fmt_out.i_codec = 0;
......
......@@ -182,7 +182,6 @@ static int OpenDecoder( vlc_object_t *p_this )
date_Set( &p_sys->end_date, 0 );
/* Set output properties */
p_dec->fmt_out.i_cat = AUDIO_ES;
p_dec->fmt_out.i_codec = VLC_CODEC_FL32;
p_dec->pf_decode = DecodeAudio;
......
......@@ -123,7 +123,6 @@ static int OpenDecoder( vlc_object_t *p_this )
p_dec->p_sys->p_obj = p_this;
/* Set output properties */
p_dec->fmt_out.i_cat = VIDEO_ES;
p_dec->fmt_out.i_codec = VLC_CODEC_RGBA;
/* Set callbacks */
......
......@@ -584,7 +584,6 @@ static int OpenDecoder( vlc_object_t *p_this )
p_sys->i_frame_pts_delta = 0;
/* Set output properties */
p_dec->fmt_out.i_cat = VIDEO_ES;
p_dec->fmt_out.i_codec = VLC_CODEC_I420;
/* Set callbacks */
......
......@@ -112,7 +112,6 @@ static int OpenDecoder( vlc_object_t *p_this )
p_sys->psz_sdl_type = p_supported_fmt[i].psz_sdl_type;
/* 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_CODEC_RGB32;
/* Set callbacks */
......
......@@ -73,7 +73,6 @@ OpenDecoder(vlc_object_t *p_this)
}
/* Set output properties */
p_dec->fmt_out.i_cat = AUDIO_ES;
p_dec->fmt_out.i_codec = p_dec->fmt_in.i_codec;
p_dec->fmt_out.audio = p_dec->fmt_in.audio;
p_dec->fmt_out.audio.i_format = p_dec->fmt_out.i_codec;
......
......@@ -224,7 +224,6 @@ static int OpenDecoder( vlc_object_t *p_this )
date_Set( &p_sys->end_date, 0 );
/* Set output properties */
p_dec->fmt_out.i_cat = AUDIO_ES;
p_dec->fmt_out.i_codec = VLC_CODEC_S16N;
/*
......
......@@ -480,7 +480,6 @@ static int Open(vlc_object_t *object)
dec->p_sys = sys;
dec->pf_decode = Decode;
dec->fmt_out.i_cat = SPU_ES;
dec->fmt_out.i_codec = 0;
return VLC_SUCCESS;
}
......
......@@ -234,7 +234,6 @@ static int OpenDecoder( vlc_object_t *p_this )
}
p_dec->pf_decode = 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 */
......
......@@ -61,7 +61,6 @@ static int Open( vlc_object_t *p_this )
p_dec->pf_decode = Decode;
p_dec->fmt_out.i_cat = SPU_ES;
p_dec->fmt_out.i_codec = 0;
if( p_dec->fmt_out.subs.p_style )
{
......
......@@ -127,7 +127,6 @@ static int OpenDecoder( vlc_object_t *p_this )
return VLC_ENOMEM;
p_dec->pf_decode = DecodeBlock;
p_dec->fmt_out.i_cat = SPU_ES;
p_dec->fmt_out.i_codec = 0;
/* init of p_sys */
......
......@@ -108,7 +108,6 @@ static int OpenDecoder( vlc_object_t *p_this )
#endif
/* Set output properties */
p_dec->fmt_out.i_cat = VIDEO_ES;
p_dec->fmt_out.i_codec = VLC_CODEC_BGRA;
/* Set callbacks */
......
......@@ -183,7 +183,6 @@ static int Open( vlc_object_t *p_this )
p_sys = p_dec->p_sys = calloc( 1, sizeof(*p_sys) );
if( p_sys == NULL )
return VLC_ENOMEM;
p_dec->fmt_out.i_cat = SPU_ES;
p_dec->fmt_out.i_codec = 0;
p_sys->i_align = 0;
......
......@@ -273,7 +273,6 @@ static int Open(vlc_object_t *object)
p_dec->p_sys = p_sys;
p_dec->pf_decode = Decode;
p_dec->fmt_out.i_cat = SPU_ES;
p_dec->fmt_out.i_codec = 0;
return VLC_SUCCESS;
......
......@@ -166,7 +166,6 @@ static int OpenDecoder( vlc_object_t *p_this )
p_sys->tcx = NULL;
/* Set output properties */
p_dec->fmt_out.i_cat = VIDEO_ES;
p_dec->fmt_out.i_codec = VLC_CODEC_I420;
/* Set callbacks */
......
......@@ -976,7 +976,6 @@ int OpenDecoder( vlc_object_t *p_this )
return VLC_ENOMEM;
p_dec->pf_decode = DecodeBlock;
p_dec->fmt_out.i_cat = SPU_ES;
p_sys->i_align = var_InheritInteger( p_dec, "ttml-align" );
return VLC_SUCCESS;
......
......@@ -868,7 +868,6 @@ static int OpenDecoder(vlc_object_t *p_this)
vlc_mutex_init(&p_sys->lock);
/* return our proper VLC internal state */
p_dec->fmt_out.i_cat = p_dec->fmt_in.i_cat;
p_dec->fmt_out.video = p_dec->fmt_in.video;
if (!p_dec->fmt_out.video.i_sar_num || !p_dec->fmt_out.video.i_sar_den)
{
......
......@@ -254,7 +254,6 @@ static int OpenDecoder( vlc_object_t *p_this )
vorbis_comment_init( &p_sys->vc );
/* Set output properties */
p_dec->fmt_out.i_cat = AUDIO_ES;
#ifdef MODULE_NAME_IS_tremor
p_dec->fmt_out.i_codec = VLC_CODEC_S32N;
#else
......
......@@ -323,7 +323,6 @@ static int OpenDecoder(vlc_object_t *p_this)
dec->pf_decode = Decode;
dec->fmt_out.i_cat = VIDEO_ES;
dec->fmt_out.video.i_width = dec->fmt_in.video.i_width;
dec->fmt_out.video.i_height = dec->fmt_in.video.i_height;
......
......@@ -139,7 +139,6 @@ static int OpenDecoder( vlc_object_t *p_this )
date_Init( &p_sys->end_date, p_dec->fmt_in.audio.i_rate, 1 );
/* Set output properties */
p_dec->fmt_out.i_cat = AUDIO_ES;
p_dec->fmt_out.i_codec = VLC_CODEC_S32N;
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;
......
......@@ -52,7 +52,6 @@ static int Open(vlc_object_t *obj)
dec->pf_decode = Decode;
es_format_Copy(&dec->fmt_out, &dec->fmt_in);
dec->fmt_out.i_codec = VLC_CODEC_RGB32;
dec->fmt_out.i_cat = VIDEO_ES;
return VLC_SUCCESS;
}
......
......@@ -232,7 +232,6 @@ static int OpenDecoder(decoder_t *dec)
dec->fmt_out.video.i_chroma = VLC_CODEC_I420;
}
dec->fmt_out.i_cat = VIDEO_ES;
dec->pf_decode = decode;
dec->pf_flush = flush_decoder;
......
......@@ -334,7 +334,6 @@ static int Open( vlc_object_t *p_this )
block_BytestreamInit( &p_sys->bytestream );
/* Set output properties (Passthrough ONLY) */
p_dec->fmt_out.i_cat = AUDIO_ES;
p_dec->fmt_out.i_codec = p_dec->fmt_in.i_codec;
p_dec->fmt_out.audio = p_dec->fmt_in.audio;
......
......@@ -360,7 +360,6 @@ static int Open( vlc_object_t *p_this )
block_BytestreamInit( &p_sys->bytestream );
/* Set output properties (passthrough only) */
p_dec->fmt_out.i_cat = AUDIO_ES;
p_dec->fmt_out.i_codec = p_dec->fmt_in.i_codec;
p_dec->fmt_out.audio = p_dec->fmt_in.audio;
......
......@@ -808,7 +808,6 @@ static int Open(vlc_object_t *p_this)
/* */
es_format_Copy(&p_dec->fmt_out, &p_dec->fmt_in);
p_dec->fmt_out.i_cat = AUDIO_ES;
p_dec->fmt_out.i_codec = VLC_CODEC_FLAC;
p_dec->fmt_out.b_packetized = true;
......
......@@ -488,7 +488,6 @@ static int Open( vlc_object_t *p_this )
p_sys->b_discontinuity = false;
/* Set output properties (Passthrough only) */
p_dec->fmt_out.i_cat = AUDIO_ES;
p_dec->fmt_out.i_codec = p_dec->fmt_in.i_codec;
p_dec->fmt_out.audio.i_rate = 0;
......
......@@ -220,7 +220,6 @@ static int OpenPacketizer(vlc_object_t *p_this)
p_sys->i_warnings = 0;
/* Set output properties */
p_dec->fmt_out.i_cat = AUDIO_ES;
p_dec->fmt_out.i_codec = VLC_CODEC_MP4A;
msg_Dbg(p_dec, "running MPEG4 audio packetizer");
......
......@@ -635,7 +635,6 @@ static int Open( vlc_object_t *p_this )
p_sys->i_bit_rate = 0;
/* Set output properties */
p_dec->fmt_out.i_cat = AUDIO_ES;
p_dec->fmt_out.i_codec = VLC_CODEC_MPGA;
p_dec->fmt_out.audio.i_rate = 0; /* So end_date gets initialized */
......
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