diff options
-rw-r--r-- | addons/resource.language.en_gb/resources/strings.po | 11 | ||||
-rw-r--r-- | cmake/platform/linux/gbm.cmake | 2 | ||||
-rw-r--r-- | system/settings/gbm.xml | 14 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp | 6 | ||||
-rw-r--r-- | xbmc/settings/Settings.cpp | 6 | ||||
-rw-r--r-- | xbmc/settings/Settings.h | 1 | ||||
-rw-r--r-- | xbmc/utils/StringUtils.h | 16 |
7 files changed, 52 insertions, 4 deletions
diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po index b138c67038..f84b08d62e 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -7004,7 +7004,10 @@ msgctxt "#13429" msgid "Allow hardware acceleration - VTBDecoder" msgstr "" -#empty string with id 13430 +#: system/settings/settings.xml +msgctxt "#13430" +msgid "Allow hardware acceleration - PRIME" +msgstr "" #: system/settings/settings.xml #: xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.cpp @@ -18346,7 +18349,11 @@ msgctxt "#36171" msgid "Select the zoom level that 4:3 videos are shown on widescreen displays." msgstr "" -#empty string with id 36172 +#. Description of setting with label #13430 "Allow hardware acceleration - PRIME" +#: system/settings/settings.xml +msgctxt "#36172" +msgid "Enable PRIME hardware decoding of video files, used if ffmpeg PRIME hwaccel is available." +msgstr "" #. Description of setting with label #14109 "Short date format" #: system/settings/settings.xml diff --git a/cmake/platform/linux/gbm.cmake b/cmake/platform/linux/gbm.cmake index d2891665db..d8e73d0628 100644 --- a/cmake/platform/linux/gbm.cmake +++ b/cmake/platform/linux/gbm.cmake @@ -1,4 +1,4 @@ set(PLATFORM_REQUIRED_DEPS OpenGLES EGL GBM LibDRM) set(PLATFORM_OPTIONAL_DEPS VAAPI) set(APP_RENDER_SYSTEM gles) -list(APPEND PLATFORM_DEFINES -DMESA_EGL_NO_X11_HEADERS) +list(APPEND PLATFORM_DEFINES -DMESA_EGL_NO_X11_HEADERS -DPLATFORM_SETTINGS_FILE=gbm.xml) diff --git a/system/settings/gbm.xml b/system/settings/gbm.xml new file mode 100644 index 0000000000..a46768c11d --- /dev/null +++ b/system/settings/gbm.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8" ?> +<settings version="1"> + <section id="player"> + <category id="videoplayer"> + <group id="3"> + <setting id="videoplayer.useprimedecoder" type="boolean" label="13430" help="36172"> + <level>2</level> + <default>true</default> + <control type="toggle" /> + </setting> + </group> + </category> + </section> +</settings> diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp index 41ff3397e8..35f1fbb661 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp @@ -20,7 +20,9 @@ #include "DVDVideoCodecDRMPRIME.h" +#include "ServiceBroker.h" #include "cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.h" +#include "settings/Settings.h" #include "threads/SingleLock.h" #include "utils/log.h" @@ -159,7 +161,9 @@ CDVDVideoCodecDRMPRIME::~CDVDVideoCodecDRMPRIME() CDVDVideoCodec* CDVDVideoCodecDRMPRIME::Create(CProcessInfo& processInfo) { - return new CDVDVideoCodecDRMPRIME(processInfo); + if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_USEPRIMEDECODER)) + return new CDVDVideoCodecDRMPRIME(processInfo); + return nullptr; } void CDVDVideoCodecDRMPRIME::Register() diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp index a7bb23f712..9dd6355945 100644 --- a/xbmc/settings/Settings.cpp +++ b/xbmc/settings/Settings.cpp @@ -172,6 +172,7 @@ const std::string CSettings::SETTING_VIDEOPLAYER_USEDXVA2 = "videoplayer.usedxva const std::string CSettings::SETTING_VIDEOPLAYER_USEOMXPLAYER = "videoplayer.useomxplayer"; const std::string CSettings::SETTING_VIDEOPLAYER_USEVTB = "videoplayer.usevtb"; const std::string CSettings::SETTING_VIDEOPLAYER_USEMMAL = "videoplayer.usemmal"; +const std::string CSettings::SETTING_VIDEOPLAYER_USEPRIMEDECODER = "videoplayer.useprimedecoder"; const std::string CSettings::SETTING_VIDEOPLAYER_USESTAGEFRIGHT = "videoplayer.usestagefright"; const std::string CSettings::SETTING_VIDEOPLAYER_LIMITGUIUPDATE = "videoplayer.limitguiupdate"; const std::string CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC = "videoplayer.supportmvc"; @@ -588,6 +589,11 @@ bool CSettings::InitializeDefinitions() #endif #endif +#if defined(PLATFORM_SETTINGS_FILE) + if (CFile::Exists(SETTINGS_XML_FOLDER DEF_TO_STR_VALUE(PLATFORM_SETTINGS_FILE)) && !Initialize(SETTINGS_XML_FOLDER DEF_TO_STR_VALUE(PLATFORM_SETTINGS_FILE))) + CLog::Log(LOGFATAL, "Unable to load platform-specific settings definitions (%s)", DEF_TO_STR_VALUE(PLATFORM_SETTINGS_FILE)); +#endif + // load any custom visibility and default values before loading the special // appliance.xml so that appliances are able to overwrite even those values InitializeVisibility(); diff --git a/xbmc/settings/Settings.h b/xbmc/settings/Settings.h index 6e3674d49d..a81e4a3d65 100644 --- a/xbmc/settings/Settings.h +++ b/xbmc/settings/Settings.h @@ -126,6 +126,7 @@ public: static const std::string SETTING_VIDEOPLAYER_USEOMXPLAYER; static const std::string SETTING_VIDEOPLAYER_USEVTB; static const std::string SETTING_VIDEOPLAYER_USEMMAL; + static const std::string SETTING_VIDEOPLAYER_USEPRIMEDECODER; static const std::string SETTING_VIDEOPLAYER_USESTAGEFRIGHT; static const std::string SETTING_VIDEOPLAYER_LIMITGUIUPDATE; static const std::string SETTING_VIDEOPLAYER_SUPPORTMVC; diff --git a/xbmc/utils/StringUtils.h b/xbmc/utils/StringUtils.h index 2fabf3966b..2cf5f63f3a 100644 --- a/xbmc/utils/StringUtils.h +++ b/xbmc/utils/StringUtils.h @@ -46,6 +46,22 @@ #include "XBDateTime.h" #include "utils/params_check_macros.h" +/*! \brief C-processor Token stringification + +The following macros can be used to stringify definitions to +C style strings. + +Example: + +#define foo 4 +DEF_TO_STR_NAME(foo) // outputs "foo" +DEF_TO_STR_VALUE(foo) // outputs "4" + +*/ + +#define DEF_TO_STR_NAME(x) #x +#define DEF_TO_STR_VALUE(x) DEF_TO_STR_NAME(x) + class StringUtils { public: |