Commit 89504cd7 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

decoder: use "audio decoder" capability for audio decoders

This avoids probing video or SPU decoders for audio format and vice-
versa.
parent 5f9515b6
......@@ -81,7 +81,7 @@ vlc_module_begin ()
set_category( CAT_INPUT )
set_subcategory( SUBCAT_INPUT_ACODEC )
add_bool( "a52-dynrng", true, DYNRNG_TEXT, DYNRNG_LONGTEXT, false )
set_capability( "decoder", 60 )
set_capability( "audio decoder", 60 )
set_callbacks( Open, Close )
vlc_module_end ()
......
......@@ -46,7 +46,7 @@ static void Flush( decoder_t * );
vlc_module_begin ()
set_description( N_("ADPCM audio decoder") )
set_capability( "decoder", 50 )
set_capability( "audio decoder", 50 )
set_category( CAT_INPUT )
set_subcategory( SUBCAT_INPUT_ACODEC )
set_callbacks( OpenDecoder, CloseDecoder )
......
......@@ -45,7 +45,7 @@ vlc_module_begin ()
set_category( CAT_INPUT )
set_subcategory( SUBCAT_INPUT_ACODEC )
set_description( N_("AES3/SMPTE 302M audio decoder") )
set_capability( "decoder", 100 )
set_capability( "audio decoder", 100 )
set_callbacks( OpenDecoder, Close )
add_submodule ()
......
......@@ -49,7 +49,7 @@ static int EncoderOpen ( vlc_object_t * );
vlc_module_begin ()
/* audio decoder module */
set_description( N_("Raw/Log Audio decoder") )
set_capability( "decoder", 100 )
set_capability( "audio decoder", 100 )
set_category( CAT_INPUT )
set_subcategory( SUBCAT_INPUT_ACODEC )
set_callbacks( DecoderOpen, DecoderClose )
......
......@@ -214,9 +214,6 @@ void EndAudioDec( vlc_object_t *obj )
int InitAudioDec( vlc_object_t *obj )
{
decoder_t *p_dec = (decoder_t *)obj;
if( p_dec->fmt_in.i_cat != AUDIO_ES )
return VLC_EGENERIC;
const AVCodec *codec;
AVCodecContext *avctx = ffmpeg_AllocContext( p_dec, &codec );
if( avctx == NULL )
......
......@@ -83,7 +83,7 @@ vlc_module_begin ()
add_submodule()
add_shortcut("ffmpeg")
set_capability("decoder", 70)
set_capability("audio decoder", 70)
set_callbacks(InitAudioDec, EndAudioDec)
add_submodule()
......
......@@ -72,7 +72,7 @@ vlc_module_begin ()
set_shortname( "DCA" )
set_description( N_("DTS Coherent Acoustics audio decoder") )
add_bool( "dts-dynrng", true, DYNRNG_TEXT, DYNRNG_LONGTEXT, false )
set_capability( "decoder", 60 )
set_capability( "audio decoder", 60 )
set_callbacks( Open, Close )
vlc_module_end ()
......
......@@ -51,6 +51,10 @@ vlc_module_begin ()
set_subcategory( SUBCAT_INPUT_SCODEC )
add_bool( "dummy-save-es", false, SAVE_TEXT, SAVE_LONGTEXT, true )
add_shortcut( "dummy" )
add_submodule()
add_shortcut( "dummy" )
set_capability( "audio decoder", 0 )
set_callbacks( OpenDecoder, CloseDecoder )
add_submodule ()
set_section( N_( "Dump decoder" ), NULL )
......@@ -58,6 +62,10 @@ vlc_module_begin ()
set_capability( "decoder", -1 )
set_callbacks( OpenDecoderDump, CloseDecoder )
add_shortcut( "dump" )
add_submodule()
add_shortcut( "dump")
set_capability( "audio decoder", 0 )
set_callbacks( OpenDecoderDump, CloseDecoder )
vlc_module_end ()
......
......@@ -95,6 +95,11 @@ vlc_module_begin ()
set_category( CAT_INPUT )
set_subcategory( SUBCAT_INPUT_VCODEC )
add_submodule()
add_shortcut("dmo")
set_capability( "audio decoder", 1 )
set_callbacks(DecoderOpen, DecoderClose)
# define ENC_CFG_PREFIX "sout-dmo-"
add_submodule ()
set_description( N_("DirectMedia Object encoder") )
......
......@@ -52,7 +52,7 @@ static void Close( vlc_object_t * );
vlc_module_begin ()
set_description( N_("AAC audio decoder (using libfaad2)") )
set_capability( "decoder", 100 )
set_capability( "audio decoder", 100 )
set_category( CAT_INPUT )
set_subcategory( SUBCAT_INPUT_ACODEC )
set_callbacks( Open, Close )
......
......@@ -162,7 +162,7 @@ vlc_module_begin ()
add_shortcut( "flac" )
set_description( N_("Flac audio decoder") )
set_capability( "decoder", 100 )
set_capability( "audio decoder", 100 )
set_callbacks( OpenDecoder, CloseDecoder )
#ifdef ENABLE_SOUT
......
......@@ -68,7 +68,7 @@ static void Close (vlc_object_t *);
vlc_module_begin ()
set_description (N_("FluidSynth MIDI synthesizer"))
set_capability ("decoder", 100)
set_capability ("audio decoder", 100)
set_shortname (N_("FluidSynth"))
set_category (CAT_INPUT)
set_subcategory (SUBCAT_INPUT_ACODEC)
......
......@@ -44,7 +44,7 @@ static block_t *EncoderEncode( encoder_t *, block_t * );
vlc_module_begin ()
set_description( N_("G.711 decoder") )
set_capability( "decoder", 100 )
set_capability( "audio decoder", 100 )
set_category( CAT_INPUT )
set_subcategory( SUBCAT_INPUT_ACODEC )
set_callbacks( DecoderOpen, DecoderClose )
......
......@@ -58,7 +58,7 @@ vlc_module_begin ()
set_category( CAT_INPUT )
set_subcategory( SUBCAT_INPUT_ACODEC )
set_description( N_("Linear PCM audio decoder") )
set_capability( "decoder", 100 )
set_capability( "audio decoder", 100 )
set_callbacks( OpenDecoder, CloseCommon )
add_submodule ()
......
......@@ -76,7 +76,7 @@ vlc_module_begin ()
set_category( CAT_INPUT )
set_subcategory( SUBCAT_INPUT_ACODEC )
set_description( N_("MPEG audio layer I/II/III decoder") )
set_capability( "decoder", 99 )
set_capability( "audio decoder", 99 )
set_callbacks( Open, Close )
vlc_module_end ()
......
......@@ -65,6 +65,11 @@ vlc_module_begin()
set_callbacks(Open, Close)
set_category(CAT_INPUT)
set_subcategory(SUBCAT_INPUT_VCODEC)
add_submodule()
add_shortcut("mft")
set_capability("audio decoder", 1)
set_callbacks(Open, Close)
vlc_module_end()
typedef struct
......
......@@ -65,7 +65,7 @@ vlc_module_begin ()
set_category( CAT_INPUT )
set_subcategory( SUBCAT_INPUT_ACODEC )
set_description( N_("MPEG audio decoder using mpg123") )
set_capability( "decoder", 100 )
set_capability( "audio decoder", 100 )
set_shortname( "mpg123" )
set_callbacks( OpenDecoder, CloseDecoder )
vlc_module_end ()
......
......@@ -189,11 +189,19 @@ vlc_module_begin ()
MEDIACODEC_TUNNELEDPLAYBACK_TEXT, NULL, true)
set_callbacks(OpenDecoderNdk, CloseDecoder)
add_shortcut("mediacodec_ndk")
add_submodule ()
set_capability("audio decoder", 0)
set_callbacks(OpenDecoderNdk, CloseDecoder)
add_shortcut("mediacodec_ndk")
add_submodule ()
set_description("Video decoder using Android MediaCodec via JNI")
set_capability("decoder", 0)
set_callbacks(OpenDecoderJni, CloseDecoder)
add_shortcut("mediacodec_jni")
add_submodule ()
set_capability("audio decoder", 0)
set_callbacks(OpenDecoderJni, CloseDecoder)
add_shortcut("mediacodec_jni")
vlc_module_end ()
static void CSDFree(decoder_t *p_dec)
......
......@@ -157,6 +157,15 @@ vlc_module_begin ()
set_capability( "decoder", 80 )
#endif
set_callbacks( OpenDecoder, CloseGeneric )
#ifndef __ANDROID__
add_submodule()
# if defined(USE_IOMX)
set_capability("audio decoder", 0)
# else
set_capability("audio decoder", 80)
# endif
set_callbacks(OpenDecoder, CloseGeneric)
#endif
add_submodule ()
set_section( N_("Encoding") , NULL )
......@@ -1008,11 +1017,6 @@ static int OpenDecoder( vlc_object_t *p_this )
decoder_t *p_dec = (decoder_t*)p_this;
int status;
#ifdef __ANDROID__
if( p_dec->fmt_in.i_cat == AUDIO_ES )
return VLC_EGENERIC;
#endif
if( 0 || !GetOmxRole(p_dec->fmt_in.i_codec, p_dec->fmt_in.i_cat, false) )
return VLC_EGENERIC;
......
......@@ -60,7 +60,7 @@ vlc_module_begin ()
set_subcategory( SUBCAT_INPUT_ACODEC )
set_description( N_("Opus audio decoder") )
set_capability( "decoder", 100 )
set_capability( "audio decoder", 100 )
set_shortname( N_("Opus") )
set_callbacks( OpenDecoder, CloseDecoder )
......
......@@ -34,7 +34,7 @@ vlc_module_begin()
set_category(CAT_INPUT)
set_subcategory(SUBCAT_INPUT_ACODEC)
set_description(N_("S/PDIF pass-through decoder"))
set_capability("decoder", 120)
set_capability("audio decoder", 120)
set_callbacks(OpenDecoder, NULL)
vlc_module_end()
......
......@@ -96,7 +96,7 @@ vlc_module_begin ()
set_subcategory( SUBCAT_INPUT_ACODEC )
set_description( N_("Speex audio decoder") )
set_capability( "decoder", 100 )
set_capability( "audio decoder", 100 )
set_shortname( N_("Speex") )
set_callbacks( OpenDecoder, CloseDecoder )
......
......@@ -39,7 +39,7 @@ static void Close(vlc_object_t *);
vlc_module_begin()
set_description(N_("Ulead DV audio decoder"))
set_capability("decoder", 50)
set_capability("audio decoder", 50)
set_category(CAT_INPUT)
set_subcategory(SUBCAT_INPUT_ACODEC)
set_callbacks(Open, Close)
......
......@@ -188,9 +188,9 @@ vlc_module_begin ()
set_shortname( "Vorbis" )
set_description( N_("Vorbis audio decoder") )
#ifdef MODULE_NAME_IS_tremor
set_capability( "decoder", 90 )
set_capability( "audio decoder", 90 )
#else
set_capability( "decoder", 100 )
set_capability( "audio decoder", 100 )
#endif
set_category( CAT_INPUT )
set_subcategory( SUBCAT_INPUT_ACODEC )
......
......@@ -81,7 +81,7 @@ vlc_module_begin();
set_category( CAT_INPUT );
set_subcategory( SUBCAT_INPUT_ACODEC );
set_description( _("WMA v1/v2 fixed point audio decoder") );
set_capability( "decoder", 80 );
set_capability( "audio decoder", 80 );
add_shortcut( "wmafixed" )
set_callbacks( OpenDecoder, CloseDecoder );
vlc_module_end();
......
......@@ -223,6 +223,12 @@ vlc_module_begin ()
set_capability( "decoder", 0 )
add_shortcut( "stats" )
set_callbacks( OpenDecoder, NULL )
add_submodule()
set_section( N_( "Stats decoder" ), NULL )
set_description( N_("Stats decoder function") )
set_capability( "audio decoder", 0 )
add_shortcut( "stats" )
set_callbacks( OpenDecoder, NULL )
add_submodule ()
set_section( N_( "Stats demux" ), NULL )
set_description( N_("Stats demux function") )
......
......@@ -175,7 +175,7 @@ int transcode_audio_new( sout_stream_t *p_stream,
id->p_decoder->pf_aout_format_update = audio_update_format;
/* id->p_decoder->p_cfg = p_sys->p_audio_cfg; */
id->p_decoder->p_module =
module_need( id->p_decoder, "decoder", "$codec", false );
module_need( id->p_decoder, "audio decoder", "$codec", false );
if( !id->p_decoder->p_module )
{
msg_Err( p_stream, "cannot find audio decoder" );
......
......@@ -173,7 +173,7 @@ static int LoadDecoder( decoder_t *p_dec, bool b_packetizer,
{
const char caps[ES_CATEGORY_COUNT][16] = {
[VIDEO_ES] = "decoder",
[AUDIO_ES] = "decoder",
[AUDIO_ES] = "audio decoder",
[SPU_ES] = "decoder",
};
p_dec->p_module = module_need( p_dec, caps[p_dec->fmt_in.i_cat],
......
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