diff options
84 files changed, 509 insertions, 209 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 28024af9fe..4ce8872d03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -215,7 +215,8 @@ endif() # find all folders containing addon.xml.in # used to define ADDON_XML_OUTPUTS, ADDON_XML_DEPENDS and ADDON_INSTALL_DATA # Function defined in ./cmake/scripts/common/Macros.cmake -find_addon_xml_in_files() +set(outputFilterRegex "addons/xbmc.json") +find_addon_xml_in_files(${outputFilterRegex}) # Compile Info add_custom_command(OUTPUT ${CORE_BUILD_DIR}/xbmc/CompileInfo.cpp @@ -227,6 +228,7 @@ add_custom_command(OUTPUT ${CORE_BUILD_DIR}/xbmc/CompileInfo.cpp -DARCH_DEFINES="${ARCH_DEFINES}" -DAPP_SCMID=${APP_SCMID} -DAPP_COPYRIGHT_YEARS=${APP_COPYRIGHT_YEARS} + -DAPP_BUILD_DATE=${APP_BUILD_DATE} -Dprefix=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} -P ${CMAKE_SOURCE_DIR}/cmake/scripts/common/GenerateVersionedFiles.cmake DEPENDS ${CMAKE_SOURCE_DIR}/version.txt @@ -488,6 +490,7 @@ if(VERBOSE) message(STATUS "BINARY: ${APP_NAME_LC}${APP_BINARY_SUFFIX}") message(STATUS "#---------------------------------------------#") message(STATUS "GIT_REV: ${APP_SCMID}") + message(STATUS "Build date: ${APP_BUILD_DATE}") message(STATUS "#---------------------------------------------#") message(STATUS "CPACK_GENERATOR : ${CPACK_GENERATOR}") message(STATUS "CPACK_SOURCE_GENERATOR: ${CPACK_SOURCE_GENERATOR}") diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po index 6e670c77df..b28cd82141 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -12877,7 +12877,7 @@ msgstr "" #: system/settings/settings.xml msgctxt "#20369" -msgid "Show plot for unwatched items" +msgid "Show information for unwatched items" msgstr "" msgctxt "#20370" @@ -18113,10 +18113,10 @@ msgctxt "#36140" msgid "Choose which temperature unit is used for displaying temperatures in the user interface." msgstr "" -#. Description of setting with label #20369 "Show plot for unwatched items" +#. Description of setting with label #20369 "Show information for unwatched items" #: system/settings/settings.xml msgctxt "#36141" -msgid "Show plot information for unwatched media in the video library. The plot will be shown for the specific category you have selected. For example if 'Movies' is selected, the plot will be shown at the movie library, but will be hidden for TV shows and otherwise." +msgid "Show information for unwatched media in the video library or hide them if not selected to prevent spoilers. Available options are 'Movie plot', 'Episode plot' and 'Episode thumb'." msgstr "" #. Description of setting with label #14106 "Speed unit" @@ -20658,6 +20658,7 @@ msgid "Configure audio encoder settings such as quality and compression level" msgstr "" #: system/settings/rbp.xml +#: system/settings/android.xml msgctxt "#37026" msgid "Auto" msgstr "" @@ -20668,6 +20669,7 @@ msgid "540" msgstr "" #: system/settings/rbp.xml +#: system/settings/android.xml msgctxt "#37028" msgid "720" msgstr "" @@ -20678,6 +20680,7 @@ msgid "900" msgstr "" #: system/settings/rbp.xml +#: system/settings/android.xml msgctxt "#37030" msgid "Unlimited" msgstr "" @@ -20772,7 +20775,12 @@ msgctxt "#37045" msgid "Extract chapter thumbnails for presentation in the chapters / bookmarks dialogue. This might increase CPU load." msgstr "" -#empty strings from id 37046 to 38009 +#: system/settings/android.xml +msgctxt "#37046" +msgid "1080" +msgstr "" + +#empty strings from id 37047 to 38009 #: system/settings/rbp.xml msgctxt "#38010" @@ -21588,3 +21596,21 @@ msgstr "" msgctxt "#39113" msgid "Center Mix Level in dB relative to metadata or default (-3 dB)" msgstr "" + +#. Label for "show information for unwatched items" setting option +#: system/settings/settings.xml +msgctxt "#39114" +msgid "Episode thumb" +msgstr "" + +#. Label for "show information for unwatched items" setting option +#: system/settings/settings.xml +msgctxt "#39115" +msgid "Movie plot" +msgstr "" + +#. Label for "show information for unwatched items" setting option +#: system/settings/settings.xml +msgctxt "#39116" +msgid "Episode plot" +msgstr "" diff --git a/addons/skin.estuary/media/OverlaySpoiler.png b/addons/skin.estuary/media/OverlaySpoiler.png Binary files differnew file mode 100644 index 0000000000..f67af16bff --- /dev/null +++ b/addons/skin.estuary/media/OverlaySpoiler.png diff --git a/cmake/modules/FindFreeType.cmake b/cmake/modules/FindFreeType.cmake index 8a3955552d..771819e902 100644 --- a/cmake/modules/FindFreeType.cmake +++ b/cmake/modules/FindFreeType.cmake @@ -19,7 +19,8 @@ endif() find_path(FREETYPE_INCLUDE_DIR NAMES freetype/freetype.h freetype.h PATHS ${PC_FREETYPE_INCLUDEDIR} - ${PC_FREETYPE_INCLUDE_DIRS}) + ${PC_FREETYPE_INCLUDE_DIRS} + PATH_SUFFIXES freetype2) find_library(FREETYPE_LIBRARY NAMES freetype freetype246MT PATHS ${PC_FREETYPE_LIBDIR}) diff --git a/cmake/scripts/common/GenerateVersionedFiles.cmake b/cmake/scripts/common/GenerateVersionedFiles.cmake index 011f4956f1..1d324db9c5 100644 --- a/cmake/scripts/common/GenerateVersionedFiles.cmake +++ b/cmake/scripts/common/GenerateVersionedFiles.cmake @@ -15,7 +15,7 @@ endfunction() file(GLOB ADDON_XML_IN_FILE ${CORE_SOURCE_DIR}/addons/*/addon.xml.in) # remove 'xbmc.json', will be created from 'xbmc/interfaces/json-rpc/schema/CMakeLists.txt' -list(REMOVE_ITEM ADDON_XML_IN_FILE xbmc.json) +list(REMOVE_ITEM ADDON_XML_IN_FILE ${CORE_SOURCE_DIR}/addons/xbmc.json/addon.xml.in) foreach(loop_var ${ADDON_XML_IN_FILE}) list(GET loop_var 0 xml_name) diff --git a/cmake/scripts/common/Macros.cmake b/cmake/scripts/common/Macros.cmake index cf1f241b3e..eefd7c8803 100644 --- a/cmake/scripts/common/Macros.cmake +++ b/cmake/scripts/common/Macros.cmake @@ -623,6 +623,8 @@ function(core_find_git_rev stamp) # allow manual setting GIT_VERSION if(GIT_VERSION) set(${stamp} ${GIT_VERSION} PARENT_SCOPE) + string(TIMESTAMP APP_BUILD_DATE "%Y%m%d" UTC) + set(APP_BUILD_DATE ${APP_BUILD_DATE} PARENT_SCOPE) else() find_package(Git) if(GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git) @@ -653,12 +655,18 @@ function(core_find_git_rev stamp) WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) string(REPLACE "\"" "" DATE ${DATE}) string(REPLACE "-" "" DATE ${DATE}) + + # build date + string(TIMESTAMP APP_BUILD_DATE "%Y%m%d" UTC) + set(APP_BUILD_DATE ${APP_BUILD_DATE} PARENT_SCOPE) else() if(EXISTS ${CMAKE_SOURCE_DIR}/BUILDDATE) file(STRINGS ${CMAKE_SOURCE_DIR}/BUILDDATE DATE LIMIT_INPUT 8) else() string(TIMESTAMP DATE "%Y%m%d" UTC) endif() + set(APP_BUILD_DATE ${DATE} PARENT_SCOPE) + if(EXISTS ${CMAKE_SOURCE_DIR}/VERSION) file(STRINGS ${CMAKE_SOURCE_DIR}/VERSION HASH LIMIT_INPUT 16) else() @@ -777,6 +785,12 @@ endmacro() # find all folders containing addon.xml.in and used to define # ADDON_XML_OUTPUTS, ADDON_XML_DEPENDS and ADDON_INSTALL_DATA macro(find_addon_xml_in_files) + set(filter ${ARGV0}) + + if(filter AND VERBOSE) + message(STATUS "find_addon_xml_in_files: filtering ${filter}") + endif() + file(GLOB ADDON_XML_IN_FILE ${CMAKE_SOURCE_DIR}/addons/*/addon.xml.in) foreach(loop_var ${ADDON_XML_IN_FILE}) list(GET loop_var 0 xml_name) @@ -785,7 +799,9 @@ macro(find_addon_xml_in_files) string(REPLACE "${CORE_SOURCE_DIR}/" "" xml_name ${xml_name}) list(APPEND ADDON_XML_DEPENDS "${CORE_SOURCE_DIR}/${xml_name}/addon.xml.in") - list(APPEND ADDON_XML_OUTPUTS "${CMAKE_BINARY_DIR}/${xml_name}/addon.xml") + if(filter AND NOT xml_name MATCHES ${filter}) + list(APPEND ADDON_XML_OUTPUTS "${CMAKE_BINARY_DIR}/${xml_name}/addon.xml") + endif() # Read content of add-on folder to have on install file(GLOB ADDON_FILES "${CORE_SOURCE_DIR}/${xml_name}/*") diff --git a/cmake/scripts/ios/Install.cmake b/cmake/scripts/ios/Install.cmake index f32c73f56f..7d8de72b9c 100644 --- a/cmake/scripts/ios/Install.cmake +++ b/cmake/scripts/ios/Install.cmake @@ -1,11 +1,26 @@ # IOS packaging -set(BUNDLE_RESOURCES ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-568h@2x.png - ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-667h@2x.png - ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-736h@3x.png - ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-Landscape-736h@3x.png - ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-812h@3x.png - ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-Landscape-812h@3x.png +set(BUNDLE_RESOURCES ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1100-Landscape-2436h@3x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1100-Portrait-2436h@3x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Landscape-1792h@2x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Portrait-2224h@2x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Landscape-2224h@2x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Portrait-2388h@2x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Landscape-2388h@2x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Landscape-2688h@3x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Portrait-1792h@2x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Portrait-2688h@3x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-568h@2x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-700-568h@2x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-700-Landscape@2x~ipad.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-700-Portrait@2x~ipad.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-700@2x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-800-667h@2x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-800-Landscape-736h@3x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-800-Portrait-736h@3x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-Landscape@2x~ipad.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-Portrait@2x~ipad.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage@2x.png ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon29x29.png ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon29x29@2x.png ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon40x40.png diff --git a/system/settings/android.xml b/system/settings/android.xml index 53d2c10650..f0a5e8f914 100644 --- a/system/settings/android.xml +++ b/system/settings/android.xml @@ -19,7 +19,7 @@ <options> <option label="37026">0</option> <!-- auto --> <option label="37028">720</option> <!-- 720 --> - <option label="37027">1080</option> <!-- 900 --> + <option label="37046">1080</option> <!-- 1080 --> <option label="37030">9999</option> <!-- unlimited --> </options> </constraints> diff --git a/system/settings/settings.xml b/system/settings/settings.xml index ed201cc591..f87ac4b6f4 100755 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -970,11 +970,12 @@ </setting> <setting id="videolibrary.showunwatchedplots" type="list[integer]" label="20369" help="36141"> <level>0</level> - <default>0,1</default> <!-- Show plot for both --> + <default>0,1,2</default> <!-- Show plot for both --> <constraints> <options> - <option label="20342">0</option> <!-- Show plot for unwatched movies only --> - <option label="20343">1</option> <!-- Show plot for unwatched tv show episodes only --> + <option label="39115">0</option> <!-- Show plot for unwatched movies only --> + <option label="39116">1</option> <!-- Show plot for unwatched tv show episodes only --> + <option label="39114">2</option> <!-- Show thumb for unwatched tv show episodes only --> </options> <delimiter>,</delimiter> </constraints> diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp index 715c4e616c..3c7c398987 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -450,7 +450,7 @@ bool CApplication::Create(const CAppParamParser ¶ms) // specialVersion = " (version for XXXX)"; #endif CLog::Log(LOGNOTICE, "Using %s %s x%d build%s", buildType.c_str(), CSysInfo::GetAppName().c_str(), g_sysinfo.GetXbmcBitness(), specialVersion.c_str()); - CLog::Log(LOGNOTICE, "%s compiled " __DATE__ " by %s for %s %s %d-bit %s (%s)", CSysInfo::GetAppName().c_str(), g_sysinfo.GetUsedCompilerNameAndVer().c_str(), g_sysinfo.GetBuildTargetPlatformName().c_str(), + CLog::Log(LOGNOTICE, "%s compiled %s by %s for %s %s %d-bit %s (%s)", CSysInfo::GetAppName().c_str(), CSysInfo::GetBuildDate(), g_sysinfo.GetUsedCompilerNameAndVer().c_str(), g_sysinfo.GetBuildTargetPlatformName().c_str(), g_sysinfo.GetBuildTargetCpuFamily().c_str(), g_sysinfo.GetXbmcBitness(), g_sysinfo.GetBuildTargetPlatformVersionDecoded().c_str(), g_sysinfo.GetBuildTargetPlatformVersion().c_str()); diff --git a/xbmc/CompileInfo.cpp.in b/xbmc/CompileInfo.cpp.in index eef78ba052..7e4d884ef8 100644 --- a/xbmc/CompileInfo.cpp.in +++ b/xbmc/CompileInfo.cpp.in @@ -59,3 +59,14 @@ const char* CCompileInfo::GetCopyrightYears() { return "@APP_COPYRIGHT_YEARS@"; } + +const char* CCompileInfo::GetBuildDate() +{ + const std::string bdate = "@APP_BUILD_DATE@"; + if (!bdate.empty()) + { + std::string datestamp = bdate.substr(0, 4) + "-" + bdate.substr(4, 2) + "-" + bdate.substr(6, 2); + return datestamp.c_str(); + } + return "1970-01-01"; +} diff --git a/xbmc/CompileInfo.h b/xbmc/CompileInfo.h index 855711e5f7..c92d24083a 100644 --- a/xbmc/CompileInfo.h +++ b/xbmc/CompileInfo.h @@ -19,4 +19,5 @@ public: static const char *GetSuffix(); // Git "Tag", e.g. alpha1 static const char* GetSCMID(); // Git Revision static const char* GetCopyrightYears(); + static const char* GetBuildDate(); }; diff --git a/xbmc/XBDateTime.cpp b/xbmc/XBDateTime.cpp index f359a8cf67..b006134794 100644 --- a/xbmc/XBDateTime.cpp +++ b/xbmc/XBDateTime.cpp @@ -1056,15 +1056,19 @@ bool CDateTime::SetFromDBDate(const std::string &date) bool CDateTime::SetFromDBTime(const std::string &time) { - if (time.size() < 8) + if (time.size() < 5) return false; - // assumes format: - // HH:MM:SS - int hour, minute, second; + int hour; + int minute; + + int second = 0; + // HH:MM or HH:MM:SS hour = atoi(time.substr(0, 2).c_str()); minute = atoi(time.substr(3, 2).c_str()); - second = atoi(time.substr(6, 2).c_str()); + // HH:MM:SS + if (time.size() == 8) + second = atoi(time.substr(6, 2).c_str()); return SetTime(hour, minute, second); } diff --git a/xbmc/addons/settings/AddonSettings.cpp b/xbmc/addons/settings/AddonSettings.cpp index caaa117912..20c3b611f9 100644 --- a/xbmc/addons/settings/AddonSettings.cpp +++ b/xbmc/addons/settings/AddonSettings.cpp @@ -430,11 +430,10 @@ bool CAddonSettings::ParseSettingVersion(const CXBMCTinyXML& doc, uint32_t& vers return true; } -std::shared_ptr<CSettingGroup> CAddonSettings::ParseOldSettingElement(const TiXmlElement* categoryElement, std::shared_ptr<CSettingCategory> category, std::set<std::string>& actionSettings) +std::shared_ptr<CSettingGroup> CAddonSettings::ParseOldSettingElement(const TiXmlElement* categoryElement, std::shared_ptr<CSettingCategory> category, std::set<std::string>& actionSettings, std::set<std::string>& settingIds) { // build a vector of settings from the same category std::vector<std::shared_ptr<const CSetting>> categorySettings; - std::set<std::string> settingIds; // prepare for settings with enable/visible conditions struct SettingWithConditions { @@ -593,9 +592,11 @@ std::shared_ptr<CSettingGroup> CAddonSettings::ParseOldSettingElement(const TiXm // turn the setting into a reference setting setting = std::make_shared<CSettingReference>(settingId, GetSettingsManager()); } - - // add the setting's identifier to the list of all identifiers - settingIds.insert(setting->GetId()); + else + { + // add the setting's identifier to the list of all identifiers + settingIds.insert(setting->GetId()); + } // add the setting to the list of settings from the same category categorySettings.push_back(setting); @@ -646,7 +647,7 @@ std::shared_ptr<CSettingGroup> CAddonSettings::ParseOldSettingElement(const TiXm return group; } -std::shared_ptr<CSettingCategory> CAddonSettings::ParseOldCategoryElement(uint32_t &categoryId, const TiXmlElement * categoryElement, std::set<std::string> &actionSettings) +std::shared_ptr<CSettingCategory> CAddonSettings::ParseOldCategoryElement(uint32_t &categoryId, const TiXmlElement * categoryElement, std::set<std::string> &actionSettings, std::set<std::string> &settingIds) { // create the category auto category = std::make_shared<CSettingCategory>(StringUtils::Format("category%u", categoryId), GetSettingsManager()); @@ -658,7 +659,7 @@ std::shared_ptr<CSettingCategory> CAddonSettings::ParseOldCategoryElement(uint32 category->SetLabel(categoryLabel); // prepare a setting group - auto group = ParseOldSettingElement(categoryElement, category, actionSettings); + auto group = ParseOldSettingElement(categoryElement, category, actionSettings, settingIds); // add the group to the category category->AddGroup(group); @@ -680,14 +681,16 @@ bool CAddonSettings::InitializeFromOldSettingDefinitions(const CXBMCTinyXML& doc uint32_t categoryId = 0; std::set<std::string> actionSettings; + // Settings id set + std::set<std::string> settingIds; // Special case for no category settings - section->AddCategory(ParseOldCategoryElement(categoryId, root, actionSettings)); + section->AddCategory(ParseOldCategoryElement(categoryId, root, actionSettings, settingIds)); const TiXmlElement *categoryElement = root->FirstChildElement("category"); while (categoryElement != nullptr) { - section->AddCategory(ParseOldCategoryElement(categoryId, categoryElement, actionSettings)); + section->AddCategory(ParseOldCategoryElement(categoryId, categoryElement, actionSettings, settingIds)); // look for the next category categoryElement = categoryElement->NextSiblingElement("category"); diff --git a/xbmc/addons/settings/AddonSettings.h b/xbmc/addons/settings/AddonSettings.h index d4f52b82e8..fbf546a85a 100644 --- a/xbmc/addons/settings/AddonSettings.h +++ b/xbmc/addons/settings/AddonSettings.h @@ -74,9 +74,9 @@ namespace ADDON bool ParseSettingVersion(const CXBMCTinyXML& doc, uint32_t& version) const; - std::shared_ptr<CSettingGroup> ParseOldSettingElement(const TiXmlElement *categoryElement, std::shared_ptr<CSettingCategory> category, std::set<std::string>& actionSettings); + std::shared_ptr<CSettingGroup> ParseOldSettingElement(const TiXmlElement *categoryElement, std::shared_ptr<CSettingCategory> category, std::set<std::string>& actionSettings, std::set<std::string>& settingIds); - std::shared_ptr<CSettingCategory> ParseOldCategoryElement(uint32_t &categoryId, const TiXmlElement * categoryElement, std::set<std::string> &actionSettings); + std::shared_ptr<CSettingCategory> ParseOldCategoryElement(uint32_t &categoryId, const TiXmlElement * categoryElement, std::set<std::string> &actionSettings, std::set<std::string>& settingIds); bool InitializeFromOldSettingDefinitions(const CXBMCTinyXML& doc); std::shared_ptr<CSetting> InitializeFromOldSettingAction(std::string settingId, const TiXmlElement *settingElement, const std::string& defaultValue); diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp index 348a1dc1bb..82bf70596b 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp @@ -2206,8 +2206,8 @@ void CAMLCodec::SetVideoZoom(const float zoom) void CAMLCodec::SetVideoContrast(const int contrast) { // input contrast range is 0 to 100 with default of 50. - // output contrast range is -255 to 255 with default of 0. - int aml_contrast = (255 * (contrast - 50)) / 50; + // output contrast range is -127 to 127 with default of 0. + int aml_contrast = (127 * (contrast - 50)) / 50; SysfsUtils::SetInt("/sys/class/video/contrast", aml_contrast); } void CAMLCodec::SetVideoBrightness(const int brightness) diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp index c93409cfae..b6d6c92c4b 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp @@ -344,6 +344,7 @@ CDVDVideoCodecAndroidMediaCodec::CDVDVideoCodecAndroidMediaCodec(CProcessInfo &p , m_bitstream(nullptr) , m_render_surface(surface_render) , m_mpeg2_sequence(nullptr) +, m_useDTSforPTS(false) { m_videobuffer.Reset(); } @@ -418,6 +419,7 @@ bool CDVDVideoCodecAndroidMediaCodec::Open(CDVDStreamInfo &hints, CDVDCodecOptio m_hints = hints; m_indexInputBuffer = -1; m_dtsShift = DVD_NOPTS_VALUE; + m_useDTSforPTS = false; CLog::Log(LOGDEBUG, LOGVIDEO, "CDVDVideoCodecAndroidMediaCodec::Open hints: fpsrate %d / fpsscale %d\n", m_hints.fpsrate, m_hints.fpsscale); CLog::Log(LOGDEBUG, LOGVIDEO, "CDVDVideoCodecAndroidMediaCodec::Open hints: CodecID %d \n", m_hints.codec); @@ -441,10 +443,9 @@ bool CDVDVideoCodecAndroidMediaCodec::Open(CDVDStreamInfo &hints, CDVDCodecOptio m_formatname = "amc-mpeg2"; break; case AV_CODEC_ID_MPEG4: - if (hints.width <= 800) - goto FAIL; m_mime = "video/mp4v-es"; m_formatname = "amc-mpeg4"; + m_useDTSforPTS = true; break; case AV_CODEC_ID_H263: m_mime = "video/3gpp"; @@ -906,6 +907,8 @@ bool CDVDVideoCodecAndroidMediaCodec::AddData(const DemuxPacket &packet) int64_t presentationTimeUs = 0; if (pts != DVD_NOPTS_VALUE) presentationTimeUs = (pts - m_dtsShift); + else if (m_useDTSforPTS && dts != DVD_NOPTS_VALUE) + presentationTimeUs = (dts - m_dtsShift); int flags = 0; int offset = 0; diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.h index acfda364c0..b1577bb455 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.h +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.h @@ -183,6 +183,7 @@ protected: mpeg2_sequence *m_mpeg2_sequence; int m_src_offset[4]; int m_src_stride[4]; + bool m_useDTSforPTS; // CJNISurfaceHolderCallback interface public: diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp index f17e509417..63d4c573be 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp @@ -720,10 +720,6 @@ CDVDVideoCodec::VCReturn CMMALVideo::GetPicture(VideoPicture* picture) bool drain = (m_codecControlFlags & DVD_CODEC_CTRL_DRAIN) ? true : false; bool send_eos = drain && !m_got_eos && m_packet_num_eos != m_packet_num; - if (picture->videoBuffer) - picture->videoBuffer->Release(); - picture->videoBuffer = nullptr; - // we don't get an EOS response if no packets have been sent if (!drain) m_got_eos = false; @@ -799,6 +795,8 @@ CDVDVideoCodec::VCReturn CMMALVideo::GetPicture(VideoPicture* picture) if (ret == CDVDVideoCodec::VC_PICTURE) { assert(buffer && buffer->mmal_buffer); + if (picture->videoBuffer) + picture->videoBuffer->Release(); picture->videoBuffer = dynamic_cast<CVideoBuffer*>(buffer); assert(picture->videoBuffer); picture->color_range = 0; diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxClient.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxClient.cpp index ac6e04b548..f999fa679f 100644 --- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxClient.cpp +++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxClient.cpp @@ -639,13 +639,16 @@ void CDVDDemuxClient::OpenStream(int id) { // OpenStream may change some parameters // in this case we need to reset our stream properties - if (m_IDemux && m_IDemux->OpenStream(id)) + if (m_IDemux) { + bool bOpenStream = m_IDemux->OpenStream(id); + CDemuxStream *stream(m_IDemux->GetStream(id)); if (stream && stream->type == STREAM_VIDEO) m_videoStreamPlaying = id; - SetStreamProps(stream, m_streams, true); + if (bOpenStream) + SetStreamProps(stream, m_streams, true); } } diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h index 03da2a160c..8dc39442c9 100644 --- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h +++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h @@ -125,7 +125,7 @@ public: virtual CDemuxStream* GetStream(int iStreamId) const = 0; virtual std::vector<CDemuxStream*> GetStreams() const = 0; virtual void EnableStream(int iStreamId, bool enable) {}; - virtual bool OpenStream(int iStreamId) { return true; }; + virtual bool OpenStream(int iStreamId) { return false; }; virtual int GetNrOfStreams() const = 0; virtual void SetSpeed(int iSpeed) = 0; virtual bool SeekTime(double time, bool backward = false, double* startpts = NULL) = 0; diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp index 6202e66dab..99e0356121 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp @@ -172,11 +172,12 @@ CMMALPool::~CMMALPool() CLog::Log(LOGERROR, "%s::%s Failed to disable component %s (status=%x %s)", CLASSNAME, __func__, m_component->name, status, mmal_status_to_string(status)); } + mmal_port_pool_destroy(port, m_mmal_pool); + if (m_component) mmal_component_destroy(m_component); m_component = nullptr; - mmal_port_pool_destroy(port, m_mmal_pool); m_mmal_pool = nullptr; for (auto buf : m_all) { diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererAML.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererAML.cpp index fe5fa42b3f..c545374a54 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererAML.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererAML.cpp @@ -119,6 +119,7 @@ bool CRendererAML::Supports(ERENDERFEATURE feature) feature == RENDERFEATURE_CONTRAST || feature == RENDERFEATURE_BRIGHTNESS || feature == RENDERFEATURE_NONLINSTRETCH || + feature == RENDERFEATURE_VERTICAL_SHIFT || feature == RENDERFEATURE_STRETCH || feature == RENDERFEATURE_PIXEL_RATIO || feature == RENDERFEATURE_ROTATION) diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderBuffer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderBuffer.cpp index 7fdafe2f2d..a85da3735b 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderBuffer.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderBuffer.cpp @@ -85,6 +85,7 @@ void CRenderBuffer::Release() m_activePlanes = 0; texBits = 8; bits = 8; + m_locked = false; m_planes[0] = nullptr; m_planes[1] = nullptr; diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp index 56f3c90f20..068da182df 100644 --- a/xbmc/cores/omxplayer/OMXAudio.cpp +++ b/xbmc/cores/omxplayer/OMXAudio.cpp @@ -1312,7 +1312,7 @@ float COMXAudio::GetCacheTotal() } //*********************************************************************************************** -unsigned int COMXAudio::GetChunkLen() +unsigned int COMXAudio::GetChunkLen() const { return m_ChunkLen; } diff --git a/xbmc/cores/omxplayer/OMXAudio.h b/xbmc/cores/omxplayer/OMXAudio.h index 42d96c11a3..06ebb49174 100644 --- a/xbmc/cores/omxplayer/OMXAudio.h +++ b/xbmc/cores/omxplayer/OMXAudio.h @@ -71,7 +71,7 @@ typedef struct tWAVEFORMATEXTENSIBLE class COMXAudio { public: - unsigned int GetChunkLen(); + unsigned int GetChunkLen() const; float GetDelay(); float GetCacheTime(); float GetCacheTotal(); @@ -101,7 +101,7 @@ public: void SetCodingType(AEAudioFormat format); static void PrintChannels(OMX_AUDIO_CHANNELTYPE eChannelMapping[]); - void PrintPCM(OMX_AUDIO_PARAM_PCMMODETYPE *pcm, std::string direction); + static void PrintPCM(OMX_AUDIO_PARAM_PCMMODETYPE *pcm, std::string direction); void UpdateAttenuation(); bool BadState() const { return !m_Initialized; }; diff --git a/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp b/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp index aa3a8bdfd8..fa7696cad9 100644 --- a/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp +++ b/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp @@ -278,28 +278,28 @@ void COMXAudioCodecOMX::Reset() m_iBufferOutputUsed = 0; } -int COMXAudioCodecOMX::GetChannels() +int COMXAudioCodecOMX::GetChannels() const { if (!m_pCodecContext) return 0; return m_pCodecContext->channels; } -int COMXAudioCodecOMX::GetSampleRate() +int COMXAudioCodecOMX::GetSampleRate() const { if (!m_pCodecContext) return 0; return m_pCodecContext->sample_rate; } -int COMXAudioCodecOMX::GetBitsPerSample() +int COMXAudioCodecOMX::GetBitsPerSample() const { if (!m_pCodecContext) return 0; return m_desiredSampleFormat == AV_SAMPLE_FMT_S16 ? 16 : 32; } -int COMXAudioCodecOMX::GetBitRate() +int COMXAudioCodecOMX::GetBitRate() const { if (!m_pCodecContext) return 0; diff --git a/xbmc/cores/omxplayer/OMXAudioCodecOMX.h b/xbmc/cores/omxplayer/OMXAudioCodecOMX.h index 7a8bf739d7..5b38b7142a 100644 --- a/xbmc/cores/omxplayer/OMXAudioCodecOMX.h +++ b/xbmc/cores/omxplayer/OMXAudioCodecOMX.h @@ -31,14 +31,14 @@ public: int Decode(unsigned char* pData, int iSize, double dts, double pts); int GetData(unsigned char** dst, double &dts, double &pts); void Reset(); - int GetChannels(); + int GetChannels() const; void BuildChannelMap(); CAEChannelInfo GetChannelMap(); - int GetSampleRate(); - int GetBitsPerSample(); + int GetSampleRate() const; + int GetBitsPerSample() const; static const char* GetName() { return "FFmpeg"; } - int GetBitRate(); - unsigned int GetFrameSize() { return m_frameSize; } + int GetBitRate() const; + unsigned int GetFrameSize() const { return m_frameSize; } protected: CProcessInfo &m_processInfo; diff --git a/xbmc/cores/omxplayer/OMXImage.h b/xbmc/cores/omxplayer/OMXImage.h index dcbebd8a80..55c85bd6a8 100644 --- a/xbmc/cores/omxplayer/OMXImage.h +++ b/xbmc/cores/omxplayer/OMXImage.h @@ -81,12 +81,12 @@ public: COMXImageFile(); virtual ~COMXImageFile(); bool ReadFile(const std::string& inputFile, int orientation = 0); - int GetOrientation() { return m_orientation; }; - unsigned int GetWidth() { return m_width; }; - unsigned int GetHeight() { return m_height; }; - unsigned long GetImageSize() { return m_image_size; }; - const uint8_t *GetImageBuffer() { return (const uint8_t *)m_image_buffer; }; - const char *GetFilename() { return m_filename.c_str(); }; + int GetOrientation() const { return m_orientation; }; + unsigned int GetWidth() const { return m_width; }; + unsigned int GetHeight() const { return m_height; }; + unsigned long GetImageSize() const { return m_image_size; }; + const uint8_t *GetImageBuffer() const { return (const uint8_t *)m_image_buffer; }; + const char *GetFilename() const { return m_filename.c_str(); }; protected: OMX_IMAGE_CODINGTYPE GetCodingType(unsigned int &width, unsigned int &height, int orientation); uint8_t *m_image_buffer; @@ -106,9 +106,9 @@ public: // Required overrides void Close(); bool Decode(const uint8_t *data, unsigned size, unsigned int width, unsigned int height, unsigned stride, void *pixels); - unsigned int GetDecodedWidth() { return (unsigned int)m_decoded_format.format.image.nFrameWidth; }; - unsigned int GetDecodedHeight() { return (unsigned int)m_decoded_format.format.image.nFrameHeight; }; - unsigned int GetDecodedStride() { return (unsigned int)m_decoded_format.format.image.nStride; }; + unsigned int GetDecodedWidth() const { return (unsigned int)m_decoded_format.format.image.nFrameWidth; }; + unsigned int GetDecodedHeight() const { return (unsigned int)m_decoded_format.format.image.nFrameHeight; }; + unsigned int GetDecodedStride() const { return (unsigned int)m_decoded_format.format.image.nStride; }; protected: bool HandlePortSettingChange(unsigned int resize_width, unsigned int resize_height, unsigned int resize_stride); // Components diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp index c3bb5377c1..93f41e7491 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp @@ -310,6 +310,13 @@ void OMXPlayerVideo::Output(double pts, bool bDropPacket) omvb->m_state = MMAL::MMALStateBypass; picture.videoBuffer = omvb; + if (m_processInfo.GetVideoStereoMode() != GetStereoMode()) + { + m_processInfo.SetVideoStereoMode(picture.stereoMode); + // signal about changes in video parameters + m_messageParent.Put(new CDVDMsg(CDVDMsg::PLAYER_AVCHANGE)); + } + m_renderManager.AddVideoPicture(picture, m_bAbortOutput, EINTERLACEMETHOD::VS_INTERLACEMETHOD_NONE, (m_syncState == ESyncState::SYNC_STARTING)); } @@ -662,20 +669,20 @@ void OMXPlayerVideo::SetVideoRect(const CRect &InSrcRect, const CRect &InDestRec if (stereoMode == "left_right") { - video_stereo_mode = RENDER_STEREO_MODE_SPLIT_HORIZONTAL; + video_stereo_mode = RENDER_STEREO_MODE_SPLIT_VERTICAL; } else if (stereoMode == "right_left") { - video_stereo_mode = RENDER_STEREO_MODE_SPLIT_HORIZONTAL; + video_stereo_mode = RENDER_STEREO_MODE_SPLIT_VERTICAL; stereo_invert = true; } else if (stereoMode == "top_bottom") { - video_stereo_mode = RENDER_STEREO_MODE_SPLIT_VERTICAL; + video_stereo_mode = RENDER_STEREO_MODE_SPLIT_HORIZONTAL; } else if (stereoMode == "bottom_top") { - video_stereo_mode = RENDER_STEREO_MODE_SPLIT_VERTICAL; + video_stereo_mode = RENDER_STEREO_MODE_SPLIT_HORIZONTAL; stereo_invert = true; } diff --git a/xbmc/cores/omxplayer/OMXVideo.h b/xbmc/cores/omxplayer/OMXVideo.h index ce0facb317..f741a7d66d 100644 --- a/xbmc/cores/omxplayer/OMXVideo.h +++ b/xbmc/cores/omxplayer/OMXVideo.h @@ -55,7 +55,7 @@ public: int Decode(uint8_t *pData, int iSize, double dts, double pts, bool &settings_changed); void Reset(void); void SetDropState(bool bDrop); - std::string GetDecoderName() { return m_video_codec_name; }; + std::string GetDecoderName() const { return m_video_codec_name; }; void SetVideoRect(const CRect& SrcRect, const CRect& DestRect, RENDER_STEREO_MODE video_mode, RENDER_STEREO_MODE display_mode, bool stereo_invert); int GetInputBufferSize(); bool GetPlayerInfo(double &match, double &phase, double &pll); diff --git a/xbmc/interfaces/legacy/ModuleXbmcvfs.h b/xbmc/interfaces/legacy/ModuleXbmcvfs.h index c4576e65fc..3e4f2508aa 100644 --- a/xbmc/interfaces/legacy/ModuleXbmcvfs.h +++ b/xbmc/interfaces/legacy/ModuleXbmcvfs.h @@ -74,7 +74,7 @@ namespace XBMCAddon /// .. /// ~~~~~~~~~~~~~ /// - deleteFile(...); + delete(...); #else bool deleteFile(const String& file); #endif diff --git a/xbmc/interfaces/legacy/Stat.h b/xbmc/interfaces/legacy/Stat.h index 5eace1da38..9b857395ca 100644 --- a/xbmc/interfaces/legacy/Stat.h +++ b/xbmc/interfaces/legacy/Stat.h @@ -160,13 +160,13 @@ namespace XBMCAddon #ifdef DOXYGEN_SHOULD_USE_THIS /// /// \ingroup python_stat - /// @brief \python_func{ atime() } + /// @brief \python_func{ st_atime() } ///----------------------------------------------------------------------- /// To get time of last access. /// /// @return st_atime /// - atime(); + st_atime(); #else inline long long atime() { return st.st_atime; }; //names st_atime/st_mtime/st_ctime are used by sys/stat.h #endif @@ -174,13 +174,13 @@ namespace XBMCAddon #ifdef DOXYGEN_SHOULD_USE_THIS /// /// \ingroup python_stat - /// @brief \python_func{ mtime() } + /// @brief \python_func{ st_mtime() } ///----------------------------------------------------------------------- /// To get time of last modification. /// /// @return st_mtime /// - mtime(); + st_mtime(); #else inline long long mtime() { return st.st_mtime; }; #endif @@ -188,13 +188,13 @@ namespace XBMCAddon #ifdef DOXYGEN_SHOULD_USE_THIS /// /// \ingroup python_stat - /// @brief \python_func{ ctime() } + /// @brief \python_func{ st_ctime() } ///----------------------------------------------------------------------- /// To get time of last status change. /// /// @return st_ctime /// - ctime(); + st_ctime(); #else inline long long ctime() { return st.st_ctime; }; #endif diff --git a/xbmc/listproviders/DirectoryProvider.cpp b/xbmc/listproviders/DirectoryProvider.cpp index b7273209b8..7fcaf8b52c 100644 --- a/xbmc/listproviders/DirectoryProvider.cpp +++ b/xbmc/listproviders/DirectoryProvider.cpp @@ -255,7 +255,8 @@ void CDirectoryProvider::Announce(ANNOUNCEMENT::AnnouncementFlag flag, const cha if (strcmp(message, "OnScanFinished") == 0 || strcmp(message, "OnCleanFinished") == 0 || strcmp(message, "OnUpdate") == 0 || - strcmp(message, "OnRemove") == 0) + strcmp(message, "OnRemove") == 0 || + strcmp(message, "OnRefresh") == 0) m_updateState = INVALIDATED; } } diff --git a/xbmc/platform/darwin/DarwinUtils.mm b/xbmc/platform/darwin/DarwinUtils.mm index 75a5559c3f..854f7267d2 100644 --- a/xbmc/platform/darwin/DarwinUtils.mm +++ b/xbmc/platform/darwin/DarwinUtils.mm @@ -81,16 +81,23 @@ enum iosPlatform iPhoneSE, iPhone7, iPhone8, + iPhoneXR, iPadAir2Wifi, iPadAir2Cellular, iPadPro9_7InchWifi, iPadPro9_7InchCellular, + iPad6thGeneration9_7InchWifi, + iPad6thGeneration9_7InchCellular, iPadPro12_9InchWifi, iPadPro12_9InchCellular, iPadPro2_12_9InchWifi, iPadPro2_12_9InchCellular, + iPadPro3_12_9InchWifi, + iPadPro3_12_9InchCellular, iPadPro_10_5InchWifi, iPadPro_10_5InchCellular, + iPadPro11InchWifi, + iPadPro11InchCellular, iPadMini3Wifi, iPadMini3Cellular, iPadMini4Wifi, @@ -100,6 +107,8 @@ enum iosPlatform iPhone7Plus, iPhone8Plus, iPhoneX, + iPhoneXS, + iPhoneXSMax, }; // platform strings are based on http://theiphonewiki.com/wiki/Models @@ -163,6 +172,9 @@ enum iosPlatform getIosPlatform() else if (devStr == "iPhone10,4") eDev = iPhone8; else if (devStr == "iPhone10,5") eDev = iPhone8Plus; else if (devStr == "iPhone10,6") eDev = iPhoneX; + else if (devStr == "iPhone11,2") eDev = iPhoneXS; + else if (devStr == "iPhone11,6") eDev = iPhoneXSMax; + else if (devStr == "iPhone11,8") eDev = iPhoneXR; else if (devStr == "iPod1,1") eDev = iPodTouch1G; else if (devStr == "iPod2,1") eDev = iPodTouch2G; else if (devStr == "iPod3,1") eDev = iPodTouch3G; @@ -207,6 +219,16 @@ enum iosPlatform getIosPlatform() else if (devStr == "iPad7,2") eDev = iPadPro2_12_9InchCellular; else if (devStr == "iPad7,3") eDev = iPadPro_10_5InchWifi; else if (devStr == "iPad7,4") eDev = iPadPro_10_5InchCellular; + else if (devStr == "iPad7,5") eDev = iPad6thGeneration9_7InchWifi; + else if (devStr == "iPad7,6") eDev = iPad6thGeneration9_7InchCellular; + else if (devStr == "iPad8,1") eDev = iPadPro11InchWifi; + else if (devStr == "iPad8,2") eDev = iPadPro11InchWifi; + else if (devStr == "iPad8,3") eDev = iPadPro11InchCellular; + else if (devStr == "iPad8,4") eDev = iPadPro11InchCellular; + else if (devStr == "iPad8,5") eDev = iPadPro3_12_9InchWifi; + else if (devStr == "iPad8,6") eDev = iPadPro3_12_9InchWifi; + else if (devStr == "iPad8,7") eDev = iPadPro3_12_9InchCellular; + else if (devStr == "iPad8,8") eDev = iPadPro3_12_9InchCellular; else if (devStr == "AppleTV2,1") eDev = AppleTV2; else if (devStr == "AppleTV5,3") eDev = AppleTV4; else if (devStr == "AppleTV6,2") eDev = AppleTV4K; diff --git a/xbmc/platform/darwin/ios/Info.plist.in b/xbmc/platform/darwin/ios/Info.plist.in index 9408ec57bc..c43a0e89ac 100644 --- a/xbmc/platform/darwin/ios/Info.plist.in +++ b/xbmc/platform/darwin/ios/Info.plist.in @@ -74,65 +74,176 @@ <key>UILaunchImages</key> <array> <dict> + <key>UILaunchImageOrientation</key> + <string>Portrait</string> + <key>UILaunchImageName</key> + <string>LaunchImage-1200-Portrait-2224h</string> <key>UILaunchImageSize</key> - <string>{375, 667}</string> + <string>{834, 1112}</string> + <key>UILaunchImageMinimumOSVersion</key> + <string>12.0</string> + </dict> + <dict> + <key>UILaunchImageOrientation</key> + <string>Landscape</string> <key>UILaunchImageName</key> - <string>Default-667h</string> + <string>LaunchImage-1200-Landscape-2224h</string> + <key>UILaunchImageSize</key> + <string>{834, 1112}</string> <key>UILaunchImageMinimumOSVersion</key> - <string>8.0</string> + <string>12.0</string> + </dict> + <dict> <key>UILaunchImageOrientation</key> <string>Portrait</string> + <key>UILaunchImageName</key> + <string>LaunchImage-1200-Portrait-2388h</string> + <key>UILaunchImageSize</key> + <string>{834, 1194}</string> + <key>UILaunchImageMinimumOSVersion</key> + <string>12.0</string> </dict> <dict> + <key>UILaunchImageOrientation</key> + <string>Landscape</string> + <key>UILaunchImageName</key> + <string>LaunchImage-1200-Landscape-2388h</string> <key>UILaunchImageSize</key> - <string>{414, 736}</string> + <string>{834, 1194}</string> + <key>UILaunchImageMinimumOSVersion</key> + <string>12.0</string> + </dict> + + <dict> + <key>UILaunchImageOrientation</key> + <string>Portrait</string> + <key>UILaunchImageName</key> + <string>LaunchImage-1200-Portrait-2688h</string> + <key>UILaunchImageSize</key> + <string>{414, 896}</string> + <key>UILaunchImageMinimumOSVersion</key> + <string>12.0</string> + </dict> + <dict> + <key>UILaunchImageOrientation</key> + <string>Landscape</string> <key>UILaunchImageName</key> - <string>Default-736h</string> + <string>LaunchImage-1200-Landscape-2688h</string> + <key>UILaunchImageSize</key> + <string>{414, 896}</string> <key>UILaunchImageMinimumOSVersion</key> - <string>8.0</string> + <string>12.0</string> + </dict> + <dict> <key>UILaunchImageOrientation</key> <string>Portrait</string> + <key>UILaunchImageName</key> + <string>LaunchImage-1200-Portrait-1792h</string> + <key>UILaunchImageSize</key> + <string>{414, 896}</string> + <key>UILaunchImageMinimumOSVersion</key> + <string>12.0</string> </dict> <dict> + <key>UILaunchImageOrientation</key> + <string>Landscape</string> + <key>UILaunchImageName</key> + <string>LaunchImage-1200-Landscape-1792h</string> <key>UILaunchImageSize</key> - <string>{414, 736}</string> + <string>{414, 896}</string> + <key>UILaunchImageMinimumOSVersion</key> + <string>12.0</string> + </dict> + <dict> + <key>UILaunchImageOrientation</key> + <string>Portrait</string> <key>UILaunchImageName</key> - <string>Default-Landscape-736h</string> + <string>LaunchImage-1100-Portrait-2436h</string> + <key>UILaunchImageSize</key> + <string>{375, 812}</string> <key>UILaunchImageMinimumOSVersion</key> - <string>8.0</string> + <string>11.0</string> + </dict> + <dict> <key>UILaunchImageOrientation</key> <string>Landscape</string> + <key>UILaunchImageName</key> + <string>LaunchImage-1100-Landscape-2436h</string> + <key>UILaunchImageSize</key> + <string>{375, 812}</string> + <key>UILaunchImageMinimumOSVersion</key> + <string>11.0</string> </dict> <dict> + <key>UILaunchImageOrientation</key> + <string>Portrait</string> + <key>UILaunchImageName</key> + <string>LaunchImage-800-Portrait-736h</string> <key>UILaunchImageSize</key> - <string>{320, 568}</string> + <string>{414, 736}</string> + <key>UILaunchImageMinimumOSVersion</key> + <string>8.0</string> + </dict> + <dict> + <key>UILaunchImageOrientation</key> + <string>Landscape</string> <key>UILaunchImageName</key> - <string>Default-568h</string> + <string>LaunchImage-800-Landscape-736h</string> + <key>UILaunchImageSize</key> + <string>{414, 736}</string> <key>UILaunchImageMinimumOSVersion</key> <string>8.0</string> + </dict> + <dict> + <key>UILaunchImageOrientation</key> + <string>Portrait</string> + <key>UILaunchImageName</key> + <string>LaunchImage-800-667h</string> + <key>UILaunchImageSize</key> + <string>{375, 667}</string> + <key>UILaunchImageMinimumOSVersion</key> + <string>8.0</string> + </dict> + <dict> + <key>UILaunchImageOrientation</key> + <string>Portrait</string> + <key>UILaunchImageName</key> + <string>LaunchImage-700</string> + <key>UILaunchImageSize</key> + <string>{320, 480}</string> + <key>UILaunchImageMinimumOSVersion</key> + <string>7.0</string> + </dict> + <dict> + <key>UILaunchImageOrientation</key> + <string>Portrait</string> + <key>UILaunchImageName</key> + <string>LaunchImage-700-568h</string> + <key>UILaunchImageSize</key> + <string>{320, 568}</string> + <key>UILaunchImageMinimumOSVersion</key> + <string>7.0</string> + </dict> + <dict> <key>UILaunchImageOrientation</key> <string>Portrait</string> + <key>UILaunchImageName</key> + <string>LaunchImage-700-Portrait</string> + <key>UILaunchImageSize</key> + <string>{768, 1024}</string> + <key>UILaunchImageMinimumOSVersion</key> + <string>7.0</string> + </dict> + <dict> + <key>UILaunchImageOrientation</key> + <string>Landscape</string> + <key>UILaunchImageName</key> + <string>LaunchImage-700-Landscape</string> + <key>UILaunchImageSize</key> + <string>{768, 1024}</string> + <key>UILaunchImageMinimumOSVersion</key> + <string>7.0</string> </dict> - <dict> - <key>UILaunchImageSize</key> - <string>{375, 812}</string> - <key>UILaunchImageName</key> - <string>Default-812h</string> - <key>UILaunchImageMinimumOSVersion</key> - <string>9.0</string> - <key>UILaunchImageOrientation</key> - <string>Portrait</string> - </dict> - <dict> - <key>UILaunchImageSize</key> - <string>{375, 812}</string> - <key>UILaunchImageName</key> - <string>Default-Landscape-812h</string> - <key>UILaunchImageMinimumOSVersion</key> - <string>9.0</string> - <key>UILaunchImageOrientation</key> - <string>Landscape</string> - </dict> </array> <key>UIDeviceFamily</key> <array> diff --git a/xbmc/platform/darwin/ios/Default-Landscape-812h@3x.png b/xbmc/platform/darwin/ios/LaunchImage-1100-Landscape-2436h@3x.png Binary files differindex b05f0a8a5a..b05f0a8a5a 100644 --- a/xbmc/platform/darwin/ios/Default-Landscape-812h@3x.png +++ b/xbmc/platform/darwin/ios/LaunchImage-1100-Landscape-2436h@3x.png diff --git a/xbmc/platform/darwin/ios/Default-812h@3x.png b/xbmc/platform/darwin/ios/LaunchImage-1100-Portrait-2436h@3x.png Binary files differindex 3248694b67..3248694b67 100644 --- a/xbmc/platform/darwin/ios/Default-812h@3x.png +++ b/xbmc/platform/darwin/ios/LaunchImage-1100-Portrait-2436h@3x.png diff --git a/xbmc/platform/darwin/ios/LaunchImage-1200-Landscape-1792h@2x.png b/xbmc/platform/darwin/ios/LaunchImage-1200-Landscape-1792h@2x.png Binary files differnew file mode 100644 index 0000000000..e19f744f10 --- /dev/null +++ b/xbmc/platform/darwin/ios/LaunchImage-1200-Landscape-1792h@2x.png diff --git a/xbmc/platform/darwin/ios/LaunchImage-1200-Landscape-2224h@2x.png b/xbmc/platform/darwin/ios/LaunchImage-1200-Landscape-2224h@2x.png Binary files differnew file mode 100644 index 0000000000..b546b2cd6a --- /dev/null +++ b/xbmc/platform/darwin/ios/LaunchImage-1200-Landscape-2224h@2x.png diff --git a/xbmc/platform/darwin/ios/LaunchImage-1200-Landscape-2388h@2x.png b/xbmc/platform/darwin/ios/LaunchImage-1200-Landscape-2388h@2x.png Binary files differnew file mode 100644 index 0000000000..cf94b66656 --- /dev/null +++ b/xbmc/platform/darwin/ios/LaunchImage-1200-Landscape-2388h@2x.png diff --git a/xbmc/platform/darwin/ios/LaunchImage-1200-Landscape-2688h@3x.png b/xbmc/platform/darwin/ios/LaunchImage-1200-Landscape-2688h@3x.png Binary files differnew file mode 100644 index 0000000000..c5b455355f --- /dev/null +++ b/xbmc/platform/darwin/ios/LaunchImage-1200-Landscape-2688h@3x.png diff --git a/xbmc/platform/darwin/ios/LaunchImage-1200-Portrait-1792h@2x.png b/xbmc/platform/darwin/ios/LaunchImage-1200-Portrait-1792h@2x.png Binary files differnew file mode 100644 index 0000000000..a7f64cd697 --- /dev/null +++ b/xbmc/platform/darwin/ios/LaunchImage-1200-Portrait-1792h@2x.png diff --git a/xbmc/platform/darwin/ios/LaunchImage-1200-Portrait-2224h@2x.png b/xbmc/platform/darwin/ios/LaunchImage-1200-Portrait-2224h@2x.png Binary files differnew file mode 100644 index 0000000000..f477575770 --- /dev/null +++ b/xbmc/platform/darwin/ios/LaunchImage-1200-Portrait-2224h@2x.png diff --git a/xbmc/platform/darwin/ios/LaunchImage-1200-Portrait-2388h@2x.png b/xbmc/platform/darwin/ios/LaunchImage-1200-Portrait-2388h@2x.png Binary files differnew file mode 100644 index 0000000000..98c79b7389 --- /dev/null +++ b/xbmc/platform/darwin/ios/LaunchImage-1200-Portrait-2388h@2x.png diff --git a/xbmc/platform/darwin/ios/LaunchImage-1200-Portrait-2688h@3x.png b/xbmc/platform/darwin/ios/LaunchImage-1200-Portrait-2688h@3x.png Binary files differnew file mode 100644 index 0000000000..77c55d7c5e --- /dev/null +++ b/xbmc/platform/darwin/ios/LaunchImage-1200-Portrait-2688h@3x.png diff --git a/xbmc/platform/darwin/ios/Default-568h@2x.png b/xbmc/platform/darwin/ios/LaunchImage-568h@2x.png Binary files differindex 7dcb0e7125..7dcb0e7125 100644 --- a/xbmc/platform/darwin/ios/Default-568h@2x.png +++ b/xbmc/platform/darwin/ios/LaunchImage-568h@2x.png diff --git a/xbmc/platform/darwin/ios/LaunchImage-700-568h@2x.png b/xbmc/platform/darwin/ios/LaunchImage-700-568h@2x.png Binary files differnew file mode 100644 index 0000000000..7dcb0e7125 --- /dev/null +++ b/xbmc/platform/darwin/ios/LaunchImage-700-568h@2x.png diff --git a/xbmc/platform/darwin/ios/LaunchImage-700-Landscape@2x~ipad.png b/xbmc/platform/darwin/ios/LaunchImage-700-Landscape@2x~ipad.png Binary files differnew file mode 100644 index 0000000000..a344aba267 --- /dev/null +++ b/xbmc/platform/darwin/ios/LaunchImage-700-Landscape@2x~ipad.png diff --git a/xbmc/platform/darwin/ios/LaunchImage-700-Portrait@2x~ipad.png b/xbmc/platform/darwin/ios/LaunchImage-700-Portrait@2x~ipad.png Binary files differnew file mode 100644 index 0000000000..93e9e7ea58 --- /dev/null +++ b/xbmc/platform/darwin/ios/LaunchImage-700-Portrait@2x~ipad.png diff --git a/xbmc/platform/darwin/ios/LaunchImage-700@2x.png b/xbmc/platform/darwin/ios/LaunchImage-700@2x.png Binary files differnew file mode 100644 index 0000000000..d93013028d --- /dev/null +++ b/xbmc/platform/darwin/ios/LaunchImage-700@2x.png diff --git a/xbmc/platform/darwin/ios/Default-667h@2x.png b/xbmc/platform/darwin/ios/LaunchImage-800-667h@2x.png Binary files differindex 57a786dcd7..57a786dcd7 100644 --- a/xbmc/platform/darwin/ios/Default-667h@2x.png +++ b/xbmc/platform/darwin/ios/LaunchImage-800-667h@2x.png diff --git a/xbmc/platform/darwin/ios/Default-Landscape-736h@3x.png b/xbmc/platform/darwin/ios/LaunchImage-800-Landscape-736h@3x.png Binary files differindex e99ea0a070..e99ea0a070 100644 --- a/xbmc/platform/darwin/ios/Default-Landscape-736h@3x.png +++ b/xbmc/platform/darwin/ios/LaunchImage-800-Landscape-736h@3x.png diff --git a/xbmc/platform/darwin/ios/Default-736h@3x.png b/xbmc/platform/darwin/ios/LaunchImage-800-Portrait-736h@3x.png Binary files differindex b1cc794440..f3049c2b58 100644 --- a/xbmc/platform/darwin/ios/Default-736h@3x.png +++ b/xbmc/platform/darwin/ios/LaunchImage-800-Portrait-736h@3x.png diff --git a/xbmc/platform/darwin/ios/LaunchImage-Landscape@2x~ipad.png b/xbmc/platform/darwin/ios/LaunchImage-Landscape@2x~ipad.png Binary files differnew file mode 100644 index 0000000000..a344aba267 --- /dev/null +++ b/xbmc/platform/darwin/ios/LaunchImage-Landscape@2x~ipad.png diff --git a/xbmc/platform/darwin/ios/LaunchImage-Portrait@2x~ipad.png b/xbmc/platform/darwin/ios/LaunchImage-Portrait@2x~ipad.png Binary files differnew file mode 100644 index 0000000000..00fedc6dc0 --- /dev/null +++ b/xbmc/platform/darwin/ios/LaunchImage-Portrait@2x~ipad.png diff --git a/xbmc/platform/darwin/ios/LaunchImage@2x.png b/xbmc/platform/darwin/ios/LaunchImage@2x.png Binary files differnew file mode 100644 index 0000000000..d93013028d --- /dev/null +++ b/xbmc/platform/darwin/ios/LaunchImage@2x.png diff --git a/xbmc/platform/linux/input/LibInputHandler.cpp b/xbmc/platform/linux/input/LibInputHandler.cpp index c7dbac7d43..d2e93d308b 100644 --- a/xbmc/platform/linux/input/LibInputHandler.cpp +++ b/xbmc/platform/linux/input/LibInputHandler.cpp @@ -181,6 +181,9 @@ void CLibInputHandler::ProcessEvent(libinput_event *ev) case LIBINPUT_EVENT_POINTER_MOTION: m_pointer->ProcessMotion(libinput_event_get_pointer_event(ev)); break; + case LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE: + m_pointer->ProcessMotionAbsolute(libinput_event_get_pointer_event(ev)); + break; case LIBINPUT_EVENT_POINTER_AXIS: m_pointer->ProcessAxis(libinput_event_get_pointer_event(ev)); break; diff --git a/xbmc/platform/linux/input/LibInputPointer.cpp b/xbmc/platform/linux/input/LibInputPointer.cpp index 82c1a25471..591a5c6fd0 100644 --- a/xbmc/platform/linux/input/LibInputPointer.cpp +++ b/xbmc/platform/linux/input/LibInputPointer.cpp @@ -96,6 +96,23 @@ void CLibInputPointer::ProcessMotion(libinput_event_pointer *e) appPort->OnEvent(event); } +void CLibInputPointer::ProcessMotionAbsolute(libinput_event_pointer *e) +{ + m_pos.X = static_cast<int>(libinput_event_pointer_get_absolute_x_transformed(e, CServiceBroker::GetWinSystem()->GetGfxContext().GetWidth())); + m_pos.Y = static_cast<int>(libinput_event_pointer_get_absolute_y_transformed(e, CServiceBroker::GetWinSystem()->GetGfxContext().GetHeight())); + + XBMC_Event event; + event.type = XBMC_MOUSEMOTION; + event.motion.x = static_cast<uint16_t>(m_pos.X); + event.motion.y = static_cast<uint16_t>(m_pos.Y); + + CLog::Log(LOGDEBUG, "CLibInputPointer::%s - event.type: %i, event.motion.x: %i, event.motion.y: %i", __FUNCTION__, event.type, event.motion.x, event.motion.y); + + std::shared_ptr<CAppInboundProtocol> appPort = CServiceBroker::GetAppPort(); + if (appPort) + appPort->OnEvent(event); +} + void CLibInputPointer::ProcessAxis(libinput_event_pointer *e) { unsigned char scroll = 0; diff --git a/xbmc/platform/linux/input/LibInputPointer.h b/xbmc/platform/linux/input/LibInputPointer.h index aa7c8b90a3..608b438abe 100644 --- a/xbmc/platform/linux/input/LibInputPointer.h +++ b/xbmc/platform/linux/input/LibInputPointer.h @@ -24,6 +24,7 @@ public: void ProcessButton(libinput_event_pointer *e); void ProcessMotion(libinput_event_pointer *e); + void ProcessMotionAbsolute(libinput_event_pointer *e); void ProcessAxis(libinput_event_pointer *e); private: diff --git a/xbmc/rendering/dx/DeviceResources.cpp b/xbmc/rendering/dx/DeviceResources.cpp index 669c5e7682..bdb2fafc9c 100644 --- a/xbmc/rendering/dx/DeviceResources.cpp +++ b/xbmc/rendering/dx/DeviceResources.cpp @@ -195,13 +195,14 @@ bool DX::DeviceResources::SetFullScreen(bool fullscreen, RESOLUTION_INFO& res) critical_section::scoped_lock lock(m_criticalSection); - CLog::LogF(LOGDEBUG, "switching to/from fullscreen (%f x %f)", m_outputSize.Width, - m_outputSize.Height); - BOOL bFullScreen; - bool recreate = m_stereoEnabled != (CServiceBroker::GetWinSystem()->GetGfxContext().GetStereoMode() == RENDER_STEREO_MODE_HARDWAREBASED); - m_swapChain->GetFullscreenState(&bFullScreen, nullptr); + + CLog::LogF(LOGDEBUG, "switching from %s(%.0f x %.0f) to %s(%d x %d)", + bFullScreen ? "fullscreen " : "", m_outputSize.Width, m_outputSize.Height, + fullscreen ? "fullscreen " : "", res.iWidth, res.iHeight); + + bool recreate = m_stereoEnabled != (CServiceBroker::GetWinSystem()->GetGfxContext().GetStereoMode() == RENDER_STEREO_MODE_HARDWAREBASED); if (!!bFullScreen && !fullscreen) { CLog::LogF(LOGDEBUG, "switching to windowed"); @@ -257,7 +258,15 @@ bool DX::DeviceResources::SetFullScreen(bool fullscreen, RESOLUTION_INFO& res) recreate |= SUCCEEDED(m_swapChain->SetFullscreenState(true, pOutput.Get())); m_swapChain->GetFullscreenState(&bFullScreen, nullptr); } - recreate |= SUCCEEDED(m_swapChain->ResizeTarget(¤tMode)); + bool resized = SUCCEEDED(m_swapChain->ResizeTarget(¤tMode)); + if (resized) + { + // some system doesn't inform windowing about desktop size changes + // so we have to change output size before resizing buffers + m_outputSize.Width = static_cast<float>(currentMode.Width); + m_outputSize.Height = static_cast<float>(currentMode.Height); + } + recreate |= resized; } } if (!bFullScreen) @@ -276,7 +285,7 @@ bool DX::DeviceResources::SetFullScreen(bool fullscreen, RESOLUTION_INFO& res) CLog::LogF(LOGDEBUG, "switching done."); - return true; + return recreate; } // Configures resources that don't depend on the Direct3D device. @@ -516,16 +525,20 @@ void DX::DeviceResources::ResizeBuffers() DXGI_SWAP_CHAIN_DESC1 scDesc = { 0 }; if (m_swapChain) { + BOOL bFullcreen = 0; + m_swapChain->GetFullscreenState(&bFullcreen, nullptr); + if (!!bFullcreen) + { + windowed = false; + } + // check if swapchain needs to be recreated m_swapChain->GetDesc1(&scDesc); if ((scDesc.Stereo == TRUE) != bHWStereoEnabled) { // check fullscreen state and go to windowing if necessary - BOOL bFullcreen; - m_swapChain->GetFullscreenState(&bFullcreen, nullptr); if (!!bFullcreen) { - windowed = false; // will create fullscreen swapchain m_swapChain->SetFullscreenState(false, nullptr); // mandatory before releasing swapchain } @@ -544,7 +557,7 @@ void DX::DeviceResources::ResizeBuffers() lround(m_outputSize.Width), lround(m_outputSize.Height), scDesc.Format, - 0 + windowed ? 0 : DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH ); if (hr == DXGI_ERROR_DEVICE_REMOVED || hr == DXGI_ERROR_DEVICE_RESET) @@ -569,7 +582,7 @@ void DX::DeviceResources::ResizeBuffers() swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; swapChainDesc.BufferCount = 3 * (1 + bHWStereoEnabled); swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; - swapChainDesc.Flags = 0; + swapChainDesc.Flags = windowed ? 0 : DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH; swapChainDesc.AlphaMode = DXGI_ALPHA_MODE_IGNORE; swapChainDesc.SampleDesc.Count = 1; swapChainDesc.SampleDesc.Quality = 0; diff --git a/xbmc/rendering/gl/RenderSystemGL.cpp b/xbmc/rendering/gl/RenderSystemGL.cpp index 0d83f858e5..de26031bca 100644 --- a/xbmc/rendering/gl/RenderSystemGL.cpp +++ b/xbmc/rendering/gl/RenderSystemGL.cpp @@ -111,6 +111,9 @@ bool CRenderSystemGL::InitRenderSystem() bool CRenderSystemGL::ResetRenderSystem(int width, int height) { + if (!m_bRenderCreated) + return false; + m_width = width; m_height = height; diff --git a/xbmc/settings/DisplaySettings.cpp b/xbmc/settings/DisplaySettings.cpp index 55985f5f56..e1ffde9afe 100644 --- a/xbmc/settings/DisplaySettings.cpp +++ b/xbmc/settings/DisplaySettings.cpp @@ -566,6 +566,12 @@ void CDisplaySettings::UpdateCalibrations() } } +void CDisplaySettings::ClearCalibrations() +{ + CSingleLock lock(m_critical); + m_calibrations.clear(); +} + DisplayMode CDisplaySettings::GetCurrentDisplayMode() const { if (GetCurrentResolution() == RES_WINDOW) diff --git a/xbmc/settings/DisplaySettings.h b/xbmc/settings/DisplaySettings.h index 75160cb42d..d525c995d8 100644 --- a/xbmc/settings/DisplaySettings.h +++ b/xbmc/settings/DisplaySettings.h @@ -71,6 +71,7 @@ public: void ApplyCalibrations(); void UpdateCalibrations(); + void ClearCalibrations(); void ClearCustomResolutions(); float GetZoomAmount() const { return m_zoomAmount; } diff --git a/xbmc/settings/MediaSettings.cpp b/xbmc/settings/MediaSettings.cpp index 69d3888ae7..8cccd71c4d 100644 --- a/xbmc/settings/MediaSettings.cpp +++ b/xbmc/settings/MediaSettings.cpp @@ -17,14 +17,17 @@ #include "dialogs/GUIDialogFileBrowser.h" #include "settings/dialogs/GUIDialogLibExportSettings.h" #include "guilib/LocalizeStrings.h" +#include "interfaces/AnnouncementManager.h" #include "interfaces/builtins/Builtins.h" #include "music/MusicDatabase.h" #include "music/MusicLibraryQueue.h" #include "messaging/helpers/DialogHelper.h" +#include "ServiceBroker.h" #include "settings/lib/Setting.h" #include "settings/Settings.h" #include "storage/MediaManager.h" #include "threads/SingleLock.h" +#include "utils/log.h" #include "utils/StringUtils.h" #include "utils/XBMCTinyXML.h" #include "utils/XMLUtils.h" @@ -343,6 +346,15 @@ void CMediaSettings::OnSettingAction(std::shared_ptr<const CSetting> setting) } } +void CMediaSettings::OnSettingChanged(std::shared_ptr<const CSetting> setting) +{ + if (setting == nullptr) + return; + + if (setting->GetId() == CSettings::SETTING_VIDEOLIBRARY_SHOWUNWATCHEDPLOTS) + CServiceBroker::GetAnnouncementManager()->Announce(ANNOUNCEMENT::VideoLibrary, "xbmc", "OnRefresh"); +} + int CMediaSettings::GetWatchedMode(const std::string &content) const { CSingleLock lock(m_critical); diff --git a/xbmc/settings/MediaSettings.h b/xbmc/settings/MediaSettings.h index 3ab6302344..93f480359e 100644 --- a/xbmc/settings/MediaSettings.h +++ b/xbmc/settings/MediaSettings.h @@ -39,6 +39,7 @@ public: bool Save(TiXmlNode *settings) const override; void OnSettingAction(std::shared_ptr<const CSetting> setting) override; + void OnSettingChanged(std::shared_ptr<const CSetting> setting) override; void OnSettingsLoaded() override; const CVideoSettings& GetDefaultVideoSettings() const { return m_defaultVideoSettings; } diff --git a/xbmc/settings/SettingDateTime.h b/xbmc/settings/SettingDateTime.h index 73d1b78055..5d05fa4d73 100644 --- a/xbmc/settings/SettingDateTime.h +++ b/xbmc/settings/SettingDateTime.h @@ -10,6 +10,7 @@ #include "XBDateTime.h" #include "settings/lib/Setting.h" +#include "utils/TimeUtils.h" class CSettingDate : public CSettingString { @@ -40,5 +41,5 @@ public: bool CheckValidity(const std::string &value) const override; CDateTime GetTime() const { return CDateTime::FromDBTime(GetValue()); } - bool SetTime(const CDateTime& time) { return SetValue(time.GetAsDBTime()); } + bool SetTime(const CDateTime& time) { return SetValue(CTimeUtils::WithoutSeconds(time.GetAsDBTime())); } }; diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp index 432aa53550..9bba5402a1 100644 --- a/xbmc/settings/Settings.cpp +++ b/xbmc/settings/Settings.cpp @@ -833,6 +833,7 @@ void CSettings::InitializeISettingCallbacks() settingSet.insert(CSettings::SETTING_VIDEOLIBRARY_CLEANUP); settingSet.insert(CSettings::SETTING_VIDEOLIBRARY_IMPORT); settingSet.insert(CSettings::SETTING_VIDEOLIBRARY_EXPORT); + settingSet.insert(CSettings::SETTING_VIDEOLIBRARY_SHOWUNWATCHEDPLOTS); GetSettingsManager()->RegisterCallback(&CMediaSettings::GetInstance(), settingSet); settingSet.clear(); diff --git a/xbmc/settings/Settings.h b/xbmc/settings/Settings.h index 41698194d4..95baba2a7e 100644 --- a/xbmc/settings/Settings.h +++ b/xbmc/settings/Settings.h @@ -376,6 +376,7 @@ public: // values for SETTING_VIDEOLIBRARY_SHOWUNWATCHEDPLOTS static const int VIDEOLIBRARY_PLOTS_SHOW_UNWATCHED_MOVIES = 0; static const int VIDEOLIBRARY_PLOTS_SHOW_UNWATCHED_TVSHOWEPISODES = 1; + static const int VIDEOLIBRARY_THUMB_SHOW_UNWATCHED_EPISODE = 2; /*! \brief Creates a new settings wrapper around a new settings manager. diff --git a/xbmc/settings/windows/GUIControlSettings.cpp b/xbmc/settings/windows/GUIControlSettings.cpp index 78eb03691e..90d205bce1 100644 --- a/xbmc/settings/windows/GUIControlSettings.cpp +++ b/xbmc/settings/windows/GUIControlSettings.cpp @@ -648,14 +648,7 @@ bool CGUIControlButtonSetting::OnClick() SYSTEMTIME systemtime; settingTime->GetTime().GetAsSystemTime(systemtime); - /* TODO - if (value.size() >= 5) - { - // assumes HH:MM - systemtime.wHour = atoi(value.substr(0, 2).c_str()); - systemtime.wMinute = atoi(value.substr(3, 2).c_str()); - } - */ + if (CGUIDialogNumeric::ShowAndGetTime(systemtime, Localize(buttonControl->GetHeading()))) SetValid(settingTime->SetTime(CDateTime(systemtime))); } diff --git a/xbmc/utils/Screenshot.cpp b/xbmc/utils/Screenshot.cpp index 24580ed232..0616e24a18 100644 --- a/xbmc/utils/Screenshot.cpp +++ b/xbmc/utils/Screenshot.cpp @@ -234,33 +234,19 @@ void CScreenShot::TakeScreenshot(const std::string &filename, bool sync) void CScreenShot::TakeScreenshot() { - static bool savingScreenshots = false; - static std::vector<std::string> screenShots; - bool promptUser = false; - std::string strDir; - - // check to see if we have a screenshot folder yet std::shared_ptr<CSettingPath> screenshotSetting = std::static_pointer_cast<CSettingPath>(CServiceBroker::GetSettingsComponent()->GetSettings()->GetSetting(CSettings::SETTING_DEBUG_SCREENSHOTPATH)); - if (screenshotSetting != NULL) - { - strDir = screenshotSetting->GetValue(); - if (strDir.empty()) - { - if (CGUIControlButtonSetting::GetPath(screenshotSetting, &g_localizeStrings)) - strDir = screenshotSetting->GetValue(); - } - } + if (!screenshotSetting) + return; + std::string strDir = screenshotSetting->GetValue(); if (strDir.empty()) { - strDir = "special://temp/"; - if (!savingScreenshots) - { - promptUser = true; - savingScreenshots = true; - screenShots.clear(); - } + if (!CGUIControlButtonSetting::GetPath(screenshotSetting, &g_localizeStrings)) + return; + + strDir = screenshotSetting->GetValue(); } + URIUtils::RemoveSlashAtEnd(strDir); if (!strDir.empty()) @@ -270,32 +256,6 @@ void CScreenShot::TakeScreenshot() if (!file.empty()) { TakeScreenshot(file, false); - if (savingScreenshots) - screenShots.push_back(file); - if (promptUser) - { // grab the real directory - std::string newDir; - if (screenshotSetting != NULL) - { - newDir = screenshotSetting->GetValue(); - if (newDir.empty()) - { - if (CGUIControlButtonSetting::GetPath(screenshotSetting, &g_localizeStrings)) - newDir = screenshotSetting->GetValue(); - } - } - - if (!newDir.empty()) - { - for (unsigned int i = 0; i < screenShots.size(); i++) - { - std::string file = CUtil::GetNextFilename(URIUtils::AddFileToFolder(newDir, "screenshot%03d.png"), 999); - CFile::Copy(screenShots[i], file); - } - screenShots.clear(); - } - savingScreenshots = false; - } } else { diff --git a/xbmc/utils/SystemInfo.cpp b/xbmc/utils/SystemInfo.cpp index cf6519a4eb..df5e043a3a 100644 --- a/xbmc/utils/SystemInfo.cpp +++ b/xbmc/utils/SystemInfo.cpp @@ -1243,7 +1243,7 @@ std::string CSysInfo::GetVersion() std::string CSysInfo::GetBuildDate() { - return StringUtils::Format("%s", __DATE__); + return CCompileInfo::GetBuildDate(); } bool CSysInfo::HasVideoToolBoxDecoder() diff --git a/xbmc/utils/TimeUtils.cpp b/xbmc/utils/TimeUtils.cpp index 26a728d713..16d75b9fe6 100644 --- a/xbmc/utils/TimeUtils.cpp +++ b/xbmc/utils/TimeUtils.cpp @@ -94,3 +94,8 @@ CDateTime CTimeUtils::GetLocalTime(time_t time) return result; } + +std::string CTimeUtils::WithoutSeconds(const std::string hhmmss) +{ + return hhmmss.substr(0, 5); +} diff --git a/xbmc/utils/TimeUtils.h b/xbmc/utils/TimeUtils.h index 87ed08fccf..55e4de5a21 100644 --- a/xbmc/utils/TimeUtils.h +++ b/xbmc/utils/TimeUtils.h @@ -10,6 +10,7 @@ #include <stdint.h> #include <time.h> +#include <string> class CDateTime; @@ -19,10 +20,25 @@ int64_t CurrentHostFrequency(void); class CTimeUtils { public: - static void UpdateFrameTime(bool flip); ///< update the frame time. Not threadsafe - static unsigned int GetFrameTime(); ///< returns the frame time in MS. Not threadsafe + + /*! + * @brief Update the time frame + * @note Not threadsafe + */ + static void UpdateFrameTime(bool flip); + + /*! + * @brief Returns the frame time in MS + * @note Not threadsafe + */ + static unsigned int GetFrameTime(); static CDateTime GetLocalTime(time_t time); - + + /*! + * @brief Returns a time string without seconds, i.e: HH:MM + * @param hhmmss Time string in the format HH:MM:SS + */ + static std::string WithoutSeconds(const std::string hhmmss); private: static unsigned int frameTime; }; diff --git a/xbmc/video/VideoThumbLoader.cpp b/xbmc/video/VideoThumbLoader.cpp index 6000f65294..28dd92e477 100644 --- a/xbmc/video/VideoThumbLoader.cpp +++ b/xbmc/video/VideoThumbLoader.cpp @@ -24,6 +24,7 @@ #include "GUIUserMessages.h" #include "music/MusicDatabase.h" #include "settings/AdvancedSettings.h" +#include "settings/lib/Setting.h" #include "settings/Settings.h" #include "settings/SettingsComponent.h" #include "cores/VideoSettings.h" @@ -349,6 +350,19 @@ bool CVideoThumbLoader::LoadItemCached(CFileItem* pItem) SetArt(*pItem, artwork); } + // hide thumb if episode is unwatched + std::shared_ptr<CSettingList> setting(std::dynamic_pointer_cast<CSettingList>( + CServiceBroker::GetSettingsComponent()->GetSettings()->GetSetting(CSettings::SETTING_VIDEOLIBRARY_SHOWUNWATCHEDPLOTS))); + if (pItem->HasArt("thumb") && pItem->HasVideoInfoTag() && + pItem->GetVideoInfoTag()->m_type == MediaTypeEpisode && + pItem->GetVideoInfoTag()->GetPlayCount() == 0 && + setting && + !setting->FindIntInList(CSettings::VIDEOLIBRARY_THUMB_SHOW_UNWATCHED_EPISODE) + ) + { + pItem->SetArt("thumb", "OverlaySpoiler.png"); + } + m_videoDatabase->Close(); return true; diff --git a/xbmc/windowing/android/AndroidUtils.cpp b/xbmc/windowing/android/AndroidUtils.cpp index aee6065379..372fb71023 100644 --- a/xbmc/windowing/android/AndroidUtils.cpp +++ b/xbmc/windowing/android/AndroidUtils.cpp @@ -23,8 +23,12 @@ #include "windowing/GraphicContext.h" #include "utils/log.h" + #include "settings/Settings.h" +#include "settings/DisplaySettings.h" #include "settings/SettingsComponent.h" +#include "settings/lib/SettingsManager.h" + #include "ServiceBroker.h" #include "utils/StringUtils.h" #include "utils/SysfsUtils.h" @@ -118,6 +122,8 @@ static void fetchDisplayModes() } } +const std::string CAndroidUtils::SETTING_LIMITGUI = "videoscreen.limitgui"; + CAndroidUtils::CAndroidUtils() { std::string displaySize; @@ -153,7 +159,7 @@ CAndroidUtils::CAndroidUtils() } CLog::Log(LOGDEBUG, "CAndroidUtils: maximum/current resolution: %dx%d", m_width, m_height); - int limit = CServiceBroker::GetSettingsComponent()->GetSettings()->GetInt("videoscreen.limitgui"); + int limit = CServiceBroker::GetSettingsComponent()->GetSettings()->GetInt(CAndroidUtils::SETTING_LIMITGUI); switch (limit) { case 0: // auto @@ -181,6 +187,10 @@ CAndroidUtils::CAndroidUtils() break; } CLog::Log(LOGDEBUG, "CAndroidUtils: selected resolution: %dx%d", m_width, m_height); + + CServiceBroker::GetSettingsComponent()->GetSettings()->GetSettingsManager()->RegisterCallback(this, { + CAndroidUtils::SETTING_LIMITGUI + }); } CAndroidUtils::~CAndroidUtils() @@ -258,6 +268,7 @@ bool CAndroidUtils::ProbeResolutions(std::vector<RESOLUTION_INFO> &resolutions) { res.iWidth = std::min(res.iWidth, m_width); res.iHeight = std::min(res.iHeight, m_height); + res.iSubtitles = static_cast<int>(0.965 * res.iHeight); } resolutions.push_back(res); } @@ -302,3 +313,11 @@ bool CAndroidUtils::ProbeResolutions(std::vector<RESOLUTION_INFO> &resolutions) } return false; } + +void CAndroidUtils::OnSettingChanged(std::shared_ptr<const CSetting> setting) +{ + const std::string &settingId = setting->GetId(); + /* Calibration (overscan / subtitles) are based on GUI size -> reset required */ + if (settingId == CAndroidUtils::SETTING_LIMITGUI) + CDisplaySettings::GetInstance().ClearCalibrations(); +} diff --git a/xbmc/windowing/android/AndroidUtils.h b/xbmc/windowing/android/AndroidUtils.h index 23a5c3deb2..e006ff1f41 100644 --- a/xbmc/windowing/android/AndroidUtils.h +++ b/xbmc/windowing/android/AndroidUtils.h @@ -13,9 +13,10 @@ #include <androidjni/Display.h> +#include "settings/lib/ISettingCallback.h" #include "windowing/Resolution.h" -class CAndroidUtils +class CAndroidUtils : public ISettingCallback { public: CAndroidUtils(); @@ -24,6 +25,10 @@ public: virtual bool SetNativeResolution(const RESOLUTION_INFO &res); virtual bool ProbeResolutions(std::vector<RESOLUTION_INFO> &resolutions); + // Implementation of ISettingCallback + static const std::string SETTING_LIMITGUI; + void OnSettingChanged(std::shared_ptr<const CSetting> setting) override; + protected: mutable int m_width; mutable int m_height; diff --git a/xbmc/windowing/android/WinSystemAndroid.cpp b/xbmc/windowing/android/WinSystemAndroid.cpp index 986ffda373..d08e3e1cb2 100644 --- a/xbmc/windowing/android/WinSystemAndroid.cpp +++ b/xbmc/windowing/android/WinSystemAndroid.cpp @@ -170,9 +170,7 @@ void CWinSystemAndroid::UpdateResolutions() CServiceBroker::GetWinSystem()->GetGfxContext().ResetOverscan(resolutions[i]); CDisplaySettings::GetInstance().GetResolutionInfo(res_index) = resolutions[i]; - if(resDesktop.iWidth == resolutions[i].iWidth && - resDesktop.iHeight == resolutions[i].iHeight && - resDesktop.iScreenWidth == resolutions[i].iScreenWidth && + if (resDesktop.iScreenWidth == resolutions[i].iScreenWidth && resDesktop.iScreenHeight == resolutions[i].iScreenHeight && (resDesktop.dwFlags & D3DPRESENTFLAG_MODEMASK) == (resolutions[i].dwFlags & D3DPRESENTFLAG_MODEMASK) && fabs(resDesktop.fRefreshRate - resolutions[i].fRefreshRate) < FLT_EPSILON) diff --git a/xbmc/windowing/win10/WinSystemWin10.cpp b/xbmc/windowing/win10/WinSystemWin10.cpp index d2e2e8d90e..0ca1b684c9 100644 --- a/xbmc/windowing/win10/WinSystemWin10.cpp +++ b/xbmc/windowing/win10/WinSystemWin10.cpp @@ -119,11 +119,6 @@ bool CWinSystemWin10::CreateNewWindow(const std::string& name, bool fullScreen, // and hide UWP splash, without this the Kodi's splash will not be shown m_coreWindow.Dispatcher().ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending); - // in some cases CoreWindow::SizeChanged isn't fired - // it causes mismatch between window actual size and UI - winrt::Rect winRect = m_coreWindow.Bounds(); - dynamic_cast<CWinEventsWin10&>(*m_winEvents).OnResize(winRect.Width, winRect.Height); - return true; } @@ -209,10 +204,8 @@ bool CWinSystemWin10::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool bool forceChange = false; // resolution/display is changed but window state isn't changed bool stereoChange = IsStereoEnabled() != (CServiceBroker::GetWinSystem()->GetGfxContext().GetStereoMode() == RENDER_STEREO_MODE_HARDWAREBASED); - if ( m_nWidth != res.iWidth - || m_nHeight != res.iHeight - || m_fRefreshRate != res.fRefreshRate - || stereoChange) + if ( m_nWidth != res.iWidth || m_nHeight != res.iHeight || m_fRefreshRate != res.fRefreshRate || + stereoChange || m_bFirstResChange) { forceChange = true; } @@ -239,6 +232,7 @@ bool CWinSystemWin10::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool m_IsAlteringWindow = true; ReleaseBackBuffer(); + m_bFirstResChange = false; m_bFullScreen = fullScreen; m_nWidth = res.iWidth; m_nHeight = res.iHeight; @@ -348,6 +342,9 @@ bool CWinSystemWin10::ChangeResolution(const RESOLUTION_INFO& res, bool forceCha // changing display mode doesn't fire CoreWindow::SizeChanged event if (changed && m_bWindowCreated) { + // dispatch all events currently pending in the queue to change window's content + m_coreWindow.Dispatcher().ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending); + float dpi = DisplayInformation::GetForCurrentView().LogicalDpi(); float dipsW = DX::ConvertPixelsToDips(m_nWidth, dpi); float dipsH = DX::ConvertPixelsToDips(m_nHeight, dpi); diff --git a/xbmc/windowing/win10/WinSystemWin10.h b/xbmc/windowing/win10/WinSystemWin10.h index af3d7d3631..7e99e7e23c 100644 --- a/xbmc/windowing/win10/WinSystemWin10.h +++ b/xbmc/windowing/win10/WinSystemWin10.h @@ -143,6 +143,7 @@ protected: WINDOW_WINDOW_STATE m_windowState; // the state of the window when in windowed bool m_inFocus; bool m_bMinimized; + bool m_bFirstResChange = true; winrt::Windows::UI::Core::CoreWindow m_coreWindow = nullptr; }; diff --git a/xbmc/windowing/win10/WinSystemWin10DX.cpp b/xbmc/windowing/win10/WinSystemWin10DX.cpp index 928e57a4d0..2ac39b1d81 100644 --- a/xbmc/windowing/win10/WinSystemWin10DX.cpp +++ b/xbmc/windowing/win10/WinSystemWin10DX.cpp @@ -52,8 +52,7 @@ bool CWinSystemWin10DX::CreateNewWindow(const std::string& name, bool fullScreen if (CWinSystemWin10::CreateNewWindow(name, fullScreen, res) && m_deviceResources->HasValidDevice()) { CGenericTouchInputHandler::GetInstance().RegisterHandler(&CGenericTouchActionHandler::GetInstance()); - CGenericTouchInputHandler::GetInstance().SetScreenDPI(DX::DisplayMetrics::Dpi100); - ChangeResolution(res, true); + CGenericTouchInputHandler::GetInstance().SetScreenDPI(m_deviceResources->GetDpi()); return true; } return false; diff --git a/xbmc/windowing/windows/WinSystemWin32.cpp b/xbmc/windowing/windows/WinSystemWin32.cpp index 83d9de1269..7b2ae0331c 100644 --- a/xbmc/windowing/windows/WinSystemWin32.cpp +++ b/xbmc/windowing/windows/WinSystemWin32.cpp @@ -441,11 +441,8 @@ bool CWinSystemWin32::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool bool changeScreen = false; // display is changed bool stereoChange = IsStereoEnabled() != (CServiceBroker::GetWinSystem()->GetGfxContext().GetStereoMode() == RENDER_STEREO_MODE_HARDWAREBASED); - if ( m_nWidth != res.iWidth - || m_nHeight != res.iHeight - || m_fRefreshRate != res.fRefreshRate - || oldMonitor->hMonitor != newMonitor->hMonitor - || stereoChange) + if ( m_nWidth != res.iWidth || m_nHeight != res.iHeight || m_fRefreshRate != res.fRefreshRate || + oldMonitor->hMonitor != newMonitor->hMonitor || stereoChange || m_bFirstResChange) { if (oldMonitor->hMonitor != newMonitor->hMonitor) changeScreen = true; @@ -458,7 +455,8 @@ bool CWinSystemWin32::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool // entering to stereo mode, limit resolution to 1080p@23.976 if (stereoChange && !IsStereoEnabled() && res.iWidth > 1280) { - res = CDisplaySettings::GetInstance().GetResolutionInfo(CResolutionUtils::ChooseBestResolution(24.f / 1.001f, 1920, 1080, true)); + res = CDisplaySettings::GetInstance().GetResolutionInfo( + CResolutionUtils::ChooseBestResolution(24.f / 1.001f, 1920, 1080, true)); } if (m_state == WINDOW_STATE_WINDOWED) @@ -490,6 +488,7 @@ bool CWinSystemWin32::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool OnScreenChange(newMonitor->hMonitor); } + m_bFirstResChange = false; m_bFullScreen = fullScreen; m_hMonitor = newMonitor->hMonitor; m_nWidth = res.iWidth; diff --git a/xbmc/windowing/windows/WinSystemWin32.h b/xbmc/windowing/windows/WinSystemWin32.h index 5ee370ff35..39c218248d 100644 --- a/xbmc/windowing/windows/WinSystemWin32.h +++ b/xbmc/windowing/windows/WinSystemWin32.h @@ -185,7 +185,8 @@ protected: DWORD m_windowExStyle; // the ex style of the window bool m_inFocus; bool m_bMinimized; - bool m_bSizeMoveEnabled{ false }; + bool m_bSizeMoveEnabled = false; + bool m_bFirstResChange = true; std::unique_ptr<CIRServerSuite> m_irss; std::vector<MONITOR_DETAILS> m_displays; }; diff --git a/xbmc/windowing/windows/WinSystemWin32DX.cpp b/xbmc/windowing/windows/WinSystemWin32DX.cpp index 40e0ab5282..c84867e96a 100644 --- a/xbmc/windowing/windows/WinSystemWin32DX.cpp +++ b/xbmc/windowing/windows/WinSystemWin32DX.cpp @@ -100,7 +100,10 @@ bool CWinSystemWin32DX::DestroyRenderSystem() void CWinSystemWin32DX::SetDeviceFullScreen(bool fullScreen, RESOLUTION_INFO& res) { - m_deviceResources->SetFullScreen(fullScreen, res); + if (m_deviceResources->SetFullScreen(fullScreen, res)) + { + ResolutionChanged(); + } } bool CWinSystemWin32DX::ResizeWindow(int newWidth, int newHeight, int newLeft, int newTop) |