From f197c11b41f0ed097e3a1055521243346ba76340 Mon Sep 17 00:00:00 2001 From: Lukas Rusak Date: Sat, 5 May 2018 13:16:09 -0700 Subject: VideoPlayer: add setting for using VAAPI HEVC --- addons/resource.language.en_gb/resources/strings.po | 13 ++++++++++++- system/settings/linux.xml | 12 ++++++++++++ xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.cpp | 2 ++ xbmc/settings/Settings.cpp | 1 + xbmc/settings/Settings.h | 1 + 5 files changed, 28 insertions(+), 1 deletion(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po index d505d3a365..1365b42eca 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -7160,7 +7160,18 @@ msgctxt "#13459" msgid "Use OMXPlayer for decoding of video files." msgstr "" -#empty strings from id 13460 to 13504 +#: system/settings/settings.xml +msgctxt "#13460" +msgid "Use HEVC VAAPI" +msgstr "" + +#. Description of setting with label #13460 "Use HEVC VAAPI" +#: system/settings/settings.xml +msgctxt "#13461" +msgid "Enable this option to use hardware acceleration for the HEVC codec. If disabled the CPU will be used instead." +msgstr "" + +#empty strings from id 13462 to 13504 #: system/settings/settings.xml msgctxt "#13505" diff --git a/system/settings/linux.xml b/system/settings/linux.xml index 82b2f6e534..fca94ba98c 100644 --- a/system/settings/linux.xml +++ b/system/settings/linux.xml @@ -124,6 +124,18 @@ true + + HAVE_LIBVA + false + + + true + + + 3 + true + + HAVE_LIBVA false diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.cpp index 75cf67cf08..d86dc50784 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.cpp @@ -507,6 +507,7 @@ bool CDecoder::Open(AVCodecContext* avctx, AVCodecContext* mainctx, const enum A { AV_CODEC_ID_MPEG2VIDEO, CSettings::SETTING_VIDEOPLAYER_USEVAAPIMPEG2 }, { AV_CODEC_ID_VP8, CSettings::SETTING_VIDEOPLAYER_USEVAAPIVP8 }, { AV_CODEC_ID_VP9, CSettings::SETTING_VIDEOPLAYER_USEVAAPIVP9 }, + { AV_CODEC_ID_HEVC, CSettings::SETTING_VIDEOPLAYER_USEVAAPIHEVC }, }; auto entry = settings_map.find(avctx->codec_id); @@ -1208,6 +1209,7 @@ void CDecoder::Register(IVaapiWinSystem *winSystem, bool deepColor) CServiceBroker::GetSettings().GetSetting(CSettings::SETTING_VIDEOPLAYER_USEVAAPIMPEG2)->SetVisible(true); CServiceBroker::GetSettings().GetSetting(CSettings::SETTING_VIDEOPLAYER_USEVAAPIVP8)->SetVisible(true); CServiceBroker::GetSettings().GetSetting(CSettings::SETTING_VIDEOPLAYER_USEVAAPIVP9)->SetVisible(true); + CServiceBroker::GetSettings().GetSetting(CSettings::SETTING_VIDEOPLAYER_USEVAAPIHEVC)->SetVisible(true); } //----------------------------------------------------------------------------- diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp index 71fcef3493..fafde447b4 100644 --- a/xbmc/settings/Settings.cpp +++ b/xbmc/settings/Settings.cpp @@ -169,6 +169,7 @@ const std::string CSettings::SETTING_VIDEOPLAYER_USEVAAPIMPEG4 = "videoplayer.us const std::string CSettings::SETTING_VIDEOPLAYER_USEVAAPIVC1 = "videoplayer.usevaapivc1"; const std::string CSettings::SETTING_VIDEOPLAYER_USEVAAPIVP8 = "videoplayer.usevaapivp8"; const std::string CSettings::SETTING_VIDEOPLAYER_USEVAAPIVP9 = "videoplayer.usevaapivp9"; +const std::string CSettings::SETTING_VIDEOPLAYER_USEVAAPIHEVC = "videoplayer.usevaapihevc"; const std::string CSettings::SETTING_VIDEOPLAYER_PREFERVAAPIRENDER = "videoplayer.prefervaapirender"; const std::string CSettings::SETTING_VIDEOPLAYER_USEDXVA2 = "videoplayer.usedxva2"; const std::string CSettings::SETTING_VIDEOPLAYER_USEOMXPLAYER = "videoplayer.useomxplayer"; diff --git a/xbmc/settings/Settings.h b/xbmc/settings/Settings.h index bdb32fc4f7..5fb35c4fe0 100644 --- a/xbmc/settings/Settings.h +++ b/xbmc/settings/Settings.h @@ -123,6 +123,7 @@ public: static const std::string SETTING_VIDEOPLAYER_USEVAAPIVC1; static const std::string SETTING_VIDEOPLAYER_USEVAAPIVP8; static const std::string SETTING_VIDEOPLAYER_USEVAAPIVP9; + static const std::string SETTING_VIDEOPLAYER_USEVAAPIHEVC; static const std::string SETTING_VIDEOPLAYER_PREFERVAAPIRENDER; static const std::string SETTING_VIDEOPLAYER_USEDXVA2; static const std::string SETTING_VIDEOPLAYER_USEOMXPLAYER; -- cgit v1.2.3