[vlc-commits] videotoolbox: add an option to enable hwdec
Thomas Guillem
git at videolan.org
Mon Apr 23 17:31:27 CEST 2018
vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Apr 20 16:28:14 2018 +0200| [28af3c70540e77af52cb788a7322050c1650d367] | committer: Thomas Guillem
videotoolbox: add an option to enable hwdec
Use --no-videotoolbox to disable hardware-accelerated video decoding on
macOS/iOS.
(cherry picked from commit edc7ccd9a70267830b257ebfcc6700dbdc095650)
(cherry picked from commit 5b3e1a9d099e52987716a4bfe2d910bc7784d718)
Remove the translation for 3.0.
Signed-off-by: Thomas Guillem <thomas at gllm.fr>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=28af3c70540e77af52cb788a7322050c1650d367
---
modules/codec/videotoolbox.m | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/modules/codec/videotoolbox.m b/modules/codec/videotoolbox.m
index 2cd2bfd4b9..b041d23b18 100644
--- a/modules/codec/videotoolbox.m
+++ b/modules/codec/videotoolbox.m
@@ -78,6 +78,7 @@ const CFStringRef kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDe
static int OpenDecoder(vlc_object_t *);
static void CloseDecoder(vlc_object_t *);
+#define VT_ENABLE_TEXT "Enable hardware acceleration"
#define VT_REQUIRE_HW_DEC N_("Use Hardware decoders only")
#define VT_FORCE_CVPX_CHROMA "Force the VT decoder CVPX chroma"
#define VT_FORCE_CVPX_CHROMA_LONG "Values can be 'BGRA', 'y420', '420f', '420v', '2vuy'. \
@@ -91,6 +92,7 @@ set_capability("video decoder",800)
set_callbacks(OpenDecoder, CloseDecoder)
add_obsolete_bool("videotoolbox-temporal-deinterlacing")
+add_bool("videotoolbox", true, VT_ENABLE_TEXT, NULL, false)
add_bool("videotoolbox-hw-decoder-only", true, VT_REQUIRE_HW_DEC, VT_REQUIRE_HW_DEC, false)
add_string("videotoolbox-cvpx-chroma", "", VT_FORCE_CVPX_CHROMA, VT_FORCE_CVPX_CHROMA_LONG, true);
vlc_module_end()
@@ -1331,6 +1333,9 @@ static int OpenDecoder(vlc_object_t *p_this)
{
decoder_t *p_dec = (decoder_t *)p_this;
+ if (!var_InheritBool(p_dec, "videotoolbox"))
+ return VLC_EGENERIC;
+
#if TARGET_OS_IPHONE
if (unlikely([[UIDevice currentDevice].systemVersion floatValue] < 8.0)) {
msg_Warn(p_dec, "decoder skipped as OS is too old");
More information about the vlc-commits
mailing list