[vlc-commits] core: remove the avcodec-hw variable
Steve Lhomme
git at videolan.org
Mon Oct 28 09:42:00 CET 2019
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Jul 22 13:58:20 2019 +0200| [8115ad9d34442656b1895f2f4749f43ae2580bd1] | committer: Steve Lhomme
core: remove the avcodec-hw variable
Now the modules only load if they are given a compatible decoder device.
This decoder device is loaded with the --dec-dev option.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8115ad9d34442656b1895f2f4749f43ae2580bd1
---
lib/media_player.c | 11 ++++-------
modules/codec/avcodec/avcodec.c | 2 +-
modules/codec/avcodec/avcodec.h | 3 ---
modules/codec/avcodec/va.c | 4 +---
4 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/lib/media_player.c b/lib/media_player.c
index 70b470b3b0..965cab2100 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -604,7 +604,6 @@ libvlc_media_player_new( libvlc_instance_t *instance )
var_Create( mp, "vout-cb-select-plane", VLC_VAR_ADDRESS );
var_Create (mp, "dec-dev", VLC_VAR_STRING);
- var_Create (mp, "avcodec-hw", VLC_VAR_STRING);
var_Create (mp, "drawable-xid", VLC_VAR_INTEGER);
#if defined (_WIN32) || defined (__OS2__)
var_Create (mp, "drawable-hwnd", VLC_VAR_INTEGER);
@@ -1008,7 +1007,7 @@ void libvlc_video_set_callbacks( libvlc_media_player_t *mp,
var_SetAddress( mp, "vmem-unlock", unlock_cb );
var_SetAddress( mp, "vmem-display", display_cb );
var_SetAddress( mp, "vmem-data", opaque );
- var_SetString( mp, "avcodec-hw", "none" );
+ var_SetString( mp, "dec-dev", "none" );
var_SetString( mp, "vout", "vmem" );
var_SetString( mp, "window", "dummy" );
}
@@ -1087,13 +1086,11 @@ bool libvlc_video_direct3d_set_callbacks(libvlc_media_player_t *mp,
if ( engine == libvlc_video_direct3d_engine_d3d11 )
{
var_SetString ( mp, "vout", "direct3d11" );
- var_SetString ( mp, "avcodec-hw", "d3d11va");
var_SetString ( mp, "dec-dev", "d3d11-device" );
}
else if ( engine == libvlc_video_direct3d_engine_d3d9 )
{
var_SetString ( mp, "vout", "direct3d9" );
- var_SetString ( mp, "avcodec-hw", "dxva2");
var_SetString ( mp, "dec-dev", "d3d9-device" );
}
else
@@ -1118,7 +1115,7 @@ void libvlc_media_player_set_nsobject( libvlc_media_player_t *p_mi,
{
assert (p_mi != NULL);
#ifdef __APPLE__
- var_SetString (p_mi, "avcodec-hw", "");
+ var_SetString (p_mi, "dec-dev", "");
var_SetString (p_mi, "vout", "");
var_SetString (p_mi, "window", "");
var_SetAddress (p_mi, "drawable-nsobject", drawable);
@@ -1153,7 +1150,7 @@ void libvlc_media_player_set_xwindow( libvlc_media_player_t *p_mi,
{
assert (p_mi != NULL);
- var_SetString (p_mi, "avcodec-hw", "");
+ var_SetString (p_mi, "dec-dev", "");
var_SetString (p_mi, "vout", "");
var_SetString (p_mi, "window", drawable ? "embed-xid,any" : "");
var_SetInteger (p_mi, "drawable-xid", drawable);
@@ -1175,7 +1172,7 @@ void libvlc_media_player_set_hwnd( libvlc_media_player_t *p_mi,
{
assert (p_mi != NULL);
#if defined (_WIN32) || defined (__OS2__)
- var_SetString (p_mi, "avcodec-hw", "");
+ var_SetString (p_mi, "dec-dev", "");
var_SetString (p_mi, "vout", "");
var_SetString (p_mi, "window",
(drawable != NULL) ? "embed-hwnd,any" : "");
diff --git a/modules/codec/avcodec/avcodec.c b/modules/codec/avcodec/avcodec.c
index ab76fd8e5e..ad2201cb1f 100644
--- a/modules/codec/avcodec/avcodec.c
+++ b/modules/codec/avcodec/avcodec.c
@@ -131,7 +131,7 @@ vlc_module_begin ()
add_obsolete_string( "ffmpeg-codec" ) /* removed since 2.1.0 */
add_string( "avcodec-codec", NULL, CODEC_TEXT, CODEC_LONGTEXT, true )
add_obsolete_bool( "ffmpeg-hw" ) /* removed since 2.1.0 */
- add_module("avcodec-hw", "hw decoder", "any", HW_TEXT, HW_LONGTEXT)
+ add_obsolete_string( "avcodec-hw" ) /* removed since 4.0.0 */
#if defined(FF_THREAD_FRAME)
add_obsolete_integer( "ffmpeg-threads" ) /* removed since 2.1.0 */
add_integer( "avcodec-threads", 0, THREADS_TEXT, THREADS_LONGTEXT, true );
diff --git a/modules/codec/avcodec/avcodec.h b/modules/codec/avcodec/avcodec.h
index 5e526a3b1c..1df39c613a 100644
--- a/modules/codec/avcodec/avcodec.h
+++ b/modules/codec/avcodec/avcodec.h
@@ -109,9 +109,6 @@ int ffmpeg_OpenCodec( decoder_t *p_dec, AVCodecContext *, const AVCodec * );
"usually has a detrimental effect on quality. However it provides a big " \
"speedup for high definition streams." )
-#define HW_TEXT N_("Hardware decoding")
-#define HW_LONGTEXT N_("This allows hardware decoding when available.")
-
#define THREADS_TEXT N_( "Threads" )
#define THREADS_LONGTEXT N_( "Number of threads used for decoding, 0 meaning auto" )
diff --git a/modules/codec/avcodec/va.c b/modules/codec/avcodec/va.c
index 634f0f0e28..23db69b605 100644
--- a/modules/codec/avcodec/va.c
+++ b/modules/codec/avcodec/va.c
@@ -119,16 +119,14 @@ vlc_va_t *vlc_va_New(vlc_object_t *obj,
if (unlikely(va == NULL))
return NULL;
- char *modlist = var_InheritString(obj, "avcodec-hw");
- if (vlc_module_load(va, "hw decoder", modlist, true,
+ if (vlc_module_load(va, "hw decoder", NULL, true,
vlc_va_Start, va, avctx, src_desc, pix_fmt, fmt, device, vtcx_out) == NULL)
{
vlc_object_delete(va);
va = NULL;
}
- free(modlist);
return va;
}
More information about the vlc-commits
mailing list