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

decoder: use "video decoder" capability for video decoders

parent 89504cd7
......@@ -48,7 +48,7 @@ static void CloseDecoder(vlc_object_t *);
vlc_module_begin ()
set_shortname("aom")
set_description(N_("AOM video decoder"))
set_capability("decoder", 100)
set_capability("video decoder", 100)
set_callbacks(OpenDecoder, CloseDecoder)
set_category(CAT_INPUT)
set_subcategory(SUBCAT_INPUT_VCODEC)
......
......@@ -78,7 +78,7 @@ vlc_module_begin ()
set_section( N_("Decoding") , NULL )
add_shortcut("ffmpeg")
set_capability("decoder", 70)
set_capability("video decoder", 70)
set_callbacks(InitVideoDec, EndVideoDec)
add_submodule()
......
......@@ -437,9 +437,6 @@ static int OpenVideoCodec( decoder_t *p_dec )
int InitVideoDec( vlc_object_t *obj )
{
decoder_t *p_dec = (decoder_t *)obj;
if( p_dec->fmt_in.i_cat != VIDEO_ES )
return VLC_EGENERIC;
const AVCodec *p_codec;
AVCodecContext *p_context = ffmpeg_AllocContext( p_dec, &p_codec );
if( p_context == NULL )
......
......@@ -47,7 +47,7 @@ vlc_module_begin()
set_subcategory( SUBCAT_INPUT_VCODEC )
/* decoder main module */
set_description( N_("BPG image decoder") )
set_capability( "decoder", 60 )
set_capability( "video decoder", 60 )
set_callbacks( OpenDecoder, CloseDecoder )
add_shortcut( "bpg" )
vlc_module_end()
......
......@@ -86,7 +86,7 @@ vlc_module_begin ()
set_category( CAT_INPUT )
set_subcategory( SUBCAT_INPUT_VCODEC )
set_description( N_("CDG video decoder") )
set_capability( "decoder", 1000 )
set_capability( "video decoder", 1000 )
set_callbacks( Open, Close )
add_shortcut( "cdg" )
vlc_module_end ()
......
......@@ -88,7 +88,7 @@ vlc_module_begin ()
set_category( CAT_INPUT )
set_subcategory( SUBCAT_INPUT_VCODEC )
set_description( N_("Crystal HD hardware video decoder") )
set_capability( "decoder", 0 )
set_capability( "video decoder", 0 )
set_callbacks( OpenDecoder, CloseDecoder )
add_shortcut( "crystalhd" )
vlc_module_end ()
......
......@@ -118,7 +118,7 @@ vlc_module_begin ()
set_subcategory( SUBCAT_INPUT_VCODEC )
set_shortname( "Daala" )
set_description( N_("Daala video decoder") )
set_capability( "decoder", 100 )
set_capability( "video decoder", 100 )
set_callbacks( OpenDecoder, CloseDecoder )
add_shortcut( "daala" )
add_submodule ()
......
......@@ -53,6 +53,10 @@ vlc_module_begin ()
add_shortcut( "dummy" )
add_submodule()
add_shortcut( "dummy" )
set_capability( "video decoder", 0 )
set_callbacks( OpenDecoder, CloseDecoder )
add_submodule()
add_shortcut( "dummy" )
set_capability( "audio decoder", 0 )
set_callbacks( OpenDecoder, CloseDecoder )
......@@ -64,6 +68,10 @@ vlc_module_begin ()
add_shortcut( "dump" )
add_submodule()
add_shortcut( "dump")
set_capability( "video decoder", 0 )
set_callbacks( OpenDecoderDump, CloseDecoder )
add_submodule()
add_shortcut( "dump")
set_capability( "audio decoder", 0 )
set_callbacks( OpenDecoderDump, CloseDecoder )
vlc_module_end ()
......
......@@ -90,7 +90,7 @@ static void CopyPicture( picture_t *, uint8_t * );
vlc_module_begin ()
set_description( N_("DirectMedia Object decoder") )
add_shortcut( "dmo" )
set_capability( "decoder", 1 )
set_capability( "video decoder", 1 )
set_callbacks( DecoderOpen, DecoderClose )
set_category( CAT_INPUT )
set_subcategory( SUBCAT_INPUT_VCODEC )
......
......@@ -92,7 +92,7 @@ vlc_module_begin( )
/* decoder main module */
set_description( N_( "GStreamer Based Decoder" ) )
set_help( MODULE_DESCRIPTION )
set_capability( "decoder", 50 )
set_capability( "video decoder", 50 )
set_section( N_( "Decoding" ) , NULL )
set_callbacks( OpenDecoder, CloseDecoder )
add_bool( "use-decodebin", true, USEDECODEBIN_TEXT,
......
......@@ -109,7 +109,7 @@ vlc_module_begin()
set_subcategory(SUBCAT_INPUT_VCODEC)
/* decoder main module */
set_description(N_("JPEG image decoder"))
set_capability("decoder", 1000)
set_capability("video decoder", 1000)
set_callbacks(OpenDecoder, CloseDecoder)
add_shortcut("jpeg")
......
......@@ -135,7 +135,7 @@ static int DpbDisplayPicture( decoder_t *, picture_t * );
*****************************************************************************/
vlc_module_begin ()
set_description( N_("MPEG I/II video decoder (using libmpeg2)") )
set_capability( "decoder", 50 )
set_capability( "video decoder", 50 )
set_category( CAT_INPUT )
set_subcategory( SUBCAT_INPUT_VCODEC )
set_callbacks( OpenDecoder, CloseDecoder )
......
......@@ -61,7 +61,7 @@ static void Close(vlc_object_t *);
vlc_module_begin()
set_description(N_("Media Foundation Transform decoder"))
add_shortcut("mft")
set_capability("decoder", 1)
set_capability("video decoder", 1)
set_callbacks(Open, Close)
set_category(CAT_INPUT)
set_subcategory(SUBCAT_INPUT_VCODEC)
......@@ -1117,9 +1117,6 @@ static int Open(vlc_object_t *p_this)
decoder_t *p_dec = (decoder_t *)p_this;
decoder_sys_t *p_sys;
if (p_dec->fmt_in.i_cat != VIDEO_ES && p_dec->fmt_in.i_cat != AUDIO_ES)
return VLC_EGENERIC;
p_sys = p_dec->p_sys = calloc(1, sizeof(*p_sys));
if (!p_sys)
return VLC_ENOMEM;
......
......@@ -84,7 +84,7 @@ vlc_module_begin ()
set_subcategory(SUBCAT_INPUT_VCODEC)
set_shortname("OggSpots")
set_description(N_("OggSpots video decoder"))
set_capability("decoder", 10)
set_capability("video decoder", 10)
set_callbacks(OpenDecoder, CloseDecoder)
add_shortcut("oggspots")
......
......@@ -180,7 +180,7 @@ vlc_module_begin ()
set_category(CAT_INPUT)
set_subcategory(SUBCAT_INPUT_VCODEC)
set_section(N_("Decoding"), NULL)
set_capability("decoder", 0) /* Only enabled via commandline arguments */
set_capability("video decoder", 0) /* Only enabled via commandline arguments */
add_bool(CFG_PREFIX "dr", true,
DIRECTRENDERING_TEXT, DIRECTRENDERING_LONGTEXT, true)
add_bool(CFG_PREFIX "audio", false,
......@@ -195,7 +195,7 @@ vlc_module_begin ()
add_shortcut("mediacodec_ndk")
add_submodule ()
set_description("Video decoder using Android MediaCodec via JNI")
set_capability("decoder", 0)
set_capability("video decoder", 0)
set_callbacks(OpenDecoderJni, CloseDecoder)
add_shortcut("mediacodec_jni")
add_submodule ()
......
......@@ -150,11 +150,11 @@ vlc_module_begin ()
/* For IOMX, don't enable it automatically via priorities,
* enable it only via the --codec iomx command line parameter when
* wanted. */
set_capability( "decoder", 0 )
set_capability( "video decoder", 0 )
add_bool(CFG_PREFIX "dr", true,
DIRECTRENDERING_TEXT, DIRECTRENDERING_LONGTEXT, true)
#else
set_capability( "decoder", 80 )
set_capability( "video decoder", 80 )
#endif
set_callbacks( OpenDecoder, CloseGeneric )
#ifndef __ANDROID__
......
......@@ -89,7 +89,7 @@ vlc_module_begin ()
set_category( CAT_INPUT )
set_subcategory( SUBCAT_INPUT_VCODEC )
set_description( N_("PNG video decoder") )
set_capability( "decoder", 1000 )
set_capability( "video decoder", 1000 )
set_callbacks( OpenDecoder, CloseDecoder )
add_shortcut( "png" )
......
......@@ -62,7 +62,7 @@ static void CloseCommon ( vlc_object_t * );
*****************************************************************************/
vlc_module_begin ()
set_description( N_("Pseudo raw video decoder") )
set_capability( "decoder", 50 )
set_capability( "video decoder", 50 )
set_category( CAT_INPUT )
set_subcategory( SUBCAT_INPUT_VCODEC )
set_callbacks( OpenDecoder, CloseCommon )
......
......@@ -361,7 +361,7 @@ vlc_module_begin ()
set_subcategory( SUBCAT_INPUT_VCODEC )
set_shortname( "Schroedinger" )
set_description( N_("Dirac video decoder using libschroedinger") )
set_capability( "decoder", 200 )
set_capability( "video decoder", 200 )
set_callbacks( OpenDecoder, CloseDecoder )
add_shortcut( "schroedinger" )
......
......@@ -59,7 +59,7 @@ vlc_module_begin ()
set_subcategory( SUBCAT_INPUT_VCODEC )
set_shortname( N_("SDL Image decoder"))
set_description( N_("SDL_image video decoder") )
set_capability( "decoder", 60 )
set_capability( "video decoder", 60 )
set_callbacks( OpenDecoder, CloseDecoder )
add_shortcut( "sdl_image" )
vlc_module_end ()
......
......@@ -61,7 +61,7 @@ vlc_module_begin ()
set_category( CAT_INPUT )
set_subcategory( SUBCAT_INPUT_VCODEC )
set_description( N_("SVG video decoder") )
set_capability( "decoder", 100 )
set_capability( "video decoder", 100 )
set_callbacks( OpenDecoder, CloseDecoder )
add_shortcut( "svg" )
......
......@@ -114,7 +114,7 @@ vlc_module_begin ()
set_subcategory( SUBCAT_INPUT_VCODEC )
set_shortname( "Theora" )
set_description( N_("Theora video decoder") )
set_capability( "decoder", 100 )
set_capability( "video decoder", 100 )
set_callbacks( OpenDecoder, CloseDecoder )
add_shortcut( "theora" )
# define DEC_CFG_PREFIX "theora-"
......
......@@ -76,7 +76,7 @@ vlc_module_begin()
set_category(CAT_INPUT)
set_subcategory(SUBCAT_INPUT_VCODEC)
set_description(N_("VideoToolbox video decoder"))
set_capability("decoder",800)
set_capability("video decoder",800)
set_callbacks(OpenDecoder, CloseDecoder)
add_bool("videotoolbox-temporal-deinterlacing", true, VT_TEMPO_DEINTERLACE, VT_TEMPO_DEINTERLACE_LONG, false)
......@@ -830,9 +830,6 @@ static int OpenDecoder(vlc_object_t *p_this)
}
#endif
if (p_dec->fmt_in.i_cat != VIDEO_ES)
return VLC_EGENERIC;
/* Fail if this module already failed to decode this ES */
if (var_Type(p_dec, "videotoolbox-failed") != 0)
return VLC_EGENERIC;
......
......@@ -64,7 +64,7 @@ static block_t *Encode(encoder_t *p_enc, picture_t *p_pict);
vlc_module_begin ()
set_shortname("vpx")
set_description(N_("WebM video decoder"))
set_capability("decoder", 100)
set_capability("video decoder", 100)
set_callbacks(OpenDecoder, CloseDecoder)
set_category(CAT_INPUT)
set_subcategory(SUBCAT_INPUT_VCODEC)
......
......@@ -34,7 +34,7 @@ static int Open(vlc_object_t *);
vlc_module_begin()
set_description(N_("XWD image decoder"))
set_capability("decoder", 50)
set_capability("video decoder", 50)
set_category(CAT_INPUT)
set_subcategory(SUBCAT_INPUT_VCODEC)
set_callbacks(Open, NULL)
......
......@@ -57,7 +57,7 @@ static void CloseDecoder(decoder_t *dec);
vlc_module_begin()
set_shortname(N_("MMAL decoder"))
set_description(N_("MMAL-based decoder plugin for Raspberry Pi"))
set_capability("decoder", 90)
set_capability("video decoder", 90)
add_shortcut("mmal_decoder")
add_bool(MMAL_OPAQUE_NAME, true, MMAL_OPAQUE_TEXT, MMAL_OPAQUE_LONGTEXT, false)
set_callbacks(OpenDecoder, CloseDecoder)
......@@ -105,9 +105,6 @@ static int OpenDecoder(decoder_t *dec)
MMAL_PARAMETER_UINT32_T extra_buffers;
MMAL_STATUS_T status;
if (dec->fmt_in.i_cat != VIDEO_ES)
return VLC_EGENERIC;
if (dec->fmt_in.i_codec != VLC_CODEC_MPGV &&
dec->fmt_in.i_codec != VLC_CODEC_H264)
return VLC_EGENERIC;
......
......@@ -220,7 +220,7 @@ vlc_module_begin ()
#endif
set_section( N_( "Stats decoder" ), NULL )
set_description( N_("Stats decoder function") )
set_capability( "decoder", 0 )
set_capability( "video decoder", 0 )
add_shortcut( "stats" )
set_callbacks( OpenDecoder, NULL )
add_submodule()
......@@ -229,6 +229,12 @@ vlc_module_begin ()
set_capability( "audio 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( "decoder", 0 )
add_shortcut( "stats" )
set_callbacks( OpenDecoder, NULL )
add_submodule ()
set_section( N_( "Stats demux" ), NULL )
set_description( N_("Stats demux function") )
......
......@@ -307,19 +307,11 @@ static sout_stream_id_sys_t * Add( sout_stream_t *p_stream, const es_format_t *p
//p_sys->p_decoder->p_cfg = p_sys->p_video_cfg;
p_sys->p_decoder->p_module =
module_need( p_sys->p_decoder, "decoder", "$codec", false );
module_need( p_sys->p_decoder, "video decoder", "$codec", false );
if( !p_sys->p_decoder->p_module || p_sys->p_decoder->fmt_out.i_cat != VIDEO_ES )
if( !p_sys->p_decoder->p_module )
{
if( p_sys->p_decoder->fmt_out.i_cat != VIDEO_ES )
{
msg_Err( p_stream, "instanciated a non video decoder" );
module_unneed( p_sys->p_decoder, p_sys->p_decoder->p_module );
}
else
{
msg_Err( p_stream, "cannot find decoder" );
}
msg_Err( p_stream, "cannot find decoder" );
free( p_sys->p_decoder->p_owner );
vlc_object_release( p_sys->p_decoder );
return NULL;
......
......@@ -196,7 +196,7 @@ int transcode_video_new( sout_stream_t *p_stream, sout_stream_id_sys_t *id )
id->p_decoder->p_owner->id = id;
id->p_decoder->p_module =
module_need( id->p_decoder, "decoder", "$codec", false );
module_need( id->p_decoder, "video decoder", "$codec", false );
if( !id->p_decoder->p_module )
{
......
......@@ -172,7 +172,7 @@ static int LoadDecoder( decoder_t *p_dec, bool b_packetizer,
if( !b_packetizer )
{
const char caps[ES_CATEGORY_COUNT][16] = {
[VIDEO_ES] = "decoder",
[VIDEO_ES] = "video decoder",
[AUDIO_ES] = "audio decoder",
[SPU_ES] = "decoder",
};
......
......@@ -655,7 +655,7 @@ static decoder_t *CreateDecoder( vlc_object_t *p_this, video_format_t *fmt )
p_dec->pf_vout_buffer_new = video_new_buffer;
/* Find a suitable decoder module */
p_dec->p_module = module_need( p_dec, "decoder", "$codec", false );
p_dec->p_module = module_need( p_dec, "video decoder", "$codec", false );
if( !p_dec->p_module )
{
msg_Err( p_dec, "no suitable decoder module for fourcc `%4.4s'. "
......
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