From 50558420a8fa128352378fc92c34b5342b685f9b Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Wed, 30 Nov 2016 22:16:21 +0000 Subject: [PATCH 01/11] libcec: bump to libcec-4.0.0-3 --- packages/devel/libcec/package.mk | 2 +- .../devel/libcec/patches/libcec-PR208.patch | 38 ------------------- 2 files changed, 1 insertion(+), 39 deletions(-) delete mode 100644 packages/devel/libcec/patches/libcec-PR208.patch diff --git a/packages/devel/libcec/package.mk b/packages/devel/libcec/package.mk index 08ecc5d9ff..b1a84e374f 100644 --- a/packages/devel/libcec/package.mk +++ b/packages/devel/libcec/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="libcec" -PKG_VERSION="6d68d21" +PKG_VERSION="209884d" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/devel/libcec/patches/libcec-PR208.patch b/packages/devel/libcec/patches/libcec-PR208.patch deleted file mode 100644 index 3dc5adf022..0000000000 --- a/packages/devel/libcec/patches/libcec-PR208.patch +++ /dev/null @@ -1,38 +0,0 @@ -From f70c4d76e1d9c0219a3927b6b66090b7575e7933 Mon Sep 17 00:00:00 2001 -From: Gerald Dachs -Date: Thu, 17 Mar 2016 12:12:51 +0100 -Subject: [PATCH] use system audio mode request instead of power on to start - AVR reliable - ---- - src/libcec/devices/CECBusDevice.cpp | 13 +++++++++---- - 1 file changed, 9 insertions(+), 4 deletions(-) - -diff --git a/src/libcec/devices/CECBusDevice.cpp b/src/libcec/devices/CECBusDevice.cpp -index 55939d1..e2d5ea3 100644 ---- a/src/libcec/devices/CECBusDevice.cpp -+++ b/src/libcec/devices/CECBusDevice.cpp -@@ -1025,14 +1025,19 @@ bool CCECBusDevice::ActivateSource(uint64_t iDelay /* = 0 */) - bool bReturn(true); - if (iDelay == 0) - { -- /** some AVRs fail to be powered up by the TV when it powers up. power up the AVR explicitly */ -+ /** send system audio mode request if AVR exists */ - if (m_iLogicalAddress != CECDEVICE_AUDIOSYSTEM) - { - CCECBusDevice* audioSystem(m_processor->GetDevice(CECDEVICE_AUDIOSYSTEM)); -- if (audioSystem && audioSystem->IsPresent() && audioSystem->GetPowerStatus(m_iLogicalAddress) != CEC_POWER_STATUS_ON) -+ if (audioSystem && audioSystem->IsPresent()) - { -- LIB_CEC->AddLog(CEC_LOG_DEBUG, "powering up the AVR"); -- audioSystem->PowerOn(m_iLogicalAddress); -+ cec_command command; -+ -+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "sending system audio mode request for '%s'", ToString(m_iLogicalAddress)); -+ cec_command::Format(command, m_iLogicalAddress, CECDEVICE_AUDIOSYSTEM, CEC_OPCODE_SYSTEM_AUDIO_MODE_REQUEST); -+ command.parameters.PushBack((uint8_t) ((m_iPhysicalAddress >> 8) & 0xFF)); -+ command.parameters.PushBack((uint8_t) (m_iPhysicalAddress & 0xFF)); -+ bReturn = m_handler->Transmit(command, false, false); - } - } - From 6f64dba14182b8536b094684851c6ec77da4bfcb Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Wed, 30 Nov 2016 22:16:21 +0000 Subject: [PATCH 02/11] libcec: remove, as no longer compatible with libcec --- .../libcec/libcec-100-from-xbian.patch | 1749 ----------------- 1 file changed, 1749 deletions(-) delete mode 100644 projects/imx6/patches/libcec/libcec-100-from-xbian.patch diff --git a/projects/imx6/patches/libcec/libcec-100-from-xbian.patch b/projects/imx6/patches/libcec/libcec-100-from-xbian.patch deleted file mode 100644 index fd30a83749..0000000000 --- a/projects/imx6/patches/libcec/libcec-100-from-xbian.patch +++ /dev/null @@ -1,1749 +0,0 @@ -From c7b9650dd936976ce150cf0b8233bacc1613c983 Mon Sep 17 00:00:00 2001 -From: Peter Vicman -Date: Sun, 10 Jul 2016 13:46:01 +0200 -Subject: [PATCH] patch for libcec from xbian - -libcec base: libcec-6d68d21 -libcec xbian: - https://github.com/xbianonpi/xbian-sources-libcec/tree/masterv3 2d231e5781a808cc7bcfaf65a69387e841c47652 ---- - debian/control | 5 +- - debian/libcec-dev.install | 1 + - debian/libcec3.install | 2 + - include/cec.h | 2 + - include/cectypes.h | 47 ++- - src/cec-client/CMakeLists.txt | 4 +- - src/cecc-client/cecc-client.c | 2 +- - src/libcec/CECClient.cpp | 12 +- - src/libcec/CECClient.h | 1 + - src/libcec/CECProcessor.cpp | 6 + - src/libcec/CECProcessor.h | 1 + - src/libcec/CECTypeUtils.h | 2 + - src/libcec/CMakeLists.txt | 22 +- - src/libcec/LibCEC.cpp | 5 + - src/libcec/LibCEC.h | 1 + - src/libcec/adapter/AdapterFactory.cpp | 27 +- - .../adapter/IMX/IMXCECAdapterCommunication.cpp | 381 +++++++++++++++++++++ - .../adapter/IMX/IMXCECAdapterCommunication.h | 139 ++++++++ - src/libcec/adapter/IMX/IMXCECAdapterDetection.cpp | 42 +++ - src/libcec/adapter/IMX/IMXCECAdapterDetection.h | 36 ++ - src/libcec/adapter/IMX/IMXCECAdapterMessageQueue.h | 118 +++++++ - src/libcec/adapter/IMX/mxc_hdmi-cec.h | 47 +++ - src/libcec/cmake/CheckPlatformSupport.cmake | 47 ++- - src/libcec/cmake/DisplayPlatformSupport.cmake | 6 + - src/libcec/cmake/LinkPlatformSupport.cmake | 7 +- - src/libcec/devices/CECBusDevice.cpp | 28 +- - src/libcec/devices/CECBusDevice.h | 2 + - src/libcec/env.h.in | 3 + - src/libcec/implementations/CECCommandHandler.cpp | 16 +- - src/libcec/implementations/CECCommandHandler.h | 6 +- - src/libcec/implementations/GRCommandHandler.cpp | 93 +++++ - src/libcec/implementations/GRCommandHandler.h | 53 +++ - support/git-rev.sh | 2 +- - 33 files changed, 1096 insertions(+), 70 deletions(-) - create mode 100644 src/libcec/adapter/IMX/IMXCECAdapterCommunication.cpp - create mode 100644 src/libcec/adapter/IMX/IMXCECAdapterCommunication.h - create mode 100644 src/libcec/adapter/IMX/IMXCECAdapterDetection.cpp - create mode 100644 src/libcec/adapter/IMX/IMXCECAdapterDetection.h - create mode 100644 src/libcec/adapter/IMX/IMXCECAdapterMessageQueue.h - create mode 100644 src/libcec/adapter/IMX/mxc_hdmi-cec.h - create mode 100644 src/libcec/implementations/GRCommandHandler.cpp - create mode 100644 src/libcec/implementations/GRCommandHandler.h - -diff --git a/debian/control b/debian/control -index e9335ef..c9fa004 100644 ---- a/debian/control -+++ b/debian/control -@@ -43,6 +43,7 @@ Description: libCEC communication Library (shared library) - Package: cec-utils - Architecture: any - Section: utils -+Replaces: xbian-package-cec - Depends: libcec3 (= ${binary:Version}), - ${shlibs:Depends}, - ${misc:Depends} -@@ -63,6 +64,8 @@ Description: Python bindings for libCEC - - Package: libcec - Architecture: any --Depends: ${shlibs:Depends}, ${misc:Depends}, libcec3 (= ${binary:Version}) -+Depends: ${shlibs:Depends}, ${misc:Depends}, libcec3 (= ${binary:Version}), python-libcec, cec-utils, libcec-dev -+Provides: xbian-package-cec -+Breaks: xbian-package-cec (<<10.0) - Description: Meta package libCEC. - -diff --git a/debian/libcec-dev.install b/debian/libcec-dev.install -index e5bbd96..15a3585 100644 ---- a/debian/libcec-dev.install -+++ b/debian/libcec-dev.install -@@ -1,3 +1,4 @@ - usr/include - usr/lib/pkgconfig - usr/lib/*/*.so -+usr/lib/p8-platform -diff --git a/debian/libcec3.install b/debian/libcec3.install -index ca5ebe3..ac5e50a 100644 ---- a/debian/libcec3.install -+++ b/debian/libcec3.install -@@ -1 +1,3 @@ - usr/lib/*/libcec.so.* -+usr/lib/libp*.a -+ -diff --git a/include/cec.h b/include/cec.h -index c5dc713..ea1454e 100644 ---- a/include/cec.h -+++ b/include/cec.h -@@ -408,6 +408,8 @@ namespace CEC - */ - virtual uint16_t GetAdapterProductId(void) const = 0; - -+ virtual bool TransmitSystemAudioModeRequest(void) = 0; -+ - virtual const char* ToString(const cec_menu_state state) = 0; - virtual const char* ToString(const cec_version version) = 0; - virtual const char* ToString(const cec_power_status status) = 0; -diff --git a/include/cectypes.h b/include/cectypes.h -index 0fdd48e..403c10b 100644 ---- a/include/cectypes.h -+++ b/include/cectypes.h -@@ -299,9 +299,19 @@ namespace CEC { - #define CEC_TDA995x_VIRTUAL_COM "CuBox" - - /*! -+ * the path to use for the i.MX CEC wire -+ */ -+#define CEC_IMX_PATH "/dev/mxc_hdmi_cec" -+ -+/*! -+ * the name of the virtual COM port to use for the i.MX CEC wire -+ */ -+#define CEC_IMX_VIRTUAL_COM "i.MX" -+ -+/*! - * the path to use for the Exynos HDMI CEC device - */ --#define CEC_EXYNOS_PATH "/dev/CEC" -+#define CEC_EXYNOS_PATH "/dev/CEC" - - /*! - * the name of the virtual COM port to use for the EXYNOS' CEC wire -@@ -877,7 +887,8 @@ typedef enum cec_adapter_type - ADAPTERTYPE_P8_DAUGHTERBOARD = 0x2, - ADAPTERTYPE_RPI = 0x100, - ADAPTERTYPE_TDA995x = 0x200, -- ADAPTERTYPE_EXYNOS = 0x300 -+ ADAPTERTYPE_EXYNOS = 0x300, -+ ADAPTERTYPE_IMX = 0x400 - } cec_adapter_type; - - /** force exporting through swig */ -@@ -1262,7 +1273,7 @@ typedef struct cec_device_type_list - typedef struct cec_logical_addresses - { - cec_logical_address primary; /**< the primary logical address to use */ -- int addresses[16]; /**< the list of addresses */ -+ uint16_t addresses; /**< the list of addresses */ - - #ifdef __cplusplus - /*! -@@ -1271,8 +1282,7 @@ typedef struct cec_logical_addresses - void Clear(void) - { - primary = CECDEVICE_UNREGISTERED; -- for (unsigned int iPtr = 0; iPtr < 16; iPtr++) -- addresses[iPtr] = 0; -+ addresses = 0; - } - - /*! -@@ -1280,7 +1290,7 @@ typedef struct cec_logical_addresses - */ - bool IsEmpty(void) const - { -- return primary == CECDEVICE_UNREGISTERED; -+ return primary == CECDEVICE_UNREGISTERED && addresses == 0; - } - - /*! -@@ -1289,11 +1299,7 @@ typedef struct cec_logical_addresses - */ - uint16_t AckMask(void) const - { -- uint16_t mask = 0; -- for (unsigned int iPtr = 0; iPtr < 16; iPtr++) -- if (addresses[iPtr] == 1) -- mask |= 0x1 << iPtr; -- return mask; -+ return addresses; - } - - /*! -@@ -1305,7 +1311,7 @@ typedef struct cec_logical_addresses - if (primary == CECDEVICE_UNREGISTERED) - primary = address; - -- addresses[(int) address] = 1; -+ addresses |= (1 << (int) address); - } - - /*! -@@ -1317,7 +1323,7 @@ typedef struct cec_logical_addresses - if (primary == address) - primary = CECDEVICE_UNREGISTERED; - -- addresses[(int) address] = 0; -+ addresses &= ~(uint16_t)(1 << (int) address); - } - - /*! -@@ -1325,7 +1331,7 @@ typedef struct cec_logical_addresses - * @param address The address to check. - * @return True when set, false otherwise. - */ -- bool IsSet(cec_logical_address address) const { return addresses[(int) address] == 1; } -+ bool IsSet(cec_logical_address address) const { return (addresses & (1 << (int) address)); } - - /*! - * @brief Check whether an address is set in this list. -@@ -1334,18 +1340,9 @@ typedef struct cec_logical_addresses - */ - bool operator[](uint8_t pos) const { return pos < 16 ? IsSet((cec_logical_address) pos) : false; } - -- bool operator==(const cec_logical_addresses &other) const -- { -- bool bEqual(true); -- for (uint8_t iPtr = 0; iPtr < 16; iPtr++) -- bEqual &= ((addresses[(int)iPtr] == 1) == other[iPtr]); -- return bEqual; -- } -+ bool operator==(const cec_logical_addresses &other) const { return addresses == other.addresses; } - -- bool operator!=(const cec_logical_addresses &other) const -- { -- return !(*this == other); -- } -+ bool operator!=(const cec_logical_addresses &other) const { return !(*this == other); } - #endif - } cec_logical_addresses; - -diff --git a/src/cec-client/CMakeLists.txt b/src/cec-client/CMakeLists.txt -index 2cb42bb..c708fdb 100644 ---- a/src/cec-client/CMakeLists.txt -+++ b/src/cec-client/CMakeLists.txt -@@ -13,9 +13,9 @@ include(CheckLibraryExists) - include(CheckIncludeFiles) - include(CheckCXXCompilerFlag) - --check_cxx_compiler_flag("-std=c++11" SUPPORTS_CXX11) -+check_cxx_compiler_flag("-std=c++0x" SUPPORTS_CXX11) - if (SUPPORTS_CXX11) -- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") - endif() - - find_package(p8-platform REQUIRED) -diff --git a/src/cecc-client/cecc-client.c b/src/cecc-client/cecc-client.c -index b912118..f5eef85 100644 ---- a/src/cecc-client/cecc-client.c -+++ b/src/cecc-client/cecc-client.c -@@ -332,7 +332,7 @@ static int cec_process_command_scan(const char* data) - activeSource = g_iface.get_active_source(g_iface.connection); - for (iPtr = 0; iPtr < 16; iPtr++) - { -- if (addresses.addresses[iPtr]) -+ if (addresses.addresses & (1 << iPtr)) - { - cec_menu_language lang; - uint64_t iVendorId = g_iface.get_device_vendor_id(g_iface.connection, (cec_logical_address)iPtr); -diff --git a/src/libcec/CECClient.cpp b/src/libcec/CECClient.cpp -index 91e97cb..e7cdf87 100644 ---- a/src/libcec/CECClient.cpp -+++ b/src/libcec/CECClient.cpp -@@ -139,10 +139,6 @@ bool CCECClient::OnRegister(void) - // set the physical address - SetPhysicalAddress(m_configuration); - -- // make the primary device the active source if the option is set -- if (m_configuration.bActivateSource == 1) -- GetPrimaryDevice()->ActivateSource(500); -- - return true; - } - -@@ -348,12 +344,13 @@ bool CCECClient::AllocateLogicalAddresses(void) - if (address == CECDEVICE_UNKNOWN) - { - LIB_CEC->AddLog(CEC_LOG_ERROR, "%s - failed to allocate device '%d', type '%s'", __FUNCTION__, iPtr, ToString(m_configuration.deviceTypes.types[iPtr])); -- return false; -+ continue; - } - - // display the registered LA - LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s - device '%d', type '%s', LA '%X'", __FUNCTION__, iPtr, ToString(m_configuration.deviceTypes.types[iPtr]), address); - m_configuration.logicalAddresses.Set(address); -+ break; - } - - // persist the new configuration -@@ -1559,6 +1556,11 @@ bool CCECClient::IsLibCECActiveSource(void) - return bReturn; - } - -+bool CCECClient::TransmitSystemAudioModeRequest(void) -+{ -+ return m_processor ? m_processor->TransmitSystemAudioModeRequest(m_configuration.logicalAddresses.primary) : false; -+} -+ - void CCECClient::SourceActivated(const cec_logical_address logicalAddress) - { - LIB_CEC->AddLog(CEC_LOG_NOTICE, ">> source activated: %s (%x)", ToString(logicalAddress), logicalAddress); -diff --git a/src/libcec/CECClient.h b/src/libcec/CECClient.h -index badd2eb..0d585bf 100644 ---- a/src/libcec/CECClient.h -+++ b/src/libcec/CECClient.h -@@ -289,6 +289,7 @@ namespace CEC - virtual cec_logical_addresses GetLogicalAddresses(void); - virtual void RescanActiveDevices(void); - virtual bool IsLibCECActiveSource(void); -+ virtual bool TransmitSystemAudioModeRequest(void); - - // configuration - virtual bool GetCurrentConfiguration(libcec_configuration &configuration); -diff --git a/src/libcec/CECProcessor.cpp b/src/libcec/CECProcessor.cpp -index 5c11209..25a86ab 100644 ---- a/src/libcec/CECProcessor.cpp -+++ b/src/libcec/CECProcessor.cpp -@@ -709,6 +709,12 @@ bool CCECProcessor::TransmitPendingActiveSourceCommands(void) - return bReturn; - } - -+bool CCECProcessor::TransmitSystemAudioModeRequest(cec_logical_address initiator) -+{ -+ CCECBusDevice *device = m_busDevices->At(initiator); -+ return device && device->TransmitSystemAudioModeRequest(initiator); -+} -+ - CCECTV *CCECProcessor::GetTV(void) const - { - return CCECBusDevice::AsTV(m_busDevices->At(CECDEVICE_TV)); -diff --git a/src/libcec/CECProcessor.h b/src/libcec/CECProcessor.h -index 08917b9..1971dee 100644 ---- a/src/libcec/CECProcessor.h -+++ b/src/libcec/CECProcessor.h -@@ -149,6 +149,7 @@ namespace CEC - bool GetDeviceInformation(const char *strPort, libcec_configuration *config, uint32_t iTimeoutMs = CEC_DEFAULT_CONNECT_TIMEOUT); - - bool TransmitPendingActiveSourceCommands(void); -+ bool TransmitSystemAudioModeRequest(cec_logical_address initiator); - - CCECDeviceMap *GetDevices(void) const { return m_busDevices; } - CLibCEC *GetLib(void) const { return m_libcec; } -diff --git a/src/libcec/CECTypeUtils.h b/src/libcec/CECTypeUtils.h -index 0d0cf17..f6c818a 100644 ---- a/src/libcec/CECTypeUtils.h -+++ b/src/libcec/CECTypeUtils.h -@@ -766,6 +766,8 @@ namespace CEC - return "Raspberry Pi"; - case ADAPTERTYPE_TDA995x: - return "TDA995x"; -+ case ADAPTERTYPE_IMX: -+ return "i.MX"; - default: - return "unknown"; - } -diff --git a/src/libcec/CMakeLists.txt b/src/libcec/CMakeLists.txt -index a494533..f097bf4 100644 ---- a/src/libcec/CMakeLists.txt -+++ b/src/libcec/CMakeLists.txt -@@ -13,9 +13,9 @@ include(CheckIncludeFiles) - include(CheckCXXCompilerFlag) - include(../../cmake/UseMultiArch.cmake) - --check_cxx_compiler_flag("-std=c++11" SUPPORTS_CXX11) -+check_cxx_compiler_flag("-std=c++0x" SUPPORTS_CXX11) - if (SUPPORTS_CXX11) -- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") - endif() - - find_package(p8-platform REQUIRED) -@@ -64,7 +64,8 @@ set(CEC_SOURCES_IMPLEMENTATIONS implementations/ANCommandHandler.cpp - implementations/RLCommandHandler.cpp - implementations/PHCommandHandler.cpp - implementations/RHCommandHandler.cpp -- implementations/AQCommandHandler.cpp) -+ implementations/AQCommandHandler.cpp -+ implementations/GRCommandHandler.cpp) - - # /platform/* - set(CEC_SOURCES_PLATFORM platform/adl/adl-edid.cpp -@@ -121,6 +122,7 @@ set(CEC_HEADERS devices/CECRecordingDevice.h - implementations/RHCommandHandler.h - implementations/PHCommandHandler.h - implementations/AQCommandHandler.h -+ implementations/GRCommandHandler.h - CECProcessor.h) - source_group("Header Files" FILES ${CEC_HEADERS}) - -@@ -173,13 +175,17 @@ install(FILES ${PROJECT_SOURCE_DIR}/../../include/cec.h - DESTINATION include/libcec) - - # libCEC target --add_library(cec SHARED ${CEC_SOURCES}) --install(TARGETS cec -+add_library(cecobj OBJECT ${CEC_SOURCES}) -+set_property(TARGET ${cecobj} PROPERTY POSITION_INDEPENDENT_CODE 1) -+add_library(cec SHARED $) -+add_library(cecstatic STATIC $) -+set_target_properties(cecstatic PROPERTIES OUTPUT_NAME cec) -+install(TARGETS cec cecstatic - DESTINATION ${LIB_DESTINATION}) --set_target_properties(cec PROPERTIES VERSION ${LIBCEC_VERSION_MAJOR}.${LIBCEC_VERSION_MINOR}.${LIBCEC_VERSION_PATCH} -+set_target_properties(cec cecstatic PROPERTIES VERSION ${LIBCEC_VERSION_MAJOR}.${LIBCEC_VERSION_MINOR}.${LIBCEC_VERSION_PATCH} - SOVERSION ${LIBCEC_VERSION_MAJOR}) --target_link_libraries(cec ${p8-platform_LIBRARIES}) --target_link_libraries(cec ${CMAKE_THREAD_LIBS_INIT}) -+target_link_libraries(cec cecstatic ${platform_LIBRARIES}) -+target_link_libraries(cec cecstatic ${CMAKE_THREAD_LIBS_INIT}) - - include(cmake/LinkPlatformSupport.cmake) - include(cmake/DisplayPlatformSupport.cmake) -diff --git a/src/libcec/LibCEC.cpp b/src/libcec/LibCEC.cpp -index 5f6a136..177c409 100644 ---- a/src/libcec/LibCEC.cpp -+++ b/src/libcec/LibCEC.cpp -@@ -621,3 +621,8 @@ void CLibCEC::PrintVersion(uint32_t version, char* buf, size_t bufSize) - std::string strVersion = CCECTypeUtils::VersionToString(version); - snprintf(buf, bufSize, "%s", strVersion.c_str()); - } -+ -+bool CLibCEC::TransmitSystemAudioModeRequest(void) -+{ -+ return m_client ? m_client->TransmitSystemAudioModeRequest() : false; -+} -diff --git a/src/libcec/LibCEC.h b/src/libcec/LibCEC.h -index cc29c82..f769d8c 100644 ---- a/src/libcec/LibCEC.h -+++ b/src/libcec/LibCEC.h -@@ -102,6 +102,7 @@ namespace CEC - bool PersistConfiguration(libcec_configuration *configuration); - void RescanActiveDevices(void); - bool IsLibCECActiveSource(void); -+ bool TransmitSystemAudioModeRequest(void); - - const char* ToString(const cec_menu_state state) { return CCECTypeUtils::ToString(state); } - const char* ToString(const cec_version version) { return CCECTypeUtils::ToString(version); } -diff --git a/src/libcec/adapter/AdapterFactory.cpp b/src/libcec/adapter/AdapterFactory.cpp -index da05725..3fe49f1 100644 ---- a/src/libcec/adapter/AdapterFactory.cpp -+++ b/src/libcec/adapter/AdapterFactory.cpp -@@ -58,6 +58,11 @@ - #include "Exynos/ExynosCECAdapterCommunication.h" - #endif - -+#if defined(HAVE_IMX_API) -+#include "IMX/IMXCECAdapterDetection.h" -+#include "IMX/IMXCECAdapterCommunication.h" -+#endif -+ - using namespace CEC; - - int8_t CAdapterFactory::FindAdapters(cec_adapter *deviceList, uint8_t iBufSize, const char *strDevicePath /* = NULL */) -@@ -126,8 +131,21 @@ int8_t CAdapterFactory::DetectAdapters(cec_adapter_descriptor *deviceList, uint8 - } - #endif - -+#if defined(HAVE_IMX_API) -+ if (iAdaptersFound < iBufSize && CIMXCECAdapterDetection::FindAdapter() && -+ (!strDevicePath || !strcmp(strDevicePath, CEC_IMX_VIRTUAL_COM))) -+ { -+ snprintf(deviceList[iAdaptersFound].strComPath, sizeof(deviceList[iAdaptersFound].strComPath), CEC_IMX_PATH); -+ snprintf(deviceList[iAdaptersFound].strComName, sizeof(deviceList[iAdaptersFound].strComName), CEC_IMX_VIRTUAL_COM); -+ deviceList[iAdaptersFound].iVendorId = IMX_ADAPTER_VID; -+ deviceList[iAdaptersFound].iProductId = IMX_ADAPTER_PID; -+ deviceList[iAdaptersFound].adapterType = ADAPTERTYPE_IMX; -+ iAdaptersFound++; -+ } -+#endif -+ - --#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) -+#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) && !defined(HAVE_IMX_API) - #error "libCEC doesn't have support for any type of adapter. please check your build system or configuration" - #endif - -@@ -151,11 +169,16 @@ IAdapterCommunication *CAdapterFactory::GetInstance(const char *strPort, uint16_ - return new CRPiCECAdapterCommunication(m_lib->m_cec); - #endif - -+#if defined(HAVE_IMX_API) -+ if (!strcmp(strPort, CEC_IMX_VIRTUAL_COM)) -+ return new CIMXCECAdapterCommunication(m_lib->m_cec); -+#endif -+ - #if defined(HAVE_P8_USB) - return new CUSBCECAdapterCommunication(m_lib->m_cec, strPort, iBaudRate); - #endif - --#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) && !defined(HAVE_EXYNOS_API) -+#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) && !defined(HAVE_EXYNOS_API) && !defined(HAVE_IMX_API) - return NULL; - #endif - } -diff --git a/src/libcec/adapter/IMX/IMXCECAdapterCommunication.cpp b/src/libcec/adapter/IMX/IMXCECAdapterCommunication.cpp -new file mode 100644 -index 0000000..212dd75 ---- /dev/null -+++ b/src/libcec/adapter/IMX/IMXCECAdapterCommunication.cpp -@@ -0,0 +1,381 @@ -+/* -+ * This file is part of the libCEC(R) library. -+ * -+ * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited. All rights reserved. -+ * libCEC(R) is an original work, containing original code. -+ * -+ * libCEC(R) is a trademark of Pulse-Eight Limited. -+ * -+ * IMX adpater port is Copyright (C) 2013 by Stephan Rafin -+ * Copyright (C) 2014 by Matus Kral -+ * -+ * You can redistribute this file and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ * -+ * -+ */ -+ -+#include "env.h" -+ -+#if defined(HAVE_IMX_API) -+#include "IMXCECAdapterCommunication.h" -+ -+#include "CECTypeUtils.h" -+#include "LibCEC.h" -+#include -+#include -+#include -+ -+using namespace std; -+using namespace CEC; -+using namespace P8PLATFORM; -+ -+#include "IMXCECAdapterMessageQueue.h" -+ -+#define LIB_CEC m_callback->GetLib() -+ -+// these are defined in nxp private header file -+#define CEC_MSG_SUCCESS 0x00 /*Message transmisson Succeed*/ -+#define CEC_CSP_OFF_STATE 0x80 /*CSP in Off State*/ -+#define CEC_BAD_REQ_SERVICE 0x81 /*Bad .req service*/ -+#define CEC_MSG_FAIL_UNABLE_TO_ACCESS 0x82 /*Message transmisson failed: Unable to access CEC line*/ -+#define CEC_MSG_FAIL_ARBITRATION_ERROR 0x83 /*Message transmisson failed: Arbitration error*/ -+#define CEC_MSG_FAIL_BIT_TIMMING_ERROR 0x84 /*Message transmisson failed: Bit timming error*/ -+#define CEC_MSG_FAIL_DEST_NOT_ACK 0x85 /*Message transmisson failed: Destination Address not aknowledged*/ -+#define CEC_MSG_FAIL_DATA_NOT_ACK 0x86 /*Message transmisson failed: Databyte not acknowledged*/ -+ -+CIMXCECAdapterCommunication::CIMXCECAdapterCommunication(IAdapterCommunicationCallback *callback) : -+ IAdapterCommunication(callback), -+ m_PAReporter(NULL) -+{ -+ CLockObject lock(m_mutex); -+ -+ m_iNextMessage = 0; -+ m_logicalAddress = CECDEVICE_UNKNOWN; -+ m_bLogicalAddressRegistered = false; -+ m_bInitialised = false; -+ m_dev = new CCDevSocket(CEC_IMX_PATH); -+ m_physicalAddress = -1; -+} -+ -+CIMXCECAdapterCommunication::~CIMXCECAdapterCommunication(void) -+{ -+ Close(); -+ SAFE_DELETE(m_PAReporter); -+ delete m_dev; -+ m_dev = 0; -+} -+ -+bool CIMXCECAdapterCommunication::IsOpen(void) -+{ -+ return IsInitialised() && m_dev->IsOpen(); -+} -+ -+bool CIMXCECAdapterCommunication::Open(uint32_t iTimeoutMs, bool UNUSED(bSkipChecks), bool bStartListening) -+{ -+ if (m_dev->Open(iTimeoutMs)) -+ { -+ if (!bStartListening || CreateThread()) { -+ if (m_dev->Ioctl(HDMICEC_IOC_STARTDEVICE, NULL) == 0) { -+ m_bInitialised = true; -+ RegisterLogicalAddress(CECDEVICE_BROADCAST); -+ return true; -+ } -+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: Unable to start device\n", __func__); -+ } -+ m_dev->Close(); -+ } -+ -+ return false; -+} -+ -+ -+void CIMXCECAdapterCommunication::Close(void) -+{ -+ m_bInitialised = false; -+ if (m_dev->Ioctl(HDMICEC_IOC_STOPDEVICE, NULL) != 0) -+ { -+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: Unable to stop device\n", __func__); -+ } -+ StopThread(false); -+ m_dev->Close(); -+} -+ -+ -+std::string CIMXCECAdapterCommunication::GetError(void) const -+{ -+ std::string strError(m_strError); -+ return strError; -+} -+ -+ -+cec_adapter_message_state CIMXCECAdapterCommunication::Write( -+ const cec_command &data, bool &bRetry, uint8_t iLineTimeout, bool UNUSED(bIsReply)) -+{ -+ unsigned char message[MAX_MESSAGE_LEN]; -+ CIMXCECAdapterMessageQueueEntry *entry; -+ int msg_len = 1; -+ cec_adapter_message_state rc = ADAPTER_MESSAGE_STATE_ERROR; -+ -+ bRetry = true; -+ if ((size_t)data.parameters.size + data.opcode_set + 1 > sizeof(message)) -+ { -+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: data size too large !", __func__); -+ bRetry = false; -+ return rc; -+ } -+ -+ message[0] = (data.initiator << 4) | (data.destination & 0x0f); -+ if (data.opcode_set) -+ { -+ message[1] = data.opcode; -+ msg_len++; -+ memcpy(&message[2], data.parameters.data, data.parameters.size); -+ msg_len+=data.parameters.size; -+ } -+ -+ entry = new CIMXCECAdapterMessageQueueEntry(message[0], data.opcode); -+ m_messageMutex.Lock(); -+ uint32_t msgKey = ++m_iNextMessage; -+ m_messages.insert(make_pair(msgKey, entry)); -+ m_messageMutex.Unlock(); -+ -+ if (m_dev->Write(message, msg_len) > 0) -+ { -+ if (entry->Wait(data.transmit_timeout ? data.transmit_timeout : iLineTimeout *1000)) -+ { -+ int status = entry->Result(); -+ -+ if (status == MESSAGE_TYPE_NOACK) -+ rc = ADAPTER_MESSAGE_STATE_SENT_NOT_ACKED; -+ else if (status == MESSAGE_TYPE_SEND_SUCCESS) -+ rc = ADAPTER_MESSAGE_STATE_SENT_ACKED; -+ -+ bRetry = false; -+ } -+ else -+ { -+ rc = ADAPTER_MESSAGE_STATE_WAITING_TO_BE_SENT; -+#ifdef CEC_DEBUGGING -+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s: command timed out !", __func__); -+#endif -+ } -+ } -+ else -+ { -+ Sleep(CEC_DEFAULT_TRANSMIT_RETRY_WAIT); -+#ifdef CEC_DEBUGGING -+ LIB_CEC->AddLog(CEC_LOG_WARNING, "%s: write failed !", __func__); -+#endif -+ } -+ -+ m_messageMutex.Lock(); -+ m_messages.erase(msgKey); -+ m_messageMutex.Unlock(); -+ -+ delete entry; -+ -+ return rc; -+} -+ -+ -+uint16_t CIMXCECAdapterCommunication::GetFirmwareVersion(void) -+{ -+ /* FIXME add ioctl ? */ -+ return 0; -+} -+ -+ -+cec_vendor_id CIMXCECAdapterCommunication::GetVendorId(void) -+{ -+ return CEC_VENDOR_UNKNOWN; -+} -+ -+ -+uint16_t CIMXCECAdapterCommunication::GetPhysicalAddress(void) -+{ -+ uint8_t phy_addr[4]; -+ uint16_t pa_tmp; -+ -+ if (m_dev->Ioctl(HDMICEC_IOC_GETPHYADDRESS, &phy_addr) != 0) -+ { -+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: HDMICEC_IOC_GETPHYADDRESS failed !", __func__); -+ return CEC_INVALID_PHYSICAL_ADDRESS; -+ } -+ -+ if ((pa_tmp = ((phy_addr[0] << 4 | phy_addr[1]) << 8) | (phy_addr[2] << 4 | phy_addr[3]))) -+ m_physicalAddress = pa_tmp; -+ -+ return m_physicalAddress; -+} -+ -+ -+cec_logical_addresses CIMXCECAdapterCommunication::GetLogicalAddresses(void) -+{ -+ cec_logical_addresses addresses; -+ addresses.Clear(); -+ -+ CLockObject lock(m_mutex); -+ if (m_bLogicalAddressRegistered) -+ addresses.Set(m_logicalAddress); -+ -+ return addresses; -+} -+ -+void CIMXCECAdapterCommunication::HandleLogicalAddressLost(cec_logical_address UNUSED(oldAddress)) -+{ -+ UnregisterLogicalAddress(); -+} -+ -+bool CIMXCECAdapterCommunication::UnregisterLogicalAddress(void) -+{ -+ { -+ CLockObject lock(m_mutex); -+ if (!m_bLogicalAddressRegistered) -+ return true; -+ } -+ -+#ifdef CEC_DEBUGGING -+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s - releasing previous logical address", __func__); -+#endif -+ return RegisterLogicalAddress(CECDEVICE_BROADCAST); -+} -+ -+bool CIMXCECAdapterCommunication::RegisterLogicalAddress(const cec_logical_address address) -+{ -+ { -+ CLockObject lock(m_mutex); -+ if ((m_logicalAddress == address && m_bLogicalAddressRegistered) || -+ (m_logicalAddress == address && address == CECDEVICE_BROADCAST)) -+ { -+ return true; -+ } -+ } -+ -+#ifdef CEC_DEBUGGING -+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s: %x to %x", __func__, m_logicalAddress, address); -+#endif -+ -+ if (m_dev->Ioctl(HDMICEC_IOC_SETLOGICALADDRESS, (void *)address) != 0) -+ { -+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: HDMICEC_IOC_SETLOGICALADDRESS failed !", __func__); -+ return false; -+ } -+ -+ CLockObject lock(m_mutex); -+ -+ m_logicalAddress = address; -+ m_bLogicalAddressRegistered = (address != CECDEVICE_BROADCAST) ? true : false; -+ return true; -+} -+ -+bool CIMXCECAdapterCommunication::SetLogicalAddresses(const cec_logical_addresses &addresses) -+{ -+ int log_addr = addresses.primary; -+ -+ return RegisterLogicalAddress((cec_logical_address)log_addr); -+} -+ -+ -+void *CIMXCECAdapterCommunication::Process(void) -+{ -+ bool bHandled; -+ hdmi_cec_event event; -+ int ret; -+ -+ cec_logical_address initiator, destination; -+ -+ while (!IsStopped()) -+ { -+ if (IsInitialised() && (ret = m_dev->Read((char *)&event, sizeof(event), 0)) > 0) -+ { -+ -+ initiator = cec_logical_address(event.msg[0] >> 4); -+ destination = cec_logical_address(event.msg[0] & 0x0f); -+ -+ if (event.event_type == MESSAGE_TYPE_RECEIVE_SUCCESS) -+ { -+ cec_command cmd; -+ -+ cec_command::Format( -+ cmd, initiator, destination, -+ ( event.msg_len > 1 ) ? cec_opcode(event.msg[1]) : CEC_OPCODE_NONE); -+ -+ for( uint8_t i = 2; i < event.msg_len; i++ ) -+ cmd.parameters.PushBack(event.msg[i]); -+ -+ if (!IsStopped()) { -+ m_callback->OnCommandReceived(cmd); -+ } -+ } -+ else if (event.event_type == MESSAGE_TYPE_SEND_SUCCESS -+ || event.event_type == MESSAGE_TYPE_NOACK) -+ { -+ bHandled = false; -+ -+ m_messageMutex.Lock(); -+ for (map::iterator it = m_messages.begin(); -+ !bHandled && it != m_messages.end(); it++) -+ { -+ bHandled = it->second->Received(event.event_type, event.msg[0], (cec_opcode)event.msg[1]); -+ } -+ m_messageMutex.Unlock(); -+ -+ if (!bHandled) -+ LIB_CEC->AddLog(CEC_LOG_WARNING, "%s: response not matched !", __func__); -+ } -+ else if (event.event_type == MESSAGE_TYPE_DISCONNECTED) -+ { -+ /* HDMI Hotplug event - disconnect */ -+ } -+ else if (event.event_type == MESSAGE_TYPE_CONNECTED) -+ { -+ if (m_physicalAddress == 0xffff) -+ continue; -+ /* HDMI Hotplug event - connect */ -+ uint16_t oldAddress = m_physicalAddress; -+ -+ if (oldAddress != GetPhysicalAddress()) { -+ if (m_PAReporter) -+ while (m_PAReporter->IsRunning()) Sleep(5); -+ delete m_PAReporter; -+ -+ m_PAReporter = new CCECPAChangedReporter(m_callback, m_physicalAddress); -+ m_PAReporter->CreateThread(false); -+ } -+#ifdef CEC_DEBUGGING -+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s: plugin event received", __func__); -+#endif -+ } -+ else -+ LIB_CEC->AddLog(CEC_LOG_WARNING, "%s: unhandled response received %d!", __func__, event.event_type); -+ } -+ } -+ -+ return 0; -+} -+ -+CCECPAChangedReporter::CCECPAChangedReporter(IAdapterCommunicationCallback *callback, uint16_t newPA) : -+ m_callback(callback), -+ m_newPA(newPA) -+{ -+} -+ -+void* CCECPAChangedReporter::Process(void) -+{ -+ m_callback->HandlePhysicalAddressChanged(m_newPA); -+ return NULL; -+} -+ -+#endif // HAVE_IMX_API -diff --git a/src/libcec/adapter/IMX/IMXCECAdapterCommunication.h b/src/libcec/adapter/IMX/IMXCECAdapterCommunication.h -new file mode 100644 -index 0000000..2da38c1 ---- /dev/null -+++ b/src/libcec/adapter/IMX/IMXCECAdapterCommunication.h -@@ -0,0 +1,139 @@ -+#pragma once -+/* -+ * This file is part of the libCEC(R) library. -+ * -+ * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited. All rights reserved. -+ * libCEC(R) is an original work, containing original code. -+ * -+ * libCEC(R) is a trademark of Pulse-Eight Limited. -+ * -+ * IMX adpater port is Copyright (C) 2013 by Stephan Rafin -+ * Copyright (C) 2014 by Matus Kral -+ * -+ * You can redistribute this file and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ * -+ * -+ */ -+ -+#if defined(HAVE_IMX_API) -+ -+#include "adapter/AdapterCommunication.h" -+#include -+#include -+#include -+#include "adapter/IMX/mxc_hdmi-cec.h" -+#include -+ -+#define IMX_ADAPTER_VID 0x0471 /*FIXME TBD*/ -+#define IMX_ADAPTER_PID 0x1001 -+ -+typedef struct hdmi_cec_event{ -+ uint8_t event_type; -+ uint8_t msg_len; -+ uint8_t msg[MAX_MESSAGE_LEN]; -+}hdmi_cec_event; -+ -+ -+namespace P8PLATFORM -+{ -+ class CCDevSocket; -+}; -+ -+namespace CEC -+{ -+ class CIMXCECAdapterMessageQueueEntry; -+ -+ class CCECPAChangedReporter : public P8PLATFORM::CThread -+ { -+ public: -+ CCECPAChangedReporter(IAdapterCommunicationCallback *callback, uint16_t newPA); -+ void* Process(void); -+ -+ private: -+ IAdapterCommunicationCallback *m_callback; -+ uint16_t m_newPA; -+ }; -+ -+ class CIMXCECAdapterCommunication : public IAdapterCommunication, public P8PLATFORM::CThread -+ { -+ public: -+ /*! -+ * @brief Create a new USB-CEC communication handler. -+ * @param callback The callback to use for incoming CEC commands. -+ */ -+ CIMXCECAdapterCommunication(IAdapterCommunicationCallback *callback); -+ virtual ~CIMXCECAdapterCommunication(void); -+ -+ /** @name IAdapterCommunication implementation */ -+ ///{ -+ bool Open(uint32_t iTimeoutMs = CEC_DEFAULT_CONNECT_TIMEOUT, bool bSkipChecks = false, bool bStartListening = true); -+ void Close(void); -+ bool IsOpen(void); -+ std::string GetError(void) const; -+ cec_adapter_message_state Write(const cec_command &data, bool &bRetry, uint8_t iLineTimeout, bool bIsReply); -+ -+ bool SetLineTimeout(uint8_t UNUSED(iTimeout)) { return true; } -+ bool StartBootloader(void) { return false; } -+ bool SetLogicalAddresses(const cec_logical_addresses &addresses); -+ cec_logical_addresses GetLogicalAddresses(void); -+ bool PingAdapter(void) { return IsInitialised(); } -+ uint16_t GetFirmwareVersion(void); -+ uint32_t GetFirmwareBuildDate(void) { return 0; } -+ bool IsRunningLatestFirmware(void) { return true; } -+ bool PersistConfiguration(const libcec_configuration & UNUSED(configuration)) { return false; } -+ bool GetConfiguration(libcec_configuration & UNUSED(configuration)) { return false; } -+ std::string GetPortName(void) { return std::string("IMX"); } -+ uint16_t GetPhysicalAddress(void); -+ bool SetControlledMode(bool UNUSED(controlled)) { return true; } -+ cec_vendor_id GetVendorId(void); -+ void HandleLogicalAddressLost(cec_logical_address UNUSED(oldAddress)); -+ bool SupportsSourceLogicalAddress(const cec_logical_address address) { return address > CECDEVICE_TV && address <= CECDEVICE_BROADCAST; } -+ cec_adapter_type GetAdapterType(void) { return ADAPTERTYPE_IMX; } -+ uint16_t GetAdapterVendorId(void) const { return IMX_ADAPTER_VID; } -+ uint16_t GetAdapterProductId(void) const { return IMX_ADAPTER_PID; } -+ void SetActiveSource(bool UNUSED(bSetTo), bool UNUSED(bClientUnregistered)) {} -+ ///} -+ -+ /** @name PLATFORM::CThread implementation */ -+ ///{ -+ void *Process(void); -+ ///} -+ -+ private: -+ bool IsInitialised(void) { return m_bInitialised; }; -+ bool RegisterLogicalAddress(const cec_logical_address address); -+ bool UnregisterLogicalAddress(void); -+ -+ std::string m_strError; /**< current error message */ -+ -+ cec_logical_address m_logicalAddress; -+ uint16_t m_physicalAddress; -+ -+ P8PLATFORM::CMutex m_mutex; -+ P8PLATFORM::CCDevSocket *m_dev; /**< the device connection */ -+ -+ P8PLATFORM::CMutex m_messageMutex; -+ uint32_t m_iNextMessage; -+ std::map m_messages; -+ -+ bool m_bLogicalAddressRegistered; -+ bool m_bInitialised; -+ -+ CCECPAChangedReporter *m_PAReporter; -+ }; -+ -+}; -+ -+#endif -diff --git a/src/libcec/adapter/IMX/IMXCECAdapterDetection.cpp b/src/libcec/adapter/IMX/IMXCECAdapterDetection.cpp -new file mode 100644 -index 0000000..6c93c45 ---- /dev/null -+++ b/src/libcec/adapter/IMX/IMXCECAdapterDetection.cpp -@@ -0,0 +1,42 @@ -+/* -+ * This file is part of the libCEC(R) library. -+ * -+ * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited. All rights reserved. -+ * libCEC(R) is an original work, containing original code. -+ * -+ * libCEC(R) is a trademark of Pulse-Eight Limited. -+ * -+ * IMX adpater port is Copyright (C) 2013 by Stephan Rafin -+ * -+ * You can redistribute this file and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ * -+ * -+ */ -+ -+#include "env.h" -+#include -+ -+#if defined(HAVE_IMX_API) -+#include "IMXCECAdapterDetection.h" -+ -+ -+using namespace CEC; -+ -+bool CIMXCECAdapterDetection::FindAdapter(void) -+{ -+ return access(CEC_IMX_PATH, 0) == 0; -+} -+ -+#endif -diff --git a/src/libcec/adapter/IMX/IMXCECAdapterDetection.h b/src/libcec/adapter/IMX/IMXCECAdapterDetection.h -new file mode 100644 -index 0000000..d54891d ---- /dev/null -+++ b/src/libcec/adapter/IMX/IMXCECAdapterDetection.h -@@ -0,0 +1,36 @@ -+#pragma once -+/* -+ * This file is part of the libCEC(R) library. -+ * -+ * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited. All rights reserved. -+ * libCEC(R) is an original work, containing original code. -+ * -+ * libCEC(R) is a trademark of Pulse-Eight Limited. -+ * -+ * IMX adpater port is Copyright (C) 2013 by Stephan Rafin -+ * -+ * You can redistribute this file and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ * -+ * -+ */ -+ -+namespace CEC -+{ -+ class CIMXCECAdapterDetection -+ { -+ public: -+ static bool FindAdapter(void); -+ }; -+} -diff --git a/src/libcec/adapter/IMX/IMXCECAdapterMessageQueue.h b/src/libcec/adapter/IMX/IMXCECAdapterMessageQueue.h -new file mode 100644 -index 0000000..e54c192 ---- /dev/null -+++ b/src/libcec/adapter/IMX/IMXCECAdapterMessageQueue.h -@@ -0,0 +1,118 @@ -+#pragma once -+/* -+ * This file is part of the libCEC(R) library. -+ * -+ * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited. All rights reserved. -+ * libCEC(R) is an original work, containing original code. -+ * -+ * libCEC(R) is a trademark of Pulse-Eight Limited. -+ * -+ * This program is dual-licensed; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ * -+ * -+ * Alternatively, you can license this library under a commercial license, -+ * please contact Pulse-Eight Licensing for more information. -+ * -+ * For more information contact: -+ * Pulse-Eight Licensing -+ * http://www.pulse-eight.com/ -+ * http://www.pulse-eight.net/ -+ */ -+ -+#include -+ -+namespace CEC -+{ -+ using namespace P8PLATFORM; -+ -+ class CIMXCECAdapterMessageQueueEntry -+ { -+ public: -+ CIMXCECAdapterMessageQueueEntry(uint8_t addrs, cec_opcode opcode) -+ : m_bWaiting(true), m_retval((uint32_t)-1), m_bSucceeded(false) -+ { -+ m_opcode = opcode; -+ m_addrs = addrs; -+ } -+ -+ virtual ~CIMXCECAdapterMessageQueueEntry(void) {} -+ -+ /*! -+ * @brief Query result from worker thread -+ */ -+ uint32_t Result() const -+ { -+ return m_retval; -+ } -+ -+ /*! -+ * @brief Signal waiting threads -+ */ -+ void Broadcast(void) -+ { -+ CLockObject lock(m_mutex); -+ m_condition.Broadcast(); -+ } -+ -+ /*! -+ * @brief Signal waiting thread(s) when message matches this entry -+ */ -+ bool Received(int response, uint8_t addrs, cec_opcode opcode) -+ { -+ CLockObject lock(m_mutex); -+ -+ if (!(m_addrs == addrs && m_opcode == opcode)) -+ return false; -+ -+ m_retval = response; -+ m_bSucceeded = true; -+ m_condition.Signal(); -+ return true; -+ } -+ -+ /*! -+ * @brief Wait for a response to this command. -+ * @param iTimeout The timeout to use while waiting. -+ * @return True when a response was received before the timeout passed, false otherwise. -+ */ -+ bool Wait(uint32_t iTimeout) -+ { -+ CLockObject lock(m_mutex); -+ -+ bool bReturn = m_bSucceeded ? true : m_condition.Wait(m_mutex, m_bSucceeded, iTimeout); -+ m_bWaiting = false; -+ return bReturn; -+ } -+ -+ /*! -+ * @return True while a thread is waiting for a signal or isn't waiting yet, false otherwise. -+ */ -+ bool IsWaiting(void) -+ { -+ CLockObject lock(m_mutex); -+ return m_bWaiting; -+ } -+ -+ private: -+ bool m_bWaiting; /**< true while a thread is waiting or when it hasn't started waiting yet */ -+ P8PLATFORM::CCondition m_condition; /**< the condition to wait on */ -+ P8PLATFORM::CMutex m_mutex; /**< mutex for changes to this class */ -+ int m_retval; -+ bool m_bSucceeded; -+ uint8_t m_addrs; -+ cec_opcode m_opcode; -+ }; -+ -+}; -diff --git a/src/libcec/adapter/IMX/mxc_hdmi-cec.h b/src/libcec/adapter/IMX/mxc_hdmi-cec.h -new file mode 100644 -index 0000000..bc5bbce ---- /dev/null -+++ b/src/libcec/adapter/IMX/mxc_hdmi-cec.h -@@ -0,0 +1,47 @@ -+/* -+ * Copyright 2005-2013 Freescale Semiconductor, Inc. All Rights Reserved. -+ */ -+ -+/* -+ * The code contained herein is licensed under the GNU General Public -+ * License. You may obtain a copy of the GNU General Public License -+ * Version 2 or later at the following locations: -+ * -+ * http://www.opensource.org/licenses/gpl-license.html -+ * http://www.gnu.org/copyleft/gpl.html -+ */ -+#ifndef _HDMICEC_H_ -+#define _HDMICEC_H_ -+#include -+ -+/* -+ * Ioctl definitions -+ */ -+ -+/* Use 'k' as magic number */ -+#define HDMICEC_IOC_MAGIC 'H' -+/* -+ * S means "Set" through a ptr, -+ * T means "Tell" directly with the argument value -+ * G means "Get": reply by setting through a pointer -+ * Q means "Query": response is on the return value -+ * X means "eXchange": G and S atomically -+ * H means "sHift": T and Q atomically -+ */ -+#define HDMICEC_IOC_SETLOGICALADDRESS \ -+ _IOW(HDMICEC_IOC_MAGIC, 1, unsigned char) -+#define HDMICEC_IOC_STARTDEVICE _IO(HDMICEC_IOC_MAGIC, 2) -+#define HDMICEC_IOC_STOPDEVICE _IO(HDMICEC_IOC_MAGIC, 3) -+#define HDMICEC_IOC_GETPHYADDRESS \ -+ _IOR(HDMICEC_IOC_MAGIC, 4, unsigned char[4]) -+ -+#define MAX_MESSAGE_LEN 16 -+ -+#define MESSAGE_TYPE_RECEIVE_SUCCESS 1 -+#define MESSAGE_TYPE_NOACK 2 -+#define MESSAGE_TYPE_DISCONNECTED 3 -+#define MESSAGE_TYPE_CONNECTED 4 -+#define MESSAGE_TYPE_SEND_SUCCESS 5 -+ -+#endif /* !_HDMICEC_H_ */ -+ -diff --git a/src/libcec/cmake/CheckPlatformSupport.cmake b/src/libcec/cmake/CheckPlatformSupport.cmake -index b8a16c8..36ed4cf 100644 ---- a/src/libcec/cmake/CheckPlatformSupport.cmake -+++ b/src/libcec/cmake/CheckPlatformSupport.cmake -@@ -83,26 +83,49 @@ else() - endif() - - # xrandr -- check_include_files("X11/Xlib.h;X11/Xatom.h;X11/extensions/Xrandr.h" HAVE_RANDR_HEADERS) -- check_library_exists(Xrandr XRRGetScreenResources "" HAVE_RANDR_LIB) -- if (HAVE_RANDR_HEADERS AND HAVE_RANDR_LIB) -- set(LIB_INFO "${LIB_INFO}, randr") -- list(APPEND CEC_SOURCES_PLATFORM platform/X11/randr-edid.cpp) -- set(HAVE_RANDR 1) -+ if (${HAVE_RANDR_API}) -+ check_include_files("X11/Xlib.h;X11/Xatom.h;X11/extensions/Xrandr.h" HAVE_RANDR_HEADERS) -+ check_library_exists(Xrandr XRRGetScreenResources "" HAVE_RANDR_LIB) -+ if (HAVE_RANDR_HEADERS AND HAVE_RANDR_LIB) -+ set(LIB_INFO "${LIB_INFO}, randr") -+ list(APPEND CEC_SOURCES_PLATFORM platform/X11/randr-edid.cpp) -+ set(HAVE_RANDR 1) -+ else() -+ set(HAVE_RANDR 0) -+ endif() - else() - set(HAVE_RANDR 0) - endif() - -- # raspberry pi -- find_library(RPI_BCM_HOST bcm_host "${RPI_LIB_DIR}") -- check_library_exists(bcm_host bcm_host_init "${RPI_LIB_DIR}" HAVE_RPI_LIB) -- if (HAVE_RPI_LIB) -+ # iMX6 -+ if (${HAVE_IMX_API}) -+ set(LIB_INFO "${LIB_INFO}, iMX6") -+ set(HAVE_IMX_API 1) -+ set(CEC_SOURCES_ADAPTER_IMX adapter/IMX/IMXCECAdapterDetection.cpp -+ adapter/IMX/IMXCECAdapterCommunication.cpp) -+ source_group("Source Files\\adapter\\iMX6" FILES ${CEC_SOURCES_ADAPTER_IMX}) -+ list(APPEND CEC_SOURCES ${CEC_SOURCES_ADAPTER_IMX}) -+ set(HAVE_RPI_API 0) -+ else() -+ set(HAVE_IMX_API 0) - set(HAVE_RPI_API 1) -+ endif() -+ -+ # raspberry pi -+ if (HAVE_RPI_API) -+ find_library(RPI_BCM_HOST bcm_host "${RPI_LIB_DIR}") -+ check_library_exists(bcm_host bcm_host_init "${RPI_LIB_DIR}" HAVE_RPI_API) -+ endif() -+ if (HAVE_RPI_API) - find_library(RPI_VCOS vcos "${RPI_LIB_DIR}") - find_library(RPI_VCHIQ_ARM vchiq_arm "${RPI_LIB_DIR}") - include_directories(${RPI_INCLUDE_DIR} ${RPI_INCLUDE_DIR}/interface/vcos/pthreads ${RPI_INCLUDE_DIR}/interface/vmcs_host/linux) - -- set(LIB_INFO "${LIB_INFO}, RPi") -+ set(LIB_INFO "${LIB_INFO}, 'RPi'") -+ # find includes files on Raspberry Pi -+ include_directories(/opt/vc/include /opt/vc/include/interface/vcos/pthreads /opt/vc/include/interface/vmcs_host/linux) -+ list(APPEND CMAKE_REQUIRED_LIBRARIES "vcos") -+ list(APPEND CMAKE_REQUIRED_LIBRARIES "vchiq_arm") - set(CEC_SOURCES_ADAPTER_RPI adapter/RPi/RPiCECAdapterDetection.cpp - adapter/RPi/RPiCECAdapterCommunication.cpp - adapter/RPi/RPiCECAdapterMessageQueue.cpp) -@@ -132,6 +155,8 @@ else() - else() - set(HAVE_EXYNOS_API 0) - endif() -+ -+ - endif() - - # rt -diff --git a/src/libcec/cmake/DisplayPlatformSupport.cmake b/src/libcec/cmake/DisplayPlatformSupport.cmake -index 9dcaacf..770b1a5 100644 ---- a/src/libcec/cmake/DisplayPlatformSupport.cmake -+++ b/src/libcec/cmake/DisplayPlatformSupport.cmake -@@ -38,6 +38,12 @@ else() - message(STATUS "Exynos support: no") - endif() - -+if (HAVE_IMX_API) -+ message(STATUS "i.MX6 support: yes") -+else() -+ message(STATUS "i.MX6 support: no") -+endif() -+ - if (HAVE_DRM_EDID_PARSER) - message(STATUS "DRM support: yes") - else() -diff --git a/src/libcec/cmake/LinkPlatformSupport.cmake b/src/libcec/cmake/LinkPlatformSupport.cmake -index fc27353..b203f6f 100644 ---- a/src/libcec/cmake/LinkPlatformSupport.cmake -+++ b/src/libcec/cmake/LinkPlatformSupport.cmake -@@ -28,7 +28,12 @@ endif() - - # raspberry pi - if (HAVE_RPI_API) -- target_link_libraries(cec ${RPI_VCOS} ${RPI_VCHIQ_ARM} ${RPI_BCM_HOST}) -+ find_library (VCOS vcos) -+ target_link_libraries(cec ${VCOS}) -+ find_library (VCHIQ_ARM vchiq_arm) -+ target_link_libraries(cec ${VCHIP_ARM}) -+ find_library (BCM_HOST bcm_host) -+ target_link_libraries(cec ${BCM_HOST}) - endif() - - # Apple -diff --git a/src/libcec/devices/CECBusDevice.cpp b/src/libcec/devices/CECBusDevice.cpp -index e2d5ea3..0cbdb8d 100644 ---- a/src/libcec/devices/CECBusDevice.cpp -+++ b/src/libcec/devices/CECBusDevice.cpp -@@ -44,6 +44,7 @@ - #include "implementations/RLCommandHandler.h" - #include "implementations/RHCommandHandler.h" - #include "implementations/AQCommandHandler.h" -+#include "implementations/GRCommandHandler.h" - #include "LibCEC.h" - #include "CECTypeUtils.h" - #include -@@ -222,6 +223,9 @@ bool CCECBusDevice::ReplaceHandler(bool bActivateSource /* = true */) - case CEC_VENDOR_SHARP2: - m_handler = new CAQCommandHandler(this, iTransmitTimeout, iTransmitWait, iTransmitRetries, iActiveSourcePending); - break; -+ case CEC_VENDOR_GRUNDIG: -+ m_handler = new CGRCommandHandler(this, iTransmitTimeout, iTransmitWait, iTransmitRetries, iActiveSourcePending); -+ break; - default: - m_handler = new CCECCommandHandler(this, iTransmitTimeout, iTransmitWait, iTransmitRetries, iActiveSourcePending); - break; -@@ -1025,21 +1029,18 @@ bool CCECBusDevice::ActivateSource(uint64_t iDelay /* = 0 */) - bool bReturn(true); - if (iDelay == 0) - { -- /** send system audio mode request if AVR exists */ -- if (m_iLogicalAddress != CECDEVICE_AUDIOSYSTEM) -+ /** some AVRs fail to be powered up by the TV when it powers up. power up the AVR explicitly */ -+ /*if (m_iLogicalAddress != CECDEVICE_AUDIOSYSTEM) - { - CCECBusDevice* audioSystem(m_processor->GetDevice(CECDEVICE_AUDIOSYSTEM)); -- if (audioSystem && audioSystem->IsPresent()) -+ if (audioSystem && audioSystem->IsPresent() && audioSystem->GetPowerStatus(m_iLogicalAddress) != CEC_POWER_STATUS_ON) - { -- cec_command command; -+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "powering up the AVR"); -+ audioSystem->PowerOn(m_iLogicalAddress); - -- LIB_CEC->AddLog(CEC_LOG_DEBUG, "sending system audio mode request for '%s'", ToString(m_iLogicalAddress)); -- cec_command::Format(command, m_iLogicalAddress, CECDEVICE_AUDIOSYSTEM, CEC_OPCODE_SYSTEM_AUDIO_MODE_REQUEST); -- command.parameters.PushBack((uint8_t) ((m_iPhysicalAddress >> 8) & 0xFF)); -- command.parameters.PushBack((uint8_t) (m_iPhysicalAddress & 0xFF)); -- bReturn = m_handler->Transmit(command, false, false); -+ audioSystem->m_waitForResponse->Wait(CEC_OPCODE_DEVICE_VENDOR_ID, 10000); - } -- } -+ }*/ - - LIB_CEC->AddLog(CEC_LOG_DEBUG, "sending active source message for '%s'", ToString(m_iLogicalAddress)); - bReturn = m_handler->ActivateSource(); -@@ -1283,7 +1284,7 @@ bool CCECBusDevice::PowerOn(const cec_logical_address initiator) - - MarkBusy(); - cec_power_status currentStatus; -- if (m_iLogicalAddress == CECDEVICE_TV || -+ if ((m_iLogicalAddress == CECDEVICE_TV && !ImageViewOnSent()) || - ((currentStatus = GetPowerStatus(initiator, false)) != CEC_POWER_STATUS_IN_TRANSITION_STANDBY_TO_ON && - currentStatus != CEC_POWER_STATUS_ON)) - { -@@ -1488,3 +1489,8 @@ bool CCECBusDevice::WaitForOpcode(cec_opcode opcode) - { - return m_waitForResponse->Wait(opcode); - } -+ -+bool CCECBusDevice::TransmitSystemAudioModeRequest(const cec_logical_address initiator) -+{ -+ return m_handler->TransmitSystemAudioModeRequest(initiator, m_iPhysicalAddress, false); -+} -diff --git a/src/libcec/devices/CECBusDevice.h b/src/libcec/devices/CECBusDevice.h -index d8b7193..23751fb 100644 ---- a/src/libcec/devices/CECBusDevice.h -+++ b/src/libcec/devices/CECBusDevice.h -@@ -194,6 +194,8 @@ namespace CEC - void SignalOpcode(cec_opcode opcode); - bool WaitForOpcode(cec_opcode opcode); - -+ virtual bool TransmitSystemAudioModeRequest(const cec_logical_address initiator); -+ - CCECAudioSystem * AsAudioSystem(void); - static CCECAudioSystem * AsAudioSystem(CCECBusDevice *device); - CCECPlaybackDevice * AsPlaybackDevice(void); -diff --git a/src/libcec/env.h.in b/src/libcec/env.h.in -index 0496aa0..836a4ce 100644 ---- a/src/libcec/env.h.in -+++ b/src/libcec/env.h.in -@@ -66,6 +66,9 @@ - /* Define to 1 for Raspberry Pi support */ - #cmakedefine HAVE_RPI_API @HAVE_RPI_API@ - -+/* Define to 1 for iMX6 support */ -+#cmakedefine HAVE_IMX_API @HAVE_IMX_API@ -+ - /* Define to 1 for TDA995x support */ - #cmakedefine HAVE_TDA995X_API @HAVE_TDA995X_API@ - -diff --git a/src/libcec/implementations/CECCommandHandler.cpp b/src/libcec/implementations/CECCommandHandler.cpp -index 2c2db21..59daaac 100644 ---- a/src/libcec/implementations/CECCommandHandler.cpp -+++ b/src/libcec/implementations/CECCommandHandler.cpp -@@ -62,6 +62,7 @@ CCECCommandHandler::CCECCommandHandler(CCECBusDevice *busDevice, - m_iTransmitRetries(iTransmitRetries), - m_bHandlerInited(false), - m_bOPTSendDeckStatusUpdateOnActiveSource(false), -+ m_bOPTSendMenuStatusUpdateOnActiveSource(true), - m_vendorId(CEC_VENDOR_UNKNOWN), - m_iActiveSourcePending(iActiveSourcePending), - m_iPowerStatusRequested(0) -@@ -1132,6 +1133,19 @@ bool CCECCommandHandler::TransmitAudioStatus(const cec_logical_address iInitiato - return Transmit(command, false, bIsReply); - } - -+bool CCECCommandHandler::TransmitSystemAudioModeRequest(const cec_logical_address iInitiator, uint16_t iPhysicalAddress, bool bIsReply) -+{ -+ cec_command command; -+ cec_command::Format(command, iInitiator, CECDEVICE_AUDIOSYSTEM, CEC_OPCODE_SYSTEM_AUDIO_MODE_REQUEST); -+ command.parameters.PushBack((uint8_t) ((iPhysicalAddress >> 8) & 0xFF)); -+ command.parameters.PushBack((uint8_t) (iPhysicalAddress & 0xFF)); -+ -+ if (Transmit(command, true, bIsReply)) -+ return true; -+ -+ return false; -+} -+ - bool CCECCommandHandler::TransmitSetSystemAudioMode(const cec_logical_address iInitiator, const cec_logical_address iDestination, cec_system_audio_status state, bool bIsReply) - { - cec_command command; -@@ -1293,7 +1307,7 @@ bool CCECCommandHandler::ActivateSource(bool bTransmitDelayedCommandsOnly /* = f - if (!bActiveSourceFailed && bSourceSwitchAllowed) - { - bActiveSourceFailed = !m_busDevice->TransmitActiveSource(false); -- if (bTvPresent && !bActiveSourceFailed) -+ if (bTvPresent && !bActiveSourceFailed && SendMenuStatusUpdateOnActiveSource()) - m_busDevice->TransmitMenuState(CECDEVICE_TV, false); - - // update the deck status for playback devices -diff --git a/src/libcec/implementations/CECCommandHandler.h b/src/libcec/implementations/CECCommandHandler.h -index 31da3e7..cd3afa3 100644 ---- a/src/libcec/implementations/CECCommandHandler.h -+++ b/src/libcec/implementations/CECCommandHandler.h -@@ -60,7 +60,8 @@ namespace CEC - virtual bool HandleCommand(const cec_command &command); - virtual cec_vendor_id GetVendorId(void) { return m_vendorId; }; - virtual void SetVendorId(cec_vendor_id vendorId) { m_vendorId = vendorId; } -- static bool HasSpecificHandler(cec_vendor_id vendorId) { return vendorId == CEC_VENDOR_LG || vendorId == CEC_VENDOR_SAMSUNG || vendorId == CEC_VENDOR_PANASONIC || vendorId == CEC_VENDOR_PHILIPS || vendorId == CEC_VENDOR_SHARP || vendorId == CEC_VENDOR_SHARP2 || vendorId == CEC_VENDOR_TOSHIBA || vendorId == CEC_VENDOR_TOSHIBA2 || vendorId == CEC_VENDOR_ONKYO;} -+ static bool HasSpecificHandler(cec_vendor_id vendorId) { return vendorId == CEC_VENDOR_LG || vendorId == CEC_VENDOR_SAMSUNG || vendorId == CEC_VENDOR_PANASONIC || vendorId == CEC_VENDOR_PHILIPS || vendorId == CEC_VENDOR_SHARP || vendorId == CEC_VENDOR_SHARP2 || vendorId == CEC_VENDOR_TOSHIBA || vendorId == CEC_VENDOR_TOSHIBA2 || vendorId == CEC_VENDOR_ONKYO -+ || vendorId == CEC_VENDOR_GRUNDIG; } - - virtual bool InitHandler(void) { return true; } - virtual bool ActivateSource(bool bTransmitDelayedCommandsOnly = false); -@@ -89,6 +90,7 @@ namespace CEC - virtual bool TransmitPowerState(const cec_logical_address iInitiator, const cec_logical_address iDestination, cec_power_status state, bool bIsReply); - virtual bool TransmitVendorID(const cec_logical_address iInitiator, const cec_logical_address iDestination, uint64_t iVendorId, bool bIsReply); - virtual bool TransmitAudioStatus(const cec_logical_address iInitiator, const cec_logical_address iDestination, uint8_t state, bool bIsReply); -+ virtual bool TransmitSystemAudioModeRequest(const cec_logical_address iInitiator, uint16_t iPhysicalAddress, bool bIsReply); - virtual bool TransmitSetSystemAudioMode(const cec_logical_address iInitiator, const cec_logical_address iDestination, cec_system_audio_status state, bool bIsReply); - virtual bool TransmitSystemAudioModeStatus(const cec_logical_address iInitiator, const cec_logical_address iDestination, cec_system_audio_status state, bool bIsReply); - virtual bool TransmitDeckStatus(const cec_logical_address iInitiator, const cec_logical_address iDestination, cec_deck_info state, bool bIsReply); -@@ -96,6 +98,7 @@ namespace CEC - virtual bool TransmitKeyRelease(const cec_logical_address iInitiator, const cec_logical_address iDestination, bool bWait = true); - virtual bool TransmitSetStreamPath(uint16_t iStreamPath, bool bIsReply); - virtual bool SendDeckStatusUpdateOnActiveSource(void) const { return m_bOPTSendDeckStatusUpdateOnActiveSource; }; -+ virtual bool SendMenuStatusUpdateOnActiveSource(void) const { return m_bOPTSendMenuStatusUpdateOnActiveSource; }; - - virtual void ScheduleActivateSource(uint64_t iDelay); - -@@ -164,6 +167,7 @@ namespace CEC - int8_t m_iTransmitRetries; - bool m_bHandlerInited; - bool m_bOPTSendDeckStatusUpdateOnActiveSource; -+ bool m_bOPTSendMenuStatusUpdateOnActiveSource; - cec_vendor_id m_vendorId; - int64_t m_iActiveSourcePending; - P8PLATFORM::CMutex m_mutex; -diff --git a/src/libcec/implementations/GRCommandHandler.cpp b/src/libcec/implementations/GRCommandHandler.cpp -new file mode 100644 -index 0000000..55857a3 ---- /dev/null -+++ b/src/libcec/implementations/GRCommandHandler.cpp -@@ -0,0 +1,93 @@ -+/* -+ * This file is part of the libCEC(R) library. -+ * -+ * libCEC(R) is Copyright (C) 2011-2015 Pulse-Eight Limited. All rights reserved. -+ * libCEC(R) is an original work, containing original code. -+ * -+ * libCEC(R) is a trademark of Pulse-Eight Limited. -+ * -+ * This program is dual-licensed; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -+ * 02110-1301 USA -+ * -+ * -+ * Alternatively, you can license this library under a commercial license, -+ * please contact Pulse-Eight Licensing for more information. -+ * -+ * For more information contact: -+ * Pulse-Eight Licensing -+ * http://www.pulse-eight.com/ -+ * http://www.pulse-eight.net/ -+ */ -+ -+#include "env.h" -+#include "GRCommandHandler.h" -+ -+#include "devices/CECBusDevice.h" -+#include "CECProcessor.h" -+#include "LibCEC.h" -+#include "CECClient.h" -+ -+using namespace CEC; -+ -+#define LIB_CEC m_busDevice->GetProcessor()->GetLib() -+#define ToString(p) LIB_CEC->ToString(p) -+ -+CGRCommandHandler::CGRCommandHandler(CCECBusDevice *busDevice, -+ int32_t iTransmitTimeout /* = CEC_DEFAULT_TRANSMIT_TIMEOUT */, -+ int32_t iTransmitWait /* = CEC_DEFAULT_TRANSMIT_WAIT */, -+ int8_t iTransmitRetries /* = CEC_DEFAULT_TRANSMIT_RETRIES */, -+ int64_t iActiveSourcePending /* = 0 */) : -+ CCECCommandHandler(busDevice, iTransmitTimeout, iTransmitWait, iTransmitRetries, iActiveSourcePending) -+{ -+ m_vendorId = CEC_VENDOR_GRUNDIG; -+ m_bOPTSendMenuStatusUpdateOnActiveSource = false; -+ -+ m_busDevice->SetCecVersion(CEC_VERSION_1_3A); -+ -+ /* Grundig devices return "" as language */ -+ cec_menu_language lang; -+ lang.device = m_busDevice->GetLogicalAddress(); -+ snprintf(lang.language, 4, "eng"); -+ m_busDevice->SetMenuLanguage(lang); -+} -+ -+bool CGRCommandHandler::InitHandler(void) -+{ -+ if (m_bHandlerInited) -+ return true; -+ m_bHandlerInited = true; -+ -+ if (m_busDevice->GetLogicalAddress() != CECDEVICE_TV) -+ return true; -+ -+ CCECBusDevice *primary = m_processor->GetPrimaryDevice(); -+ if (primary && primary->GetLogicalAddress() != CECDEVICE_UNREGISTERED) -+ { -+ /* imitate Toshiba devices */ -+ if (m_busDevice->GetLogicalAddress() != primary->GetLogicalAddress()) -+ { -+ primary->SetVendorId(CEC_VENDOR_GRUNDIG); -+ primary->ReplaceHandler(false); -+ } -+ -+ if (m_busDevice->GetLogicalAddress() == CECDEVICE_TV) -+ { -+ /* send the vendor id */ -+ primary->TransmitVendorID(CECDEVICE_BROADCAST, false, false); -+ } -+ } -+ -+ return true; -+} -diff --git a/src/libcec/implementations/GRCommandHandler.h b/src/libcec/implementations/GRCommandHandler.h -new file mode 100644 -index 0000000..e01c7fc ---- /dev/null -+++ b/src/libcec/implementations/GRCommandHandler.h -@@ -0,0 +1,53 @@ -+#pragma once -+/* -+ * This file is part of the libCEC(R) library. -+ * -+ * libCEC(R) is Copyright (C) 2011-2015 Pulse-Eight Limited. All rights reserved. -+ * libCEC(R) is an original work, containing original code. -+ * -+ * libCEC(R) is a trademark of Pulse-Eight Limited. -+ * -+ * This program is dual-licensed; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -+ * 02110-1301 USA -+ * -+ * -+ * Alternatively, you can license this library under a commercial license, -+ * please contact Pulse-Eight Licensing for more information. -+ * -+ * For more information contact: -+ * Pulse-Eight Licensing -+ * http://www.pulse-eight.com/ -+ * http://www.pulse-eight.net/ -+ */ -+ -+#include "env.h" -+#include "CECCommandHandler.h" -+#include "p8-platform/threads/threads.h" -+ -+namespace CEC -+{ -+ class CGRCommandHandler : public CCECCommandHandler -+ { -+ public: -+ CGRCommandHandler(CCECBusDevice *busDevice, -+ int32_t iTransmitTimeout = CEC_DEFAULT_TRANSMIT_TIMEOUT, -+ int32_t iTransmitWait = CEC_DEFAULT_TRANSMIT_WAIT, -+ int8_t iTransmitRetries = CEC_DEFAULT_TRANSMIT_RETRIES, -+ int64_t iActiveSourcePending = 0); -+ -+ bool InitHandler(void); -+ virtual ~CGRCommandHandler(void) {}; -+ }; -+}; -diff --git a/support/git-rev.sh b/support/git-rev.sh -index db682c1..15b6a23 100755 ---- a/support/git-rev.sh -+++ b/support/git-rev.sh -@@ -2,7 +2,7 @@ - - ## cmake doesn't read the variable when it doesn't end with a newline, and I haven't figured out how to have it add a newline directly... - if git rev-parse --git-dir > /dev/null 2>&1; then -- last_tag=`git describe --tags --abbrev=0` -+ last_tag=`git describe --tags --abbrev=0 --all` - last_hash=`git --no-pager log --abbrev=7 -n 1 --pretty=format:"%h"` - commits_since_tag=`git log ${last_tag}..HEAD --oneline | wc -l` - git_dirty=`git diff HEAD | wc -l` --- -2.7.1 - From 93cf36d4953a470d3600dee2079bafe6764d071e Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Wed, 30 Nov 2016 22:16:21 +0000 Subject: [PATCH 03/11] ffmpeg: update to 3.1.6-Krypton-Beta6 --- packages/multimedia/ffmpeg/package.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/multimedia/ffmpeg/package.mk b/packages/multimedia/ffmpeg/package.mk index 0310f92350..c435428513 100644 --- a/packages/multimedia/ffmpeg/package.mk +++ b/packages/multimedia/ffmpeg/package.mk @@ -18,7 +18,7 @@ PKG_NAME="ffmpeg" # Current branch is: release/3.1-xbmc -PKG_VERSION="0cf9269" +PKG_VERSION="544eaf0" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="LGPLv2.1+" From 2ec3835432648fd815fd5f8ba3322d2b57ff67a1 Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Wed, 30 Nov 2016 22:16:21 +0000 Subject: [PATCH 04/11] kodi-binary-addons: pvr.octonet initial package --- .../kodi-binary-addons/pvr.octonet/package.mk | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 packages/mediacenter/kodi-binary-addons/pvr.octonet/package.mk diff --git a/packages/mediacenter/kodi-binary-addons/pvr.octonet/package.mk b/packages/mediacenter/kodi-binary-addons/pvr.octonet/package.mk new file mode 100644 index 0000000000..9773b156cb --- /dev/null +++ b/packages/mediacenter/kodi-binary-addons/pvr.octonet/package.mk @@ -0,0 +1,44 @@ +################################################################################ +# This file is part of LibreELEC - http://www.libreelec.tv +# Copyright (C) 2016 Team LibreELEC +# +# LibreELEC is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# LibreELEC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LibreELEC. If not, see . +################################################################################ + +PKG_NAME="pvr.octonet" +PKG_VERSION="8549a31" +PKG_REV="1" +PKG_ARCH="any" +PKG_LICENSE="GPL" +PKG_SITE="http://www.kodi.tv" +PKG_URL="https://github.com/DigitalDevices/pvr.octonet/archive/$PKG_VERSION.tar.gz" +PKG_DEPENDS_TARGET="toolchain kodi-platform jsoncpp" +PKG_SECTION="" +PKG_SHORTDESC="A pvr plugin for DigitalDevices Octonet Sat>IP servers" +PKG_LONGDESC="A pvr plugin for DigitalDevices Octonet Sat>IP servers" +PKG_AUTORECONF="no" + +PKG_IS_ADDON="yes" +PKG_ADDON_TYPE="xbmc.pvrclient" + +PKG_CMAKE_OPTS_TARGET="-DCMAKE_MODULE_PATH=$SYSROOT_PREFIX/usr/lib/kodi \ + -DCMAKE_PREFIX_PATH=$SYSROOT_PREFIX/usr" + +addon() { + mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/ + cp -R $PKG_BUILD/.install_pkg/usr/share/kodi/addons/$PKG_NAME/* $ADDON_BUILD/$PKG_ADDON_ID/ + + ADDONSO=$(xmlstarlet sel -t -v "/addon/extension/@library_linux" $ADDON_BUILD/$PKG_ADDON_ID/addon.xml) + cp -L $PKG_BUILD/.install_pkg/usr/lib/kodi/addons/$PKG_NAME/$ADDONSO $ADDON_BUILD/$PKG_ADDON_ID/ +} From a2848577badfce35512be64d650121af74c00fd6 Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Wed, 30 Nov 2016 22:16:21 +0000 Subject: [PATCH 05/11] kodi/kodi-theme-Estuary: LibreELEC branding supported upstream --- .../mediacenter/kodi-theme-Estuary/package.mk | 3 --- ...y-0001-add_le_settings_to_settingscreen.patch | 15 --------------- .../sources/media/icons/settings/libreelec.png | Bin 2313 -> 0 bytes 3 files changed, 18 deletions(-) delete mode 100644 packages/mediacenter/kodi-theme-Estuary/patches/kodi-theme-Estuary-0001-add_le_settings_to_settingscreen.patch delete mode 100644 packages/mediacenter/kodi-theme-Estuary/sources/media/icons/settings/libreelec.png diff --git a/packages/mediacenter/kodi-theme-Estuary/package.mk b/packages/mediacenter/kodi-theme-Estuary/package.mk index 437833fd19..903fb23075 100644 --- a/packages/mediacenter/kodi-theme-Estuary/package.mk +++ b/packages/mediacenter/kodi-theme-Estuary/package.mk @@ -56,7 +56,4 @@ makeinstall_target() { for theme in themes/*; do cp $(basename $theme).xbt $INSTALL/usr/share/kodi/addons/skin.estuary/media done - -# Rebrand - sed -e "s,@DISTRONAME@,$DISTRONAME,g" -i $INSTALL/usr/share/kodi/addons/skin.estuary/1080i/Settings.xml } diff --git a/packages/mediacenter/kodi-theme-Estuary/patches/kodi-theme-Estuary-0001-add_le_settings_to_settingscreen.patch b/packages/mediacenter/kodi-theme-Estuary/patches/kodi-theme-Estuary-0001-add_le_settings_to_settingscreen.patch deleted file mode 100644 index 7d094a5436..0000000000 --- a/packages/mediacenter/kodi-theme-Estuary/patches/kodi-theme-Estuary-0001-add_le_settings_to_settingscreen.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/1080i/Settings.xml b/1080i/Settings.xml ---- a/1080i/Settings.xml -+++ b/1080i/Settings.xml -@@ -134,6 +134,11 @@ - icons/settings/system.png - - -+ -+ RunAddon(service.libreelec.settings) -+ icons/settings/libreelec.png -+ -+ - - ActivateWindow(systeminfo) - icons/settings/sysinfo.png diff --git a/packages/mediacenter/kodi-theme-Estuary/sources/media/icons/settings/libreelec.png b/packages/mediacenter/kodi-theme-Estuary/sources/media/icons/settings/libreelec.png deleted file mode 100644 index 7dfd90398bd76a8f977f40f58cd4f9b90c2de7c6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2313 zcmb_e30D(o7LBq6Bnha9EE4ui1VKp#!>)uywm8BFvV*b&4Ny&FZvqAd84+!Wpd>;^ zj0|dUL5M(DGJrNq0@zGKKq25jkaYlAWYMn7Kj?F&&Z%>%?tS;Z_tp2lcdFoT1b3K< zwh9CSfq9&9@r6M4=*VuUB8bc$(>H)XpaUK*r~jVDSopMXZ|FCzyousFa{BVl095Uo zSoI%JK=GY=pBUP%o`$*4hgd~mA~0z?mj?FAVT|e>pFVD_4c8Sss0i>C!FJDw%JTf# ztKHtC!lcn-1wFn^`%ipvEIXEK>EW|t;ItK9tjU(jEqbgR?Uq)Wk8BTqbDs7{Gt3aK!jx=3R}g`Em?EM?AIL*62kbzI!V;-K%u-+Lvg$_CddINw!j+kuGL46 z4ix(DBQzjnvSVUU*2U|lFtwE7=J&Gjm?j)f>?8~HV)+o=>T*j`WK`e12Bww|oG_9f zV~jg~ehbQ<>6SdMl-XAlw>o1oj^n;q%2fG}`v(dsP{I}rw70c-qnBgnaT(3p=vt0N zPfZ_T51ThdeHYoK z(xX1v13E~ntjfvXD~yI+3EZ1j@h4ktbgC-XLwHY;Cc8?~M=2_Bk_jpd+epfe1oyxs zy`s4***G{a=IXkH8@pvuwtSvQM&= za7Qh(!vE4;?c1{|BzwOJAhxcFPM+}IY^m3siC&I8{G7fI7pLi2EW~&Z8Dgva6x~S{ zpCgAF>s5Ww((E%`su#&&Y&_T>p6H8pok+G)nv11ub1&AlX9pwxn=|H&vGoEdi4Kqe z)6^x`FAG`LncO=uHC1g0Y1bn=c!*)Q(}%M_ky`oSxm-WZPmvJ?U)32#H)5{7kqo(} z9=w1bQIy_fY8^4bB@Z5v7t*YGHc3Rc7Nu&7rc3RIUMB(qweoW>cr~{c)n2mZ4=^w{ zVupf&*++JJ=M6>`rG-qbwf&5y88{@f2b7YDZfr13Xd2OAPEo4ujJd1i1H~x0zZCGIB5eY*HXlYlE%&pYp=YxoHJ=V(Z9JuposS712S!^=bDj zvU=_U^6B=tl8p&|M|eS|e`OK}(N80GzM0{ zd;77pnJ+{ozJ*u+@;>}^Eha%46t=FHB`C{xIUwNUUu^nNl#jrV{XVAShZ^%oY$KQA z*sF#(M(}it@(Ti&e??g^BEX7w>aogpFemw?TkShT!0@q(rZI@FSf5inO+av%y zP`c`sJh@~W46NHG@Fs>|FDjYLb&jW(O6Ie;)Q%I;^s`Z-g0}4$UR*MR+VLuCl#QJ2 z)GE?u2;ZY{y7+bRr6&Z&6p{C3>aBc!YxFq(`E2KdqWz4qB6ncMZ)Cna03{G+0vQf) z9@8?e*&+5J?$Qh1mn;g8iTH8}DY5-YI7TJY8Wr*zKDZOzk|+Dvnu{~URTcPxabr9e zviR(PG@&Kuj+Hd4g!4A%-%)hS`f&V1T=ugYAGd!#`=CAm8x8}H##3Wtk0^9KV>P3P z()^8rYIgW)D>Cmme&M7h@WFy+%#KZSPTbebNw+YyE_0SvGmaR_j-4$l!Xa&hjpEJcP6Vo*X{3%MjL%VmTB8Z@; z(nJq2XOikZZ`%odQF^1SC9-&HJ$UPGv!&+sU6XWC+MbX{1p9`@)5EhVnfll_nmqC3 zdWIqPtC18Ts8&k&yxKRaUT!w^@UB_UCuz*(Ih&aBt*FJiq*T(6o#_`&rM{FSc@uY( zow7Sox!_wEyhEb#PmP=W9)T{yOBu$x$v2gknlU4dt##COnG=~8>zG&IMFT+PFlk;p z*9f~)I6N;Yry61HT}UZOFrK=$o{_bkEg86;SACN&5FFNJMykAulX!#7ll^ozff@+F zU&YP*1_IOj!8xqW_yKn7L1v`lDAgJqfOEb*+d?vfF>v)1$rgAi;p*j0#EZW-KM@*Y zf$**IoM&Tn&IbP_>1PFmM;osO(KmVpxUN`H{GIAod7r}pzpM8>3e^uK81(}2Y0quR z(1XlGMYYcGi7+Z*b$dJmCljH`@aqa zX5Cg3G<2EQ*wMR^q1)0>JDjszW_Jd!#*W|Y5Bjf{PJz$;%~%j;n?nil*d-RYG~xnP zGW2d$04o|eWf>!1-B3|a3k2~QpW*-yM~9ch#1byi;WMY$KHIpsvV^Ol{bzpz{!j70 a7W|M)SoV2ak-AYOv-EH!xYRmFQ2zj9hZ>py From 05ff287b2b0a6e6f072783de85c12948f65662fa Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Wed, 30 Nov 2016 22:16:21 +0000 Subject: [PATCH 06/11] RPi/RPi2: Update kodi support patches --- .../RPi/patches/kodi/kodi-001-backport.patch | 5186 ++++++----------- .../RPi2/patches/kodi/kodi-001-backport.patch | 5186 ++++++----------- 2 files changed, 3434 insertions(+), 6938 deletions(-) diff --git a/projects/RPi/patches/kodi/kodi-001-backport.patch b/projects/RPi/patches/kodi/kodi-001-backport.patch index be742b6ec4..b84fadf6ce 100644 --- a/projects/RPi/patches/kodi/kodi-001-backport.patch +++ b/projects/RPi/patches/kodi/kodi-001-backport.patch @@ -1,146 +1,273 @@ -From 8d1013867be79401fbf6031a77c9559836300481 Mon Sep 17 00:00:00 2001 +From 78147d45acfa1e8416b3c86888aaf68d64bb584e Mon Sep 17 00:00:00 2001 From: popcornmix -Date: Tue, 5 May 2015 17:27:39 +0100 -Subject: [PATCH 01/73] build: Allow installed links to be overwritten +Date: Fri, 11 Nov 2016 14:03:29 +0000 +Subject: [PATCH 01/63] cec: fixup strings after PR 10775 --- - tools/depends/target/Makefile | 72 +++++++++++++++++++-------------------- - tools/depends/xbmc-addons.include | 36 ++++++++++---------- - 2 files changed, 54 insertions(+), 54 deletions(-) + system/peripherals.xml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) -diff --git a/tools/depends/target/Makefile b/tools/depends/target/Makefile -index c35e4849aa2651868e06046d397e0c3126b6b829..9bca1889b127a690082c2fb55625fc9a385a97d1 100644 ---- a/tools/depends/target/Makefile -+++ b/tools/depends/target/Makefile -@@ -130,41 +130,41 @@ distclean:: - for d in $(DEPENDS); do $(MAKE) -C $$d distclean; done - - linux-system-libs-egl: -- [ -f $(PREFIX)/lib/pkgconfig/egl.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/egl.pc $(PREFIX)/lib/pkgconfig/egl.pc -- [ -f $(PREFIX)/lib/pkgconfig/damageproto.pc ] || ln -s /usr/share/pkgconfig/damageproto.pc $(PREFIX)/lib/pkgconfig/damageproto.pc -- [ -f $(PREFIX)/lib/pkgconfig/fixesproto.pc ] || ln -s /usr/share/pkgconfig/fixesproto.pc $(PREFIX)/lib/pkgconfig/fixesproto.pc -- [ -f $(PREFIX)/lib/pkgconfig/x11-xcb.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/x11-xcb.pc $(PREFIX)/lib/pkgconfig/x11-xcb.pc -- [ -f $(PREFIX)/lib/pkgconfig/xcb-dri2.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xcb-dri2.pc $(PREFIX)/lib/pkgconfig/xcb-dri2.pc -- [ -f $(PREFIX)/lib/pkgconfig/xcb-dri3.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xcb-dri3.pc $(PREFIX)/lib/pkgconfig/xcb-dri3.pc -- [ -f $(PREFIX)/lib/pkgconfig/xcb-glx.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xcb-glx.pc $(PREFIX)/lib/pkgconfig/xcb-glx.pc -- [ -f $(PREFIX)/lib/pkgconfig/xcb-xfixes.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xcb-xfixes.pc $(PREFIX)/lib/pkgconfig/xcb-xfixes.pc -- [ -f $(PREFIX)/lib/pkgconfig/xcb-present.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xcb-present.pc $(PREFIX)/lib/pkgconfig/xcb-present.pc -- [ -f $(PREFIX)/lib/pkgconfig/xcb-randr.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xcb-randr.pc $(PREFIX)/lib/pkgconfig/xcb-randr.pc -- [ -f $(PREFIX)/lib/pkgconfig/xcb-render.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xcb-render.pc $(PREFIX)/lib/pkgconfig/xcb-render.pc -- [ -f $(PREFIX)/lib/pkgconfig/xcb-shape.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xcb-shape.pc $(PREFIX)/lib/pkgconfig/xcb-shape.pc -- [ -f $(PREFIX)/lib/pkgconfig/xcb-sync.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xcb-sync.pc $(PREFIX)/lib/pkgconfig/xcb-sync.pc -- [ -f $(PREFIX)/lib/pkgconfig/xdamage.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xdamage.pc $(PREFIX)/lib/pkgconfig/xdamage.pc -- [ -f $(PREFIX)/lib/pkgconfig/xf86vidmodeproto.pc ] || ln -s /usr/share/pkgconfig/xf86vidmodeproto.pc $(PREFIX)/lib/pkgconfig/xf86vidmodeproto.pc -- [ -f $(PREFIX)/lib/pkgconfig/xfixes.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xfixes.pc $(PREFIX)/lib/pkgconfig/xfixes.pc -- [ -f $(PREFIX)/lib/pkgconfig/xshmfence.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xshmfence.pc $(PREFIX)/lib/pkgconfig/xshmfence.pc -- [ -f $(PREFIX)/lib/pkgconfig/xxf86vm.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xxf86vm.pc $(PREFIX)/lib/pkgconfig/xxf86vm.pc -+ [ -f $(PREFIX)/lib/pkgconfig/egl.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/egl.pc $(PREFIX)/lib/pkgconfig/egl.pc -+ [ -f $(PREFIX)/lib/pkgconfig/damageproto.pc ] || ln -sf /usr/share/pkgconfig/damageproto.pc $(PREFIX)/lib/pkgconfig/damageproto.pc -+ [ -f $(PREFIX)/lib/pkgconfig/fixesproto.pc ] || ln -sf /usr/share/pkgconfig/fixesproto.pc $(PREFIX)/lib/pkgconfig/fixesproto.pc -+ [ -f $(PREFIX)/lib/pkgconfig/x11-xcb.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/x11-xcb.pc $(PREFIX)/lib/pkgconfig/x11-xcb.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xcb-dri2.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xcb-dri2.pc $(PREFIX)/lib/pkgconfig/xcb-dri2.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xcb-dri3.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xcb-dri3.pc $(PREFIX)/lib/pkgconfig/xcb-dri3.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xcb-glx.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xcb-glx.pc $(PREFIX)/lib/pkgconfig/xcb-glx.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xcb-xfixes.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xcb-xfixes.pc $(PREFIX)/lib/pkgconfig/xcb-xfixes.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xcb-present.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xcb-present.pc $(PREFIX)/lib/pkgconfig/xcb-present.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xcb-randr.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xcb-randr.pc $(PREFIX)/lib/pkgconfig/xcb-randr.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xcb-render.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xcb-render.pc $(PREFIX)/lib/pkgconfig/xcb-render.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xcb-shape.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xcb-shape.pc $(PREFIX)/lib/pkgconfig/xcb-shape.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xcb-sync.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xcb-sync.pc $(PREFIX)/lib/pkgconfig/xcb-sync.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xdamage.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xdamage.pc $(PREFIX)/lib/pkgconfig/xdamage.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xf86vidmodeproto.pc ] || ln -sf /usr/share/pkgconfig/xf86vidmodeproto.pc $(PREFIX)/lib/pkgconfig/xf86vidmodeproto.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xfixes.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xfixes.pc $(PREFIX)/lib/pkgconfig/xfixes.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xshmfence.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xshmfence.pc $(PREFIX)/lib/pkgconfig/xshmfence.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xxf86vm.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xxf86vm.pc $(PREFIX)/lib/pkgconfig/xxf86vm.pc - - linux-system-libs: linux-system-libs-egl -- [ -f $(PREFIX)/lib/pkgconfig/x11.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/x11.pc $(PREFIX)/lib/pkgconfig/x11.pc -- [ -f $(PREFIX)/lib/pkgconfig/xproto.pc ] || ln -s /usr/share/pkgconfig/xproto.pc $(PREFIX)/lib/pkgconfig/xproto.pc -- [ -f $(PREFIX)/lib/pkgconfig/kbproto.pc ] || ln -s /usr/share/pkgconfig/kbproto.pc $(PREFIX)/lib/pkgconfig/kbproto.pc -- [ -f $(PREFIX)/lib/pkgconfig/xcb.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xcb.pc $(PREFIX)/lib/pkgconfig/xcb.pc -- [ -f $(PREFIX)/lib/pkgconfig/pthread-stubs.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/pthread-stubs.pc $(PREFIX)/lib/pkgconfig/pthread-stubs.pc -- [ -f $(PREFIX)/lib/pkgconfig/xau.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xau.pc $(PREFIX)/lib/pkgconfig/xau.pc -- [ -f $(PREFIX)/lib/pkgconfig/xdmcp.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xdmcp.pc $(PREFIX)/lib/pkgconfig/xdmcp.pc -- [ -f $(PREFIX)/lib/pkgconfig/xext.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xext.pc $(PREFIX)/lib/pkgconfig/xext.pc -- [ -f $(PREFIX)/lib/pkgconfig/xextproto.pc ] || ln -s /usr/share/pkgconfig/xextproto.pc $(PREFIX)/lib/pkgconfig/xextproto.pc -- [ -f $(PREFIX)/lib/pkgconfig/xrandr.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xrandr.pc $(PREFIX)/lib/pkgconfig/xrandr.pc -- [ -f $(PREFIX)/lib/pkgconfig/xrender.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xrender.pc $(PREFIX)/lib/pkgconfig/xrender.pc -- [ -f $(PREFIX)/lib/pkgconfig/randrproto.pc ] || ln -s /usr/share/pkgconfig/randrproto.pc $(PREFIX)/lib/pkgconfig/randrproto.pc -- [ -f $(PREFIX)/lib/pkgconfig/renderproto.pc ] || ln -s /usr/share/pkgconfig/renderproto.pc $(PREFIX)/lib/pkgconfig/renderproto.pc -- [ -f $(PREFIX)/lib/pkgconfig/xt.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xt.pc $(PREFIX)/lib/pkgconfig/xt.pc -- [ -f $(PREFIX)/lib/pkgconfig/ice.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/ice.pc $(PREFIX)/lib/pkgconfig/ice.pc -- [ -f $(PREFIX)/lib/pkgconfig/sm.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/sm.pc $(PREFIX)/lib/pkgconfig/sm.pc -- [ -f $(PREFIX)/lib/pkgconfig/xmu.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xmu.pc $(PREFIX)/lib/pkgconfig/xmu.pc -- [ -f $(PREFIX)/lib/pkgconfig/libdrm.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/libdrm.pc $(PREFIX)/lib/pkgconfig/libdrm.pc -+ [ -f $(PREFIX)/lib/pkgconfig/x11.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/x11.pc $(PREFIX)/lib/pkgconfig/x11.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xproto.pc ] || ln -sf /usr/share/pkgconfig/xproto.pc $(PREFIX)/lib/pkgconfig/xproto.pc -+ [ -f $(PREFIX)/lib/pkgconfig/kbproto.pc ] || ln -sf /usr/share/pkgconfig/kbproto.pc $(PREFIX)/lib/pkgconfig/kbproto.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xcb.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xcb.pc $(PREFIX)/lib/pkgconfig/xcb.pc -+ [ -f $(PREFIX)/lib/pkgconfig/pthread-stubs.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/pthread-stubs.pc $(PREFIX)/lib/pkgconfig/pthread-stubs.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xau.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xau.pc $(PREFIX)/lib/pkgconfig/xau.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xdmcp.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xdmcp.pc $(PREFIX)/lib/pkgconfig/xdmcp.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xext.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xext.pc $(PREFIX)/lib/pkgconfig/xext.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xextproto.pc ] || ln -sf /usr/share/pkgconfig/xextproto.pc $(PREFIX)/lib/pkgconfig/xextproto.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xrandr.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xrandr.pc $(PREFIX)/lib/pkgconfig/xrandr.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xrender.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xrender.pc $(PREFIX)/lib/pkgconfig/xrender.pc -+ [ -f $(PREFIX)/lib/pkgconfig/randrproto.pc ] || ln -sf /usr/share/pkgconfig/randrproto.pc $(PREFIX)/lib/pkgconfig/randrproto.pc -+ [ -f $(PREFIX)/lib/pkgconfig/renderproto.pc ] || ln -sf /usr/share/pkgconfig/renderproto.pc $(PREFIX)/lib/pkgconfig/renderproto.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xt.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xt.pc $(PREFIX)/lib/pkgconfig/xt.pc -+ [ -f $(PREFIX)/lib/pkgconfig/ice.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/ice.pc $(PREFIX)/lib/pkgconfig/ice.pc -+ [ -f $(PREFIX)/lib/pkgconfig/sm.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/sm.pc $(PREFIX)/lib/pkgconfig/sm.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xmu.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xmu.pc $(PREFIX)/lib/pkgconfig/xmu.pc -+ [ -f $(PREFIX)/lib/pkgconfig/libdrm.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/libdrm.pc $(PREFIX)/lib/pkgconfig/libdrm.pc -diff --git a/tools/depends/xbmc-addons.include b/tools/depends/xbmc-addons.include -index 5eb06d2001cfd049fce02b9dacf20f4fc76252d6..499d41f3c4c2307c3275dc3562d37def8ea9eb16 100644 ---- a/tools/depends/xbmc-addons.include -+++ b/tools/depends/xbmc-addons.include -@@ -77,23 +77,23 @@ $(TOOLCHAIN_FILE): $(abs_top_srcdir)/target/Toolchain_binaddons.cmake - - linux-system-libs: - mkdir -p $(ADDON_DEPS_DIR)/lib/pkgconfig $(ADDON_DEPS_DIR)/include -- [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/x11.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/x*.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/ -- [ -f $(ADDON_DEPS_DIR)/lib/libX11.so ] || ln -s /usr/lib/$(HOST)/libX11.so* $(ADDON_DEPS_DIR)/lib/ -- [ -L $(ADDON_DEPS_DIR)/include/X11 ] || ln -s /usr/include/X11 $(ADDON_DEPS_DIR)/include/X11 -- [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/xproto.pc ] || ln -s /usr/share/pkgconfig/x*.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/ -- [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/kbproto.pc ] || ln -s /usr/share/pkgconfig/kbproto.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/kbproto.pc -- [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/damageproto.pc ] || ln -s /usr/share/pkgconfig/damageproto.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/damageproto.pc -- [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/fixesproto.pc ] || ln -s /usr/share/pkgconfig/fixesproto.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/fixesproto.pc -- [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/pthread-stubs.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/pthread-stubs.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/pthread-stubs.pc -- [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/ice.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/ice.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/ice.pc -- [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/sm.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/sm.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/sm.pc -- [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/libdrm.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/libdrm.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/libdrm.pc -- [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/gl.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/gl.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/gl.pc -- [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/glu.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/glu.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/glu.pc -- [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/glew.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/glew.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/glew.pc -+ [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/x11.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/x*.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/ -+ [ -f $(ADDON_DEPS_DIR)/lib/libX11.so ] || ln -sf /usr/lib/$(HOST)/libX11.so* $(ADDON_DEPS_DIR)/lib/ -+ [ -L $(ADDON_DEPS_DIR)/include/X11 ] || ln -sf /usr/include/X11 $(ADDON_DEPS_DIR)/include/X11 -+ [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/xproto.pc ] || ln -sf /usr/share/pkgconfig/x*.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/ -+ [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/kbproto.pc ] || ln -sf /usr/share/pkgconfig/kbproto.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/kbproto.pc -+ [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/damageproto.pc ] || ln -sf /usr/share/pkgconfig/damageproto.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/damageproto.pc -+ [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/fixesproto.pc ] || ln -sf /usr/share/pkgconfig/fixesproto.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/fixesproto.pc -+ [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/pthread-stubs.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/pthread-stubs.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/pthread-stubs.pc -+ [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/ice.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/ice.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/ice.pc -+ [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/sm.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/sm.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/sm.pc -+ [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/libdrm.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/libdrm.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/libdrm.pc -+ [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/gl.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/gl.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/gl.pc -+ [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/glu.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/glu.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/glu.pc -+ [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/glew.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/glew.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/glew.pc - [ -f $(ADDON_DEPS_DIR)/lib/libGL.so ] || \ -- (ln -s /usr/lib/$(HOST)/mesa $(ADDON_DEPS_DIR)/lib/mesa && ln -s $(ADDON_DEPS_DIR)/lib/mesa/libGL.so $(ADDON_DEPS_DIR)/lib/libGL.so) -- [ -f $(ADDON_DEPS_DIR)/lib/libGLEW.so ] || ln -s /usr/lib/$(HOST)/libGLEW.so* $(ADDON_DEPS_DIR)/lib/ -- [ -L $(ADDON_DEPS_DIR)/include/GL ] || ln -s /usr/include/GL $(ADDON_DEPS_DIR)/include/GL -- [ -f $(ADDON_DEPS_DIR)/lib/libm.so ] || ln -s /usr/lib/$(HOST)/libm.so $(ADDON_DEPS_DIR)/lib/ -+ (ln -sf /usr/lib/$(HOST)/mesa $(ADDON_DEPS_DIR)/lib/mesa && ln -sf $(ADDON_DEPS_DIR)/lib/mesa/libGL.so $(ADDON_DEPS_DIR)/lib/libGL.so) -+ [ -f $(ADDON_DEPS_DIR)/lib/libGLEW.so ] || ln -sf /usr/lib/$(HOST)/libGLEW.so* $(ADDON_DEPS_DIR)/lib/ -+ [ -L $(ADDON_DEPS_DIR)/include/GL ] || ln -sf /usr/include/GL $(ADDON_DEPS_DIR)/include/GL -+ [ -f $(ADDON_DEPS_DIR)/lib/libm.so ] || ln -sf /usr/lib/$(HOST)/libm.so $(ADDON_DEPS_DIR)/lib/ +diff --git a/system/peripherals.xml b/system/peripherals.xml +index ed707b6767f6fc9184adf2090810b5b1ad89d10d..d5704b249c3065b2980dc92c7c81dc7b384187bc 100644 +--- a/system/peripherals.xml ++++ b/system/peripherals.xml +@@ -16,7 +16,7 @@ + + + +- ++ + + + +@@ -24,7 +24,7 @@ + + + +- ++ + + -From c2d4af27ae0c490f8b3b21c40938f69eddb3b993 Mon Sep 17 00:00:00 2001 +From 1febcd53bb19499e0820cb7bcaaf39619d8a3666 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 28 Oct 2014 00:19:40 +0000 +Subject: [PATCH 02/63] [cec] Add settings for configuring button repeats + +--- + addons/resource.language.en_gb/resources/strings.po | 15 +++++++++++++++ + system/peripherals.xml | 4 +++- + xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 16 ++++++++++++++++ + 3 files changed, 34 insertions(+), 1 deletion(-) + +diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po +index abfc92bd5a9f1da9e2eed758a90416ce2d369e3b..15745a792a5a28c79c19effc4d9037e842535da6 100644 +--- a/addons/resource.language.en_gb/resources/strings.po ++++ b/addons/resource.language.en_gb/resources/strings.po +@@ -19714,3 +19714,18 @@ msgstr "" + msgctxt "#39010" + msgid "Select sort method" + msgstr "" ++ ++#: system/peripherals.xml ++msgctxt "#38050" ++msgid "Remote button press delay before repeating (ms)" ++msgstr "" ++ ++#: system/peripherals.xml ++msgctxt "#38051" ++msgid "Remote button press repeat rate (ms)" ++msgstr "" ++ ++#: system/peripherals.xml ++msgctxt "#38052" ++msgid "Remote button press release time (ms)" ++msgstr "" +diff --git a/system/peripherals.xml b/system/peripherals.xml +index d5704b249c3065b2980dc92c7c81dc7b384187bc..02b1a9ed6fce1986bd864bba09a9df0621f9e041 100644 +--- a/system/peripherals.xml ++++ b/system/peripherals.xml +@@ -31,7 +31,9 @@ + + + +- ++ ++ ++ + + + +diff --git a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp +index d032ffd707fee5eec035e90bdf618530f7215c37..30367a3fde956090afdca9930fa52e829f35046f 100644 +--- a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp ++++ b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp +@@ -1296,6 +1296,20 @@ void CPeripheralCecAdapter::SetConfigurationFromLibCEC(const CEC::libcec_configu + m_configuration.bActivateSource = config.bActivateSource; + bChanged |= SetSetting("activate_source", m_configuration.bActivateSource == 1); + ++#if defined(CEC_DOUBLE_TAP_TIMEOUT_MS_OLD) ++ m_configuration.iDoubleTapTimeout50Ms = config.iDoubleTapTimeout50Ms; ++ bChanged |= SetSetting("double_tap_timeout_ms", (int)m_configuration.iDoubleTapTimeout50Ms * 50); ++#else ++ m_configuration.iDoubleTapTimeoutMs = config.iDoubleTapTimeoutMs; ++ bChanged |= SetSetting("double_tap_timeout_ms", (int)m_configuration.iDoubleTapTimeoutMs); ++#endif ++ ++ m_configuration.iButtonRepeatRateMs = config.iButtonRepeatRateMs; ++ bChanged |= SetSetting("button_repeat_rate_ms", (int)m_configuration.iButtonRepeatRateMs); ++ ++ m_configuration.iButtonReleaseDelayMs = config.iButtonReleaseDelayMs; ++ bChanged |= SetSetting("button_release_delay_ms", (int)m_configuration.iButtonReleaseDelayMs); ++ + m_configuration.bPowerOffOnStandby = config.bPowerOffOnStandby; + + m_configuration.iFirmwareVersion = config.iFirmwareVersion; +@@ -1398,6 +1412,8 @@ void CPeripheralCecAdapter::SetConfigurationFromSettings(void) + // backwards compatibility. will be removed once the next major release of libCEC is out + m_configuration.iDoubleTapTimeoutMs = GetSettingInt("double_tap_timeout_ms"); + #endif ++ m_configuration.iButtonRepeatRateMs = GetSettingInt("button_repeat_rate_ms"); ++ m_configuration.iButtonReleaseDelayMs = GetSettingInt("button_release_delay_ms"); + + if (GetSettingBool("pause_playback_on_deactivate")) + { + +From b713d931abc454fd9248650c21b93820688e8f5b Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sat, 26 Apr 2014 17:27:52 +0100 +Subject: [PATCH 03/63] [cec] Don't suspend pi on tv switch off - it can't wake + up + +--- + system/peripherals.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/system/peripherals.xml b/system/peripherals.xml +index 02b1a9ed6fce1986bd864bba09a9df0621f9e041..54f9b70cfd5c8c82ceb99932e1b3e3251211cd20 100644 +--- a/system/peripherals.xml ++++ b/system/peripherals.xml +@@ -16,7 +16,7 @@ + + + +- ++ + + + + +From 2971cf8df975ab6fc221bf1d5342d3371ce5b41e Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Thu, 21 Apr 2016 16:49:02 +0100 +Subject: [PATCH 04/63] Revert "[settings] remove show EXIF picture information + setting" + +This reverts commit e7d90188436b6966eff23fd695e1a9d18f4af1b4. +--- + addons/resource.language.en_gb/resources/strings.po | 10 ++++++++++ + system/settings/settings.xml | 5 +++++ + xbmc/pictures/GUIWindowPictures.cpp | 2 +- + xbmc/pictures/PictureInfoLoader.cpp | 8 ++++++-- + xbmc/pictures/PictureInfoLoader.h | 1 + + xbmc/settings/Settings.cpp | 1 + + xbmc/settings/Settings.h | 1 + + 7 files changed, 25 insertions(+), 3 deletions(-) + +diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po +index 15745a792a5a28c79c19effc4d9037e842535da6..dbd80f07e305ad99a29d90211a7596b8bb5cedec 100644 +--- a/addons/resource.language.en_gb/resources/strings.po ++++ b/addons/resource.language.en_gb/resources/strings.po +@@ -19729,3 +19729,13 @@ msgstr "" + msgctxt "#38052" + msgid "Remote button press release time (ms)" + msgstr "" ++ ++#. Description of setting "Pictures -> Show EXIF picture information" with label #38207 ++#: system/settings/settings.xml ++msgctxt "#38207" ++msgid "Show EXIF picture information" ++msgstr "" ++ ++msgctxt "#38208" ++msgid "If EXIF information exists (date, time, camera used, etc.), it will be displayed." ++msgstr "" +diff --git a/system/settings/settings.xml b/system/settings/settings.xml +index c3804da9625186f5651a8d8be0edcedd8a2b255b..63613fc13acfd66476a880f8ebe9047a53837a33 100644 +--- a/system/settings/settings.xml ++++ b/system/settings/settings.xml +@@ -1172,6 +1172,11 @@ + + + ++ ++ 0 ++ true ++ ++ + + 0 + true +diff --git a/xbmc/pictures/GUIWindowPictures.cpp b/xbmc/pictures/GUIWindowPictures.cpp +index 4b5ec502a49d5116cafd53441a6d823be0da6b54..072639baae58479ec7d746f96634de069ee87e34 100644 +--- a/xbmc/pictures/GUIWindowPictures.cpp ++++ b/xbmc/pictures/GUIWindowPictures.cpp +@@ -203,7 +203,7 @@ void CGUIWindowPictures::OnPrepareFileItems(CFileItemList& items) + if (StringUtils::EqualsNoCase(items[i]->GetLabel(), "folder.jpg")) + items.Remove(i); + +- if (items.GetFolderCount() == items.Size()) ++ if (items.GetFolderCount() == items.Size() || !CSettings::GetInstance().GetBool(CSettings::SETTING_PICTURES_USETAGS)) + return; + + // Start the music info loader thread +diff --git a/xbmc/pictures/PictureInfoLoader.cpp b/xbmc/pictures/PictureInfoLoader.cpp +index dd3347277c75c5e63a4a4db9af9cc46605bb5ea9..05304f9fc44285d5577f2056625cceb15347ae57 100644 +--- a/xbmc/pictures/PictureInfoLoader.cpp ++++ b/xbmc/pictures/PictureInfoLoader.cpp +@@ -43,6 +43,7 @@ void CPictureInfoLoader::OnLoaderStart() + m_mapFileItems->SetFastLookup(true); + + m_tagReads = 0; ++ m_loadTags = CSettings::GetInstance().GetBool(CSettings::SETTING_PICTURES_USETAGS); + + if (m_pProgressCallback) + m_pProgressCallback->SetProgressMax(m_pVecItems->GetFileCount()); +@@ -87,8 +88,11 @@ bool CPictureInfoLoader::LoadItemLookup(CFileItem* pItem) + if (pItem->HasPictureInfoTag()) + return false; + +- pItem->GetPictureInfoTag()->Load(pItem->GetPath()); +- m_tagReads++; ++ if (m_loadTags) ++ { // Nothing found, load tag from file ++ pItem->GetPictureInfoTag()->Load(pItem->GetPath()); ++ m_tagReads++; ++ } + + return true; + } +diff --git a/xbmc/pictures/PictureInfoLoader.h b/xbmc/pictures/PictureInfoLoader.h +index 000b54fe1bb1dd1963edd5cf208ea318a5a5499d..2a022ff0ff66d237f0ebd12092c7b5ce8244a511 100644 +--- a/xbmc/pictures/PictureInfoLoader.h ++++ b/xbmc/pictures/PictureInfoLoader.h +@@ -39,5 +39,6 @@ protected: + + CFileItemList* m_mapFileItems; + unsigned int m_tagReads; ++ bool m_loadTags; + }; + +diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp +index 9940b6aac87971d7024c1c925846b4dac1ca98a0..6e13ba61b99217d95c1ad423131221869be6036b 100644 +--- a/xbmc/settings/Settings.cpp ++++ b/xbmc/settings/Settings.cpp +@@ -296,6 +296,7 @@ const std::string CSettings::SETTING_AUDIOCDS_SETTINGS = "audiocds.settings"; + const std::string CSettings::SETTING_AUDIOCDS_EJECTONRIP = "audiocds.ejectonrip"; + const std::string CSettings::SETTING_MYMUSIC_SONGTHUMBINVIS = "mymusic.songthumbinvis"; + const std::string CSettings::SETTING_MYMUSIC_DEFAULTLIBVIEW = "mymusic.defaultlibview"; ++const std::string CSettings::SETTING_PICTURES_USETAGS = "pictures.usetags"; + const std::string CSettings::SETTING_PICTURES_GENERATETHUMBS = "pictures.generatethumbs"; + const std::string CSettings::SETTING_PICTURES_SHOWVIDEOS = "pictures.showvideos"; + const std::string CSettings::SETTING_PICTURES_DISPLAYRESOLUTION = "pictures.displayresolution"; +diff --git a/xbmc/settings/Settings.h b/xbmc/settings/Settings.h +index 482f61db8aab70aff4013fee2f1c73a5b5a9b4a9..269a3a741340d60354037166c3b03ddfdd36cf01 100644 +--- a/xbmc/settings/Settings.h ++++ b/xbmc/settings/Settings.h +@@ -253,6 +253,7 @@ public: + static const std::string SETTING_AUDIOCDS_EJECTONRIP; + static const std::string SETTING_MYMUSIC_SONGTHUMBINVIS; + static const std::string SETTING_MYMUSIC_DEFAULTLIBVIEW; ++ static const std::string SETTING_PICTURES_USETAGS; + static const std::string SETTING_PICTURES_GENERATETHUMBS; + static const std::string SETTING_PICTURES_SHOWVIDEOS; + static const std::string SETTING_PICTURES_DISPLAYRESOLUTION; + +From 1a444eea815b96b8d61c847161d08452022c2192 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 18:19:32 +0100 -Subject: [PATCH 02/73] [rbp/omxplayer] When opening a stream don't try to +Subject: [PATCH 05/63] [rbp/omxplayer] When opening a stream don't try to update gui so often --- @@ -148,7 +275,7 @@ Subject: [PATCH 02/73] [rbp/omxplayer] When opening a stream don't try to 1 file changed, 4 insertions(+) diff --git a/xbmc/dialogs/GUIDialogBusy.cpp b/xbmc/dialogs/GUIDialogBusy.cpp -index 8ea5161637b4e66ddd222859f058521dbc8922b9..811019a39a10acc21b83f0b0c70d5500055e7f98 100644 +index c8fe0706d128b3c67a4000894129ae0fa08bb223..8a5916299575661743131b921a27a76f0bb88409 100644 --- a/xbmc/dialogs/GUIDialogBusy.cpp +++ b/xbmc/dialogs/GUIDialogBusy.cpp @@ -69,7 +69,11 @@ bool CGUIDialogBusy::WaitOnEvent(CEvent &event, unsigned int displaytime /* = 10 @@ -164,10 +291,10 @@ index 8ea5161637b4e66ddd222859f058521dbc8922b9..811019a39a10acc21b83f0b0c70d5500 dialog->ProcessRenderLoop(false); if (allowCancel && dialog->IsCanceled()) -From b4539526e1b39f837de148f31ac72c1984987925 Mon Sep 17 00:00:00 2001 +From 68f330731015a5b4abbacbd458c8309e9729fd76 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 8 Mar 2014 15:36:06 +0000 -Subject: [PATCH 03/73] [hifiberry] Hack: force it to be recognised as IEC958 +Subject: [PATCH 06/63] [hifiberry] Hack: force it to be recognised as IEC958 capable to enable passthrough options --- @@ -175,10 +302,10 @@ Subject: [PATCH 03/73] [hifiberry] Hack: force it to be recognised as IEC958 1 file changed, 4 insertions(+) diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp -index 6a9066b2dbe8d505d636b3638c1d35c7c8a698ed..9c6ac5d4cc9bf21b2d48619cc6fb5d274f1c3928 100644 +index d66993a09583d8f9f54f5f97c18fbba45dddee9b..3c0b691860ace57e0a25f01013df01a5ca4f62f5 100644 --- a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp +++ b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp -@@ -1352,6 +1352,10 @@ void CAESinkALSA::EnumerateDevice(AEDeviceInfoList &list, const std::string &dev +@@ -1351,6 +1351,10 @@ void CAESinkALSA::EnumerateDevice(AEDeviceInfoList &list, const std::string &dev if (snd_card_get_name(cardNr, &cardName) == 0) info.m_displayName = cardName; @@ -190,10 +317,10 @@ index 6a9066b2dbe8d505d636b3638c1d35c7c8a698ed..9c6ac5d4cc9bf21b2d48619cc6fb5d27 info.m_displayName.substr(info.m_displayName.size()-5) == " HDMI") { -From ead0ca4a8494d6eb946a38d801d6f538d1464b25 Mon Sep 17 00:00:00 2001 +From 76cd8f440e9203cc4ba28a0bbeede281dc391559 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 1 May 2014 16:28:39 +0100 -Subject: [PATCH 04/73] Improved file buffering in CArchive +Subject: [PATCH 07/63] Improved file buffering in CArchive Even though memcpy is typically inlined by the compiler into byte/word loads and stores (at least for release builds), the frequency with which 1, 2 and 4 @@ -253,10 +380,10 @@ index 23cac2759fb10d532da56fa75c5528c5589e9010..89d31d4db1afa7340ed8cd51a7a9fa7a } -From c77ae55125886d20a9dc5d4f6bbffa9bad1f4e82 Mon Sep 17 00:00:00 2001 +From 46eb2adb4e1c586c374f9bedeac9fef6f2dca4f0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 10 Aug 2014 16:45:16 +0100 -Subject: [PATCH 05/73] filesystem: Make support of browsing into archives +Subject: [PATCH 08/63] filesystem: Make support of browsing into archives optional The ability to browse, scan and play content in archives can cause problems on low powered/low memory devices. @@ -275,10 +402,10 @@ We'll let people who don't use archives disable it manually 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 5d2af8d8705ecf61dc5b7c91f0517b8d1e1e640a..488e590d5a48467b19e27d01863487f51442b130 100644 +index dbd80f07e305ad99a29d90211a7596b8bb5cedec..ecea05ac43622f75034c60cc3b2bd16859065a80 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po -@@ -19333,6 +19333,15 @@ msgstr "" +@@ -19371,6 +19371,15 @@ msgstr "" #: system/settings/rbp.xml msgctxt "#38010" msgid "GPU accelerated" @@ -366,10 +493,10 @@ index a0fd0a9011e71f4af1535110c696b6ea5c4b37db..688b71a297c7c617c6764bfe6be157d7 { CURL xbtUrl = URIUtils::CreateArchivePath("xbt", url); -From 6fdad9365c972c6ba48db3487f8228b3a6e69afd Mon Sep 17 00:00:00 2001 +From 5a6fdf25a8adde963039cf03732fda057bca72a5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 27 Oct 2014 13:06:57 +0000 -Subject: [PATCH 06/73] [rbp] Make cachemembuffersize default depend on memory +Subject: [PATCH 09/63] [rbp] Make cachemembuffersize default depend on memory size --- @@ -379,7 +506,7 @@ Subject: [PATCH 06/73] [rbp] Make cachemembuffersize default depend on memory 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp -index c417308c210204847f9b2d54250af68f2e4e2ee7..6b06c253644a85ca6a5088b07ca41369e38f21d0 100644 +index 571bf9f1ae64ae6d2d80a4aaca1a164f5178bf98..5a6f780517cff0c31f1c40e5e95445d448eb2297 100644 --- a/xbmc/linux/RBP.cpp +++ b/xbmc/linux/RBP.cpp @@ -23,6 +23,7 @@ @@ -433,7 +560,7 @@ index a35a509a91483f13e2cf0e688fc7e9528f254290..fffa5182126159f6dfcf750b21fa0464 void Deinitialize(); int GetArmMem() { return m_arm_mem; } diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index 6beebe0c9c11b0bab63e5abbd4aea2d62bb05f0c..03f566d3ee4eab690d2236b7739080269d552511 100644 +index cc37998f0c9edfb38cf609666374cfa96530bf8f..3891a7ed34acb3489a860678d56a8ec049890f6e 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp @@ -50,6 +50,9 @@ @@ -471,10 +598,10 @@ index 6beebe0c9c11b0bab63e5abbd4aea2d62bb05f0c..03f566d3ee4eab690d2236b773908026 } -From 66ba52b064d5697ad214f71bdf50c704275f0e87 Mon Sep 17 00:00:00 2001 +From 366c33404013529d89c2442e09dbfdba3d6e7c34 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 30 May 2014 14:58:43 +0100 -Subject: [PATCH 07/73] [settings] Experiment: Report DESKTOP resolution in +Subject: [PATCH 10/63] [settings] Experiment: Report DESKTOP resolution in video settings --- @@ -496,10 +623,10 @@ index ef95bc286fa982790248bad26da3c3e00c1da002..da69c6960867621d4ebe9267929664d9 StringUtils::Format("%dx%d%s", resolution->width, resolution->height, ModeFlagsToString(resolution->flags, false).c_str()), -From 859c87e3ac2360ecaa7eb846c24ae565228b9d85 Mon Sep 17 00:00:00 2001 +From de4036d5f101d94439763545120b52bb346f4875 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 24 Sep 2014 23:13:52 +0100 -Subject: [PATCH 08/73] [audio] Add settings option to boost centre channel +Subject: [PATCH 11/63] [audio] Add settings option to boost centre channel when downmixing This allows a dB volume increase to be added to centre channel. @@ -517,12 +644,12 @@ Should work with Pi Sink (dvdplayer/paplayer) and omxplayer 5 files changed, 46 insertions(+) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 488e590d5a48467b19e27d01863487f51442b130..a867d3205bbad13ac4f3b0862911f04c694e0f07 100644 +index ecea05ac43622f75034c60cc3b2bd16859065a80..de5eb0dd99700c0bdc7c3409c1b63f1c01c650bb 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po -@@ -19531,6 +19531,21 @@ msgstr "" +@@ -19591,6 +19591,21 @@ msgstr "" - #empty strings from id 38047 to 38099 + #empty strings from id 38062 to 38099 +#: system/settings/settings.xml +msgctxt "#38007" @@ -543,10 +670,10 @@ index 488e590d5a48467b19e27d01863487f51442b130..a867d3205bbad13ac4f3b0862911f04c #: system/settings/settings.xml msgctxt "#38100" diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index 6ff6b4c63fdb49ebe02f63b93c6995e0ddd21d40..52f7d29eaa509c8d648c2cf2e125b9e7e4b90f3b 100644 +index 63613fc13acfd66476a880f8ebe9047a53837a33..9ce9e725aec4d8ed000200342a2a99f3bc34a749 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml -@@ -2361,6 +2361,18 @@ +@@ -2358,6 +2358,18 @@ @@ -625,10 +752,10 @@ index f16b822ed7b4aebe18b5d339b3f71ee66e97c23f..993d4b33a294e88c2c004b7943895ba5 // stereo upmix if (upmix && m_src_channels == 2 && m_dst_channels > 2) -From 5b64f68afe3f41097e46b278f02db69190d2628d Mon Sep 17 00:00:00 2001 +From abc2a09d9cb7b423a37f1dfae6f198dfa361f1af Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 27 Oct 2014 15:23:51 +0000 -Subject: [PATCH 09/73] [rbp] Default extract thumbnails to false +Subject: [PATCH 12/63] [rbp] Default extract thumbnails to false It can take 80 seconds for a single file on a Pi. It can cause crashes with out-of-memory errors. It genereates a lot of support issues. Best to default to disabled and let users enable it if they must @@ -654,10 +781,10 @@ index e8b0d3d472b02fd161a4b51e957b9129e3cb9792..289dc55ec41aa44848519a05f8ee1ccc -From d52a6e898409a2c72e04c8f3abc9bff0cf01bec1 Mon Sep 17 00:00:00 2001 +From 747d6a7aa129348078f5b4e36d47bbc1307806a8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 27 Nov 2014 16:31:56 +0000 -Subject: [PATCH 10/73] [languageinvoker] Reduce priority of python threads +Subject: [PATCH 13/63] [languageinvoker] Reduce priority of python threads --- xbmc/interfaces/generic/LanguageInvokerThread.cpp | 5 +++++ @@ -680,64 +807,10 @@ index fcdd0633f30cd9595ae6cc4ed293677cdcb1f422..16f0c8916b5e0a9e90973d194cf2ebd1 } -From 9b1420ca7a51442c3937106d739b01879a3568f8 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sat, 14 Dec 2013 16:55:05 +0000 -Subject: [PATCH 11/73] logging: Add microsecond timer to log messages - ---- - xbmc/utils/log.cpp | 15 +++++++++++++-- - 1 file changed, 13 insertions(+), 2 deletions(-) - -diff --git a/xbmc/utils/log.cpp b/xbmc/utils/log.cpp -index 3443f1293d86018830269ed992c90a4e69c0430c..d330320842243df6f5ff256e608dddfa946e8773 100644 ---- a/xbmc/utils/log.cpp -+++ b/xbmc/utils/log.cpp -@@ -24,6 +24,7 @@ - #include "threads/Thread.h" - #include "utils/StringUtils.h" - #include "CompileInfo.h" -+#include "utils/TimeUtils.h" - - static const char* const levelNames[] = - {"DEBUG", "INFO", "NOTICE", "WARNING", "ERROR", "SEVERE", "FATAL", "NONE"}; -@@ -198,19 +199,29 @@ void CLog::PrintDebugString(const std::string& line) - - bool CLog::WriteLogString(int logLevel, const std::string& logString) - { -+#if defined(TARGET_LINUX) -+ static const char* prefixFormat = "%02.2d:%02.2d:%02.2d %10.6f T:%" PRIu64" %7s: "; -+#else - static const char* prefixFormat = "%02.2d:%02.2d:%02.2d T:%" PRIu64" %7s: "; -- -+#endif - std::string strData(logString); - /* fixup newline alignment, number of spaces should equal prefix length */ - StringUtils::Replace(strData, "\n", "\n "); - - int hour, minute, second; - s_globals.m_platform.GetCurrentLocalTime(hour, minute, second); -- -+ -+#if defined(TARGET_LINUX) -+ float Now = CurrentHostCounter() * 1e-9; -+#endif -+ - strData = StringUtils::Format(prefixFormat, - hour, - minute, - second, -+#if defined(TARGET_LINUX) -+ Now, -+#endif - (uint64_t)CThread::GetCurrentThreadId(), - levelNames[logLevel]) + strData; - - -From a2e3b4c8b1af982f133cc894d249fb9322f8f9a2 Mon Sep 17 00:00:00 2001 +From 0732dc96e4f4e84c14eebc953e3cf571363afb34 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 29 Nov 2014 15:25:16 +0000 -Subject: [PATCH 12/73] [rbp] hack: wait for splash to complete before changing +Subject: [PATCH 14/63] [rbp] hack: wait for splash to complete before changing hdmi mode --- @@ -821,10 +894,10 @@ index ee297700f8583dbb15cbe53baf8c887b36bd2ea0..bbe501d40c5e101f1d0d64b8b59b1928 RENDER_STEREO_MODE stereo_mode = g_graphicsContext.GetStereoMode(); -From 0b55fcce3a914ba67822156986f7aca2a0fd97ed Mon Sep 17 00:00:00 2001 +From e182b3ca45dd427c939d6c39366664e9afb382a8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 11 Dec 2014 17:00:57 +0000 -Subject: [PATCH 13/73] Fix for UI not showing both extractflags and +Subject: [PATCH 15/63] Fix for UI not showing both extractflags and extractthumb --- @@ -833,10 +906,10 @@ Subject: [PATCH 13/73] Fix for UI not showing both extractflags and 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index a867d3205bbad13ac4f3b0862911f04c694e0f07..ca11841fdb24ed2f420e1b9ff92ed3e184af2fc3 100644 +index de5eb0dd99700c0bdc7c3409c1b63f1c01c650bb..ae3aa10aa65beac6689f129d60056cadf8a5b5c1 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po -@@ -12450,7 +12450,7 @@ msgstr "" +@@ -12451,7 +12451,7 @@ msgstr "" #: system/settings/settings.xml msgctxt "#20433" @@ -845,7 +918,7 @@ index a867d3205bbad13ac4f3b0862911f04c694e0f07..ca11841fdb24ed2f420e1b9ff92ed3e1 msgstr "" #: xbmc/dialogs/GUIDialogSmartPlaylistRule.cpp -@@ -16969,7 +16969,7 @@ msgstr "" +@@ -17011,7 +17011,7 @@ msgstr "" #. Description of setting with label #20433 "Extract thumbnails and video information" #: system/settings/settings.xml msgctxt "#36178" @@ -854,7 +927,7 @@ index a867d3205bbad13ac4f3b0862911f04c694e0f07..ca11841fdb24ed2f420e1b9ff92ed3e1 msgstr "" #. Description of setting with label #20419 "Replace file names with library titles" -@@ -16981,7 +16981,7 @@ msgstr "" +@@ -17023,7 +17023,7 @@ msgstr "" #. Description of setting with label #20433 "Extract thumbnails and video information" #: system/settings/settings.xml msgctxt "#36180" @@ -863,19 +936,19 @@ index a867d3205bbad13ac4f3b0862911f04c694e0f07..ca11841fdb24ed2f420e1b9ff92ed3e1 msgstr "" #: system/settings/settings.xml -@@ -19678,3 +19678,7 @@ msgstr "" - msgctxt "#39010" - msgid "Select sort method" +@@ -19763,3 +19763,7 @@ msgstr "" + msgctxt "#38208" + msgid "If EXIF information exists (date, time, camera used, etc.), it will be displayed." msgstr "" + +msgctxt "#38190" +msgid "Extract thumbnails from video files" +msgstr "" diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index 52f7d29eaa509c8d648c2cf2e125b9e7e4b90f3b..785b431b40eb7fad5791bca97c1d20ef4c3d4817 100644 +index 9ce9e725aec4d8ed000200342a2a99f3bc34a749..326ffbd0f08428c3b4a95208134253feeabf1b1f 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml -@@ -977,8 +977,8 @@ +@@ -969,8 +969,8 @@ true @@ -887,10 +960,10 @@ index 52f7d29eaa509c8d648c2cf2e125b9e7e4b90f3b..785b431b40eb7fad5791bca97c1d20ef -From 21b1d6a4c44e5e88288d4d436477c2bfd05f6588 Mon Sep 17 00:00:00 2001 +From 31ef126da025be5761a86664e2c9428f5208f2ae Mon Sep 17 00:00:00 2001 From: anaconda Date: Thu, 11 Sep 2014 21:30:43 +0200 -Subject: [PATCH 14/73] Disable autoscrolling while on screensaver and while +Subject: [PATCH 16/63] Disable autoscrolling while on screensaver and while opening streams. --- @@ -903,10 +976,10 @@ Subject: [PATCH 14/73] Disable autoscrolling while on screensaver and while 6 files changed, 24 insertions(+), 3 deletions(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index 83c79ccc94c61c1740a65fd7e9402ca7c2b82813..cad5c05a1397a12309482dae7928b2a118a42925 100644 +index 100a2f2cd2a097ec275751a75e82500324166757..6e5c33c1118cbda79a614d90c6ca4b610f338c87 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -5208,3 +5208,13 @@ bool CApplication::NotifyActionListeners(const CAction &action) const +@@ -5240,3 +5240,13 @@ bool CApplication::NotifyActionListeners(const CAction &action) const return false; } @@ -921,10 +994,10 @@ index 83c79ccc94c61c1740a65fd7e9402ca7c2b82813..cad5c05a1397a12309482dae7928b2a1 + return onBlackDimScreenSaver || openingStreams; +} diff --git a/xbmc/Application.h b/xbmc/Application.h -index 22aca8173d0a452dc3d18ee559613ceb59f31b41..0f570f108436c168b3af746f5c005ae9dadf68b5 100644 +index a9d9bf5c4d69f0073e683e28cbd82d72d0fe4e06..dfee194a7d88a2cd6f503b5c7fbc258709997cb8 100644 --- a/xbmc/Application.h +++ b/xbmc/Application.h -@@ -395,6 +395,8 @@ public: +@@ -394,6 +394,8 @@ public: */ void UnregisterActionListener(IActionListener *listener); @@ -978,7 +1051,7 @@ index 7f1108939a63162024c7a055403a58e395f090b6..1192b74675b79d1a862de2949a60163a { scrollInfo.waitTime--; diff --git a/xbmc/guilib/GUILabel.cpp b/xbmc/guilib/GUILabel.cpp -index db201317a1f8d93dcf0641a28b7688cbd1a70734..1c8c30dcb9d55b7240af93b5e46c620320ef410a 100644 +index f15e847ec43d07b44660caec9f8faca780b0a061..ba88a7c5e45da13404d59dfbf1bbc8b93d3528c1 100644 --- a/xbmc/guilib/GUILabel.cpp +++ b/xbmc/guilib/GUILabel.cpp @@ -21,6 +21,8 @@ @@ -990,7 +1063,7 @@ index db201317a1f8d93dcf0641a28b7688cbd1a70734..1c8c30dcb9d55b7240af93b5e46c6203 CGUILabel::CGUILabel(float posX, float posY, float width, float height, const CLabelInfo& labelInfo, CGUILabel::OVER_FLOW overflow) : m_label(labelInfo) , m_textLayout(labelInfo.font, overflow == OVER_FLOW_WRAP, height) -@@ -104,7 +106,7 @@ void CGUILabel::Render() +@@ -103,7 +105,7 @@ void CGUILabel::Render() color_t color = GetColor(); bool renderSolid = (m_color == COLOR_DISABLED); bool overFlows = (m_renderRect.Width() + 0.5f < m_textLayout.GetTextWidth()); // 0.5f to deal with floating point rounding issues @@ -1021,10 +1094,10 @@ index d7bc1c5ba6067af9a460589920367288c640a915..ac766293f1c47c7f145cb46f6b152144 if (m_lastRenderTime) m_autoScrollDelayTime += currentTime - m_lastRenderTime; -From e5b903c3dfb34e4361f8f6075cb772b2a8bf92b0 Mon Sep 17 00:00:00 2001 +From 485dc3edb739f64c1816177cc34305c9a45931df Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 13 Dec 2014 18:35:20 +0000 -Subject: [PATCH 15/73] [demuxer] Avoid memcpy on every demuxer packet +Subject: [PATCH 17/63] [demuxer] Avoid memcpy on every demuxer packet Avoids an unnecessary memcpy on every demuxer packet which for high bitrate videos can be significant. @@ -1035,10 +1108,10 @@ high bitrate videos can be significant. 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -index 64dce349ad574e1bd115a1bfb08102034c1aef95..ca952e157690fe464c731e82cd302883c8ff437b 100644 +index 3540a8f0c89e4f82b5ae3c40fe58ca8bfffd2360..fedbff21018d352d88a820c6354aa7d7d4623e79 100644 --- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -@@ -906,7 +906,7 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() +@@ -921,7 +921,7 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() { if(m_pkt.pkt.stream_index == (int)m_pFormatContext->programs[m_program]->stream_index[i]) { @@ -1047,7 +1120,7 @@ index 64dce349ad574e1bd115a1bfb08102034c1aef95..ca952e157690fe464c731e82cd302883 break; } } -@@ -915,7 +915,7 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() +@@ -930,7 +930,7 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() bReturnEmpty = true; } else @@ -1056,7 +1129,7 @@ index 64dce349ad574e1bd115a1bfb08102034c1aef95..ca952e157690fe464c731e82cd302883 } else bReturnEmpty = true; -@@ -945,9 +945,13 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() +@@ -960,9 +960,13 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() // copy contents into our own packet pPacket->iSize = m_pkt.pkt.size; @@ -1072,7 +1145,7 @@ index 64dce349ad574e1bd115a1bfb08102034c1aef95..ca952e157690fe464c731e82cd302883 pPacket->pts = ConvertTimestamp(m_pkt.pkt.pts, stream->time_base.den, stream->time_base.num); pPacket->dts = ConvertTimestamp(m_pkt.pkt.dts, stream->time_base.den, stream->time_base.num); -@@ -1001,7 +1005,10 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() +@@ -1016,7 +1020,10 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() pPacket->iStreamId = m_pkt.pkt.stream_index; } m_pkt.result = -1; @@ -1124,10 +1197,10 @@ index df0f35bd49c65b302de4ccd110d859e8b881ea5f..b4b591ae4c4dd4fb0b36d4d00fedca96 } catch(...) { -From 520156ba013cc22da40d68d232fc4760c3595d29 Mon Sep 17 00:00:00 2001 +From 6f64ae9541cbeebd2d0169efea2e19639604d019 Mon Sep 17 00:00:00 2001 From: anaconda Date: Wed, 25 Feb 2015 18:22:21 +0100 -Subject: [PATCH 16/73] Load OSD dialogs on startup. +Subject: [PATCH 18/63] Load OSD dialogs on startup. Fixes skipped frames the first time they're loaded in memory on less powered devices, like a Raspberry Pi, when using DVDPlayer. @@ -1181,7 +1254,7 @@ index eb67552344f59b8857b16c882c29e3fa62bed75c..f31572b34d376e70a35003a8c2e175b4 CGUIDialogAudioSubtitleSettings::~CGUIDialogAudioSubtitleSettings() { } diff --git a/xbmc/video/dialogs/GUIDialogSubtitles.cpp b/xbmc/video/dialogs/GUIDialogSubtitles.cpp -index 398558e4d5d0cae30ee1c73e2b70e3b2f787e8fc..4e8a9b1e307a89d3a7b68402e2ff11b57e7dccd4 100644 +index 29c2917aa5aaaf4160c8f6fafadda45a71c54835..84204c1b1a058377d9d0d03d8af7d97f35ba119f 100644 --- a/xbmc/video/dialogs/GUIDialogSubtitles.cpp +++ b/xbmc/video/dialogs/GUIDialogSubtitles.cpp @@ -103,7 +103,7 @@ CGUIDialogSubtitles::CGUIDialogSubtitles(void) @@ -1222,10 +1295,10 @@ index 0534828dd85520134f7a6890e43a873e223062c1..5a86dfc1e2a54c8fe8d82cb75b612d8e CGUIDialogVideoSettings::~CGUIDialogVideoSettings() { } -From b0c4cebc6683c71e88e1e86aeaaef53c759d9666 Mon Sep 17 00:00:00 2001 +From 381a8656cb8bbd3a32edd2b9e7f717e3fc195ec3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 14 Apr 2015 20:51:14 +0100 -Subject: [PATCH 17/73] [gui] Also limit GUI updates when in non full-screen +Subject: [PATCH 19/63] [gui] Also limit GUI updates when in non full-screen video mode --- @@ -1233,10 +1306,10 @@ Subject: [PATCH 17/73] [gui] Also limit GUI updates when in non full-screen 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index cad5c05a1397a12309482dae7928b2a118a42925..826bc68488ed2227bd5175c3c20cacb1ab8b9930 100644 +index 6e5c33c1118cbda79a614d90c6ca4b610f338c87..283f300d89cbfd95cc160b19c24f1a5e55c48277 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -2754,7 +2754,7 @@ void CApplication::FrameMove(bool processEvents, bool processGUI) +@@ -2780,7 +2780,7 @@ void CApplication::FrameMove(bool processEvents, bool processGUI) #if defined(TARGET_RASPBERRY_PI) || defined(HAS_IMXVPU) // This code reduces rendering fps of the GUI layer when playing videos in fullscreen mode // it makes only sense on architectures with multiple layers @@ -1245,7 +1318,7 @@ index cad5c05a1397a12309482dae7928b2a118a42925..826bc68488ed2227bd5175c3c20cacb1 fps = CSettings::GetInstance().GetInt(CSettings::SETTING_VIDEOPLAYER_LIMITGUIUPDATE); #endif -@@ -2767,6 +2767,8 @@ void CApplication::FrameMove(bool processEvents, bool processGUI) +@@ -2793,6 +2793,8 @@ void CApplication::FrameMove(bool processEvents, bool processGUI) { if (!m_skipGuiRender) g_windowManager.Process(CTimeUtils::GetFrameTime()); @@ -1255,10 +1328,10 @@ index cad5c05a1397a12309482dae7928b2a118a42925..826bc68488ed2227bd5175c3c20cacb1 g_windowManager.FrameMove(); } -From d1ed850bff3522923aa92c84a7faf6de41e31f81 Mon Sep 17 00:00:00 2001 +From d60d5b5d2c0fe031a50e595888a5b704e33c39b6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 5 May 2015 23:58:06 +0100 -Subject: [PATCH 18/73] [screensaver] Leave GUI contents available for +Subject: [PATCH 20/63] [screensaver] Leave GUI contents available for screensaver --- @@ -1266,10 +1339,10 @@ Subject: [PATCH 18/73] [screensaver] Leave GUI contents available for 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/xbmc/guilib/GUIWindowManager.cpp b/xbmc/guilib/GUIWindowManager.cpp -index f6f64414831232558751c9f35f5c1d61eacd4fd6..9350bfd4ed53954fc500ff813da3cc9d5f3b99c7 100644 +index 5808f7ed1e94d68ead7305ba6d284edd4df12bdd..2a3b7f16531c9822e79c77efabdd30acdaa2a3c9 100644 --- a/xbmc/guilib/GUIWindowManager.cpp +++ b/xbmc/guilib/GUIWindowManager.cpp -@@ -794,7 +794,16 @@ void CGUIWindowManager::ActivateWindow_Internal(int iWindowID, const std::vector +@@ -795,7 +795,16 @@ void CGUIWindowManager::ActivateWindow_Internal(int iWindowID, const std::vector int currentWindow = GetActiveWindow(); CGUIWindow *pWindow = GetWindow(currentWindow); if (pWindow) @@ -1288,10 +1361,10 @@ index f6f64414831232558751c9f35f5c1d61eacd4fd6..9350bfd4ed53954fc500ff813da3cc9d // Add window to the history list (we must do this before we activate it, -From 2e458883e7d819a8f51acbf0832d035d3a79452a Mon Sep 17 00:00:00 2001 +From 052ea3734af13684c6b187e4eb61d93216b50d30 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 6 Jun 2015 18:43:57 +0100 -Subject: [PATCH 19/73] ffmpeg: Automatic switch to software decode for GMC +Subject: [PATCH 21/63] ffmpeg: Automatic switch to software decode for GMC with more than one warp point --- @@ -1383,10 +1456,10 @@ index eaf9fc49319d5f0ee450ddd802bba569e291f0b5..8dd14cdfd053f142f386b6dee1fc0b21 CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \ ./configure $(ffmpg_config) diff --git a/tools/depends/target/ffmpeg/autobuild.sh b/tools/depends/target/ffmpeg/autobuild.sh -index 6bbebfca1c7189fec6650932d7292f17af60db62..e491c788793fa5df35e4570b54d7606183350376 100755 +index 5c2976278eb5ec5b8b4a4f9f9c7174b164ab5201..dde29adf425e54f54e4104b3370352db0be6ef40 100755 --- a/tools/depends/target/ffmpeg/autobuild.sh +++ b/tools/depends/target/ffmpeg/autobuild.sh -@@ -127,6 +127,8 @@ mkdir -p "ffmpeg-${VERSION}" +@@ -132,6 +132,8 @@ mkdir -p "ffmpeg-${VERSION}" cd "ffmpeg-${VERSION}" || exit 2 tar --strip-components=1 -xf $MYDIR/${ARCHIVE} @@ -1396,7 +1469,7 @@ index 6bbebfca1c7189fec6650932d7292f17af60db62..e491c788793fa5df35e4570b54d76061 ./configure --prefix=$FFMPEG_PREFIX \ --extra-version="kodi-${VERSION}" \ diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -index 6adeaa66b04379a2685a80b99cfd493648f43775..aa20f18cbea80ed68c1307470289525bd5db29e3 100644 +index 8997e3c8dfb9d37cc6c1b0706366d0b193201dd9..1884c27272ad98ba5f8cbc7f275a7d9850cfab1d 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp @@ -47,6 +47,10 @@ @@ -1417,10 +1490,10 @@ index 6adeaa66b04379a2685a80b99cfd493648f43775..aa20f18cbea80ed68c1307470289525b + if (hints.workaround_bugs & FF_BUG_GMC_UNSUPPORTED) + return false; - m_processInfo.SetVideoDeintMethod("none"); - + std::list deintMethods; + deintMethods.push_back(EINTERLACEMETHOD::VS_INTERLACEMETHOD_AUTO); diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemux.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemux.h -index 03fdf6efa072219d55cac21b7f7923ffc6c00e17..e3a32aebfe59016b43cd7c2b304921b58c44e129 100644 +index 3bb003b634c83d2c1b0ecd12b53027950e58be99..24341dc23e97e86e1b20b255548573c88e02f064 100644 --- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemux.h +++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemux.h @@ -157,6 +157,7 @@ public: @@ -1440,10 +1513,10 @@ index 03fdf6efa072219d55cac21b7f7923ffc6c00e17..e3a32aebfe59016b43cd7c2b304921b5 class CDemuxStreamAudio : public CDemuxStream diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -index ca952e157690fe464c731e82cd302883c8ff437b..f00e95324849011df9d078432699030f6c4afae8 100644 +index fedbff21018d352d88a820c6354aa7d7d4623e79..b3bdc5a75b77af7dff90ded100a97b848db358da 100644 --- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -@@ -1393,7 +1393,7 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) +@@ -1415,7 +1415,7 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) if (!stereoMode.empty()) st->stereo_mode = stereoMode; @@ -1519,446 +1592,10 @@ index f135d423c0ca76fd70e79ae5b7d035f0cb79fc75..d9b576bc46055fdab1c134e5f2c63cd4 else if ((hint.codec == AV_CODEC_ID_VC1 || hint.codec == AV_CODEC_ID_WMV3) && g_RBP.GetCodecWvc1()) supported = true; -From 82f78893a3e6809a5deba403df8b37a2bae734fe Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 10 Mar 2016 17:56:11 +0000 -Subject: [PATCH 20/73] [rbp] HW mouse pointer - -Updating the mouse point provokes a complete screen update which can make it feel laggy -and results in high cpu. - -Render the mouse with an overlay to avoid redrawing the normal gui. ---- - xbmc/guilib/GUIWindowManager.cpp | 2 + - xbmc/linux/RBP.cpp | 135 ++++++++++++++++++++++++++++++++++++++ - xbmc/linux/RBP.h | 9 +++ - xbmc/windowing/WinEventsLinux.cpp | 125 +++++++++++++++++++++++++++++++++++ - xbmc/windowing/WinEventsLinux.h | 11 ++++ - 5 files changed, 282 insertions(+) - -diff --git a/xbmc/guilib/GUIWindowManager.cpp b/xbmc/guilib/GUIWindowManager.cpp -index 9350bfd4ed53954fc500ff813da3cc9d5f3b99c7..cd45a5961d4ffafbc8e62a3874dd626af5ccb7e2 100644 ---- a/xbmc/guilib/GUIWindowManager.cpp -+++ b/xbmc/guilib/GUIWindowManager.cpp -@@ -199,7 +199,9 @@ void CGUIWindowManager::CreateWindows() - Add(new CGUIWindowAddonBrowser); - Add(new CGUIWindowScreensaverDim); - Add(new CGUIWindowDebugInfo); -+#ifndef TARGET_RASPBERRY_PI - Add(new CGUIWindowPointer); -+#endif - Add(new CGUIDialogYesNo); - Add(new CGUIDialogProgress); - Add(new CGUIDialogExtendedProgressBar); -diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp -index 6b06c253644a85ca6a5088b07ca41369e38f21d0..92f20e5174dd6b886cf622460ac68ab5f2fe24b9 100644 ---- a/xbmc/linux/RBP.cpp -+++ b/xbmc/linux/RBP.cpp -@@ -28,6 +28,9 @@ - - #include "cores/omxplayer/OMXImage.h" - -+#include "guilib/GraphicContext.h" -+#include "settings/DisplaySettings.h" -+ - #include - #include "rpi/rpi_user_vcsm.h" - #include "utils/TimeUtils.h" -@@ -46,6 +49,10 @@ CRBP::CRBP() - m_DllBcmHost = new DllBcmHost(); - m_OMX = new COMXCore(); - m_display = DISPMANX_NO_HANDLE; -+ m_p = NULL; -+ m_x = 0; -+ m_y = 0; -+ m_enabled = 0; - m_mb = mbox_open(); - vcsm_init(); - m_vsync_count = 0; -@@ -141,6 +148,7 @@ DISPMANX_DISPLAY_HANDLE_T CRBP::OpenDisplay(uint32_t device) - m_display = vc_dispmanx_display_open( 0 /*screen*/ ); - int s = vc_dispmanx_vsync_callback(m_display, vsync_callback_static, (void *)this); - assert(s == 0); -+ init_cursor(); - } - return m_display; - } -@@ -148,6 +156,7 @@ DISPMANX_DISPLAY_HANDLE_T CRBP::OpenDisplay(uint32_t device) - void CRBP::CloseDisplay(DISPMANX_DISPLAY_HANDLE_T display) - { - CSingleLock lock(m_critSection); -+ uninit_cursor(); - assert(display == m_display); - int s = vc_dispmanx_vsync_callback(m_display, NULL, NULL); - assert(s == 0); -@@ -266,6 +275,9 @@ void CRBP::Deinitialize() - m_omx_image_init = false; - m_initialized = false; - m_omx_initialized = false; -+ uninit_cursor(); -+ delete m_p; -+ m_p = NULL; - if (m_mb) - mbox_close(m_mb); - m_mb = 0; -@@ -338,6 +350,52 @@ unsigned mem_unlock(int file_desc, unsigned handle) - return p[5]; - } - -+unsigned int mailbox_set_cursor_info(int file_desc, int width, int height, int format, uint32_t buffer, int hotspotx, int hotspoty) -+{ -+ int i=0; -+ unsigned int p[32]; -+ p[i++] = 0; // size -+ p[i++] = 0x00000000; // process request -+ p[i++] = 0x00008010; // set cursor state -+ p[i++] = 24; // buffer size -+ p[i++] = 24; // data size -+ -+ p[i++] = width; -+ p[i++] = height; -+ p[i++] = format; -+ p[i++] = buffer; // ptr to VC memory buffer. Doesn't work in 64bit.... -+ p[i++] = hotspotx; -+ p[i++] = hotspoty; -+ -+ p[i++] = 0x00000000; // end tag -+ p[0] = i*sizeof(*p); // actual size -+ -+ mbox_property(file_desc, p); -+ return p[5]; -+ -+} -+ -+unsigned int mailbox_set_cursor_position(int file_desc, int enabled, int x, int y) -+{ -+ int i=0; -+ unsigned p[32]; -+ p[i++] = 0; // size -+ p[i++] = 0x00000000; // process request -+ p[i++] = 0x00008011; // set cursor state -+ p[i++] = 12; // buffer size -+ p[i++] = 12; // data size -+ -+ p[i++] = enabled; -+ p[i++] = x; -+ p[i++] = y; -+ -+ p[i++] = 0x00000000; // end tag -+ p[0] = i*sizeof *p; // actual size -+ -+ mbox_property(file_desc, p); -+ return p[5]; -+} -+ - CGPUMEM::CGPUMEM(unsigned int numbytes, bool cached) - { - m_numbytes = numbytes; -@@ -369,4 +427,81 @@ void CGPUMEM::Flush() - vcsm_clean_invalid( &iocache ); - } - -+#define T 0 -+#define W 0xffffffff -+#define B 0xff000000 -+ -+const static uint32_t default_cursor_pixels[] = -+{ -+ B,B,B,B,B,B,B,B,B,T,T,T,T,T,T,T, -+ B,W,W,W,W,W,W,B,T,T,T,T,T,T,T,T, -+ B,W,W,W,W,W,B,T,T,T,T,T,T,T,T,T, -+ B,W,W,W,W,B,T,T,T,T,T,T,T,T,T,T, -+ B,W,W,W,W,W,B,T,T,T,T,T,T,T,T,T, -+ B,W,W,B,W,W,W,B,T,T,T,T,T,T,T,T, -+ B,W,B,T,B,W,W,W,B,T,T,T,T,T,T,T, -+ B,B,T,T,T,B,W,W,W,B,T,T,T,T,T,T, -+ B,T,T,T,T,T,B,W,W,W,B,T,T,T,T,T, -+ T,T,T,T,T,T,T,B,W,W,W,B,T,T,T,T, -+ T,T,T,T,T,T,T,T,B,W,W,W,B,T,T,T, -+ T,T,T,T,T,T,T,T,T,B,W,W,W,B,T,T, -+ T,T,T,T,T,T,T,T,T,T,B,W,W,W,B,T, -+ T,T,T,T,T,T,T,T,T,T,T,B,W,W,W,B, -+ T,T,T,T,T,T,T,T,T,T,T,T,B,W,B,T, -+ T,T,T,T,T,T,T,T,T,T,T,T,T,B,T,T -+}; -+ -+#undef T -+#undef W -+#undef B -+ -+void CRBP::init_cursor() -+{ -+ if (!m_mb) -+ return; -+ if (!m_p) -+ m_p = new CGPUMEM(64 * 64 * 4, false); -+ if (m_p && m_p->m_arm && m_p->m_vc) -+ set_cursor(default_cursor_pixels, 16, 16, 0, 0); -+} -+ -+void CRBP::set_cursor(const void *pixels, int width, int height, int hotspot_x, int hotspot_y) -+{ -+ if (!m_mb || !m_p || !m_p->m_arm || !m_p->m_vc || !pixels || width * height > 64 * 64) -+ return; -+ memcpy(m_p->m_arm, pixels, width * height * 4); -+ unsigned int s = mailbox_set_cursor_info(m_mb, width, height, 0, m_p->m_vc, hotspot_x, hotspot_y); -+ assert(s == 0); -+} -+ -+void CRBP::update_cursor(int x, int y, bool enabled) -+{ -+ if (!m_mb || !m_p || !m_p->m_arm || !m_p->m_vc) -+ return; -+ -+ RESOLUTION res = g_graphicsContext.GetVideoResolution(); -+ CRect gui(0, 0, CDisplaySettings::GetInstance().GetResolutionInfo(res).iWidth, CDisplaySettings::GetInstance().GetResolutionInfo(res).iHeight); -+ CRect display(0, 0, CDisplaySettings::GetInstance().GetResolutionInfo(res).iScreenWidth, CDisplaySettings::GetInstance().GetResolutionInfo(res).iScreenHeight); -+ -+ int x2 = x * display.Width() / gui.Width(); -+ int y2 = y * display.Height() / gui.Height(); -+ -+ if (g_graphicsContext.GetStereoMode() == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) -+ y2 *= 2; -+ else if (g_graphicsContext.GetStereoMode() == RENDER_STEREO_MODE_SPLIT_VERTICAL) -+ x2 *= 2; -+ if (m_x != x2 || m_y != y2 || m_enabled != enabled) -+ mailbox_set_cursor_position(m_mb, enabled, x2, y2); -+ m_x = x2; -+ m_y = y2; -+ m_enabled = enabled; -+} -+ -+void CRBP::uninit_cursor() -+{ -+ if (!m_mb || !m_p || !m_p->m_arm || !m_p->m_vc) -+ return; -+ mailbox_set_cursor_position(m_mb, 0, 0, 0); -+} -+ - #endif -diff --git a/xbmc/linux/RBP.h b/xbmc/linux/RBP.h -index fffa5182126159f6dfcf750b21fa0464e229e545..90b04db5405058be2ff20aeaa6af2d2ac651586f 100644 ---- a/xbmc/linux/RBP.h -+++ b/xbmc/linux/RBP.h -@@ -103,6 +103,15 @@ private: - CCriticalSection m_critSection; - - int m_mb; -+ CGPUMEM *m_p; -+ int m_x; -+ int m_y; -+ bool m_enabled; -+ public: -+ void init_cursor(); -+ void set_cursor(const void *pixels, int width, int height, int hotspot_x, int hotspot_y); -+ void update_cursor(int x, int y, bool enabled); -+ void uninit_cursor(); - }; - - extern CRBP g_RBP; -diff --git a/xbmc/windowing/WinEventsLinux.cpp b/xbmc/windowing/WinEventsLinux.cpp -index a958a23d7185a1dce59fc6c3f8854d177068ace4..70f0e4d3f2ac6c706e7c477d0a6e5ee2999dc88b 100644 ---- a/xbmc/windowing/WinEventsLinux.cpp -+++ b/xbmc/windowing/WinEventsLinux.cpp -@@ -30,11 +30,26 @@ - #include "utils/log.h" - #include "powermanagement/PowerManager.h" - -+#ifdef TARGET_RASPBERRY_PI -+#include "utils/TimeUtils.h" -+#include "guilib/Resolution.h" -+#include "addons/Skin.h" -+#include "utils/XMLUtils.h" -+#include "utils/StringUtils.h" -+#include "guilib/Texture.h" -+#include "linux/RBP.h" -+#include "input/InputManager.h" -+#endif -+ - bool CWinEventsLinux::m_initialized = false; - CLinuxInputDevices CWinEventsLinux::m_devices; - - CWinEventsLinux::CWinEventsLinux() - { -+#ifdef TARGET_RASPBERRY_PI -+ m_last_mouse_move_time = 0; -+ m_mouse_state = -1; -+#endif - } - - void CWinEventsLinux::RefreshDevices() -@@ -48,6 +63,72 @@ bool CWinEventsLinux::IsRemoteLowBattery() - return false; - } - -+#ifdef TARGET_RASPBERRY_PI -+bool CWinEventsLinux::LoadXML(const std::string strFileName) -+{ -+ RESOLUTION_INFO m_coordsRes; // resolution that the window coordinates are in. -+ // Find appropriate skin folder + resolution to load from -+ std::string strFileNameLower = strFileName; -+ StringUtils::ToLower(strFileNameLower); -+ std::string strLowerPath = g_SkinInfo->GetSkinPath(strFileNameLower, &m_coordsRes); -+ std::string strPath = g_SkinInfo->GetSkinPath(strFileName, &m_coordsRes); -+ -+ TiXmlElement* pRootElement = NULL; -+ CXBMCTinyXML xmlDoc; -+ std::string strPathLower = strPath; -+ StringUtils::ToLower(strPathLower); -+ if (!xmlDoc.LoadFile(strPath) && !xmlDoc.LoadFile(strPathLower) && !xmlDoc.LoadFile(strLowerPath)) -+ { -+ CLog::Log(LOGERROR, "unable to load:%s, Line %d\n%s", strPath.c_str(), xmlDoc.ErrorRow(), xmlDoc.ErrorDesc()); -+ return false; -+ } -+ pRootElement = (TiXmlElement*)xmlDoc.RootElement()->Clone(); -+ -+ if (!pRootElement) -+ return false; -+ -+ if (strcmpi(pRootElement->Value(), "window")) -+ { -+ CLog::Log(LOGERROR, "file : XML file doesnt contain "); -+ return false; -+ } -+ -+ TiXmlElement *pChild = pRootElement->FirstChildElement(); -+ while (pChild) -+ { -+ if (strcmpi(pChild->Value(), "controls") == 0) -+ { -+ TiXmlElement *pControl = pChild->FirstChildElement(); -+ while (pControl) -+ { -+ if (strcmpi(pControl->Value(), "control") == 0) -+ { -+ std::string strStringValue; -+ if (XMLUtils::GetString(pControl, "texture", strStringValue)) -+ { -+ const char* idAttr = pControl->Attribute("id"); -+ int index = idAttr ? atoi(idAttr)-1 : -1; -+ if (index >= 0 && index < (int)(sizeof m_cursors/sizeof *m_cursors)) -+ { -+ if (m_cursors[index].m_filename.size()) -+ g_TextureManager.ReleaseTexture(m_cursors[index].m_filename, true); -+ m_cursors[index].m_filename.clear(); -+ m_cursors[index].m_texture = g_TextureManager.Load(strStringValue); -+ if (m_cursors[index].m_texture.size()) -+ m_cursors[index].m_filename = strStringValue; -+ } -+ } -+ } -+ pControl = pControl->NextSiblingElement(); -+ } -+ } -+ pChild = pChild->NextSiblingElement(); -+ } -+ delete pRootElement; -+ return true; -+} -+#endif -+ - bool CWinEventsLinux::MessagePump() - { - if (!m_initialized) -@@ -55,13 +136,50 @@ bool CWinEventsLinux::MessagePump() - m_devices.InitAvailable(); - m_checkHotplug = std::unique_ptr(new CLinuxInputDevicesCheckHotplugged(m_devices)); - m_initialized = true; -+#ifdef TARGET_RASPBERRY_PI -+ LoadXML("Pointer.xml"); -+#endif - } - - bool ret = false; - XBMC_Event event = {0}; -+#ifdef TARGET_RASPBERRY_PI -+ bool active = CInputManager::GetInstance().IsMouseActive(); -+ int64_t Now = CurrentHostCounter(); -+ if (!active) -+ { -+ if (m_mouse_state != -1) -+ { -+ g_RBP.update_cursor(0, 0, 0); -+ m_mouse_state = -1; -+ } -+ } -+ else -+ { -+ int state = CInputManager::GetInstance().GetMouseState() - 1; -+ if (m_mouse_state != state) -+ { -+ if (state >= 0 && state < (int)(sizeof m_cursors/sizeof *m_cursors) && !m_cursors[state].m_texture.m_textures.empty()) -+ { -+ CBaseTexture *t = (m_cursors[state].m_texture.m_textures)[0]; -+ if (t) -+ g_RBP.set_cursor((const void *)t->GetPixels(), t->GetPitch()>>2, t->GetRows(), 0, 0); -+ } -+ m_mouse_state = state; -+ } -+ } -+#endif - while (1) - { - event = m_devices.ReadEvent(); -+#ifdef TARGET_RASPBERRY_PI -+ if (active && (event.type == XBMC_MOUSEMOTION || event.type == XBMC_MOUSEBUTTONDOWN || event.type == XBMC_MOUSEBUTTONUP)) -+ { -+ if (event.type == XBMC_MOUSEMOTION) -+ g_RBP.update_cursor(event.motion.x, event.motion.y, 1); -+ m_last_mouse_move_time = Now; -+ } -+#endif - if (event.type != XBMC_NOEVENT) - { - ret |= g_application.OnEvent(event); -@@ -72,6 +190,13 @@ bool CWinEventsLinux::MessagePump() - } - } - -+#ifdef TARGET_RASPBERRY_PI -+ if (active && Now - m_last_mouse_move_time > 5 * 1000000000LL) -+ { -+ g_RBP.update_cursor(0, 0, 0); -+ m_mouse_state = -1; -+ } -+#endif - return ret; - } - -diff --git a/xbmc/windowing/WinEventsLinux.h b/xbmc/windowing/WinEventsLinux.h -index 1b1d2f2e60334ed0f3a9964d106957f58e69f1b3..c82ba84625fe3556ff49764d40ceb3ec220114e1 100644 ---- a/xbmc/windowing/WinEventsLinux.h -+++ b/xbmc/windowing/WinEventsLinux.h -@@ -25,6 +25,7 @@ - #include - #include "windowing/WinEvents.h" - #include "input/linux/LinuxInputDevices.h" -+#include "guilib/TextureManager.h" - - class CWinEventsLinux : public IWinEvents - { -@@ -45,6 +46,16 @@ private: - static bool m_initialized; - static CLinuxInputDevices m_devices; - std::unique_ptr m_checkHotplug; -+#ifdef TARGET_RASPBERRY_PI -+ bool LoadXML(const std::string strFileName); -+ int64_t m_last_mouse_move_time; -+ struct -+ { -+ std::string m_filename; -+ CTextureArray m_texture; -+ } m_cursors[4]; -+ int m_mouse_state; -+#endif - }; - - #endif - -From 8ec830426891523384c72770524644469ba58d78 Mon Sep 17 00:00:00 2001 +From f972d5b044f4cee30fcfe87371751f35b2f56d51 Mon Sep 17 00:00:00 2001 From: Claudio-Sjo Date: Mon, 16 Feb 2015 14:51:26 +0100 -Subject: [PATCH 21/73] - allow reads < CDIO_CD_FRAMESIZE_RAW by using a buffer +Subject: [PATCH 22/63] - allow reads < CDIO_CD_FRAMESIZE_RAW by using a buffer - fixes #15794 --- @@ -2150,10 +1787,10 @@ index 0427af4534bfe59a343f0518c7f4242d93299836..e99236294fa8b9b613e465a8ecaf3ad3 lsn_t m_lsnCurrent; // Position inside the track in logical sector number lsn_t m_lsnEnd; // End of m_iTrack in logical sector number -From 285514a249509a62393980e93dd4b30906e702e5 Mon Sep 17 00:00:00 2001 +From 96c9a7bcce868adebd570d86fd3411d83c8aed9f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 24 Jun 2016 19:38:13 +0100 -Subject: [PATCH 22/73] codecoverlay: Include codec name in overlay +Subject: [PATCH 23/63] codecoverlay: Include codec name in overlay --- xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp | 4 ++++ @@ -2179,10 +1816,10 @@ index f822935ab7fc919128db53f70a6c4eb84d9759bc..9db3a9cc91fd5f9b194d6c1aa66aa021 //print the inverse of the resample ratio, since that makes more sense //if the resample ratio is 0.5, then we're playing twice as fast diff --git a/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp b/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp -index c1e91b52884b7268c580ef6814596832cdf222c7..babe49ec6c4a3650b17ddcf9b1f20ada93551e1d 100644 +index 89db27cce079e3e273050f2fa71f941f21b8280b..903f0d83527d9088ff1bf0ba056f357f6abfda81 100644 --- a/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp +++ b/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp -@@ -917,10 +917,13 @@ int CVideoPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) +@@ -895,10 +895,13 @@ int CVideoPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) std::string CVideoPlayerVideo::GetPlayerInfo() { @@ -2213,7 +1850,7 @@ index 1e5d2b98bbef15b47994c3e4735873a9946b58c7..d43350fa0eefb5960475a02c1327efc2 return s.str(); } diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index e9444d10405a88cef5d1e34ab5325802f0a938ea..84f389f6e37381a22db024667eebe4e8113857db 100644 +index a4b663d43d5b626e351256a1dd10650a282b494c..f6fb241dfec9269f4e501248de4dc83d5fdc2d3a 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp @@ -593,12 +593,14 @@ void OMXPlayerVideo::SetSpeed(int speed) @@ -2247,10 +1884,10 @@ index 0df7e72cc9d1947173c2bac5e72eb09976b51aa5..b5050081c360d29b1b478c27e6b88291 double m_iSubtitleDelay; bool m_bRenderSubs; -From dbbdecf89a7496be839920f2efb6105bba0fb059 Mon Sep 17 00:00:00 2001 +From d3b64baa508e43fc2e1d108653754b3abcb3ab56 Mon Sep 17 00:00:00 2001 From: Anton Fedchin Date: Tue, 8 Mar 2016 21:20:58 +0300 -Subject: [PATCH 23/73] [DebugInfo] Add cpu usage info. +Subject: [PATCH 24/63] [DebugInfo] Add cpu usage info. --- .../VideoPlayer/VideoRenderers/DebugRenderer.cpp | 56 ++++++++-------------- @@ -2387,7 +2024,7 @@ index 85aefaace73994730f7d2bdff9de85c79e99b2a2..8005a13bc220be0c5c596d276197c11e }; \ No newline at end of file diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp -index b2c09cad49daab09794b375c643dfb670597e68e..d38031da337aa9ff180c2866c5d5924c8537978e 100644 +index 482142e46a714d1821d0bb25a552b043d6dcce66..54cf477648bba4583904cf122b4e66f6bbdd9469 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp @@ -24,6 +24,7 @@ @@ -2420,10 +2057,10 @@ index b2c09cad49daab09794b375c643dfb670597e68e..d38031da337aa9ff180c2866c5d5924c m_debugTimer.Set(1000); -From 7260435be2b9f432dd40d0296e301d89a1c85db6 Mon Sep 17 00:00:00 2001 +From eb2da354526d4f0dedd27542d28f358bafddf868 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 22 May 2015 13:56:29 +0100 -Subject: [PATCH 24/73] ffmpeg: Allow neon to be enabled in unified builds +Subject: [PATCH 25/63] ffmpeg: Allow neon to be enabled in unified builds --- tools/depends/target/ffmpeg/Makefile | 4 ++++ @@ -2446,10 +2083,10 @@ index 8dd14cdfd053f142f386b6dee1fc0b21bb1f8d93..b5f38a458dfb341c43089e07afded153 ifeq ($(OS), linux) ffmpg_config += --target-os=$(OS) --cpu=$(CPU) -From 06bd1e13b97ac36991da8b844b6c23c7c4db25ed Mon Sep 17 00:00:00 2001 +From f3d6aa22f4d91deedc2b54096b762a7a8d99c440 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 27 Feb 2015 14:37:27 +0000 -Subject: [PATCH 25/73] ffmpeg: Add some upstream HEVC optimisations +Subject: [PATCH 26/63] ffmpeg: Add some upstream HEVC optimisations --- tools/depends/target/ffmpeg/Makefile | 6 +- @@ -5819,10 +5456,10 @@ index 0000000000000000000000000000000000000000..792b5fea581613a6fe9108443357f975 +2.5.0 + diff --git a/tools/depends/target/ffmpeg/autobuild.sh b/tools/depends/target/ffmpeg/autobuild.sh -index e491c788793fa5df35e4570b54d7606183350376..1a169999f75813a3f8e18185ced0620d445dee1f 100755 +index dde29adf425e54f54e4104b3370352db0be6ef40..83369203fef720456080f4119822e7fe3631ca1a 100755 --- a/tools/depends/target/ffmpeg/autobuild.sh +++ b/tools/depends/target/ffmpeg/autobuild.sh -@@ -128,6 +128,8 @@ cd "ffmpeg-${VERSION}" || exit 2 +@@ -133,6 +133,8 @@ cd "ffmpeg-${VERSION}" || exit 2 tar --strip-components=1 -xf $MYDIR/${ARCHIVE} patch -p1 < ../0001-mpeg4video-Signal-unsupported-GMC-with-more-than-one.patch @@ -6247,10 +5884,10 @@ index 0000000000000000000000000000000000000000..5e8e07d407f045fc99554f0f061d1e81 +2.5.0 + -From 6d77c3fa90ff76fbe476911dcd70a4e2bf4461b4 Mon Sep 17 00:00:00 2001 +From 86764acae60faf07ae737a25e5232fa32b69f584 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 7 May 2015 14:04:18 +0100 -Subject: [PATCH 26/73] [ffmpeg] Add GPU acceleration to hevc +Subject: [PATCH 27/63] [ffmpeg] Add GPU acceleration to hevc --- tools/depends/target/ffmpeg/Makefile | 4 +- @@ -6282,10 +5919,10 @@ index c46b533e47497cb7b1e7200eff2cee1a6f2a1a2f..48f8d56988718dd53294e8291a53e532 cd $(PLATFORM);\ CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \ diff --git a/tools/depends/target/ffmpeg/autobuild.sh b/tools/depends/target/ffmpeg/autobuild.sh -index 1a169999f75813a3f8e18185ced0620d445dee1f..e2641093d15e5b465fae7e5f87c3ea18573dd6ee 100755 +index 83369203fef720456080f4119822e7fe3631ca1a..d6856dbd4fb4957ace700cbc08332223c01938f6 100755 --- a/tools/depends/target/ffmpeg/autobuild.sh +++ b/tools/depends/target/ffmpeg/autobuild.sh -@@ -130,6 +130,7 @@ tar --strip-components=1 -xf $MYDIR/${ARCHIVE} +@@ -135,6 +135,7 @@ tar --strip-components=1 -xf $MYDIR/${ARCHIVE} patch -p1 < ../0001-mpeg4video-Signal-unsupported-GMC-with-more-than-one.patch patch -p1 < ../hevcdsp_ARM_NEON_optimized_epel_functions.patch patch -p1 < ../added_ARM_NEON_optimized_SAO_patches.patch @@ -44436,10 +44073,10 @@ index 0000000000000000000000000000000000000000..e172ebf157aebffe1ae50b4a2b25fd71 +2.7.4 + -From 8dde9060e177029f52161cd53dd24afe6edbdee7 Mon Sep 17 00:00:00 2001 +From 6a887bec79c0c9c51ecfdf826d9d9673bcc9f288 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 12 Jan 2016 16:29:57 +0000 -Subject: [PATCH 27/73] ffmpeg: Add cabac opimisations for hevc +Subject: [PATCH 28/63] ffmpeg: Add cabac opimisations for hevc --- .../0001-Squashed-commit-of-the-following.patch | 2179 ++++++++++++++++++++ @@ -46664,10 +46301,10 @@ index 48f8d56988718dd53294e8291a53e532f0ff338d..337dbaab927919858e44d79f647207ef cd $(PLATFORM);\ CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \ diff --git a/tools/depends/target/ffmpeg/autobuild.sh b/tools/depends/target/ffmpeg/autobuild.sh -index e2641093d15e5b465fae7e5f87c3ea18573dd6ee..41248acbe1ff6d8883e55678ae256b566bf925c3 100755 +index d6856dbd4fb4957ace700cbc08332223c01938f6..a61357f14cb2139e8125ae04684bed1b29fefb12 100755 --- a/tools/depends/target/ffmpeg/autobuild.sh +++ b/tools/depends/target/ffmpeg/autobuild.sh -@@ -131,6 +131,7 @@ patch -p1 < ../0001-mpeg4video-Signal-unsupported-GMC-with-more-than-one.patch +@@ -136,6 +136,7 @@ patch -p1 < ../0001-mpeg4video-Signal-unsupported-GMC-with-more-than-one.patch patch -p1 < ../hevcdsp_ARM_NEON_optimized_epel_functions.patch patch -p1 < ../added_ARM_NEON_optimized_SAO_patches.patch patch -p1 < ../pfcd_hevc_optimisations.patch @@ -46675,7 +46312,7 @@ index e2641093d15e5b465fae7e5f87c3ea18573dd6ee..41248acbe1ff6d8883e55678ae256b56 CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" \ ./configure --prefix=$FFMPEG_PREFIX \ -@@ -165,6 +166,7 @@ CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" \ +@@ -170,6 +171,7 @@ CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" \ --enable-zlib \ --disable-mipsdsp \ --disable-mipsdspr2 \ @@ -46684,10 +46321,10 @@ index e2641093d15e5b465fae7e5f87c3ea18573dd6ee..41248acbe1ff6d8883e55678ae256b56 make -j ${BUILDTHREADS} -From a76e212aeac830e30521517ec45f88d6934881e6 Mon Sep 17 00:00:00 2001 +From 55692ec5212ee1967dceb12271886d4438845257 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 16 Sep 2015 19:05:12 +0100 -Subject: [PATCH 28/73] [3d] Make MVC a valid 3D filename tag +Subject: [PATCH 29/63] [3d] Make MVC a valid 3D filename tag --- xbmc/guilib/StereoscopicsManager.cpp | 9 +++++++++ @@ -46716,7 +46353,7 @@ index b34873cba6534086ae243326550385867a03256a..1443acaf0f25df458ae49766e13dd032 } diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index 03f566d3ee4eab690d2236b7739080269d552511..60e5652f69e96a559d8080e01dc214a56fb19343 100644 +index 3891a7ed34acb3489a860678d56a8ec049890f6e..974305ff329eb6999c908d5e05d723f93137ae33 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp @@ -402,6 +402,7 @@ void CAdvancedSettings::Initialize() @@ -46727,7 +46364,7 @@ index 03f566d3ee4eab690d2236b7739080269d552511..60e5652f69e96a559d8080e01dc214a5 m_useDisplayControlHWStereo = false; -@@ -516,6 +517,7 @@ void CAdvancedSettings::ParseSettingsFile(const std::string &file) +@@ -551,6 +552,7 @@ void CAdvancedSettings::ParseSettingsFile(const std::string &file) XMLUtils::GetString(pElement, "stereoscopicregex3d", m_stereoscopicregex_3d); XMLUtils::GetString(pElement, "stereoscopicregexsbs", m_stereoscopicregex_sbs); XMLUtils::GetString(pElement, "stereoscopicregextab", m_stereoscopicregex_tab); @@ -46748,10 +46385,10 @@ index fc526d11c3a78bc74125429120e29bf295bd3b16..6b0e3b8cf9e3ff40e6af758c54fe7eef bool m_useDisplayControlHWStereo; -From 787ee8e5ad59ef95b9c6e02f8b54ce942922c87c Mon Sep 17 00:00:00 2001 +From 317d4c5e46f0530b27f5ba01179e34175d8e9a03 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 5 Oct 2015 14:58:05 +0100 -Subject: [PATCH 29/73] [3d] Swap top/bottom sides of GUI +Subject: [PATCH 30/63] [3d] Swap top/bottom sides of GUI --- xbmc/guilib/GraphicContext.cpp | 2 +- @@ -46771,10 +46408,10 @@ index 3706e4d80b3b31da4c5be0a1b21f36e59d2910f2..e170b3fb05279ffa316794dbce1d4f9d } if(m_stereoMode == RENDER_STEREO_MODE_SPLIT_VERTICAL) -From 266b32ce92b7794c18301d74338408bf570e1375 Mon Sep 17 00:00:00 2001 +From 1a9778af9ccb8c27a58a82907b6f1d18ac84a2a7 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 11 Oct 2015 20:51:37 +0100 -Subject: [PATCH 30/73] Revert "Revert "Disable extra logging by default"" +Subject: [PATCH 31/63] Revert "Revert "Disable extra logging by default"" This reverts commit a880554325be187b877cd8f0e2b338e7267da636. --- @@ -46782,10 +46419,10 @@ This reverts commit a880554325be187b877cd8f0e2b338e7267da636. 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index 785b431b40eb7fad5791bca97c1d20ef4c3d4817..291a781e33496a0e6fe5cd869c857f5a851586ce 100644 +index 326ffbd0f08428c3b4a95208134253feeabf1b1f..22dcff1c06577055f84c3d2c2fda73cfa16c53d4 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml -@@ -2825,12 +2825,12 @@ +@@ -2822,12 +2822,12 @@ 1 @@ -46801,32 +46438,10 @@ index 785b431b40eb7fad5791bca97c1d20ef4c3d4817..291a781e33496a0e6fe5cd869c857f5a loggingcomponents , -From d385c7c046adc03f7fd7357a722ec2b0305361f7 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 26 Nov 2015 17:14:49 +0000 -Subject: [PATCH 31/73] [ae] Add debug logging showing resamplerate - ---- - xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -index f5671b8dfb03216301d936ae3b08bfc3e8225729..7db4a6e3610ccea32fe19574b4f2838d4a3a2bdb 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -@@ -2457,6 +2457,7 @@ CSampleBuffer* CActiveAE::SyncStream(CActiveAEStream *stream) - if (stream->m_processingBuffers) - { - stream->m_processingBuffers->SetRR(stream->CalcResampleRatio(error), m_settings.atempoThreshold); -+ CLog::Log(LOGDEBUG, "CDVDPlayerAudio::%s rr:%.5f threshold:%.3f error:%.6f", __FUNCTION__, stream->m_processingBuffers->GetRR(), m_settings.atempoThreshold, error); - } - } - else if (stream->m_processingBuffers) - -From b592933a9bf174678474554b552734fa101ea430 Mon Sep 17 00:00:00 2001 +From 4800a5c41c44a33c3bccb52716474ed77309e21e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 21 Dec 2015 22:17:25 +0000 -Subject: [PATCH 32/73] [omximage] Fall back to arm jpeg encode/decode when gpu +Subject: [PATCH 32/63] [omximage] Fall back to arm jpeg encode/decode when gpu is busy --- @@ -47069,10 +46684,10 @@ index a93aa82663903fb1bf712058c2e259290ee742e6..6f38dbc7e5cc721c59a3633935f08218 extern COMXImage g_OMXImage; -From fb991421a324fc5245614fca885a36f7554a3fc2 Mon Sep 17 00:00:00 2001 +From 3834081dfbf66a8faa92a5f514c86de0b6c09179 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 9 Dec 2015 13:31:14 +0000 -Subject: [PATCH 33/73] [mmalcodec] Fail to open when width is invalid. Can +Subject: [PATCH 33/63] [mmalcodec] Fail to open when width is invalid. Can happen with mpegts files --- @@ -47080,7 +46695,7 @@ Subject: [PATCH 33/73] [mmalcodec] Fail to open when width is invalid. Can 1 file changed, 3 insertions(+) diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -index aa20f18cbea80ed68c1307470289525bd5db29e3..cead68bd79d388f0eda0f8a79f17d296478d3361 100644 +index 1884c27272ad98ba5f8cbc7f275a7d9850cfab1d..e757ca64c1caf5c43988c2cb77da159b8f8eee93 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp @@ -368,6 +368,9 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) @@ -47094,10 +46709,10 @@ index aa20f18cbea80ed68c1307470289525bd5db29e3..cead68bd79d388f0eda0f8a79f17d296 if (!CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_USEMMAL) || hints.software) return false; -From d3e36c19b8c0382ad963c316822703aaf2f082c8 Mon Sep 17 00:00:00 2001 +From c8985bee54655c26528c3b8ed5101d8f669f17f6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 19 Sep 2014 11:54:49 +0100 -Subject: [PATCH 34/73] [videoplayer/rbp] Add pi specific option to maintain +Subject: [PATCH 34/63] [videoplayer/rbp] Add pi specific option to maintain vsync with pll adjustment New A/V sync option in settings/video/playback to do "Adjust PLL". @@ -47106,23 +46721,23 @@ or drop/dupe audio packets which is normally required. --- .../resource.language.en_gb/resources/strings.po | 32 ++++++++++++++++++++++ system/settings/rbp.xml | 14 ++++++++++ - .../AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 31 +++++++++++++++------ + .../AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 25 +++++++++++------ xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h | 9 +++++- - .../Engines/ActiveAE/ActiveAEStream.cpp | 7 +++-- - .../AudioEngine/Engines/ActiveAE/ActiveAEStream.h | 4 ++- + .../Engines/ActiveAE/ActiveAEStream.cpp | 24 +++++++++++++--- + .../AudioEngine/Engines/ActiveAE/ActiveAEStream.h | 7 +++-- xbmc/cores/AudioEngine/Interfaces/AEStream.h | 10 ++++++- xbmc/cores/VideoPlayer/DVDAudio.cpp | 4 +-- xbmc/cores/VideoPlayer/DVDAudio.h | 2 +- xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp | 12 ++++++-- - xbmc/linux/RBP.cpp | 13 +++++++++ - xbmc/linux/RBP.h | 3 ++ - 12 files changed, 122 insertions(+), 19 deletions(-) + xbmc/linux/RBP.cpp | 20 ++++++++++++++ + xbmc/linux/RBP.h | 5 ++++ + 12 files changed, 143 insertions(+), 21 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index ca11841fdb24ed2f420e1b9ff92ed3e184af2fc3..7ace950c83e1497b4d96a31b33b524e7eafb1783 100644 +index ae3aa10aa65beac6689f129d60056cadf8a5b5c1..7c7969d381bf15ac1ba2fd8f16e463f6b12fe4c3 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po -@@ -19682,3 +19682,35 @@ msgstr "" +@@ -19767,3 +19767,35 @@ msgstr "" msgctxt "#38190" msgid "Extract thumbnails from video files" msgstr "" @@ -47184,21 +46799,10 @@ index 289dc55ec41aa44848519a05f8ee1ccc72740085..2572e25753712186f69390965ee1448b diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -index 7db4a6e3610ccea32fe19574b4f2838d4a3a2bdb..497b4433ed5fa45051b9b344cd59d949603ccda2 100644 +index f5671b8dfb03216301d936ae3b08bfc3e8225729..68399ab14faf813bd195d2fdf03a4a376307b4cd 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -@@ -34,6 +34,10 @@ using namespace ActiveAE; - #include "windowing/WindowingFactory.h" - #include "utils/log.h" - -+#if defined(TARGET_RASPBERRY_PI) -+#include "linux/RBP.h" -+#endif -+ - #define MAX_CACHE_LEVEL 0.4 // total cache time of stream in seconds - #define MAX_WATER_LEVEL 0.2 // buffered time after stream stages in seconds - #define MAX_BUFFER_TIME 0.1 // max time of a buffer in seconds -@@ -363,11 +367,12 @@ void CActiveAE::StateMachine(int signal, Protocol *port, Message *msg) +@@ -363,11 +363,12 @@ void CActiveAE::StateMachine(int signal, Protocol *port, Message *msg) m_sink.m_controlPort.SendOutMessage(CSinkControlProtocol::APPFOCUSED, msg->data, sizeof(bool)); return; case CActiveAEControlProtocol::STREAMRESAMPLEMODE: @@ -47214,25 +46818,23 @@ index 7db4a6e3610ccea32fe19574b4f2838d4a3a2bdb..497b4433ed5fa45051b9b344cd59d949 par->stream->m_resampleIntegral = 0.0; } return; -@@ -2452,7 +2457,16 @@ CSampleBuffer* CActiveAE::SyncStream(CActiveAEStream *stream) - if (!newerror || stream->m_syncState != CAESyncInfo::AESyncState::SYNC_INSYNC) - return ret; - -- if (stream->m_resampleMode) -+ if (stream->m_pllAdjust > 0) // pll adjust -+ { -+#if defined(TARGET_RASPBERRY_PI) -+ double e = std::max(std::min(error / 50.0, 1.0), -1.0); -+ double m_plladjust = 1.0 + e * stream->m_pllAdjust; -+ double m_last_plladjust = g_RBP.AdjustHDMIClock(m_plladjust); -+ CLog::Log(LOGDEBUG, "CDVDPlayerAudio::%s pll:%.5f (%.5f) error:%.6f e:%.6f a:%f", __FUNCTION__, m_plladjust, m_last_plladjust, error, e * stream->m_pllAdjust, stream->m_pllAdjust ); -+#endif -+ } -+ else if (stream->m_resampleMode) +@@ -2456,7 +2457,14 @@ CSampleBuffer* CActiveAE::SyncStream(CActiveAEStream *stream) { if (stream->m_processingBuffers) { -@@ -3323,13 +3337,14 @@ void CActiveAE::SetStreamResampleRatio(CActiveAEStream *stream, double ratio) +- stream->m_processingBuffers->SetRR(stream->CalcResampleRatio(error), m_settings.atempoThreshold); ++ double pllAdjustRequest = 0.0, pllAdjustActual = 0.0, e = 0.0; ++ if (stream->m_pllAdjust > 0.0) ++ { ++ e = std::max(std::min(error / 50.0, 1.0), - 1.0); ++ pllAdjustRequest = 1.0 + e * stream->m_pllAdjust; ++ } ++ stream->m_processingBuffers->SetRR(stream->CalcResampleRatio(error), m_settings.atempoThreshold, pllAdjustRequest, stream->m_pllAdjust, pllAdjustActual); ++ CLog::Log(LOGDEBUG, "ActiveAE::%s pll:%.5f (act:%.5f lim:%.5f) rr:%.5f threshold:%.3f error:%.6f", __FUNCTION__, pllAdjustRequest, pllAdjustActual, stream->m_pllAdjust, stream->m_processingBuffers->GetRR(), m_settings.atempoThreshold, error ); + } + } + else if (stream->m_processingBuffers) +@@ -3322,13 +3330,14 @@ void CActiveAE::SetStreamResampleRatio(CActiveAEStream *stream, double ratio) &msg, sizeof(MsgStreamParameter)); } @@ -47279,10 +46881,29 @@ index e29eb5719a2e24562a16180e53b2decd955e50a5..e2d3a6824ca0dc93fb08f3374c745ac1 void SetStreamFade(CActiveAEStream *stream, float from, float target, unsigned int millis); diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp -index 246d7e6c05242f1d64bbc3983b7342e24423ba8c..394459ab0581c2eef9c5e59b83c209d239c6b66a 100644 +index 246d7e6c05242f1d64bbc3983b7342e24423ba8c..6b009dcea60e7431d418286c7602e1c29e793cb5 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp -@@ -509,11 +509,12 @@ void CActiveAEStream::SetResampleRatio(double ratio) +@@ -29,6 +29,10 @@ + #include "ActiveAE.h" + #include "ActiveAEStream.h" + ++#if defined(TARGET_RASPBERRY_PI) ++#include "linux/RBP.h" ++#endif ++ + using namespace ActiveAE; + + /* typecast AE to CActiveAE */ +@@ -71,6 +75,7 @@ CActiveAEStream::CActiveAEStream(AEAudioFormat *format, unsigned int streamid) + m_lastPtsJump = 0; + m_errorInterval = 1000; + m_clockSpeed = 1.0; ++ m_pllAdjust = 0.0f; + } + + CActiveAEStream::~CActiveAEStream() +@@ -509,11 +514,12 @@ void CActiveAEStream::SetResampleRatio(double ratio) m_streamResampleRatio = ratio; } @@ -47298,11 +46919,41 @@ index 246d7e6c05242f1d64bbc3983b7342e24423ba8c..394459ab0581c2eef9c5e59b83c209d2 } void CActiveAEStream::SetFFmpegInfo(int profile, enum AVMatrixEncoding matrix_encoding, enum AVAudioServiceType audio_service_type) +@@ -714,8 +720,18 @@ bool CActiveAEStreamBuffers::IsDrained() + return false; + } + +-void CActiveAEStreamBuffers::SetRR(double rr, double atempoThreshold) ++void CActiveAEStreamBuffers::SetRR(double rr, double atempoThreshold, double pllAdjustRequest, double pllThreshold, double &pllAdjustActual) + { ++#if defined(TARGET_RASPBERRY_PI) ++ if (pllAdjustRequest > 0.0f) // pll adjust ++ { ++ pllAdjustActual = g_RBP.AdjustHDMIClock(pllAdjustRequest); ++ rr = 1.0; ++ } ++ else ++ pllAdjustActual = g_RBP.AdjustHDMIClock(1.0); ++#endif ++ + if (fabs(rr - 1.0) < atempoThreshold) + { + m_resampleBuffers->SetRR(rr); diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.h -index 531dedc71f8b342d1556518e1fb7cb051f334e88..927f93ed09d1b9dbc4a6a7dc6a8e2dceaa4ae7dc 100644 +index 531dedc71f8b342d1556518e1fb7cb051f334e88..80ab096a417d53fcdf7703d11437f92df23f6f46 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.h +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.h -@@ -169,7 +169,7 @@ public: +@@ -103,7 +103,8 @@ public: + void Flush(); + void SetDrain(bool drain); + bool IsDrained(); +- void SetRR(double rr, double atempoThreshold); ++ void SetRR(double rr, double atempoThreshold, double pllAdjustRequest, double pllThreshold, double &pllAdjustActual); ++ void SetRR(double rr, double atempoThreshold) { double pllAdjustActual; SetRR(rr, atempoThreshold, 0.0, 0.0, pllAdjustActual); } + double GetRR(); + void FillBuffer(); + bool DoesNormalize(); +@@ -169,7 +170,7 @@ public: virtual double GetResampleRatio(); virtual void SetResampleRatio(double ratio); @@ -47311,7 +46962,7 @@ index 531dedc71f8b342d1556518e1fb7cb051f334e88..927f93ed09d1b9dbc4a6a7dc6a8e2dce virtual void RegisterAudioCallback(IAudioCallback* pCallback); virtual void UnRegisterAudioCallback(); virtual void FadeVolume(float from, float to, unsigned int time); -@@ -186,6 +186,7 @@ protected: +@@ -186,6 +187,7 @@ protected: float m_streamAmplify; double m_streamResampleRatio; int m_streamResampleMode; @@ -47319,7 +46970,7 @@ index 531dedc71f8b342d1556518e1fb7cb051f334e88..927f93ed09d1b9dbc4a6a7dc6a8e2dce unsigned int m_streamSpace; bool m_streamDraining; bool m_streamDrained; -@@ -226,6 +227,7 @@ protected: +@@ -226,6 +228,7 @@ protected: int m_fadingTime; int m_profile; int m_resampleMode; @@ -47436,43 +47087,50 @@ index 9db3a9cc91fd5f9b194d6c1aa66aa02121164c29..56170f48cda417554c57b2adf934c2df if (!codec || codec->NeedPassthrough() == m_pAudioCodec->NeedPassthrough()) { // passthrough state has not changed diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp -index 92f20e5174dd6b886cf622460ac68ab5f2fe24b9..3618a68143d30391f937eb4bfdb6ed09dd86b9ce 100644 +index 5a6f780517cff0c31f1c40e5e95445d448eb2297..6e8529001b1a464b4547a846f553d98f5bc0b6c0 100644 --- a/xbmc/linux/RBP.cpp +++ b/xbmc/linux/RBP.cpp -@@ -49,6 +49,7 @@ CRBP::CRBP() +@@ -46,6 +46,8 @@ CRBP::CRBP() m_DllBcmHost = new DllBcmHost(); m_OMX = new COMXCore(); m_display = DISPMANX_NO_HANDLE; -+ m_last_pll_adjust = 1.0; - m_p = NULL; - m_x = 0; - m_y = 0; -@@ -162,6 +163,7 @@ void CRBP::CloseDisplay(DISPMANX_DISPLAY_HANDLE_T display) ++ m_requested_pll_adjust = -1.0; ++ m_actual_pll_adjust = -1.0; + m_mb = mbox_open(); + vcsm_init(); + m_vsync_count = 0; +@@ -153,6 +155,8 @@ void CRBP::CloseDisplay(DISPMANX_DISPLAY_HANDLE_T display) assert(s == 0); vc_dispmanx_display_close(m_display); m_display = DISPMANX_NO_HANDLE; -+ m_last_pll_adjust = 1.0; ++ m_requested_pll_adjust = -1.0; ++ m_actual_pll_adjust = -1.0; } void CRBP::GetDisplaySize(int &width, int &height) -@@ -504,4 +506,15 @@ void CRBP::uninit_cursor() - mailbox_set_cursor_position(m_mb, 0, 0, 0); +@@ -366,4 +370,20 @@ void CGPUMEM::Flush() + vcsm_clean_invalid( &iocache ); } +double CRBP::AdjustHDMIClock(double adjust) +{ + char response[80]; ++ ++ if (adjust == m_requested_pll_adjust) ++ return m_actual_pll_adjust; ++ ++ m_requested_pll_adjust = adjust; + vc_gencmd(response, sizeof response, "hdmi_adjust_clock %f", adjust); + char *p = strchr(response, '='); + if (p) -+ m_last_pll_adjust = atof(p+1); -+ CLog::Log(LOGDEBUG, "CRBP::%s(%.4f) = %.4f", __func__, adjust, m_last_pll_adjust); -+ return m_last_pll_adjust; ++ m_actual_pll_adjust = atof(p+1); ++ CLog::Log(LOGDEBUG, "CRBP::%s(%.5f) = %.5f", __func__, adjust, m_actual_pll_adjust); ++ return m_actual_pll_adjust; +} + #endif diff --git a/xbmc/linux/RBP.h b/xbmc/linux/RBP.h -index 90b04db5405058be2ff20aeaa6af2d2ac651586f..084fba87f49f4c3b33a8dd4a20a626a370a1f371 100644 +index fffa5182126159f6dfcf750b21fa0464e229e545..815d758e7086d73b4d4eb16849fdbb509a3c251d 100644 --- a/xbmc/linux/RBP.h +++ b/xbmc/linux/RBP.h @@ -82,6 +82,8 @@ public: @@ -47480,23 +47138,25 @@ index 90b04db5405058be2ff20aeaa6af2d2ac651586f..084fba87f49f4c3b33a8dd4a20a626a3 void VSyncCallback(); int GetMBox() { return m_mb; } + double AdjustHDMIClock(double adjust); -+ double GetAdjustHDMIClock() { return m_last_pll_adjust; } ++ double GetAdjustHDMIClock() { return m_actual_pll_adjust; } private: DllBcmHost *m_DllBcmHost; -@@ -107,6 +109,7 @@ private: - int m_x; - int m_y; - bool m_enabled; -+ double m_last_pll_adjust; - public: - void init_cursor(); - void set_cursor(const void *pixels, int width, int height, int hotspot_x, int hotspot_y); +@@ -103,6 +105,9 @@ private: + CCriticalSection m_critSection; + + int m_mb; ++ double m_requested_pll_adjust; ++ double m_actual_pll_adjust; ++ public: + }; + + extern CRBP g_RBP; -From 93d5e234c992e2b99148ecf128b46b321e49ed78 Mon Sep 17 00:00:00 2001 +From 044a640b88cd4a02095731737711d011577bf809 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 7 May 2015 15:35:43 +0100 -Subject: [PATCH 35/73] rbp: Support zero copy interface with hevc acceleration +Subject: [PATCH 35/63] rbp: Support zero copy interface with hevc acceleration --- xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 9 +++++++++ @@ -47504,7 +47164,7 @@ Subject: [PATCH 35/73] rbp: Support zero copy interface with hevc acceleration 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index b0bd4b5b4009520367525132a8455557830a3741..fc152c13ed5b17ccfbb0ab4c659dedf8fd63d6bd 100644 +index 4129d3d6a77ce1a3f15bad045746970f6e640ea6..619515c9411172261d8f0bef24c5d679c35e5d7d 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp @@ -368,6 +368,15 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options @@ -47524,12 +47184,12 @@ index b0bd4b5b4009520367525132a8455557830a3741..fc152c13ed5b17ccfbb0ab4c659dedf8 else { diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp -index 29c4e6d15dd838cf845c301ea1a1f4c05db29871..864650d488d0f5b3dc9f89f01aa5c3b845b92564 100644 +index e0ba70f31e3972f23e0231a16b9ba84f4b511d2c..d42e3090c9b38a43ee72fdc3780a244317ece11a 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp -@@ -290,8 +290,9 @@ bool CDecoder::GetPicture(AVCodecContext* avctx, AVFrame* frame, DVDVideoPicture - picture->MMALBuffer->mmal_buffer->data = (uint8_t *)gmem->m_vc_handle; +@@ -294,8 +294,9 @@ bool CDecoder::GetPicture(AVCodecContext* avctx, AVFrame* frame, DVDVideoPicture picture->MMALBuffer->mmal_buffer->alloc_size = picture->MMALBuffer->mmal_buffer->length = gmem->m_numbytes; + picture->MMALBuffer->m_stills = m_hints.stills; - // need to flush ARM cache so GPU can see it - gmem->Flush(); @@ -47540,10 +47200,10 @@ index 29c4e6d15dd838cf845c301ea1a1f4c05db29871..864650d488d0f5b3dc9f89f01aa5c3b8 if (g_advancedSettings.CanLogComponent(LOGVIDEO)) CLog::Log(LOGDEBUG, "%s::%s - mmal:%p dts:%.3f pts:%.3f buf:%p gpu:%p", CLASSNAME, __FUNCTION__, picture->MMALBuffer->mmal_buffer, 1e-6*picture->dts, 1e-6*picture->pts, picture->MMALBuffer, gmem); -From 2ba5f8b40e899f9ddd37b66803c65c4199324476 Mon Sep 17 00:00:00 2001 +From 534cd8664f784d6ce1dd59484f5cacafe90c9f9a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 16 May 2015 18:26:04 +0100 -Subject: [PATCH 36/73] ffmpeg: use upstream mvc patches +Subject: [PATCH 36/63] ffmpeg: use upstream mvc patches --- ...vcodec-add-h264_mvc-codec-id-and-profiles.patch | 68 ++++++++++++ @@ -47778,10 +47438,10 @@ index 337dbaab927919858e44d79f647207ef0513eea1..7e97e4d91a443d46d933df528763422f cd $(PLATFORM);\ CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \ diff --git a/tools/depends/target/ffmpeg/autobuild.sh b/tools/depends/target/ffmpeg/autobuild.sh -index 41248acbe1ff6d8883e55678ae256b566bf925c3..aa12d8d4ab30a43e405cac37d7daf1bc6686fe5a 100755 +index a61357f14cb2139e8125ae04684bed1b29fefb12..9f6c26c8acd08ed603aadeb4d9d81b07026e7506 100755 --- a/tools/depends/target/ffmpeg/autobuild.sh +++ b/tools/depends/target/ffmpeg/autobuild.sh -@@ -132,6 +132,9 @@ patch -p1 < ../hevcdsp_ARM_NEON_optimized_epel_functions.patch +@@ -137,6 +137,9 @@ patch -p1 < ../hevcdsp_ARM_NEON_optimized_epel_functions.patch patch -p1 < ../added_ARM_NEON_optimized_SAO_patches.patch patch -p1 < ../pfcd_hevc_optimisations.patch patch -p1 < ../0001-Squashed-commit-of-the-following.patch @@ -47853,10 +47513,43 @@ index 0000000000000000000000000000000000000000..b39480ad098b9cd0882fcf75b96afb1b +2.7.4 + -From b52627c29eb93ede720d7473f91b644f868e6691 Mon Sep 17 00:00:00 2001 +From 42c3af7c453ee02e0c83a267c150938389df0e4a Mon Sep 17 00:00:00 2001 +From: Anton Fedchin +Date: Fri, 29 Jan 2016 17:18:50 +0300 +Subject: [PATCH 37/63] [win32] Settings: Added setting to enable/disable MVC + decoder. + +--- + system/settings/win32.xml | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/system/settings/win32.xml b/system/settings/win32.xml +index a017d30c24232fb01220b87b29398403b8ed9662..2fcee72a64e8b701c8e895143410bbe9fd617356 100644 +--- a/system/settings/win32.xml ++++ b/system/settings/win32.xml +@@ -12,6 +12,17 @@ + false + + ++
++ ++ ++ ++ 2 ++ true ++ ++ ++ ++ ++
+
+ + + +From e717a6b60088a6c405c17503e3ab5ad1d1d67ecc Mon Sep 17 00:00:00 2001 From: Anton Fedchin Date: Wed, 20 Jan 2016 17:02:16 +0300 -Subject: [PATCH 37/73] [VideoPlayer] DemuxFFmpeg: Properly demuxing h264_mvc +Subject: [PATCH 38/63] [VideoPlayer] DemuxFFmpeg: Properly demuxing h264_mvc streams. --- @@ -47864,7 +47557,7 @@ Subject: [PATCH 37/73] [VideoPlayer] DemuxFFmpeg: Properly demuxing h264_mvc 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -index f00e95324849011df9d078432699030f6c4afae8..c673115f4c5b1f80a0f2beb157f2821a337debee 100644 +index b3bdc5a75b77af7dff90ded100a97b848db358da..62e110e816f21e60c1564029fe646a0a7e85f08d 100644 --- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp @@ -25,6 +25,7 @@ @@ -47875,7 +47568,7 @@ index f00e95324849011df9d078432699030f6c4afae8..c673115f4c5b1f80a0f2beb157f2821a #include "DVDClock.h" // for DVD_TIME_BASE #include "DVDDemuxUtils.h" #include "DVDInputStreams/DVDInputStream.h" -@@ -1332,6 +1333,15 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) +@@ -1354,6 +1355,15 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) } case AVMEDIA_TYPE_VIDEO: { @@ -47891,7 +47584,7 @@ index f00e95324849011df9d078432699030f6c4afae8..c673115f4c5b1f80a0f2beb157f2821a CDemuxStreamVideoFFmpeg* st = new CDemuxStreamVideoFFmpeg(this, pStream); stream = st; if(strcmp(m_pFormatContext->iformat->name, "flv") == 0) -@@ -1340,7 +1350,7 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) +@@ -1362,7 +1372,7 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) st->bVFR = false; // never trust pts in avi files with h264. @@ -47900,7 +47593,7 @@ index f00e95324849011df9d078432699030f6c4afae8..c673115f4c5b1f80a0f2beb157f2821a st->bPTSInvalid = true; #if defined(AVFORMAT_HAS_STREAM_GET_R_FRAME_RATE) -@@ -1411,6 +1421,17 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) +@@ -1433,6 +1443,17 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) if (av_dict_get(pStream->metadata, "title", NULL, 0)) st->m_description = av_dict_get(pStream->metadata, "title", NULL, 0)->value; @@ -47919,54 +47612,50 @@ index f00e95324849011df9d078432699030f6c4afae8..c673115f4c5b1f80a0f2beb157f2821a } case AVMEDIA_TYPE_DATA: -From 5e3d8ff9954cd60f9c896eabb9219b824d9844f3 Mon Sep 17 00:00:00 2001 +From 9a4d3b6f6b304d51aa12d734e023059926ef34c4 Mon Sep 17 00:00:00 2001 From: Anton Fedchin Date: Thu, 25 Feb 2016 11:21:25 +0300 -Subject: [PATCH 38/73] [Stereo3D] Added mvc modes. +Subject: [PATCH 39/63] [Stereo3D] Added block_lr and block_rl to supported + modes. --- - xbmc/cores/VideoPlayer/VideoRenderers/RenderFlags.cpp | 4 ++++ - xbmc/guilib/StereoscopicsManager.cpp | 6 +++++- - 2 files changed, 9 insertions(+), 1 deletion(-) + xbmc/cores/VideoPlayer/VideoRenderers/RenderFlags.cpp | 4 ++-- + xbmc/guilib/StereoscopicsManager.cpp | 8 +++++--- + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/RenderFlags.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/RenderFlags.cpp -index 24b1b10519467cbbfd96f7048efaf49aab7700cc..0b7b6178427302e0824734eb5c7aecd2a3b21a8c 100644 +index 24b1b10519467cbbfd96f7048efaf49aab7700cc..49f7f7ca7e144a259f6d06bd11cd97aa0b3242aa 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/RenderFlags.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/RenderFlags.cpp -@@ -104,6 +104,8 @@ namespace RenderManager { +@@ -102,8 +102,8 @@ namespace RenderManager { + convert["right_left"] = CONF_FLAGS_STEREO_MODE_SBS | CONF_FLAGS_STEREO_CADANCE_RIGHT_LEFT; + convert["anaglyph_green_magenta"] = 0u; convert["anaglyph_yellow_blue"] = 0u; - convert["block_lr"] = 0u; - convert["block_rl"] = 0u; -+ convert["mvc_lr"] = 0u; -+ convert["mvc_rl"] = 0u; +- convert["block_lr"] = 0u; +- convert["block_rl"] = 0u; ++ convert["block_lr"] = CONF_FLAGS_STEREO_CADANCE_LEFT_RIGHT; ++ convert["block_rl"] = CONF_FLAGS_STEREO_CADANCE_RIGHT_LEFT; } return convert[mode]; } -@@ -125,6 +127,8 @@ namespace RenderManager { - convert["col_interleaved_lr"] = "col_interleaved_rl"; - convert["block_lr"] = "block_rl"; - convert["block_rl"] = "block_lr"; -+ convert["mvc_lr"] = "mvc_rl"; -+ convert["mvc_rl"] = "mvc_lr"; - } - std::string res = convert[mode]; - if(res.empty()) diff --git a/xbmc/guilib/StereoscopicsManager.cpp b/xbmc/guilib/StereoscopicsManager.cpp -index 1443acaf0f25df458ae49766e13dd0323454f2eb..6eb0752994bc5f8c47efbbf211120af0a0720d0c 100644 +index 1443acaf0f25df458ae49766e13dd0323454f2eb..6aaa82f4d883b8cae0ccdedf6c5a6814e7aaa720 100644 --- a/xbmc/guilib/StereoscopicsManager.cpp +++ b/xbmc/guilib/StereoscopicsManager.cpp -@@ -72,6 +72,10 @@ static const struct StereoModeMap VideoModeToGuiModeMap[] = +@@ -70,8 +70,10 @@ static const struct StereoModeMap VideoModeToGuiModeMap[] = + { "anaglyph_cyan_red", RENDER_STEREO_MODE_ANAGLYPH_RED_CYAN }, + { "anaglyph_green_magenta", RENDER_STEREO_MODE_ANAGLYPH_GREEN_MAGENTA }, { "anaglyph_yellow_blue", RENDER_STEREO_MODE_ANAGLYPH_YELLOW_BLUE }, - { "block_lr", RENDER_STEREO_MODE_OFF }, // unsupported - { "block_rl", RENDER_STEREO_MODE_OFF }, // unsupported -+ { "mvc_lr", RENDER_STEREO_MODE_HARDWAREBASED }, -+ { "mvc_rl", RENDER_STEREO_MODE_HARDWAREBASED }, -+ { "mvc_lr", RENDER_STEREO_MODE_SPLIT_HORIZONTAL }, // fallback -+ { "mvc_rl", RENDER_STEREO_MODE_SPLIT_HORIZONTAL }, // fallback +- { "block_lr", RENDER_STEREO_MODE_OFF }, // unsupported +- { "block_rl", RENDER_STEREO_MODE_OFF }, // unsupported ++ { "block_lr", RENDER_STEREO_MODE_HARDWAREBASED }, ++ { "block_rl", RENDER_STEREO_MODE_HARDWAREBASED }, ++ { "block_lr", RENDER_STEREO_MODE_SPLIT_HORIZONTAL }, // fallback ++ { "block_rl", RENDER_STEREO_MODE_SPLIT_HORIZONTAL }, // fallback {} }; -@@ -310,7 +314,7 @@ int CStereoscopicsManager::ConvertVideoToGuiStereoMode(const std::string &mode) +@@ -310,7 +312,7 @@ int CStereoscopicsManager::ConvertVideoToGuiStereoMode(const std::string &mode) size_t i = 0; while (VideoModeToGuiModeMap[i].name) { @@ -47976,20 +47665,20 @@ index 1443acaf0f25df458ae49766e13dd0323454f2eb..6eb0752994bc5f8c47efbbf211120af0 i++; } -From 7e689b0ba66c1626583734f772dd449760e36ac8 Mon Sep 17 00:00:00 2001 +From 0d7219d8c5e63b80cf07e4d2e45d7af5d225cc16 Mon Sep 17 00:00:00 2001 From: Anton Fedchin Date: Sat, 23 Jan 2016 10:21:32 +0300 -Subject: [PATCH 39/73] [VideoPlayer] Fix possible wrong aspect. +Subject: [PATCH 40/63] [VideoPlayer] Fix possible wrong aspect. --- xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp b/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp -index babe49ec6c4a3650b17ddcf9b1f20ada93551e1d..693de6bc868b808eb746d6e304849e8a6c8d7e63 100644 +index 903f0d83527d9088ff1bf0ba056f357f6abfda81..a5a33d34c70892cde77ad4d8f3cb65fdd9703081 100644 --- a/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp +++ b/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp -@@ -182,7 +182,7 @@ void CVideoPlayerVideo::OpenStream(CDVDStreamInfo &hint, CDVDVideoCodec* codec) +@@ -181,7 +181,7 @@ void CVideoPlayerVideo::OpenStream(CDVDStreamInfo &hint, CDVDVideoCodec* codec) } // use aspect in stream if available @@ -47999,32 +47688,32 @@ index babe49ec6c4a3650b17ddcf9b1f20ada93551e1d..693de6bc868b808eb746d6e304849e8a else m_fForcedAspectRatio = 0.0; -From 4b756099637b1cb748fde03af22ea6276f979cbf Mon Sep 17 00:00:00 2001 +From 9f3dabbe75b336823dfe5ec3a453f9d48c4ee769 Mon Sep 17 00:00:00 2001 From: Anton Fedchin Date: Fri, 22 Jan 2016 18:18:33 +0300 -Subject: [PATCH 40/73] [VideoPlayer] DemuxFFmpeg: ssif remux +Subject: [PATCH 41/63] [VideoPlayer] DemuxFFmpeg: ssif remux --- xbmc/cores/VideoPlayer/DVDDemuxers/CMakeLists.txt | 2 + .../VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 47 ++++++- .../cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.h | 2 + - .../VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.cpp | 156 +++++++++++++++++++++ - .../VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.h | 49 +++++++ + .../VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp | 156 +++++++++++++++++++++ + .../VideoPlayer/DVDDemuxers/DemuxStreamSSIF.h | 49 +++++++ xbmc/cores/VideoPlayer/DVDDemuxers/Makefile.in | 1 + xbmc/settings/AdvancedSettings.cpp | 2 +- 7 files changed, 251 insertions(+), 8 deletions(-) - create mode 100644 xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.cpp - create mode 100644 xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.h + create mode 100644 xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp + create mode 100644 xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.h diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/CMakeLists.txt b/xbmc/cores/VideoPlayer/DVDDemuxers/CMakeLists.txt -index 63776b1333bb66483303e44d6ebe60f3cd7e14d7..0da129ff99f57dc38ca8a854854d9fe658651e1f 100644 +index 63776b1333bb66483303e44d6ebe60f3cd7e14d7..156ec2021002d9d7a355db2f0dcf099aabb1db48 100644 --- a/xbmc/cores/VideoPlayer/DVDDemuxers/CMakeLists.txt +++ b/xbmc/cores/VideoPlayer/DVDDemuxers/CMakeLists.txt @@ -5,6 +5,7 @@ set(SOURCES DemuxMultiSource.cpp DVDDemuxCDDA.cpp DVDDemuxClient.cpp DVDDemuxFFmpeg.cpp -+ DVDDemuxStreamSSIF.cpp ++ DemuxStreamSSIF.cpp DVDDemuxUtils.cpp DVDDemuxVobsub.cpp DVDFactoryDemuxer.cpp) @@ -48032,12 +47721,12 @@ index 63776b1333bb66483303e44d6ebe60f3cd7e14d7..0da129ff99f57dc38ca8a854854d9fe6 DVDDemuxCDDA.h DVDDemuxClient.h DVDDemuxFFmpeg.h -+ DVDDemuxStreamSSIF.h ++ DemuxStreamSSIF.h DVDDemuxPacket.h DVDDemuxUtils.h DVDDemuxVobsub.h diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -index c673115f4c5b1f80a0f2beb157f2821a337debee..d028c5642585ffca236882a2f316150cac2cb0d4 100644 +index 62e110e816f21e60c1564029fe646a0a7e85f08d..fb5dabe8558570bd2e48450b18778bfc77b3d7ef 100644 --- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp @@ -166,6 +166,7 @@ CDVDDemuxFFmpeg::CDVDDemuxFFmpeg() : CDVDDemux() @@ -48048,7 +47737,7 @@ index c673115f4c5b1f80a0f2beb157f2821a337debee..d028c5642585ffca236882a2f316150c m_speed = DVD_PLAYSPEED_NORMAL; m_program = UINT_MAX; m_pkt.result = -1; -@@ -543,6 +544,8 @@ void CDVDDemuxFFmpeg::Dispose() +@@ -553,6 +554,8 @@ void CDVDDemuxFFmpeg::Dispose() m_pkt.result = -1; av_packet_unref(&m_pkt.pkt); @@ -48057,7 +47746,7 @@ index c673115f4c5b1f80a0f2beb157f2821a337debee..d028c5642585ffca236882a2f316150c if (m_pFormatContext) { for (unsigned int i = 0; i < m_pFormatContext->nb_streams; i++) -@@ -596,6 +599,9 @@ void CDVDDemuxFFmpeg::Flush() +@@ -606,6 +609,9 @@ void CDVDDemuxFFmpeg::Flush() m_displayTime = 0; m_dtsAtDisplayTime = DVD_NOPTS_VALUE; @@ -48067,7 +47756,7 @@ index c673115f4c5b1f80a0f2beb157f2821a337debee..d028c5642585ffca236882a2f316150c } void CDVDDemuxFFmpeg::Abort() -@@ -863,7 +869,9 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() +@@ -878,7 +884,9 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() { Flush(); } @@ -48078,7 +47767,7 @@ index c673115f4c5b1f80a0f2beb157f2821a337debee..d028c5642585ffca236882a2f316150c { // update streams CreateStreams(m_program); -@@ -891,6 +899,9 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() +@@ -906,6 +914,9 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() m_pkt.result = -1; av_packet_unref(&m_pkt.pkt); @@ -48088,7 +47777,7 @@ index c673115f4c5b1f80a0f2beb157f2821a337debee..d028c5642585ffca236882a2f316150c } else { -@@ -900,7 +911,9 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() +@@ -915,7 +926,9 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() if (IsVideoReady()) { @@ -48099,7 +47788,7 @@ index c673115f4c5b1f80a0f2beb157f2821a337debee..d028c5642585ffca236882a2f316150c { /* check so packet belongs to selected program */ for (unsigned int i = 0; i < m_pFormatContext->programs[m_program]->nb_stream_indexes; i++) -@@ -1049,6 +1062,15 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() +@@ -1064,6 +1077,15 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() stream = AddStream(pPacket->iStreamId); } } @@ -48115,7 +47804,7 @@ index c673115f4c5b1f80a0f2beb157f2821a337debee..d028c5642585ffca236882a2f316150c if (!stream) { CLog::Log(LOGERROR, "CDVDDemuxFFmpeg::AddStream - internal error, stream is null"); -@@ -1078,6 +1100,9 @@ bool CDVDDemuxFFmpeg::SeekTime(int time, bool backwords, double *startpts) +@@ -1093,6 +1115,9 @@ bool CDVDDemuxFFmpeg::SeekTime(double time, bool backwards, double *startpts) m_pkt.result = -1; av_packet_unref(&m_pkt.pkt); @@ -48125,7 +47814,7 @@ index c673115f4c5b1f80a0f2beb157f2821a337debee..d028c5642585ffca236882a2f316150c CDVDInputStream::IPosTime* ist = m_pInput->GetIPosTime(); if (ist) { -@@ -1158,6 +1183,9 @@ bool CDVDDemuxFFmpeg::SeekByte(int64_t pos) +@@ -1173,6 +1198,9 @@ bool CDVDDemuxFFmpeg::SeekByte(int64_t pos) m_pkt.result = -1; av_packet_unref(&m_pkt.pkt); @@ -48135,12 +47824,12 @@ index c673115f4c5b1f80a0f2beb157f2821a337debee..d028c5642585ffca236882a2f316150c return (ret >= 0); } -@@ -1335,11 +1363,12 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) +@@ -1357,11 +1385,12 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) { if (pStream->codec->codec_id == AV_CODEC_ID_H264_MVC) { - // ignore MVC extension streams, they are handled specially -+ m_pSSIF = new CDVDDemuxStreamSSIF(); ++ m_pSSIF = new CDemuxStreamSSIF(); + m_pSSIF->SetMVCStreamId(streamIdx); + stream = new CDemuxStream(); @@ -48151,7 +47840,7 @@ index c673115f4c5b1f80a0f2beb157f2821a337debee..d028c5642585ffca236882a2f316150c break; } CDemuxStreamVideoFFmpeg* st = new CDemuxStreamVideoFFmpeg(this, pStream); -@@ -1425,7 +1454,11 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) +@@ -1447,7 +1476,11 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) { if (CDVDCodecUtils::IsH264AnnexB(m_pFormatContext->iformat->name, pStream)) { @@ -48164,7 +47853,7 @@ index c673115f4c5b1f80a0f2beb157f2821a337debee..d028c5642585ffca236882a2f316150c } else if (CDVDCodecUtils::ProcessH264MVCExtradata(pStream->codec->extradata, pStream->codec->extradata_size)) { -@@ -1537,7 +1570,7 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) +@@ -1559,7 +1592,7 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) if (langTag) strncpy(stream->language, langTag->value, 3); @@ -48174,14 +47863,14 @@ index c673115f4c5b1f80a0f2beb157f2821a337debee..d028c5642585ffca236882a2f316150c stream->ExtraSize = pStream->codec->extradata_size; stream->ExtraData = new uint8_t[pStream->codec->extradata_size]; diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.h -index 26cb1b91f6a08c1016210b98f75681d878afb9a1..49128bf011e2a802501cc8b3def5720a19248669 100644 +index 0bc498e8e387c7ff0aef065832c121d1367454aa..85ce39ee858992a5f095cdf6b4d35398c7ce7dcc 100644 --- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.h +++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.h @@ -21,6 +21,7 @@ */ #include "DVDDemux.h" -+#include "DVDDemuxStreamSSIF.h" ++#include "DemuxStreamSSIF.h" #include "threads/CriticalSection.h" #include "threads/SystemClock.h" #include @@ -48189,15 +47878,15 @@ index 26cb1b91f6a08c1016210b98f75681d878afb9a1..49128bf011e2a802501cc8b3def5720a double m_currentPts; // used for stream length estimation bool m_bMatroska; bool m_bAVI; -+ CDVDDemuxStreamSSIF* m_pSSIF; ++ CDemuxStreamSSIF* m_pSSIF; int m_speed; unsigned m_program; XbmcThreads::EndTime m_timeout; -diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.cpp +diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..e99352a90f348a95673ef3442d3f6cb020cd57d4 +index 0000000000000000000000000000000000000000..f75532016a1395782b59dc124676835c7254de56 --- /dev/null -+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.cpp ++++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp @@ -0,0 +1,156 @@ +/* +* Copyright (C) 2005-2013 Team XBMC @@ -48219,14 +47908,14 @@ index 0000000000000000000000000000000000000000..e99352a90f348a95673ef3442d3f6cb0 +* +*/ + -+#include "DVDDemuxStreamSSIF.h" ++#include "DemuxStreamSSIF.h" +#include "DVDClock.h" +#include "DVDDemuxUtils.h" +#include "utils/log.h" + +//#define DEBUG_VERBOSE + -+DemuxPacket* CDVDDemuxStreamSSIF::AddPacket(DemuxPacket* &srcPkt) ++DemuxPacket* CDemuxStreamSSIF::AddPacket(DemuxPacket* &srcPkt) +{ + if (srcPkt->iStreamId != m_h264StreamId && + srcPkt->iStreamId != m_mvcStreamId) @@ -48244,7 +47933,7 @@ index 0000000000000000000000000000000000000000..e99352a90f348a95673ef3442d3f6cb0 + return GetMVCPacket(); +} + -+void CDVDDemuxStreamSSIF::Flush() ++void CDemuxStreamSSIF::Flush() +{ + while (!m_H264queue.empty()) + { @@ -48258,7 +47947,7 @@ index 0000000000000000000000000000000000000000..e99352a90f348a95673ef3442d3f6cb0 + } +} + -+DemuxPacket* CDVDDemuxStreamSSIF::MergePacket(DemuxPacket* &srcPkt, DemuxPacket* &appendPkt) ++DemuxPacket* CDemuxStreamSSIF::MergePacket(DemuxPacket* &srcPkt, DemuxPacket* &appendPkt) +{ + DemuxPacket* newpkt = NULL; + newpkt = CDVDDemuxUtils::AllocateDemuxPacket(srcPkt->iSize + appendPkt->iSize); @@ -48280,7 +47969,7 @@ index 0000000000000000000000000000000000000000..e99352a90f348a95673ef3442d3f6cb0 + return newpkt; +} + -+DemuxPacket* CDVDDemuxStreamSSIF::GetMVCPacket() ++DemuxPacket* CDemuxStreamSSIF::GetMVCPacket() +{ + // Here, we recreate a h264 MVC packet from the base one + buffered MVC NALU's + while (!m_H264queue.empty() && !m_MVCqueue.empty()) @@ -48355,11 +48044,11 @@ index 0000000000000000000000000000000000000000..e99352a90f348a95673ef3442d3f6cb0 + + return CDVDDemuxUtils::AllocateDemuxPacket(0); +} -diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.h +diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.h new file mode 100644 -index 0000000000000000000000000000000000000000..8412627a3ea13f59bd2c96c23bd386e4b5b2658e +index 0000000000000000000000000000000000000000..1dafdc58db3f9cb5eac032c591942439117e13c4 --- /dev/null -+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.h ++++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.h @@ -0,0 +1,49 @@ +#pragma once + @@ -48390,11 +48079,11 @@ index 0000000000000000000000000000000000000000..8412627a3ea13f59bd2c96c23bd386e4 +#include "libavformat/avformat.h" +} + -+class CDVDDemuxStreamSSIF ++class CDemuxStreamSSIF +{ +public: -+ CDVDDemuxStreamSSIF() {}; -+ ~CDVDDemuxStreamSSIF() { Flush(); } ++ CDemuxStreamSSIF() {}; ++ ~CDemuxStreamSSIF() { Flush(); } + + DemuxPacket* AddPacket(DemuxPacket* &scrPkt); + void Flush(); @@ -48411,19 +48100,19 @@ index 0000000000000000000000000000000000000000..8412627a3ea13f59bd2c96c23bd386e4 + int m_mvcStreamId = 0; +}; diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/Makefile.in b/xbmc/cores/VideoPlayer/DVDDemuxers/Makefile.in -index e4f8aed0af96fe0dceec4d8517087742f2c7df81..f3b717ddabb4729fe0db5ebab5a7913b8fe8297c 100644 +index e4f8aed0af96fe0dceec4d8517087742f2c7df81..30076937bd084936571abf0e6eeecf5ad916c7b3 100644 --- a/xbmc/cores/VideoPlayer/DVDDemuxers/Makefile.in +++ b/xbmc/cores/VideoPlayer/DVDDemuxers/Makefile.in @@ -10,6 +10,7 @@ SRCS += DVDDemuxUtils.cpp SRCS += DVDDemuxVobsub.cpp SRCS += DVDDemuxCC.cpp SRCS += DVDFactoryDemuxer.cpp -+SRCS += DVDDemuxStreamSSIF.cpp ++SRCS += DemuxStreamSSIF.cpp LIB = DVDDemuxers.a diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index 60e5652f69e96a559d8080e01dc214a56fb19343..cdaf53585a89a0da3a4038178806ee937049fe42 100644 +index 974305ff329eb6999c908d5e05d723f93137ae33..985ecf9722141d78471c00e90da15bfad931462a 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp @@ -391,7 +391,7 @@ void CAdvancedSettings::Initialize() @@ -48436,48 +48125,25 @@ index 60e5652f69e96a559d8080e01dc214a56fb19343..cdaf53585a89a0da3a4038178806ee93 m_discStubExtensions = ".disc"; // internal music extensions -From bc26543c6ed60a2d9775d2fc03d4a6f0d9c72203 Mon Sep 17 00:00:00 2001 -From: Anton Fedchin -Date: Tue, 23 Feb 2016 16:01:08 +0300 -Subject: [PATCH 41/73] [libbluray] bump libbluray to 0.9.2-mvc. - ---- - project/BuildDependencies/scripts/0_package.list | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/project/BuildDependencies/scripts/0_package.list b/project/BuildDependencies/scripts/0_package.list -index 4d1be9c2cb2bb0c9531413c7300342444df023e1..bc4913a3d0c1fcb7e27106a2ddd6988f7749b571 100644 ---- a/project/BuildDependencies/scripts/0_package.list -+++ b/project/BuildDependencies/scripts/0_package.list -@@ -17,7 +17,7 @@ freetype-2.6.3-win32-vc140.7z - giflib-5.1.4-win32-vc140.7z - jsonschemabuilder-1.0.0-win32-3.7z - libass-0.13.2-win32-vc140.7z --libbluray-0.9.3-win32-vc140.7z -+libbluray-0.9.2-mvc-win32-vc120.7z - libcdio-0.9.3-win32-vc140.7z - libcec-3.1.0-win32-vc140.7z - libfribidi-0.19.2-win32.7z - -From 45649c80d6a0ae44ad09d040d616401980b3946c Mon Sep 17 00:00:00 2001 +From 7d58e1dbdf0a13bbb9e7264c6a7a500ddfd29c8b Mon Sep 17 00:00:00 2001 From: Anton Fedchin Date: Tue, 23 Feb 2016 16:02:46 +0300 -Subject: [PATCH 42/73] [3DBD] Added support of 3D-BluRay playback. +Subject: [PATCH 42/63] [3DBD] Added support of 3D-BluRay playback. --- lib/DllLibbluray.h | 8 + xbmc/cores/VideoPlayer/DVDDemuxers/CMakeLists.txt | 2 + - .../VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 57 ++++- - xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxMVC.cpp | 262 +++++++++++++++++++++ - xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxMVC.h | 57 +++++ - .../VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.cpp | 40 +++- - .../VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.h | 12 +- + .../VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 51 +++- + xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.cpp | 266 +++++++++++++++++++++ + xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.h | 57 +++++ + .../VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp | 40 +++- + .../VideoPlayer/DVDDemuxers/DemuxStreamSSIF.h | 12 +- xbmc/cores/VideoPlayer/DVDDemuxers/Makefile.in | 1 + - .../DVDInputStreams/DVDInputStreamBluray.cpp | 159 +++++++++++-- + .../DVDInputStreams/DVDInputStreamBluray.cpp | 159 ++++++++++-- .../DVDInputStreams/DVDInputStreamBluray.h | 20 ++ - 10 files changed, 583 insertions(+), 35 deletions(-) - create mode 100644 xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxMVC.cpp - create mode 100644 xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxMVC.h + 10 files changed, 581 insertions(+), 35 deletions(-) + create mode 100644 xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.cpp + create mode 100644 xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.h diff --git a/lib/DllLibbluray.h b/lib/DllLibbluray.h index f5a337fe19beff472557c97ff7a203ad30a912b2..03f93391265e164837c2a17a8fe6d7da41c2f13e 100644 @@ -48520,34 +48186,34 @@ index f5a337fe19beff472557c97ff7a203ad30a912b2..03f93391265e164837c2a17a8fe6d7da public: diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/CMakeLists.txt b/xbmc/cores/VideoPlayer/DVDDemuxers/CMakeLists.txt -index 0da129ff99f57dc38ca8a854854d9fe658651e1f..82d4b499245afda1a51ca281584cc47fc76173d1 100644 +index 156ec2021002d9d7a355db2f0dcf099aabb1db48..87d27b666f703743bb0170252cf1190da5bce261 100644 --- a/xbmc/cores/VideoPlayer/DVDDemuxers/CMakeLists.txt +++ b/xbmc/cores/VideoPlayer/DVDDemuxers/CMakeLists.txt -@@ -5,6 +5,7 @@ set(SOURCES DemuxMultiSource.cpp - DVDDemuxCDDA.cpp +@@ -6,6 +6,7 @@ set(SOURCES DemuxMultiSource.cpp DVDDemuxClient.cpp DVDDemuxFFmpeg.cpp -+ DVDDemuxMVC.cpp - DVDDemuxStreamSSIF.cpp + DemuxStreamSSIF.cpp ++ DemuxMVC.cpp DVDDemuxUtils.cpp DVDDemuxVobsub.cpp -@@ -17,6 +18,7 @@ set(HEADERS DemuxMultiSource.h - DVDDemuxCDDA.h + DVDFactoryDemuxer.cpp) +@@ -18,6 +19,7 @@ set(HEADERS DemuxMultiSource.h DVDDemuxClient.h DVDDemuxFFmpeg.h -+ DVDDemuxMVC.h - DVDDemuxStreamSSIF.h + DemuxStreamSSIF.h ++ DemuxMVC.h DVDDemuxPacket.h DVDDemuxUtils.h + DVDDemuxVobsub.h diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -index d028c5642585ffca236882a2f316150cac2cb0d4..9498f676602e85d020968a7ecf12a31a750ef0ba 100644 +index fb5dabe8558570bd2e48450b18778bfc77b3d7ef..3d4d22930da1ac1e090ba95ef0faa65fbafa4326 100644 --- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp @@ -27,6 +27,7 @@ #include "cores/FFmpeg.h" #include "DVDCodecs/DVDCodecUtils.h" #include "DVDClock.h" // for DVD_TIME_BASE -+#include "DVDDemuxMVC.h" ++#include "DemuxMVC.h" #include "DVDDemuxUtils.h" #include "DVDInputStreams/DVDInputStream.h" #include "DVDInputStreams/DVDInputStreamFFmpeg.h" @@ -48561,14 +48227,14 @@ index d028c5642585ffca236882a2f316150cac2cb0d4..9498f676602e85d020968a7ecf12a31a + if (bluRay->HasMVC()) + { + SAFE_DELETE(m_pSSIF); -+ m_pSSIF = new CDVDDemuxStreamSSIF(); ++ m_pSSIF = new CDemuxStreamSSIF(); + m_pSSIF->SetBluRay(bluRay); + } + } // in case of mpegts and we have not seen pat/pmt, defer creation of streams if (!skipCreateStreams || m_pFormatContext->nb_programs > 0) { -@@ -869,9 +880,7 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() +@@ -884,9 +895,7 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() { Flush(); } @@ -48579,7 +48245,7 @@ index d028c5642585ffca236882a2f316150cac2cb0d4..9498f676602e85d020968a7ecf12a31a { // update streams CreateStreams(m_program); -@@ -912,8 +921,7 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() +@@ -927,8 +936,7 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() if (IsVideoReady()) { // libavformat is confused by the interleaved SSIF. @@ -48589,7 +48255,7 @@ index d028c5642585ffca236882a2f316150cac2cb0d4..9498f676602e85d020968a7ecf12a31a { /* check so packet belongs to selected program */ for (unsigned int i = 0; i < m_pFormatContext->programs[m_program]->nb_stream_indexes; i++) -@@ -1064,10 +1072,7 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() +@@ -1079,10 +1087,7 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() } if (stream && m_pSSIF) { @@ -48601,7 +48267,7 @@ index d028c5642585ffca236882a2f316150cac2cb0d4..9498f676602e85d020968a7ecf12a31a if (stream->type == STREAM_DATA && stream->codec == AV_CODEC_ID_H264_MVC && pPacket->iSize) stream = GetStream(pPacket->iStreamId); } -@@ -1458,6 +1463,29 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) +@@ -1480,6 +1485,29 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) { m_pSSIF->SetH264StreamId(streamIdx); pStream->codec->codec_tag = MKTAG('A', 'M', 'V', 'C'); @@ -48612,8 +48278,8 @@ index d028c5642585ffca236882a2f316150cac2cb0d4..9498f676602e85d020968a7ecf12a31a + CDVDInputStreamBluray *bluRay = static_cast(m_pInput); + if (bluRay->HasMVC()) + { -+ st->stereo_mode = bluRay->AreEyesFlipped() ? "mvc_rl" : "mvc_lr"; -+ mvcStream = static_cast(bluRay->GetDemuxMVC())->GetAVStream(); ++ st->stereo_mode = bluRay->AreEyesFlipped() ? "block_rl" : "block_lr"; ++ mvcStream = static_cast(bluRay->GetDemuxMVC())->GetAVStream(); + } + } + else @@ -48631,20 +48297,7 @@ index d028c5642585ffca236882a2f316150cac2cb0d4..9498f676602e85d020968a7ecf12a31a } } else if (CDVDCodecUtils::ProcessH264MVCExtradata(pStream->codec->extradata, pStream->codec->extradata_size)) -@@ -1737,6 +1765,12 @@ bool CDVDDemuxFFmpeg::SeekChapter(int chapter, double* startpts) - } - - Flush(); -+ if (m_pInput->IsStreamType(DVDSTREAM_TYPE_BLURAY) -+ && static_cast(m_pInput)->HasMVC()) -+ { -+ // also empty the internal ffmpeg buffer otherwise it may cause MVC buffers hang -+ m_ioContext->buf_ptr = m_ioContext->buf_end; -+ } - return true; - } - -@@ -1781,6 +1815,11 @@ std::string CDVDDemuxFFmpeg::GetStreamCodecName(int iStreamId) +@@ -1803,6 +1831,11 @@ std::string CDVDDemuxFFmpeg::GetStreamCodecName(int iStreamId) bool CDVDDemuxFFmpeg::IsProgramChange() { @@ -48656,12 +48309,12 @@ index d028c5642585ffca236882a2f316150cac2cb0d4..9498f676602e85d020968a7ecf12a31a if (m_program == UINT_MAX) return false; -diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxMVC.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxMVC.cpp +diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..4ed7c439e7c36de211f2136c9b6b9a95549fe634 +index 0000000000000000000000000000000000000000..ade6a4454fc3915b0c787b1a4f72aedbd74903db --- /dev/null -+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxMVC.cpp -@@ -0,0 +1,262 @@ ++++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.cpp +@@ -0,0 +1,266 @@ +/* +* Copyright (C) 2005-2013 Team XBMC +* http://xbmc.org @@ -48682,7 +48335,7 @@ index 0000000000000000000000000000000000000000..4ed7c439e7c36de211f2136c9b6b9a95 +* +*/ + -+#include "DVDDemuxMVC.h" ++#include "DemuxMVC.h" +#include "DVDDemuxUtils.h" +#include "DVDInputStreams/DVDInputStream.h" +#include "DVDClock.h" @@ -48697,20 +48350,20 @@ index 0000000000000000000000000000000000000000..4ed7c439e7c36de211f2136c9b6b9a95 + +static int mvc_file_read(void *h, uint8_t* buf, int size) +{ -+ CDVDInputStream* pInputStream = static_cast(h)->m_pInput; ++ CDVDInputStream* pInputStream = static_cast(h)->m_pInput; + return pInputStream->Read(buf, size); +} + +static int64_t mvc_file_seek(void *h, int64_t pos, int whence) +{ -+ CDVDInputStream* pInputStream = static_cast(h)->m_pInput; ++ CDVDInputStream* pInputStream = static_cast(h)->m_pInput; + if (whence == AVSEEK_SIZE) + return pInputStream->GetLength(); + else + return pInputStream->Seek(pos, whence & ~AVSEEK_FORCE); +} + -+CDVDDemuxMVC::CDVDDemuxMVC() ++CDemuxMVC::CDemuxMVC() +{ + m_ioContext = nullptr; + m_pFormatContext = nullptr; @@ -48718,12 +48371,12 @@ index 0000000000000000000000000000000000000000..4ed7c439e7c36de211f2136c9b6b9a95 + m_nStreamIndex = -1; +} + -+CDVDDemuxMVC::~CDVDDemuxMVC() ++CDemuxMVC::~CDemuxMVC() +{ + Dispose(); +} + -+bool CDVDDemuxMVC::Open(CDVDInputStream* pInput) ++bool CDemuxMVC::Open(CDVDInputStream* pInput) +{ + int ret; + @@ -48790,24 +48443,28 @@ index 0000000000000000000000000000000000000000..4ed7c439e7c36de211f2136c9b6b9a95 + return true; +} + -+void CDVDDemuxMVC::Reset() ++void CDemuxMVC::Reset() +{ + CDVDInputStream* pInput = m_pInput; + Dispose(); + Open(pInput); +} + -+void CDVDDemuxMVC::Abort() ++void CDemuxMVC::Abort() +{ +} + -+void CDVDDemuxMVC::Flush() ++void CDemuxMVC::Flush() +{ + if (m_pFormatContext) ++ { ++ if (m_pFormatContext->pb) ++ avio_flush(m_pFormatContext->pb); + avformat_flush(m_pFormatContext); ++ } +} + -+DemuxPacket* CDVDDemuxMVC::Read() ++DemuxPacket* CDemuxMVC::Read() +{ + int ret; + AVPacket mvcPacket = { 0 }; @@ -48848,7 +48505,7 @@ index 0000000000000000000000000000000000000000..4ed7c439e7c36de211f2136c9b6b9a95 + return nullptr; +} + -+bool CDVDDemuxMVC::SeekTime(int time, bool backwords, double* startpts) ++bool CDemuxMVC::SeekTime(int time, bool backwords, double* startpts) +{ + if (!m_pInput) + return false; @@ -48870,17 +48527,17 @@ index 0000000000000000000000000000000000000000..4ed7c439e7c36de211f2136c9b6b9a95 + return true; +} + -+std::string CDVDDemuxMVC::GetFileName() ++std::string CDemuxMVC::GetFileName() +{ + return m_pInput->GetFileName(); +} + -+AVStream* CDVDDemuxMVC::GetAVStream() ++AVStream* CDemuxMVC::GetAVStream() +{ + return m_pFormatContext ? m_pFormatContext->streams[m_nStreamIndex] : nullptr; +} + -+void CDVDDemuxMVC::Dispose() ++void CDemuxMVC::Dispose() +{ + if (m_pFormatContext) + avformat_close_input(&m_pFormatContext); @@ -48897,7 +48554,7 @@ index 0000000000000000000000000000000000000000..4ed7c439e7c36de211f2136c9b6b9a95 + m_nStreamIndex = -1; +} + -+double CDVDDemuxMVC::ConvertTimestamp(int64_t pts, int den, int num) ++double CDemuxMVC::ConvertTimestamp(int64_t pts, int den, int num) +{ + if (pts == (int64_t)AV_NOPTS_VALUE) + return DVD_NOPTS_VALUE; @@ -48919,17 +48576,17 @@ index 0000000000000000000000000000000000000000..4ed7c439e7c36de211f2136c9b6b9a95 + return timestamp * DVD_TIME_BASE; +} + -+std::vector CDVDDemuxMVC::GetStreams() const ++std::vector CDemuxMVC::GetStreams() const +{ + std::vector streams; + return streams; +} \ No newline at end of file -diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxMVC.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxMVC.h +diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.h new file mode 100644 -index 0000000000000000000000000000000000000000..284358f282ed3d708be5929e6b04d6f49782079d +index 0000000000000000000000000000000000000000..bbb836a61344689a83af68c821c05c212a86b097 --- /dev/null -+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxMVC.h ++++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.h @@ -0,0 +1,57 @@ +#pragma once + @@ -48959,11 +48616,11 @@ index 0000000000000000000000000000000000000000..284358f282ed3d708be5929e6b04d6f4 +#include "libavformat/avformat.h" +} + -+class CDVDDemuxMVC : public CDVDDemux ++class CDemuxMVC : public CDVDDemux +{ +public: -+ CDVDDemuxMVC(); -+ virtual ~CDVDDemuxMVC(); ++ CDemuxMVC(); ++ virtual ~CDemuxMVC(); + bool Open(CDVDInputStream* pInput); + virtual void Reset(); + virtual void Abort(); @@ -48989,14 +48646,14 @@ index 0000000000000000000000000000000000000000..284358f282ed3d708be5929e6b04d6f4 + int m_nStreamIndex = -1; +}; \ No newline at end of file -diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.cpp -index e99352a90f348a95673ef3442d3f6cb020cd57d4..e390529bb8602af04c3853337821123546fb098d 100644 ---- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.cpp -+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.cpp +diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp +index f75532016a1395782b59dc124676835c7254de56..2c7e66f7ee5683a0fbcde5ad5c65ebfd6853f3d0 100644 +--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp ++++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp @@ -19,11 +19,13 @@ */ - #include "DVDDemuxStreamSSIF.h" + #include "DemuxStreamSSIF.h" +#include "DVDDemux.h" #include "DVDClock.h" #include "DVDDemuxUtils.h" @@ -49005,9 +48662,9 @@ index e99352a90f348a95673ef3442d3f6cb020cd57d4..e390529bb8602af04c38533378211235 //#define DEBUG_VERBOSE +#define MVC_QUEUE_SIZE 100 - DemuxPacket* CDVDDemuxStreamSSIF::AddPacket(DemuxPacket* &srcPkt) + DemuxPacket* CDemuxStreamSSIF::AddPacket(DemuxPacket* &srcPkt) { -@@ -37,7 +39,7 @@ DemuxPacket* CDVDDemuxStreamSSIF::AddPacket(DemuxPacket* &srcPkt) +@@ -37,7 +39,7 @@ DemuxPacket* CDemuxStreamSSIF::AddPacket(DemuxPacket* &srcPkt) } else if (srcPkt->iStreamId == m_mvcStreamId) { @@ -49016,9 +48673,9 @@ index e99352a90f348a95673ef3442d3f6cb020cd57d4..e390529bb8602af04c38533378211235 } return GetMVCPacket(); -@@ -81,6 +83,10 @@ DemuxPacket* CDVDDemuxStreamSSIF::MergePacket(DemuxPacket* &srcPkt, DemuxPacket* +@@ -81,6 +83,10 @@ DemuxPacket* CDemuxStreamSSIF::MergePacket(DemuxPacket* &srcPkt, DemuxPacket* &a - DemuxPacket* CDVDDemuxStreamSSIF::GetMVCPacket() + DemuxPacket* CDemuxStreamSSIF::GetMVCPacket() { + // if input is a bluray fill mvc queue before processing + if (m_bluRay && m_MVCqueue.empty() && !m_H264queue.empty()) @@ -49027,7 +48684,7 @@ index e99352a90f348a95673ef3442d3f6cb020cd57d4..e390529bb8602af04c38533378211235 // Here, we recreate a h264 MVC packet from the base one + buffered MVC NALU's while (!m_H264queue.empty() && !m_MVCqueue.empty()) { -@@ -151,6 +157,36 @@ DemuxPacket* CDVDDemuxStreamSSIF::GetMVCPacket() +@@ -151,6 +157,36 @@ DemuxPacket* CDemuxStreamSSIF::GetMVCPacket() #if defined(DEBUG_VERBOSE) CLog::Log(LOGDEBUG, ">>> MVC waiting. MVC(%d) H264(%d)", m_MVCqueue.size(), m_H264queue.size()); #endif @@ -49035,12 +48692,12 @@ index e99352a90f348a95673ef3442d3f6cb020cd57d4..e390529bb8602af04c38533378211235 return CDVDDemuxUtils::AllocateDemuxPacket(0); } + -+void CDVDDemuxStreamSSIF::AddMVCExtPacket(DemuxPacket* &mvcExtPkt) ++void CDemuxStreamSSIF::AddMVCExtPacket(DemuxPacket* &mvcExtPkt) +{ + m_MVCqueue.push(mvcExtPkt); +} + -+bool CDVDDemuxStreamSSIF::FillMVCQueue(double dtsBase) ++bool CDemuxStreamSSIF::FillMVCQueue(double dtsBase) +{ + if (!m_bluRay) + return false; @@ -49065,10 +48722,10 @@ index e99352a90f348a95673ef3442d3f6cb020cd57d4..e390529bb8602af04c38533378211235 + }; + return m_MVCqueue.size() == MVC_QUEUE_SIZE; +} -diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.h -index 8412627a3ea13f59bd2c96c23bd386e4b5b2658e..579c382dca988b0c37e5da7396803f70d4cf15ff 100644 ---- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.h -+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.h +diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.h +index 1dafdc58db3f9cb5eac032c591942439117e13c4..508e9debd3e6679a1433842a65649fa68ead76ec 100644 +--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.h ++++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.h @@ -21,6 +21,7 @@ */ @@ -49101,19 +48758,19 @@ index 8412627a3ea13f59bd2c96c23bd386e4b5b2658e..579c382dca988b0c37e5da7396803f70 + int m_mvcStreamId = -1; }; diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/Makefile.in b/xbmc/cores/VideoPlayer/DVDDemuxers/Makefile.in -index f3b717ddabb4729fe0db5ebab5a7913b8fe8297c..80ceeeaea6f061ec0b82f95d1edf7c572960397c 100644 +index 30076937bd084936571abf0e6eeecf5ad916c7b3..0359426b85683a4c3a80ef0e0d52f7a79564daaa 100644 --- a/xbmc/cores/VideoPlayer/DVDDemuxers/Makefile.in +++ b/xbmc/cores/VideoPlayer/DVDDemuxers/Makefile.in @@ -11,6 +11,7 @@ SRCS += DVDDemuxVobsub.cpp SRCS += DVDDemuxCC.cpp SRCS += DVDFactoryDemuxer.cpp - SRCS += DVDDemuxStreamSSIF.cpp + SRCS += DemuxStreamSSIF.cpp +SRCS += DVDDemuxMVC.cpp LIB = DVDDemuxers.a diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp -index 6ccd9a8c00fdc5175df3ecbb3a5d30dc93e319ab..5e85db23b09c920c4b19f3e7cae6e3f8ccae2db9 100644 +index 6ccd9a8c00fdc5175df3ecbb3a5d30dc93e319ab..ad2c65ba5b80c5ac5d055d621a1e8319e3f770c0 100644 --- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp +++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp @@ -26,6 +26,8 @@ @@ -49121,7 +48778,7 @@ index 6ccd9a8c00fdc5175df3ecbb3a5d30dc93e319ab..5e85db23b09c920c4b19f3e7cae6e3f8 #include "DVDCodecs/Overlay/DVDOverlay.h" #include "DVDCodecs/Overlay/DVDOverlayImage.h" +#include "DVDInputStreamFile.h" -+#include "DVDDemuxers/DVDDemuxMVC.h" ++#include "DVDDemuxers/DemuxMVC.h" #include "settings/Settings.h" #include "LangInfo.h" #include "utils/log.h" @@ -49375,7 +49032,7 @@ index 6ccd9a8c00fdc5175df3ecbb3a5d30dc93e319ab..5e85db23b09c920c4b19f3e7cae6e3f8 + if (m_pMVCDemux) + SAFE_DELETE(m_pMVCDemux); + -+ CDVDDemuxMVC* pMVCDemux = new CDVDDemuxMVC; ++ CDemuxMVC* pMVCDemux = new CDemuxMVC; + m_pMVCDemux = pMVCDemux; + + if (!pMVCDemux->Open(m_pMVCInput)) @@ -49461,57 +49118,648 @@ index b967a85e6557e42a7f1235cdd804d5a0263b866f..561fb5cd4f971bc9ee4f41218a60bb3d typedef std::shared_ptr SOverlay; typedef std::list SOverlays; -From 9364454aa08e510e8285fd792abb8cdf63aace2f Mon Sep 17 00:00:00 2001 -From: Anton Fedchin -Date: Wed, 2 Mar 2016 23:31:50 +0300 -Subject: [PATCH 43/73] [BaseRenderer] Fix aspect for TAB/SBS (need more - testing) +From 3de6eb54b199d8c1bfe75061558d176de257be55 Mon Sep 17 00:00:00 2001 +From: Anton Fedchin +Date: Fri, 11 Mar 2016 16:58:53 +0300 +Subject: [PATCH 43/63] [VideoPlayer] HasVideo returns true if video stream + exists. This don't allow start visualization if audio is opened before video. --- - xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.cpp | 18 ++++++++++++++++++ - 1 file changed, 18 insertions(+) + xbmc/cores/VideoPlayer/VideoPlayer.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.cpp -index f9b3bfb4eb35eff3ef7af370136882bc733461e6..ab804ab0259992e4700e0ba99759c3f777bc8d52 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.cpp -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.cpp -@@ -35,6 +35,9 @@ - #include "settings/AdvancedSettings.h" - #include "cores/VideoPlayer/VideoRenderers/RenderFlags.h" +diff --git a/xbmc/cores/VideoPlayer/VideoPlayer.cpp b/xbmc/cores/VideoPlayer/VideoPlayer.cpp +index bb80b836b9c7528def9b623966d8b66aca9bcc92..d2482bcfb036cd5705afc3bae9bf759b6cf2f6b0 100644 +--- a/xbmc/cores/VideoPlayer/VideoPlayer.cpp ++++ b/xbmc/cores/VideoPlayer/VideoPlayer.cpp +@@ -3115,7 +3115,7 @@ void CVideoPlayer::Pause() -+extern "C" { -+#include "libavformat/version.h" -+} - - CBaseRenderer::CBaseRenderer() + bool CVideoPlayer::HasVideo() const { -@@ -369,6 +372,21 @@ void CBaseRenderer::CalculateFrameAspectRatio(unsigned int desired_width, unsign - if (m_sourceHeight == 576) // PAL - m_sourceFrameRatio = imageFrameRatio * PALPixelRatio * Non4by3Correction; - } -+#if (LIBAVFORMAT_VERSION_MAJOR >= 57) -+ bool isAnamorph = m_sourceWidth <= 1920 && m_sourceHeight <= 1080; -+ float factor = isAnamorph ? 2.0f : 4.0f; -+ switch (CONF_FLAGS_STEREO_MODE_MASK(m_iFlags)) -+ { -+ case CONF_FLAGS_STEREO_MODE_TAB: -+ m_sourceFrameRatio *= factor; -+ break; -+ case CONF_FLAGS_STEREO_MODE_SBS: -+ m_sourceFrameRatio /= factor; -+ break; -+ default: -+ break; -+ } -+#endif +- return m_HasVideo; ++ return m_HasVideo || GetVideoStream() >= 0; } - void CBaseRenderer::ManageRenderArea() + bool CVideoPlayer::HasAudio() const -From 023ad967694764e1c6f1ae964a284de3eac0474b Mon Sep 17 00:00:00 2001 +From 5a0375aa55d9fcc679382b12482cc66861df7ff5 Mon Sep 17 00:00:00 2001 +From: Anton Fedchin +Date: Thu, 10 Mar 2016 18:11:33 +0300 +Subject: [PATCH 44/63] fixup! Revert supporting crappy tab/sbs subtitles. this + fixes regular subtitles. + +--- + .../cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp +index 3a080d06c90b0762482816928642e6de7810b539..a8323f419e404037c4e5fb4d78fa1b45409337a7 100644 +--- a/xbmc/cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp ++++ b/xbmc/cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp +@@ -243,20 +243,20 @@ CDVDOverlay* CDVDOverlayCodecFFmpeg::GetOverlay() + } + } + +- RENDER_STEREO_MODE render_stereo_mode = g_graphicsContext.GetStereoMode(); ++ /*RENDER_STEREO_MODE render_stereo_mode = g_graphicsContext.GetStereoMode(); + if (render_stereo_mode != RENDER_STEREO_MODE_OFF) + { +- if (rect.h > m_height / 2) ++ if ((rect.h - rect.y) > m_height / 2) + { + m_height /= 2; + rect.h /= 2; + } +- else if (rect.w > m_width / 2) ++ else if ((rect.w - rect.x) > m_width / 2) + { + m_width /= 2; + rect.w /= 2; + } +- } ++ }*/ + + CDVDOverlayImage* overlay = new CDVDOverlayImage(); + + +From e2498d26f1b7928017f856108aa8263e6c73194d Mon Sep 17 00:00:00 2001 +From: Anton Fedchin +Date: Thu, 7 Apr 2016 17:28:50 +0300 +Subject: [PATCH 45/63] [VideoPlayer] Disable reading extension stream from + input stream if decoder doesn't support it. + +--- + xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h | 5 +++++ + xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 18 +++++++++--------- + xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp | 4 +++- + xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.h | 6 +++--- + .../cores/VideoPlayer/DVDInputStreams/DVDInputStream.h | 11 +++++++++++ + .../DVDInputStreams/DVDInputStreamBluray.cpp | 9 ++++++++- + .../VideoPlayer/DVDInputStreams/DVDInputStreamBluray.h | 9 ++++++--- + xbmc/cores/VideoPlayer/IVideoPlayer.h | 1 + + xbmc/cores/VideoPlayer/VideoPlayer.cpp | 4 ++++ + xbmc/cores/VideoPlayer/VideoPlayerVideo.h | 1 + + 10 files changed, 51 insertions(+), 17 deletions(-) + +diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h +index a2da9de4375939f3711c594dc854b9a533c755b4..8101b6eeff0341a94736df7ee815dd4c18337a32 100644 +--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h ++++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h +@@ -311,6 +311,11 @@ public: + */ + virtual void Reopen() {}; + ++ /** ++ * Indicates that the decoder supports extention streams. ++ */ ++ virtual bool SupportsExtention() { return false; } ++ + protected: + CProcessInfo &m_processInfo; + }; +diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +index 3d4d22930da1ac1e090ba95ef0faa65fbafa4326..0282b3e0c70c023c412128acae508d7ece3f294b 100644 +--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp ++++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +@@ -504,14 +504,14 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput, bool streaminfo, bool filein + + UpdateCurrentPTS(); + +- if (!fileinfo && m_pInput->IsStreamType(DVDSTREAM_TYPE_BLURAY)) ++ if (!fileinfo) + { +- CDVDInputStreamBluray *bluRay = static_cast(m_pInput); +- if (bluRay->HasMVC()) ++ CDVDInputStream::IExtentionStream* pExt = dynamic_cast(m_pInput); ++ if (pExt && pExt->HasExtention()) + { + SAFE_DELETE(m_pSSIF); + m_pSSIF = new CDemuxStreamSSIF(); +- m_pSSIF->SetBluRay(bluRay); ++ m_pSSIF->SetBluRay(pExt); + } + } + // in case of mpegts and we have not seen pat/pmt, defer creation of streams +@@ -1487,13 +1487,13 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) + pStream->codec->codec_tag = MKTAG('A', 'M', 'V', 'C'); + + AVStream* mvcStream = nullptr; +- if (m_pInput->IsStreamType(DVDSTREAM_TYPE_BLURAY)) ++ CDVDInputStream::IExtentionStream* pExt = dynamic_cast(m_pInput); ++ if (pExt) + { +- CDVDInputStreamBluray *bluRay = static_cast(m_pInput); +- if (bluRay->HasMVC()) ++ if (pExt->HasExtention()) + { +- st->stereo_mode = bluRay->AreEyesFlipped() ? "block_rl" : "block_lr"; +- mvcStream = static_cast(bluRay->GetDemuxMVC())->GetAVStream(); ++ st->stereo_mode = pExt->AreEyesFlipped() ? "block_rl" : "block_lr"; ++ mvcStream = static_cast(pExt->GetExtentionDemux())->GetAVStream(); + } + } + else +diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp +index 2c7e66f7ee5683a0fbcde5ad5c65ebfd6853f3d0..7c8719ce40e725e27b7551250398022a1f1a4fc6 100644 +--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp ++++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp +@@ -35,6 +35,8 @@ DemuxPacket* CDemuxStreamSSIF::AddPacket(DemuxPacket* &srcPkt) + + if (srcPkt->iStreamId == m_h264StreamId) + { ++ if (m_bluRay && !m_bluRay->HasExtention()) ++ return srcPkt; + m_H264queue.push(srcPkt); + } + else if (srcPkt->iStreamId == m_mvcStreamId) +@@ -170,7 +172,7 @@ bool CDemuxStreamSSIF::FillMVCQueue(double dtsBase) + if (!m_bluRay) + return false; + +- CDVDDemux* demux = m_bluRay->GetDemuxMVC(); ++ CDVDDemux* demux = m_bluRay->GetExtentionDemux(); + DemuxPacket* mvc; + while ((m_MVCqueue.size() < MVC_QUEUE_SIZE) && (mvc = demux->Read())) + { +diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.h +index 508e9debd3e6679a1433842a65649fa68ead76ec..26cd97dddcae208afacfb241e96b4935ad0f81f3 100644 +--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.h ++++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.h +@@ -21,7 +21,7 @@ + */ + + #include "DVDDemuxPacket.h" +-#include "DVDInputStreams/DVDInputStreamBluray.h" ++#include "DVDInputStreams/DVDInputStream.h" + #include + + extern "C" { +@@ -41,7 +41,7 @@ public: + int GetH264StreamId() { return m_h264StreamId; }; + int GetMVCStreamId() { return m_mvcStreamId; }; + void AddMVCExtPacket(DemuxPacket* &scrPkt); +- void SetBluRay(CDVDInputStreamBluray* &bluRay) { m_bluRay = bluRay; }; ++ void SetBluRay(CDVDInputStream::IExtentionStream* &bluRay) { m_bluRay = bluRay; }; + bool IsBluRay() { return m_bluRay != nullptr; }; + + private: +@@ -49,7 +49,7 @@ private: + DemuxPacket* MergePacket(DemuxPacket* &srcPkt, DemuxPacket* &appendPkt); + bool FillMVCQueue(double dtsBase); + +- CDVDInputStreamBluray* m_bluRay = nullptr; ++ CDVDInputStream::IExtentionStream* m_bluRay = nullptr; + std::queue m_H264queue; + std::queue m_MVCqueue; + int m_h264StreamId = -1; +diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h +index 932f0e4093c836453b07932df9075afc6f6e5ae5..7aee35cef8f42d080882e4bdd20a4a9ed234a8c2 100644 +--- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h ++++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h +@@ -57,6 +57,7 @@ namespace XFILE + + struct DemuxPacket; + class CDemuxStream; ++class CDVDDemux; + + class CDVDInputStream + { +@@ -131,6 +132,16 @@ public: + virtual void SetVideoResolution(int width, int height) {}; + }; + ++ class IExtentionStream ++ { ++ public: ++ virtual ~IExtentionStream() {} ++ virtual bool HasExtention() = 0; ++ virtual bool AreEyesFlipped() = 0; ++ virtual CDVDDemux* GetExtentionDemux() = 0; ++ virtual void DisableExtention() = 0; ++ }; ++ + enum ENextStream + { + NEXTSTREAM_NONE, +diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp +index ad2c65ba5b80c5ac5d055d621a1e8319e3f770c0..74e8e1fc2da66d3c98a5bab04faa2f6bf16539ff 100644 +--- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp ++++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp +@@ -617,6 +617,13 @@ void CDVDInputStreamBluray::ProcessEvent() { + } + } + ++void CDVDInputStreamBluray::DisableExtention() ++{ ++ CloseMVCDemux(); ++ m_bMVCDisabled = true; ++ m_bMVCPlayback = false; ++} ++ + int CDVDInputStreamBluray::Read(uint8_t* buf, int buf_size) + { + int result = 0; +@@ -1165,7 +1172,7 @@ bool CDVDInputStreamBluray::ProcessItem(int playitem) + + m_title = m_dll->bd_get_playlist_info(m_bd, playitem, m_angle); + +- if (CSettings::GetInstance().GetBool("videoplayer.supportmvc")) ++ if (CSettings::GetInstance().GetBool("videoplayer.supportmvc") && !m_bMVCDisabled) + { + MPLS_PL * mpls = m_dll->bd_get_title_mpls(m_bd); + if (mpls) +diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.h b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.h +index 561fb5cd4f971bc9ee4f41218a60bb3d5bc5625f..f70657c9e31fb2460d12910c635dba5163282e74 100644 +--- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.h ++++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.h +@@ -46,6 +46,7 @@ class CDVDInputStreamBluray + , public CDVDInputStream::IChapter + , public CDVDInputStream::IPosTime + , public CDVDInputStream::IMenus ++ , public CDVDInputStream::IExtentionStream + { + public: + CDVDInputStreamBluray(IVideoPlayer* player, const CFileItem& fileitem); +@@ -120,9 +121,10 @@ public: + BLURAY_TITLE_INFO* GetTitleFile(const std::string& name); + + void ProcessEvent(); +- CDVDDemux* GetDemuxMVC() { return m_pMVCDemux; }; +- bool HasMVC() { return m_bMVCPlayback; } +- bool AreEyesFlipped() { return m_bFlipEyes; } ++ CDVDDemux* GetExtentionDemux() override { return m_pMVCDemux; }; ++ bool HasExtention() override { return m_bMVCPlayback; } ++ bool AreEyesFlipped() override { return m_bFlipEyes; } ++ void DisableExtention() override; + + protected: + struct SPlane; +@@ -157,6 +159,7 @@ protected: + int m_nMVCSubPathIndex = 0; + int m_nMVCClip = -1; + bool m_bFlipEyes = false; ++ bool m_bMVCDisabled = false; + uint64_t m_clipStartTime = 0; + + typedef std::shared_ptr SOverlay; +diff --git a/xbmc/cores/VideoPlayer/IVideoPlayer.h b/xbmc/cores/VideoPlayer/IVideoPlayer.h +index 0b676c9b611fe956f1aa721013412e41ff5b62f6..6762e733848d1298a75a862b0aaf81aa5690537d 100644 +--- a/xbmc/cores/VideoPlayer/IVideoPlayer.h ++++ b/xbmc/cores/VideoPlayer/IVideoPlayer.h +@@ -111,6 +111,7 @@ public: + virtual int GetDecoderBufferSize() { return 0; } + virtual int GetDecoderFreeSpace() = 0; + virtual bool IsEOS() { return false; }; ++ virtual bool SupportsExtention() const = 0; + }; + + class CDVDAudioCodec; +diff --git a/xbmc/cores/VideoPlayer/VideoPlayer.cpp b/xbmc/cores/VideoPlayer/VideoPlayer.cpp +index d2482bcfb036cd5705afc3bae9bf759b6cf2f6b0..eda74e7b74452c7e8dfc18571ebcd355bd12a247 100644 +--- a/xbmc/cores/VideoPlayer/VideoPlayer.cpp ++++ b/xbmc/cores/VideoPlayer/VideoPlayer.cpp +@@ -3891,6 +3891,10 @@ bool CVideoPlayer::OpenVideoStream(CDVDStreamInfo& hint, bool reset) + if (!player->OpenStream(hint)) + return false; + ++ CDVDInputStream::IExtentionStream* pExt = dynamic_cast(m_pInputStream); ++ if (pExt && !static_cast(player)->SupportsExtention()) ++ pExt->DisableExtention(); ++ + s.stereo_mode = static_cast(player)->GetStereoMode(); + if (s.stereo_mode == "mono") + s.stereo_mode = ""; +diff --git a/xbmc/cores/VideoPlayer/VideoPlayerVideo.h b/xbmc/cores/VideoPlayer/VideoPlayerVideo.h +index 0d4100e58e9db7e5035bcf9ae23b0147f80cec8f..69570153f0810a5840f3780c7a6681a102b85cec 100644 +--- a/xbmc/cores/VideoPlayer/VideoPlayerVideo.h ++++ b/xbmc/cores/VideoPlayer/VideoPlayerVideo.h +@@ -91,6 +91,7 @@ public: + int GetVideoBitrate(); + std::string GetStereoMode(); + void SetSpeed(int iSpeed); ++ bool SupportsExtention() const override { return m_pVideoCodec && m_pVideoCodec->SupportsExtention(); } + + // classes + CDVDOverlayContainer* m_pOverlayContainer; + +From 9352e854adf22fa92a355da385cf0b9930ab9821 Mon Sep 17 00:00:00 2001 +From: Anton Fedchin +Date: Fri, 16 Sep 2016 11:37:48 +0300 +Subject: [PATCH 46/63] [Settings] move SETTING_VIDEOPLAYER_SUPPORTMVC from + platform settings to common settings. + +--- + system/settings/rbp.xml | 7 ------- + system/settings/settings.xml | 6 ++++++ + system/settings/win32.xml | 11 ----------- + .../VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp | 2 +- + xbmc/settings/SettingConditions.cpp | 3 +++ + 5 files changed, 10 insertions(+), 19 deletions(-) + +diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml +index 2572e25753712186f69390965ee1448bff3fadd5..7098edf32dff8c00e192229c3ffb060be6a42482 100644 +--- a/system/settings/rbp.xml ++++ b/system/settings/rbp.xml +@@ -28,13 +28,6 @@ + + + +- +- +- 2 +- true +- +- +- + +
+
+diff --git a/system/settings/settings.xml b/system/settings/settings.xml +index 22dcff1c06577055f84c3d2c2fda73cfa16c53d4..eb610a8aaa795d2caeaf2ab12bcf61b1148524b4 100644 +--- a/system/settings/settings.xml ++++ b/system/settings/settings.xml +@@ -343,6 +343,12 @@ + true + + ++ ++ 2 ++ true ++ ++ HAS_MVC ++ + + + +diff --git a/system/settings/win32.xml b/system/settings/win32.xml +index 2fcee72a64e8b701c8e895143410bbe9fd617356..a017d30c24232fb01220b87b29398403b8ed9662 100644 +--- a/system/settings/win32.xml ++++ b/system/settings/win32.xml +@@ -12,17 +12,6 @@ + false + +
+-
+- +- +- +- 2 +- true +- +- +- +- +-
+
+ + +diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp +index 74e8e1fc2da66d3c98a5bab04faa2f6bf16539ff..7dd85f0173bd636f4f5ae6e7fc43b3064e2ff822 100644 +--- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp ++++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp +@@ -1172,7 +1172,7 @@ bool CDVDInputStreamBluray::ProcessItem(int playitem) + + m_title = m_dll->bd_get_playlist_info(m_bd, playitem, m_angle); + +- if (CSettings::GetInstance().GetBool("videoplayer.supportmvc") && !m_bMVCDisabled) ++ if (CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC) && !m_bMVCDisabled) + { + MPLS_PL * mpls = m_dll->bd_get_title_mpls(m_bd); + if (mpls) +diff --git a/xbmc/settings/SettingConditions.cpp b/xbmc/settings/SettingConditions.cpp +index 6b1f2b6d757354d6065c2862b44dfb47184a1dcc..9163ec85bd0feb48a698a025d9870bf40042c675 100644 +--- a/xbmc/settings/SettingConditions.cpp ++++ b/xbmc/settings/SettingConditions.cpp +@@ -327,6 +327,9 @@ void CSettingConditions::Initialize() + m_simpleConditions.insert("has_dx"); + m_simpleConditions.insert("hasdxva2"); + #endif ++#if defined(HAVE_LIBMFX) || defined(TARGET_RASPBERRY_PI) ++ m_simpleConditions.insert("has_mvc"); ++#endif + #ifdef HAVE_LCMS2 + m_simpleConditions.insert("have_lcms2"); + #endif + +From 0bc38979bbe7ace03e826101248397b845581a7f Mon Sep 17 00:00:00 2001 +From: Anton Fedchin +Date: Fri, 4 Nov 2016 22:56:56 +0300 +Subject: [PATCH 47/63] [VideoPlayer] SSIF: fix for corner case when mvc stream + is switched before the last packet is read from previous stream. + +--- + .../VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 5 ++- + .../VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp | 7 ++-- + .../VideoPlayer/DVDInputStreams/DVDInputStream.h | 1 + + .../DVDInputStreams/DVDInputStreamBluray.cpp | 39 +++++++++++++++++++--- + .../DVDInputStreams/DVDInputStreamBluray.h | 3 ++ + 5 files changed, 45 insertions(+), 10 deletions(-) + +diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +index 0282b3e0c70c023c412128acae508d7ece3f294b..c3e8a84ed2cdb148717f05ca85aebb21bb2dab6e 100644 +--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp ++++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +@@ -1120,9 +1120,6 @@ bool CDVDDemuxFFmpeg::SeekTime(double time, bool backwards, double *startpts) + m_pkt.result = -1; + av_packet_unref(&m_pkt.pkt); + +- if (m_pSSIF) +- m_pSSIF->Flush(); +- + CDVDInputStream::IPosTime* ist = m_pInput->GetIPosTime(); + if (ist) + { +@@ -1136,6 +1133,8 @@ bool CDVDDemuxFFmpeg::SeekTime(double time, bool backwards, double *startpts) + + return true; + } ++ else if (m_pSSIF) ++ m_pSSIF->Flush(); + + if (!m_pInput->Seek(0, SEEK_POSSIBLE) && + !m_pInput->IsStreamType(DVDSTREAM_TYPE_FFMPEG)) +diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp +index 7c8719ce40e725e27b7551250398022a1f1a4fc6..c675e31f731bc6afb8aabc37bbb5495aed45f4f6 100644 +--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp ++++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp +@@ -183,12 +183,15 @@ bool CDemuxStreamSSIF::FillMVCQueue(double dtsBase) + else if (mvc->dts < dtsBase) + { + #if defined(DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, ">>> MVC discard mvc: %6d, pts(%.3f) dts(%.3f)", mvc->iSize, mvc->pts*1e-6, mvc->dts*1e-6); ++ CLog::Log(LOGDEBUG, ">>> MVC drop mvc: %6d, pts(%.3f) dts(%.3f)", mvc->iSize, mvc->pts*1e-6, mvc->dts*1e-6); + #endif + CDVDDemuxUtils::FreeDemuxPacket(mvc); + continue; + } + AddMVCExtPacket(mvc); + }; +- return m_MVCqueue.size() == MVC_QUEUE_SIZE; ++ if (m_MVCqueue.size() != MVC_QUEUE_SIZE) ++ m_bluRay->OpenNextStream(); ++ ++ return true; + } +diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h +index 7aee35cef8f42d080882e4bdd20a4a9ed234a8c2..ea138f95bac915a946800f6bc7b964bd928e1a89 100644 +--- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h ++++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h +@@ -140,6 +140,7 @@ public: + virtual bool AreEyesFlipped() = 0; + virtual CDVDDemux* GetExtentionDemux() = 0; + virtual void DisableExtention() = 0; ++ virtual bool OpenNextStream() = 0; + }; + + enum ENextStream +diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp +index 7dd85f0173bd636f4f5ae6e7fc43b3064e2ff822..23053d7f8ebf494c7b35bf41bcf9952fa9a5f261 100644 +--- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp ++++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp +@@ -48,6 +48,7 @@ + #endif + + #define LIBBLURAY_BYTESEEK 0 ++#define EMPTY_QUEUE(x) { while(!x.empty()) x.pop(); } + + using namespace XFILE; + +@@ -432,6 +433,8 @@ bool CDVDInputStreamBluray::Open() + while (m_dll->bd_get_event(m_bd, &m_event)) + ProcessEvent(); + ++ OpenNextStream(); ++ + return true; + } + +@@ -610,10 +613,14 @@ void CDVDInputStreamBluray::ProcessEvent() { + /* event has been consumed */ + m_event.event = BD_EVENT_NONE; + +- if (m_bMVCPlayback && m_clip >= 0 && m_title && m_clip < m_title->clip_count && m_nMVCClip != m_clip) ++ if ( m_bMVCPlayback && m_clip >= 0 ++ && m_title ++ && m_clip < m_title->clip_count ++ && m_nMVCClip != m_clip ++ && (m_clipQueue.empty() ++ || m_clip != m_clipQueue.front())) + { +- CloseMVCDemux(); +- OpenMVCDemux(m_clip); ++ m_clipQueue.push(m_clip); + } + } + +@@ -935,10 +942,15 @@ bool CDVDInputStreamBluray::PosTime(int ms) + if(m_dll->bd_seek_time(m_bd, ms * 90) < 0) + return false; + ++ EMPTY_QUEUE(m_clipQueue); + while (m_dll->bd_get_event(m_bd, &m_event)) + ProcessEvent(); + +- SeekMVCDemux(ms - m_clipStartTime); ++ if (m_bMVCPlayback) ++ { ++ OpenNextStream(); ++ SeekMVCDemux(ms - m_clipStartTime); ++ } + return true; + } + +@@ -963,10 +975,15 @@ bool CDVDInputStreamBluray::SeekChapter(int ch) + if(m_title && m_dll->bd_seek_chapter(m_bd, ch-1) < 0) + return false; + ++ EMPTY_QUEUE(m_clipQueue); + while (m_dll->bd_get_event(m_bd, &m_event)) + ProcessEvent(); + +- SeekMVCDemux(GetChapterPos(ch) * 1000 - m_clipStartTime); ++ if (m_bMVCPlayback) ++ { ++ OpenNextStream(); ++ SeekMVCDemux(GetChapterPos(ch) * 1000 - m_clipStartTime); ++ } + return true; + } + +@@ -1196,6 +1213,18 @@ bool CDVDInputStreamBluray::ProcessItem(int playitem) + return true; + } + ++bool CDVDInputStreamBluray::OpenNextStream() ++{ ++ if (m_clipQueue.empty()) ++ return false; ++ ++ int clip = m_clipQueue.front(); ++ m_clipQueue.pop(); ++ ++ CloseMVCDemux(); ++ return OpenMVCDemux(clip); ++} ++ + bool CDVDInputStreamBluray::OpenMVCDemux(int playItem) + { + MPLS_PL *pl = m_dll->bd_get_title_mpls(m_bd); +diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.h b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.h +index f70657c9e31fb2460d12910c635dba5163282e74..a11ec77903d2a9b2c68106a8e2301af93823b0bd 100644 +--- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.h ++++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.h +@@ -23,6 +23,7 @@ + #include "DVDInputStream.h" + #include + #include ++#include + + extern "C" + { +@@ -125,6 +126,7 @@ public: + bool HasExtention() override { return m_bMVCPlayback; } + bool AreEyesFlipped() override { return m_bFlipEyes; } + void DisableExtention() override; ++ bool OpenNextStream() override; + + protected: + struct SPlane; +@@ -161,6 +163,7 @@ protected: + bool m_bFlipEyes = false; + bool m_bMVCDisabled = false; + uint64_t m_clipStartTime = 0; ++ std::queue m_clipQueue; + + typedef std::shared_ptr SOverlay; + typedef std::list SOverlays; + +From ed5005bc45795b939aeff91bed0f117c16b4dc2c Mon Sep 17 00:00:00 2001 +From: Anton Fedchin +Date: Tue, 23 Feb 2016 16:01:08 +0300 +Subject: [PATCH 48/63] [libbluray] bump libbluray to 0.9.2-mvc. + +--- + project/BuildDependencies/scripts/0_package.list | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/project/BuildDependencies/scripts/0_package.list b/project/BuildDependencies/scripts/0_package.list +index e6c608023a46d377ef520bf23e9863ee0350d980..f8db70ab3861835f33f0e4be79cf3d193093a45f 100644 +--- a/project/BuildDependencies/scripts/0_package.list ++++ b/project/BuildDependencies/scripts/0_package.list +@@ -17,7 +17,7 @@ freetype-2.6.3-win32-vc140.7z + giflib-5.1.4-win32-vc140.7z + jsonschemabuilder-1.0.0-win32-3.7z + libass-542975a-win32-vc140.7z +-libbluray-0.9.3-win32-vc140.7z ++libbluray-0.9.2-mvc-win32-vc120.7z + libcdio-0.9.3-win32-vc140.7z + libcec-4.0.0-win32-vc140-2.7z + libfribidi-0.19.2-win32.7z + +From c0fee4b9928898a5d274afb281bcb47914858ebb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 29 Feb 2016 17:00:50 +0000 -Subject: [PATCH 44/73] libbluray: Bump to Nevcairie's v0.9.2 +Subject: [PATCH 49/63] libbluray: Bump to Nevcairie's v0.9.2 This includes 3D support --- @@ -51168,15 +51416,148 @@ index 0000000000000000000000000000000000000000..5ef0124e35c9d81143921a328e272220 + + return fp; -From e513afc9435f9652af6e31e159e0a9e5217e3c96 Mon Sep 17 00:00:00 2001 +From a8036877d09fcadda752e2ef27141713d375db8e Mon Sep 17 00:00:00 2001 From: popcornmix -Date: Wed, 2 Mar 2016 19:40:47 +0000 -Subject: [PATCH 45/73] [VideoPlayer] Added new msdk-mvc decoder. +Date: Sun, 6 Mar 2016 12:54:59 +0000 +Subject: [PATCH 50/63] mvc: Automatically enable stereo mode + +--- + xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp | 6 +++++- + xbmc/cores/omxplayer/OMXVideo.cpp | 6 +++++- + 2 files changed, 10 insertions(+), 2 deletions(-) + +diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp +index e757ca64c1caf5c43988c2cb77da159b8f8eee93..368a26d9d7f1f3ca8b1666cb188446b120b934c2 100644 +--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp ++++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp +@@ -403,13 +403,17 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) + switch (hints.codec) + { + case AV_CODEC_ID_H264: ++ case AV_CODEC_ID_H264_MVC: + // H.264 + m_codingType = MMAL_ENCODING_H264; + m_pFormatName = "mmal-h264"; +- if (CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC)) ++ if ((hints.codec_tag == MKTAG('M', 'V', 'C', '1') || hints.codec_tag == MKTAG('A', 'M', 'V', 'C')) && ++ CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC)) + { + m_codingType = MMAL_ENCODING_MVC; + m_pFormatName= "mmal-mvc"; ++ if (hints.stereo_mode == "mono") ++ hints.stereo_mode = "mvc_lr"; + } + break; + case AV_CODEC_ID_H263: +diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp +index 311dd6689236d660919c4c4483c51dca2752514a..536332c43e22ccb229e72b88518e54dd8a23ac41 100644 +--- a/xbmc/cores/omxplayer/OMXVideo.cpp ++++ b/xbmc/cores/omxplayer/OMXVideo.cpp +@@ -398,6 +398,7 @@ bool COMXVideo::Open(CDVDStreamInfo &hints, OMXClock *clock, bool hdmi_clock_syn + switch (hints.codec) + { + case AV_CODEC_ID_H264: ++ case AV_CODEC_ID_H264_MVC: + { + switch(hints.profile) + { +@@ -434,10 +435,13 @@ bool COMXVideo::Open(CDVDStreamInfo &hints, OMXClock *clock, bool hdmi_clock_syn + break; + } + } +- if (CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC)) ++ if ((hints.codec_tag == MKTAG('M', 'V', 'C', '1') || hints.codec_tag == MKTAG('A', 'M', 'V', 'C')) && ++ CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC)) + { + m_codingType = OMX_VIDEO_CodingMVC; + m_video_codec_name = "omx-mvc"; ++ if (hints.stereo_mode == "mono") ++ hints.stereo_mode = "mvc_lr"; + } + break; + case AV_CODEC_ID_MPEG4: + +From 16bdfb5fba5132fc097c56c116a4628cf8ba05aa Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Thu, 24 Mar 2016 13:02:58 +0000 +Subject: [PATCH 51/63] ffmpeg: mvc: fix for pixelation from packets with no + pts/dts + +--- + .../73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105.patch | 24 ++++++++++++++++++++++ + tools/depends/target/ffmpeg/Makefile | 4 +++- + 2 files changed, 27 insertions(+), 1 deletion(-) + create mode 100644 tools/depends/target/ffmpeg/73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105.patch + +diff --git a/tools/depends/target/ffmpeg/73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105.patch b/tools/depends/target/ffmpeg/73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105.patch +new file mode 100644 +index 0000000000000000000000000000000000000000..5240cf58ce40c28d12354db63b7e29143ba46978 +--- /dev/null ++++ b/tools/depends/target/ffmpeg/73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105.patch +@@ -0,0 +1,24 @@ ++From 73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105 Mon Sep 17 00:00:00 2001 ++From: Hendrik Leppkes ++Date: Mon, 1 Sep 2014 11:39:09 +0200 ++Subject: [PATCH] h264_parser: force grabing a new timestamp until a frame ++ start was found ++ ++--- ++ libavcodec/h264_parser.c | 3 +++ ++ 1 file changed, 3 insertions(+) ++ ++diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c ++index 2fd3f2b..7165652 100644 ++--- a/libavcodec/h264_parser.c +++++ b/libavcodec/h264_parser.c ++@@ -525,6 +525,9 @@ static int h264_parse(AVCodecParserContext *s, ++ } else { ++ next = h264_find_frame_end(p, buf, buf_size); ++ +++ if (next == END_NOT_FOUND && pc->frame_start_found == 0) +++ s->fetch_timestamp = 1; +++ ++ if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) { ++ *poutbuf = NULL; ++ *poutbuf_size = 0; +diff --git a/tools/depends/target/ffmpeg/Makefile b/tools/depends/target/ffmpeg/Makefile +index 7e97e4d91a443d46d933df528763422ff5e8f4fa..d4f279fd4f2ceb260698cd6fedb124bae61018d0 100644 +--- a/tools/depends/target/ffmpeg/Makefile ++++ b/tools/depends/target/ffmpeg/Makefile +@@ -6,7 +6,8 @@ DEPS= ../../Makefile.include FFMPEG-VERSION Makefile \ + pfcd_hevc_optimisations.patch \ + 0001-Squashed-commit-of-the-following.patch \ + 0001-avcodec-add-h264_mvc-codec-id-and-profiles.patch 0001-h264_parser-add-support-for-parsing-h264-mvc-NALUs.patch \ +- h264_parser_fix_parsing_of_mvc_slices_in_some_corner_cases.patch ++ h264_parser_fix_parsing_of_mvc_slices_in_some_corner_cases.patch \ ++ 73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105.patch + + # set to "yes" to enable patching + # we don't apply patches until we move to a vanilla ffmpeg tarball +@@ -95,6 +96,7 @@ $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) + cd $(PLATFORM); patch -p1 < ../0001-avcodec-add-h264_mvc-codec-id-and-profiles.patch + cd $(PLATFORM); patch -p1 < ../0001-h264_parser-add-support-for-parsing-h264-mvc-NALUs.patch + cd $(PLATFORM); patch -p1 < ../h264_parser_fix_parsing_of_mvc_slices_in_some_corner_cases.patch ++ cd $(PLATFORM); patch -p1 < ../73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105.patch + + cd $(PLATFORM);\ + CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \ + +From 47c649a1866f8897059db26a63e43e3666223b95 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 11 Nov 2016 15:53:53 +0000 +Subject: [PATCH 52/63] stereoscopicmanager: fixups for rbp --- xbmc/cores/VideoPlayer/DVDCodecs/DVDCodecUtils.cpp | 61 ++++++++++++++++++++++ xbmc/cores/VideoPlayer/DVDCodecs/DVDCodecUtils.h | 4 ++ - 2 files changed, 65 insertions(+) + .../VideoPlayer/DVDCodecs/Video/MMALCodec.cpp | 9 +++- + xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h | 1 + + xbmc/cores/VideoPlayer/DVDDemuxers/Makefile.in | 2 +- + xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 5 ++ + xbmc/cores/omxplayer/OMXPlayerVideo.h | 1 + + xbmc/cores/omxplayer/OMXVideo.cpp | 2 +- + xbmc/guilib/StereoscopicsManager.cpp | 3 ++ + 9 files changed, 84 insertions(+), 4 deletions(-) diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/DVDCodecUtils.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/DVDCodecUtils.cpp index ac4e063460a39888a1a1113aab37b74cbf0a0766..0d88acfb85333e88b3774144499eb4421abc4566 100644 @@ -51286,225 +51667,90 @@ index 361c96623660305fc393273b1eaea4db096c417d..8ec50bbf79e9e163ccae25e30f3a40bf static ERenderFormat EFormatFromPixfmt(int fmt); static AVPixelFormat PixfmtFromEFormat(ERenderFormat format); }; - -From 8ac9fae10b66960c1405aa06fede7ea2f2d4ab50 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sun, 6 Mar 2016 12:54:59 +0000 -Subject: [PATCH 46/73] mvc: Automatically enable stereo mode - ---- - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp | 6 +++++- - xbmc/cores/omxplayer/OMXVideo.cpp | 6 +++++- - 2 files changed, 10 insertions(+), 2 deletions(-) - diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -index cead68bd79d388f0eda0f8a79f17d296478d3361..38e7d44b7968039120b9821fd5b6b2d552edf3c1 100644 +index 368a26d9d7f1f3ca8b1666cb188446b120b934c2..2257c94a6b095d9b0926c418c1faaf2ebfadf088 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -@@ -405,13 +405,17 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) - switch (hints.codec) - { - case AV_CODEC_ID_H264: -+ case AV_CODEC_ID_H264_MVC: - // H.264 +@@ -362,6 +362,11 @@ bool CMMALVideo::SendCodecConfigData() + return true; + } + ++bool CMMALVideo::SupportsExtention() ++{ ++ return CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC); ++} ++ + bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) + { + CSingleLock lock(m_sharedSection); +@@ -408,12 +413,12 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) m_codingType = MMAL_ENCODING_H264; m_pFormatName = "mmal-h264"; -- if (CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC)) -+ if ((hints.codec_tag == MKTAG('M', 'V', 'C', '1') || hints.codec_tag == MKTAG('A', 'M', 'V', 'C')) && -+ CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC)) + if ((hints.codec_tag == MKTAG('M', 'V', 'C', '1') || hints.codec_tag == MKTAG('A', 'M', 'V', 'C')) && +- CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC)) ++ SupportsExtention()) { m_codingType = MMAL_ENCODING_MVC; m_pFormatName= "mmal-mvc"; -+ if (hints.stereo_mode == "mono") -+ hints.stereo_mode = "mvc_lr"; - } - break; - case AV_CODEC_ID_H263: -diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp -index 311dd6689236d660919c4c4483c51dca2752514a..536332c43e22ccb229e72b88518e54dd8a23ac41 100644 ---- a/xbmc/cores/omxplayer/OMXVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXVideo.cpp -@@ -398,6 +398,7 @@ bool COMXVideo::Open(CDVDStreamInfo &hints, OMXClock *clock, bool hdmi_clock_syn - switch (hints.codec) - { - case AV_CODEC_ID_H264: -+ case AV_CODEC_ID_H264_MVC: - { - switch(hints.profile) - { -@@ -434,10 +435,13 @@ bool COMXVideo::Open(CDVDStreamInfo &hints, OMXClock *clock, bool hdmi_clock_syn - break; - } - } -- if (CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC)) -+ if ((hints.codec_tag == MKTAG('M', 'V', 'C', '1') || hints.codec_tag == MKTAG('A', 'M', 'V', 'C')) && -+ CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC)) - { - m_codingType = OMX_VIDEO_CodingMVC; - m_video_codec_name = "omx-mvc"; -+ if (hints.stereo_mode == "mono") -+ hints.stereo_mode = "mvc_lr"; - } - break; - case AV_CODEC_ID_MPEG4: - -From 2764d1e7a679c4b570af7e8cb704cffc02590dcd Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 24 Mar 2016 13:02:58 +0000 -Subject: [PATCH 47/73] ffmpeg: mvc: fix for pixelation from packets with no - pts/dts - ---- - .../73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105.patch | 24 ++++++++++++++++++++++ - tools/depends/target/ffmpeg/Makefile | 4 +++- - 2 files changed, 27 insertions(+), 1 deletion(-) - create mode 100644 tools/depends/target/ffmpeg/73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105.patch - -diff --git a/tools/depends/target/ffmpeg/73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105.patch b/tools/depends/target/ffmpeg/73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105.patch -new file mode 100644 -index 0000000000000000000000000000000000000000..5240cf58ce40c28d12354db63b7e29143ba46978 ---- /dev/null -+++ b/tools/depends/target/ffmpeg/73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105.patch -@@ -0,0 +1,24 @@ -+From 73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105 Mon Sep 17 00:00:00 2001 -+From: Hendrik Leppkes -+Date: Mon, 1 Sep 2014 11:39:09 +0200 -+Subject: [PATCH] h264_parser: force grabing a new timestamp until a frame -+ start was found -+ -+--- -+ libavcodec/h264_parser.c | 3 +++ -+ 1 file changed, 3 insertions(+) -+ -+diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c -+index 2fd3f2b..7165652 100644 -+--- a/libavcodec/h264_parser.c -++++ b/libavcodec/h264_parser.c -+@@ -525,6 +525,9 @@ static int h264_parse(AVCodecParserContext *s, -+ } else { -+ next = h264_find_frame_end(p, buf, buf_size); -+ -++ if (next == END_NOT_FOUND && pc->frame_start_found == 0) -++ s->fetch_timestamp = 1; -++ -+ if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) { -+ *poutbuf = NULL; -+ *poutbuf_size = 0; -diff --git a/tools/depends/target/ffmpeg/Makefile b/tools/depends/target/ffmpeg/Makefile -index 7e97e4d91a443d46d933df528763422ff5e8f4fa..d4f279fd4f2ceb260698cd6fedb124bae61018d0 100644 ---- a/tools/depends/target/ffmpeg/Makefile -+++ b/tools/depends/target/ffmpeg/Makefile -@@ -6,7 +6,8 @@ DEPS= ../../Makefile.include FFMPEG-VERSION Makefile \ - pfcd_hevc_optimisations.patch \ - 0001-Squashed-commit-of-the-following.patch \ - 0001-avcodec-add-h264_mvc-codec-id-and-profiles.patch 0001-h264_parser-add-support-for-parsing-h264-mvc-NALUs.patch \ -- h264_parser_fix_parsing_of_mvc_slices_in_some_corner_cases.patch -+ h264_parser_fix_parsing_of_mvc_slices_in_some_corner_cases.patch \ -+ 73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105.patch - - # set to "yes" to enable patching - # we don't apply patches until we move to a vanilla ffmpeg tarball -@@ -95,6 +96,7 @@ $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) - cd $(PLATFORM); patch -p1 < ../0001-avcodec-add-h264_mvc-codec-id-and-profiles.patch - cd $(PLATFORM); patch -p1 < ../0001-h264_parser-add-support-for-parsing-h264-mvc-NALUs.patch - cd $(PLATFORM); patch -p1 < ../h264_parser_fix_parsing_of_mvc_slices_in_some_corner_cases.patch -+ cd $(PLATFORM); patch -p1 < ../73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105.patch - - cd $(PLATFORM);\ - CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \ - -From c966666795999cb4bd4f8e43107d78e42cde580f Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 9 Mar 2016 13:08:44 +0000 -Subject: [PATCH 48/73] stereoscopicmanager: remove hardwarebased for rbp - ---- - xbmc/guilib/StereoscopicsManager.cpp | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/xbmc/guilib/StereoscopicsManager.cpp b/xbmc/guilib/StereoscopicsManager.cpp -index 6eb0752994bc5f8c47efbbf211120af0a0720d0c..9426604f6460651f54cc035476e69530b2ea8493 100644 ---- a/xbmc/guilib/StereoscopicsManager.cpp -+++ b/xbmc/guilib/StereoscopicsManager.cpp -@@ -72,8 +72,10 @@ static const struct StereoModeMap VideoModeToGuiModeMap[] = - { "anaglyph_yellow_blue", RENDER_STEREO_MODE_ANAGLYPH_YELLOW_BLUE }, - { "block_lr", RENDER_STEREO_MODE_OFF }, // unsupported - { "block_rl", RENDER_STEREO_MODE_OFF }, // unsupported -+#ifndef TARGET_RASPBERRY_PI - { "mvc_lr", RENDER_STEREO_MODE_HARDWAREBASED }, - { "mvc_rl", RENDER_STEREO_MODE_HARDWAREBASED }, -+#endif - { "mvc_lr", RENDER_STEREO_MODE_SPLIT_HORIZONTAL }, // fallback - { "mvc_rl", RENDER_STEREO_MODE_SPLIT_HORIZONTAL }, // fallback - {} - -From c2b6b76b5b397bdae56fe26490aa55267d6d2465 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Tue, 17 May 2016 19:24:08 +0100 -Subject: [PATCH 49/73] stereoscopics: Switch to using block_lr for mvc to - match makemkv - -See: http://forum.kodi.tv/showthread.php?tid=221407&pid=2339656#pid2339656 ---- - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp | 2 +- - xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 2 +- - xbmc/cores/VideoPlayer/VideoRenderers/RenderFlags.cpp | 8 ++------ - xbmc/cores/omxplayer/OMXVideo.cpp | 2 +- - xbmc/guilib/StereoscopicsManager.cpp | 11 +++++------ - 5 files changed, 10 insertions(+), 15 deletions(-) - -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -index 38e7d44b7968039120b9821fd5b6b2d552edf3c1..654a927a0d4cbf877a3bb2616d62f46a63e7cadb 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -@@ -415,7 +415,7 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) - m_codingType = MMAL_ENCODING_MVC; - m_pFormatName= "mmal-mvc"; if (hints.stereo_mode == "mono") - hints.stereo_mode = "mvc_lr"; + hints.stereo_mode = "block_lr"; } break; case AV_CODEC_ID_H263: -diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -index 9498f676602e85d020968a7ecf12a31a750ef0ba..6ac2da1262bd7f6a8304ef3192d67d1ea8d910c5 100644 ---- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -@@ -1470,7 +1470,7 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) - CDVDInputStreamBluray *bluRay = static_cast(m_pInput); - if (bluRay->HasMVC()) - { -- st->stereo_mode = bluRay->AreEyesFlipped() ? "mvc_rl" : "mvc_lr"; -+ st->stereo_mode = bluRay->AreEyesFlipped() ? "block_rl" : "block_lr"; - mvcStream = static_cast(bluRay->GetDemuxMVC())->GetAVStream(); - } - } -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/RenderFlags.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/RenderFlags.cpp -index 0b7b6178427302e0824734eb5c7aecd2a3b21a8c..49f7f7ca7e144a259f6d06bd11cd97aa0b3242aa 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/RenderFlags.cpp -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/RenderFlags.cpp -@@ -102,10 +102,8 @@ namespace RenderManager { - convert["right_left"] = CONF_FLAGS_STEREO_MODE_SBS | CONF_FLAGS_STEREO_CADANCE_RIGHT_LEFT; - convert["anaglyph_green_magenta"] = 0u; - convert["anaglyph_yellow_blue"] = 0u; -- convert["block_lr"] = 0u; -- convert["block_rl"] = 0u; -- convert["mvc_lr"] = 0u; -- convert["mvc_rl"] = 0u; -+ convert["block_lr"] = CONF_FLAGS_STEREO_CADANCE_LEFT_RIGHT; -+ convert["block_rl"] = CONF_FLAGS_STEREO_CADANCE_RIGHT_LEFT; - } - return convert[mode]; - } -@@ -127,8 +125,6 @@ namespace RenderManager { - convert["col_interleaved_lr"] = "col_interleaved_rl"; - convert["block_lr"] = "block_rl"; - convert["block_rl"] = "block_lr"; -- convert["mvc_lr"] = "mvc_rl"; -- convert["mvc_rl"] = "mvc_lr"; - } - std::string res = convert[mode]; - if(res.empty()) +diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h +index baff1f031149da5d669536711cc0057b2db078e3..1e49f09574c2a93b938d5eb405ebcb06543dec01 100644 +--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h ++++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h +@@ -104,6 +104,7 @@ public: + virtual bool GetCodecStats(double &pts, int &droppedPics); + virtual void SetCodecControl(int flags); + virtual void SetSpeed(int iSpeed); ++ virtual bool SupportsExtention(); + + // MMAL decoder callback routines. + void dec_output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer); +diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/Makefile.in b/xbmc/cores/VideoPlayer/DVDDemuxers/Makefile.in +index 0359426b85683a4c3a80ef0e0d52f7a79564daaa..7d19ec3c56fdea514628d27cf36e641707be030f 100644 +--- a/xbmc/cores/VideoPlayer/DVDDemuxers/Makefile.in ++++ b/xbmc/cores/VideoPlayer/DVDDemuxers/Makefile.in +@@ -11,7 +11,7 @@ SRCS += DVDDemuxVobsub.cpp + SRCS += DVDDemuxCC.cpp + SRCS += DVDFactoryDemuxer.cpp + SRCS += DemuxStreamSSIF.cpp +-SRCS += DVDDemuxMVC.cpp ++SRCS += DemuxMVC.cpp + + LIB = DVDDemuxers.a + +diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +index f6fb241dfec9269f4e501248de4dc83d5fdc2d3a..58ad6672e3351edbec537ad5b142ff14cb7389ea 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +@@ -111,6 +111,11 @@ OMXPlayerVideo::~OMXPlayerVideo() + CloseStream(false); + } + ++bool OMXPlayerVideo::SupportsExtention() const ++{ ++ return CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC); ++} ++ + bool OMXPlayerVideo::OpenStream(CDVDStreamInfo &hints) + { + m_hints = hints; +diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.h b/xbmc/cores/omxplayer/OMXPlayerVideo.h +index b5050081c360d29b1b478c27e6b88291e20ecdac..c880fa6bbb128b99f8a5393056586821143d99ff 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerVideo.h ++++ b/xbmc/cores/omxplayer/OMXPlayerVideo.h +@@ -96,6 +96,7 @@ public: + void WaitForBuffers() { m_messageQueue.WaitUntilEmpty(); } + int GetLevel() const { return m_messageQueue.GetLevel(); } + bool IsStalled() const { return m_stalled; } ++ bool SupportsExtention() const; + bool IsEOS(); + void CloseStream(bool bWaitForBuffers); + void Output(double pts, bool bDropPacket); diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp index 536332c43e22ccb229e72b88518e54dd8a23ac41..39bc0530cecd54ae8c3a5481c92f1a6a18a4d9c5 100644 --- a/xbmc/cores/omxplayer/OMXVideo.cpp @@ -51519,69 +51765,38 @@ index 536332c43e22ccb229e72b88518e54dd8a23ac41..39bc0530cecd54ae8c3a5481c92f1a6a break; case AV_CODEC_ID_MPEG4: diff --git a/xbmc/guilib/StereoscopicsManager.cpp b/xbmc/guilib/StereoscopicsManager.cpp -index 9426604f6460651f54cc035476e69530b2ea8493..cc929b599125a44ac128713fd4331782d9931791 100644 +index 6aaa82f4d883b8cae0ccdedf6c5a6814e7aaa720..cc929b599125a44ac128713fd4331782d9931791 100644 --- a/xbmc/guilib/StereoscopicsManager.cpp +++ b/xbmc/guilib/StereoscopicsManager.cpp -@@ -70,14 +70,13 @@ static const struct StereoModeMap VideoModeToGuiModeMap[] = +@@ -70,10 +70,13 @@ static const struct StereoModeMap VideoModeToGuiModeMap[] = { "anaglyph_cyan_red", RENDER_STEREO_MODE_ANAGLYPH_RED_CYAN }, { "anaglyph_green_magenta", RENDER_STEREO_MODE_ANAGLYPH_GREEN_MAGENTA }, { "anaglyph_yellow_blue", RENDER_STEREO_MODE_ANAGLYPH_YELLOW_BLUE }, -- { "block_lr", RENDER_STEREO_MODE_OFF }, // unsupported -- { "block_rl", RENDER_STEREO_MODE_OFF }, // unsupported - #ifndef TARGET_RASPBERRY_PI -- { "mvc_lr", RENDER_STEREO_MODE_HARDWAREBASED }, -- { "mvc_rl", RENDER_STEREO_MODE_HARDWAREBASED }, -+ { "block_lr", RENDER_STEREO_MODE_HARDWAREBASED }, -+ { "block_rl", RENDER_STEREO_MODE_HARDWAREBASED }, ++#ifndef TARGET_RASPBERRY_PI + { "block_lr", RENDER_STEREO_MODE_HARDWAREBASED }, + { "block_rl", RENDER_STEREO_MODE_HARDWAREBASED }, +#else -+ { "block_lr", RENDER_STEREO_MODE_SPLIT_HORIZONTAL }, // fallback -+ { "block_rl", RENDER_STEREO_MODE_SPLIT_HORIZONTAL }, // fallback - #endif -- { "mvc_lr", RENDER_STEREO_MODE_SPLIT_HORIZONTAL }, // fallback -- { "mvc_rl", RENDER_STEREO_MODE_SPLIT_HORIZONTAL }, // fallback + { "block_lr", RENDER_STEREO_MODE_SPLIT_HORIZONTAL }, // fallback + { "block_rl", RENDER_STEREO_MODE_SPLIT_HORIZONTAL }, // fallback ++#endif {} }; -From f1301d05093a677529ccc63fabbb161ea09a9d83 Mon Sep 17 00:00:00 2001 +From 89abe07219f314eb147833325a41323ca13932bc Mon Sep 17 00:00:00 2001 From: Anton Fedchin Date: Thu, 10 Mar 2016 18:11:33 +0300 -Subject: [PATCH 50/73] fixup! Revert supporting crappy tab/sbs subtitles. this +Subject: [PATCH 53/63] fixup! Revert supporting crappy tab/sbs subtitles. this fixes regular subtitles. --- - .../VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp | 9 +++++---- - 1 file changed, 5 insertions(+), 4 deletions(-) + xbmc/cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp | 1 + + 1 file changed, 1 insertion(+) diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp -index 3a080d06c90b0762482816928642e6de7810b539..7c0b70777556ac7694e7fc511cd4bb189fc42e08 100644 +index a8323f419e404037c4e5fb4d78fa1b45409337a7..7c0b70777556ac7694e7fc511cd4bb189fc42e08 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp -@@ -243,20 +243,20 @@ CDVDOverlay* CDVDOverlayCodecFFmpeg::GetOverlay() - } - } - -- RENDER_STEREO_MODE render_stereo_mode = g_graphicsContext.GetStereoMode(); -+ /*RENDER_STEREO_MODE render_stereo_mode = g_graphicsContext.GetStereoMode(); - if (render_stereo_mode != RENDER_STEREO_MODE_OFF) - { -- if (rect.h > m_height / 2) -+ if ((rect.h - rect.y) > m_height / 2) - { - m_height /= 2; - rect.h /= 2; - } -- else if (rect.w > m_width / 2) -+ else if ((rect.w - rect.x) > m_width / 2) - { - m_width /= 2; - rect.w /= 2; - } -- } -+ }*/ - - CDVDOverlayImage* overlay = new CDVDOverlayImage(); - @@ -290,6 +290,7 @@ CDVDOverlay* CDVDOverlayCodecFFmpeg::GetOverlay() m_SubtitleIndex++; @@ -51591,1045 +51806,57 @@ index 3a080d06c90b0762482816928642e6de7810b539..7c0b70777556ac7694e7fc511cd4bb18 } -From 7552084189bbac0c9b2a443fa071b1ebe85b1cf3 Mon Sep 17 00:00:00 2001 +From 6c4da5b733b9fd7092ad84c0213f99c9f917b1b5 Mon Sep 17 00:00:00 2001 From: popcornmix -Date: Tue, 10 Feb 2015 15:29:16 +0000 -Subject: [PATCH 51/73] [libcec] Add repeating keypress patch from popcornmix' - repo +Date: Sat, 26 Nov 2016 18:24:18 +0000 +Subject: [PATCH 54/63] DemuxMVC: fixup after SeekTime API change --- - tools/depends/target/libcec/Makefile | 1 + - tools/depends/target/libcec/popcornmix.patch | 859 +++++++++++++++++++++++++++ - 2 files changed, 860 insertions(+) - create mode 100644 tools/depends/target/libcec/popcornmix.patch + xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.cpp | 2 +- + xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) -diff --git a/tools/depends/target/libcec/Makefile b/tools/depends/target/libcec/Makefile -index f54af9e7ed3d0a9bef922517728c8b8db51d9d75..ddf996361ad5b46dd2b33fb035b2ed133914a612 100644 ---- a/tools/depends/target/libcec/Makefile -+++ b/tools/depends/target/libcec/Makefile -@@ -21,6 +21,7 @@ $(TARBALLS_LOCATION)/$(ARCHIVE): - $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) - rm -rf $(PLATFORM); mkdir -p $(PLATFORM)/build - cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) -+ cd $(PLATFORM); patch -p1 < ../popcornmix.patch - cd $(PLATFORM)/build; $(CMAKE) -DBUILD_SHARED_LIBS=1 -DSKIP_PYTHON_WRAPPER:STRING=1 -DCMAKE_INSTALL_LIBDIR=$(PREFIX)/lib .. +diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.cpp +index ade6a4454fc3915b0c787b1a4f72aedbd74903db..baefe44ca932ee98e482f1bed70d8949be71cfac 100644 +--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.cpp ++++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.cpp +@@ -188,7 +188,7 @@ DemuxPacket* CDemuxMVC::Read() + return nullptr; + } - $(LIBDYLIB): $(PLATFORM) -diff --git a/tools/depends/target/libcec/popcornmix.patch b/tools/depends/target/libcec/popcornmix.patch -new file mode 100644 -index 0000000000000000000000000000000000000000..8366a696562a934144cc9a21ea6f2cab3c69e655 ---- /dev/null -+++ b/tools/depends/target/libcec/popcornmix.patch -@@ -0,0 +1,859 @@ -+From ec982e9800ae312972d306b67779215a2add6cde Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Fri, 24 Oct 2014 13:45:21 +0100 -+Subject: [PATCH 1/6] Make released key polling wait for exact time until key -+ gets released -+ -+--- -+ src/libcec/CECClient.cpp | 16 ++++++++++++++-- -+ src/libcec/CECClient.h | 2 +- -+ src/libcec/CECProcessor.cpp | 8 +++++--- -+ src/libcec/LibCEC.cpp | 10 ++++++++-- -+ src/libcec/LibCEC.h | 4 +++- -+ 5 files changed, 31 insertions(+), 9 deletions(-) -+ -+diff --git a/src/libcec/CECClient.cpp b/src/libcec/CECClient.cpp -+index 35c2d3e..e307c0e 100644 -+--- a/src/libcec/CECClient.cpp -++++ b/src/libcec/CECClient.cpp -+@@ -1067,7 +1067,7 @@ void CCECClient::SetCurrentButton(const cec_user_control_code iButtonCode) -+ AddKey(key); -+ } -+ -+-void CCECClient::CheckKeypressTimeout(void) -++uint16_t CCECClient::CheckKeypressTimeout(void) -+ { -+ cec_keypress key; -+ -+@@ -1091,12 +1091,24 @@ void CCECClient::CheckKeypressTimeout(void) -+ } -+ else -+ { -+- return; -++ // time when this keypress will be released and we'd like to be called again -++ unsigned int timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -++ if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && m_iCurrentButton == comboKey && iTimeoutMs > 0) -++ timeout = iTimeoutMs - (iNow - m_buttontime) + 1; -++ else if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && m_iCurrentButton != comboKey) -++ timeout = CEC_BUTTON_TIMEOUT - (iNow - m_buttontime) + 1; -++ if (timeout > CEC_PROCESSOR_SIGNAL_WAIT_TIME) -++ { -++ LIB_CEC->AddLog(CEC_LOG_ERROR, "Unexpected timeout: %d (%.3f %.3f %.3f) k:%02x", timeout, iNow*1e-3, m_buttontime*1e-3, CEC_BUTTON_TIMEOUT*1e-3, m_iCurrentButton); -++ timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -++ } -++ return timeout; -+ } -+ } -+ -+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "key auto-released: %s (%1x)", ToString(key.keycode), key.keycode); -+ QueueAddKey(key); -++ return CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ } -+ -+ bool CCECClient::EnableCallbacks(void *cbParam, ICECCallbacks *callbacks) -+diff --git a/src/libcec/CECClient.h b/src/libcec/CECClient.h -+index 12f8a3b..c9ce5e3 100644 -+--- a/src/libcec/CECClient.h -++++ b/src/libcec/CECClient.h -+@@ -272,7 +272,7 @@ namespace CEC -+ virtual void AddKey(bool bSendComboKey = false); -+ virtual void AddKey(const cec_keypress &key); -+ virtual void SetCurrentButton(const cec_user_control_code iButtonCode); -+- virtual void CheckKeypressTimeout(void); -++ virtual uint16_t CheckKeypressTimeout(void); -+ virtual void SourceActivated(const cec_logical_address logicalAddress); -+ virtual void SourceDeactivated(const cec_logical_address logicalAddress); -+ -+diff --git a/src/libcec/CECProcessor.cpp b/src/libcec/CECProcessor.cpp -+index 99f71aa..604b950 100644 -+--- a/src/libcec/CECProcessor.cpp -++++ b/src/libcec/CECProcessor.cpp -+@@ -52,7 +52,6 @@ -+ using namespace CEC; -+ using namespace PLATFORM; -+ -+-#define CEC_PROCESSOR_SIGNAL_WAIT_TIME 1000 -+ #define ACTIVE_SOURCE_CHECK_INTERVAL 500 -+ #define TV_PRESENT_CHECK_INTERVAL 30000 -+ -+@@ -260,6 +259,7 @@ bool CCECProcessor::OnCommandReceived(const cec_command &command) -+ -+ void *CCECProcessor::Process(void) -+ { -++ uint16_t timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ m_libcec->AddLog(CEC_LOG_DEBUG, "processor thread started"); -+ -+ if (!m_connCheck) -+@@ -274,13 +274,13 @@ void *CCECProcessor::Process(void) -+ while (!IsStopped() && m_communication->IsOpen()) -+ { -+ // wait for a new incoming command, and process it -+- if (m_inBuffer.Pop(command, CEC_PROCESSOR_SIGNAL_WAIT_TIME)) -++ if (m_inBuffer.Pop(command, timeout)) -+ ProcessCommand(command); -+ -+ if (CECInitialised() && !IsStopped()) -+ { -+ // check clients for keypress timeouts -+- m_libcec->CheckKeypressTimeout(); -++ timeout = m_libcec->CheckKeypressTimeout(); -+ -+ // check if we need to replace handlers -+ ReplaceHandlers(); -+@@ -311,6 +311,8 @@ void *CCECProcessor::Process(void) -+ tvPresentCheck.Init(TV_PRESENT_CHECK_INTERVAL); -+ } -+ } -++ else -++ timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ } -+ -+ return NULL; -+diff --git a/src/libcec/LibCEC.cpp b/src/libcec/LibCEC.cpp -+index af36b79..5ccb8dd 100644 -+--- a/src/libcec/LibCEC.cpp -++++ b/src/libcec/LibCEC.cpp -+@@ -361,11 +361,17 @@ bool CLibCEC::IsValidPhysicalAddress(uint16_t iPhysicalAddress) -+ iPhysicalAddress <= CEC_MAX_PHYSICAL_ADDRESS; -+ } -+ -+-void CLibCEC::CheckKeypressTimeout(void) -++uint16_t CLibCEC::CheckKeypressTimeout(void) -+ { -++ uint16_t timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ // check all clients -+ for (std::vector::iterator it = m_clients.begin(); it != m_clients.end(); it++) -+- (*it)->CheckKeypressTimeout(); -++ { -++ uint16_t t = (*it)->CheckKeypressTimeout(); -++ if (t < timeout) -++ timeout = t; -++ } -++ return timeout; -+ } -+ -+ void CLibCEC::AddLog(const cec_log_level level, const char *strFormat, ...) -+diff --git a/src/libcec/LibCEC.h b/src/libcec/LibCEC.h -+index 6d9a229..d9d1e7b 100644 -+--- a/src/libcec/LibCEC.h -++++ b/src/libcec/LibCEC.h -+@@ -39,6 +39,8 @@ -+ #include "CECTypeUtils.h" -+ #include -+ -++#define CEC_PROCESSOR_SIGNAL_WAIT_TIME 1000 -++ -+ namespace CEC -+ { -+ class CAdapterCommunication; -+@@ -125,7 +127,7 @@ namespace CEC -+ -+ void AddLog(const cec_log_level level, const char *strFormat, ...); -+ void AddCommand(const cec_command &command); -+- void CheckKeypressTimeout(void); -++ uint16_t CheckKeypressTimeout(void); -+ void Alert(const libcec_alert type, const libcec_parameter ¶m); -+ -+ static bool IsValidPhysicalAddress(uint16_t iPhysicalAddress); -+-- -+1.9.1 -+ -+ -+From 41f0f3ec9ac136da3565c96fd5a7075499f3938d Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Fri, 24 Oct 2014 13:51:34 +0100 -+Subject: [PATCH 2/6] Keep track of time since initial button press and last -+ button update -+ -+--- -+ src/libcec/CECClient.cpp | 44 +++++++++++++++++++++++++++----------------- -+ src/libcec/CECClient.h | 3 ++- -+ 2 files changed, 29 insertions(+), 18 deletions(-) -+ -+diff --git a/src/libcec/CECClient.cpp b/src/libcec/CECClient.cpp -+index e307c0e..e7935b9 100644 -+--- a/src/libcec/CECClient.cpp -++++ b/src/libcec/CECClient.cpp -+@@ -54,7 +54,8 @@ CCECClient::CCECClient(CCECProcessor *processor, const libcec_configuration &con -+ m_bInitialised(false), -+ m_bRegistered(false), -+ m_iCurrentButton(CEC_USER_CONTROL_CODE_UNKNOWN), -+- m_buttontime(0), -++ m_initialButtontime(0), -++ m_updateButtontime(0), -+ m_iPreventForwardingPowerOffCommand(0), -+ m_iLastKeypressTime(0) -+ { -+@@ -981,9 +982,10 @@ void CCECClient::AddKey(bool bSendComboKey /* = false */) -+ CLockObject lock(m_mutex); -+ if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN) -+ { -+- key.duration = (unsigned int) (GetTimeMs() - m_buttontime); -++ unsigned int duration = (unsigned int) (GetTimeMs() - m_updateButtontime); -++ key.duration = (unsigned int) (GetTimeMs() - m_initialButtontime); -+ -+- if (key.duration > m_configuration.iComboKeyTimeoutMs || -++ if (duration > m_configuration.iComboKeyTimeoutMs || -+ m_configuration.iComboKeyTimeoutMs == 0 || -+ m_iCurrentButton != m_configuration.comboKey || -+ bSendComboKey) -+@@ -991,14 +993,15 @@ void CCECClient::AddKey(bool bSendComboKey /* = false */) -+ key.keycode = m_iCurrentButton; -+ -+ m_iCurrentButton = CEC_USER_CONTROL_CODE_UNKNOWN; -+- m_buttontime = 0; -++ m_initialButtontime = 0; -++ m_updateButtontime = 0; -+ } -+ } -+ } -+ -+ if (key.keycode != CEC_USER_CONTROL_CODE_UNKNOWN) -+ { -+- LIB_CEC->AddLog(CEC_LOG_DEBUG, "key released: %s (%1x)", ToString(key.keycode), key.keycode); -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "key released: %s (%1x) D:%dms", ToString(key.keycode), key.keycode, key.duration); -+ QueueAddKey(key); -+ } -+ } -+@@ -1012,7 +1015,7 @@ void CCECClient::AddKey(const cec_keypress &key) -+ AddKey(); -+ return; -+ } -+- -++ bool isrepeat = false; -+ cec_keypress transmitKey(key); -+ cec_user_control_code comboKey(m_configuration.clientVersion >= LIBCEC_VERSION_TO_UINT(2, 0, 5) ? -+ m_configuration.comboKey : CEC_USER_CONTROL_CODE_STOP); -+@@ -1035,22 +1038,27 @@ void CCECClient::AddKey(const cec_keypress &key) -+ AddKey(true); -+ } -+ -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "key pressed: %s (%1x) current(%lx) duration(%d)", ToString(transmitKey.keycode), transmitKey.keycode, m_iCurrentButton, key.duration); -++ -+ if (m_iCurrentButton == key.keycode) -+ { -+- m_buttontime = GetTimeMs(); -++ m_updateButtontime = GetTimeMs(); -++ isrepeat = true; -+ } -+ else -+ { -+- AddKey(); -++ if (m_iCurrentButton != transmitKey.keycode) -++ AddKey(); -+ if (key.duration == 0) -+ { -+ m_iCurrentButton = transmitKey.keycode; -+- m_buttontime = m_iCurrentButton == CEC_USER_CONTROL_CODE_UNKNOWN || key.duration > 0 ? 0 : GetTimeMs(); -++ m_initialButtontime = m_iCurrentButton == CEC_USER_CONTROL_CODE_UNKNOWN || key.duration > 0 ? 0 : GetTimeMs(); -++ m_updateButtontime = m_initialButtontime; -+ } -+ } -+ } -+ -+- if (key.keycode != comboKey || key.duration > 0) -++ if (!isrepeat && (key.keycode != comboKey || key.duration > 0)) -+ { -+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "key pressed: %s (%1x)", ToString(transmitKey.keycode), transmitKey.keycode); -+ QueueAddKey(transmitKey); -+@@ -1074,32 +1082,34 @@ uint16_t CCECClient::CheckKeypressTimeout(void) -+ { -+ CLockObject lock(m_mutex); -+ uint64_t iNow = GetTimeMs(); -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s T:%.3f", __FUNCTION__, iNow*1e-3); -+ cec_user_control_code comboKey(m_configuration.clientVersion >= LIBCEC_VERSION_TO_UINT(2, 0, 5) ? -+ m_configuration.comboKey : CEC_USER_CONTROL_CODE_STOP); -+ uint32_t iTimeoutMs(m_configuration.clientVersion >= LIBCEC_VERSION_TO_UINT(2, 0, 5) ? -+ m_configuration.iComboKeyTimeoutMs : CEC_DEFAULT_COMBO_TIMEOUT_MS); -+ -+ if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && -+- ((m_iCurrentButton == comboKey && iTimeoutMs > 0 && iNow - m_buttontime > iTimeoutMs) || -+- (m_iCurrentButton != comboKey && iNow - m_buttontime > CEC_BUTTON_TIMEOUT))) -++ ((m_iCurrentButton == comboKey && iTimeoutMs > 0 && iNow - m_updateButtontime > iTimeoutMs) || -++ (m_iCurrentButton != comboKey && iNow - m_updateButtontime > CEC_BUTTON_TIMEOUT))) -+ { -+- key.duration = (unsigned int) (iNow - m_buttontime); -++ key.duration = (unsigned int) (iNow - m_initialButtontime); -+ key.keycode = m_iCurrentButton; -+ -+ m_iCurrentButton = CEC_USER_CONTROL_CODE_UNKNOWN; -+- m_buttontime = 0; -++ m_initialButtontime = 0; -++ m_updateButtontime = 0; -+ } -+ else -+ { -+ // time when this keypress will be released and we'd like to be called again -+ unsigned int timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && m_iCurrentButton == comboKey && iTimeoutMs > 0) -+- timeout = iTimeoutMs - (iNow - m_buttontime) + 1; -++ timeout = iTimeoutMs - (iNow - m_updateButtontime) + 1; -+ else if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && m_iCurrentButton != comboKey) -+- timeout = CEC_BUTTON_TIMEOUT - (iNow - m_buttontime) + 1; -++ timeout = CEC_BUTTON_TIMEOUT - (iNow - m_updateButtontime) + 1; -+ if (timeout > CEC_PROCESSOR_SIGNAL_WAIT_TIME) -+ { -+- LIB_CEC->AddLog(CEC_LOG_ERROR, "Unexpected timeout: %d (%.3f %.3f %.3f) k:%02x", timeout, iNow*1e-3, m_buttontime*1e-3, CEC_BUTTON_TIMEOUT*1e-3, m_iCurrentButton); -++ LIB_CEC->AddLog(CEC_LOG_ERROR, "Unexpected timeout: %d (%.3f %.3f %.3f) k:%02x", timeout, iNow*1e-3, m_updateButtontime*1e-3, CEC_BUTTON_TIMEOUT*1e-3, m_iCurrentButton); -+ timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ } -+ return timeout; -+diff --git a/src/libcec/CECClient.h b/src/libcec/CECClient.h -+index c9ce5e3..611c68b 100644 -+--- a/src/libcec/CECClient.h -++++ b/src/libcec/CECClient.h -+@@ -404,7 +404,8 @@ namespace CEC -+ PLATFORM::CMutex m_mutex; /**< mutex for changes to this instance */ -+ PLATFORM::CMutex m_cbMutex; /**< mutex that is held when doing anything with callbacks */ -+ cec_user_control_code m_iCurrentButton; /**< the control code of the button that's currently held down (if any) */ -+- int64_t m_buttontime; /**< the timestamp when the button was pressed (in seconds since epoch), or 0 if none was pressed. */ -++ int64_t m_initialButtontime; /**< the timestamp when the button was initially pressed (in seconds since epoch), or 0 if none was pressed. */ -++ int64_t m_updateButtontime; /**< the timestamp when the button was updated (in seconds since epoch), or 0 if none was pressed. */ -+ int64_t m_iPreventForwardingPowerOffCommand; /**< prevent forwarding standby commands until this time */ -+ int64_t m_iLastKeypressTime; /**< last time a key press was sent to the client */ -+ cec_keypress m_lastKeypress; /**< the last key press that was sent to the client */ -+-- -+1.9.1 -+ -+ -+From 273ead6980b69eddf98810eb1eb33d94a7d74fce Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Tue, 28 Oct 2014 00:09:18 +0000 -+Subject: [PATCH 3/6] Support repeating button presses with configurable repeat -+ rate -+ -+--- -+ include/cectypes.h | 6 ++ -+ src/libcec/CECClient.cpp | 100 +++++++++++++++++++---- -+ src/libcec/CECClient.h | 6 +- -+ src/libcec/implementations/CECCommandHandler.cpp | 2 +- -+ 4 files changed, 96 insertions(+), 18 deletions(-) -+ -+diff --git a/include/cectypes.h b/include/cectypes.h -+index acff259..8f098ef 100644 -+--- a/include/cectypes.h -++++ b/include/cectypes.h -+@@ -1493,6 +1493,8 @@ struct libcec_configuration -+ XXX changed meaning in 2.2.0 to not break binary compatibility. next major (3.0) release will fix it in a nicer way */ -+ cec_user_control_code comboKey; /*!< key code that initiates combo keys. defaults to CEC_USER_CONTROL_CODE_F1_BLUE. CEC_USER_CONTROL_CODE_UNKNOWN to disable. added in 2.0.5 */ -+ uint32_t iComboKeyTimeoutMs; /*!< timeout until the combo key is sent as normal keypress */ -++ uint32_t iButtonRepeatRateMs; /*!< rate at which buttons autorepeat. 0 means rely on CEC device */ -++ uint32_t iButtonReleaseDelayMs;/*!< duration after last update until a button is considered released */ -+ -+ #ifdef __cplusplus -+ libcec_configuration(void) { Clear(); } -+@@ -1527,6 +1529,8 @@ struct libcec_configuration -+ cecVersion == other.cecVersion && -+ adapterType == other.adapterType && -+ iDoubleTapTimeout50Ms == other.iDoubleTapTimeout50Ms && -++ iButtonRepeatRateMs == other.iButtonRepeatRateMs && -++ iButtonReleaseDelayMs == other.iButtonReleaseDelayMs && -+ (other.clientVersion <= LIBCEC_VERSION_TO_UINT(2, 0, 4) || comboKey == other.comboKey) && -+ (other.clientVersion <= LIBCEC_VERSION_TO_UINT(2, 0, 4) || iComboKeyTimeoutMs == other.iComboKeyTimeoutMs) && -+ (other.clientVersion < LIBCEC_VERSION_TO_UINT(2, 1, 0) || bPowerOnScreensaver == other.bPowerOnScreensaver)); -+@@ -1567,6 +1571,8 @@ struct libcec_configuration -+ iDoubleTapTimeout50Ms = CEC_DOUBLE_TAP_TIMEOUT_50_MS; -+ comboKey = CEC_USER_CONTROL_CODE_STOP; -+ iComboKeyTimeoutMs = CEC_DEFAULT_COMBO_TIMEOUT_MS; -++ iButtonRepeatRateMs = 0; -++ iButtonReleaseDelayMs = CEC_BUTTON_TIMEOUT; -+ -+ memset(strDeviceName, 0, 13); -+ deviceTypes.Clear(); -+diff --git a/src/libcec/CECClient.cpp b/src/libcec/CECClient.cpp -+index e7935b9..598628d 100644 -+--- a/src/libcec/CECClient.cpp -++++ b/src/libcec/CECClient.cpp -+@@ -56,6 +56,10 @@ CCECClient::CCECClient(CCECProcessor *processor, const libcec_configuration &con -+ m_iCurrentButton(CEC_USER_CONTROL_CODE_UNKNOWN), -+ m_initialButtontime(0), -+ m_updateButtontime(0), -++ m_repeatButtontime(0), -++ m_releaseButtontime(0), -++ m_pressedButtoncount(0), -++ m_releasedButtoncount(0), -+ m_iPreventForwardingPowerOffCommand(0), -+ m_iLastKeypressTime(0) -+ { -+@@ -851,6 +855,9 @@ bool CCECClient::GetCurrentConfiguration(libcec_configuration &configuration) -+ configuration.bMonitorOnly = m_configuration.bMonitorOnly; -+ configuration.cecVersion = m_configuration.cecVersion; -+ configuration.adapterType = m_configuration.adapterType; -++ configuration.iDoubleTapTimeout50Ms = m_configuration.iDoubleTapTimeout50Ms; -++ configuration.iButtonRepeatRateMs = m_configuration.iButtonRepeatRateMs; -++ configuration.iButtonReleaseDelayMs = m_configuration.iButtonReleaseDelayMs; -+ -+ return true; -+ } -+@@ -894,6 +901,9 @@ bool CCECClient::SetConfiguration(const libcec_configuration &configuration) -+ m_configuration.cecVersion = configuration.cecVersion; -+ m_configuration.adapterType = configuration.adapterType; -+ m_configuration.iDoubleTapTimeout50Ms = configuration.iDoubleTapTimeout50Ms; -++ m_configuration.iButtonRepeatRateMs = configuration.iButtonRepeatRateMs; -++ m_configuration.iButtonReleaseDelayMs = configuration.iButtonReleaseDelayMs; -++ -+ m_configuration.deviceTypes.Add(configuration.deviceTypes[0]); -+ -+ if (m_configuration.clientVersion >= LIBCEC_VERSION_TO_UINT(2, 0, 5)) -+@@ -950,6 +960,7 @@ bool CCECClient::SetConfiguration(const libcec_configuration &configuration) -+ primary->ActivateSource(); -+ } -+ -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s: %d:%d:%d", __FUNCTION__, DoubleTapTimeoutMS(), m_configuration.iButtonRepeatRateMs, m_configuration.iButtonReleaseDelayMs); -+ return true; -+ } -+ -+@@ -973,11 +984,15 @@ void CCECClient::AddCommand(const cec_command &command) -+ } -+ } -+ -+-void CCECClient::AddKey(bool bSendComboKey /* = false */) -++void CCECClient::AddKey(bool bSendComboKey /* = false */, bool bButtonRelease /* = false */) -+ { -+ cec_keypress key; -+ key.keycode = CEC_USER_CONTROL_CODE_UNKNOWN; -+ -++ // we ignore button releases when supporting repeating keys -++ if (bButtonRelease && m_configuration.iButtonRepeatRateMs && m_configuration.iButtonReleaseDelayMs) -++ return; -++ -+ { -+ CLockObject lock(m_mutex); -+ if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN) -+@@ -995,6 +1010,10 @@ void CCECClient::AddKey(bool bSendComboKey /* = false */) -+ m_iCurrentButton = CEC_USER_CONTROL_CODE_UNKNOWN; -+ m_initialButtontime = 0; -+ m_updateButtontime = 0; -++ m_repeatButtontime = 0; -++ m_releaseButtontime = 0; -++ m_pressedButtoncount = 0; -++ m_releasedButtoncount = 0; -+ } -+ } -+ } -+@@ -1012,6 +1031,7 @@ void CCECClient::AddKey(const cec_keypress &key) -+ key.keycode < CEC_USER_CONTROL_CODE_SELECT) -+ { -+ // send back the previous key if there is one -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "Unexpected key %s (%1x) D:%dms", ToString(key.keycode), key.keycode, key.duration); -+ AddKey(); -+ return; -+ } -+@@ -1035,7 +1055,10 @@ void CCECClient::AddKey(const cec_keypress &key) -+ transmitKey.keycode = CEC_USER_CONTROL_CODE_DOT; -+ // default, send back the previous key -+ else -++ { -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "Combo key %s (%1x) D%dms:", ToString(key.keycode), key.keycode, key.duration); -+ AddKey(true); -++ } -+ } -+ -+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "key pressed: %s (%1x) current(%lx) duration(%d)", ToString(transmitKey.keycode), transmitKey.keycode, m_iCurrentButton, key.duration); -+@@ -1043,17 +1066,44 @@ void CCECClient::AddKey(const cec_keypress &key) -+ if (m_iCurrentButton == key.keycode) -+ { -+ m_updateButtontime = GetTimeMs(); -+- isrepeat = true; -++ m_releaseButtontime = m_updateButtontime + (m_configuration.iButtonReleaseDelayMs ? m_configuration.iButtonReleaseDelayMs : CEC_BUTTON_TIMEOUT); -++ // want to have seen some updated before considering a repeat -++ if (m_configuration.iButtonRepeatRateMs) -++ { -++ if (!m_repeatButtontime && m_pressedButtoncount > 1) -++ m_repeatButtontime = m_initialButtontime + DoubleTapTimeoutMS(); -++ isrepeat = true; -++ } -++ m_pressedButtoncount++; -+ } -+ else -+ { -+ if (m_iCurrentButton != transmitKey.keycode) -++ { -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "Changed key %s (%1x) D:%dms cur:%lx", ToString(transmitKey.keycode), transmitKey.keycode, transmitKey.duration, m_iCurrentButton); -+ AddKey(); -++ } -+ if (key.duration == 0) -+ { -+ m_iCurrentButton = transmitKey.keycode; -+- m_initialButtontime = m_iCurrentButton == CEC_USER_CONTROL_CODE_UNKNOWN || key.duration > 0 ? 0 : GetTimeMs(); -+- m_updateButtontime = m_initialButtontime; -++ if (m_iCurrentButton == CEC_USER_CONTROL_CODE_UNKNOWN) -++ { -++ m_initialButtontime = 0; -++ m_updateButtontime = 0; -++ m_repeatButtontime = 0; -++ m_releaseButtontime = 0; -++ m_pressedButtoncount = 0; -++ m_releasedButtoncount = 0; -++ } -++ else -++ { -++ m_initialButtontime = GetTimeMs(); -++ m_updateButtontime = m_initialButtontime; -++ m_repeatButtontime = 0; // set this on next update -++ m_releaseButtontime = m_initialButtontime + (m_configuration.iButtonReleaseDelayMs ? m_configuration.iButtonReleaseDelayMs : CEC_BUTTON_TIMEOUT); -++ m_pressedButtoncount = 1; -++ m_releasedButtoncount = 0; -++ } -+ } -+ } -+ } -+@@ -1072,12 +1122,16 @@ void CCECClient::SetCurrentButton(const cec_user_control_code iButtonCode) -+ key.duration = 0; -+ key.keycode = iButtonCode; -+ -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "SetCurrentButton %s (%1x) D:%dms cur:%lx", ToString(key.keycode), key.keycode, key.duration); -+ AddKey(key); -+ } -+ -+ uint16_t CCECClient::CheckKeypressTimeout(void) -+ { -++ // time when we'd like to be called again -++ unsigned int timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ cec_keypress key; -++ key.keycode = CEC_USER_CONTROL_CODE_UNKNOWN; -+ -+ { -+ CLockObject lock(m_mutex); -+@@ -1089,8 +1143,8 @@ uint16_t CCECClient::CheckKeypressTimeout(void) -+ m_configuration.iComboKeyTimeoutMs : CEC_DEFAULT_COMBO_TIMEOUT_MS); -+ -+ if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && -+- ((m_iCurrentButton == comboKey && iTimeoutMs > 0 && iNow - m_updateButtontime > iTimeoutMs) || -+- (m_iCurrentButton != comboKey && iNow - m_updateButtontime > CEC_BUTTON_TIMEOUT))) -++ ((m_iCurrentButton == comboKey && iTimeoutMs > 0 && iNow - m_updateButtontime >= iTimeoutMs) || -++ (m_iCurrentButton != comboKey && m_releaseButtontime && iNow >= (uint64_t)m_releaseButtontime))) -+ { -+ key.duration = (unsigned int) (iNow - m_initialButtontime); -+ key.keycode = m_iCurrentButton; -+@@ -1098,27 +1152,41 @@ uint16_t CCECClient::CheckKeypressTimeout(void) -+ m_iCurrentButton = CEC_USER_CONTROL_CODE_UNKNOWN; -+ m_initialButtontime = 0; -+ m_updateButtontime = 0; -++ m_repeatButtontime = 0; -++ m_releaseButtontime = 0; -++ m_pressedButtoncount = 0; -++ m_releasedButtoncount = 0; -++ } -++ else if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && -++ (m_iCurrentButton != comboKey && m_repeatButtontime && iNow >= (uint64_t)m_repeatButtontime)) -++ { -++ key.duration = 0; -++ key.keycode = m_iCurrentButton; -++ m_repeatButtontime = iNow + m_configuration.iButtonRepeatRateMs; -++ timeout = std::min((uint64_t)timeout, m_repeatButtontime - iNow); -+ } -+ else -+ { -+- // time when this keypress will be released and we'd like to be called again -+- unsigned int timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && m_iCurrentButton == comboKey && iTimeoutMs > 0) -+- timeout = iTimeoutMs - (iNow - m_updateButtontime) + 1; -+- else if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && m_iCurrentButton != comboKey) -+- timeout = CEC_BUTTON_TIMEOUT - (iNow - m_updateButtontime) + 1; -++ timeout = std::min((uint64_t)timeout, m_updateButtontime - iNow + iTimeoutMs); -++ if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && m_iCurrentButton != comboKey && m_releaseButtontime) -++ timeout = std::min((uint64_t)timeout, m_releaseButtontime - iNow); -++ if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && m_iCurrentButton != comboKey && m_repeatButtontime) -++ timeout = std::min((uint64_t)timeout, m_repeatButtontime - iNow); -+ if (timeout > CEC_PROCESSOR_SIGNAL_WAIT_TIME) -+ { -+- LIB_CEC->AddLog(CEC_LOG_ERROR, "Unexpected timeout: %d (%.3f %.3f %.3f) k:%02x", timeout, iNow*1e-3, m_updateButtontime*1e-3, CEC_BUTTON_TIMEOUT*1e-3, m_iCurrentButton); -++ LIB_CEC->AddLog(CEC_LOG_ERROR, "Unexpected timeout: %d (%.3f %.3f %.3f) k:%02x", timeout, iNow*1e-3, m_updateButtontime*1e-3, m_releaseButtontime*1e-3, m_iCurrentButton); -+ timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ } -+- return timeout; -+ } -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "key %s: %s (%1x) timeout:%dms (rel:%d,rep:%d,prs:%d,rel:%d)", key.keycode == CEC_USER_CONTROL_CODE_UNKNOWN ? "idle" : key.duration ? "released" : "repeated", -++ ToString(m_iCurrentButton), m_iCurrentButton, timeout, (int)(m_releaseButtontime ? m_releaseButtontime - iNow : 0), (int)(m_repeatButtontime ? m_repeatButtontime - iNow : 0), m_pressedButtoncount, m_releasedButtoncount); -+ } -+ -+- LIB_CEC->AddLog(CEC_LOG_DEBUG, "key auto-released: %s (%1x)", ToString(key.keycode), key.keycode); -+- QueueAddKey(key); -+- return CEC_PROCESSOR_SIGNAL_WAIT_TIME; -++ if (key.keycode != CEC_USER_CONTROL_CODE_UNKNOWN) -++ QueueAddKey(key); -++ -++ return timeout; -+ } -+ -+ bool CCECClient::EnableCallbacks(void *cbParam, ICECCallbacks *callbacks) -+diff --git a/src/libcec/CECClient.h b/src/libcec/CECClient.h -+index 611c68b..adeb5af 100644 -+--- a/src/libcec/CECClient.h -++++ b/src/libcec/CECClient.h -+@@ -269,7 +269,7 @@ namespace CEC -+ // callbacks -+ virtual void Alert(const libcec_alert type, const libcec_parameter ¶m) { QueueAlert(type, param); } -+ virtual void AddLog(const cec_log_message &message) { QueueAddLog(message); } -+- virtual void AddKey(bool bSendComboKey = false); -++ virtual void AddKey(bool bSendComboKey = false, bool bButtonRelease = false); -+ virtual void AddKey(const cec_keypress &key); -+ virtual void SetCurrentButton(const cec_user_control_code iButtonCode); -+ virtual uint16_t CheckKeypressTimeout(void); -+@@ -406,6 +406,10 @@ namespace CEC -+ cec_user_control_code m_iCurrentButton; /**< the control code of the button that's currently held down (if any) */ -+ int64_t m_initialButtontime; /**< the timestamp when the button was initially pressed (in seconds since epoch), or 0 if none was pressed. */ -+ int64_t m_updateButtontime; /**< the timestamp when the button was updated (in seconds since epoch), or 0 if none was pressed. */ -++ int64_t m_repeatButtontime; /**< the timestamp when the button will next repeat (in seconds since epoch), or 0 if repeat is disabled. */ -++ int64_t m_releaseButtontime; /**< the timestamp when the button will be released (in seconds since epoch), or 0 if none was pressed. */ -++ int32_t m_pressedButtoncount; /**< the number of times a button released message has been seen for this press. */ -++ int32_t m_releasedButtoncount; /**< the number of times a button pressed message has been seen for this press. */ -+ int64_t m_iPreventForwardingPowerOffCommand; /**< prevent forwarding standby commands until this time */ -+ int64_t m_iLastKeypressTime; /**< last time a key press was sent to the client */ -+ cec_keypress m_lastKeypress; /**< the last key press that was sent to the client */ -+diff --git a/src/libcec/implementations/CECCommandHandler.cpp b/src/libcec/implementations/CECCommandHandler.cpp -+index 6d6244e..d64186f 100644 -+--- a/src/libcec/implementations/CECCommandHandler.cpp -++++ b/src/libcec/implementations/CECCommandHandler.cpp -+@@ -770,7 +770,7 @@ int CCECCommandHandler::HandleUserControlRelease(const cec_command &command) -+ -+ CECClientPtr client = m_processor->GetClient(command.destination); -+ if (client) -+- client->AddKey(); -++ client->AddKey(false, true); -+ -+ return COMMAND_HANDLED; -+ } -+-- -+1.9.1 -+ -+ -+From 3336d0827f7fd159430f3431642b07090c06c869 Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Tue, 28 Oct 2014 01:21:35 +0000 -+Subject: [PATCH 4/6] Skip double press removal. It is handled through other -+ means. -+ -+--- -+ src/libcec/CECClient.cpp | 18 +----------------- -+ src/libcec/CECClient.h | 2 -- -+ 2 files changed, 1 insertion(+), 19 deletions(-) -+ -+diff --git a/src/libcec/CECClient.cpp b/src/libcec/CECClient.cpp -+index 598628d..dccd874 100644 -+--- a/src/libcec/CECClient.cpp -++++ b/src/libcec/CECClient.cpp -+@@ -60,11 +60,8 @@ CCECClient::CCECClient(CCECProcessor *processor, const libcec_configuration &con -+ m_releaseButtontime(0), -+ m_pressedButtoncount(0), -+ m_releasedButtoncount(0), -+- m_iPreventForwardingPowerOffCommand(0), -+- m_iLastKeypressTime(0) -++ m_iPreventForwardingPowerOffCommand(0) -+ { -+- m_lastKeypress.keycode = CEC_USER_CONTROL_CODE_UNKNOWN; -+- m_lastKeypress.duration = 0; -+ m_configuration.Clear(); -+ // set the initial configuration -+ SetConfiguration(configuration); -+@@ -1647,20 +1644,7 @@ void CCECClient::CallbackAddKey(const cec_keypress &key) -+ { -+ CLockObject lock(m_cbMutex); -+ if (m_configuration.callbacks && m_configuration.callbacks->CBCecKeyPress) -+- { -+- // prevent double taps -+- int64_t now = GetTimeMs(); -+- if (m_lastKeypress.keycode != key.keycode || -+- key.duration > 0 || -+- now - m_iLastKeypressTime >= DoubleTapTimeoutMS()) -+- { -+- // no double tap -+- if (key.duration == 0) -+- m_iLastKeypressTime = now; -+- m_lastKeypress = key; -+ m_configuration.callbacks->CBCecKeyPress(m_configuration.callbackParam, key); -+- } -+- } -+ } -+ -+ void CCECClient::CallbackAddLog(const cec_log_message &message) -+diff --git a/src/libcec/CECClient.h b/src/libcec/CECClient.h -+index adeb5af..43a713b 100644 -+--- a/src/libcec/CECClient.h -++++ b/src/libcec/CECClient.h -+@@ -411,8 +411,6 @@ namespace CEC -+ int32_t m_pressedButtoncount; /**< the number of times a button released message has been seen for this press. */ -+ int32_t m_releasedButtoncount; /**< the number of times a button pressed message has been seen for this press. */ -+ int64_t m_iPreventForwardingPowerOffCommand; /**< prevent forwarding standby commands until this time */ -+- int64_t m_iLastKeypressTime; /**< last time a key press was sent to the client */ -+- cec_keypress m_lastKeypress; /**< the last key press that was sent to the client */ -+ PLATFORM::SyncedBuffer m_callbackCalls; -+ }; -+ } -+-- -+1.9.1 -+ -+ -+From 0dd0234f620a546bfa843172648383f83d88088c Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Mon, 3 Nov 2014 23:28:04 +0000 -+Subject: [PATCH 5/6] Pass through duration on all button repeats -+ -+--- -+ src/libcec/CECClient.cpp | 34 ++++++++++++++++++++++++---------- -+ 1 file changed, 24 insertions(+), 10 deletions(-) -+ -+diff --git a/src/libcec/CECClient.cpp b/src/libcec/CECClient.cpp -+index dccd874..1946148 100644 -+--- a/src/libcec/CECClient.cpp -++++ b/src/libcec/CECClient.cpp -+@@ -986,10 +986,6 @@ void CCECClient::AddKey(bool bSendComboKey /* = false */, bool bButtonRelease /* -+ cec_keypress key; -+ key.keycode = CEC_USER_CONTROL_CODE_UNKNOWN; -+ -+- // we ignore button releases when supporting repeating keys -+- if (bButtonRelease && m_configuration.iButtonRepeatRateMs && m_configuration.iButtonReleaseDelayMs) -+- return; -+- -+ { -+ CLockObject lock(m_mutex); -+ if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN) -+@@ -1015,6 +1011,10 @@ void CCECClient::AddKey(bool bSendComboKey /* = false */, bool bButtonRelease /* -+ } -+ } -+ -++ // we don't forward releases when supporting repeating keys -++ if (bButtonRelease && m_configuration.iButtonRepeatRateMs) -++ return; -++ -+ if (key.keycode != CEC_USER_CONTROL_CODE_UNKNOWN) -+ { -+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "key released: %s (%1x) D:%dms", ToString(key.keycode), key.keycode, key.duration); -+@@ -1107,7 +1107,7 @@ void CCECClient::AddKey(const cec_keypress &key) -+ -+ if (!isrepeat && (key.keycode != comboKey || key.duration > 0)) -+ { -+- LIB_CEC->AddLog(CEC_LOG_DEBUG, "key pressed: %s (%1x)", ToString(transmitKey.keycode), transmitKey.keycode); -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "key pressed: %s (%1x, %d)", ToString(transmitKey.keycode), transmitKey.keycode, transmitKey.duration); -+ QueueAddKey(transmitKey); -+ } -+ } -+@@ -1129,6 +1129,7 @@ uint16_t CCECClient::CheckKeypressTimeout(void) -+ unsigned int timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ cec_keypress key; -+ key.keycode = CEC_USER_CONTROL_CODE_UNKNOWN; -++ key.duration = 0; -+ -+ { -+ CLockObject lock(m_mutex); -+@@ -1140,8 +1141,7 @@ uint16_t CCECClient::CheckKeypressTimeout(void) -+ m_configuration.iComboKeyTimeoutMs : CEC_DEFAULT_COMBO_TIMEOUT_MS); -+ -+ if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && -+- ((m_iCurrentButton == comboKey && iTimeoutMs > 0 && iNow - m_updateButtontime >= iTimeoutMs) || -+- (m_iCurrentButton != comboKey && m_releaseButtontime && iNow >= (uint64_t)m_releaseButtontime))) -++ m_iCurrentButton == comboKey && iTimeoutMs > 0 && iNow - m_updateButtontime >= iTimeoutMs) -+ { -+ key.duration = (unsigned int) (iNow - m_initialButtontime); -+ key.keycode = m_iCurrentButton; -+@@ -1155,9 +1155,23 @@ uint16_t CCECClient::CheckKeypressTimeout(void) -+ m_releasedButtoncount = 0; -+ } -+ else if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && -++ m_iCurrentButton != comboKey && m_releaseButtontime && iNow >= (uint64_t)m_releaseButtontime) -++ { -++ key.duration = (unsigned int) (iNow - m_initialButtontime); -++ key.keycode = CEC_USER_CONTROL_CODE_UNKNOWN; -++ -++ m_iCurrentButton = CEC_USER_CONTROL_CODE_UNKNOWN; -++ m_initialButtontime = 0; -++ m_updateButtontime = 0; -++ m_repeatButtontime = 0; -++ m_releaseButtontime = 0; -++ m_pressedButtoncount = 0; -++ m_releasedButtoncount = 0; -++ } -++ else if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && -+ (m_iCurrentButton != comboKey && m_repeatButtontime && iNow >= (uint64_t)m_repeatButtontime)) -+ { -+- key.duration = 0; -++ key.duration = (unsigned int) (iNow - m_initialButtontime); -+ key.keycode = m_iCurrentButton; -+ m_repeatButtontime = iNow + m_configuration.iButtonRepeatRateMs; -+ timeout = std::min((uint64_t)timeout, m_repeatButtontime - iNow); -+@@ -1176,8 +1190,8 @@ uint16_t CCECClient::CheckKeypressTimeout(void) -+ timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ } -+ } -+- LIB_CEC->AddLog(CEC_LOG_DEBUG, "key %s: %s (%1x) timeout:%dms (rel:%d,rep:%d,prs:%d,rel:%d)", key.keycode == CEC_USER_CONTROL_CODE_UNKNOWN ? "idle" : key.duration ? "released" : "repeated", -+- ToString(m_iCurrentButton), m_iCurrentButton, timeout, (int)(m_releaseButtontime ? m_releaseButtontime - iNow : 0), (int)(m_repeatButtontime ? m_repeatButtontime - iNow : 0), m_pressedButtoncount, m_releasedButtoncount); -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "Key %s: %s (duration:%d) (%1x) timeout:%dms (rel:%d,rep:%d,prs:%d,rel:%d)", ToString(m_iCurrentButton), key.keycode == CEC_USER_CONTROL_CODE_UNKNOWN ? "idle" : m_repeatButtontime ? "repeated" : "released", key.duration, -++ m_iCurrentButton, timeout, (int)(m_releaseButtontime ? m_releaseButtontime - iNow : 0), (int)(m_repeatButtontime ? m_repeatButtontime - iNow : 0), m_pressedButtoncount, m_releasedButtoncount); -+ } -+ -+ if (key.keycode != CEC_USER_CONTROL_CODE_UNKNOWN) -+-- -+1.9.1 -+ -+ -+From 1ea01f59d8186d4d53af41961aaccbbc11651115 Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Wed, 5 Nov 2014 21:04:25 +0000 -+Subject: [PATCH 6/6] squash: Fix for stop needing to be pressed twice -+ -+--- -+ src/libcec/CECClient.cpp | 17 ++++++++--------- -+ 1 file changed, 8 insertions(+), 9 deletions(-) -+ -+diff --git a/src/libcec/CECClient.cpp b/src/libcec/CECClient.cpp -+index 1946148..f4f114b 100644 -+--- a/src/libcec/CECClient.cpp -++++ b/src/libcec/CECClient.cpp -+@@ -1131,6 +1131,8 @@ uint16_t CCECClient::CheckKeypressTimeout(void) -+ key.keycode = CEC_USER_CONTROL_CODE_UNKNOWN; -+ key.duration = 0; -+ -++ if (m_iCurrentButton == CEC_USER_CONTROL_CODE_UNKNOWN) -++ return timeout; -+ { -+ CLockObject lock(m_mutex); -+ uint64_t iNow = GetTimeMs(); -+@@ -1140,8 +1142,7 @@ uint16_t CCECClient::CheckKeypressTimeout(void) -+ uint32_t iTimeoutMs(m_configuration.clientVersion >= LIBCEC_VERSION_TO_UINT(2, 0, 5) ? -+ m_configuration.iComboKeyTimeoutMs : CEC_DEFAULT_COMBO_TIMEOUT_MS); -+ -+- if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && -+- m_iCurrentButton == comboKey && iTimeoutMs > 0 && iNow - m_updateButtontime >= iTimeoutMs) -++ if (m_iCurrentButton == comboKey && iTimeoutMs > 0 && iNow - m_updateButtontime >= iTimeoutMs) -+ { -+ key.duration = (unsigned int) (iNow - m_initialButtontime); -+ key.keycode = m_iCurrentButton; -+@@ -1154,8 +1155,7 @@ uint16_t CCECClient::CheckKeypressTimeout(void) -+ m_pressedButtoncount = 0; -+ m_releasedButtoncount = 0; -+ } -+- else if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && -+- m_iCurrentButton != comboKey && m_releaseButtontime && iNow >= (uint64_t)m_releaseButtontime) -++ else if (m_iCurrentButton != comboKey && m_releaseButtontime && iNow >= (uint64_t)m_releaseButtontime) -+ { -+ key.duration = (unsigned int) (iNow - m_initialButtontime); -+ key.keycode = CEC_USER_CONTROL_CODE_UNKNOWN; -+@@ -1168,8 +1168,7 @@ uint16_t CCECClient::CheckKeypressTimeout(void) -+ m_pressedButtoncount = 0; -+ m_releasedButtoncount = 0; -+ } -+- else if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && -+- (m_iCurrentButton != comboKey && m_repeatButtontime && iNow >= (uint64_t)m_repeatButtontime)) -++ else if (m_iCurrentButton != comboKey && m_repeatButtontime && iNow >= (uint64_t)m_repeatButtontime) -+ { -+ key.duration = (unsigned int) (iNow - m_initialButtontime); -+ key.keycode = m_iCurrentButton; -+@@ -1178,11 +1177,11 @@ uint16_t CCECClient::CheckKeypressTimeout(void) -+ } -+ else -+ { -+- if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && m_iCurrentButton == comboKey && iTimeoutMs > 0) -++ if (m_iCurrentButton == comboKey && iTimeoutMs > 0) -+ timeout = std::min((uint64_t)timeout, m_updateButtontime - iNow + iTimeoutMs); -+- if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && m_iCurrentButton != comboKey && m_releaseButtontime) -++ if (m_iCurrentButton != comboKey && m_releaseButtontime) -+ timeout = std::min((uint64_t)timeout, m_releaseButtontime - iNow); -+- if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && m_iCurrentButton != comboKey && m_repeatButtontime) -++ if (m_iCurrentButton != comboKey && m_repeatButtontime) -+ timeout = std::min((uint64_t)timeout, m_repeatButtontime - iNow); -+ if (timeout > CEC_PROCESSOR_SIGNAL_WAIT_TIME) -+ { -+-- -+1.9.1 -+ +-bool CDemuxMVC::SeekTime(int time, bool backwords, double* startpts) ++bool CDemuxMVC::SeekTime(double time, bool backwords, double* startpts) + { + if (!m_pInput) + return false; +diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.h +index bbb836a61344689a83af68c821c05c212a86b097..54f91a02391368fbfbb4d669c003f42568347f62 100644 +--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.h ++++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.h +@@ -36,7 +36,7 @@ public: + virtual void Abort(); + virtual void Flush(); + virtual DemuxPacket* Read(); +- virtual bool SeekTime(int time, bool backwords = false, double* startpts = nullptr); ++ virtual bool SeekTime(double time, bool backwords = false, double* startpts = nullptr); + virtual void SetSpeed(int iSpeed) { }; + virtual int GetStreamLength() { return 0; }; + virtual CDemuxStream* GetStream(int iStreamId) const override { return nullptr; }; -From 32d910f5fb777a2d18b2d81b8242e0abd48e6388 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sat, 19 Mar 2016 17:15:29 +0000 -Subject: [PATCH 52/73] cec: hack: pretend bump to 3.1.0 - ---- - tools/depends/target/libcec/Makefile | 1 + - tools/depends/target/libcec/bump.patch | 21 +++++++++++++++++++++ - 2 files changed, 22 insertions(+) - create mode 100644 tools/depends/target/libcec/bump.patch - -diff --git a/tools/depends/target/libcec/Makefile b/tools/depends/target/libcec/Makefile -index ddf996361ad5b46dd2b33fb035b2ed133914a612..39ba882d0c7e270b4d1d1d566027cbaffb76b587 100644 ---- a/tools/depends/target/libcec/Makefile -+++ b/tools/depends/target/libcec/Makefile -@@ -22,6 +22,7 @@ $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) - rm -rf $(PLATFORM); mkdir -p $(PLATFORM)/build - cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) - cd $(PLATFORM); patch -p1 < ../popcornmix.patch -+ cd $(PLATFORM); patch -p1 < ../bump.patch - cd $(PLATFORM)/build; $(CMAKE) -DBUILD_SHARED_LIBS=1 -DSKIP_PYTHON_WRAPPER:STRING=1 -DCMAKE_INSTALL_LIBDIR=$(PREFIX)/lib .. - - $(LIBDYLIB): $(PLATFORM) -diff --git a/tools/depends/target/libcec/bump.patch b/tools/depends/target/libcec/bump.patch -new file mode 100644 -index 0000000000000000000000000000000000000000..9e55e51068e7befd9d4ff003156ce1ff4cc56c0e ---- /dev/null -+++ b/tools/depends/target/libcec/bump.patch -@@ -0,0 +1,21 @@ -+commit 49a1728feabca68b8424a8b22abec9ee87b9aa99 -+Author: Lars Op den Kamp -+Date: Wed Jan 20 01:06:50 2016 +0100 -+ -+ bump to 3.1.0 -+ -+diff --git a/CMakeLists.txt b/CMakeLists.txt -+index 23d71fc..173f625 100644 -+--- a/CMakeLists.txt -++++ b/CMakeLists.txt -+@@ -2,8 +2,8 @@ project(libcec) -+ cmake_minimum_required(VERSION 2.8.9) -+ -+ set(LIBCEC_VERSION_MAJOR 3) -+-set(LIBCEC_VERSION_MINOR 0) -+-set(LIBCEC_VERSION_PATCH 0) -++set(LIBCEC_VERSION_MINOR 1) -++set(LIBCEC_VERSION_PATCH 0) -+ -+ # cec-client -+ add_subdirectory(src/cec-client) - -From 2e98d936f34bb32d80b7edfc86f10e4cd6073a85 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Tue, 28 Oct 2014 00:19:40 +0000 -Subject: [PATCH 53/73] [cec] Add settings for configuring button repeats - ---- - addons/resource.language.en_gb/resources/strings.po | 15 +++++++++++++++ - system/peripherals.xml | 4 +++- - xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 16 ++++++++++++++++ - 3 files changed, 34 insertions(+), 1 deletion(-) - -diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 7ace950c83e1497b4d96a31b33b524e7eafb1783..bdc5953503cf382091706240505c850084d84d94 100644 ---- a/addons/resource.language.en_gb/resources/strings.po -+++ b/addons/resource.language.en_gb/resources/strings.po -@@ -19714,3 +19714,18 @@ msgstr "" - msgctxt "#38206" - msgid "Max" - msgstr "" -+ -+#: system/peripherals.xml -+msgctxt "#38050" -+msgid "Remote button press delay before repeating (ms)" -+msgstr "" -+ -+#: system/peripherals.xml -+msgctxt "#38051" -+msgid "Remote button press repeat rate (ms)" -+msgstr "" -+ -+#: system/peripherals.xml -+msgctxt "#38052" -+msgid "Remote button press release time (ms)" -+msgstr "" -diff --git a/system/peripherals.xml b/system/peripherals.xml -index f939c0b685d96d022856544e7eb31a71338d9ba4..a4b8f7add4d915c1749628d62a9cbe9afe97d063 100644 ---- a/system/peripherals.xml -+++ b/system/peripherals.xml -@@ -31,7 +31,9 @@ - - - -- -+ -+ -+ - - - -diff --git a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp -index e6bcbce6911a1714e129ecd5aceead94769231f4..19b3c37bc18fcab30920b12902e8c3397a69dccc 100644 ---- a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp -+++ b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp -@@ -1287,6 +1287,20 @@ void CPeripheralCecAdapter::SetConfigurationFromLibCEC(const CEC::libcec_configu - m_configuration.bSendInactiveSource = config.bSendInactiveSource; - bChanged |= SetSetting("send_inactive_source", m_configuration.bSendInactiveSource == 1); - -+#if defined(CEC_DOUBLE_TAP_TIMEOUT_MS_OLD) -+ m_configuration.iDoubleTapTimeout50Ms = config.iDoubleTapTimeout50Ms; -+ bChanged |= SetSetting("double_tap_timeout_ms", (int)m_configuration.iDoubleTapTimeout50Ms * 50); -+#else -+ m_configuration.iDoubleTapTimeoutMs = config.iDoubleTapTimeoutMs; -+ bChanged |= SetSetting("double_tap_timeout_ms", (int)m_configuration.iDoubleTapTimeoutMs; -+#endif -+ -+ m_configuration.iButtonRepeatRateMs = config.iButtonRepeatRateMs; -+ bChanged |= SetSetting("button_repeat_rate_ms", (int)m_configuration.iButtonRepeatRateMs); -+ -+ m_configuration.iButtonReleaseDelayMs = config.iButtonReleaseDelayMs; -+ bChanged |= SetSetting("button_release_delay_ms", (int)m_configuration.iButtonReleaseDelayMs); -+ - m_configuration.iFirmwareVersion = config.iFirmwareVersion; - m_configuration.bShutdownOnStandby = config.bShutdownOnStandby; - -@@ -1391,6 +1405,8 @@ void CPeripheralCecAdapter::SetConfigurationFromSettings(void) - // backwards compatibility. will be removed once the next major release of libCEC is out - m_configuration.iDoubleTapTimeoutMs = GetSettingInt("double_tap_timeout_ms"); - #endif -+ m_configuration.iButtonRepeatRateMs = GetSettingInt("button_repeat_rate_ms"); -+ m_configuration.iButtonReleaseDelayMs = GetSettingInt("button_release_delay_ms"); - - if (GetSettingBool("pause_playback_on_deactivate")) - { - -From 4b033455b05332c157035752984e7c8da9ddce20 Mon Sep 17 00:00:00 2001 +From 08f34e983316fb995d27145fe023c5dbf7316df9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Nov 2014 23:17:46 +0000 -Subject: [PATCH 54/73] [cec] Don't discard buttons when repeat mode is enabled +Subject: [PATCH 55/63] [cec] Don't discard buttons when repeat mode is enabled --- xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp -index 19b3c37bc18fcab30920b12902e8c3397a69dccc..f859f44f6d5379154317b5760d7df720f0894e0d 100644 +index 30367a3fde956090afdca9930fa52e829f35046f..febacb3b7964eab3b8615a6a807e0f27d911b4da 100644 --- a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp +++ b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp -@@ -778,7 +778,10 @@ void CPeripheralCecAdapter::PushCecKeypress(const CecButtonPress &key) +@@ -803,7 +803,10 @@ void CPeripheralCecAdapter::PushCecKeypress(const CecButtonPress &key) CLog::Log(LOGDEBUG, "%s - received key %2x duration %d", __FUNCTION__, key.iButton, key.iDuration); CSingleLock lock(m_critSection); @@ -52642,20 +51869,20 @@ index 19b3c37bc18fcab30920b12902e8c3397a69dccc..f859f44f6d5379154317b5760d7df720 if (m_currentButton.iButton == key.iButton && m_currentButton.iDuration == 0) { -From 6e8d828760fc9a98acb6d7599926b9bc33ff4f4e Mon Sep 17 00:00:00 2001 +From fc196a50f90057e3eb1b6553347a9d400c717db8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 4 Nov 2014 18:50:00 +0000 -Subject: [PATCH 55/73] [cec] Temp - more logging +Subject: [PATCH 56/63] [cec] Temp - more logging --- xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp -index f859f44f6d5379154317b5760d7df720f0894e0d..f1c3a6d242183507c4ce9ebf4651b0c0f7e9c5c9 100644 +index febacb3b7964eab3b8615a6a807e0f27d911b4da..52d6e6a7ab68ce91faf5a3881b23ea7adde96cb8 100644 --- a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp +++ b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp -@@ -775,12 +775,15 @@ void CPeripheralCecAdapter::GetNextKey(void) +@@ -800,12 +800,15 @@ void CPeripheralCecAdapter::GetNextKey(void) void CPeripheralCecAdapter::PushCecKeypress(const CecButtonPress &key) { @@ -52672,7 +51899,7 @@ index f859f44f6d5379154317b5760d7df720f0894e0d..f1c3a6d242183507c4ce9ebf4651b0c0 if (m_configuration.iButtonRepeatRateMs == 0 && key.iDuration > 0) { if (m_currentButton.iButton == key.iButton && m_currentButton.iDuration == 0) -@@ -789,6 +792,7 @@ void CPeripheralCecAdapter::PushCecKeypress(const CecButtonPress &key) +@@ -814,6 +817,7 @@ void CPeripheralCecAdapter::PushCecKeypress(const CecButtonPress &key) if (m_bHasButton) m_currentButton.iDuration = key.iDuration; // ignore this one, since it's already been handled by xbmc @@ -52680,7 +51907,7 @@ index f859f44f6d5379154317b5760d7df720f0894e0d..f1c3a6d242183507c4ce9ebf4651b0c0 return; } // if we received a keypress with a duration set, try to find the same one without a duration set, and replace it -@@ -799,6 +803,7 @@ void CPeripheralCecAdapter::PushCecKeypress(const CecButtonPress &key) +@@ -824,6 +828,7 @@ void CPeripheralCecAdapter::PushCecKeypress(const CecButtonPress &key) if ((*it).iDuration == 0) { // replace this entry @@ -52688,7 +51915,7 @@ index f859f44f6d5379154317b5760d7df720f0894e0d..f1c3a6d242183507c4ce9ebf4651b0c0 (*it).iDuration = key.iDuration; return; } -@@ -808,6 +813,7 @@ void CPeripheralCecAdapter::PushCecKeypress(const CecButtonPress &key) +@@ -833,6 +838,7 @@ void CPeripheralCecAdapter::PushCecKeypress(const CecButtonPress &key) } } @@ -52697,128 +51924,10 @@ index f859f44f6d5379154317b5760d7df720f0894e0d..f1c3a6d242183507c4ce9ebf4651b0c0 } -From f422270e1333ba02c8c2321538ae171572e9879d Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 22 Jan 2016 12:29:41 +0000 -Subject: [PATCH 56/73] [cec] Update for libcec 3.1.0 - ---- - configure.ac | 4 ++-- - xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 4 ++-- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 3df753bde53593ecea534455056268f9f8a24c1a..738d23e3272cd56b095cef821a3993bb9aa69b55 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1453,9 +1453,9 @@ if test "x$use_libcec" != "xno"; then - # libcec is dyloaded, so we need to check for its headers and link any depends. - if test "x$use_libcec" != "xno"; then - if test "x$use_libcec" != "xauto"; then -- PKG_CHECK_MODULES([CEC],[libcec >= 3.0.0],,[use_libcec="no";AC_MSG_ERROR($libcec_disabled)]) -+ PKG_CHECK_MODULES([CEC],[libcec >= 3.1.0],,[use_libcec="no";AC_MSG_ERROR($libcec_disabled)]) - else -- PKG_CHECK_MODULES([CEC],[libcec >= 3.0.0],,[use_libcec="no";AC_MSG_RESULT($libcec_disabled)]) -+ PKG_CHECK_MODULES([CEC],[libcec >= 3.1.0],,[use_libcec="no";AC_MSG_RESULT($libcec_disabled)]) - fi - - if test "x$use_libcec" != "xno"; then -diff --git a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp -index f1c3a6d242183507c4ce9ebf4651b0c0f7e9c5c9..28a6a8148810da940f977976a627018c59a719db 100644 ---- a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp -+++ b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp -@@ -43,7 +43,7 @@ using namespace PERIPHERALS; - using namespace ANNOUNCEMENT; - using namespace CEC; - --#define CEC_LIB_SUPPORTED_VERSION LIBCEC_VERSION_TO_UINT(3, 0, 0) -+#define CEC_LIB_SUPPORTED_VERSION LIBCEC_VERSION_TO_UINT(3, 1, 0) - - /* time in seconds to ignore standby commands from devices after the screensaver has been activated */ - #define SCREENSAVER_TIMEOUT 20 -@@ -1329,7 +1329,7 @@ void CPeripheralCecAdapter::SetConfigurationFromLibCEC(const CEC::libcec_configu - void CPeripheralCecAdapter::SetConfigurationFromSettings(void) - { - // client version matches the version of libCEC that we originally used the API from -- m_configuration.clientVersion = LIBCEC_VERSION_TO_UINT(3, 0, 0); -+ m_configuration.clientVersion = CEC_LIB_SUPPORTED_VERSION; - - // device name 'XBMC' - snprintf(m_configuration.strDeviceName, 13, "%s", GetSettingString("device_name").c_str()); - -From 2748fd05bec256b540214e0e3e4cbbacac5aea31 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sat, 19 Mar 2016 14:46:41 +0000 -Subject: [PATCH 57/73] libcec: use system audio mode request instead of power - on to start AVR reliable - ---- - tools/depends/target/libcec/208.patch | 38 +++++++++++++++++++++++++++++++++++ - tools/depends/target/libcec/Makefile | 1 + - 2 files changed, 39 insertions(+) - create mode 100644 tools/depends/target/libcec/208.patch - -diff --git a/tools/depends/target/libcec/208.patch b/tools/depends/target/libcec/208.patch -new file mode 100644 -index 0000000000000000000000000000000000000000..3dc5adf022e80c3337ad69b7c7d7346daafbfdd3 ---- /dev/null -+++ b/tools/depends/target/libcec/208.patch -@@ -0,0 +1,38 @@ -+From f70c4d76e1d9c0219a3927b6b66090b7575e7933 Mon Sep 17 00:00:00 2001 -+From: Gerald Dachs -+Date: Thu, 17 Mar 2016 12:12:51 +0100 -+Subject: [PATCH] use system audio mode request instead of power on to start -+ AVR reliable -+ -+--- -+ src/libcec/devices/CECBusDevice.cpp | 13 +++++++++---- -+ 1 file changed, 9 insertions(+), 4 deletions(-) -+ -+diff --git a/src/libcec/devices/CECBusDevice.cpp b/src/libcec/devices/CECBusDevice.cpp -+index 55939d1..e2d5ea3 100644 -+--- a/src/libcec/devices/CECBusDevice.cpp -++++ b/src/libcec/devices/CECBusDevice.cpp -+@@ -1025,14 +1025,19 @@ bool CCECBusDevice::ActivateSource(uint64_t iDelay /* = 0 */) -+ bool bReturn(true); -+ if (iDelay == 0) -+ { -+- /** some AVRs fail to be powered up by the TV when it powers up. power up the AVR explicitly */ -++ /** send system audio mode request if AVR exists */ -+ if (m_iLogicalAddress != CECDEVICE_AUDIOSYSTEM) -+ { -+ CCECBusDevice* audioSystem(m_processor->GetDevice(CECDEVICE_AUDIOSYSTEM)); -+- if (audioSystem && audioSystem->IsPresent() && audioSystem->GetPowerStatus(m_iLogicalAddress) != CEC_POWER_STATUS_ON) -++ if (audioSystem && audioSystem->IsPresent()) -+ { -+- LIB_CEC->AddLog(CEC_LOG_DEBUG, "powering up the AVR"); -+- audioSystem->PowerOn(m_iLogicalAddress); -++ cec_command command; -++ -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "sending system audio mode request for '%s'", ToString(m_iLogicalAddress)); -++ cec_command::Format(command, m_iLogicalAddress, CECDEVICE_AUDIOSYSTEM, CEC_OPCODE_SYSTEM_AUDIO_MODE_REQUEST); -++ command.parameters.PushBack((uint8_t) ((m_iPhysicalAddress >> 8) & 0xFF)); -++ command.parameters.PushBack((uint8_t) (m_iPhysicalAddress & 0xFF)); -++ bReturn = m_handler->Transmit(command, false, false); -+ } -+ } -+ -diff --git a/tools/depends/target/libcec/Makefile b/tools/depends/target/libcec/Makefile -index 39ba882d0c7e270b4d1d1d566027cbaffb76b587..4565dc9f6fc0b3e6b49133443c19e10767d475eb 100644 ---- a/tools/depends/target/libcec/Makefile -+++ b/tools/depends/target/libcec/Makefile -@@ -23,6 +23,7 @@ $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) - cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) - cd $(PLATFORM); patch -p1 < ../popcornmix.patch - cd $(PLATFORM); patch -p1 < ../bump.patch -+ cd $(PLATFORM); patch -p1 < ../208.patch - cd $(PLATFORM)/build; $(CMAKE) -DBUILD_SHARED_LIBS=1 -DSKIP_PYTHON_WRAPPER:STRING=1 -DCMAKE_INSTALL_LIBDIR=$(PREFIX)/lib .. - - $(LIBDYLIB): $(PLATFORM) - -From 25e789e48fd92bd81c780834328846abde00c69f Mon Sep 17 00:00:00 2001 +From dd28ae7d01450884dca135169ca72a6ac6344117 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Tue, 22 Mar 2016 09:51:52 +0100 -Subject: [PATCH 58/73] python: use kodi provided cert if available +Subject: [PATCH 57/63] python: use kodi provided cert if available --- xbmc/interfaces/python/XBPython.cpp | 6 ++++++ @@ -52842,10 +51951,10 @@ index bc84af9411ef55eaf5ba71a320b5cbfec5f49548..ff4ed7db26845905108ea0ae504e4f58 PyEval_AcquireLock(); else -From 2c9d4750f89d50ab7350a6f258d219190111c0b3 Mon Sep 17 00:00:00 2001 +From 2ed41ab819cb7060380c1f7cba57edbd0ad0fba8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 25 May 2016 18:31:17 +0100 -Subject: [PATCH 59/73] rbp: Hard code the number of buffers to improve audio +Subject: [PATCH 58/63] rbp: Hard code the number of buffers to improve audio sync --- @@ -52854,10 +51963,10 @@ Subject: [PATCH 59/73] rbp: Hard code the number of buffers to improve audio 2 files changed, 10 insertions(+) diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml -index 2572e25753712186f69390965ee1448bff3fadd5..5d9f716bac49f9850f1062a4d5ac851794eefbe3 100644 +index 7098edf32dff8c00e192229c3ffb060be6a42482..0ce6735e11fabd1d07a4860b9d985a4e1fd5f35a 100644 --- a/system/settings/rbp.xml +++ b/system/settings/rbp.xml -@@ -92,6 +92,12 @@ +@@ -85,6 +85,12 @@ @@ -52871,7 +51980,7 @@ index 2572e25753712186f69390965ee1448bff3fadd5..5d9f716bac49f9850f1062a4d5ac8517 diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp -index d38031da337aa9ff180c2866c5d5924c8537978e..370485e08080d421b12ad5ad4dd0f4985a55147d 100644 +index 54cf477648bba4583904cf122b4e66f6bbdd9469..908d73b151845c2f85a897ca5714fa1fac6cc603 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp @@ -1063,7 +1063,11 @@ void CRenderManager::UpdateDisplayLatency() @@ -52887,10 +51996,10 @@ index d38031da337aa9ff180c2866c5d5924c8537978e..370485e08080d421b12ad5ad4dd0f498 } -From 2881008fef3d6c44ad33d258fa9be3c3346ab8d6 Mon Sep 17 00:00:00 2001 +From 82f3257a709241542444806947dc2b573715e399 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 4 Jul 2016 18:30:03 +0100 -Subject: [PATCH 60/73] rbp: Update the GL libs to new naming scheme +Subject: [PATCH 59/63] rbp: Update the GL libs to new naming scheme As the opensource mesa GL library is getting more usable, the name collision wih the firmware GL driver is causing issues. As such we are renaming the firmware GL driver to avoid this. @@ -52904,7 +52013,7 @@ will be dropped at some point 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac -index 738d23e3272cd56b095cef821a3993bb9aa69b55..db912db732d5b55a5c8abfca0b4c7a04bf96d535 100644 +index 87bfbbfe8b833cec9cdef6b16d311471b162d564..dd67c5e53183b5c2c19de44bb246ed7b86372453 100644 --- a/configure.ac +++ b/configure.ac @@ -949,7 +949,7 @@ if test "$use_gles" = "yes"; then @@ -52942,10 +52051,10 @@ index ab06f968b3e314fca1ae001139f687dce9a5098b..87f1faa248b91a2e50758b23c0b9e5b0 else() find_library(OPENGLES_gl_LIBRARY NAMES OpenGLES diff --git a/tools/depends/configure.ac b/tools/depends/configure.ac -index a0bc386284f168c982b8cfed7e28768fd42459b5..dbe3ec83221396d1a5ae5b8715b7ca45f17d247c 100644 +index 3626ea5204eb561dc1ae0b64c6bb7253d2ec59ec..100ff3178bafe7434bd5456100b5bb7189a5378d 100644 --- a/tools/depends/configure.ac +++ b/tools/depends/configure.ac -@@ -432,7 +432,7 @@ if test "$target_platform" = "raspberry-pi" ; then +@@ -433,7 +433,7 @@ if test "$target_platform" = "raspberry-pi" ; then -isystem${use_firmware}/opt/vc/include \ -isystem${use_firmware}/opt/vc/include/interface/vcos/pthreads \ -isystem${use_firmware}/opt/vc/include/interface/vmcs_host/linux" @@ -52955,146 +52064,20 @@ index a0bc386284f168c982b8cfed7e28768fd42459b5..dbe3ec83221396d1a5ae5b8715b7ca45 fi -From c8be496ad1ad4e4abe988ac1a4fc264d518f7393 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 21 Apr 2016 16:49:02 +0100 -Subject: [PATCH 61/73] Revert "[settings] remove show EXIF picture information - setting" - -This reverts commit e7d90188436b6966eff23fd695e1a9d18f4af1b4. ---- - addons/resource.language.en_gb/resources/strings.po | 10 ++++++++++ - system/settings/settings.xml | 5 +++++ - xbmc/pictures/GUIWindowPictures.cpp | 2 +- - xbmc/pictures/PictureInfoLoader.cpp | 8 ++++++-- - xbmc/pictures/PictureInfoLoader.h | 1 + - xbmc/settings/Settings.cpp | 1 + - xbmc/settings/Settings.h | 1 + - 7 files changed, 25 insertions(+), 3 deletions(-) - -diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index bdc5953503cf382091706240505c850084d84d94..a459a333cd646462956e2e2925cc5bcbfb972bd8 100644 ---- a/addons/resource.language.en_gb/resources/strings.po -+++ b/addons/resource.language.en_gb/resources/strings.po -@@ -19729,3 +19729,13 @@ msgstr "" - msgctxt "#38052" - msgid "Remote button press release time (ms)" - msgstr "" -+ -+#. Description of setting "Pictures -> Show EXIF picture information" with label #38207 -+#: system/settings/settings.xml -+msgctxt "#38207" -+msgid "Show EXIF picture information" -+msgstr "" -+ -+msgctxt "#38208" -+msgid "If EXIF information exists (date, time, camera used, etc.), it will be displayed." -+msgstr "" -diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index 291a781e33496a0e6fe5cd869c857f5a851586ce..508055794481729aa6394b84d2527e6c2e9dc4e2 100644 ---- a/system/settings/settings.xml -+++ b/system/settings/settings.xml -@@ -1180,6 +1180,11 @@ - - - -+ -+ 0 -+ true -+ -+ - - 0 - true -diff --git a/xbmc/pictures/GUIWindowPictures.cpp b/xbmc/pictures/GUIWindowPictures.cpp -index 4b5ec502a49d5116cafd53441a6d823be0da6b54..072639baae58479ec7d746f96634de069ee87e34 100644 ---- a/xbmc/pictures/GUIWindowPictures.cpp -+++ b/xbmc/pictures/GUIWindowPictures.cpp -@@ -203,7 +203,7 @@ void CGUIWindowPictures::OnPrepareFileItems(CFileItemList& items) - if (StringUtils::EqualsNoCase(items[i]->GetLabel(), "folder.jpg")) - items.Remove(i); - -- if (items.GetFolderCount() == items.Size()) -+ if (items.GetFolderCount() == items.Size() || !CSettings::GetInstance().GetBool(CSettings::SETTING_PICTURES_USETAGS)) - return; - - // Start the music info loader thread -diff --git a/xbmc/pictures/PictureInfoLoader.cpp b/xbmc/pictures/PictureInfoLoader.cpp -index dd3347277c75c5e63a4a4db9af9cc46605bb5ea9..05304f9fc44285d5577f2056625cceb15347ae57 100644 ---- a/xbmc/pictures/PictureInfoLoader.cpp -+++ b/xbmc/pictures/PictureInfoLoader.cpp -@@ -43,6 +43,7 @@ void CPictureInfoLoader::OnLoaderStart() - m_mapFileItems->SetFastLookup(true); - - m_tagReads = 0; -+ m_loadTags = CSettings::GetInstance().GetBool(CSettings::SETTING_PICTURES_USETAGS); - - if (m_pProgressCallback) - m_pProgressCallback->SetProgressMax(m_pVecItems->GetFileCount()); -@@ -87,8 +88,11 @@ bool CPictureInfoLoader::LoadItemLookup(CFileItem* pItem) - if (pItem->HasPictureInfoTag()) - return false; - -- pItem->GetPictureInfoTag()->Load(pItem->GetPath()); -- m_tagReads++; -+ if (m_loadTags) -+ { // Nothing found, load tag from file -+ pItem->GetPictureInfoTag()->Load(pItem->GetPath()); -+ m_tagReads++; -+ } - - return true; - } -diff --git a/xbmc/pictures/PictureInfoLoader.h b/xbmc/pictures/PictureInfoLoader.h -index 000b54fe1bb1dd1963edd5cf208ea318a5a5499d..2a022ff0ff66d237f0ebd12092c7b5ce8244a511 100644 ---- a/xbmc/pictures/PictureInfoLoader.h -+++ b/xbmc/pictures/PictureInfoLoader.h -@@ -39,5 +39,6 @@ protected: - - CFileItemList* m_mapFileItems; - unsigned int m_tagReads; -+ bool m_loadTags; - }; - -diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp -index 8f7f14cce4281daeb1cf4ba18cb9304615ef17b8..69bd754cf2f97bc2416b4929e5fd6653e9e1fbc6 100644 ---- a/xbmc/settings/Settings.cpp -+++ b/xbmc/settings/Settings.cpp -@@ -297,6 +297,7 @@ const std::string CSettings::SETTING_AUDIOCDS_SETTINGS = "audiocds.settings"; - const std::string CSettings::SETTING_AUDIOCDS_EJECTONRIP = "audiocds.ejectonrip"; - const std::string CSettings::SETTING_MYMUSIC_SONGTHUMBINVIS = "mymusic.songthumbinvis"; - const std::string CSettings::SETTING_MYMUSIC_DEFAULTLIBVIEW = "mymusic.defaultlibview"; -+const std::string CSettings::SETTING_PICTURES_USETAGS = "pictures.usetags"; - const std::string CSettings::SETTING_PICTURES_GENERATETHUMBS = "pictures.generatethumbs"; - const std::string CSettings::SETTING_PICTURES_SHOWVIDEOS = "pictures.showvideos"; - const std::string CSettings::SETTING_PICTURES_DISPLAYRESOLUTION = "pictures.displayresolution"; -diff --git a/xbmc/settings/Settings.h b/xbmc/settings/Settings.h -index 038b8c6b9436ed30e2a670164cf1f9556382c8c6..583f1079ce70192d133c43335a27bc0a49350648 100644 ---- a/xbmc/settings/Settings.h -+++ b/xbmc/settings/Settings.h -@@ -254,6 +254,7 @@ public: - static const std::string SETTING_AUDIOCDS_EJECTONRIP; - static const std::string SETTING_MYMUSIC_SONGTHUMBINVIS; - static const std::string SETTING_MYMUSIC_DEFAULTLIBVIEW; -+ static const std::string SETTING_PICTURES_USETAGS; - static const std::string SETTING_PICTURES_GENERATETHUMBS; - static const std::string SETTING_PICTURES_SHOWVIDEOS; - static const std::string SETTING_PICTURES_DISPLAYRESOLUTION; - -From 6be024ea730bcd2513b897e122be3ca1fbb1416b Mon Sep 17 00:00:00 2001 +From 364926a71cd3cf33b948a2e1ef1fd13881a0a95e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 28 Jun 2016 14:46:01 +0100 -Subject: [PATCH 62/73] ffmpeg: hacky fix for files with GMC +Subject: [PATCH 60/63] ffmpeg: hacky fix for files with GMC --- xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -index 6ac2da1262bd7f6a8304ef3192d67d1ea8d910c5..563556d7ab6858a767af6df83e24737e3ade5663 100644 +index c3e8a84ed2cdb148717f05ca85aebb21bb2dab6e..0a46eef4d265f1d0bca9215fd92a355af7d242ca 100644 --- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -@@ -1436,8 +1436,8 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) +@@ -1457,8 +1457,8 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) stereoMode = GetStereoModeFromMetadata(m_pFormatContext->metadata); if (!stereoMode.empty()) st->stereo_mode = stereoMode; @@ -53106,10 +52089,10 @@ index 6ac2da1262bd7f6a8304ef3192d67d1ea8d910c5..563556d7ab6858a767af6df83e24737e { if (pStream->codec->codec_id == AV_CODEC_ID_PROBE) -From d926e32b95f3353f1d12a81709e8bbaab12f1be5 Mon Sep 17 00:00:00 2001 +From 2a1502990a40ce020d6f51681e6adffdea9a0bc8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 19 Jul 2016 20:39:18 +0100 -Subject: [PATCH 63/73] mmalrender: Add sharpness control +Subject: [PATCH 61/63] mmalrender: Add sharpness control --- addons/resource.language.en_gb/resources/strings.po | 2 +- @@ -53118,10 +52101,10 @@ Subject: [PATCH 63/73] mmalrender: Add sharpness control 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index a459a333cd646462956e2e2925cc5bcbfb972bd8..dc220fb9809e277b1be60653c7fa1a6f62ff5a2c 100644 +index 7c7969d381bf15ac1ba2fd8f16e463f6b12fe4c3..45cf0830ea6079a0f2ad22792f2497c5ad53b625 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po -@@ -8695,7 +8695,7 @@ msgstr "" +@@ -8694,7 +8694,7 @@ msgstr "" #: xbmc/video/dialogs/GUIDialogVideoSettings.cpp msgctxt "#16313" @@ -53131,20 +52114,20 @@ index a459a333cd646462956e2e2925cc5bcbfb972bd8..dc220fb9809e277b1be60653c7fa1a6f #empty string with id 16314 diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -index 96a8e61aa22094f95385a2b45ce50c0d6d6b1fc4..a0104d9ff67402e74ea8076dd47e9e9bd11a74f1 100644 +index d0b88727674b67b851a7b74cb946cafe64e3ff6e..0b73b7700ce8a63932d3fa3b90dda8cf80ac527c 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -@@ -403,6 +403,7 @@ CMMALRenderer::CMMALRenderer() : CThread("MMALRenderer"), m_processThread(this, - m_queue_process = nullptr; - m_error = 0.0; +@@ -411,6 +411,7 @@ CMMALRenderer::CMMALRenderer() : CThread("MMALRenderer"), m_processThread(this, + m_frameInterval = 0.0; + m_frameIntervalDiff = 1e5; m_vsync_count = ~0U; + m_sharpness = -2.0f; m_vout_width = 0; m_vout_height = 0; m_vout_aligned_width = 0; -@@ -750,6 +751,15 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) - - ManageRenderArea(); +@@ -845,6 +846,15 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) + goto exit; + } + // if sharpness setting has changed, we should update it + if (m_sharpness != CMediaSettings::GetInstance().GetCurrentVideoSettings().m_Sharpness) @@ -53158,7 +52141,7 @@ index 96a8e61aa22094f95385a2b45ce50c0d6d6b1fc4..a0104d9ff67402e74ea8076dd47e9e9b if (m_format != RENDER_FMT_MMAL) { if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -@@ -927,7 +937,8 @@ bool CMMALRenderer::Supports(ERENDERFEATURE feature) +@@ -1021,7 +1031,8 @@ bool CMMALRenderer::Supports(ERENDERFEATURE feature) feature == RENDERFEATURE_ZOOM || feature == RENDERFEATURE_ROTATION || feature == RENDERFEATURE_VERTICAL_SHIFT || @@ -53169,10 +52152,10 @@ index 96a8e61aa22094f95385a2b45ce50c0d6d6b1fc4..a0104d9ff67402e74ea8076dd47e9e9b return false; diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -index a056a25f4f74fc6be023404286e044dac9d8ca7c..5d3baa6534a2fe449990402ab805d84423fbc636 100644 +index e0e6f7c0e0546013ca74265aef54704fd332f8e4..69eae6cbef0131d20dc979dcb35915cd73967592 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h +++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -@@ -133,6 +133,7 @@ protected: +@@ -140,6 +140,7 @@ protected: RENDER_STEREO_MODE m_video_stereo_mode; RENDER_STEREO_MODE m_display_stereo_mode; bool m_StereoInvert; @@ -53181,848 +52164,17 @@ index a056a25f4f74fc6be023404286e044dac9d8ca7c..5d3baa6534a2fe449990402ab805d844 CCriticalSection m_sharedSection; MMAL_COMPONENT_T *m_vout; -From 1f66b2a9ff102af96f70d8fa6b9b8a80bfcb2dce Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Tue, 26 Jul 2016 19:00:03 +0100 -Subject: [PATCH 64/73] rbp: Ensure processinfo values are initialised - ---- - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp | 2 ++ - xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 5 ++--- - 2 files changed, 4 insertions(+), 3 deletions(-) - -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -index 654a927a0d4cbf877a3bb2616d62f46a63e7cadb..2c5144c44403de9d8ddea7cfbb0c7f8356b81784 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -@@ -598,6 +598,8 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) - m_speed = DVD_PLAYSPEED_NORMAL; - - m_processInfo.SetVideoDecoderName(m_pFormatName, true); -+ m_processInfo.SetVideoDimensions(m_decoded_width, m_decoded_height); -+ m_processInfo.SetVideoDAR(m_aspect_ratio); - - return true; - } -diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index 84f389f6e37381a22db024667eebe4e8113857db..f6fb241dfec9269f4e501248de4dc83d5fdc2d3a 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -739,9 +739,6 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, f - m_bAllowFullscreen = false; // only allow on first configure - } - -- m_processInfo.SetVideoDimensions(width, height); -- m_processInfo.SetVideoDAR(display_aspect); -- - unsigned int iDisplayWidth = width; - unsigned int iDisplayHeight = height; - -@@ -753,6 +750,8 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, f - - m_fFrameRate = DVD_TIME_BASE / CDVDCodecUtils::NormalizeFrameduration((double)DVD_TIME_BASE / framerate); - m_processInfo.SetVideoFps(m_fFrameRate); -+ m_processInfo.SetVideoDimensions(width, height); -+ m_processInfo.SetVideoDAR((float)iDisplayWidth / (float)iDisplayHeight); - - CLog::Log(LOGDEBUG,"%s - change configuration. video:%dx%d. framerate: %4.2f. %dx%d format: BYPASS", - __FUNCTION__, video_width, video_height, m_fFrameRate, iDisplayWidth, iDisplayHeight); - -From b958fb38ea881c4da2f98a4a3c9b5290e0b7fbed Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 16 Sep 2016 15:37:07 +0100 -Subject: [PATCH 65/73] MMAL: Indicate when picture came from still frame so - advanced deinterlace can be disabled - -MMAL Advanced deinterlace requires 3 frames of context so does not produce any output -from a dvd menu still. - -We cannot easily submit the same frame multiple times (the MMAL buffer headers contain -linked list pointers), so the simple solution is to switch to the simpler -deinterlace that does not require context for stills. ---- - xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 2 +- - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp | 4 ++-- - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h | 1 + - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp | 4 +++- - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h | 3 ++- - .../VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp | 10 ++++++++++ - 6 files changed, 19 insertions(+), 5 deletions(-) - -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index fc152c13ed5b17ccfbb0ab4c659dedf8fd63d6bd..ec2cc3d867d446a748024ce85e079aea8451fb85 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -@@ -243,7 +243,7 @@ enum AVPixelFormat CDVDVideoCodecFFmpeg::GetFormat(struct AVCodecContext * avctx - #ifdef HAS_MMAL - if (*cur == AV_PIX_FMT_YUV420P) - { -- MMAL::CDecoder* dec = new MMAL::CDecoder(ctx->m_processInfo); -+ MMAL::CDecoder* dec = new MMAL::CDecoder(ctx->m_processInfo, ctx->m_hints); - if(dec->Open(avctx, ctx->m_pCodecContext, *cur, ctx->m_uSurfacesCount)) - { - ctx->m_processInfo.SetVideoPixelFormat(pixFmtName ? pixFmtName : ""); -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -index 2c5144c44403de9d8ddea7cfbb0c7f8356b81784..1cb76f65a24bf46fe4e3fc1f54e99f284672d80b 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -@@ -71,6 +71,7 @@ CMMALVideoBuffer::CMMALVideoBuffer(CMMALVideo *omv, std::shared_ptr p - m_encoding = MMAL_ENCODING_UNKNOWN; - m_aspect_ratio = 0.0f; - m_rendered = false; -+ m_stills = false; - } - - CMMALVideoBuffer::~CMMALVideoBuffer() -@@ -258,8 +259,6 @@ void CMMALVideo::dec_output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buf - omvb->m_aligned_width = m_decoded_aligned_width; - omvb->m_aligned_height = m_decoded_aligned_height; - omvb->m_aspect_ratio = m_aspect_ratio; -- if (m_hints.stills) // disable interlace in dvd stills mode -- omvb->mmal_buffer->flags &= ~MMAL_BUFFER_HEADER_VIDEO_FLAG_INTERLACED; - omvb->m_encoding = m_dec_output->format->encoding; - { - CSingleLock lock(m_output_mutex); -@@ -841,6 +840,7 @@ bool CMMALVideo::GetPicture(DVDVideoPicture* pDvdVideoPicture) - pDvdVideoPicture->iFlags, buffer->mmal_buffer->flags, pDvdVideoPicture->MMALBuffer, pDvdVideoPicture->MMALBuffer->mmal_buffer); - assert(!(buffer->mmal_buffer->flags & MMAL_BUFFER_HEADER_FLAG_DECODEONLY)); - buffer->mmal_buffer->flags &= ~MMAL_BUFFER_HEADER_FLAG_USER3; -+ buffer->m_stills = m_hints.stills; - } - else - { -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h -index d39dc1ded1511e08556ed1129f58b23df9b1dbdd..1b21fe1a8a26c80dfb83a0af5a6ebd5c9cae42ca 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h -@@ -59,6 +59,7 @@ public: - float m_aspect_ratio; - MMALState m_state; - bool m_rendered; -+ bool m_stills; - const char *GetStateName() { - static const char *names[] = { "MMALStateNone", "MMALStateHWDec", "MMALStateFFDec", "MMALStateDeint", }; - if ((size_t)m_state < vcos_countof(names)) -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp -index 864650d488d0f5b3dc9f89f01aa5c3b845b92564..244dced9d7d5c4a9006a2e5a6d27f80fdf0f497a 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp -@@ -54,6 +54,7 @@ CMMALYUVBuffer::CMMALYUVBuffer(std::shared_ptr pool, uint32_t mmal_en - m_aspect_ratio = 0.0f; - mmal_buffer = nullptr; - m_rendered = false; -+ m_stills = false; - if (m_encoding == MMAL_ENCODING_I420) - size_pic = (m_aligned_width * m_aligned_height * 3) >> 1; - else if (m_encoding == MMAL_ENCODING_YUVUV128) -@@ -93,7 +94,7 @@ CMMALYUVBuffer::~CMMALYUVBuffer() - #undef CLASSNAME - #define CLASSNAME "CDecoder" - --CDecoder::CDecoder(CProcessInfo &processInfo) : m_processInfo(processInfo) -+CDecoder::CDecoder(CProcessInfo &processInfo, CDVDStreamInfo &hints) : m_processInfo(processInfo), m_hints(hints) - { - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s - create %p", CLASSNAME, __FUNCTION__, this); -@@ -289,6 +290,7 @@ bool CDecoder::GetPicture(AVCodecContext* avctx, AVFrame* frame, DVDVideoPicture - assert(picture->MMALBuffer->mmal_buffer); - picture->MMALBuffer->mmal_buffer->data = (uint8_t *)gmem->m_vc_handle; - picture->MMALBuffer->mmal_buffer->alloc_size = picture->MMALBuffer->mmal_buffer->length = gmem->m_numbytes; -+ picture->MMALBuffer->m_stills = m_hints.stills; - - // need to flush ARM cache so GPU can see it (HEVC will have already done this) - if (avctx->codec_id != AV_CODEC_ID_HEVC) -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h -index ffc61612ff3f2fef374cde67111939e4851ccc70..60aff83a3e55f11313d0d9186212e9badbb6d52e 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h -@@ -52,7 +52,7 @@ class CDecoder - : public CDVDVideoCodecFFmpeg::IHardwareDecoder - { - public: -- CDecoder(CProcessInfo& processInfo); -+ CDecoder(CProcessInfo& processInfo, CDVDStreamInfo &hints); - virtual ~CDecoder(); - virtual bool Open(AVCodecContext* avctx, AVCodecContext* mainctx, const enum AVPixelFormat, unsigned int surfaces); - virtual int Decode(AVCodecContext* avctx, AVFrame* frame); -@@ -73,6 +73,7 @@ protected: - CCriticalSection m_section; - std::shared_ptr m_pool; - enum AVPixelFormat m_fmt; -+ CDVDStreamInfo m_hints; - }; - - }; -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -index a0104d9ff67402e74ea8076dd47e9e9bd11a74f1..2f9af729c26f81327a666a59a90f707e53041774 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -@@ -526,6 +526,16 @@ void CMMALRenderer::Run() - if (interlace_method == VS_INTERLACEMETHOD_AUTO) - interlace_method = VS_INTERLACEMETHOD_MMAL_ADVANCED; - bool interlace = (omvb->mmal_buffer->flags & MMAL_BUFFER_HEADER_VIDEO_FLAG_INTERLACED) ? true:false; -+ -+ // advanced deinterlace requires 3 frames of context so disable when showing stills -+ if (omvb->m_stills) -+ { -+ if (interlace_method == VS_INTERLACEMETHOD_MMAL_ADVANCED) -+ interlace_method = VS_INTERLACEMETHOD_MMAL_BOB; -+ if (interlace_method == VS_INTERLACEMETHOD_MMAL_ADVANCED_HALF) -+ interlace_method = VS_INTERLACEMETHOD_MMAL_BOB_HALF; -+ } -+ - // we don't keep up when running at 60fps in the background so switch to half rate - if (!g_graphicsContext.IsFullScreenVideo()) - { - -From 2eff85dc93732ef5fed900a933680fa8ba10f104 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sun, 18 Sep 2016 15:19:02 +0100 -Subject: [PATCH 66/73] MMAL: Move pool into base class - ---- - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp | 2 +- - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h | 11 ++++++----- - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp | 2 +- - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h | 1 - - 4 files changed, 8 insertions(+), 8 deletions(-) - -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -index 1cb76f65a24bf46fe4e3fc1f54e99f284672d80b..d62539aed69306a682d8dc68e410cf7b4a1d6594 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -@@ -59,7 +59,7 @@ using namespace KODI::MESSAGING; - - - CMMALVideoBuffer::CMMALVideoBuffer(CMMALVideo *omv, std::shared_ptr pool) -- : m_omv(omv), m_pool(pool) -+ : CMMALBuffer(pool), m_omv(omv) - { - if (VERBOSE && g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, this); -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h -index 1b21fe1a8a26c80dfb83a0af5a6ebd5c9cae42ca..5c741d340d19b3765f96434ceb54745e4eccdc44 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h -@@ -45,10 +45,15 @@ - - enum MMALState { MMALStateNone, MMALStateHWDec, MMALStateFFDec, MMALStateDeint, }; - -+class CMMALVideo; -+class CMMALRenderer; -+class CMMALPool; -+ - // a mmal video frame - class CMMALBuffer : public IDVDResourceCounted - { - public: -+ CMMALBuffer(std::shared_ptr pool) : m_pool(pool) {} - virtual ~CMMALBuffer() {} - MMAL_BUFFER_HEADER_T *mmal_buffer; - unsigned int m_width; -@@ -60,6 +65,7 @@ public: - MMALState m_state; - bool m_rendered; - bool m_stills; -+ std::shared_ptr m_pool; - const char *GetStateName() { - static const char *names[] = { "MMALStateNone", "MMALStateHWDec", "MMALStateFFDec", "MMALStateDeint", }; - if ((size_t)m_state < vcos_countof(names)) -@@ -69,10 +75,6 @@ public: - } - }; - --class CMMALVideo; --class CMMALRenderer; --class CMMALPool; -- - // a mmal video frame - class CMMALVideoBuffer : public CMMALBuffer - { -@@ -81,7 +83,6 @@ public: - virtual ~CMMALVideoBuffer(); - CMMALVideo *m_omv; - protected: -- std::shared_ptr m_pool; - }; - - class CMMALVideo : public CDVDVideoCodec -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp -index 244dced9d7d5c4a9006a2e5a6d27f80fdf0f497a..b0db2746b6eb51b2222e8f2813b1eb14ff120a2e 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp -@@ -43,7 +43,7 @@ using namespace MMAL; - #define CLASSNAME "CMMALYUVBuffer" - - CMMALYUVBuffer::CMMALYUVBuffer(std::shared_ptr pool, uint32_t mmal_encoding, uint32_t width, uint32_t height, uint32_t aligned_width, uint32_t aligned_height, uint32_t size) -- : m_pool(pool) -+ : CMMALBuffer(pool), m_omv(omv) - { - uint32_t size_pic = 0; - m_width = width; -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h -index 60aff83a3e55f11313d0d9186212e9badbb6d52e..20eab3bed39fa11bd1454f6c6decd4ec601f3bca 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h -@@ -45,7 +45,6 @@ public: - - CGPUMEM *gmem; - private: -- std::shared_ptr m_pool; - }; - - class CDecoder - -From f3cd5d153db54994cebd549bf0181b030978a39e Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sun, 18 Sep 2016 16:20:30 +0100 -Subject: [PATCH 67/73] MMAL: Make setting the decoder more consistent between - MMALCodec and MMALFFMpeg - ---- - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp | 5 +++-- - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h | 3 ++- - .../cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp | 7 ++++--- - xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h | 8 +++++--- - 4 files changed, 14 insertions(+), 9 deletions(-) - -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp -index b0db2746b6eb51b2222e8f2813b1eb14ff120a2e..f20305acaf0ca73a928bc0927129f384c642474a 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp -@@ -42,8 +42,8 @@ using namespace MMAL; - - #define CLASSNAME "CMMALYUVBuffer" - --CMMALYUVBuffer::CMMALYUVBuffer(std::shared_ptr pool, uint32_t mmal_encoding, uint32_t width, uint32_t height, uint32_t aligned_width, uint32_t aligned_height, uint32_t size) -- : CMMALBuffer(pool), m_omv(omv) -+CMMALYUVBuffer::CMMALYUVBuffer(CDecoder *omv, std::shared_ptr pool, uint32_t mmal_encoding, uint32_t width, uint32_t height, uint32_t aligned_width, uint32_t aligned_height, uint32_t size) -+: CMMALBuffer(pool), m_omv(omv) - { - uint32_t size_pic = 0; - m_width = width; -@@ -244,6 +244,7 @@ bool CDecoder::Open(AVCodecContext *avctx, AVCodecContext* mainctx, enum AVPixel - CLog::Log(LOGERROR, "%s::%s Failed to create pool for decoder output", CLASSNAME, __func__); - return false; - } -+ m_pool->SetDecoder(this); - - std::list deintMethods; - deintMethods.push_back(EINTERLACEMETHOD::VS_INTERLACEMETHOD_AUTO); -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h -index 20eab3bed39fa11bd1454f6c6decd4ec601f3bca..b819c249b6c5f5fbb5c1a4ebd9d45fbdf8adb63b 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h -@@ -40,10 +40,11 @@ class CGPUPool; - class CMMALYUVBuffer : public CMMALBuffer - { - public: -- CMMALYUVBuffer(std::shared_ptr pool, uint32_t mmal_encoding, uint32_t width, uint32_t height, uint32_t aligned_width, uint32_t aligned_height, uint32_t size); -+ CMMALYUVBuffer(CDecoder *dec, std::shared_ptr pool, uint32_t mmal_encoding, uint32_t width, uint32_t height, uint32_t aligned_width, uint32_t aligned_height, uint32_t size); - virtual ~CMMALYUVBuffer(); - - CGPUMEM *gmem; -+ CDecoder *m_omv; - private: - }; - -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -index 2f9af729c26f81327a666a59a90f707e53041774..65e09af1c62b011656a15f662a2eb904ed03680e 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -@@ -71,6 +71,7 @@ CMMALPool::CMMALPool(const char *component_name, bool input, uint32_t num_buffer - - m_mmal_pool = mmal_port_pool_create(port, port->buffer_num, port->buffer_size); - m_closing = false; -+ m_software = false; - m_mmal_format = 0; - m_width = 0; - m_height = 0; -@@ -207,14 +208,14 @@ CMMALBuffer *CMMALPool::GetBuffer(uint32_t timeout) - // ffmpeg requirements - uint32_t aligned_width = m_aligned_width, aligned_height = m_aligned_height; - AlignedSize(m_avctx, aligned_width, aligned_height); -- if (m_dec) -+ if (!IsSoftware()) - { -- CMMALVideoBuffer *vid = new CMMALVideoBuffer(m_dec, shared_from_this()); -+ CMMALVideoBuffer *vid = new CMMALVideoBuffer(static_cast(m_dec), shared_from_this()); - omvb = vid; - } - else - { -- MMAL::CMMALYUVBuffer *yuv = new MMAL::CMMALYUVBuffer(shared_from_this(), m_mmal_format, m_width, m_height, aligned_width, aligned_height, m_size); -+ MMAL::CMMALYUVBuffer *yuv = new MMAL::CMMALYUVBuffer(static_cast(m_dec), shared_from_this(), m_mmal_format, m_width, m_height, aligned_width, aligned_height, m_size); - if (yuv) - { - CGPUMEM *gmem = yuv->gmem; -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -index 5d3baa6534a2fe449990402ab805d84423fbc636..b7a61eab678f8aedeff96795c9ba3a06157bb88d 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -@@ -62,13 +62,14 @@ public: - void ReleaseBuffer(CGPUMEM *gmem); - void Close(); - void Prime(); -- void SetDecoder(CMMALVideo *dec) { m_dec = dec; } -+ void SetDecoder(void *dec) { m_dec = dec; } - void SetFormat(uint32_t mmal_format, uint32_t width, uint32_t height, uint32_t aligned_width, uint32_t aligned_height, uint32_t size, AVCodecContext *avctx) -- { m_mmal_format = mmal_format; m_width = width; m_height = height; m_aligned_width = aligned_width; m_aligned_height = aligned_height; m_size = size, m_avctx = avctx; } -+ { m_mmal_format = mmal_format; m_width = width; m_height = height; m_aligned_width = aligned_width; m_aligned_height = aligned_height; m_size = size, m_avctx = avctx; m_software = true; } -+ bool IsSoftware() { return m_software; } - protected: - uint32_t m_mmal_format, m_width, m_height, m_aligned_width, m_aligned_height, m_size; - AVCodecContext *m_avctx; -- CMMALVideo *m_dec; -+ void *m_dec; - MMALState m_state; - bool m_input; - MMAL_POOL_T *m_mmal_pool; -@@ -76,6 +77,7 @@ protected: - CCriticalSection m_section; - std::deque m_freeBuffers; - bool m_closing; -+ bool m_software; - }; - - class CMMALRenderer : public CBaseRenderer, public CThread, public IRunnable - -From dc0a901b361cc7e40ed64d3b77c06a7a5f38a042 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sun, 18 Sep 2016 16:32:45 +0100 -Subject: [PATCH 68/73] MMAL: Set processInfo in pool - ---- - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp | 1 + - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp | 1 + - xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp | 1 + - xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h | 2 ++ - 4 files changed, 5 insertions(+) - -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -index d62539aed69306a682d8dc68e410cf7b4a1d6594..c65fc524273f2b6cc40cf6ff8e8beb8d0bc38440 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -@@ -481,6 +481,7 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) - return false; - } - m_pool->SetDecoder(this); -+ m_pool->SetProcessInfo(&m_processInfo); - m_dec = m_pool->GetComponent(); - - m_dec->control->userdata = (struct MMAL_PORT_USERDATA_T *)this; -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp -index f20305acaf0ca73a928bc0927129f384c642474a..d42e3090c9b38a43ee72fdc3780a244317ece11a 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp -@@ -245,6 +245,7 @@ bool CDecoder::Open(AVCodecContext *avctx, AVCodecContext* mainctx, enum AVPixel - return false; - } - m_pool->SetDecoder(this); -+ m_pool->SetProcessInfo(&m_processInfo); - - std::list deintMethods; - deintMethods.push_back(EINTERLACEMETHOD::VS_INTERLACEMETHOD_AUTO); -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -index 65e09af1c62b011656a15f662a2eb904ed03680e..297fca290f7d66b1eecad4da834865821864b53d 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -@@ -72,6 +72,7 @@ CMMALPool::CMMALPool(const char *component_name, bool input, uint32_t num_buffer - m_mmal_pool = mmal_port_pool_create(port, port->buffer_num, port->buffer_size); - m_closing = false; - m_software = false; -+ m_processInfo = nullptr; - m_mmal_format = 0; - m_width = 0; - m_height = 0; -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -index b7a61eab678f8aedeff96795c9ba3a06157bb88d..b7621a8cf37907d544987b06dd4528eed468abc0 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -@@ -63,6 +63,7 @@ public: - void Close(); - void Prime(); - void SetDecoder(void *dec) { m_dec = dec; } -+ void SetProcessInfo(CProcessInfo *processInfo) { m_processInfo = processInfo; } - void SetFormat(uint32_t mmal_format, uint32_t width, uint32_t height, uint32_t aligned_width, uint32_t aligned_height, uint32_t size, AVCodecContext *avctx) - { m_mmal_format = mmal_format; m_width = width; m_height = height; m_aligned_width = aligned_width; m_aligned_height = aligned_height; m_size = size, m_avctx = avctx; m_software = true; } - bool IsSoftware() { return m_software; } -@@ -78,6 +79,7 @@ protected: - std::deque m_freeBuffers; - bool m_closing; - bool m_software; -+ CProcessInfo *m_processInfo; - }; - - class CMMALRenderer : public CBaseRenderer, public CThread, public IRunnable - -From f9fcf79aa64dec676674a0237f15db390a225bce Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sun, 18 Sep 2016 18:35:55 +0100 -Subject: [PATCH 69/73] MMAL: Report deinterlace method to processinfo overlay - ---- - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp | 3 +-- - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h | 1 + - .../VideoRenderers/HwDecRender/MMALRenderer.cpp | 19 ++++++++++++++++++- - .../VideoRenderers/HwDecRender/MMALRenderer.h | 1 + - 4 files changed, 21 insertions(+), 3 deletions(-) - -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -index c65fc524273f2b6cc40cf6ff8e8beb8d0bc38440..1aca23f755ce273ca1e5e4ffdd8be02897e2304a 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -@@ -57,6 +57,7 @@ using namespace KODI::MESSAGING; - - #define VERBOSE 0 - -+void CMMALBuffer::SetVideoDeintMethod(std::string method) { if (m_pool) m_pool->SetVideoDeintMethod(method); } - - CMMALVideoBuffer::CMMALVideoBuffer(CMMALVideo *omv, std::shared_ptr pool) - : CMMALBuffer(pool), m_omv(omv) -@@ -376,8 +377,6 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) - if (hints.workaround_bugs & FF_BUG_GMC_UNSUPPORTED) - return false; - -- m_processInfo.SetVideoDeintMethod("none"); -- - std::list deintMethods; - deintMethods.push_back(EINTERLACEMETHOD::VS_INTERLACEMETHOD_AUTO); - deintMethods.push_back(EINTERLACEMETHOD::VS_INTERLACEMETHOD_MMAL_ADVANCED); -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h -index 5c741d340d19b3765f96434ceb54745e4eccdc44..baff1f031149da5d669536711cc0057b2db078e3 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h -@@ -66,6 +66,7 @@ public: - bool m_rendered; - bool m_stills; - std::shared_ptr m_pool; -+ void SetVideoDeintMethod(std::string method); - const char *GetStateName() { - static const char *names[] = { "MMALStateNone", "MMALStateHWDec", "MMALStateFFDec", "MMALStateDeint", }; - if ((size_t)m_state < vcos_countof(names)) -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -index 297fca290f7d66b1eecad4da834865821864b53d..a9566eb810c3b890ddbaa5651333cf4c547aa953 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -@@ -524,6 +524,7 @@ void CMMALRenderer::Run() - { - if (buffer->length > 0) - { -+ EINTERLACEMETHOD last_interlace_method = m_interlace_method; - EINTERLACEMETHOD interlace_method = CMediaSettings::GetInstance().GetCurrentVideoSettings().m_InterlaceMethod; - if (interlace_method == VS_INTERLACEMETHOD_AUTO) - interlace_method = VS_INTERLACEMETHOD_MMAL_ADVANCED; -@@ -555,6 +556,22 @@ void CMMALRenderer::Run() - else if (m_deint_input || interlace) - CheckConfigurationDeint(omvb->m_width, omvb->m_height, omvb->m_aligned_width, omvb->m_aligned_height, omvb->m_encoding, interlace_method); - -+ if (!m_deint_input) -+ m_interlace_method = VS_INTERLACEMETHOD_NONE; -+ -+ if (last_interlace_method == m_interlace_method) -+ ; -+ else if (m_interlace_method == VS_INTERLACEMETHOD_MMAL_ADVANCED) -+ omvb->SetVideoDeintMethod("adv(x2)"); -+ else if (m_interlace_method == VS_INTERLACEMETHOD_MMAL_ADVANCED_HALF) -+ omvb->SetVideoDeintMethod("adv(x1)"); -+ else if (m_interlace_method == VS_INTERLACEMETHOD_MMAL_BOB) -+ omvb->SetVideoDeintMethod("bob(x2)"); -+ else if (m_interlace_method == VS_INTERLACEMETHOD_MMAL_BOB_HALF) -+ omvb->SetVideoDeintMethod("bob(x1)"); -+ else -+ omvb->SetVideoDeintMethod("none"); -+ - if (m_deint_input) - { - MMAL_STATUS_T status = mmal_port_send_buffer(m_deint_input, omvb->mmal_buffer); -@@ -1150,7 +1167,7 @@ void CMMALRenderer::DestroyDeinterlace() - CLog::Log(LOGERROR, "%s::%s Failed to disable deinterlace output port(status=%x %s)", CLASSNAME, __func__, status, mmal_status_to_string(status)); - } - m_deint_output = nullptr; -- m_interlace_method = VS_INTERLACEMETHOD_NONE; -+ m_interlace_method = VS_INTERLACEMETHOD_MAX; - m_deint_width = 0; - m_deint_height = 0; - m_deint_aligned_width = 0; -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -index b7621a8cf37907d544987b06dd4528eed468abc0..5758deba4d5d30662507968ac7af0fb0497ae35e 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -@@ -67,6 +67,7 @@ public: - void SetFormat(uint32_t mmal_format, uint32_t width, uint32_t height, uint32_t aligned_width, uint32_t aligned_height, uint32_t size, AVCodecContext *avctx) - { m_mmal_format = mmal_format; m_width = width; m_height = height; m_aligned_width = aligned_width; m_aligned_height = aligned_height; m_size = size, m_avctx = avctx; m_software = true; } - bool IsSoftware() { return m_software; } -+ void SetVideoDeintMethod(std::string method) { if (m_processInfo) m_processInfo->SetVideoDeintMethod(method); } - protected: - uint32_t m_mmal_format, m_width, m_height, m_aligned_width, m_aligned_height, m_size; - AVCodecContext *m_avctx; - -From 85dc8a110e932cb99d9ae5f1366a2d683274ebb5 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Mon, 19 Sep 2016 19:56:07 +0100 -Subject: [PATCH 70/73] MMALRenderer: Ensure updated aspect ratio is seen in - the case of a single still frame - ---- - .../VideoRenderers/HwDecRender/MMALRenderer.cpp | 15 +++++++++++---- - .../VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h | 2 ++ - 2 files changed, 13 insertions(+), 4 deletions(-) - -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -index a9566eb810c3b890ddbaa5651333cf4c547aa953..81dd06167b65ab8c29300d68f3138fd0bb7f6a48 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -@@ -388,6 +388,7 @@ bool CMMALRenderer::CheckConfigurationVout(uint32_t width, uint32_t height, uint - Create(); - } - } -+ SetVideoRect(m_cachedSourceRect, m_cachedDestRect); - return true; - } - -@@ -417,6 +418,8 @@ CMMALRenderer::CMMALRenderer() : CThread("MMALRenderer"), m_processThread(this, - m_deint_height = 0; - m_deint_aligned_width = 0; - m_deint_aligned_height = 0; -+ m_cachedSourceRect.SetRect(0, 0, 0, 0); -+ m_cachedDestRect.SetRect(0, 0, 0, 0); - - m_queue_process = mmal_queue_create(); - m_processThread.Create(); -@@ -770,16 +773,22 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) - if (m_format == RENDER_FMT_MMAL) - omvb = m_buffers[source]; - -+ if (g_graphicsContext.GetStereoView() != RENDER_STEREO_VIEW_RIGHT) -+ { -+ ManageRenderArea(); -+ CRect view; -+ CBaseRenderer::GetVideoRect(m_cachedSourceRect, m_cachedDestRect, view); -+ } -+ - // we only want to upload frames once - if (omvb && omvb->m_rendered) - { - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s - MMAL: clear:%d flags:%x alpha:%d source:%d omvb:%p mmal:%p mflags:%x skipping", CLASSNAME, __func__, clear, flags, alpha, source, omvb, omvb->mmal_buffer, omvb->mmal_buffer->flags); -+ SetVideoRect(m_cachedSourceRect, m_cachedDestRect); - goto exit; - } - -- ManageRenderArea(); -- - // if sharpness setting has changed, we should update it - if (m_sharpness != CMediaSettings::GetInstance().GetCurrentVideoSettings().m_Sharpness) - { -@@ -795,7 +804,6 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) - CLog::Log(LOGDEBUG, "%s::%s - bypass: clear:%d flags:%x alpha:%d source:%d format:%d", CLASSNAME, __func__, clear, flags, alpha, source, m_format); - goto exit; - } -- SetVideoRect(m_sourceRect, m_destRect); - - if (omvb && omvb->mmal_buffer) - { -@@ -981,7 +989,6 @@ bool CMMALRenderer::Supports(ESCALINGMETHOD method) - void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect) - { - CSingleLock lock(m_sharedSection); -- assert(g_graphicsContext.GetStereoView() != RENDER_STEREO_VIEW_RIGHT); - - if (!m_vout_input) - return; -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -index 5758deba4d5d30662507968ac7af0fb0497ae35e..a2af6d5fd0f5fa6736cb3ca31ee6c778fa78e3f7 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -@@ -133,6 +133,8 @@ protected: - unsigned int m_extended_format; - int m_neededBuffers; - -+ CRect m_cachedSourceRect; -+ CRect m_cachedDestRect; - CRect m_src_rect; - CRect m_dst_rect; - RENDER_STEREO_MODE m_video_stereo_mode; - -From db293141be4e15f5d567d82fe151f2e2ede82aa1 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Tue, 19 Jul 2016 20:37:46 +0100 -Subject: [PATCH 71/73] mmalrender: Use computed framerate rather than version - from configure - ---- - .../VideoRenderers/HwDecRender/MMALRenderer.cpp | 58 ++++++++++++++++++++-- - .../VideoRenderers/HwDecRender/MMALRenderer.h | 5 +- - 2 files changed, 57 insertions(+), 6 deletions(-) - -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -index 81dd06167b65ab8c29300d68f3138fd0bb7f6a48..d3ddcdeea8a71f9c24656c0ff2f7f95e7e845906 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -@@ -34,6 +34,7 @@ - #include "cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h" - #include "xbmc/Application.h" - #include "linux/RBP.h" -+#include "cores/VideoPlayer/DVDClock.h" - - extern "C" { - #include "libavutil/imgutils.h" -@@ -405,6 +406,10 @@ CMMALRenderer::CMMALRenderer() : CThread("MMALRenderer"), m_processThread(this, - m_queue_render = nullptr; - m_queue_process = nullptr; - m_error = 0.0; -+ m_fps = 0.0; -+ m_lastPts = DVD_NOPTS_VALUE; -+ m_frameInterval = 0.0; -+ m_frameIntervalDiff = 1e5; - m_vsync_count = ~0U; - m_sharpness = -2.0f; - m_vout_width = 0; -@@ -452,14 +457,32 @@ void CMMALRenderer::Process() - CLog::Log(LOGDEBUG, "%s::%s - starting", CLASSNAME, __func__); - while (!bStop) - { -- g_RBP.WaitVsync(); - double dfps = g_graphicsContext.GetFPS(); -- if (dfps <= 0.0) -- dfps = m_fps; -+ double fps = 0.0; -+ double inc = 1.0; -+ g_RBP.WaitVsync(); -+ -+ CSingleLock lock(m_sharedSection); -+ // if good enough framerate measure then use it -+ if (dfps > 0.0 && m_frameInterval > 0.0 && m_frameIntervalDiff * 1e-6 < 1e-3) -+ { -+ fps = 1e6 / m_frameInterval; -+ inc = fps / dfps; -+ if (fabs(inc - 1.0) < 1e-2) -+ inc = 1.0; -+ else if (fabs(inc - 0.5) < 1e-2) -+ inc = 0.5; -+ else if (fabs(inc - 24.0/60.0) < 1e-2) -+ inc = 24.0/60.0; -+ if (m_deint) -+ inc *= 2.0; -+ } - // This algorithm is basically making the decision according to Bresenham's line algorithm. Imagine drawing a line where x-axis is display frames, and y-axis is video frames -- m_error += m_fps / dfps; -+ m_error += inc; -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s - debug vsync:%d queue:%d fps:%.2f/%.2f/%.2f inc:%f diff:%f", CLASSNAME, __func__, g_RBP.LastVsync(), mmal_queue_length(m_queue_render), fps, m_fps, dfps, inc, m_error); - // we may need to discard frames if queue length gets too high or video frame rate is above display frame rate -- while (mmal_queue_length(m_queue_render) > 2 || m_error > 1.0) -+ while (mmal_queue_length(m_queue_render) > 2 || (mmal_queue_length(m_queue_render) > 1 && m_error > 1.0)) - { - if (m_error > 1.0) - m_error -= 1.0; -@@ -655,6 +678,26 @@ void CMMALRenderer::Run() - CLog::Log(LOGDEBUG, "%s::%s - stopping", CLASSNAME, __func__); - } - -+void CMMALRenderer::UpdateFramerateStats(double pts) -+{ -+ double diff = 0.0; -+ if (m_lastPts != DVD_NOPTS_VALUE && pts != DVD_NOPTS_VALUE && pts - m_lastPts > 0.0 && pts - m_lastPts < DVD_SEC_TO_TIME(1./20.0)) -+ { -+ diff = pts - m_lastPts; -+ if (m_frameInterval == 0.0) -+ m_frameInterval = diff; -+ else if (diff > 0.0) -+ { -+ m_frameIntervalDiff = m_frameIntervalDiff * 0.9 + 0.1 * fabs(m_frameInterval - diff); -+ m_frameInterval = m_frameInterval * 0.9 + diff * 0.1; -+ } -+ } -+ if (pts != DVD_NOPTS_VALUE) -+ m_lastPts = pts; -+ if (VERBOSE && g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s pts:%.3f diff:%.3f m_frameInterval:%.6f m_frameIntervalDiff:%.6f", CLASSNAME, __func__, pts*1e-6, diff * 1e-6 , m_frameInterval * 1e-6, m_frameIntervalDiff *1e-6); -+} -+ - void CMMALRenderer::AddVideoPictureHW(DVDVideoPicture& pic, int index) - { - if (m_format != RENDER_FMT_MMAL) -@@ -669,6 +712,7 @@ void CMMALRenderer::AddVideoPictureHW(DVDVideoPicture& pic, int index) - CLog::Log(LOGDEBUG, "%s::%s MMAL - %p (%p) %i", CLASSNAME, __func__, buffer, buffer->mmal_buffer, index); - - m_buffers[index] = buffer->Acquire(); -+ UpdateFramerateStats(pic.pts); - } - - bool CMMALRenderer::Configure(unsigned int width, unsigned int height, unsigned int d_width, unsigned int d_height, float fps, unsigned flags, ERenderFormat format, unsigned extended_format, unsigned int orientation) -@@ -682,6 +726,10 @@ bool CMMALRenderer::Configure(unsigned int width, unsigned int height, unsigned - - m_fps = fps; - m_iFlags = flags; -+ m_error = 0.0; -+ m_lastPts = DVD_NOPTS_VALUE; -+ m_frameInterval = 0.0; -+ m_frameIntervalDiff = 1e5; - - // cause SetVideoRect to trigger - needed after a hdmi mode change - m_src_rect.SetRect(0, 0, 0, 0); -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -index a2af6d5fd0f5fa6736cb3ca31ee6c778fa78e3f7..69eae6cbef0131d20dc979dcb35915cd73967592 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -@@ -150,7 +150,9 @@ protected: - CThread m_processThread; - MMAL_BUFFER_HEADER_T m_quitpacket; - double m_error; -- -+ double m_lastPts; -+ double m_frameInterval; -+ double m_frameIntervalDiff; - uint32_t m_vout_width, m_vout_height, m_vout_aligned_width, m_vout_aligned_height; - // deinterlace - MMAL_COMPONENT_T *m_deint; -@@ -168,5 +170,6 @@ protected: - uint32_t m_vsync_count; - void ReleaseBuffers(); - void UnInitMMAL(); -+ void UpdateFramerateStats(double pts); - virtual void Run() override; - }; - -From e2e4983038147c5a0c104ed51c9a11eef1c787a0 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 13 Oct 2016 19:31:46 +0100 -Subject: [PATCH 72/73] MMALRender: Switch to deinterlace mode where frame - flags are exclusively used - -Ensures non-interlace frames are not deinterlaced when stream switches from interlaced to progressive -with software decode ---- - xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -index d3ddcdeea8a71f9c24656c0ff2f7f95e7e845906..2f1e5bfc280ca1d608650ae97dc7df3d8d5a438c 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -@@ -1338,7 +1338,7 @@ bool CMMALRenderer::CheckConfigurationDeint(uint32_t width, uint32_t height, uin - if (m_deint_output && (sizeChanged || deinterlaceChanged || encodingChanged)) - { - MMAL_PARAMETER_IMAGEFX_PARAMETERS_T imfx_param = {{MMAL_PARAMETER_IMAGE_EFFECT_PARAMETERS, sizeof(imfx_param)}, -- advanced_deinterlace ? MMAL_PARAM_IMAGEFX_DEINTERLACE_ADV : MMAL_PARAM_IMAGEFX_DEINTERLACE_FAST, 4, {3, 0, half_framerate, 1 }}; -+ advanced_deinterlace ? MMAL_PARAM_IMAGEFX_DEINTERLACE_ADV : MMAL_PARAM_IMAGEFX_DEINTERLACE_FAST, 4, {5, 0, half_framerate, 1 }}; - - status = mmal_port_parameter_set(m_deint_output, &imfx_param.hdr); - if (status != MMAL_SUCCESS) - -From ee966fcdd5219fc0ab777c9ad50d0e045d69f359 Mon Sep 17 00:00:00 2001 +From 60198462cb88a0e0bcee714c4d3d0b418b01af76 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 14 Oct 2016 15:37:53 +0100 -Subject: [PATCH 73/73] MMALFFMpeg: Report as SW decode in codec overlay info +Subject: [PATCH 62/63] MMALFFMpeg: Report as SW decode in codec overlay info --- xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index ec2cc3d867d446a748024ce85e079aea8451fb85..e180ba5b73fe9a521a585722d3959291e919c375 100644 +index 619515c9411172261d8f0bef24c5d679c35e5d7d..b31c984c0a507891f2754146a4c62802f0096505 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp @@ -579,7 +579,7 @@ void CDVDVideoCodecFFmpeg::UpdateName() @@ -54034,3 +52186,99 @@ index ec2cc3d867d446a748024ce85e079aea8451fb85..e180ba5b73fe9a521a585722d3959291 CLog::Log(LOGDEBUG, "CDVDVideoCodecFFmpeg - Updated codec: %s", m_name.c_str()); } + +From 7d4c324285dbe6d3a90c6f379178388841395f66 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 8 Nov 2016 17:29:02 +0000 +Subject: [PATCH 63/63] MMALRender: Reduce log spam + +--- + xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp | 4 ++-- + xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp | 6 ++++-- + .../cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp | 8 +++++--- + 3 files changed, 11 insertions(+), 7 deletions(-) + +diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp +index 2257c94a6b095d9b0926c418c1faaf2ebfadf088..dca872373080156100618d58d9782e2461fa2648 100644 +--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp ++++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp +@@ -224,7 +224,7 @@ static void dec_input_port_cb_static(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *bu + void CMMALVideo::dec_output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer) + { + if (!(buffer->cmd == 0 && buffer->length > 0)) +- if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ if (VERBOSE && g_advancedSettings.CanLogComponent(LOGVIDEO)) + CLog::Log(LOGDEBUG, "%s::%s port:%p buffer %p, len %d cmd:%x flags:%x", CLASSNAME, __func__, port, buffer, buffer->length, buffer->cmd, buffer->flags); + + bool kept = false; +@@ -617,7 +617,7 @@ void CMMALVideo::Dispose() + + void CMMALVideo::SetDropState(bool bDrop) + { +- if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ if (bDrop != m_dropState) + CLog::Log(LOGDEBUG, "%s::%s - bDrop(%d)", CLASSNAME, __func__, bDrop); + m_dropState = bDrop; + } +diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp +index d42e3090c9b38a43ee72fdc3780a244317ece11a..c0b3f19f2ef9cdef9adf00cf81154803b12feb4f 100644 +--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp ++++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp +@@ -42,6 +42,8 @@ using namespace MMAL; + + #define CLASSNAME "CMMALYUVBuffer" + ++#define VERBOSE 0 ++ + CMMALYUVBuffer::CMMALYUVBuffer(CDecoder *omv, std::shared_ptr pool, uint32_t mmal_encoding, uint32_t width, uint32_t height, uint32_t aligned_width, uint32_t aligned_height, uint32_t size) + : CMMALBuffer(pool), m_omv(omv) + { +@@ -72,13 +74,13 @@ CMMALYUVBuffer::CMMALYUVBuffer(CDecoder *omv, std::shared_ptr pool, u + gmem = m_pool->AllocateBuffer(size_pic); + if (gmem) + gmem->m_opaque = (void *)this; +- if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ if (VERBOSE && g_advancedSettings.CanLogComponent(LOGVIDEO)) + CLog::Log(LOGDEBUG, "%s::%s buf:%p gmem:%p mmal:%p %dx%d (%dx%d) size:%d %.4s", CLASSNAME, __FUNCTION__, this, gmem, mmal_buffer, m_width, m_height, m_aligned_width, m_aligned_height, gmem->m_numbytes, (char *)&m_encoding); + } + + CMMALYUVBuffer::~CMMALYUVBuffer() + { +- if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ if (VERBOSE && g_advancedSettings.CanLogComponent(LOGVIDEO)) + CLog::Log(LOGDEBUG, "%s::%s buf:%p gmem:%p mmal:%p %dx%d (%dx%d) size:%d %.4s", CLASSNAME, __FUNCTION__, this, gmem, mmal_buffer, m_width, m_height, m_aligned_width, m_aligned_height, gmem->m_numbytes, (char *)&m_encoding); + if (gmem) + m_pool->ReleaseBuffer(gmem); +diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp +index 0b73b7700ce8a63932d3fa3b90dda8cf80ac527c..f5f0f0d01227b3b4dcebb4a22a54dbcaac2d5ee9 100644 +--- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp ++++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp +@@ -638,7 +638,8 @@ void CMMALRenderer::Run() + if (m_queue_render) + { + mmal_queue_put(m_queue_render, buffer); +- CLog::Log(LOGDEBUG, "%s::%s send %p to m_queue_render", CLASSNAME, __func__, omvb); ++ if (VERBOSE && g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s send %p to m_queue_render", CLASSNAME, __func__, omvb); + kept = true; + } + else +@@ -646,7 +647,8 @@ void CMMALRenderer::Run() + CheckConfigurationVout(omvb->m_width, omvb->m_height, omvb->m_aligned_width, omvb->m_aligned_height, omvb->m_encoding); + if (m_vout_input) + { +- CLog::Log(LOGDEBUG, "%s::%s send %p to m_vout_input", CLASSNAME, __func__, omvb); ++ if (VERBOSE && g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s send %p to m_vout_input", CLASSNAME, __func__, omvb); + MMAL_STATUS_T status = mmal_port_send_buffer(m_vout_input, buffer); + if (status != MMAL_SUCCESS) + CLog::Log(LOGERROR, "%s::%s - Failed to send buffer %p to %s (status=0%x %s)", CLASSNAME, __func__, buffer, m_vout_input->name, status, mmal_status_to_string(status)); +@@ -765,7 +767,7 @@ int CMMALRenderer::GetImage(YV12Image *image, int source, bool readonly) + CLog::Log(LOGDEBUG, "%s::%s - invalid: format:%d image:%p source:%d ro:%d", CLASSNAME, __func__, m_format, image, source, readonly); + return -1; + } +- if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ if (VERBOSE && g_advancedSettings.CanLogComponent(LOGVIDEO)) + CLog::Log(LOGDEBUG, "%s::%s - MMAL: image:%p source:%d ro:%d", CLASSNAME, __func__, image, source, readonly); + return source; + } diff --git a/projects/RPi2/patches/kodi/kodi-001-backport.patch b/projects/RPi2/patches/kodi/kodi-001-backport.patch index be742b6ec4..b84fadf6ce 100644 --- a/projects/RPi2/patches/kodi/kodi-001-backport.patch +++ b/projects/RPi2/patches/kodi/kodi-001-backport.patch @@ -1,146 +1,273 @@ -From 8d1013867be79401fbf6031a77c9559836300481 Mon Sep 17 00:00:00 2001 +From 78147d45acfa1e8416b3c86888aaf68d64bb584e Mon Sep 17 00:00:00 2001 From: popcornmix -Date: Tue, 5 May 2015 17:27:39 +0100 -Subject: [PATCH 01/73] build: Allow installed links to be overwritten +Date: Fri, 11 Nov 2016 14:03:29 +0000 +Subject: [PATCH 01/63] cec: fixup strings after PR 10775 --- - tools/depends/target/Makefile | 72 +++++++++++++++++++-------------------- - tools/depends/xbmc-addons.include | 36 ++++++++++---------- - 2 files changed, 54 insertions(+), 54 deletions(-) + system/peripherals.xml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) -diff --git a/tools/depends/target/Makefile b/tools/depends/target/Makefile -index c35e4849aa2651868e06046d397e0c3126b6b829..9bca1889b127a690082c2fb55625fc9a385a97d1 100644 ---- a/tools/depends/target/Makefile -+++ b/tools/depends/target/Makefile -@@ -130,41 +130,41 @@ distclean:: - for d in $(DEPENDS); do $(MAKE) -C $$d distclean; done - - linux-system-libs-egl: -- [ -f $(PREFIX)/lib/pkgconfig/egl.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/egl.pc $(PREFIX)/lib/pkgconfig/egl.pc -- [ -f $(PREFIX)/lib/pkgconfig/damageproto.pc ] || ln -s /usr/share/pkgconfig/damageproto.pc $(PREFIX)/lib/pkgconfig/damageproto.pc -- [ -f $(PREFIX)/lib/pkgconfig/fixesproto.pc ] || ln -s /usr/share/pkgconfig/fixesproto.pc $(PREFIX)/lib/pkgconfig/fixesproto.pc -- [ -f $(PREFIX)/lib/pkgconfig/x11-xcb.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/x11-xcb.pc $(PREFIX)/lib/pkgconfig/x11-xcb.pc -- [ -f $(PREFIX)/lib/pkgconfig/xcb-dri2.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xcb-dri2.pc $(PREFIX)/lib/pkgconfig/xcb-dri2.pc -- [ -f $(PREFIX)/lib/pkgconfig/xcb-dri3.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xcb-dri3.pc $(PREFIX)/lib/pkgconfig/xcb-dri3.pc -- [ -f $(PREFIX)/lib/pkgconfig/xcb-glx.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xcb-glx.pc $(PREFIX)/lib/pkgconfig/xcb-glx.pc -- [ -f $(PREFIX)/lib/pkgconfig/xcb-xfixes.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xcb-xfixes.pc $(PREFIX)/lib/pkgconfig/xcb-xfixes.pc -- [ -f $(PREFIX)/lib/pkgconfig/xcb-present.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xcb-present.pc $(PREFIX)/lib/pkgconfig/xcb-present.pc -- [ -f $(PREFIX)/lib/pkgconfig/xcb-randr.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xcb-randr.pc $(PREFIX)/lib/pkgconfig/xcb-randr.pc -- [ -f $(PREFIX)/lib/pkgconfig/xcb-render.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xcb-render.pc $(PREFIX)/lib/pkgconfig/xcb-render.pc -- [ -f $(PREFIX)/lib/pkgconfig/xcb-shape.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xcb-shape.pc $(PREFIX)/lib/pkgconfig/xcb-shape.pc -- [ -f $(PREFIX)/lib/pkgconfig/xcb-sync.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xcb-sync.pc $(PREFIX)/lib/pkgconfig/xcb-sync.pc -- [ -f $(PREFIX)/lib/pkgconfig/xdamage.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xdamage.pc $(PREFIX)/lib/pkgconfig/xdamage.pc -- [ -f $(PREFIX)/lib/pkgconfig/xf86vidmodeproto.pc ] || ln -s /usr/share/pkgconfig/xf86vidmodeproto.pc $(PREFIX)/lib/pkgconfig/xf86vidmodeproto.pc -- [ -f $(PREFIX)/lib/pkgconfig/xfixes.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xfixes.pc $(PREFIX)/lib/pkgconfig/xfixes.pc -- [ -f $(PREFIX)/lib/pkgconfig/xshmfence.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xshmfence.pc $(PREFIX)/lib/pkgconfig/xshmfence.pc -- [ -f $(PREFIX)/lib/pkgconfig/xxf86vm.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xxf86vm.pc $(PREFIX)/lib/pkgconfig/xxf86vm.pc -+ [ -f $(PREFIX)/lib/pkgconfig/egl.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/egl.pc $(PREFIX)/lib/pkgconfig/egl.pc -+ [ -f $(PREFIX)/lib/pkgconfig/damageproto.pc ] || ln -sf /usr/share/pkgconfig/damageproto.pc $(PREFIX)/lib/pkgconfig/damageproto.pc -+ [ -f $(PREFIX)/lib/pkgconfig/fixesproto.pc ] || ln -sf /usr/share/pkgconfig/fixesproto.pc $(PREFIX)/lib/pkgconfig/fixesproto.pc -+ [ -f $(PREFIX)/lib/pkgconfig/x11-xcb.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/x11-xcb.pc $(PREFIX)/lib/pkgconfig/x11-xcb.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xcb-dri2.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xcb-dri2.pc $(PREFIX)/lib/pkgconfig/xcb-dri2.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xcb-dri3.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xcb-dri3.pc $(PREFIX)/lib/pkgconfig/xcb-dri3.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xcb-glx.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xcb-glx.pc $(PREFIX)/lib/pkgconfig/xcb-glx.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xcb-xfixes.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xcb-xfixes.pc $(PREFIX)/lib/pkgconfig/xcb-xfixes.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xcb-present.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xcb-present.pc $(PREFIX)/lib/pkgconfig/xcb-present.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xcb-randr.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xcb-randr.pc $(PREFIX)/lib/pkgconfig/xcb-randr.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xcb-render.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xcb-render.pc $(PREFIX)/lib/pkgconfig/xcb-render.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xcb-shape.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xcb-shape.pc $(PREFIX)/lib/pkgconfig/xcb-shape.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xcb-sync.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xcb-sync.pc $(PREFIX)/lib/pkgconfig/xcb-sync.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xdamage.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xdamage.pc $(PREFIX)/lib/pkgconfig/xdamage.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xf86vidmodeproto.pc ] || ln -sf /usr/share/pkgconfig/xf86vidmodeproto.pc $(PREFIX)/lib/pkgconfig/xf86vidmodeproto.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xfixes.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xfixes.pc $(PREFIX)/lib/pkgconfig/xfixes.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xshmfence.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xshmfence.pc $(PREFIX)/lib/pkgconfig/xshmfence.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xxf86vm.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xxf86vm.pc $(PREFIX)/lib/pkgconfig/xxf86vm.pc - - linux-system-libs: linux-system-libs-egl -- [ -f $(PREFIX)/lib/pkgconfig/x11.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/x11.pc $(PREFIX)/lib/pkgconfig/x11.pc -- [ -f $(PREFIX)/lib/pkgconfig/xproto.pc ] || ln -s /usr/share/pkgconfig/xproto.pc $(PREFIX)/lib/pkgconfig/xproto.pc -- [ -f $(PREFIX)/lib/pkgconfig/kbproto.pc ] || ln -s /usr/share/pkgconfig/kbproto.pc $(PREFIX)/lib/pkgconfig/kbproto.pc -- [ -f $(PREFIX)/lib/pkgconfig/xcb.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xcb.pc $(PREFIX)/lib/pkgconfig/xcb.pc -- [ -f $(PREFIX)/lib/pkgconfig/pthread-stubs.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/pthread-stubs.pc $(PREFIX)/lib/pkgconfig/pthread-stubs.pc -- [ -f $(PREFIX)/lib/pkgconfig/xau.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xau.pc $(PREFIX)/lib/pkgconfig/xau.pc -- [ -f $(PREFIX)/lib/pkgconfig/xdmcp.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xdmcp.pc $(PREFIX)/lib/pkgconfig/xdmcp.pc -- [ -f $(PREFIX)/lib/pkgconfig/xext.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xext.pc $(PREFIX)/lib/pkgconfig/xext.pc -- [ -f $(PREFIX)/lib/pkgconfig/xextproto.pc ] || ln -s /usr/share/pkgconfig/xextproto.pc $(PREFIX)/lib/pkgconfig/xextproto.pc -- [ -f $(PREFIX)/lib/pkgconfig/xrandr.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xrandr.pc $(PREFIX)/lib/pkgconfig/xrandr.pc -- [ -f $(PREFIX)/lib/pkgconfig/xrender.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xrender.pc $(PREFIX)/lib/pkgconfig/xrender.pc -- [ -f $(PREFIX)/lib/pkgconfig/randrproto.pc ] || ln -s /usr/share/pkgconfig/randrproto.pc $(PREFIX)/lib/pkgconfig/randrproto.pc -- [ -f $(PREFIX)/lib/pkgconfig/renderproto.pc ] || ln -s /usr/share/pkgconfig/renderproto.pc $(PREFIX)/lib/pkgconfig/renderproto.pc -- [ -f $(PREFIX)/lib/pkgconfig/xt.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xt.pc $(PREFIX)/lib/pkgconfig/xt.pc -- [ -f $(PREFIX)/lib/pkgconfig/ice.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/ice.pc $(PREFIX)/lib/pkgconfig/ice.pc -- [ -f $(PREFIX)/lib/pkgconfig/sm.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/sm.pc $(PREFIX)/lib/pkgconfig/sm.pc -- [ -f $(PREFIX)/lib/pkgconfig/xmu.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xmu.pc $(PREFIX)/lib/pkgconfig/xmu.pc -- [ -f $(PREFIX)/lib/pkgconfig/libdrm.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/libdrm.pc $(PREFIX)/lib/pkgconfig/libdrm.pc -+ [ -f $(PREFIX)/lib/pkgconfig/x11.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/x11.pc $(PREFIX)/lib/pkgconfig/x11.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xproto.pc ] || ln -sf /usr/share/pkgconfig/xproto.pc $(PREFIX)/lib/pkgconfig/xproto.pc -+ [ -f $(PREFIX)/lib/pkgconfig/kbproto.pc ] || ln -sf /usr/share/pkgconfig/kbproto.pc $(PREFIX)/lib/pkgconfig/kbproto.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xcb.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xcb.pc $(PREFIX)/lib/pkgconfig/xcb.pc -+ [ -f $(PREFIX)/lib/pkgconfig/pthread-stubs.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/pthread-stubs.pc $(PREFIX)/lib/pkgconfig/pthread-stubs.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xau.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xau.pc $(PREFIX)/lib/pkgconfig/xau.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xdmcp.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xdmcp.pc $(PREFIX)/lib/pkgconfig/xdmcp.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xext.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xext.pc $(PREFIX)/lib/pkgconfig/xext.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xextproto.pc ] || ln -sf /usr/share/pkgconfig/xextproto.pc $(PREFIX)/lib/pkgconfig/xextproto.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xrandr.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xrandr.pc $(PREFIX)/lib/pkgconfig/xrandr.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xrender.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xrender.pc $(PREFIX)/lib/pkgconfig/xrender.pc -+ [ -f $(PREFIX)/lib/pkgconfig/randrproto.pc ] || ln -sf /usr/share/pkgconfig/randrproto.pc $(PREFIX)/lib/pkgconfig/randrproto.pc -+ [ -f $(PREFIX)/lib/pkgconfig/renderproto.pc ] || ln -sf /usr/share/pkgconfig/renderproto.pc $(PREFIX)/lib/pkgconfig/renderproto.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xt.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xt.pc $(PREFIX)/lib/pkgconfig/xt.pc -+ [ -f $(PREFIX)/lib/pkgconfig/ice.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/ice.pc $(PREFIX)/lib/pkgconfig/ice.pc -+ [ -f $(PREFIX)/lib/pkgconfig/sm.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/sm.pc $(PREFIX)/lib/pkgconfig/sm.pc -+ [ -f $(PREFIX)/lib/pkgconfig/xmu.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/xmu.pc $(PREFIX)/lib/pkgconfig/xmu.pc -+ [ -f $(PREFIX)/lib/pkgconfig/libdrm.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/libdrm.pc $(PREFIX)/lib/pkgconfig/libdrm.pc -diff --git a/tools/depends/xbmc-addons.include b/tools/depends/xbmc-addons.include -index 5eb06d2001cfd049fce02b9dacf20f4fc76252d6..499d41f3c4c2307c3275dc3562d37def8ea9eb16 100644 ---- a/tools/depends/xbmc-addons.include -+++ b/tools/depends/xbmc-addons.include -@@ -77,23 +77,23 @@ $(TOOLCHAIN_FILE): $(abs_top_srcdir)/target/Toolchain_binaddons.cmake - - linux-system-libs: - mkdir -p $(ADDON_DEPS_DIR)/lib/pkgconfig $(ADDON_DEPS_DIR)/include -- [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/x11.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/x*.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/ -- [ -f $(ADDON_DEPS_DIR)/lib/libX11.so ] || ln -s /usr/lib/$(HOST)/libX11.so* $(ADDON_DEPS_DIR)/lib/ -- [ -L $(ADDON_DEPS_DIR)/include/X11 ] || ln -s /usr/include/X11 $(ADDON_DEPS_DIR)/include/X11 -- [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/xproto.pc ] || ln -s /usr/share/pkgconfig/x*.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/ -- [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/kbproto.pc ] || ln -s /usr/share/pkgconfig/kbproto.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/kbproto.pc -- [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/damageproto.pc ] || ln -s /usr/share/pkgconfig/damageproto.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/damageproto.pc -- [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/fixesproto.pc ] || ln -s /usr/share/pkgconfig/fixesproto.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/fixesproto.pc -- [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/pthread-stubs.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/pthread-stubs.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/pthread-stubs.pc -- [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/ice.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/ice.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/ice.pc -- [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/sm.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/sm.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/sm.pc -- [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/libdrm.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/libdrm.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/libdrm.pc -- [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/gl.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/gl.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/gl.pc -- [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/glu.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/glu.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/glu.pc -- [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/glew.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/glew.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/glew.pc -+ [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/x11.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/x*.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/ -+ [ -f $(ADDON_DEPS_DIR)/lib/libX11.so ] || ln -sf /usr/lib/$(HOST)/libX11.so* $(ADDON_DEPS_DIR)/lib/ -+ [ -L $(ADDON_DEPS_DIR)/include/X11 ] || ln -sf /usr/include/X11 $(ADDON_DEPS_DIR)/include/X11 -+ [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/xproto.pc ] || ln -sf /usr/share/pkgconfig/x*.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/ -+ [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/kbproto.pc ] || ln -sf /usr/share/pkgconfig/kbproto.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/kbproto.pc -+ [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/damageproto.pc ] || ln -sf /usr/share/pkgconfig/damageproto.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/damageproto.pc -+ [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/fixesproto.pc ] || ln -sf /usr/share/pkgconfig/fixesproto.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/fixesproto.pc -+ [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/pthread-stubs.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/pthread-stubs.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/pthread-stubs.pc -+ [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/ice.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/ice.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/ice.pc -+ [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/sm.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/sm.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/sm.pc -+ [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/libdrm.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/libdrm.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/libdrm.pc -+ [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/gl.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/gl.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/gl.pc -+ [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/glu.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/glu.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/glu.pc -+ [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/glew.pc ] || ln -sf /usr/lib/$(HOST)/pkgconfig/glew.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/glew.pc - [ -f $(ADDON_DEPS_DIR)/lib/libGL.so ] || \ -- (ln -s /usr/lib/$(HOST)/mesa $(ADDON_DEPS_DIR)/lib/mesa && ln -s $(ADDON_DEPS_DIR)/lib/mesa/libGL.so $(ADDON_DEPS_DIR)/lib/libGL.so) -- [ -f $(ADDON_DEPS_DIR)/lib/libGLEW.so ] || ln -s /usr/lib/$(HOST)/libGLEW.so* $(ADDON_DEPS_DIR)/lib/ -- [ -L $(ADDON_DEPS_DIR)/include/GL ] || ln -s /usr/include/GL $(ADDON_DEPS_DIR)/include/GL -- [ -f $(ADDON_DEPS_DIR)/lib/libm.so ] || ln -s /usr/lib/$(HOST)/libm.so $(ADDON_DEPS_DIR)/lib/ -+ (ln -sf /usr/lib/$(HOST)/mesa $(ADDON_DEPS_DIR)/lib/mesa && ln -sf $(ADDON_DEPS_DIR)/lib/mesa/libGL.so $(ADDON_DEPS_DIR)/lib/libGL.so) -+ [ -f $(ADDON_DEPS_DIR)/lib/libGLEW.so ] || ln -sf /usr/lib/$(HOST)/libGLEW.so* $(ADDON_DEPS_DIR)/lib/ -+ [ -L $(ADDON_DEPS_DIR)/include/GL ] || ln -sf /usr/include/GL $(ADDON_DEPS_DIR)/include/GL -+ [ -f $(ADDON_DEPS_DIR)/lib/libm.so ] || ln -sf /usr/lib/$(HOST)/libm.so $(ADDON_DEPS_DIR)/lib/ +diff --git a/system/peripherals.xml b/system/peripherals.xml +index ed707b6767f6fc9184adf2090810b5b1ad89d10d..d5704b249c3065b2980dc92c7c81dc7b384187bc 100644 +--- a/system/peripherals.xml ++++ b/system/peripherals.xml +@@ -16,7 +16,7 @@ + + + +- ++ + + + +@@ -24,7 +24,7 @@ + + + +- ++ + + -From c2d4af27ae0c490f8b3b21c40938f69eddb3b993 Mon Sep 17 00:00:00 2001 +From 1febcd53bb19499e0820cb7bcaaf39619d8a3666 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 28 Oct 2014 00:19:40 +0000 +Subject: [PATCH 02/63] [cec] Add settings for configuring button repeats + +--- + addons/resource.language.en_gb/resources/strings.po | 15 +++++++++++++++ + system/peripherals.xml | 4 +++- + xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 16 ++++++++++++++++ + 3 files changed, 34 insertions(+), 1 deletion(-) + +diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po +index abfc92bd5a9f1da9e2eed758a90416ce2d369e3b..15745a792a5a28c79c19effc4d9037e842535da6 100644 +--- a/addons/resource.language.en_gb/resources/strings.po ++++ b/addons/resource.language.en_gb/resources/strings.po +@@ -19714,3 +19714,18 @@ msgstr "" + msgctxt "#39010" + msgid "Select sort method" + msgstr "" ++ ++#: system/peripherals.xml ++msgctxt "#38050" ++msgid "Remote button press delay before repeating (ms)" ++msgstr "" ++ ++#: system/peripherals.xml ++msgctxt "#38051" ++msgid "Remote button press repeat rate (ms)" ++msgstr "" ++ ++#: system/peripherals.xml ++msgctxt "#38052" ++msgid "Remote button press release time (ms)" ++msgstr "" +diff --git a/system/peripherals.xml b/system/peripherals.xml +index d5704b249c3065b2980dc92c7c81dc7b384187bc..02b1a9ed6fce1986bd864bba09a9df0621f9e041 100644 +--- a/system/peripherals.xml ++++ b/system/peripherals.xml +@@ -31,7 +31,9 @@ + + + +- ++ ++ ++ + + + +diff --git a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp +index d032ffd707fee5eec035e90bdf618530f7215c37..30367a3fde956090afdca9930fa52e829f35046f 100644 +--- a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp ++++ b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp +@@ -1296,6 +1296,20 @@ void CPeripheralCecAdapter::SetConfigurationFromLibCEC(const CEC::libcec_configu + m_configuration.bActivateSource = config.bActivateSource; + bChanged |= SetSetting("activate_source", m_configuration.bActivateSource == 1); + ++#if defined(CEC_DOUBLE_TAP_TIMEOUT_MS_OLD) ++ m_configuration.iDoubleTapTimeout50Ms = config.iDoubleTapTimeout50Ms; ++ bChanged |= SetSetting("double_tap_timeout_ms", (int)m_configuration.iDoubleTapTimeout50Ms * 50); ++#else ++ m_configuration.iDoubleTapTimeoutMs = config.iDoubleTapTimeoutMs; ++ bChanged |= SetSetting("double_tap_timeout_ms", (int)m_configuration.iDoubleTapTimeoutMs); ++#endif ++ ++ m_configuration.iButtonRepeatRateMs = config.iButtonRepeatRateMs; ++ bChanged |= SetSetting("button_repeat_rate_ms", (int)m_configuration.iButtonRepeatRateMs); ++ ++ m_configuration.iButtonReleaseDelayMs = config.iButtonReleaseDelayMs; ++ bChanged |= SetSetting("button_release_delay_ms", (int)m_configuration.iButtonReleaseDelayMs); ++ + m_configuration.bPowerOffOnStandby = config.bPowerOffOnStandby; + + m_configuration.iFirmwareVersion = config.iFirmwareVersion; +@@ -1398,6 +1412,8 @@ void CPeripheralCecAdapter::SetConfigurationFromSettings(void) + // backwards compatibility. will be removed once the next major release of libCEC is out + m_configuration.iDoubleTapTimeoutMs = GetSettingInt("double_tap_timeout_ms"); + #endif ++ m_configuration.iButtonRepeatRateMs = GetSettingInt("button_repeat_rate_ms"); ++ m_configuration.iButtonReleaseDelayMs = GetSettingInt("button_release_delay_ms"); + + if (GetSettingBool("pause_playback_on_deactivate")) + { + +From b713d931abc454fd9248650c21b93820688e8f5b Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sat, 26 Apr 2014 17:27:52 +0100 +Subject: [PATCH 03/63] [cec] Don't suspend pi on tv switch off - it can't wake + up + +--- + system/peripherals.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/system/peripherals.xml b/system/peripherals.xml +index 02b1a9ed6fce1986bd864bba09a9df0621f9e041..54f9b70cfd5c8c82ceb99932e1b3e3251211cd20 100644 +--- a/system/peripherals.xml ++++ b/system/peripherals.xml +@@ -16,7 +16,7 @@ + + + +- ++ + + + + +From 2971cf8df975ab6fc221bf1d5342d3371ce5b41e Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Thu, 21 Apr 2016 16:49:02 +0100 +Subject: [PATCH 04/63] Revert "[settings] remove show EXIF picture information + setting" + +This reverts commit e7d90188436b6966eff23fd695e1a9d18f4af1b4. +--- + addons/resource.language.en_gb/resources/strings.po | 10 ++++++++++ + system/settings/settings.xml | 5 +++++ + xbmc/pictures/GUIWindowPictures.cpp | 2 +- + xbmc/pictures/PictureInfoLoader.cpp | 8 ++++++-- + xbmc/pictures/PictureInfoLoader.h | 1 + + xbmc/settings/Settings.cpp | 1 + + xbmc/settings/Settings.h | 1 + + 7 files changed, 25 insertions(+), 3 deletions(-) + +diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po +index 15745a792a5a28c79c19effc4d9037e842535da6..dbd80f07e305ad99a29d90211a7596b8bb5cedec 100644 +--- a/addons/resource.language.en_gb/resources/strings.po ++++ b/addons/resource.language.en_gb/resources/strings.po +@@ -19729,3 +19729,13 @@ msgstr "" + msgctxt "#38052" + msgid "Remote button press release time (ms)" + msgstr "" ++ ++#. Description of setting "Pictures -> Show EXIF picture information" with label #38207 ++#: system/settings/settings.xml ++msgctxt "#38207" ++msgid "Show EXIF picture information" ++msgstr "" ++ ++msgctxt "#38208" ++msgid "If EXIF information exists (date, time, camera used, etc.), it will be displayed." ++msgstr "" +diff --git a/system/settings/settings.xml b/system/settings/settings.xml +index c3804da9625186f5651a8d8be0edcedd8a2b255b..63613fc13acfd66476a880f8ebe9047a53837a33 100644 +--- a/system/settings/settings.xml ++++ b/system/settings/settings.xml +@@ -1172,6 +1172,11 @@ + + + ++ ++ 0 ++ true ++ ++ + + 0 + true +diff --git a/xbmc/pictures/GUIWindowPictures.cpp b/xbmc/pictures/GUIWindowPictures.cpp +index 4b5ec502a49d5116cafd53441a6d823be0da6b54..072639baae58479ec7d746f96634de069ee87e34 100644 +--- a/xbmc/pictures/GUIWindowPictures.cpp ++++ b/xbmc/pictures/GUIWindowPictures.cpp +@@ -203,7 +203,7 @@ void CGUIWindowPictures::OnPrepareFileItems(CFileItemList& items) + if (StringUtils::EqualsNoCase(items[i]->GetLabel(), "folder.jpg")) + items.Remove(i); + +- if (items.GetFolderCount() == items.Size()) ++ if (items.GetFolderCount() == items.Size() || !CSettings::GetInstance().GetBool(CSettings::SETTING_PICTURES_USETAGS)) + return; + + // Start the music info loader thread +diff --git a/xbmc/pictures/PictureInfoLoader.cpp b/xbmc/pictures/PictureInfoLoader.cpp +index dd3347277c75c5e63a4a4db9af9cc46605bb5ea9..05304f9fc44285d5577f2056625cceb15347ae57 100644 +--- a/xbmc/pictures/PictureInfoLoader.cpp ++++ b/xbmc/pictures/PictureInfoLoader.cpp +@@ -43,6 +43,7 @@ void CPictureInfoLoader::OnLoaderStart() + m_mapFileItems->SetFastLookup(true); + + m_tagReads = 0; ++ m_loadTags = CSettings::GetInstance().GetBool(CSettings::SETTING_PICTURES_USETAGS); + + if (m_pProgressCallback) + m_pProgressCallback->SetProgressMax(m_pVecItems->GetFileCount()); +@@ -87,8 +88,11 @@ bool CPictureInfoLoader::LoadItemLookup(CFileItem* pItem) + if (pItem->HasPictureInfoTag()) + return false; + +- pItem->GetPictureInfoTag()->Load(pItem->GetPath()); +- m_tagReads++; ++ if (m_loadTags) ++ { // Nothing found, load tag from file ++ pItem->GetPictureInfoTag()->Load(pItem->GetPath()); ++ m_tagReads++; ++ } + + return true; + } +diff --git a/xbmc/pictures/PictureInfoLoader.h b/xbmc/pictures/PictureInfoLoader.h +index 000b54fe1bb1dd1963edd5cf208ea318a5a5499d..2a022ff0ff66d237f0ebd12092c7b5ce8244a511 100644 +--- a/xbmc/pictures/PictureInfoLoader.h ++++ b/xbmc/pictures/PictureInfoLoader.h +@@ -39,5 +39,6 @@ protected: + + CFileItemList* m_mapFileItems; + unsigned int m_tagReads; ++ bool m_loadTags; + }; + +diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp +index 9940b6aac87971d7024c1c925846b4dac1ca98a0..6e13ba61b99217d95c1ad423131221869be6036b 100644 +--- a/xbmc/settings/Settings.cpp ++++ b/xbmc/settings/Settings.cpp +@@ -296,6 +296,7 @@ const std::string CSettings::SETTING_AUDIOCDS_SETTINGS = "audiocds.settings"; + const std::string CSettings::SETTING_AUDIOCDS_EJECTONRIP = "audiocds.ejectonrip"; + const std::string CSettings::SETTING_MYMUSIC_SONGTHUMBINVIS = "mymusic.songthumbinvis"; + const std::string CSettings::SETTING_MYMUSIC_DEFAULTLIBVIEW = "mymusic.defaultlibview"; ++const std::string CSettings::SETTING_PICTURES_USETAGS = "pictures.usetags"; + const std::string CSettings::SETTING_PICTURES_GENERATETHUMBS = "pictures.generatethumbs"; + const std::string CSettings::SETTING_PICTURES_SHOWVIDEOS = "pictures.showvideos"; + const std::string CSettings::SETTING_PICTURES_DISPLAYRESOLUTION = "pictures.displayresolution"; +diff --git a/xbmc/settings/Settings.h b/xbmc/settings/Settings.h +index 482f61db8aab70aff4013fee2f1c73a5b5a9b4a9..269a3a741340d60354037166c3b03ddfdd36cf01 100644 +--- a/xbmc/settings/Settings.h ++++ b/xbmc/settings/Settings.h +@@ -253,6 +253,7 @@ public: + static const std::string SETTING_AUDIOCDS_EJECTONRIP; + static const std::string SETTING_MYMUSIC_SONGTHUMBINVIS; + static const std::string SETTING_MYMUSIC_DEFAULTLIBVIEW; ++ static const std::string SETTING_PICTURES_USETAGS; + static const std::string SETTING_PICTURES_GENERATETHUMBS; + static const std::string SETTING_PICTURES_SHOWVIDEOS; + static const std::string SETTING_PICTURES_DISPLAYRESOLUTION; + +From 1a444eea815b96b8d61c847161d08452022c2192 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 18:19:32 +0100 -Subject: [PATCH 02/73] [rbp/omxplayer] When opening a stream don't try to +Subject: [PATCH 05/63] [rbp/omxplayer] When opening a stream don't try to update gui so often --- @@ -148,7 +275,7 @@ Subject: [PATCH 02/73] [rbp/omxplayer] When opening a stream don't try to 1 file changed, 4 insertions(+) diff --git a/xbmc/dialogs/GUIDialogBusy.cpp b/xbmc/dialogs/GUIDialogBusy.cpp -index 8ea5161637b4e66ddd222859f058521dbc8922b9..811019a39a10acc21b83f0b0c70d5500055e7f98 100644 +index c8fe0706d128b3c67a4000894129ae0fa08bb223..8a5916299575661743131b921a27a76f0bb88409 100644 --- a/xbmc/dialogs/GUIDialogBusy.cpp +++ b/xbmc/dialogs/GUIDialogBusy.cpp @@ -69,7 +69,11 @@ bool CGUIDialogBusy::WaitOnEvent(CEvent &event, unsigned int displaytime /* = 10 @@ -164,10 +291,10 @@ index 8ea5161637b4e66ddd222859f058521dbc8922b9..811019a39a10acc21b83f0b0c70d5500 dialog->ProcessRenderLoop(false); if (allowCancel && dialog->IsCanceled()) -From b4539526e1b39f837de148f31ac72c1984987925 Mon Sep 17 00:00:00 2001 +From 68f330731015a5b4abbacbd458c8309e9729fd76 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 8 Mar 2014 15:36:06 +0000 -Subject: [PATCH 03/73] [hifiberry] Hack: force it to be recognised as IEC958 +Subject: [PATCH 06/63] [hifiberry] Hack: force it to be recognised as IEC958 capable to enable passthrough options --- @@ -175,10 +302,10 @@ Subject: [PATCH 03/73] [hifiberry] Hack: force it to be recognised as IEC958 1 file changed, 4 insertions(+) diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp -index 6a9066b2dbe8d505d636b3638c1d35c7c8a698ed..9c6ac5d4cc9bf21b2d48619cc6fb5d274f1c3928 100644 +index d66993a09583d8f9f54f5f97c18fbba45dddee9b..3c0b691860ace57e0a25f01013df01a5ca4f62f5 100644 --- a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp +++ b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp -@@ -1352,6 +1352,10 @@ void CAESinkALSA::EnumerateDevice(AEDeviceInfoList &list, const std::string &dev +@@ -1351,6 +1351,10 @@ void CAESinkALSA::EnumerateDevice(AEDeviceInfoList &list, const std::string &dev if (snd_card_get_name(cardNr, &cardName) == 0) info.m_displayName = cardName; @@ -190,10 +317,10 @@ index 6a9066b2dbe8d505d636b3638c1d35c7c8a698ed..9c6ac5d4cc9bf21b2d48619cc6fb5d27 info.m_displayName.substr(info.m_displayName.size()-5) == " HDMI") { -From ead0ca4a8494d6eb946a38d801d6f538d1464b25 Mon Sep 17 00:00:00 2001 +From 76cd8f440e9203cc4ba28a0bbeede281dc391559 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 1 May 2014 16:28:39 +0100 -Subject: [PATCH 04/73] Improved file buffering in CArchive +Subject: [PATCH 07/63] Improved file buffering in CArchive Even though memcpy is typically inlined by the compiler into byte/word loads and stores (at least for release builds), the frequency with which 1, 2 and 4 @@ -253,10 +380,10 @@ index 23cac2759fb10d532da56fa75c5528c5589e9010..89d31d4db1afa7340ed8cd51a7a9fa7a } -From c77ae55125886d20a9dc5d4f6bbffa9bad1f4e82 Mon Sep 17 00:00:00 2001 +From 46eb2adb4e1c586c374f9bedeac9fef6f2dca4f0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 10 Aug 2014 16:45:16 +0100 -Subject: [PATCH 05/73] filesystem: Make support of browsing into archives +Subject: [PATCH 08/63] filesystem: Make support of browsing into archives optional The ability to browse, scan and play content in archives can cause problems on low powered/low memory devices. @@ -275,10 +402,10 @@ We'll let people who don't use archives disable it manually 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 5d2af8d8705ecf61dc5b7c91f0517b8d1e1e640a..488e590d5a48467b19e27d01863487f51442b130 100644 +index dbd80f07e305ad99a29d90211a7596b8bb5cedec..ecea05ac43622f75034c60cc3b2bd16859065a80 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po -@@ -19333,6 +19333,15 @@ msgstr "" +@@ -19371,6 +19371,15 @@ msgstr "" #: system/settings/rbp.xml msgctxt "#38010" msgid "GPU accelerated" @@ -366,10 +493,10 @@ index a0fd0a9011e71f4af1535110c696b6ea5c4b37db..688b71a297c7c617c6764bfe6be157d7 { CURL xbtUrl = URIUtils::CreateArchivePath("xbt", url); -From 6fdad9365c972c6ba48db3487f8228b3a6e69afd Mon Sep 17 00:00:00 2001 +From 5a6fdf25a8adde963039cf03732fda057bca72a5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 27 Oct 2014 13:06:57 +0000 -Subject: [PATCH 06/73] [rbp] Make cachemembuffersize default depend on memory +Subject: [PATCH 09/63] [rbp] Make cachemembuffersize default depend on memory size --- @@ -379,7 +506,7 @@ Subject: [PATCH 06/73] [rbp] Make cachemembuffersize default depend on memory 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp -index c417308c210204847f9b2d54250af68f2e4e2ee7..6b06c253644a85ca6a5088b07ca41369e38f21d0 100644 +index 571bf9f1ae64ae6d2d80a4aaca1a164f5178bf98..5a6f780517cff0c31f1c40e5e95445d448eb2297 100644 --- a/xbmc/linux/RBP.cpp +++ b/xbmc/linux/RBP.cpp @@ -23,6 +23,7 @@ @@ -433,7 +560,7 @@ index a35a509a91483f13e2cf0e688fc7e9528f254290..fffa5182126159f6dfcf750b21fa0464 void Deinitialize(); int GetArmMem() { return m_arm_mem; } diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index 6beebe0c9c11b0bab63e5abbd4aea2d62bb05f0c..03f566d3ee4eab690d2236b7739080269d552511 100644 +index cc37998f0c9edfb38cf609666374cfa96530bf8f..3891a7ed34acb3489a860678d56a8ec049890f6e 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp @@ -50,6 +50,9 @@ @@ -471,10 +598,10 @@ index 6beebe0c9c11b0bab63e5abbd4aea2d62bb05f0c..03f566d3ee4eab690d2236b773908026 } -From 66ba52b064d5697ad214f71bdf50c704275f0e87 Mon Sep 17 00:00:00 2001 +From 366c33404013529d89c2442e09dbfdba3d6e7c34 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 30 May 2014 14:58:43 +0100 -Subject: [PATCH 07/73] [settings] Experiment: Report DESKTOP resolution in +Subject: [PATCH 10/63] [settings] Experiment: Report DESKTOP resolution in video settings --- @@ -496,10 +623,10 @@ index ef95bc286fa982790248bad26da3c3e00c1da002..da69c6960867621d4ebe9267929664d9 StringUtils::Format("%dx%d%s", resolution->width, resolution->height, ModeFlagsToString(resolution->flags, false).c_str()), -From 859c87e3ac2360ecaa7eb846c24ae565228b9d85 Mon Sep 17 00:00:00 2001 +From de4036d5f101d94439763545120b52bb346f4875 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 24 Sep 2014 23:13:52 +0100 -Subject: [PATCH 08/73] [audio] Add settings option to boost centre channel +Subject: [PATCH 11/63] [audio] Add settings option to boost centre channel when downmixing This allows a dB volume increase to be added to centre channel. @@ -517,12 +644,12 @@ Should work with Pi Sink (dvdplayer/paplayer) and omxplayer 5 files changed, 46 insertions(+) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 488e590d5a48467b19e27d01863487f51442b130..a867d3205bbad13ac4f3b0862911f04c694e0f07 100644 +index ecea05ac43622f75034c60cc3b2bd16859065a80..de5eb0dd99700c0bdc7c3409c1b63f1c01c650bb 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po -@@ -19531,6 +19531,21 @@ msgstr "" +@@ -19591,6 +19591,21 @@ msgstr "" - #empty strings from id 38047 to 38099 + #empty strings from id 38062 to 38099 +#: system/settings/settings.xml +msgctxt "#38007" @@ -543,10 +670,10 @@ index 488e590d5a48467b19e27d01863487f51442b130..a867d3205bbad13ac4f3b0862911f04c #: system/settings/settings.xml msgctxt "#38100" diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index 6ff6b4c63fdb49ebe02f63b93c6995e0ddd21d40..52f7d29eaa509c8d648c2cf2e125b9e7e4b90f3b 100644 +index 63613fc13acfd66476a880f8ebe9047a53837a33..9ce9e725aec4d8ed000200342a2a99f3bc34a749 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml -@@ -2361,6 +2361,18 @@ +@@ -2358,6 +2358,18 @@ @@ -625,10 +752,10 @@ index f16b822ed7b4aebe18b5d339b3f71ee66e97c23f..993d4b33a294e88c2c004b7943895ba5 // stereo upmix if (upmix && m_src_channels == 2 && m_dst_channels > 2) -From 5b64f68afe3f41097e46b278f02db69190d2628d Mon Sep 17 00:00:00 2001 +From abc2a09d9cb7b423a37f1dfae6f198dfa361f1af Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 27 Oct 2014 15:23:51 +0000 -Subject: [PATCH 09/73] [rbp] Default extract thumbnails to false +Subject: [PATCH 12/63] [rbp] Default extract thumbnails to false It can take 80 seconds for a single file on a Pi. It can cause crashes with out-of-memory errors. It genereates a lot of support issues. Best to default to disabled and let users enable it if they must @@ -654,10 +781,10 @@ index e8b0d3d472b02fd161a4b51e957b9129e3cb9792..289dc55ec41aa44848519a05f8ee1ccc
-From d52a6e898409a2c72e04c8f3abc9bff0cf01bec1 Mon Sep 17 00:00:00 2001 +From 747d6a7aa129348078f5b4e36d47bbc1307806a8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 27 Nov 2014 16:31:56 +0000 -Subject: [PATCH 10/73] [languageinvoker] Reduce priority of python threads +Subject: [PATCH 13/63] [languageinvoker] Reduce priority of python threads --- xbmc/interfaces/generic/LanguageInvokerThread.cpp | 5 +++++ @@ -680,64 +807,10 @@ index fcdd0633f30cd9595ae6cc4ed293677cdcb1f422..16f0c8916b5e0a9e90973d194cf2ebd1 } -From 9b1420ca7a51442c3937106d739b01879a3568f8 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sat, 14 Dec 2013 16:55:05 +0000 -Subject: [PATCH 11/73] logging: Add microsecond timer to log messages - ---- - xbmc/utils/log.cpp | 15 +++++++++++++-- - 1 file changed, 13 insertions(+), 2 deletions(-) - -diff --git a/xbmc/utils/log.cpp b/xbmc/utils/log.cpp -index 3443f1293d86018830269ed992c90a4e69c0430c..d330320842243df6f5ff256e608dddfa946e8773 100644 ---- a/xbmc/utils/log.cpp -+++ b/xbmc/utils/log.cpp -@@ -24,6 +24,7 @@ - #include "threads/Thread.h" - #include "utils/StringUtils.h" - #include "CompileInfo.h" -+#include "utils/TimeUtils.h" - - static const char* const levelNames[] = - {"DEBUG", "INFO", "NOTICE", "WARNING", "ERROR", "SEVERE", "FATAL", "NONE"}; -@@ -198,19 +199,29 @@ void CLog::PrintDebugString(const std::string& line) - - bool CLog::WriteLogString(int logLevel, const std::string& logString) - { -+#if defined(TARGET_LINUX) -+ static const char* prefixFormat = "%02.2d:%02.2d:%02.2d %10.6f T:%" PRIu64" %7s: "; -+#else - static const char* prefixFormat = "%02.2d:%02.2d:%02.2d T:%" PRIu64" %7s: "; -- -+#endif - std::string strData(logString); - /* fixup newline alignment, number of spaces should equal prefix length */ - StringUtils::Replace(strData, "\n", "\n "); - - int hour, minute, second; - s_globals.m_platform.GetCurrentLocalTime(hour, minute, second); -- -+ -+#if defined(TARGET_LINUX) -+ float Now = CurrentHostCounter() * 1e-9; -+#endif -+ - strData = StringUtils::Format(prefixFormat, - hour, - minute, - second, -+#if defined(TARGET_LINUX) -+ Now, -+#endif - (uint64_t)CThread::GetCurrentThreadId(), - levelNames[logLevel]) + strData; - - -From a2e3b4c8b1af982f133cc894d249fb9322f8f9a2 Mon Sep 17 00:00:00 2001 +From 0732dc96e4f4e84c14eebc953e3cf571363afb34 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 29 Nov 2014 15:25:16 +0000 -Subject: [PATCH 12/73] [rbp] hack: wait for splash to complete before changing +Subject: [PATCH 14/63] [rbp] hack: wait for splash to complete before changing hdmi mode --- @@ -821,10 +894,10 @@ index ee297700f8583dbb15cbe53baf8c887b36bd2ea0..bbe501d40c5e101f1d0d64b8b59b1928 RENDER_STEREO_MODE stereo_mode = g_graphicsContext.GetStereoMode(); -From 0b55fcce3a914ba67822156986f7aca2a0fd97ed Mon Sep 17 00:00:00 2001 +From e182b3ca45dd427c939d6c39366664e9afb382a8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 11 Dec 2014 17:00:57 +0000 -Subject: [PATCH 13/73] Fix for UI not showing both extractflags and +Subject: [PATCH 15/63] Fix for UI not showing both extractflags and extractthumb --- @@ -833,10 +906,10 @@ Subject: [PATCH 13/73] Fix for UI not showing both extractflags and 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index a867d3205bbad13ac4f3b0862911f04c694e0f07..ca11841fdb24ed2f420e1b9ff92ed3e184af2fc3 100644 +index de5eb0dd99700c0bdc7c3409c1b63f1c01c650bb..ae3aa10aa65beac6689f129d60056cadf8a5b5c1 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po -@@ -12450,7 +12450,7 @@ msgstr "" +@@ -12451,7 +12451,7 @@ msgstr "" #: system/settings/settings.xml msgctxt "#20433" @@ -845,7 +918,7 @@ index a867d3205bbad13ac4f3b0862911f04c694e0f07..ca11841fdb24ed2f420e1b9ff92ed3e1 msgstr "" #: xbmc/dialogs/GUIDialogSmartPlaylistRule.cpp -@@ -16969,7 +16969,7 @@ msgstr "" +@@ -17011,7 +17011,7 @@ msgstr "" #. Description of setting with label #20433 "Extract thumbnails and video information" #: system/settings/settings.xml msgctxt "#36178" @@ -854,7 +927,7 @@ index a867d3205bbad13ac4f3b0862911f04c694e0f07..ca11841fdb24ed2f420e1b9ff92ed3e1 msgstr "" #. Description of setting with label #20419 "Replace file names with library titles" -@@ -16981,7 +16981,7 @@ msgstr "" +@@ -17023,7 +17023,7 @@ msgstr "" #. Description of setting with label #20433 "Extract thumbnails and video information" #: system/settings/settings.xml msgctxt "#36180" @@ -863,19 +936,19 @@ index a867d3205bbad13ac4f3b0862911f04c694e0f07..ca11841fdb24ed2f420e1b9ff92ed3e1 msgstr "" #: system/settings/settings.xml -@@ -19678,3 +19678,7 @@ msgstr "" - msgctxt "#39010" - msgid "Select sort method" +@@ -19763,3 +19763,7 @@ msgstr "" + msgctxt "#38208" + msgid "If EXIF information exists (date, time, camera used, etc.), it will be displayed." msgstr "" + +msgctxt "#38190" +msgid "Extract thumbnails from video files" +msgstr "" diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index 52f7d29eaa509c8d648c2cf2e125b9e7e4b90f3b..785b431b40eb7fad5791bca97c1d20ef4c3d4817 100644 +index 9ce9e725aec4d8ed000200342a2a99f3bc34a749..326ffbd0f08428c3b4a95208134253feeabf1b1f 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml -@@ -977,8 +977,8 @@ +@@ -969,8 +969,8 @@ true
@@ -887,10 +960,10 @@ index 52f7d29eaa509c8d648c2cf2e125b9e7e4b90f3b..785b431b40eb7fad5791bca97c1d20ef
-From 21b1d6a4c44e5e88288d4d436477c2bfd05f6588 Mon Sep 17 00:00:00 2001 +From 31ef126da025be5761a86664e2c9428f5208f2ae Mon Sep 17 00:00:00 2001 From: anaconda Date: Thu, 11 Sep 2014 21:30:43 +0200 -Subject: [PATCH 14/73] Disable autoscrolling while on screensaver and while +Subject: [PATCH 16/63] Disable autoscrolling while on screensaver and while opening streams. --- @@ -903,10 +976,10 @@ Subject: [PATCH 14/73] Disable autoscrolling while on screensaver and while 6 files changed, 24 insertions(+), 3 deletions(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index 83c79ccc94c61c1740a65fd7e9402ca7c2b82813..cad5c05a1397a12309482dae7928b2a118a42925 100644 +index 100a2f2cd2a097ec275751a75e82500324166757..6e5c33c1118cbda79a614d90c6ca4b610f338c87 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -5208,3 +5208,13 @@ bool CApplication::NotifyActionListeners(const CAction &action) const +@@ -5240,3 +5240,13 @@ bool CApplication::NotifyActionListeners(const CAction &action) const return false; } @@ -921,10 +994,10 @@ index 83c79ccc94c61c1740a65fd7e9402ca7c2b82813..cad5c05a1397a12309482dae7928b2a1 + return onBlackDimScreenSaver || openingStreams; +} diff --git a/xbmc/Application.h b/xbmc/Application.h -index 22aca8173d0a452dc3d18ee559613ceb59f31b41..0f570f108436c168b3af746f5c005ae9dadf68b5 100644 +index a9d9bf5c4d69f0073e683e28cbd82d72d0fe4e06..dfee194a7d88a2cd6f503b5c7fbc258709997cb8 100644 --- a/xbmc/Application.h +++ b/xbmc/Application.h -@@ -395,6 +395,8 @@ public: +@@ -394,6 +394,8 @@ public: */ void UnregisterActionListener(IActionListener *listener); @@ -978,7 +1051,7 @@ index 7f1108939a63162024c7a055403a58e395f090b6..1192b74675b79d1a862de2949a60163a { scrollInfo.waitTime--; diff --git a/xbmc/guilib/GUILabel.cpp b/xbmc/guilib/GUILabel.cpp -index db201317a1f8d93dcf0641a28b7688cbd1a70734..1c8c30dcb9d55b7240af93b5e46c620320ef410a 100644 +index f15e847ec43d07b44660caec9f8faca780b0a061..ba88a7c5e45da13404d59dfbf1bbc8b93d3528c1 100644 --- a/xbmc/guilib/GUILabel.cpp +++ b/xbmc/guilib/GUILabel.cpp @@ -21,6 +21,8 @@ @@ -990,7 +1063,7 @@ index db201317a1f8d93dcf0641a28b7688cbd1a70734..1c8c30dcb9d55b7240af93b5e46c6203 CGUILabel::CGUILabel(float posX, float posY, float width, float height, const CLabelInfo& labelInfo, CGUILabel::OVER_FLOW overflow) : m_label(labelInfo) , m_textLayout(labelInfo.font, overflow == OVER_FLOW_WRAP, height) -@@ -104,7 +106,7 @@ void CGUILabel::Render() +@@ -103,7 +105,7 @@ void CGUILabel::Render() color_t color = GetColor(); bool renderSolid = (m_color == COLOR_DISABLED); bool overFlows = (m_renderRect.Width() + 0.5f < m_textLayout.GetTextWidth()); // 0.5f to deal with floating point rounding issues @@ -1021,10 +1094,10 @@ index d7bc1c5ba6067af9a460589920367288c640a915..ac766293f1c47c7f145cb46f6b152144 if (m_lastRenderTime) m_autoScrollDelayTime += currentTime - m_lastRenderTime; -From e5b903c3dfb34e4361f8f6075cb772b2a8bf92b0 Mon Sep 17 00:00:00 2001 +From 485dc3edb739f64c1816177cc34305c9a45931df Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 13 Dec 2014 18:35:20 +0000 -Subject: [PATCH 15/73] [demuxer] Avoid memcpy on every demuxer packet +Subject: [PATCH 17/63] [demuxer] Avoid memcpy on every demuxer packet Avoids an unnecessary memcpy on every demuxer packet which for high bitrate videos can be significant. @@ -1035,10 +1108,10 @@ high bitrate videos can be significant. 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -index 64dce349ad574e1bd115a1bfb08102034c1aef95..ca952e157690fe464c731e82cd302883c8ff437b 100644 +index 3540a8f0c89e4f82b5ae3c40fe58ca8bfffd2360..fedbff21018d352d88a820c6354aa7d7d4623e79 100644 --- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -@@ -906,7 +906,7 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() +@@ -921,7 +921,7 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() { if(m_pkt.pkt.stream_index == (int)m_pFormatContext->programs[m_program]->stream_index[i]) { @@ -1047,7 +1120,7 @@ index 64dce349ad574e1bd115a1bfb08102034c1aef95..ca952e157690fe464c731e82cd302883 break; } } -@@ -915,7 +915,7 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() +@@ -930,7 +930,7 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() bReturnEmpty = true; } else @@ -1056,7 +1129,7 @@ index 64dce349ad574e1bd115a1bfb08102034c1aef95..ca952e157690fe464c731e82cd302883 } else bReturnEmpty = true; -@@ -945,9 +945,13 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() +@@ -960,9 +960,13 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() // copy contents into our own packet pPacket->iSize = m_pkt.pkt.size; @@ -1072,7 +1145,7 @@ index 64dce349ad574e1bd115a1bfb08102034c1aef95..ca952e157690fe464c731e82cd302883 pPacket->pts = ConvertTimestamp(m_pkt.pkt.pts, stream->time_base.den, stream->time_base.num); pPacket->dts = ConvertTimestamp(m_pkt.pkt.dts, stream->time_base.den, stream->time_base.num); -@@ -1001,7 +1005,10 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() +@@ -1016,7 +1020,10 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() pPacket->iStreamId = m_pkt.pkt.stream_index; } m_pkt.result = -1; @@ -1124,10 +1197,10 @@ index df0f35bd49c65b302de4ccd110d859e8b881ea5f..b4b591ae4c4dd4fb0b36d4d00fedca96 } catch(...) { -From 520156ba013cc22da40d68d232fc4760c3595d29 Mon Sep 17 00:00:00 2001 +From 6f64ae9541cbeebd2d0169efea2e19639604d019 Mon Sep 17 00:00:00 2001 From: anaconda Date: Wed, 25 Feb 2015 18:22:21 +0100 -Subject: [PATCH 16/73] Load OSD dialogs on startup. +Subject: [PATCH 18/63] Load OSD dialogs on startup. Fixes skipped frames the first time they're loaded in memory on less powered devices, like a Raspberry Pi, when using DVDPlayer. @@ -1181,7 +1254,7 @@ index eb67552344f59b8857b16c882c29e3fa62bed75c..f31572b34d376e70a35003a8c2e175b4 CGUIDialogAudioSubtitleSettings::~CGUIDialogAudioSubtitleSettings() { } diff --git a/xbmc/video/dialogs/GUIDialogSubtitles.cpp b/xbmc/video/dialogs/GUIDialogSubtitles.cpp -index 398558e4d5d0cae30ee1c73e2b70e3b2f787e8fc..4e8a9b1e307a89d3a7b68402e2ff11b57e7dccd4 100644 +index 29c2917aa5aaaf4160c8f6fafadda45a71c54835..84204c1b1a058377d9d0d03d8af7d97f35ba119f 100644 --- a/xbmc/video/dialogs/GUIDialogSubtitles.cpp +++ b/xbmc/video/dialogs/GUIDialogSubtitles.cpp @@ -103,7 +103,7 @@ CGUIDialogSubtitles::CGUIDialogSubtitles(void) @@ -1222,10 +1295,10 @@ index 0534828dd85520134f7a6890e43a873e223062c1..5a86dfc1e2a54c8fe8d82cb75b612d8e CGUIDialogVideoSettings::~CGUIDialogVideoSettings() { } -From b0c4cebc6683c71e88e1e86aeaaef53c759d9666 Mon Sep 17 00:00:00 2001 +From 381a8656cb8bbd3a32edd2b9e7f717e3fc195ec3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 14 Apr 2015 20:51:14 +0100 -Subject: [PATCH 17/73] [gui] Also limit GUI updates when in non full-screen +Subject: [PATCH 19/63] [gui] Also limit GUI updates when in non full-screen video mode --- @@ -1233,10 +1306,10 @@ Subject: [PATCH 17/73] [gui] Also limit GUI updates when in non full-screen 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index cad5c05a1397a12309482dae7928b2a118a42925..826bc68488ed2227bd5175c3c20cacb1ab8b9930 100644 +index 6e5c33c1118cbda79a614d90c6ca4b610f338c87..283f300d89cbfd95cc160b19c24f1a5e55c48277 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -2754,7 +2754,7 @@ void CApplication::FrameMove(bool processEvents, bool processGUI) +@@ -2780,7 +2780,7 @@ void CApplication::FrameMove(bool processEvents, bool processGUI) #if defined(TARGET_RASPBERRY_PI) || defined(HAS_IMXVPU) // This code reduces rendering fps of the GUI layer when playing videos in fullscreen mode // it makes only sense on architectures with multiple layers @@ -1245,7 +1318,7 @@ index cad5c05a1397a12309482dae7928b2a118a42925..826bc68488ed2227bd5175c3c20cacb1 fps = CSettings::GetInstance().GetInt(CSettings::SETTING_VIDEOPLAYER_LIMITGUIUPDATE); #endif -@@ -2767,6 +2767,8 @@ void CApplication::FrameMove(bool processEvents, bool processGUI) +@@ -2793,6 +2793,8 @@ void CApplication::FrameMove(bool processEvents, bool processGUI) { if (!m_skipGuiRender) g_windowManager.Process(CTimeUtils::GetFrameTime()); @@ -1255,10 +1328,10 @@ index cad5c05a1397a12309482dae7928b2a118a42925..826bc68488ed2227bd5175c3c20cacb1 g_windowManager.FrameMove(); } -From d1ed850bff3522923aa92c84a7faf6de41e31f81 Mon Sep 17 00:00:00 2001 +From d60d5b5d2c0fe031a50e595888a5b704e33c39b6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 5 May 2015 23:58:06 +0100 -Subject: [PATCH 18/73] [screensaver] Leave GUI contents available for +Subject: [PATCH 20/63] [screensaver] Leave GUI contents available for screensaver --- @@ -1266,10 +1339,10 @@ Subject: [PATCH 18/73] [screensaver] Leave GUI contents available for 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/xbmc/guilib/GUIWindowManager.cpp b/xbmc/guilib/GUIWindowManager.cpp -index f6f64414831232558751c9f35f5c1d61eacd4fd6..9350bfd4ed53954fc500ff813da3cc9d5f3b99c7 100644 +index 5808f7ed1e94d68ead7305ba6d284edd4df12bdd..2a3b7f16531c9822e79c77efabdd30acdaa2a3c9 100644 --- a/xbmc/guilib/GUIWindowManager.cpp +++ b/xbmc/guilib/GUIWindowManager.cpp -@@ -794,7 +794,16 @@ void CGUIWindowManager::ActivateWindow_Internal(int iWindowID, const std::vector +@@ -795,7 +795,16 @@ void CGUIWindowManager::ActivateWindow_Internal(int iWindowID, const std::vector int currentWindow = GetActiveWindow(); CGUIWindow *pWindow = GetWindow(currentWindow); if (pWindow) @@ -1288,10 +1361,10 @@ index f6f64414831232558751c9f35f5c1d61eacd4fd6..9350bfd4ed53954fc500ff813da3cc9d // Add window to the history list (we must do this before we activate it, -From 2e458883e7d819a8f51acbf0832d035d3a79452a Mon Sep 17 00:00:00 2001 +From 052ea3734af13684c6b187e4eb61d93216b50d30 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 6 Jun 2015 18:43:57 +0100 -Subject: [PATCH 19/73] ffmpeg: Automatic switch to software decode for GMC +Subject: [PATCH 21/63] ffmpeg: Automatic switch to software decode for GMC with more than one warp point --- @@ -1383,10 +1456,10 @@ index eaf9fc49319d5f0ee450ddd802bba569e291f0b5..8dd14cdfd053f142f386b6dee1fc0b21 CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \ ./configure $(ffmpg_config) diff --git a/tools/depends/target/ffmpeg/autobuild.sh b/tools/depends/target/ffmpeg/autobuild.sh -index 6bbebfca1c7189fec6650932d7292f17af60db62..e491c788793fa5df35e4570b54d7606183350376 100755 +index 5c2976278eb5ec5b8b4a4f9f9c7174b164ab5201..dde29adf425e54f54e4104b3370352db0be6ef40 100755 --- a/tools/depends/target/ffmpeg/autobuild.sh +++ b/tools/depends/target/ffmpeg/autobuild.sh -@@ -127,6 +127,8 @@ mkdir -p "ffmpeg-${VERSION}" +@@ -132,6 +132,8 @@ mkdir -p "ffmpeg-${VERSION}" cd "ffmpeg-${VERSION}" || exit 2 tar --strip-components=1 -xf $MYDIR/${ARCHIVE} @@ -1396,7 +1469,7 @@ index 6bbebfca1c7189fec6650932d7292f17af60db62..e491c788793fa5df35e4570b54d76061 ./configure --prefix=$FFMPEG_PREFIX \ --extra-version="kodi-${VERSION}" \ diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -index 6adeaa66b04379a2685a80b99cfd493648f43775..aa20f18cbea80ed68c1307470289525bd5db29e3 100644 +index 8997e3c8dfb9d37cc6c1b0706366d0b193201dd9..1884c27272ad98ba5f8cbc7f275a7d9850cfab1d 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp @@ -47,6 +47,10 @@ @@ -1417,10 +1490,10 @@ index 6adeaa66b04379a2685a80b99cfd493648f43775..aa20f18cbea80ed68c1307470289525b + if (hints.workaround_bugs & FF_BUG_GMC_UNSUPPORTED) + return false; - m_processInfo.SetVideoDeintMethod("none"); - + std::list deintMethods; + deintMethods.push_back(EINTERLACEMETHOD::VS_INTERLACEMETHOD_AUTO); diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemux.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemux.h -index 03fdf6efa072219d55cac21b7f7923ffc6c00e17..e3a32aebfe59016b43cd7c2b304921b58c44e129 100644 +index 3bb003b634c83d2c1b0ecd12b53027950e58be99..24341dc23e97e86e1b20b255548573c88e02f064 100644 --- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemux.h +++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemux.h @@ -157,6 +157,7 @@ public: @@ -1440,10 +1513,10 @@ index 03fdf6efa072219d55cac21b7f7923ffc6c00e17..e3a32aebfe59016b43cd7c2b304921b5 class CDemuxStreamAudio : public CDemuxStream diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -index ca952e157690fe464c731e82cd302883c8ff437b..f00e95324849011df9d078432699030f6c4afae8 100644 +index fedbff21018d352d88a820c6354aa7d7d4623e79..b3bdc5a75b77af7dff90ded100a97b848db358da 100644 --- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -@@ -1393,7 +1393,7 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) +@@ -1415,7 +1415,7 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) if (!stereoMode.empty()) st->stereo_mode = stereoMode; @@ -1519,446 +1592,10 @@ index f135d423c0ca76fd70e79ae5b7d035f0cb79fc75..d9b576bc46055fdab1c134e5f2c63cd4 else if ((hint.codec == AV_CODEC_ID_VC1 || hint.codec == AV_CODEC_ID_WMV3) && g_RBP.GetCodecWvc1()) supported = true; -From 82f78893a3e6809a5deba403df8b37a2bae734fe Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 10 Mar 2016 17:56:11 +0000 -Subject: [PATCH 20/73] [rbp] HW mouse pointer - -Updating the mouse point provokes a complete screen update which can make it feel laggy -and results in high cpu. - -Render the mouse with an overlay to avoid redrawing the normal gui. ---- - xbmc/guilib/GUIWindowManager.cpp | 2 + - xbmc/linux/RBP.cpp | 135 ++++++++++++++++++++++++++++++++++++++ - xbmc/linux/RBP.h | 9 +++ - xbmc/windowing/WinEventsLinux.cpp | 125 +++++++++++++++++++++++++++++++++++ - xbmc/windowing/WinEventsLinux.h | 11 ++++ - 5 files changed, 282 insertions(+) - -diff --git a/xbmc/guilib/GUIWindowManager.cpp b/xbmc/guilib/GUIWindowManager.cpp -index 9350bfd4ed53954fc500ff813da3cc9d5f3b99c7..cd45a5961d4ffafbc8e62a3874dd626af5ccb7e2 100644 ---- a/xbmc/guilib/GUIWindowManager.cpp -+++ b/xbmc/guilib/GUIWindowManager.cpp -@@ -199,7 +199,9 @@ void CGUIWindowManager::CreateWindows() - Add(new CGUIWindowAddonBrowser); - Add(new CGUIWindowScreensaverDim); - Add(new CGUIWindowDebugInfo); -+#ifndef TARGET_RASPBERRY_PI - Add(new CGUIWindowPointer); -+#endif - Add(new CGUIDialogYesNo); - Add(new CGUIDialogProgress); - Add(new CGUIDialogExtendedProgressBar); -diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp -index 6b06c253644a85ca6a5088b07ca41369e38f21d0..92f20e5174dd6b886cf622460ac68ab5f2fe24b9 100644 ---- a/xbmc/linux/RBP.cpp -+++ b/xbmc/linux/RBP.cpp -@@ -28,6 +28,9 @@ - - #include "cores/omxplayer/OMXImage.h" - -+#include "guilib/GraphicContext.h" -+#include "settings/DisplaySettings.h" -+ - #include - #include "rpi/rpi_user_vcsm.h" - #include "utils/TimeUtils.h" -@@ -46,6 +49,10 @@ CRBP::CRBP() - m_DllBcmHost = new DllBcmHost(); - m_OMX = new COMXCore(); - m_display = DISPMANX_NO_HANDLE; -+ m_p = NULL; -+ m_x = 0; -+ m_y = 0; -+ m_enabled = 0; - m_mb = mbox_open(); - vcsm_init(); - m_vsync_count = 0; -@@ -141,6 +148,7 @@ DISPMANX_DISPLAY_HANDLE_T CRBP::OpenDisplay(uint32_t device) - m_display = vc_dispmanx_display_open( 0 /*screen*/ ); - int s = vc_dispmanx_vsync_callback(m_display, vsync_callback_static, (void *)this); - assert(s == 0); -+ init_cursor(); - } - return m_display; - } -@@ -148,6 +156,7 @@ DISPMANX_DISPLAY_HANDLE_T CRBP::OpenDisplay(uint32_t device) - void CRBP::CloseDisplay(DISPMANX_DISPLAY_HANDLE_T display) - { - CSingleLock lock(m_critSection); -+ uninit_cursor(); - assert(display == m_display); - int s = vc_dispmanx_vsync_callback(m_display, NULL, NULL); - assert(s == 0); -@@ -266,6 +275,9 @@ void CRBP::Deinitialize() - m_omx_image_init = false; - m_initialized = false; - m_omx_initialized = false; -+ uninit_cursor(); -+ delete m_p; -+ m_p = NULL; - if (m_mb) - mbox_close(m_mb); - m_mb = 0; -@@ -338,6 +350,52 @@ unsigned mem_unlock(int file_desc, unsigned handle) - return p[5]; - } - -+unsigned int mailbox_set_cursor_info(int file_desc, int width, int height, int format, uint32_t buffer, int hotspotx, int hotspoty) -+{ -+ int i=0; -+ unsigned int p[32]; -+ p[i++] = 0; // size -+ p[i++] = 0x00000000; // process request -+ p[i++] = 0x00008010; // set cursor state -+ p[i++] = 24; // buffer size -+ p[i++] = 24; // data size -+ -+ p[i++] = width; -+ p[i++] = height; -+ p[i++] = format; -+ p[i++] = buffer; // ptr to VC memory buffer. Doesn't work in 64bit.... -+ p[i++] = hotspotx; -+ p[i++] = hotspoty; -+ -+ p[i++] = 0x00000000; // end tag -+ p[0] = i*sizeof(*p); // actual size -+ -+ mbox_property(file_desc, p); -+ return p[5]; -+ -+} -+ -+unsigned int mailbox_set_cursor_position(int file_desc, int enabled, int x, int y) -+{ -+ int i=0; -+ unsigned p[32]; -+ p[i++] = 0; // size -+ p[i++] = 0x00000000; // process request -+ p[i++] = 0x00008011; // set cursor state -+ p[i++] = 12; // buffer size -+ p[i++] = 12; // data size -+ -+ p[i++] = enabled; -+ p[i++] = x; -+ p[i++] = y; -+ -+ p[i++] = 0x00000000; // end tag -+ p[0] = i*sizeof *p; // actual size -+ -+ mbox_property(file_desc, p); -+ return p[5]; -+} -+ - CGPUMEM::CGPUMEM(unsigned int numbytes, bool cached) - { - m_numbytes = numbytes; -@@ -369,4 +427,81 @@ void CGPUMEM::Flush() - vcsm_clean_invalid( &iocache ); - } - -+#define T 0 -+#define W 0xffffffff -+#define B 0xff000000 -+ -+const static uint32_t default_cursor_pixels[] = -+{ -+ B,B,B,B,B,B,B,B,B,T,T,T,T,T,T,T, -+ B,W,W,W,W,W,W,B,T,T,T,T,T,T,T,T, -+ B,W,W,W,W,W,B,T,T,T,T,T,T,T,T,T, -+ B,W,W,W,W,B,T,T,T,T,T,T,T,T,T,T, -+ B,W,W,W,W,W,B,T,T,T,T,T,T,T,T,T, -+ B,W,W,B,W,W,W,B,T,T,T,T,T,T,T,T, -+ B,W,B,T,B,W,W,W,B,T,T,T,T,T,T,T, -+ B,B,T,T,T,B,W,W,W,B,T,T,T,T,T,T, -+ B,T,T,T,T,T,B,W,W,W,B,T,T,T,T,T, -+ T,T,T,T,T,T,T,B,W,W,W,B,T,T,T,T, -+ T,T,T,T,T,T,T,T,B,W,W,W,B,T,T,T, -+ T,T,T,T,T,T,T,T,T,B,W,W,W,B,T,T, -+ T,T,T,T,T,T,T,T,T,T,B,W,W,W,B,T, -+ T,T,T,T,T,T,T,T,T,T,T,B,W,W,W,B, -+ T,T,T,T,T,T,T,T,T,T,T,T,B,W,B,T, -+ T,T,T,T,T,T,T,T,T,T,T,T,T,B,T,T -+}; -+ -+#undef T -+#undef W -+#undef B -+ -+void CRBP::init_cursor() -+{ -+ if (!m_mb) -+ return; -+ if (!m_p) -+ m_p = new CGPUMEM(64 * 64 * 4, false); -+ if (m_p && m_p->m_arm && m_p->m_vc) -+ set_cursor(default_cursor_pixels, 16, 16, 0, 0); -+} -+ -+void CRBP::set_cursor(const void *pixels, int width, int height, int hotspot_x, int hotspot_y) -+{ -+ if (!m_mb || !m_p || !m_p->m_arm || !m_p->m_vc || !pixels || width * height > 64 * 64) -+ return; -+ memcpy(m_p->m_arm, pixels, width * height * 4); -+ unsigned int s = mailbox_set_cursor_info(m_mb, width, height, 0, m_p->m_vc, hotspot_x, hotspot_y); -+ assert(s == 0); -+} -+ -+void CRBP::update_cursor(int x, int y, bool enabled) -+{ -+ if (!m_mb || !m_p || !m_p->m_arm || !m_p->m_vc) -+ return; -+ -+ RESOLUTION res = g_graphicsContext.GetVideoResolution(); -+ CRect gui(0, 0, CDisplaySettings::GetInstance().GetResolutionInfo(res).iWidth, CDisplaySettings::GetInstance().GetResolutionInfo(res).iHeight); -+ CRect display(0, 0, CDisplaySettings::GetInstance().GetResolutionInfo(res).iScreenWidth, CDisplaySettings::GetInstance().GetResolutionInfo(res).iScreenHeight); -+ -+ int x2 = x * display.Width() / gui.Width(); -+ int y2 = y * display.Height() / gui.Height(); -+ -+ if (g_graphicsContext.GetStereoMode() == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) -+ y2 *= 2; -+ else if (g_graphicsContext.GetStereoMode() == RENDER_STEREO_MODE_SPLIT_VERTICAL) -+ x2 *= 2; -+ if (m_x != x2 || m_y != y2 || m_enabled != enabled) -+ mailbox_set_cursor_position(m_mb, enabled, x2, y2); -+ m_x = x2; -+ m_y = y2; -+ m_enabled = enabled; -+} -+ -+void CRBP::uninit_cursor() -+{ -+ if (!m_mb || !m_p || !m_p->m_arm || !m_p->m_vc) -+ return; -+ mailbox_set_cursor_position(m_mb, 0, 0, 0); -+} -+ - #endif -diff --git a/xbmc/linux/RBP.h b/xbmc/linux/RBP.h -index fffa5182126159f6dfcf750b21fa0464e229e545..90b04db5405058be2ff20aeaa6af2d2ac651586f 100644 ---- a/xbmc/linux/RBP.h -+++ b/xbmc/linux/RBP.h -@@ -103,6 +103,15 @@ private: - CCriticalSection m_critSection; - - int m_mb; -+ CGPUMEM *m_p; -+ int m_x; -+ int m_y; -+ bool m_enabled; -+ public: -+ void init_cursor(); -+ void set_cursor(const void *pixels, int width, int height, int hotspot_x, int hotspot_y); -+ void update_cursor(int x, int y, bool enabled); -+ void uninit_cursor(); - }; - - extern CRBP g_RBP; -diff --git a/xbmc/windowing/WinEventsLinux.cpp b/xbmc/windowing/WinEventsLinux.cpp -index a958a23d7185a1dce59fc6c3f8854d177068ace4..70f0e4d3f2ac6c706e7c477d0a6e5ee2999dc88b 100644 ---- a/xbmc/windowing/WinEventsLinux.cpp -+++ b/xbmc/windowing/WinEventsLinux.cpp -@@ -30,11 +30,26 @@ - #include "utils/log.h" - #include "powermanagement/PowerManager.h" - -+#ifdef TARGET_RASPBERRY_PI -+#include "utils/TimeUtils.h" -+#include "guilib/Resolution.h" -+#include "addons/Skin.h" -+#include "utils/XMLUtils.h" -+#include "utils/StringUtils.h" -+#include "guilib/Texture.h" -+#include "linux/RBP.h" -+#include "input/InputManager.h" -+#endif -+ - bool CWinEventsLinux::m_initialized = false; - CLinuxInputDevices CWinEventsLinux::m_devices; - - CWinEventsLinux::CWinEventsLinux() - { -+#ifdef TARGET_RASPBERRY_PI -+ m_last_mouse_move_time = 0; -+ m_mouse_state = -1; -+#endif - } - - void CWinEventsLinux::RefreshDevices() -@@ -48,6 +63,72 @@ bool CWinEventsLinux::IsRemoteLowBattery() - return false; - } - -+#ifdef TARGET_RASPBERRY_PI -+bool CWinEventsLinux::LoadXML(const std::string strFileName) -+{ -+ RESOLUTION_INFO m_coordsRes; // resolution that the window coordinates are in. -+ // Find appropriate skin folder + resolution to load from -+ std::string strFileNameLower = strFileName; -+ StringUtils::ToLower(strFileNameLower); -+ std::string strLowerPath = g_SkinInfo->GetSkinPath(strFileNameLower, &m_coordsRes); -+ std::string strPath = g_SkinInfo->GetSkinPath(strFileName, &m_coordsRes); -+ -+ TiXmlElement* pRootElement = NULL; -+ CXBMCTinyXML xmlDoc; -+ std::string strPathLower = strPath; -+ StringUtils::ToLower(strPathLower); -+ if (!xmlDoc.LoadFile(strPath) && !xmlDoc.LoadFile(strPathLower) && !xmlDoc.LoadFile(strLowerPath)) -+ { -+ CLog::Log(LOGERROR, "unable to load:%s, Line %d\n%s", strPath.c_str(), xmlDoc.ErrorRow(), xmlDoc.ErrorDesc()); -+ return false; -+ } -+ pRootElement = (TiXmlElement*)xmlDoc.RootElement()->Clone(); -+ -+ if (!pRootElement) -+ return false; -+ -+ if (strcmpi(pRootElement->Value(), "window")) -+ { -+ CLog::Log(LOGERROR, "file : XML file doesnt contain "); -+ return false; -+ } -+ -+ TiXmlElement *pChild = pRootElement->FirstChildElement(); -+ while (pChild) -+ { -+ if (strcmpi(pChild->Value(), "controls") == 0) -+ { -+ TiXmlElement *pControl = pChild->FirstChildElement(); -+ while (pControl) -+ { -+ if (strcmpi(pControl->Value(), "control") == 0) -+ { -+ std::string strStringValue; -+ if (XMLUtils::GetString(pControl, "texture", strStringValue)) -+ { -+ const char* idAttr = pControl->Attribute("id"); -+ int index = idAttr ? atoi(idAttr)-1 : -1; -+ if (index >= 0 && index < (int)(sizeof m_cursors/sizeof *m_cursors)) -+ { -+ if (m_cursors[index].m_filename.size()) -+ g_TextureManager.ReleaseTexture(m_cursors[index].m_filename, true); -+ m_cursors[index].m_filename.clear(); -+ m_cursors[index].m_texture = g_TextureManager.Load(strStringValue); -+ if (m_cursors[index].m_texture.size()) -+ m_cursors[index].m_filename = strStringValue; -+ } -+ } -+ } -+ pControl = pControl->NextSiblingElement(); -+ } -+ } -+ pChild = pChild->NextSiblingElement(); -+ } -+ delete pRootElement; -+ return true; -+} -+#endif -+ - bool CWinEventsLinux::MessagePump() - { - if (!m_initialized) -@@ -55,13 +136,50 @@ bool CWinEventsLinux::MessagePump() - m_devices.InitAvailable(); - m_checkHotplug = std::unique_ptr(new CLinuxInputDevicesCheckHotplugged(m_devices)); - m_initialized = true; -+#ifdef TARGET_RASPBERRY_PI -+ LoadXML("Pointer.xml"); -+#endif - } - - bool ret = false; - XBMC_Event event = {0}; -+#ifdef TARGET_RASPBERRY_PI -+ bool active = CInputManager::GetInstance().IsMouseActive(); -+ int64_t Now = CurrentHostCounter(); -+ if (!active) -+ { -+ if (m_mouse_state != -1) -+ { -+ g_RBP.update_cursor(0, 0, 0); -+ m_mouse_state = -1; -+ } -+ } -+ else -+ { -+ int state = CInputManager::GetInstance().GetMouseState() - 1; -+ if (m_mouse_state != state) -+ { -+ if (state >= 0 && state < (int)(sizeof m_cursors/sizeof *m_cursors) && !m_cursors[state].m_texture.m_textures.empty()) -+ { -+ CBaseTexture *t = (m_cursors[state].m_texture.m_textures)[0]; -+ if (t) -+ g_RBP.set_cursor((const void *)t->GetPixels(), t->GetPitch()>>2, t->GetRows(), 0, 0); -+ } -+ m_mouse_state = state; -+ } -+ } -+#endif - while (1) - { - event = m_devices.ReadEvent(); -+#ifdef TARGET_RASPBERRY_PI -+ if (active && (event.type == XBMC_MOUSEMOTION || event.type == XBMC_MOUSEBUTTONDOWN || event.type == XBMC_MOUSEBUTTONUP)) -+ { -+ if (event.type == XBMC_MOUSEMOTION) -+ g_RBP.update_cursor(event.motion.x, event.motion.y, 1); -+ m_last_mouse_move_time = Now; -+ } -+#endif - if (event.type != XBMC_NOEVENT) - { - ret |= g_application.OnEvent(event); -@@ -72,6 +190,13 @@ bool CWinEventsLinux::MessagePump() - } - } - -+#ifdef TARGET_RASPBERRY_PI -+ if (active && Now - m_last_mouse_move_time > 5 * 1000000000LL) -+ { -+ g_RBP.update_cursor(0, 0, 0); -+ m_mouse_state = -1; -+ } -+#endif - return ret; - } - -diff --git a/xbmc/windowing/WinEventsLinux.h b/xbmc/windowing/WinEventsLinux.h -index 1b1d2f2e60334ed0f3a9964d106957f58e69f1b3..c82ba84625fe3556ff49764d40ceb3ec220114e1 100644 ---- a/xbmc/windowing/WinEventsLinux.h -+++ b/xbmc/windowing/WinEventsLinux.h -@@ -25,6 +25,7 @@ - #include - #include "windowing/WinEvents.h" - #include "input/linux/LinuxInputDevices.h" -+#include "guilib/TextureManager.h" - - class CWinEventsLinux : public IWinEvents - { -@@ -45,6 +46,16 @@ private: - static bool m_initialized; - static CLinuxInputDevices m_devices; - std::unique_ptr m_checkHotplug; -+#ifdef TARGET_RASPBERRY_PI -+ bool LoadXML(const std::string strFileName); -+ int64_t m_last_mouse_move_time; -+ struct -+ { -+ std::string m_filename; -+ CTextureArray m_texture; -+ } m_cursors[4]; -+ int m_mouse_state; -+#endif - }; - - #endif - -From 8ec830426891523384c72770524644469ba58d78 Mon Sep 17 00:00:00 2001 +From f972d5b044f4cee30fcfe87371751f35b2f56d51 Mon Sep 17 00:00:00 2001 From: Claudio-Sjo Date: Mon, 16 Feb 2015 14:51:26 +0100 -Subject: [PATCH 21/73] - allow reads < CDIO_CD_FRAMESIZE_RAW by using a buffer +Subject: [PATCH 22/63] - allow reads < CDIO_CD_FRAMESIZE_RAW by using a buffer - fixes #15794 --- @@ -2150,10 +1787,10 @@ index 0427af4534bfe59a343f0518c7f4242d93299836..e99236294fa8b9b613e465a8ecaf3ad3 lsn_t m_lsnCurrent; // Position inside the track in logical sector number lsn_t m_lsnEnd; // End of m_iTrack in logical sector number -From 285514a249509a62393980e93dd4b30906e702e5 Mon Sep 17 00:00:00 2001 +From 96c9a7bcce868adebd570d86fd3411d83c8aed9f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 24 Jun 2016 19:38:13 +0100 -Subject: [PATCH 22/73] codecoverlay: Include codec name in overlay +Subject: [PATCH 23/63] codecoverlay: Include codec name in overlay --- xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp | 4 ++++ @@ -2179,10 +1816,10 @@ index f822935ab7fc919128db53f70a6c4eb84d9759bc..9db3a9cc91fd5f9b194d6c1aa66aa021 //print the inverse of the resample ratio, since that makes more sense //if the resample ratio is 0.5, then we're playing twice as fast diff --git a/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp b/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp -index c1e91b52884b7268c580ef6814596832cdf222c7..babe49ec6c4a3650b17ddcf9b1f20ada93551e1d 100644 +index 89db27cce079e3e273050f2fa71f941f21b8280b..903f0d83527d9088ff1bf0ba056f357f6abfda81 100644 --- a/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp +++ b/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp -@@ -917,10 +917,13 @@ int CVideoPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) +@@ -895,10 +895,13 @@ int CVideoPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) std::string CVideoPlayerVideo::GetPlayerInfo() { @@ -2213,7 +1850,7 @@ index 1e5d2b98bbef15b47994c3e4735873a9946b58c7..d43350fa0eefb5960475a02c1327efc2 return s.str(); } diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index e9444d10405a88cef5d1e34ab5325802f0a938ea..84f389f6e37381a22db024667eebe4e8113857db 100644 +index a4b663d43d5b626e351256a1dd10650a282b494c..f6fb241dfec9269f4e501248de4dc83d5fdc2d3a 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp @@ -593,12 +593,14 @@ void OMXPlayerVideo::SetSpeed(int speed) @@ -2247,10 +1884,10 @@ index 0df7e72cc9d1947173c2bac5e72eb09976b51aa5..b5050081c360d29b1b478c27e6b88291 double m_iSubtitleDelay; bool m_bRenderSubs; -From dbbdecf89a7496be839920f2efb6105bba0fb059 Mon Sep 17 00:00:00 2001 +From d3b64baa508e43fc2e1d108653754b3abcb3ab56 Mon Sep 17 00:00:00 2001 From: Anton Fedchin Date: Tue, 8 Mar 2016 21:20:58 +0300 -Subject: [PATCH 23/73] [DebugInfo] Add cpu usage info. +Subject: [PATCH 24/63] [DebugInfo] Add cpu usage info. --- .../VideoPlayer/VideoRenderers/DebugRenderer.cpp | 56 ++++++++-------------- @@ -2387,7 +2024,7 @@ index 85aefaace73994730f7d2bdff9de85c79e99b2a2..8005a13bc220be0c5c596d276197c11e }; \ No newline at end of file diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp -index b2c09cad49daab09794b375c643dfb670597e68e..d38031da337aa9ff180c2866c5d5924c8537978e 100644 +index 482142e46a714d1821d0bb25a552b043d6dcce66..54cf477648bba4583904cf122b4e66f6bbdd9469 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp @@ -24,6 +24,7 @@ @@ -2420,10 +2057,10 @@ index b2c09cad49daab09794b375c643dfb670597e68e..d38031da337aa9ff180c2866c5d5924c m_debugTimer.Set(1000); -From 7260435be2b9f432dd40d0296e301d89a1c85db6 Mon Sep 17 00:00:00 2001 +From eb2da354526d4f0dedd27542d28f358bafddf868 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 22 May 2015 13:56:29 +0100 -Subject: [PATCH 24/73] ffmpeg: Allow neon to be enabled in unified builds +Subject: [PATCH 25/63] ffmpeg: Allow neon to be enabled in unified builds --- tools/depends/target/ffmpeg/Makefile | 4 ++++ @@ -2446,10 +2083,10 @@ index 8dd14cdfd053f142f386b6dee1fc0b21bb1f8d93..b5f38a458dfb341c43089e07afded153 ifeq ($(OS), linux) ffmpg_config += --target-os=$(OS) --cpu=$(CPU) -From 06bd1e13b97ac36991da8b844b6c23c7c4db25ed Mon Sep 17 00:00:00 2001 +From f3d6aa22f4d91deedc2b54096b762a7a8d99c440 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 27 Feb 2015 14:37:27 +0000 -Subject: [PATCH 25/73] ffmpeg: Add some upstream HEVC optimisations +Subject: [PATCH 26/63] ffmpeg: Add some upstream HEVC optimisations --- tools/depends/target/ffmpeg/Makefile | 6 +- @@ -5819,10 +5456,10 @@ index 0000000000000000000000000000000000000000..792b5fea581613a6fe9108443357f975 +2.5.0 + diff --git a/tools/depends/target/ffmpeg/autobuild.sh b/tools/depends/target/ffmpeg/autobuild.sh -index e491c788793fa5df35e4570b54d7606183350376..1a169999f75813a3f8e18185ced0620d445dee1f 100755 +index dde29adf425e54f54e4104b3370352db0be6ef40..83369203fef720456080f4119822e7fe3631ca1a 100755 --- a/tools/depends/target/ffmpeg/autobuild.sh +++ b/tools/depends/target/ffmpeg/autobuild.sh -@@ -128,6 +128,8 @@ cd "ffmpeg-${VERSION}" || exit 2 +@@ -133,6 +133,8 @@ cd "ffmpeg-${VERSION}" || exit 2 tar --strip-components=1 -xf $MYDIR/${ARCHIVE} patch -p1 < ../0001-mpeg4video-Signal-unsupported-GMC-with-more-than-one.patch @@ -6247,10 +5884,10 @@ index 0000000000000000000000000000000000000000..5e8e07d407f045fc99554f0f061d1e81 +2.5.0 + -From 6d77c3fa90ff76fbe476911dcd70a4e2bf4461b4 Mon Sep 17 00:00:00 2001 +From 86764acae60faf07ae737a25e5232fa32b69f584 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 7 May 2015 14:04:18 +0100 -Subject: [PATCH 26/73] [ffmpeg] Add GPU acceleration to hevc +Subject: [PATCH 27/63] [ffmpeg] Add GPU acceleration to hevc --- tools/depends/target/ffmpeg/Makefile | 4 +- @@ -6282,10 +5919,10 @@ index c46b533e47497cb7b1e7200eff2cee1a6f2a1a2f..48f8d56988718dd53294e8291a53e532 cd $(PLATFORM);\ CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \ diff --git a/tools/depends/target/ffmpeg/autobuild.sh b/tools/depends/target/ffmpeg/autobuild.sh -index 1a169999f75813a3f8e18185ced0620d445dee1f..e2641093d15e5b465fae7e5f87c3ea18573dd6ee 100755 +index 83369203fef720456080f4119822e7fe3631ca1a..d6856dbd4fb4957ace700cbc08332223c01938f6 100755 --- a/tools/depends/target/ffmpeg/autobuild.sh +++ b/tools/depends/target/ffmpeg/autobuild.sh -@@ -130,6 +130,7 @@ tar --strip-components=1 -xf $MYDIR/${ARCHIVE} +@@ -135,6 +135,7 @@ tar --strip-components=1 -xf $MYDIR/${ARCHIVE} patch -p1 < ../0001-mpeg4video-Signal-unsupported-GMC-with-more-than-one.patch patch -p1 < ../hevcdsp_ARM_NEON_optimized_epel_functions.patch patch -p1 < ../added_ARM_NEON_optimized_SAO_patches.patch @@ -44436,10 +44073,10 @@ index 0000000000000000000000000000000000000000..e172ebf157aebffe1ae50b4a2b25fd71 +2.7.4 + -From 8dde9060e177029f52161cd53dd24afe6edbdee7 Mon Sep 17 00:00:00 2001 +From 6a887bec79c0c9c51ecfdf826d9d9673bcc9f288 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 12 Jan 2016 16:29:57 +0000 -Subject: [PATCH 27/73] ffmpeg: Add cabac opimisations for hevc +Subject: [PATCH 28/63] ffmpeg: Add cabac opimisations for hevc --- .../0001-Squashed-commit-of-the-following.patch | 2179 ++++++++++++++++++++ @@ -46664,10 +46301,10 @@ index 48f8d56988718dd53294e8291a53e532f0ff338d..337dbaab927919858e44d79f647207ef cd $(PLATFORM);\ CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \ diff --git a/tools/depends/target/ffmpeg/autobuild.sh b/tools/depends/target/ffmpeg/autobuild.sh -index e2641093d15e5b465fae7e5f87c3ea18573dd6ee..41248acbe1ff6d8883e55678ae256b566bf925c3 100755 +index d6856dbd4fb4957ace700cbc08332223c01938f6..a61357f14cb2139e8125ae04684bed1b29fefb12 100755 --- a/tools/depends/target/ffmpeg/autobuild.sh +++ b/tools/depends/target/ffmpeg/autobuild.sh -@@ -131,6 +131,7 @@ patch -p1 < ../0001-mpeg4video-Signal-unsupported-GMC-with-more-than-one.patch +@@ -136,6 +136,7 @@ patch -p1 < ../0001-mpeg4video-Signal-unsupported-GMC-with-more-than-one.patch patch -p1 < ../hevcdsp_ARM_NEON_optimized_epel_functions.patch patch -p1 < ../added_ARM_NEON_optimized_SAO_patches.patch patch -p1 < ../pfcd_hevc_optimisations.patch @@ -46675,7 +46312,7 @@ index e2641093d15e5b465fae7e5f87c3ea18573dd6ee..41248acbe1ff6d8883e55678ae256b56 CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" \ ./configure --prefix=$FFMPEG_PREFIX \ -@@ -165,6 +166,7 @@ CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" \ +@@ -170,6 +171,7 @@ CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" \ --enable-zlib \ --disable-mipsdsp \ --disable-mipsdspr2 \ @@ -46684,10 +46321,10 @@ index e2641093d15e5b465fae7e5f87c3ea18573dd6ee..41248acbe1ff6d8883e55678ae256b56 make -j ${BUILDTHREADS} -From a76e212aeac830e30521517ec45f88d6934881e6 Mon Sep 17 00:00:00 2001 +From 55692ec5212ee1967dceb12271886d4438845257 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 16 Sep 2015 19:05:12 +0100 -Subject: [PATCH 28/73] [3d] Make MVC a valid 3D filename tag +Subject: [PATCH 29/63] [3d] Make MVC a valid 3D filename tag --- xbmc/guilib/StereoscopicsManager.cpp | 9 +++++++++ @@ -46716,7 +46353,7 @@ index b34873cba6534086ae243326550385867a03256a..1443acaf0f25df458ae49766e13dd032 } diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index 03f566d3ee4eab690d2236b7739080269d552511..60e5652f69e96a559d8080e01dc214a56fb19343 100644 +index 3891a7ed34acb3489a860678d56a8ec049890f6e..974305ff329eb6999c908d5e05d723f93137ae33 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp @@ -402,6 +402,7 @@ void CAdvancedSettings::Initialize() @@ -46727,7 +46364,7 @@ index 03f566d3ee4eab690d2236b7739080269d552511..60e5652f69e96a559d8080e01dc214a5 m_useDisplayControlHWStereo = false; -@@ -516,6 +517,7 @@ void CAdvancedSettings::ParseSettingsFile(const std::string &file) +@@ -551,6 +552,7 @@ void CAdvancedSettings::ParseSettingsFile(const std::string &file) XMLUtils::GetString(pElement, "stereoscopicregex3d", m_stereoscopicregex_3d); XMLUtils::GetString(pElement, "stereoscopicregexsbs", m_stereoscopicregex_sbs); XMLUtils::GetString(pElement, "stereoscopicregextab", m_stereoscopicregex_tab); @@ -46748,10 +46385,10 @@ index fc526d11c3a78bc74125429120e29bf295bd3b16..6b0e3b8cf9e3ff40e6af758c54fe7eef bool m_useDisplayControlHWStereo; -From 787ee8e5ad59ef95b9c6e02f8b54ce942922c87c Mon Sep 17 00:00:00 2001 +From 317d4c5e46f0530b27f5ba01179e34175d8e9a03 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 5 Oct 2015 14:58:05 +0100 -Subject: [PATCH 29/73] [3d] Swap top/bottom sides of GUI +Subject: [PATCH 30/63] [3d] Swap top/bottom sides of GUI --- xbmc/guilib/GraphicContext.cpp | 2 +- @@ -46771,10 +46408,10 @@ index 3706e4d80b3b31da4c5be0a1b21f36e59d2910f2..e170b3fb05279ffa316794dbce1d4f9d } if(m_stereoMode == RENDER_STEREO_MODE_SPLIT_VERTICAL) -From 266b32ce92b7794c18301d74338408bf570e1375 Mon Sep 17 00:00:00 2001 +From 1a9778af9ccb8c27a58a82907b6f1d18ac84a2a7 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 11 Oct 2015 20:51:37 +0100 -Subject: [PATCH 30/73] Revert "Revert "Disable extra logging by default"" +Subject: [PATCH 31/63] Revert "Revert "Disable extra logging by default"" This reverts commit a880554325be187b877cd8f0e2b338e7267da636. --- @@ -46782,10 +46419,10 @@ This reverts commit a880554325be187b877cd8f0e2b338e7267da636. 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index 785b431b40eb7fad5791bca97c1d20ef4c3d4817..291a781e33496a0e6fe5cd869c857f5a851586ce 100644 +index 326ffbd0f08428c3b4a95208134253feeabf1b1f..22dcff1c06577055f84c3d2c2fda73cfa16c53d4 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml -@@ -2825,12 +2825,12 @@ +@@ -2822,12 +2822,12 @@
1 @@ -46801,32 +46438,10 @@ index 785b431b40eb7fad5791bca97c1d20ef4c3d4817..291a781e33496a0e6fe5cd869c857f5a loggingcomponents , -From d385c7c046adc03f7fd7357a722ec2b0305361f7 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 26 Nov 2015 17:14:49 +0000 -Subject: [PATCH 31/73] [ae] Add debug logging showing resamplerate - ---- - xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -index f5671b8dfb03216301d936ae3b08bfc3e8225729..7db4a6e3610ccea32fe19574b4f2838d4a3a2bdb 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -@@ -2457,6 +2457,7 @@ CSampleBuffer* CActiveAE::SyncStream(CActiveAEStream *stream) - if (stream->m_processingBuffers) - { - stream->m_processingBuffers->SetRR(stream->CalcResampleRatio(error), m_settings.atempoThreshold); -+ CLog::Log(LOGDEBUG, "CDVDPlayerAudio::%s rr:%.5f threshold:%.3f error:%.6f", __FUNCTION__, stream->m_processingBuffers->GetRR(), m_settings.atempoThreshold, error); - } - } - else if (stream->m_processingBuffers) - -From b592933a9bf174678474554b552734fa101ea430 Mon Sep 17 00:00:00 2001 +From 4800a5c41c44a33c3bccb52716474ed77309e21e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 21 Dec 2015 22:17:25 +0000 -Subject: [PATCH 32/73] [omximage] Fall back to arm jpeg encode/decode when gpu +Subject: [PATCH 32/63] [omximage] Fall back to arm jpeg encode/decode when gpu is busy --- @@ -47069,10 +46684,10 @@ index a93aa82663903fb1bf712058c2e259290ee742e6..6f38dbc7e5cc721c59a3633935f08218 extern COMXImage g_OMXImage; -From fb991421a324fc5245614fca885a36f7554a3fc2 Mon Sep 17 00:00:00 2001 +From 3834081dfbf66a8faa92a5f514c86de0b6c09179 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 9 Dec 2015 13:31:14 +0000 -Subject: [PATCH 33/73] [mmalcodec] Fail to open when width is invalid. Can +Subject: [PATCH 33/63] [mmalcodec] Fail to open when width is invalid. Can happen with mpegts files --- @@ -47080,7 +46695,7 @@ Subject: [PATCH 33/73] [mmalcodec] Fail to open when width is invalid. Can 1 file changed, 3 insertions(+) diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -index aa20f18cbea80ed68c1307470289525bd5db29e3..cead68bd79d388f0eda0f8a79f17d296478d3361 100644 +index 1884c27272ad98ba5f8cbc7f275a7d9850cfab1d..e757ca64c1caf5c43988c2cb77da159b8f8eee93 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp @@ -368,6 +368,9 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) @@ -47094,10 +46709,10 @@ index aa20f18cbea80ed68c1307470289525bd5db29e3..cead68bd79d388f0eda0f8a79f17d296 if (!CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_USEMMAL) || hints.software) return false; -From d3e36c19b8c0382ad963c316822703aaf2f082c8 Mon Sep 17 00:00:00 2001 +From c8985bee54655c26528c3b8ed5101d8f669f17f6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 19 Sep 2014 11:54:49 +0100 -Subject: [PATCH 34/73] [videoplayer/rbp] Add pi specific option to maintain +Subject: [PATCH 34/63] [videoplayer/rbp] Add pi specific option to maintain vsync with pll adjustment New A/V sync option in settings/video/playback to do "Adjust PLL". @@ -47106,23 +46721,23 @@ or drop/dupe audio packets which is normally required. --- .../resource.language.en_gb/resources/strings.po | 32 ++++++++++++++++++++++ system/settings/rbp.xml | 14 ++++++++++ - .../AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 31 +++++++++++++++------ + .../AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 25 +++++++++++------ xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h | 9 +++++- - .../Engines/ActiveAE/ActiveAEStream.cpp | 7 +++-- - .../AudioEngine/Engines/ActiveAE/ActiveAEStream.h | 4 ++- + .../Engines/ActiveAE/ActiveAEStream.cpp | 24 +++++++++++++--- + .../AudioEngine/Engines/ActiveAE/ActiveAEStream.h | 7 +++-- xbmc/cores/AudioEngine/Interfaces/AEStream.h | 10 ++++++- xbmc/cores/VideoPlayer/DVDAudio.cpp | 4 +-- xbmc/cores/VideoPlayer/DVDAudio.h | 2 +- xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp | 12 ++++++-- - xbmc/linux/RBP.cpp | 13 +++++++++ - xbmc/linux/RBP.h | 3 ++ - 12 files changed, 122 insertions(+), 19 deletions(-) + xbmc/linux/RBP.cpp | 20 ++++++++++++++ + xbmc/linux/RBP.h | 5 ++++ + 12 files changed, 143 insertions(+), 21 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index ca11841fdb24ed2f420e1b9ff92ed3e184af2fc3..7ace950c83e1497b4d96a31b33b524e7eafb1783 100644 +index ae3aa10aa65beac6689f129d60056cadf8a5b5c1..7c7969d381bf15ac1ba2fd8f16e463f6b12fe4c3 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po -@@ -19682,3 +19682,35 @@ msgstr "" +@@ -19767,3 +19767,35 @@ msgstr "" msgctxt "#38190" msgid "Extract thumbnails from video files" msgstr "" @@ -47184,21 +46799,10 @@ index 289dc55ec41aa44848519a05f8ee1ccc72740085..2572e25753712186f69390965ee1448b diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -index 7db4a6e3610ccea32fe19574b4f2838d4a3a2bdb..497b4433ed5fa45051b9b344cd59d949603ccda2 100644 +index f5671b8dfb03216301d936ae3b08bfc3e8225729..68399ab14faf813bd195d2fdf03a4a376307b4cd 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -@@ -34,6 +34,10 @@ using namespace ActiveAE; - #include "windowing/WindowingFactory.h" - #include "utils/log.h" - -+#if defined(TARGET_RASPBERRY_PI) -+#include "linux/RBP.h" -+#endif -+ - #define MAX_CACHE_LEVEL 0.4 // total cache time of stream in seconds - #define MAX_WATER_LEVEL 0.2 // buffered time after stream stages in seconds - #define MAX_BUFFER_TIME 0.1 // max time of a buffer in seconds -@@ -363,11 +367,12 @@ void CActiveAE::StateMachine(int signal, Protocol *port, Message *msg) +@@ -363,11 +363,12 @@ void CActiveAE::StateMachine(int signal, Protocol *port, Message *msg) m_sink.m_controlPort.SendOutMessage(CSinkControlProtocol::APPFOCUSED, msg->data, sizeof(bool)); return; case CActiveAEControlProtocol::STREAMRESAMPLEMODE: @@ -47214,25 +46818,23 @@ index 7db4a6e3610ccea32fe19574b4f2838d4a3a2bdb..497b4433ed5fa45051b9b344cd59d949 par->stream->m_resampleIntegral = 0.0; } return; -@@ -2452,7 +2457,16 @@ CSampleBuffer* CActiveAE::SyncStream(CActiveAEStream *stream) - if (!newerror || stream->m_syncState != CAESyncInfo::AESyncState::SYNC_INSYNC) - return ret; - -- if (stream->m_resampleMode) -+ if (stream->m_pllAdjust > 0) // pll adjust -+ { -+#if defined(TARGET_RASPBERRY_PI) -+ double e = std::max(std::min(error / 50.0, 1.0), -1.0); -+ double m_plladjust = 1.0 + e * stream->m_pllAdjust; -+ double m_last_plladjust = g_RBP.AdjustHDMIClock(m_plladjust); -+ CLog::Log(LOGDEBUG, "CDVDPlayerAudio::%s pll:%.5f (%.5f) error:%.6f e:%.6f a:%f", __FUNCTION__, m_plladjust, m_last_plladjust, error, e * stream->m_pllAdjust, stream->m_pllAdjust ); -+#endif -+ } -+ else if (stream->m_resampleMode) +@@ -2456,7 +2457,14 @@ CSampleBuffer* CActiveAE::SyncStream(CActiveAEStream *stream) { if (stream->m_processingBuffers) { -@@ -3323,13 +3337,14 @@ void CActiveAE::SetStreamResampleRatio(CActiveAEStream *stream, double ratio) +- stream->m_processingBuffers->SetRR(stream->CalcResampleRatio(error), m_settings.atempoThreshold); ++ double pllAdjustRequest = 0.0, pllAdjustActual = 0.0, e = 0.0; ++ if (stream->m_pllAdjust > 0.0) ++ { ++ e = std::max(std::min(error / 50.0, 1.0), - 1.0); ++ pllAdjustRequest = 1.0 + e * stream->m_pllAdjust; ++ } ++ stream->m_processingBuffers->SetRR(stream->CalcResampleRatio(error), m_settings.atempoThreshold, pllAdjustRequest, stream->m_pllAdjust, pllAdjustActual); ++ CLog::Log(LOGDEBUG, "ActiveAE::%s pll:%.5f (act:%.5f lim:%.5f) rr:%.5f threshold:%.3f error:%.6f", __FUNCTION__, pllAdjustRequest, pllAdjustActual, stream->m_pllAdjust, stream->m_processingBuffers->GetRR(), m_settings.atempoThreshold, error ); + } + } + else if (stream->m_processingBuffers) +@@ -3322,13 +3330,14 @@ void CActiveAE::SetStreamResampleRatio(CActiveAEStream *stream, double ratio) &msg, sizeof(MsgStreamParameter)); } @@ -47279,10 +46881,29 @@ index e29eb5719a2e24562a16180e53b2decd955e50a5..e2d3a6824ca0dc93fb08f3374c745ac1 void SetStreamFade(CActiveAEStream *stream, float from, float target, unsigned int millis); diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp -index 246d7e6c05242f1d64bbc3983b7342e24423ba8c..394459ab0581c2eef9c5e59b83c209d239c6b66a 100644 +index 246d7e6c05242f1d64bbc3983b7342e24423ba8c..6b009dcea60e7431d418286c7602e1c29e793cb5 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp -@@ -509,11 +509,12 @@ void CActiveAEStream::SetResampleRatio(double ratio) +@@ -29,6 +29,10 @@ + #include "ActiveAE.h" + #include "ActiveAEStream.h" + ++#if defined(TARGET_RASPBERRY_PI) ++#include "linux/RBP.h" ++#endif ++ + using namespace ActiveAE; + + /* typecast AE to CActiveAE */ +@@ -71,6 +75,7 @@ CActiveAEStream::CActiveAEStream(AEAudioFormat *format, unsigned int streamid) + m_lastPtsJump = 0; + m_errorInterval = 1000; + m_clockSpeed = 1.0; ++ m_pllAdjust = 0.0f; + } + + CActiveAEStream::~CActiveAEStream() +@@ -509,11 +514,12 @@ void CActiveAEStream::SetResampleRatio(double ratio) m_streamResampleRatio = ratio; } @@ -47298,11 +46919,41 @@ index 246d7e6c05242f1d64bbc3983b7342e24423ba8c..394459ab0581c2eef9c5e59b83c209d2 } void CActiveAEStream::SetFFmpegInfo(int profile, enum AVMatrixEncoding matrix_encoding, enum AVAudioServiceType audio_service_type) +@@ -714,8 +720,18 @@ bool CActiveAEStreamBuffers::IsDrained() + return false; + } + +-void CActiveAEStreamBuffers::SetRR(double rr, double atempoThreshold) ++void CActiveAEStreamBuffers::SetRR(double rr, double atempoThreshold, double pllAdjustRequest, double pllThreshold, double &pllAdjustActual) + { ++#if defined(TARGET_RASPBERRY_PI) ++ if (pllAdjustRequest > 0.0f) // pll adjust ++ { ++ pllAdjustActual = g_RBP.AdjustHDMIClock(pllAdjustRequest); ++ rr = 1.0; ++ } ++ else ++ pllAdjustActual = g_RBP.AdjustHDMIClock(1.0); ++#endif ++ + if (fabs(rr - 1.0) < atempoThreshold) + { + m_resampleBuffers->SetRR(rr); diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.h -index 531dedc71f8b342d1556518e1fb7cb051f334e88..927f93ed09d1b9dbc4a6a7dc6a8e2dceaa4ae7dc 100644 +index 531dedc71f8b342d1556518e1fb7cb051f334e88..80ab096a417d53fcdf7703d11437f92df23f6f46 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.h +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.h -@@ -169,7 +169,7 @@ public: +@@ -103,7 +103,8 @@ public: + void Flush(); + void SetDrain(bool drain); + bool IsDrained(); +- void SetRR(double rr, double atempoThreshold); ++ void SetRR(double rr, double atempoThreshold, double pllAdjustRequest, double pllThreshold, double &pllAdjustActual); ++ void SetRR(double rr, double atempoThreshold) { double pllAdjustActual; SetRR(rr, atempoThreshold, 0.0, 0.0, pllAdjustActual); } + double GetRR(); + void FillBuffer(); + bool DoesNormalize(); +@@ -169,7 +170,7 @@ public: virtual double GetResampleRatio(); virtual void SetResampleRatio(double ratio); @@ -47311,7 +46962,7 @@ index 531dedc71f8b342d1556518e1fb7cb051f334e88..927f93ed09d1b9dbc4a6a7dc6a8e2dce virtual void RegisterAudioCallback(IAudioCallback* pCallback); virtual void UnRegisterAudioCallback(); virtual void FadeVolume(float from, float to, unsigned int time); -@@ -186,6 +186,7 @@ protected: +@@ -186,6 +187,7 @@ protected: float m_streamAmplify; double m_streamResampleRatio; int m_streamResampleMode; @@ -47319,7 +46970,7 @@ index 531dedc71f8b342d1556518e1fb7cb051f334e88..927f93ed09d1b9dbc4a6a7dc6a8e2dce unsigned int m_streamSpace; bool m_streamDraining; bool m_streamDrained; -@@ -226,6 +227,7 @@ protected: +@@ -226,6 +228,7 @@ protected: int m_fadingTime; int m_profile; int m_resampleMode; @@ -47436,43 +47087,50 @@ index 9db3a9cc91fd5f9b194d6c1aa66aa02121164c29..56170f48cda417554c57b2adf934c2df if (!codec || codec->NeedPassthrough() == m_pAudioCodec->NeedPassthrough()) { // passthrough state has not changed diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp -index 92f20e5174dd6b886cf622460ac68ab5f2fe24b9..3618a68143d30391f937eb4bfdb6ed09dd86b9ce 100644 +index 5a6f780517cff0c31f1c40e5e95445d448eb2297..6e8529001b1a464b4547a846f553d98f5bc0b6c0 100644 --- a/xbmc/linux/RBP.cpp +++ b/xbmc/linux/RBP.cpp -@@ -49,6 +49,7 @@ CRBP::CRBP() +@@ -46,6 +46,8 @@ CRBP::CRBP() m_DllBcmHost = new DllBcmHost(); m_OMX = new COMXCore(); m_display = DISPMANX_NO_HANDLE; -+ m_last_pll_adjust = 1.0; - m_p = NULL; - m_x = 0; - m_y = 0; -@@ -162,6 +163,7 @@ void CRBP::CloseDisplay(DISPMANX_DISPLAY_HANDLE_T display) ++ m_requested_pll_adjust = -1.0; ++ m_actual_pll_adjust = -1.0; + m_mb = mbox_open(); + vcsm_init(); + m_vsync_count = 0; +@@ -153,6 +155,8 @@ void CRBP::CloseDisplay(DISPMANX_DISPLAY_HANDLE_T display) assert(s == 0); vc_dispmanx_display_close(m_display); m_display = DISPMANX_NO_HANDLE; -+ m_last_pll_adjust = 1.0; ++ m_requested_pll_adjust = -1.0; ++ m_actual_pll_adjust = -1.0; } void CRBP::GetDisplaySize(int &width, int &height) -@@ -504,4 +506,15 @@ void CRBP::uninit_cursor() - mailbox_set_cursor_position(m_mb, 0, 0, 0); +@@ -366,4 +370,20 @@ void CGPUMEM::Flush() + vcsm_clean_invalid( &iocache ); } +double CRBP::AdjustHDMIClock(double adjust) +{ + char response[80]; ++ ++ if (adjust == m_requested_pll_adjust) ++ return m_actual_pll_adjust; ++ ++ m_requested_pll_adjust = adjust; + vc_gencmd(response, sizeof response, "hdmi_adjust_clock %f", adjust); + char *p = strchr(response, '='); + if (p) -+ m_last_pll_adjust = atof(p+1); -+ CLog::Log(LOGDEBUG, "CRBP::%s(%.4f) = %.4f", __func__, adjust, m_last_pll_adjust); -+ return m_last_pll_adjust; ++ m_actual_pll_adjust = atof(p+1); ++ CLog::Log(LOGDEBUG, "CRBP::%s(%.5f) = %.5f", __func__, adjust, m_actual_pll_adjust); ++ return m_actual_pll_adjust; +} + #endif diff --git a/xbmc/linux/RBP.h b/xbmc/linux/RBP.h -index 90b04db5405058be2ff20aeaa6af2d2ac651586f..084fba87f49f4c3b33a8dd4a20a626a370a1f371 100644 +index fffa5182126159f6dfcf750b21fa0464e229e545..815d758e7086d73b4d4eb16849fdbb509a3c251d 100644 --- a/xbmc/linux/RBP.h +++ b/xbmc/linux/RBP.h @@ -82,6 +82,8 @@ public: @@ -47480,23 +47138,25 @@ index 90b04db5405058be2ff20aeaa6af2d2ac651586f..084fba87f49f4c3b33a8dd4a20a626a3 void VSyncCallback(); int GetMBox() { return m_mb; } + double AdjustHDMIClock(double adjust); -+ double GetAdjustHDMIClock() { return m_last_pll_adjust; } ++ double GetAdjustHDMIClock() { return m_actual_pll_adjust; } private: DllBcmHost *m_DllBcmHost; -@@ -107,6 +109,7 @@ private: - int m_x; - int m_y; - bool m_enabled; -+ double m_last_pll_adjust; - public: - void init_cursor(); - void set_cursor(const void *pixels, int width, int height, int hotspot_x, int hotspot_y); +@@ -103,6 +105,9 @@ private: + CCriticalSection m_critSection; + + int m_mb; ++ double m_requested_pll_adjust; ++ double m_actual_pll_adjust; ++ public: + }; + + extern CRBP g_RBP; -From 93d5e234c992e2b99148ecf128b46b321e49ed78 Mon Sep 17 00:00:00 2001 +From 044a640b88cd4a02095731737711d011577bf809 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 7 May 2015 15:35:43 +0100 -Subject: [PATCH 35/73] rbp: Support zero copy interface with hevc acceleration +Subject: [PATCH 35/63] rbp: Support zero copy interface with hevc acceleration --- xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 9 +++++++++ @@ -47504,7 +47164,7 @@ Subject: [PATCH 35/73] rbp: Support zero copy interface with hevc acceleration 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index b0bd4b5b4009520367525132a8455557830a3741..fc152c13ed5b17ccfbb0ab4c659dedf8fd63d6bd 100644 +index 4129d3d6a77ce1a3f15bad045746970f6e640ea6..619515c9411172261d8f0bef24c5d679c35e5d7d 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp @@ -368,6 +368,15 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options @@ -47524,12 +47184,12 @@ index b0bd4b5b4009520367525132a8455557830a3741..fc152c13ed5b17ccfbb0ab4c659dedf8 else { diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp -index 29c4e6d15dd838cf845c301ea1a1f4c05db29871..864650d488d0f5b3dc9f89f01aa5c3b845b92564 100644 +index e0ba70f31e3972f23e0231a16b9ba84f4b511d2c..d42e3090c9b38a43ee72fdc3780a244317ece11a 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp -@@ -290,8 +290,9 @@ bool CDecoder::GetPicture(AVCodecContext* avctx, AVFrame* frame, DVDVideoPicture - picture->MMALBuffer->mmal_buffer->data = (uint8_t *)gmem->m_vc_handle; +@@ -294,8 +294,9 @@ bool CDecoder::GetPicture(AVCodecContext* avctx, AVFrame* frame, DVDVideoPicture picture->MMALBuffer->mmal_buffer->alloc_size = picture->MMALBuffer->mmal_buffer->length = gmem->m_numbytes; + picture->MMALBuffer->m_stills = m_hints.stills; - // need to flush ARM cache so GPU can see it - gmem->Flush(); @@ -47540,10 +47200,10 @@ index 29c4e6d15dd838cf845c301ea1a1f4c05db29871..864650d488d0f5b3dc9f89f01aa5c3b8 if (g_advancedSettings.CanLogComponent(LOGVIDEO)) CLog::Log(LOGDEBUG, "%s::%s - mmal:%p dts:%.3f pts:%.3f buf:%p gpu:%p", CLASSNAME, __FUNCTION__, picture->MMALBuffer->mmal_buffer, 1e-6*picture->dts, 1e-6*picture->pts, picture->MMALBuffer, gmem); -From 2ba5f8b40e899f9ddd37b66803c65c4199324476 Mon Sep 17 00:00:00 2001 +From 534cd8664f784d6ce1dd59484f5cacafe90c9f9a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 16 May 2015 18:26:04 +0100 -Subject: [PATCH 36/73] ffmpeg: use upstream mvc patches +Subject: [PATCH 36/63] ffmpeg: use upstream mvc patches --- ...vcodec-add-h264_mvc-codec-id-and-profiles.patch | 68 ++++++++++++ @@ -47778,10 +47438,10 @@ index 337dbaab927919858e44d79f647207ef0513eea1..7e97e4d91a443d46d933df528763422f cd $(PLATFORM);\ CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \ diff --git a/tools/depends/target/ffmpeg/autobuild.sh b/tools/depends/target/ffmpeg/autobuild.sh -index 41248acbe1ff6d8883e55678ae256b566bf925c3..aa12d8d4ab30a43e405cac37d7daf1bc6686fe5a 100755 +index a61357f14cb2139e8125ae04684bed1b29fefb12..9f6c26c8acd08ed603aadeb4d9d81b07026e7506 100755 --- a/tools/depends/target/ffmpeg/autobuild.sh +++ b/tools/depends/target/ffmpeg/autobuild.sh -@@ -132,6 +132,9 @@ patch -p1 < ../hevcdsp_ARM_NEON_optimized_epel_functions.patch +@@ -137,6 +137,9 @@ patch -p1 < ../hevcdsp_ARM_NEON_optimized_epel_functions.patch patch -p1 < ../added_ARM_NEON_optimized_SAO_patches.patch patch -p1 < ../pfcd_hevc_optimisations.patch patch -p1 < ../0001-Squashed-commit-of-the-following.patch @@ -47853,10 +47513,43 @@ index 0000000000000000000000000000000000000000..b39480ad098b9cd0882fcf75b96afb1b +2.7.4 + -From b52627c29eb93ede720d7473f91b644f868e6691 Mon Sep 17 00:00:00 2001 +From 42c3af7c453ee02e0c83a267c150938389df0e4a Mon Sep 17 00:00:00 2001 +From: Anton Fedchin +Date: Fri, 29 Jan 2016 17:18:50 +0300 +Subject: [PATCH 37/63] [win32] Settings: Added setting to enable/disable MVC + decoder. + +--- + system/settings/win32.xml | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/system/settings/win32.xml b/system/settings/win32.xml +index a017d30c24232fb01220b87b29398403b8ed9662..2fcee72a64e8b701c8e895143410bbe9fd617356 100644 +--- a/system/settings/win32.xml ++++ b/system/settings/win32.xml +@@ -12,6 +12,17 @@ + false + + ++
++ ++ ++ ++ 2 ++ true ++ ++ ++ ++ ++
+
+ + + +From e717a6b60088a6c405c17503e3ab5ad1d1d67ecc Mon Sep 17 00:00:00 2001 From: Anton Fedchin Date: Wed, 20 Jan 2016 17:02:16 +0300 -Subject: [PATCH 37/73] [VideoPlayer] DemuxFFmpeg: Properly demuxing h264_mvc +Subject: [PATCH 38/63] [VideoPlayer] DemuxFFmpeg: Properly demuxing h264_mvc streams. --- @@ -47864,7 +47557,7 @@ Subject: [PATCH 37/73] [VideoPlayer] DemuxFFmpeg: Properly demuxing h264_mvc 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -index f00e95324849011df9d078432699030f6c4afae8..c673115f4c5b1f80a0f2beb157f2821a337debee 100644 +index b3bdc5a75b77af7dff90ded100a97b848db358da..62e110e816f21e60c1564029fe646a0a7e85f08d 100644 --- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp @@ -25,6 +25,7 @@ @@ -47875,7 +47568,7 @@ index f00e95324849011df9d078432699030f6c4afae8..c673115f4c5b1f80a0f2beb157f2821a #include "DVDClock.h" // for DVD_TIME_BASE #include "DVDDemuxUtils.h" #include "DVDInputStreams/DVDInputStream.h" -@@ -1332,6 +1333,15 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) +@@ -1354,6 +1355,15 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) } case AVMEDIA_TYPE_VIDEO: { @@ -47891,7 +47584,7 @@ index f00e95324849011df9d078432699030f6c4afae8..c673115f4c5b1f80a0f2beb157f2821a CDemuxStreamVideoFFmpeg* st = new CDemuxStreamVideoFFmpeg(this, pStream); stream = st; if(strcmp(m_pFormatContext->iformat->name, "flv") == 0) -@@ -1340,7 +1350,7 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) +@@ -1362,7 +1372,7 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) st->bVFR = false; // never trust pts in avi files with h264. @@ -47900,7 +47593,7 @@ index f00e95324849011df9d078432699030f6c4afae8..c673115f4c5b1f80a0f2beb157f2821a st->bPTSInvalid = true; #if defined(AVFORMAT_HAS_STREAM_GET_R_FRAME_RATE) -@@ -1411,6 +1421,17 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) +@@ -1433,6 +1443,17 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) if (av_dict_get(pStream->metadata, "title", NULL, 0)) st->m_description = av_dict_get(pStream->metadata, "title", NULL, 0)->value; @@ -47919,54 +47612,50 @@ index f00e95324849011df9d078432699030f6c4afae8..c673115f4c5b1f80a0f2beb157f2821a } case AVMEDIA_TYPE_DATA: -From 5e3d8ff9954cd60f9c896eabb9219b824d9844f3 Mon Sep 17 00:00:00 2001 +From 9a4d3b6f6b304d51aa12d734e023059926ef34c4 Mon Sep 17 00:00:00 2001 From: Anton Fedchin Date: Thu, 25 Feb 2016 11:21:25 +0300 -Subject: [PATCH 38/73] [Stereo3D] Added mvc modes. +Subject: [PATCH 39/63] [Stereo3D] Added block_lr and block_rl to supported + modes. --- - xbmc/cores/VideoPlayer/VideoRenderers/RenderFlags.cpp | 4 ++++ - xbmc/guilib/StereoscopicsManager.cpp | 6 +++++- - 2 files changed, 9 insertions(+), 1 deletion(-) + xbmc/cores/VideoPlayer/VideoRenderers/RenderFlags.cpp | 4 ++-- + xbmc/guilib/StereoscopicsManager.cpp | 8 +++++--- + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/RenderFlags.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/RenderFlags.cpp -index 24b1b10519467cbbfd96f7048efaf49aab7700cc..0b7b6178427302e0824734eb5c7aecd2a3b21a8c 100644 +index 24b1b10519467cbbfd96f7048efaf49aab7700cc..49f7f7ca7e144a259f6d06bd11cd97aa0b3242aa 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/RenderFlags.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/RenderFlags.cpp -@@ -104,6 +104,8 @@ namespace RenderManager { +@@ -102,8 +102,8 @@ namespace RenderManager { + convert["right_left"] = CONF_FLAGS_STEREO_MODE_SBS | CONF_FLAGS_STEREO_CADANCE_RIGHT_LEFT; + convert["anaglyph_green_magenta"] = 0u; convert["anaglyph_yellow_blue"] = 0u; - convert["block_lr"] = 0u; - convert["block_rl"] = 0u; -+ convert["mvc_lr"] = 0u; -+ convert["mvc_rl"] = 0u; +- convert["block_lr"] = 0u; +- convert["block_rl"] = 0u; ++ convert["block_lr"] = CONF_FLAGS_STEREO_CADANCE_LEFT_RIGHT; ++ convert["block_rl"] = CONF_FLAGS_STEREO_CADANCE_RIGHT_LEFT; } return convert[mode]; } -@@ -125,6 +127,8 @@ namespace RenderManager { - convert["col_interleaved_lr"] = "col_interleaved_rl"; - convert["block_lr"] = "block_rl"; - convert["block_rl"] = "block_lr"; -+ convert["mvc_lr"] = "mvc_rl"; -+ convert["mvc_rl"] = "mvc_lr"; - } - std::string res = convert[mode]; - if(res.empty()) diff --git a/xbmc/guilib/StereoscopicsManager.cpp b/xbmc/guilib/StereoscopicsManager.cpp -index 1443acaf0f25df458ae49766e13dd0323454f2eb..6eb0752994bc5f8c47efbbf211120af0a0720d0c 100644 +index 1443acaf0f25df458ae49766e13dd0323454f2eb..6aaa82f4d883b8cae0ccdedf6c5a6814e7aaa720 100644 --- a/xbmc/guilib/StereoscopicsManager.cpp +++ b/xbmc/guilib/StereoscopicsManager.cpp -@@ -72,6 +72,10 @@ static const struct StereoModeMap VideoModeToGuiModeMap[] = +@@ -70,8 +70,10 @@ static const struct StereoModeMap VideoModeToGuiModeMap[] = + { "anaglyph_cyan_red", RENDER_STEREO_MODE_ANAGLYPH_RED_CYAN }, + { "anaglyph_green_magenta", RENDER_STEREO_MODE_ANAGLYPH_GREEN_MAGENTA }, { "anaglyph_yellow_blue", RENDER_STEREO_MODE_ANAGLYPH_YELLOW_BLUE }, - { "block_lr", RENDER_STEREO_MODE_OFF }, // unsupported - { "block_rl", RENDER_STEREO_MODE_OFF }, // unsupported -+ { "mvc_lr", RENDER_STEREO_MODE_HARDWAREBASED }, -+ { "mvc_rl", RENDER_STEREO_MODE_HARDWAREBASED }, -+ { "mvc_lr", RENDER_STEREO_MODE_SPLIT_HORIZONTAL }, // fallback -+ { "mvc_rl", RENDER_STEREO_MODE_SPLIT_HORIZONTAL }, // fallback +- { "block_lr", RENDER_STEREO_MODE_OFF }, // unsupported +- { "block_rl", RENDER_STEREO_MODE_OFF }, // unsupported ++ { "block_lr", RENDER_STEREO_MODE_HARDWAREBASED }, ++ { "block_rl", RENDER_STEREO_MODE_HARDWAREBASED }, ++ { "block_lr", RENDER_STEREO_MODE_SPLIT_HORIZONTAL }, // fallback ++ { "block_rl", RENDER_STEREO_MODE_SPLIT_HORIZONTAL }, // fallback {} }; -@@ -310,7 +314,7 @@ int CStereoscopicsManager::ConvertVideoToGuiStereoMode(const std::string &mode) +@@ -310,7 +312,7 @@ int CStereoscopicsManager::ConvertVideoToGuiStereoMode(const std::string &mode) size_t i = 0; while (VideoModeToGuiModeMap[i].name) { @@ -47976,20 +47665,20 @@ index 1443acaf0f25df458ae49766e13dd0323454f2eb..6eb0752994bc5f8c47efbbf211120af0 i++; } -From 7e689b0ba66c1626583734f772dd449760e36ac8 Mon Sep 17 00:00:00 2001 +From 0d7219d8c5e63b80cf07e4d2e45d7af5d225cc16 Mon Sep 17 00:00:00 2001 From: Anton Fedchin Date: Sat, 23 Jan 2016 10:21:32 +0300 -Subject: [PATCH 39/73] [VideoPlayer] Fix possible wrong aspect. +Subject: [PATCH 40/63] [VideoPlayer] Fix possible wrong aspect. --- xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp b/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp -index babe49ec6c4a3650b17ddcf9b1f20ada93551e1d..693de6bc868b808eb746d6e304849e8a6c8d7e63 100644 +index 903f0d83527d9088ff1bf0ba056f357f6abfda81..a5a33d34c70892cde77ad4d8f3cb65fdd9703081 100644 --- a/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp +++ b/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp -@@ -182,7 +182,7 @@ void CVideoPlayerVideo::OpenStream(CDVDStreamInfo &hint, CDVDVideoCodec* codec) +@@ -181,7 +181,7 @@ void CVideoPlayerVideo::OpenStream(CDVDStreamInfo &hint, CDVDVideoCodec* codec) } // use aspect in stream if available @@ -47999,32 +47688,32 @@ index babe49ec6c4a3650b17ddcf9b1f20ada93551e1d..693de6bc868b808eb746d6e304849e8a else m_fForcedAspectRatio = 0.0; -From 4b756099637b1cb748fde03af22ea6276f979cbf Mon Sep 17 00:00:00 2001 +From 9f3dabbe75b336823dfe5ec3a453f9d48c4ee769 Mon Sep 17 00:00:00 2001 From: Anton Fedchin Date: Fri, 22 Jan 2016 18:18:33 +0300 -Subject: [PATCH 40/73] [VideoPlayer] DemuxFFmpeg: ssif remux +Subject: [PATCH 41/63] [VideoPlayer] DemuxFFmpeg: ssif remux --- xbmc/cores/VideoPlayer/DVDDemuxers/CMakeLists.txt | 2 + .../VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 47 ++++++- .../cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.h | 2 + - .../VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.cpp | 156 +++++++++++++++++++++ - .../VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.h | 49 +++++++ + .../VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp | 156 +++++++++++++++++++++ + .../VideoPlayer/DVDDemuxers/DemuxStreamSSIF.h | 49 +++++++ xbmc/cores/VideoPlayer/DVDDemuxers/Makefile.in | 1 + xbmc/settings/AdvancedSettings.cpp | 2 +- 7 files changed, 251 insertions(+), 8 deletions(-) - create mode 100644 xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.cpp - create mode 100644 xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.h + create mode 100644 xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp + create mode 100644 xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.h diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/CMakeLists.txt b/xbmc/cores/VideoPlayer/DVDDemuxers/CMakeLists.txt -index 63776b1333bb66483303e44d6ebe60f3cd7e14d7..0da129ff99f57dc38ca8a854854d9fe658651e1f 100644 +index 63776b1333bb66483303e44d6ebe60f3cd7e14d7..156ec2021002d9d7a355db2f0dcf099aabb1db48 100644 --- a/xbmc/cores/VideoPlayer/DVDDemuxers/CMakeLists.txt +++ b/xbmc/cores/VideoPlayer/DVDDemuxers/CMakeLists.txt @@ -5,6 +5,7 @@ set(SOURCES DemuxMultiSource.cpp DVDDemuxCDDA.cpp DVDDemuxClient.cpp DVDDemuxFFmpeg.cpp -+ DVDDemuxStreamSSIF.cpp ++ DemuxStreamSSIF.cpp DVDDemuxUtils.cpp DVDDemuxVobsub.cpp DVDFactoryDemuxer.cpp) @@ -48032,12 +47721,12 @@ index 63776b1333bb66483303e44d6ebe60f3cd7e14d7..0da129ff99f57dc38ca8a854854d9fe6 DVDDemuxCDDA.h DVDDemuxClient.h DVDDemuxFFmpeg.h -+ DVDDemuxStreamSSIF.h ++ DemuxStreamSSIF.h DVDDemuxPacket.h DVDDemuxUtils.h DVDDemuxVobsub.h diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -index c673115f4c5b1f80a0f2beb157f2821a337debee..d028c5642585ffca236882a2f316150cac2cb0d4 100644 +index 62e110e816f21e60c1564029fe646a0a7e85f08d..fb5dabe8558570bd2e48450b18778bfc77b3d7ef 100644 --- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp @@ -166,6 +166,7 @@ CDVDDemuxFFmpeg::CDVDDemuxFFmpeg() : CDVDDemux() @@ -48048,7 +47737,7 @@ index c673115f4c5b1f80a0f2beb157f2821a337debee..d028c5642585ffca236882a2f316150c m_speed = DVD_PLAYSPEED_NORMAL; m_program = UINT_MAX; m_pkt.result = -1; -@@ -543,6 +544,8 @@ void CDVDDemuxFFmpeg::Dispose() +@@ -553,6 +554,8 @@ void CDVDDemuxFFmpeg::Dispose() m_pkt.result = -1; av_packet_unref(&m_pkt.pkt); @@ -48057,7 +47746,7 @@ index c673115f4c5b1f80a0f2beb157f2821a337debee..d028c5642585ffca236882a2f316150c if (m_pFormatContext) { for (unsigned int i = 0; i < m_pFormatContext->nb_streams; i++) -@@ -596,6 +599,9 @@ void CDVDDemuxFFmpeg::Flush() +@@ -606,6 +609,9 @@ void CDVDDemuxFFmpeg::Flush() m_displayTime = 0; m_dtsAtDisplayTime = DVD_NOPTS_VALUE; @@ -48067,7 +47756,7 @@ index c673115f4c5b1f80a0f2beb157f2821a337debee..d028c5642585ffca236882a2f316150c } void CDVDDemuxFFmpeg::Abort() -@@ -863,7 +869,9 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() +@@ -878,7 +884,9 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() { Flush(); } @@ -48078,7 +47767,7 @@ index c673115f4c5b1f80a0f2beb157f2821a337debee..d028c5642585ffca236882a2f316150c { // update streams CreateStreams(m_program); -@@ -891,6 +899,9 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() +@@ -906,6 +914,9 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() m_pkt.result = -1; av_packet_unref(&m_pkt.pkt); @@ -48088,7 +47777,7 @@ index c673115f4c5b1f80a0f2beb157f2821a337debee..d028c5642585ffca236882a2f316150c } else { -@@ -900,7 +911,9 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() +@@ -915,7 +926,9 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() if (IsVideoReady()) { @@ -48099,7 +47788,7 @@ index c673115f4c5b1f80a0f2beb157f2821a337debee..d028c5642585ffca236882a2f316150c { /* check so packet belongs to selected program */ for (unsigned int i = 0; i < m_pFormatContext->programs[m_program]->nb_stream_indexes; i++) -@@ -1049,6 +1062,15 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() +@@ -1064,6 +1077,15 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() stream = AddStream(pPacket->iStreamId); } } @@ -48115,7 +47804,7 @@ index c673115f4c5b1f80a0f2beb157f2821a337debee..d028c5642585ffca236882a2f316150c if (!stream) { CLog::Log(LOGERROR, "CDVDDemuxFFmpeg::AddStream - internal error, stream is null"); -@@ -1078,6 +1100,9 @@ bool CDVDDemuxFFmpeg::SeekTime(int time, bool backwords, double *startpts) +@@ -1093,6 +1115,9 @@ bool CDVDDemuxFFmpeg::SeekTime(double time, bool backwards, double *startpts) m_pkt.result = -1; av_packet_unref(&m_pkt.pkt); @@ -48125,7 +47814,7 @@ index c673115f4c5b1f80a0f2beb157f2821a337debee..d028c5642585ffca236882a2f316150c CDVDInputStream::IPosTime* ist = m_pInput->GetIPosTime(); if (ist) { -@@ -1158,6 +1183,9 @@ bool CDVDDemuxFFmpeg::SeekByte(int64_t pos) +@@ -1173,6 +1198,9 @@ bool CDVDDemuxFFmpeg::SeekByte(int64_t pos) m_pkt.result = -1; av_packet_unref(&m_pkt.pkt); @@ -48135,12 +47824,12 @@ index c673115f4c5b1f80a0f2beb157f2821a337debee..d028c5642585ffca236882a2f316150c return (ret >= 0); } -@@ -1335,11 +1363,12 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) +@@ -1357,11 +1385,12 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) { if (pStream->codec->codec_id == AV_CODEC_ID_H264_MVC) { - // ignore MVC extension streams, they are handled specially -+ m_pSSIF = new CDVDDemuxStreamSSIF(); ++ m_pSSIF = new CDemuxStreamSSIF(); + m_pSSIF->SetMVCStreamId(streamIdx); + stream = new CDemuxStream(); @@ -48151,7 +47840,7 @@ index c673115f4c5b1f80a0f2beb157f2821a337debee..d028c5642585ffca236882a2f316150c break; } CDemuxStreamVideoFFmpeg* st = new CDemuxStreamVideoFFmpeg(this, pStream); -@@ -1425,7 +1454,11 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) +@@ -1447,7 +1476,11 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) { if (CDVDCodecUtils::IsH264AnnexB(m_pFormatContext->iformat->name, pStream)) { @@ -48164,7 +47853,7 @@ index c673115f4c5b1f80a0f2beb157f2821a337debee..d028c5642585ffca236882a2f316150c } else if (CDVDCodecUtils::ProcessH264MVCExtradata(pStream->codec->extradata, pStream->codec->extradata_size)) { -@@ -1537,7 +1570,7 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) +@@ -1559,7 +1592,7 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) if (langTag) strncpy(stream->language, langTag->value, 3); @@ -48174,14 +47863,14 @@ index c673115f4c5b1f80a0f2beb157f2821a337debee..d028c5642585ffca236882a2f316150c stream->ExtraSize = pStream->codec->extradata_size; stream->ExtraData = new uint8_t[pStream->codec->extradata_size]; diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.h -index 26cb1b91f6a08c1016210b98f75681d878afb9a1..49128bf011e2a802501cc8b3def5720a19248669 100644 +index 0bc498e8e387c7ff0aef065832c121d1367454aa..85ce39ee858992a5f095cdf6b4d35398c7ce7dcc 100644 --- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.h +++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.h @@ -21,6 +21,7 @@ */ #include "DVDDemux.h" -+#include "DVDDemuxStreamSSIF.h" ++#include "DemuxStreamSSIF.h" #include "threads/CriticalSection.h" #include "threads/SystemClock.h" #include @@ -48189,15 +47878,15 @@ index 26cb1b91f6a08c1016210b98f75681d878afb9a1..49128bf011e2a802501cc8b3def5720a double m_currentPts; // used for stream length estimation bool m_bMatroska; bool m_bAVI; -+ CDVDDemuxStreamSSIF* m_pSSIF; ++ CDemuxStreamSSIF* m_pSSIF; int m_speed; unsigned m_program; XbmcThreads::EndTime m_timeout; -diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.cpp +diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..e99352a90f348a95673ef3442d3f6cb020cd57d4 +index 0000000000000000000000000000000000000000..f75532016a1395782b59dc124676835c7254de56 --- /dev/null -+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.cpp ++++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp @@ -0,0 +1,156 @@ +/* +* Copyright (C) 2005-2013 Team XBMC @@ -48219,14 +47908,14 @@ index 0000000000000000000000000000000000000000..e99352a90f348a95673ef3442d3f6cb0 +* +*/ + -+#include "DVDDemuxStreamSSIF.h" ++#include "DemuxStreamSSIF.h" +#include "DVDClock.h" +#include "DVDDemuxUtils.h" +#include "utils/log.h" + +//#define DEBUG_VERBOSE + -+DemuxPacket* CDVDDemuxStreamSSIF::AddPacket(DemuxPacket* &srcPkt) ++DemuxPacket* CDemuxStreamSSIF::AddPacket(DemuxPacket* &srcPkt) +{ + if (srcPkt->iStreamId != m_h264StreamId && + srcPkt->iStreamId != m_mvcStreamId) @@ -48244,7 +47933,7 @@ index 0000000000000000000000000000000000000000..e99352a90f348a95673ef3442d3f6cb0 + return GetMVCPacket(); +} + -+void CDVDDemuxStreamSSIF::Flush() ++void CDemuxStreamSSIF::Flush() +{ + while (!m_H264queue.empty()) + { @@ -48258,7 +47947,7 @@ index 0000000000000000000000000000000000000000..e99352a90f348a95673ef3442d3f6cb0 + } +} + -+DemuxPacket* CDVDDemuxStreamSSIF::MergePacket(DemuxPacket* &srcPkt, DemuxPacket* &appendPkt) ++DemuxPacket* CDemuxStreamSSIF::MergePacket(DemuxPacket* &srcPkt, DemuxPacket* &appendPkt) +{ + DemuxPacket* newpkt = NULL; + newpkt = CDVDDemuxUtils::AllocateDemuxPacket(srcPkt->iSize + appendPkt->iSize); @@ -48280,7 +47969,7 @@ index 0000000000000000000000000000000000000000..e99352a90f348a95673ef3442d3f6cb0 + return newpkt; +} + -+DemuxPacket* CDVDDemuxStreamSSIF::GetMVCPacket() ++DemuxPacket* CDemuxStreamSSIF::GetMVCPacket() +{ + // Here, we recreate a h264 MVC packet from the base one + buffered MVC NALU's + while (!m_H264queue.empty() && !m_MVCqueue.empty()) @@ -48355,11 +48044,11 @@ index 0000000000000000000000000000000000000000..e99352a90f348a95673ef3442d3f6cb0 + + return CDVDDemuxUtils::AllocateDemuxPacket(0); +} -diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.h +diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.h new file mode 100644 -index 0000000000000000000000000000000000000000..8412627a3ea13f59bd2c96c23bd386e4b5b2658e +index 0000000000000000000000000000000000000000..1dafdc58db3f9cb5eac032c591942439117e13c4 --- /dev/null -+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.h ++++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.h @@ -0,0 +1,49 @@ +#pragma once + @@ -48390,11 +48079,11 @@ index 0000000000000000000000000000000000000000..8412627a3ea13f59bd2c96c23bd386e4 +#include "libavformat/avformat.h" +} + -+class CDVDDemuxStreamSSIF ++class CDemuxStreamSSIF +{ +public: -+ CDVDDemuxStreamSSIF() {}; -+ ~CDVDDemuxStreamSSIF() { Flush(); } ++ CDemuxStreamSSIF() {}; ++ ~CDemuxStreamSSIF() { Flush(); } + + DemuxPacket* AddPacket(DemuxPacket* &scrPkt); + void Flush(); @@ -48411,19 +48100,19 @@ index 0000000000000000000000000000000000000000..8412627a3ea13f59bd2c96c23bd386e4 + int m_mvcStreamId = 0; +}; diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/Makefile.in b/xbmc/cores/VideoPlayer/DVDDemuxers/Makefile.in -index e4f8aed0af96fe0dceec4d8517087742f2c7df81..f3b717ddabb4729fe0db5ebab5a7913b8fe8297c 100644 +index e4f8aed0af96fe0dceec4d8517087742f2c7df81..30076937bd084936571abf0e6eeecf5ad916c7b3 100644 --- a/xbmc/cores/VideoPlayer/DVDDemuxers/Makefile.in +++ b/xbmc/cores/VideoPlayer/DVDDemuxers/Makefile.in @@ -10,6 +10,7 @@ SRCS += DVDDemuxUtils.cpp SRCS += DVDDemuxVobsub.cpp SRCS += DVDDemuxCC.cpp SRCS += DVDFactoryDemuxer.cpp -+SRCS += DVDDemuxStreamSSIF.cpp ++SRCS += DemuxStreamSSIF.cpp LIB = DVDDemuxers.a diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index 60e5652f69e96a559d8080e01dc214a56fb19343..cdaf53585a89a0da3a4038178806ee937049fe42 100644 +index 974305ff329eb6999c908d5e05d723f93137ae33..985ecf9722141d78471c00e90da15bfad931462a 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp @@ -391,7 +391,7 @@ void CAdvancedSettings::Initialize() @@ -48436,48 +48125,25 @@ index 60e5652f69e96a559d8080e01dc214a56fb19343..cdaf53585a89a0da3a4038178806ee93 m_discStubExtensions = ".disc"; // internal music extensions -From bc26543c6ed60a2d9775d2fc03d4a6f0d9c72203 Mon Sep 17 00:00:00 2001 -From: Anton Fedchin -Date: Tue, 23 Feb 2016 16:01:08 +0300 -Subject: [PATCH 41/73] [libbluray] bump libbluray to 0.9.2-mvc. - ---- - project/BuildDependencies/scripts/0_package.list | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/project/BuildDependencies/scripts/0_package.list b/project/BuildDependencies/scripts/0_package.list -index 4d1be9c2cb2bb0c9531413c7300342444df023e1..bc4913a3d0c1fcb7e27106a2ddd6988f7749b571 100644 ---- a/project/BuildDependencies/scripts/0_package.list -+++ b/project/BuildDependencies/scripts/0_package.list -@@ -17,7 +17,7 @@ freetype-2.6.3-win32-vc140.7z - giflib-5.1.4-win32-vc140.7z - jsonschemabuilder-1.0.0-win32-3.7z - libass-0.13.2-win32-vc140.7z --libbluray-0.9.3-win32-vc140.7z -+libbluray-0.9.2-mvc-win32-vc120.7z - libcdio-0.9.3-win32-vc140.7z - libcec-3.1.0-win32-vc140.7z - libfribidi-0.19.2-win32.7z - -From 45649c80d6a0ae44ad09d040d616401980b3946c Mon Sep 17 00:00:00 2001 +From 7d58e1dbdf0a13bbb9e7264c6a7a500ddfd29c8b Mon Sep 17 00:00:00 2001 From: Anton Fedchin Date: Tue, 23 Feb 2016 16:02:46 +0300 -Subject: [PATCH 42/73] [3DBD] Added support of 3D-BluRay playback. +Subject: [PATCH 42/63] [3DBD] Added support of 3D-BluRay playback. --- lib/DllLibbluray.h | 8 + xbmc/cores/VideoPlayer/DVDDemuxers/CMakeLists.txt | 2 + - .../VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 57 ++++- - xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxMVC.cpp | 262 +++++++++++++++++++++ - xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxMVC.h | 57 +++++ - .../VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.cpp | 40 +++- - .../VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.h | 12 +- + .../VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 51 +++- + xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.cpp | 266 +++++++++++++++++++++ + xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.h | 57 +++++ + .../VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp | 40 +++- + .../VideoPlayer/DVDDemuxers/DemuxStreamSSIF.h | 12 +- xbmc/cores/VideoPlayer/DVDDemuxers/Makefile.in | 1 + - .../DVDInputStreams/DVDInputStreamBluray.cpp | 159 +++++++++++-- + .../DVDInputStreams/DVDInputStreamBluray.cpp | 159 ++++++++++-- .../DVDInputStreams/DVDInputStreamBluray.h | 20 ++ - 10 files changed, 583 insertions(+), 35 deletions(-) - create mode 100644 xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxMVC.cpp - create mode 100644 xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxMVC.h + 10 files changed, 581 insertions(+), 35 deletions(-) + create mode 100644 xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.cpp + create mode 100644 xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.h diff --git a/lib/DllLibbluray.h b/lib/DllLibbluray.h index f5a337fe19beff472557c97ff7a203ad30a912b2..03f93391265e164837c2a17a8fe6d7da41c2f13e 100644 @@ -48520,34 +48186,34 @@ index f5a337fe19beff472557c97ff7a203ad30a912b2..03f93391265e164837c2a17a8fe6d7da public: diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/CMakeLists.txt b/xbmc/cores/VideoPlayer/DVDDemuxers/CMakeLists.txt -index 0da129ff99f57dc38ca8a854854d9fe658651e1f..82d4b499245afda1a51ca281584cc47fc76173d1 100644 +index 156ec2021002d9d7a355db2f0dcf099aabb1db48..87d27b666f703743bb0170252cf1190da5bce261 100644 --- a/xbmc/cores/VideoPlayer/DVDDemuxers/CMakeLists.txt +++ b/xbmc/cores/VideoPlayer/DVDDemuxers/CMakeLists.txt -@@ -5,6 +5,7 @@ set(SOURCES DemuxMultiSource.cpp - DVDDemuxCDDA.cpp +@@ -6,6 +6,7 @@ set(SOURCES DemuxMultiSource.cpp DVDDemuxClient.cpp DVDDemuxFFmpeg.cpp -+ DVDDemuxMVC.cpp - DVDDemuxStreamSSIF.cpp + DemuxStreamSSIF.cpp ++ DemuxMVC.cpp DVDDemuxUtils.cpp DVDDemuxVobsub.cpp -@@ -17,6 +18,7 @@ set(HEADERS DemuxMultiSource.h - DVDDemuxCDDA.h + DVDFactoryDemuxer.cpp) +@@ -18,6 +19,7 @@ set(HEADERS DemuxMultiSource.h DVDDemuxClient.h DVDDemuxFFmpeg.h -+ DVDDemuxMVC.h - DVDDemuxStreamSSIF.h + DemuxStreamSSIF.h ++ DemuxMVC.h DVDDemuxPacket.h DVDDemuxUtils.h + DVDDemuxVobsub.h diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -index d028c5642585ffca236882a2f316150cac2cb0d4..9498f676602e85d020968a7ecf12a31a750ef0ba 100644 +index fb5dabe8558570bd2e48450b18778bfc77b3d7ef..3d4d22930da1ac1e090ba95ef0faa65fbafa4326 100644 --- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp @@ -27,6 +27,7 @@ #include "cores/FFmpeg.h" #include "DVDCodecs/DVDCodecUtils.h" #include "DVDClock.h" // for DVD_TIME_BASE -+#include "DVDDemuxMVC.h" ++#include "DemuxMVC.h" #include "DVDDemuxUtils.h" #include "DVDInputStreams/DVDInputStream.h" #include "DVDInputStreams/DVDInputStreamFFmpeg.h" @@ -48561,14 +48227,14 @@ index d028c5642585ffca236882a2f316150cac2cb0d4..9498f676602e85d020968a7ecf12a31a + if (bluRay->HasMVC()) + { + SAFE_DELETE(m_pSSIF); -+ m_pSSIF = new CDVDDemuxStreamSSIF(); ++ m_pSSIF = new CDemuxStreamSSIF(); + m_pSSIF->SetBluRay(bluRay); + } + } // in case of mpegts and we have not seen pat/pmt, defer creation of streams if (!skipCreateStreams || m_pFormatContext->nb_programs > 0) { -@@ -869,9 +880,7 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() +@@ -884,9 +895,7 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() { Flush(); } @@ -48579,7 +48245,7 @@ index d028c5642585ffca236882a2f316150cac2cb0d4..9498f676602e85d020968a7ecf12a31a { // update streams CreateStreams(m_program); -@@ -912,8 +921,7 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() +@@ -927,8 +936,7 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() if (IsVideoReady()) { // libavformat is confused by the interleaved SSIF. @@ -48589,7 +48255,7 @@ index d028c5642585ffca236882a2f316150cac2cb0d4..9498f676602e85d020968a7ecf12a31a { /* check so packet belongs to selected program */ for (unsigned int i = 0; i < m_pFormatContext->programs[m_program]->nb_stream_indexes; i++) -@@ -1064,10 +1072,7 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() +@@ -1079,10 +1087,7 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() } if (stream && m_pSSIF) { @@ -48601,7 +48267,7 @@ index d028c5642585ffca236882a2f316150cac2cb0d4..9498f676602e85d020968a7ecf12a31a if (stream->type == STREAM_DATA && stream->codec == AV_CODEC_ID_H264_MVC && pPacket->iSize) stream = GetStream(pPacket->iStreamId); } -@@ -1458,6 +1463,29 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) +@@ -1480,6 +1485,29 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) { m_pSSIF->SetH264StreamId(streamIdx); pStream->codec->codec_tag = MKTAG('A', 'M', 'V', 'C'); @@ -48612,8 +48278,8 @@ index d028c5642585ffca236882a2f316150cac2cb0d4..9498f676602e85d020968a7ecf12a31a + CDVDInputStreamBluray *bluRay = static_cast(m_pInput); + if (bluRay->HasMVC()) + { -+ st->stereo_mode = bluRay->AreEyesFlipped() ? "mvc_rl" : "mvc_lr"; -+ mvcStream = static_cast(bluRay->GetDemuxMVC())->GetAVStream(); ++ st->stereo_mode = bluRay->AreEyesFlipped() ? "block_rl" : "block_lr"; ++ mvcStream = static_cast(bluRay->GetDemuxMVC())->GetAVStream(); + } + } + else @@ -48631,20 +48297,7 @@ index d028c5642585ffca236882a2f316150cac2cb0d4..9498f676602e85d020968a7ecf12a31a } } else if (CDVDCodecUtils::ProcessH264MVCExtradata(pStream->codec->extradata, pStream->codec->extradata_size)) -@@ -1737,6 +1765,12 @@ bool CDVDDemuxFFmpeg::SeekChapter(int chapter, double* startpts) - } - - Flush(); -+ if (m_pInput->IsStreamType(DVDSTREAM_TYPE_BLURAY) -+ && static_cast(m_pInput)->HasMVC()) -+ { -+ // also empty the internal ffmpeg buffer otherwise it may cause MVC buffers hang -+ m_ioContext->buf_ptr = m_ioContext->buf_end; -+ } - return true; - } - -@@ -1781,6 +1815,11 @@ std::string CDVDDemuxFFmpeg::GetStreamCodecName(int iStreamId) +@@ -1803,6 +1831,11 @@ std::string CDVDDemuxFFmpeg::GetStreamCodecName(int iStreamId) bool CDVDDemuxFFmpeg::IsProgramChange() { @@ -48656,12 +48309,12 @@ index d028c5642585ffca236882a2f316150cac2cb0d4..9498f676602e85d020968a7ecf12a31a if (m_program == UINT_MAX) return false; -diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxMVC.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxMVC.cpp +diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..4ed7c439e7c36de211f2136c9b6b9a95549fe634 +index 0000000000000000000000000000000000000000..ade6a4454fc3915b0c787b1a4f72aedbd74903db --- /dev/null -+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxMVC.cpp -@@ -0,0 +1,262 @@ ++++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.cpp +@@ -0,0 +1,266 @@ +/* +* Copyright (C) 2005-2013 Team XBMC +* http://xbmc.org @@ -48682,7 +48335,7 @@ index 0000000000000000000000000000000000000000..4ed7c439e7c36de211f2136c9b6b9a95 +* +*/ + -+#include "DVDDemuxMVC.h" ++#include "DemuxMVC.h" +#include "DVDDemuxUtils.h" +#include "DVDInputStreams/DVDInputStream.h" +#include "DVDClock.h" @@ -48697,20 +48350,20 @@ index 0000000000000000000000000000000000000000..4ed7c439e7c36de211f2136c9b6b9a95 + +static int mvc_file_read(void *h, uint8_t* buf, int size) +{ -+ CDVDInputStream* pInputStream = static_cast(h)->m_pInput; ++ CDVDInputStream* pInputStream = static_cast(h)->m_pInput; + return pInputStream->Read(buf, size); +} + +static int64_t mvc_file_seek(void *h, int64_t pos, int whence) +{ -+ CDVDInputStream* pInputStream = static_cast(h)->m_pInput; ++ CDVDInputStream* pInputStream = static_cast(h)->m_pInput; + if (whence == AVSEEK_SIZE) + return pInputStream->GetLength(); + else + return pInputStream->Seek(pos, whence & ~AVSEEK_FORCE); +} + -+CDVDDemuxMVC::CDVDDemuxMVC() ++CDemuxMVC::CDemuxMVC() +{ + m_ioContext = nullptr; + m_pFormatContext = nullptr; @@ -48718,12 +48371,12 @@ index 0000000000000000000000000000000000000000..4ed7c439e7c36de211f2136c9b6b9a95 + m_nStreamIndex = -1; +} + -+CDVDDemuxMVC::~CDVDDemuxMVC() ++CDemuxMVC::~CDemuxMVC() +{ + Dispose(); +} + -+bool CDVDDemuxMVC::Open(CDVDInputStream* pInput) ++bool CDemuxMVC::Open(CDVDInputStream* pInput) +{ + int ret; + @@ -48790,24 +48443,28 @@ index 0000000000000000000000000000000000000000..4ed7c439e7c36de211f2136c9b6b9a95 + return true; +} + -+void CDVDDemuxMVC::Reset() ++void CDemuxMVC::Reset() +{ + CDVDInputStream* pInput = m_pInput; + Dispose(); + Open(pInput); +} + -+void CDVDDemuxMVC::Abort() ++void CDemuxMVC::Abort() +{ +} + -+void CDVDDemuxMVC::Flush() ++void CDemuxMVC::Flush() +{ + if (m_pFormatContext) ++ { ++ if (m_pFormatContext->pb) ++ avio_flush(m_pFormatContext->pb); + avformat_flush(m_pFormatContext); ++ } +} + -+DemuxPacket* CDVDDemuxMVC::Read() ++DemuxPacket* CDemuxMVC::Read() +{ + int ret; + AVPacket mvcPacket = { 0 }; @@ -48848,7 +48505,7 @@ index 0000000000000000000000000000000000000000..4ed7c439e7c36de211f2136c9b6b9a95 + return nullptr; +} + -+bool CDVDDemuxMVC::SeekTime(int time, bool backwords, double* startpts) ++bool CDemuxMVC::SeekTime(int time, bool backwords, double* startpts) +{ + if (!m_pInput) + return false; @@ -48870,17 +48527,17 @@ index 0000000000000000000000000000000000000000..4ed7c439e7c36de211f2136c9b6b9a95 + return true; +} + -+std::string CDVDDemuxMVC::GetFileName() ++std::string CDemuxMVC::GetFileName() +{ + return m_pInput->GetFileName(); +} + -+AVStream* CDVDDemuxMVC::GetAVStream() ++AVStream* CDemuxMVC::GetAVStream() +{ + return m_pFormatContext ? m_pFormatContext->streams[m_nStreamIndex] : nullptr; +} + -+void CDVDDemuxMVC::Dispose() ++void CDemuxMVC::Dispose() +{ + if (m_pFormatContext) + avformat_close_input(&m_pFormatContext); @@ -48897,7 +48554,7 @@ index 0000000000000000000000000000000000000000..4ed7c439e7c36de211f2136c9b6b9a95 + m_nStreamIndex = -1; +} + -+double CDVDDemuxMVC::ConvertTimestamp(int64_t pts, int den, int num) ++double CDemuxMVC::ConvertTimestamp(int64_t pts, int den, int num) +{ + if (pts == (int64_t)AV_NOPTS_VALUE) + return DVD_NOPTS_VALUE; @@ -48919,17 +48576,17 @@ index 0000000000000000000000000000000000000000..4ed7c439e7c36de211f2136c9b6b9a95 + return timestamp * DVD_TIME_BASE; +} + -+std::vector CDVDDemuxMVC::GetStreams() const ++std::vector CDemuxMVC::GetStreams() const +{ + std::vector streams; + return streams; +} \ No newline at end of file -diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxMVC.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxMVC.h +diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.h new file mode 100644 -index 0000000000000000000000000000000000000000..284358f282ed3d708be5929e6b04d6f49782079d +index 0000000000000000000000000000000000000000..bbb836a61344689a83af68c821c05c212a86b097 --- /dev/null -+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxMVC.h ++++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.h @@ -0,0 +1,57 @@ +#pragma once + @@ -48959,11 +48616,11 @@ index 0000000000000000000000000000000000000000..284358f282ed3d708be5929e6b04d6f4 +#include "libavformat/avformat.h" +} + -+class CDVDDemuxMVC : public CDVDDemux ++class CDemuxMVC : public CDVDDemux +{ +public: -+ CDVDDemuxMVC(); -+ virtual ~CDVDDemuxMVC(); ++ CDemuxMVC(); ++ virtual ~CDemuxMVC(); + bool Open(CDVDInputStream* pInput); + virtual void Reset(); + virtual void Abort(); @@ -48989,14 +48646,14 @@ index 0000000000000000000000000000000000000000..284358f282ed3d708be5929e6b04d6f4 + int m_nStreamIndex = -1; +}; \ No newline at end of file -diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.cpp -index e99352a90f348a95673ef3442d3f6cb020cd57d4..e390529bb8602af04c3853337821123546fb098d 100644 ---- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.cpp -+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.cpp +diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp +index f75532016a1395782b59dc124676835c7254de56..2c7e66f7ee5683a0fbcde5ad5c65ebfd6853f3d0 100644 +--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp ++++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp @@ -19,11 +19,13 @@ */ - #include "DVDDemuxStreamSSIF.h" + #include "DemuxStreamSSIF.h" +#include "DVDDemux.h" #include "DVDClock.h" #include "DVDDemuxUtils.h" @@ -49005,9 +48662,9 @@ index e99352a90f348a95673ef3442d3f6cb020cd57d4..e390529bb8602af04c38533378211235 //#define DEBUG_VERBOSE +#define MVC_QUEUE_SIZE 100 - DemuxPacket* CDVDDemuxStreamSSIF::AddPacket(DemuxPacket* &srcPkt) + DemuxPacket* CDemuxStreamSSIF::AddPacket(DemuxPacket* &srcPkt) { -@@ -37,7 +39,7 @@ DemuxPacket* CDVDDemuxStreamSSIF::AddPacket(DemuxPacket* &srcPkt) +@@ -37,7 +39,7 @@ DemuxPacket* CDemuxStreamSSIF::AddPacket(DemuxPacket* &srcPkt) } else if (srcPkt->iStreamId == m_mvcStreamId) { @@ -49016,9 +48673,9 @@ index e99352a90f348a95673ef3442d3f6cb020cd57d4..e390529bb8602af04c38533378211235 } return GetMVCPacket(); -@@ -81,6 +83,10 @@ DemuxPacket* CDVDDemuxStreamSSIF::MergePacket(DemuxPacket* &srcPkt, DemuxPacket* +@@ -81,6 +83,10 @@ DemuxPacket* CDemuxStreamSSIF::MergePacket(DemuxPacket* &srcPkt, DemuxPacket* &a - DemuxPacket* CDVDDemuxStreamSSIF::GetMVCPacket() + DemuxPacket* CDemuxStreamSSIF::GetMVCPacket() { + // if input is a bluray fill mvc queue before processing + if (m_bluRay && m_MVCqueue.empty() && !m_H264queue.empty()) @@ -49027,7 +48684,7 @@ index e99352a90f348a95673ef3442d3f6cb020cd57d4..e390529bb8602af04c38533378211235 // Here, we recreate a h264 MVC packet from the base one + buffered MVC NALU's while (!m_H264queue.empty() && !m_MVCqueue.empty()) { -@@ -151,6 +157,36 @@ DemuxPacket* CDVDDemuxStreamSSIF::GetMVCPacket() +@@ -151,6 +157,36 @@ DemuxPacket* CDemuxStreamSSIF::GetMVCPacket() #if defined(DEBUG_VERBOSE) CLog::Log(LOGDEBUG, ">>> MVC waiting. MVC(%d) H264(%d)", m_MVCqueue.size(), m_H264queue.size()); #endif @@ -49035,12 +48692,12 @@ index e99352a90f348a95673ef3442d3f6cb020cd57d4..e390529bb8602af04c38533378211235 return CDVDDemuxUtils::AllocateDemuxPacket(0); } + -+void CDVDDemuxStreamSSIF::AddMVCExtPacket(DemuxPacket* &mvcExtPkt) ++void CDemuxStreamSSIF::AddMVCExtPacket(DemuxPacket* &mvcExtPkt) +{ + m_MVCqueue.push(mvcExtPkt); +} + -+bool CDVDDemuxStreamSSIF::FillMVCQueue(double dtsBase) ++bool CDemuxStreamSSIF::FillMVCQueue(double dtsBase) +{ + if (!m_bluRay) + return false; @@ -49065,10 +48722,10 @@ index e99352a90f348a95673ef3442d3f6cb020cd57d4..e390529bb8602af04c38533378211235 + }; + return m_MVCqueue.size() == MVC_QUEUE_SIZE; +} -diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.h -index 8412627a3ea13f59bd2c96c23bd386e4b5b2658e..579c382dca988b0c37e5da7396803f70d4cf15ff 100644 ---- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.h -+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxStreamSSIF.h +diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.h +index 1dafdc58db3f9cb5eac032c591942439117e13c4..508e9debd3e6679a1433842a65649fa68ead76ec 100644 +--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.h ++++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.h @@ -21,6 +21,7 @@ */ @@ -49101,19 +48758,19 @@ index 8412627a3ea13f59bd2c96c23bd386e4b5b2658e..579c382dca988b0c37e5da7396803f70 + int m_mvcStreamId = -1; }; diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/Makefile.in b/xbmc/cores/VideoPlayer/DVDDemuxers/Makefile.in -index f3b717ddabb4729fe0db5ebab5a7913b8fe8297c..80ceeeaea6f061ec0b82f95d1edf7c572960397c 100644 +index 30076937bd084936571abf0e6eeecf5ad916c7b3..0359426b85683a4c3a80ef0e0d52f7a79564daaa 100644 --- a/xbmc/cores/VideoPlayer/DVDDemuxers/Makefile.in +++ b/xbmc/cores/VideoPlayer/DVDDemuxers/Makefile.in @@ -11,6 +11,7 @@ SRCS += DVDDemuxVobsub.cpp SRCS += DVDDemuxCC.cpp SRCS += DVDFactoryDemuxer.cpp - SRCS += DVDDemuxStreamSSIF.cpp + SRCS += DemuxStreamSSIF.cpp +SRCS += DVDDemuxMVC.cpp LIB = DVDDemuxers.a diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp -index 6ccd9a8c00fdc5175df3ecbb3a5d30dc93e319ab..5e85db23b09c920c4b19f3e7cae6e3f8ccae2db9 100644 +index 6ccd9a8c00fdc5175df3ecbb3a5d30dc93e319ab..ad2c65ba5b80c5ac5d055d621a1e8319e3f770c0 100644 --- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp +++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp @@ -26,6 +26,8 @@ @@ -49121,7 +48778,7 @@ index 6ccd9a8c00fdc5175df3ecbb3a5d30dc93e319ab..5e85db23b09c920c4b19f3e7cae6e3f8 #include "DVDCodecs/Overlay/DVDOverlay.h" #include "DVDCodecs/Overlay/DVDOverlayImage.h" +#include "DVDInputStreamFile.h" -+#include "DVDDemuxers/DVDDemuxMVC.h" ++#include "DVDDemuxers/DemuxMVC.h" #include "settings/Settings.h" #include "LangInfo.h" #include "utils/log.h" @@ -49375,7 +49032,7 @@ index 6ccd9a8c00fdc5175df3ecbb3a5d30dc93e319ab..5e85db23b09c920c4b19f3e7cae6e3f8 + if (m_pMVCDemux) + SAFE_DELETE(m_pMVCDemux); + -+ CDVDDemuxMVC* pMVCDemux = new CDVDDemuxMVC; ++ CDemuxMVC* pMVCDemux = new CDemuxMVC; + m_pMVCDemux = pMVCDemux; + + if (!pMVCDemux->Open(m_pMVCInput)) @@ -49461,57 +49118,648 @@ index b967a85e6557e42a7f1235cdd804d5a0263b866f..561fb5cd4f971bc9ee4f41218a60bb3d typedef std::shared_ptr SOverlay; typedef std::list SOverlays; -From 9364454aa08e510e8285fd792abb8cdf63aace2f Mon Sep 17 00:00:00 2001 -From: Anton Fedchin -Date: Wed, 2 Mar 2016 23:31:50 +0300 -Subject: [PATCH 43/73] [BaseRenderer] Fix aspect for TAB/SBS (need more - testing) +From 3de6eb54b199d8c1bfe75061558d176de257be55 Mon Sep 17 00:00:00 2001 +From: Anton Fedchin +Date: Fri, 11 Mar 2016 16:58:53 +0300 +Subject: [PATCH 43/63] [VideoPlayer] HasVideo returns true if video stream + exists. This don't allow start visualization if audio is opened before video. --- - xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.cpp | 18 ++++++++++++++++++ - 1 file changed, 18 insertions(+) + xbmc/cores/VideoPlayer/VideoPlayer.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.cpp -index f9b3bfb4eb35eff3ef7af370136882bc733461e6..ab804ab0259992e4700e0ba99759c3f777bc8d52 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.cpp -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.cpp -@@ -35,6 +35,9 @@ - #include "settings/AdvancedSettings.h" - #include "cores/VideoPlayer/VideoRenderers/RenderFlags.h" +diff --git a/xbmc/cores/VideoPlayer/VideoPlayer.cpp b/xbmc/cores/VideoPlayer/VideoPlayer.cpp +index bb80b836b9c7528def9b623966d8b66aca9bcc92..d2482bcfb036cd5705afc3bae9bf759b6cf2f6b0 100644 +--- a/xbmc/cores/VideoPlayer/VideoPlayer.cpp ++++ b/xbmc/cores/VideoPlayer/VideoPlayer.cpp +@@ -3115,7 +3115,7 @@ void CVideoPlayer::Pause() -+extern "C" { -+#include "libavformat/version.h" -+} - - CBaseRenderer::CBaseRenderer() + bool CVideoPlayer::HasVideo() const { -@@ -369,6 +372,21 @@ void CBaseRenderer::CalculateFrameAspectRatio(unsigned int desired_width, unsign - if (m_sourceHeight == 576) // PAL - m_sourceFrameRatio = imageFrameRatio * PALPixelRatio * Non4by3Correction; - } -+#if (LIBAVFORMAT_VERSION_MAJOR >= 57) -+ bool isAnamorph = m_sourceWidth <= 1920 && m_sourceHeight <= 1080; -+ float factor = isAnamorph ? 2.0f : 4.0f; -+ switch (CONF_FLAGS_STEREO_MODE_MASK(m_iFlags)) -+ { -+ case CONF_FLAGS_STEREO_MODE_TAB: -+ m_sourceFrameRatio *= factor; -+ break; -+ case CONF_FLAGS_STEREO_MODE_SBS: -+ m_sourceFrameRatio /= factor; -+ break; -+ default: -+ break; -+ } -+#endif +- return m_HasVideo; ++ return m_HasVideo || GetVideoStream() >= 0; } - void CBaseRenderer::ManageRenderArea() + bool CVideoPlayer::HasAudio() const -From 023ad967694764e1c6f1ae964a284de3eac0474b Mon Sep 17 00:00:00 2001 +From 5a0375aa55d9fcc679382b12482cc66861df7ff5 Mon Sep 17 00:00:00 2001 +From: Anton Fedchin +Date: Thu, 10 Mar 2016 18:11:33 +0300 +Subject: [PATCH 44/63] fixup! Revert supporting crappy tab/sbs subtitles. this + fixes regular subtitles. + +--- + .../cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp +index 3a080d06c90b0762482816928642e6de7810b539..a8323f419e404037c4e5fb4d78fa1b45409337a7 100644 +--- a/xbmc/cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp ++++ b/xbmc/cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp +@@ -243,20 +243,20 @@ CDVDOverlay* CDVDOverlayCodecFFmpeg::GetOverlay() + } + } + +- RENDER_STEREO_MODE render_stereo_mode = g_graphicsContext.GetStereoMode(); ++ /*RENDER_STEREO_MODE render_stereo_mode = g_graphicsContext.GetStereoMode(); + if (render_stereo_mode != RENDER_STEREO_MODE_OFF) + { +- if (rect.h > m_height / 2) ++ if ((rect.h - rect.y) > m_height / 2) + { + m_height /= 2; + rect.h /= 2; + } +- else if (rect.w > m_width / 2) ++ else if ((rect.w - rect.x) > m_width / 2) + { + m_width /= 2; + rect.w /= 2; + } +- } ++ }*/ + + CDVDOverlayImage* overlay = new CDVDOverlayImage(); + + +From e2498d26f1b7928017f856108aa8263e6c73194d Mon Sep 17 00:00:00 2001 +From: Anton Fedchin +Date: Thu, 7 Apr 2016 17:28:50 +0300 +Subject: [PATCH 45/63] [VideoPlayer] Disable reading extension stream from + input stream if decoder doesn't support it. + +--- + xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h | 5 +++++ + xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 18 +++++++++--------- + xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp | 4 +++- + xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.h | 6 +++--- + .../cores/VideoPlayer/DVDInputStreams/DVDInputStream.h | 11 +++++++++++ + .../DVDInputStreams/DVDInputStreamBluray.cpp | 9 ++++++++- + .../VideoPlayer/DVDInputStreams/DVDInputStreamBluray.h | 9 ++++++--- + xbmc/cores/VideoPlayer/IVideoPlayer.h | 1 + + xbmc/cores/VideoPlayer/VideoPlayer.cpp | 4 ++++ + xbmc/cores/VideoPlayer/VideoPlayerVideo.h | 1 + + 10 files changed, 51 insertions(+), 17 deletions(-) + +diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h +index a2da9de4375939f3711c594dc854b9a533c755b4..8101b6eeff0341a94736df7ee815dd4c18337a32 100644 +--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h ++++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h +@@ -311,6 +311,11 @@ public: + */ + virtual void Reopen() {}; + ++ /** ++ * Indicates that the decoder supports extention streams. ++ */ ++ virtual bool SupportsExtention() { return false; } ++ + protected: + CProcessInfo &m_processInfo; + }; +diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +index 3d4d22930da1ac1e090ba95ef0faa65fbafa4326..0282b3e0c70c023c412128acae508d7ece3f294b 100644 +--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp ++++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +@@ -504,14 +504,14 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput, bool streaminfo, bool filein + + UpdateCurrentPTS(); + +- if (!fileinfo && m_pInput->IsStreamType(DVDSTREAM_TYPE_BLURAY)) ++ if (!fileinfo) + { +- CDVDInputStreamBluray *bluRay = static_cast(m_pInput); +- if (bluRay->HasMVC()) ++ CDVDInputStream::IExtentionStream* pExt = dynamic_cast(m_pInput); ++ if (pExt && pExt->HasExtention()) + { + SAFE_DELETE(m_pSSIF); + m_pSSIF = new CDemuxStreamSSIF(); +- m_pSSIF->SetBluRay(bluRay); ++ m_pSSIF->SetBluRay(pExt); + } + } + // in case of mpegts and we have not seen pat/pmt, defer creation of streams +@@ -1487,13 +1487,13 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) + pStream->codec->codec_tag = MKTAG('A', 'M', 'V', 'C'); + + AVStream* mvcStream = nullptr; +- if (m_pInput->IsStreamType(DVDSTREAM_TYPE_BLURAY)) ++ CDVDInputStream::IExtentionStream* pExt = dynamic_cast(m_pInput); ++ if (pExt) + { +- CDVDInputStreamBluray *bluRay = static_cast(m_pInput); +- if (bluRay->HasMVC()) ++ if (pExt->HasExtention()) + { +- st->stereo_mode = bluRay->AreEyesFlipped() ? "block_rl" : "block_lr"; +- mvcStream = static_cast(bluRay->GetDemuxMVC())->GetAVStream(); ++ st->stereo_mode = pExt->AreEyesFlipped() ? "block_rl" : "block_lr"; ++ mvcStream = static_cast(pExt->GetExtentionDemux())->GetAVStream(); + } + } + else +diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp +index 2c7e66f7ee5683a0fbcde5ad5c65ebfd6853f3d0..7c8719ce40e725e27b7551250398022a1f1a4fc6 100644 +--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp ++++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp +@@ -35,6 +35,8 @@ DemuxPacket* CDemuxStreamSSIF::AddPacket(DemuxPacket* &srcPkt) + + if (srcPkt->iStreamId == m_h264StreamId) + { ++ if (m_bluRay && !m_bluRay->HasExtention()) ++ return srcPkt; + m_H264queue.push(srcPkt); + } + else if (srcPkt->iStreamId == m_mvcStreamId) +@@ -170,7 +172,7 @@ bool CDemuxStreamSSIF::FillMVCQueue(double dtsBase) + if (!m_bluRay) + return false; + +- CDVDDemux* demux = m_bluRay->GetDemuxMVC(); ++ CDVDDemux* demux = m_bluRay->GetExtentionDemux(); + DemuxPacket* mvc; + while ((m_MVCqueue.size() < MVC_QUEUE_SIZE) && (mvc = demux->Read())) + { +diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.h +index 508e9debd3e6679a1433842a65649fa68ead76ec..26cd97dddcae208afacfb241e96b4935ad0f81f3 100644 +--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.h ++++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.h +@@ -21,7 +21,7 @@ + */ + + #include "DVDDemuxPacket.h" +-#include "DVDInputStreams/DVDInputStreamBluray.h" ++#include "DVDInputStreams/DVDInputStream.h" + #include + + extern "C" { +@@ -41,7 +41,7 @@ public: + int GetH264StreamId() { return m_h264StreamId; }; + int GetMVCStreamId() { return m_mvcStreamId; }; + void AddMVCExtPacket(DemuxPacket* &scrPkt); +- void SetBluRay(CDVDInputStreamBluray* &bluRay) { m_bluRay = bluRay; }; ++ void SetBluRay(CDVDInputStream::IExtentionStream* &bluRay) { m_bluRay = bluRay; }; + bool IsBluRay() { return m_bluRay != nullptr; }; + + private: +@@ -49,7 +49,7 @@ private: + DemuxPacket* MergePacket(DemuxPacket* &srcPkt, DemuxPacket* &appendPkt); + bool FillMVCQueue(double dtsBase); + +- CDVDInputStreamBluray* m_bluRay = nullptr; ++ CDVDInputStream::IExtentionStream* m_bluRay = nullptr; + std::queue m_H264queue; + std::queue m_MVCqueue; + int m_h264StreamId = -1; +diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h +index 932f0e4093c836453b07932df9075afc6f6e5ae5..7aee35cef8f42d080882e4bdd20a4a9ed234a8c2 100644 +--- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h ++++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h +@@ -57,6 +57,7 @@ namespace XFILE + + struct DemuxPacket; + class CDemuxStream; ++class CDVDDemux; + + class CDVDInputStream + { +@@ -131,6 +132,16 @@ public: + virtual void SetVideoResolution(int width, int height) {}; + }; + ++ class IExtentionStream ++ { ++ public: ++ virtual ~IExtentionStream() {} ++ virtual bool HasExtention() = 0; ++ virtual bool AreEyesFlipped() = 0; ++ virtual CDVDDemux* GetExtentionDemux() = 0; ++ virtual void DisableExtention() = 0; ++ }; ++ + enum ENextStream + { + NEXTSTREAM_NONE, +diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp +index ad2c65ba5b80c5ac5d055d621a1e8319e3f770c0..74e8e1fc2da66d3c98a5bab04faa2f6bf16539ff 100644 +--- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp ++++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp +@@ -617,6 +617,13 @@ void CDVDInputStreamBluray::ProcessEvent() { + } + } + ++void CDVDInputStreamBluray::DisableExtention() ++{ ++ CloseMVCDemux(); ++ m_bMVCDisabled = true; ++ m_bMVCPlayback = false; ++} ++ + int CDVDInputStreamBluray::Read(uint8_t* buf, int buf_size) + { + int result = 0; +@@ -1165,7 +1172,7 @@ bool CDVDInputStreamBluray::ProcessItem(int playitem) + + m_title = m_dll->bd_get_playlist_info(m_bd, playitem, m_angle); + +- if (CSettings::GetInstance().GetBool("videoplayer.supportmvc")) ++ if (CSettings::GetInstance().GetBool("videoplayer.supportmvc") && !m_bMVCDisabled) + { + MPLS_PL * mpls = m_dll->bd_get_title_mpls(m_bd); + if (mpls) +diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.h b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.h +index 561fb5cd4f971bc9ee4f41218a60bb3d5bc5625f..f70657c9e31fb2460d12910c635dba5163282e74 100644 +--- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.h ++++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.h +@@ -46,6 +46,7 @@ class CDVDInputStreamBluray + , public CDVDInputStream::IChapter + , public CDVDInputStream::IPosTime + , public CDVDInputStream::IMenus ++ , public CDVDInputStream::IExtentionStream + { + public: + CDVDInputStreamBluray(IVideoPlayer* player, const CFileItem& fileitem); +@@ -120,9 +121,10 @@ public: + BLURAY_TITLE_INFO* GetTitleFile(const std::string& name); + + void ProcessEvent(); +- CDVDDemux* GetDemuxMVC() { return m_pMVCDemux; }; +- bool HasMVC() { return m_bMVCPlayback; } +- bool AreEyesFlipped() { return m_bFlipEyes; } ++ CDVDDemux* GetExtentionDemux() override { return m_pMVCDemux; }; ++ bool HasExtention() override { return m_bMVCPlayback; } ++ bool AreEyesFlipped() override { return m_bFlipEyes; } ++ void DisableExtention() override; + + protected: + struct SPlane; +@@ -157,6 +159,7 @@ protected: + int m_nMVCSubPathIndex = 0; + int m_nMVCClip = -1; + bool m_bFlipEyes = false; ++ bool m_bMVCDisabled = false; + uint64_t m_clipStartTime = 0; + + typedef std::shared_ptr SOverlay; +diff --git a/xbmc/cores/VideoPlayer/IVideoPlayer.h b/xbmc/cores/VideoPlayer/IVideoPlayer.h +index 0b676c9b611fe956f1aa721013412e41ff5b62f6..6762e733848d1298a75a862b0aaf81aa5690537d 100644 +--- a/xbmc/cores/VideoPlayer/IVideoPlayer.h ++++ b/xbmc/cores/VideoPlayer/IVideoPlayer.h +@@ -111,6 +111,7 @@ public: + virtual int GetDecoderBufferSize() { return 0; } + virtual int GetDecoderFreeSpace() = 0; + virtual bool IsEOS() { return false; }; ++ virtual bool SupportsExtention() const = 0; + }; + + class CDVDAudioCodec; +diff --git a/xbmc/cores/VideoPlayer/VideoPlayer.cpp b/xbmc/cores/VideoPlayer/VideoPlayer.cpp +index d2482bcfb036cd5705afc3bae9bf759b6cf2f6b0..eda74e7b74452c7e8dfc18571ebcd355bd12a247 100644 +--- a/xbmc/cores/VideoPlayer/VideoPlayer.cpp ++++ b/xbmc/cores/VideoPlayer/VideoPlayer.cpp +@@ -3891,6 +3891,10 @@ bool CVideoPlayer::OpenVideoStream(CDVDStreamInfo& hint, bool reset) + if (!player->OpenStream(hint)) + return false; + ++ CDVDInputStream::IExtentionStream* pExt = dynamic_cast(m_pInputStream); ++ if (pExt && !static_cast(player)->SupportsExtention()) ++ pExt->DisableExtention(); ++ + s.stereo_mode = static_cast(player)->GetStereoMode(); + if (s.stereo_mode == "mono") + s.stereo_mode = ""; +diff --git a/xbmc/cores/VideoPlayer/VideoPlayerVideo.h b/xbmc/cores/VideoPlayer/VideoPlayerVideo.h +index 0d4100e58e9db7e5035bcf9ae23b0147f80cec8f..69570153f0810a5840f3780c7a6681a102b85cec 100644 +--- a/xbmc/cores/VideoPlayer/VideoPlayerVideo.h ++++ b/xbmc/cores/VideoPlayer/VideoPlayerVideo.h +@@ -91,6 +91,7 @@ public: + int GetVideoBitrate(); + std::string GetStereoMode(); + void SetSpeed(int iSpeed); ++ bool SupportsExtention() const override { return m_pVideoCodec && m_pVideoCodec->SupportsExtention(); } + + // classes + CDVDOverlayContainer* m_pOverlayContainer; + +From 9352e854adf22fa92a355da385cf0b9930ab9821 Mon Sep 17 00:00:00 2001 +From: Anton Fedchin +Date: Fri, 16 Sep 2016 11:37:48 +0300 +Subject: [PATCH 46/63] [Settings] move SETTING_VIDEOPLAYER_SUPPORTMVC from + platform settings to common settings. + +--- + system/settings/rbp.xml | 7 ------- + system/settings/settings.xml | 6 ++++++ + system/settings/win32.xml | 11 ----------- + .../VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp | 2 +- + xbmc/settings/SettingConditions.cpp | 3 +++ + 5 files changed, 10 insertions(+), 19 deletions(-) + +diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml +index 2572e25753712186f69390965ee1448bff3fadd5..7098edf32dff8c00e192229c3ffb060be6a42482 100644 +--- a/system/settings/rbp.xml ++++ b/system/settings/rbp.xml +@@ -28,13 +28,6 @@ + + + +- +- +- 2 +- true +- +- +- + +
+
+diff --git a/system/settings/settings.xml b/system/settings/settings.xml +index 22dcff1c06577055f84c3d2c2fda73cfa16c53d4..eb610a8aaa795d2caeaf2ab12bcf61b1148524b4 100644 +--- a/system/settings/settings.xml ++++ b/system/settings/settings.xml +@@ -343,6 +343,12 @@ + true + + ++ ++ 2 ++ true ++ ++ HAS_MVC ++ + + + +diff --git a/system/settings/win32.xml b/system/settings/win32.xml +index 2fcee72a64e8b701c8e895143410bbe9fd617356..a017d30c24232fb01220b87b29398403b8ed9662 100644 +--- a/system/settings/win32.xml ++++ b/system/settings/win32.xml +@@ -12,17 +12,6 @@ + false + +
+-
+- +- +- +- 2 +- true +- +- +- +- +-
+
+ + +diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp +index 74e8e1fc2da66d3c98a5bab04faa2f6bf16539ff..7dd85f0173bd636f4f5ae6e7fc43b3064e2ff822 100644 +--- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp ++++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp +@@ -1172,7 +1172,7 @@ bool CDVDInputStreamBluray::ProcessItem(int playitem) + + m_title = m_dll->bd_get_playlist_info(m_bd, playitem, m_angle); + +- if (CSettings::GetInstance().GetBool("videoplayer.supportmvc") && !m_bMVCDisabled) ++ if (CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC) && !m_bMVCDisabled) + { + MPLS_PL * mpls = m_dll->bd_get_title_mpls(m_bd); + if (mpls) +diff --git a/xbmc/settings/SettingConditions.cpp b/xbmc/settings/SettingConditions.cpp +index 6b1f2b6d757354d6065c2862b44dfb47184a1dcc..9163ec85bd0feb48a698a025d9870bf40042c675 100644 +--- a/xbmc/settings/SettingConditions.cpp ++++ b/xbmc/settings/SettingConditions.cpp +@@ -327,6 +327,9 @@ void CSettingConditions::Initialize() + m_simpleConditions.insert("has_dx"); + m_simpleConditions.insert("hasdxva2"); + #endif ++#if defined(HAVE_LIBMFX) || defined(TARGET_RASPBERRY_PI) ++ m_simpleConditions.insert("has_mvc"); ++#endif + #ifdef HAVE_LCMS2 + m_simpleConditions.insert("have_lcms2"); + #endif + +From 0bc38979bbe7ace03e826101248397b845581a7f Mon Sep 17 00:00:00 2001 +From: Anton Fedchin +Date: Fri, 4 Nov 2016 22:56:56 +0300 +Subject: [PATCH 47/63] [VideoPlayer] SSIF: fix for corner case when mvc stream + is switched before the last packet is read from previous stream. + +--- + .../VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 5 ++- + .../VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp | 7 ++-- + .../VideoPlayer/DVDInputStreams/DVDInputStream.h | 1 + + .../DVDInputStreams/DVDInputStreamBluray.cpp | 39 +++++++++++++++++++--- + .../DVDInputStreams/DVDInputStreamBluray.h | 3 ++ + 5 files changed, 45 insertions(+), 10 deletions(-) + +diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +index 0282b3e0c70c023c412128acae508d7ece3f294b..c3e8a84ed2cdb148717f05ca85aebb21bb2dab6e 100644 +--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp ++++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +@@ -1120,9 +1120,6 @@ bool CDVDDemuxFFmpeg::SeekTime(double time, bool backwards, double *startpts) + m_pkt.result = -1; + av_packet_unref(&m_pkt.pkt); + +- if (m_pSSIF) +- m_pSSIF->Flush(); +- + CDVDInputStream::IPosTime* ist = m_pInput->GetIPosTime(); + if (ist) + { +@@ -1136,6 +1133,8 @@ bool CDVDDemuxFFmpeg::SeekTime(double time, bool backwards, double *startpts) + + return true; + } ++ else if (m_pSSIF) ++ m_pSSIF->Flush(); + + if (!m_pInput->Seek(0, SEEK_POSSIBLE) && + !m_pInput->IsStreamType(DVDSTREAM_TYPE_FFMPEG)) +diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp +index 7c8719ce40e725e27b7551250398022a1f1a4fc6..c675e31f731bc6afb8aabc37bbb5495aed45f4f6 100644 +--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp ++++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxStreamSSIF.cpp +@@ -183,12 +183,15 @@ bool CDemuxStreamSSIF::FillMVCQueue(double dtsBase) + else if (mvc->dts < dtsBase) + { + #if defined(DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, ">>> MVC discard mvc: %6d, pts(%.3f) dts(%.3f)", mvc->iSize, mvc->pts*1e-6, mvc->dts*1e-6); ++ CLog::Log(LOGDEBUG, ">>> MVC drop mvc: %6d, pts(%.3f) dts(%.3f)", mvc->iSize, mvc->pts*1e-6, mvc->dts*1e-6); + #endif + CDVDDemuxUtils::FreeDemuxPacket(mvc); + continue; + } + AddMVCExtPacket(mvc); + }; +- return m_MVCqueue.size() == MVC_QUEUE_SIZE; ++ if (m_MVCqueue.size() != MVC_QUEUE_SIZE) ++ m_bluRay->OpenNextStream(); ++ ++ return true; + } +diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h +index 7aee35cef8f42d080882e4bdd20a4a9ed234a8c2..ea138f95bac915a946800f6bc7b964bd928e1a89 100644 +--- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h ++++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h +@@ -140,6 +140,7 @@ public: + virtual bool AreEyesFlipped() = 0; + virtual CDVDDemux* GetExtentionDemux() = 0; + virtual void DisableExtention() = 0; ++ virtual bool OpenNextStream() = 0; + }; + + enum ENextStream +diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp +index 7dd85f0173bd636f4f5ae6e7fc43b3064e2ff822..23053d7f8ebf494c7b35bf41bcf9952fa9a5f261 100644 +--- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp ++++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp +@@ -48,6 +48,7 @@ + #endif + + #define LIBBLURAY_BYTESEEK 0 ++#define EMPTY_QUEUE(x) { while(!x.empty()) x.pop(); } + + using namespace XFILE; + +@@ -432,6 +433,8 @@ bool CDVDInputStreamBluray::Open() + while (m_dll->bd_get_event(m_bd, &m_event)) + ProcessEvent(); + ++ OpenNextStream(); ++ + return true; + } + +@@ -610,10 +613,14 @@ void CDVDInputStreamBluray::ProcessEvent() { + /* event has been consumed */ + m_event.event = BD_EVENT_NONE; + +- if (m_bMVCPlayback && m_clip >= 0 && m_title && m_clip < m_title->clip_count && m_nMVCClip != m_clip) ++ if ( m_bMVCPlayback && m_clip >= 0 ++ && m_title ++ && m_clip < m_title->clip_count ++ && m_nMVCClip != m_clip ++ && (m_clipQueue.empty() ++ || m_clip != m_clipQueue.front())) + { +- CloseMVCDemux(); +- OpenMVCDemux(m_clip); ++ m_clipQueue.push(m_clip); + } + } + +@@ -935,10 +942,15 @@ bool CDVDInputStreamBluray::PosTime(int ms) + if(m_dll->bd_seek_time(m_bd, ms * 90) < 0) + return false; + ++ EMPTY_QUEUE(m_clipQueue); + while (m_dll->bd_get_event(m_bd, &m_event)) + ProcessEvent(); + +- SeekMVCDemux(ms - m_clipStartTime); ++ if (m_bMVCPlayback) ++ { ++ OpenNextStream(); ++ SeekMVCDemux(ms - m_clipStartTime); ++ } + return true; + } + +@@ -963,10 +975,15 @@ bool CDVDInputStreamBluray::SeekChapter(int ch) + if(m_title && m_dll->bd_seek_chapter(m_bd, ch-1) < 0) + return false; + ++ EMPTY_QUEUE(m_clipQueue); + while (m_dll->bd_get_event(m_bd, &m_event)) + ProcessEvent(); + +- SeekMVCDemux(GetChapterPos(ch) * 1000 - m_clipStartTime); ++ if (m_bMVCPlayback) ++ { ++ OpenNextStream(); ++ SeekMVCDemux(GetChapterPos(ch) * 1000 - m_clipStartTime); ++ } + return true; + } + +@@ -1196,6 +1213,18 @@ bool CDVDInputStreamBluray::ProcessItem(int playitem) + return true; + } + ++bool CDVDInputStreamBluray::OpenNextStream() ++{ ++ if (m_clipQueue.empty()) ++ return false; ++ ++ int clip = m_clipQueue.front(); ++ m_clipQueue.pop(); ++ ++ CloseMVCDemux(); ++ return OpenMVCDemux(clip); ++} ++ + bool CDVDInputStreamBluray::OpenMVCDemux(int playItem) + { + MPLS_PL *pl = m_dll->bd_get_title_mpls(m_bd); +diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.h b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.h +index f70657c9e31fb2460d12910c635dba5163282e74..a11ec77903d2a9b2c68106a8e2301af93823b0bd 100644 +--- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.h ++++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.h +@@ -23,6 +23,7 @@ + #include "DVDInputStream.h" + #include + #include ++#include + + extern "C" + { +@@ -125,6 +126,7 @@ public: + bool HasExtention() override { return m_bMVCPlayback; } + bool AreEyesFlipped() override { return m_bFlipEyes; } + void DisableExtention() override; ++ bool OpenNextStream() override; + + protected: + struct SPlane; +@@ -161,6 +163,7 @@ protected: + bool m_bFlipEyes = false; + bool m_bMVCDisabled = false; + uint64_t m_clipStartTime = 0; ++ std::queue m_clipQueue; + + typedef std::shared_ptr SOverlay; + typedef std::list SOverlays; + +From ed5005bc45795b939aeff91bed0f117c16b4dc2c Mon Sep 17 00:00:00 2001 +From: Anton Fedchin +Date: Tue, 23 Feb 2016 16:01:08 +0300 +Subject: [PATCH 48/63] [libbluray] bump libbluray to 0.9.2-mvc. + +--- + project/BuildDependencies/scripts/0_package.list | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/project/BuildDependencies/scripts/0_package.list b/project/BuildDependencies/scripts/0_package.list +index e6c608023a46d377ef520bf23e9863ee0350d980..f8db70ab3861835f33f0e4be79cf3d193093a45f 100644 +--- a/project/BuildDependencies/scripts/0_package.list ++++ b/project/BuildDependencies/scripts/0_package.list +@@ -17,7 +17,7 @@ freetype-2.6.3-win32-vc140.7z + giflib-5.1.4-win32-vc140.7z + jsonschemabuilder-1.0.0-win32-3.7z + libass-542975a-win32-vc140.7z +-libbluray-0.9.3-win32-vc140.7z ++libbluray-0.9.2-mvc-win32-vc120.7z + libcdio-0.9.3-win32-vc140.7z + libcec-4.0.0-win32-vc140-2.7z + libfribidi-0.19.2-win32.7z + +From c0fee4b9928898a5d274afb281bcb47914858ebb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 29 Feb 2016 17:00:50 +0000 -Subject: [PATCH 44/73] libbluray: Bump to Nevcairie's v0.9.2 +Subject: [PATCH 49/63] libbluray: Bump to Nevcairie's v0.9.2 This includes 3D support --- @@ -51168,15 +51416,148 @@ index 0000000000000000000000000000000000000000..5ef0124e35c9d81143921a328e272220 + + return fp; -From e513afc9435f9652af6e31e159e0a9e5217e3c96 Mon Sep 17 00:00:00 2001 +From a8036877d09fcadda752e2ef27141713d375db8e Mon Sep 17 00:00:00 2001 From: popcornmix -Date: Wed, 2 Mar 2016 19:40:47 +0000 -Subject: [PATCH 45/73] [VideoPlayer] Added new msdk-mvc decoder. +Date: Sun, 6 Mar 2016 12:54:59 +0000 +Subject: [PATCH 50/63] mvc: Automatically enable stereo mode + +--- + xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp | 6 +++++- + xbmc/cores/omxplayer/OMXVideo.cpp | 6 +++++- + 2 files changed, 10 insertions(+), 2 deletions(-) + +diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp +index e757ca64c1caf5c43988c2cb77da159b8f8eee93..368a26d9d7f1f3ca8b1666cb188446b120b934c2 100644 +--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp ++++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp +@@ -403,13 +403,17 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) + switch (hints.codec) + { + case AV_CODEC_ID_H264: ++ case AV_CODEC_ID_H264_MVC: + // H.264 + m_codingType = MMAL_ENCODING_H264; + m_pFormatName = "mmal-h264"; +- if (CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC)) ++ if ((hints.codec_tag == MKTAG('M', 'V', 'C', '1') || hints.codec_tag == MKTAG('A', 'M', 'V', 'C')) && ++ CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC)) + { + m_codingType = MMAL_ENCODING_MVC; + m_pFormatName= "mmal-mvc"; ++ if (hints.stereo_mode == "mono") ++ hints.stereo_mode = "mvc_lr"; + } + break; + case AV_CODEC_ID_H263: +diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp +index 311dd6689236d660919c4c4483c51dca2752514a..536332c43e22ccb229e72b88518e54dd8a23ac41 100644 +--- a/xbmc/cores/omxplayer/OMXVideo.cpp ++++ b/xbmc/cores/omxplayer/OMXVideo.cpp +@@ -398,6 +398,7 @@ bool COMXVideo::Open(CDVDStreamInfo &hints, OMXClock *clock, bool hdmi_clock_syn + switch (hints.codec) + { + case AV_CODEC_ID_H264: ++ case AV_CODEC_ID_H264_MVC: + { + switch(hints.profile) + { +@@ -434,10 +435,13 @@ bool COMXVideo::Open(CDVDStreamInfo &hints, OMXClock *clock, bool hdmi_clock_syn + break; + } + } +- if (CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC)) ++ if ((hints.codec_tag == MKTAG('M', 'V', 'C', '1') || hints.codec_tag == MKTAG('A', 'M', 'V', 'C')) && ++ CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC)) + { + m_codingType = OMX_VIDEO_CodingMVC; + m_video_codec_name = "omx-mvc"; ++ if (hints.stereo_mode == "mono") ++ hints.stereo_mode = "mvc_lr"; + } + break; + case AV_CODEC_ID_MPEG4: + +From 16bdfb5fba5132fc097c56c116a4628cf8ba05aa Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Thu, 24 Mar 2016 13:02:58 +0000 +Subject: [PATCH 51/63] ffmpeg: mvc: fix for pixelation from packets with no + pts/dts + +--- + .../73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105.patch | 24 ++++++++++++++++++++++ + tools/depends/target/ffmpeg/Makefile | 4 +++- + 2 files changed, 27 insertions(+), 1 deletion(-) + create mode 100644 tools/depends/target/ffmpeg/73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105.patch + +diff --git a/tools/depends/target/ffmpeg/73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105.patch b/tools/depends/target/ffmpeg/73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105.patch +new file mode 100644 +index 0000000000000000000000000000000000000000..5240cf58ce40c28d12354db63b7e29143ba46978 +--- /dev/null ++++ b/tools/depends/target/ffmpeg/73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105.patch +@@ -0,0 +1,24 @@ ++From 73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105 Mon Sep 17 00:00:00 2001 ++From: Hendrik Leppkes ++Date: Mon, 1 Sep 2014 11:39:09 +0200 ++Subject: [PATCH] h264_parser: force grabing a new timestamp until a frame ++ start was found ++ ++--- ++ libavcodec/h264_parser.c | 3 +++ ++ 1 file changed, 3 insertions(+) ++ ++diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c ++index 2fd3f2b..7165652 100644 ++--- a/libavcodec/h264_parser.c +++++ b/libavcodec/h264_parser.c ++@@ -525,6 +525,9 @@ static int h264_parse(AVCodecParserContext *s, ++ } else { ++ next = h264_find_frame_end(p, buf, buf_size); ++ +++ if (next == END_NOT_FOUND && pc->frame_start_found == 0) +++ s->fetch_timestamp = 1; +++ ++ if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) { ++ *poutbuf = NULL; ++ *poutbuf_size = 0; +diff --git a/tools/depends/target/ffmpeg/Makefile b/tools/depends/target/ffmpeg/Makefile +index 7e97e4d91a443d46d933df528763422ff5e8f4fa..d4f279fd4f2ceb260698cd6fedb124bae61018d0 100644 +--- a/tools/depends/target/ffmpeg/Makefile ++++ b/tools/depends/target/ffmpeg/Makefile +@@ -6,7 +6,8 @@ DEPS= ../../Makefile.include FFMPEG-VERSION Makefile \ + pfcd_hevc_optimisations.patch \ + 0001-Squashed-commit-of-the-following.patch \ + 0001-avcodec-add-h264_mvc-codec-id-and-profiles.patch 0001-h264_parser-add-support-for-parsing-h264-mvc-NALUs.patch \ +- h264_parser_fix_parsing_of_mvc_slices_in_some_corner_cases.patch ++ h264_parser_fix_parsing_of_mvc_slices_in_some_corner_cases.patch \ ++ 73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105.patch + + # set to "yes" to enable patching + # we don't apply patches until we move to a vanilla ffmpeg tarball +@@ -95,6 +96,7 @@ $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) + cd $(PLATFORM); patch -p1 < ../0001-avcodec-add-h264_mvc-codec-id-and-profiles.patch + cd $(PLATFORM); patch -p1 < ../0001-h264_parser-add-support-for-parsing-h264-mvc-NALUs.patch + cd $(PLATFORM); patch -p1 < ../h264_parser_fix_parsing_of_mvc_slices_in_some_corner_cases.patch ++ cd $(PLATFORM); patch -p1 < ../73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105.patch + + cd $(PLATFORM);\ + CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \ + +From 47c649a1866f8897059db26a63e43e3666223b95 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 11 Nov 2016 15:53:53 +0000 +Subject: [PATCH 52/63] stereoscopicmanager: fixups for rbp --- xbmc/cores/VideoPlayer/DVDCodecs/DVDCodecUtils.cpp | 61 ++++++++++++++++++++++ xbmc/cores/VideoPlayer/DVDCodecs/DVDCodecUtils.h | 4 ++ - 2 files changed, 65 insertions(+) + .../VideoPlayer/DVDCodecs/Video/MMALCodec.cpp | 9 +++- + xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h | 1 + + xbmc/cores/VideoPlayer/DVDDemuxers/Makefile.in | 2 +- + xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 5 ++ + xbmc/cores/omxplayer/OMXPlayerVideo.h | 1 + + xbmc/cores/omxplayer/OMXVideo.cpp | 2 +- + xbmc/guilib/StereoscopicsManager.cpp | 3 ++ + 9 files changed, 84 insertions(+), 4 deletions(-) diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/DVDCodecUtils.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/DVDCodecUtils.cpp index ac4e063460a39888a1a1113aab37b74cbf0a0766..0d88acfb85333e88b3774144499eb4421abc4566 100644 @@ -51286,225 +51667,90 @@ index 361c96623660305fc393273b1eaea4db096c417d..8ec50bbf79e9e163ccae25e30f3a40bf static ERenderFormat EFormatFromPixfmt(int fmt); static AVPixelFormat PixfmtFromEFormat(ERenderFormat format); }; - -From 8ac9fae10b66960c1405aa06fede7ea2f2d4ab50 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sun, 6 Mar 2016 12:54:59 +0000 -Subject: [PATCH 46/73] mvc: Automatically enable stereo mode - ---- - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp | 6 +++++- - xbmc/cores/omxplayer/OMXVideo.cpp | 6 +++++- - 2 files changed, 10 insertions(+), 2 deletions(-) - diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -index cead68bd79d388f0eda0f8a79f17d296478d3361..38e7d44b7968039120b9821fd5b6b2d552edf3c1 100644 +index 368a26d9d7f1f3ca8b1666cb188446b120b934c2..2257c94a6b095d9b0926c418c1faaf2ebfadf088 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -@@ -405,13 +405,17 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) - switch (hints.codec) - { - case AV_CODEC_ID_H264: -+ case AV_CODEC_ID_H264_MVC: - // H.264 +@@ -362,6 +362,11 @@ bool CMMALVideo::SendCodecConfigData() + return true; + } + ++bool CMMALVideo::SupportsExtention() ++{ ++ return CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC); ++} ++ + bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) + { + CSingleLock lock(m_sharedSection); +@@ -408,12 +413,12 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) m_codingType = MMAL_ENCODING_H264; m_pFormatName = "mmal-h264"; -- if (CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC)) -+ if ((hints.codec_tag == MKTAG('M', 'V', 'C', '1') || hints.codec_tag == MKTAG('A', 'M', 'V', 'C')) && -+ CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC)) + if ((hints.codec_tag == MKTAG('M', 'V', 'C', '1') || hints.codec_tag == MKTAG('A', 'M', 'V', 'C')) && +- CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC)) ++ SupportsExtention()) { m_codingType = MMAL_ENCODING_MVC; m_pFormatName= "mmal-mvc"; -+ if (hints.stereo_mode == "mono") -+ hints.stereo_mode = "mvc_lr"; - } - break; - case AV_CODEC_ID_H263: -diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp -index 311dd6689236d660919c4c4483c51dca2752514a..536332c43e22ccb229e72b88518e54dd8a23ac41 100644 ---- a/xbmc/cores/omxplayer/OMXVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXVideo.cpp -@@ -398,6 +398,7 @@ bool COMXVideo::Open(CDVDStreamInfo &hints, OMXClock *clock, bool hdmi_clock_syn - switch (hints.codec) - { - case AV_CODEC_ID_H264: -+ case AV_CODEC_ID_H264_MVC: - { - switch(hints.profile) - { -@@ -434,10 +435,13 @@ bool COMXVideo::Open(CDVDStreamInfo &hints, OMXClock *clock, bool hdmi_clock_syn - break; - } - } -- if (CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC)) -+ if ((hints.codec_tag == MKTAG('M', 'V', 'C', '1') || hints.codec_tag == MKTAG('A', 'M', 'V', 'C')) && -+ CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC)) - { - m_codingType = OMX_VIDEO_CodingMVC; - m_video_codec_name = "omx-mvc"; -+ if (hints.stereo_mode == "mono") -+ hints.stereo_mode = "mvc_lr"; - } - break; - case AV_CODEC_ID_MPEG4: - -From 2764d1e7a679c4b570af7e8cb704cffc02590dcd Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 24 Mar 2016 13:02:58 +0000 -Subject: [PATCH 47/73] ffmpeg: mvc: fix for pixelation from packets with no - pts/dts - ---- - .../73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105.patch | 24 ++++++++++++++++++++++ - tools/depends/target/ffmpeg/Makefile | 4 +++- - 2 files changed, 27 insertions(+), 1 deletion(-) - create mode 100644 tools/depends/target/ffmpeg/73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105.patch - -diff --git a/tools/depends/target/ffmpeg/73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105.patch b/tools/depends/target/ffmpeg/73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105.patch -new file mode 100644 -index 0000000000000000000000000000000000000000..5240cf58ce40c28d12354db63b7e29143ba46978 ---- /dev/null -+++ b/tools/depends/target/ffmpeg/73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105.patch -@@ -0,0 +1,24 @@ -+From 73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105 Mon Sep 17 00:00:00 2001 -+From: Hendrik Leppkes -+Date: Mon, 1 Sep 2014 11:39:09 +0200 -+Subject: [PATCH] h264_parser: force grabing a new timestamp until a frame -+ start was found -+ -+--- -+ libavcodec/h264_parser.c | 3 +++ -+ 1 file changed, 3 insertions(+) -+ -+diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c -+index 2fd3f2b..7165652 100644 -+--- a/libavcodec/h264_parser.c -++++ b/libavcodec/h264_parser.c -+@@ -525,6 +525,9 @@ static int h264_parse(AVCodecParserContext *s, -+ } else { -+ next = h264_find_frame_end(p, buf, buf_size); -+ -++ if (next == END_NOT_FOUND && pc->frame_start_found == 0) -++ s->fetch_timestamp = 1; -++ -+ if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) { -+ *poutbuf = NULL; -+ *poutbuf_size = 0; -diff --git a/tools/depends/target/ffmpeg/Makefile b/tools/depends/target/ffmpeg/Makefile -index 7e97e4d91a443d46d933df528763422ff5e8f4fa..d4f279fd4f2ceb260698cd6fedb124bae61018d0 100644 ---- a/tools/depends/target/ffmpeg/Makefile -+++ b/tools/depends/target/ffmpeg/Makefile -@@ -6,7 +6,8 @@ DEPS= ../../Makefile.include FFMPEG-VERSION Makefile \ - pfcd_hevc_optimisations.patch \ - 0001-Squashed-commit-of-the-following.patch \ - 0001-avcodec-add-h264_mvc-codec-id-and-profiles.patch 0001-h264_parser-add-support-for-parsing-h264-mvc-NALUs.patch \ -- h264_parser_fix_parsing_of_mvc_slices_in_some_corner_cases.patch -+ h264_parser_fix_parsing_of_mvc_slices_in_some_corner_cases.patch \ -+ 73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105.patch - - # set to "yes" to enable patching - # we don't apply patches until we move to a vanilla ffmpeg tarball -@@ -95,6 +96,7 @@ $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) - cd $(PLATFORM); patch -p1 < ../0001-avcodec-add-h264_mvc-codec-id-and-profiles.patch - cd $(PLATFORM); patch -p1 < ../0001-h264_parser-add-support-for-parsing-h264-mvc-NALUs.patch - cd $(PLATFORM); patch -p1 < ../h264_parser_fix_parsing_of_mvc_slices_in_some_corner_cases.patch -+ cd $(PLATFORM); patch -p1 < ../73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105.patch - - cd $(PLATFORM);\ - CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \ - -From c966666795999cb4bd4f8e43107d78e42cde580f Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 9 Mar 2016 13:08:44 +0000 -Subject: [PATCH 48/73] stereoscopicmanager: remove hardwarebased for rbp - ---- - xbmc/guilib/StereoscopicsManager.cpp | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/xbmc/guilib/StereoscopicsManager.cpp b/xbmc/guilib/StereoscopicsManager.cpp -index 6eb0752994bc5f8c47efbbf211120af0a0720d0c..9426604f6460651f54cc035476e69530b2ea8493 100644 ---- a/xbmc/guilib/StereoscopicsManager.cpp -+++ b/xbmc/guilib/StereoscopicsManager.cpp -@@ -72,8 +72,10 @@ static const struct StereoModeMap VideoModeToGuiModeMap[] = - { "anaglyph_yellow_blue", RENDER_STEREO_MODE_ANAGLYPH_YELLOW_BLUE }, - { "block_lr", RENDER_STEREO_MODE_OFF }, // unsupported - { "block_rl", RENDER_STEREO_MODE_OFF }, // unsupported -+#ifndef TARGET_RASPBERRY_PI - { "mvc_lr", RENDER_STEREO_MODE_HARDWAREBASED }, - { "mvc_rl", RENDER_STEREO_MODE_HARDWAREBASED }, -+#endif - { "mvc_lr", RENDER_STEREO_MODE_SPLIT_HORIZONTAL }, // fallback - { "mvc_rl", RENDER_STEREO_MODE_SPLIT_HORIZONTAL }, // fallback - {} - -From c2b6b76b5b397bdae56fe26490aa55267d6d2465 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Tue, 17 May 2016 19:24:08 +0100 -Subject: [PATCH 49/73] stereoscopics: Switch to using block_lr for mvc to - match makemkv - -See: http://forum.kodi.tv/showthread.php?tid=221407&pid=2339656#pid2339656 ---- - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp | 2 +- - xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 2 +- - xbmc/cores/VideoPlayer/VideoRenderers/RenderFlags.cpp | 8 ++------ - xbmc/cores/omxplayer/OMXVideo.cpp | 2 +- - xbmc/guilib/StereoscopicsManager.cpp | 11 +++++------ - 5 files changed, 10 insertions(+), 15 deletions(-) - -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -index 38e7d44b7968039120b9821fd5b6b2d552edf3c1..654a927a0d4cbf877a3bb2616d62f46a63e7cadb 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -@@ -415,7 +415,7 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) - m_codingType = MMAL_ENCODING_MVC; - m_pFormatName= "mmal-mvc"; if (hints.stereo_mode == "mono") - hints.stereo_mode = "mvc_lr"; + hints.stereo_mode = "block_lr"; } break; case AV_CODEC_ID_H263: -diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -index 9498f676602e85d020968a7ecf12a31a750ef0ba..6ac2da1262bd7f6a8304ef3192d67d1ea8d910c5 100644 ---- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -@@ -1470,7 +1470,7 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) - CDVDInputStreamBluray *bluRay = static_cast(m_pInput); - if (bluRay->HasMVC()) - { -- st->stereo_mode = bluRay->AreEyesFlipped() ? "mvc_rl" : "mvc_lr"; -+ st->stereo_mode = bluRay->AreEyesFlipped() ? "block_rl" : "block_lr"; - mvcStream = static_cast(bluRay->GetDemuxMVC())->GetAVStream(); - } - } -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/RenderFlags.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/RenderFlags.cpp -index 0b7b6178427302e0824734eb5c7aecd2a3b21a8c..49f7f7ca7e144a259f6d06bd11cd97aa0b3242aa 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/RenderFlags.cpp -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/RenderFlags.cpp -@@ -102,10 +102,8 @@ namespace RenderManager { - convert["right_left"] = CONF_FLAGS_STEREO_MODE_SBS | CONF_FLAGS_STEREO_CADANCE_RIGHT_LEFT; - convert["anaglyph_green_magenta"] = 0u; - convert["anaglyph_yellow_blue"] = 0u; -- convert["block_lr"] = 0u; -- convert["block_rl"] = 0u; -- convert["mvc_lr"] = 0u; -- convert["mvc_rl"] = 0u; -+ convert["block_lr"] = CONF_FLAGS_STEREO_CADANCE_LEFT_RIGHT; -+ convert["block_rl"] = CONF_FLAGS_STEREO_CADANCE_RIGHT_LEFT; - } - return convert[mode]; - } -@@ -127,8 +125,6 @@ namespace RenderManager { - convert["col_interleaved_lr"] = "col_interleaved_rl"; - convert["block_lr"] = "block_rl"; - convert["block_rl"] = "block_lr"; -- convert["mvc_lr"] = "mvc_rl"; -- convert["mvc_rl"] = "mvc_lr"; - } - std::string res = convert[mode]; - if(res.empty()) +diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h +index baff1f031149da5d669536711cc0057b2db078e3..1e49f09574c2a93b938d5eb405ebcb06543dec01 100644 +--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h ++++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h +@@ -104,6 +104,7 @@ public: + virtual bool GetCodecStats(double &pts, int &droppedPics); + virtual void SetCodecControl(int flags); + virtual void SetSpeed(int iSpeed); ++ virtual bool SupportsExtention(); + + // MMAL decoder callback routines. + void dec_output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer); +diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/Makefile.in b/xbmc/cores/VideoPlayer/DVDDemuxers/Makefile.in +index 0359426b85683a4c3a80ef0e0d52f7a79564daaa..7d19ec3c56fdea514628d27cf36e641707be030f 100644 +--- a/xbmc/cores/VideoPlayer/DVDDemuxers/Makefile.in ++++ b/xbmc/cores/VideoPlayer/DVDDemuxers/Makefile.in +@@ -11,7 +11,7 @@ SRCS += DVDDemuxVobsub.cpp + SRCS += DVDDemuxCC.cpp + SRCS += DVDFactoryDemuxer.cpp + SRCS += DemuxStreamSSIF.cpp +-SRCS += DVDDemuxMVC.cpp ++SRCS += DemuxMVC.cpp + + LIB = DVDDemuxers.a + +diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +index f6fb241dfec9269f4e501248de4dc83d5fdc2d3a..58ad6672e3351edbec537ad5b142ff14cb7389ea 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +@@ -111,6 +111,11 @@ OMXPlayerVideo::~OMXPlayerVideo() + CloseStream(false); + } + ++bool OMXPlayerVideo::SupportsExtention() const ++{ ++ return CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC); ++} ++ + bool OMXPlayerVideo::OpenStream(CDVDStreamInfo &hints) + { + m_hints = hints; +diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.h b/xbmc/cores/omxplayer/OMXPlayerVideo.h +index b5050081c360d29b1b478c27e6b88291e20ecdac..c880fa6bbb128b99f8a5393056586821143d99ff 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerVideo.h ++++ b/xbmc/cores/omxplayer/OMXPlayerVideo.h +@@ -96,6 +96,7 @@ public: + void WaitForBuffers() { m_messageQueue.WaitUntilEmpty(); } + int GetLevel() const { return m_messageQueue.GetLevel(); } + bool IsStalled() const { return m_stalled; } ++ bool SupportsExtention() const; + bool IsEOS(); + void CloseStream(bool bWaitForBuffers); + void Output(double pts, bool bDropPacket); diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp index 536332c43e22ccb229e72b88518e54dd8a23ac41..39bc0530cecd54ae8c3a5481c92f1a6a18a4d9c5 100644 --- a/xbmc/cores/omxplayer/OMXVideo.cpp @@ -51519,69 +51765,38 @@ index 536332c43e22ccb229e72b88518e54dd8a23ac41..39bc0530cecd54ae8c3a5481c92f1a6a break; case AV_CODEC_ID_MPEG4: diff --git a/xbmc/guilib/StereoscopicsManager.cpp b/xbmc/guilib/StereoscopicsManager.cpp -index 9426604f6460651f54cc035476e69530b2ea8493..cc929b599125a44ac128713fd4331782d9931791 100644 +index 6aaa82f4d883b8cae0ccdedf6c5a6814e7aaa720..cc929b599125a44ac128713fd4331782d9931791 100644 --- a/xbmc/guilib/StereoscopicsManager.cpp +++ b/xbmc/guilib/StereoscopicsManager.cpp -@@ -70,14 +70,13 @@ static const struct StereoModeMap VideoModeToGuiModeMap[] = +@@ -70,10 +70,13 @@ static const struct StereoModeMap VideoModeToGuiModeMap[] = { "anaglyph_cyan_red", RENDER_STEREO_MODE_ANAGLYPH_RED_CYAN }, { "anaglyph_green_magenta", RENDER_STEREO_MODE_ANAGLYPH_GREEN_MAGENTA }, { "anaglyph_yellow_blue", RENDER_STEREO_MODE_ANAGLYPH_YELLOW_BLUE }, -- { "block_lr", RENDER_STEREO_MODE_OFF }, // unsupported -- { "block_rl", RENDER_STEREO_MODE_OFF }, // unsupported - #ifndef TARGET_RASPBERRY_PI -- { "mvc_lr", RENDER_STEREO_MODE_HARDWAREBASED }, -- { "mvc_rl", RENDER_STEREO_MODE_HARDWAREBASED }, -+ { "block_lr", RENDER_STEREO_MODE_HARDWAREBASED }, -+ { "block_rl", RENDER_STEREO_MODE_HARDWAREBASED }, ++#ifndef TARGET_RASPBERRY_PI + { "block_lr", RENDER_STEREO_MODE_HARDWAREBASED }, + { "block_rl", RENDER_STEREO_MODE_HARDWAREBASED }, +#else -+ { "block_lr", RENDER_STEREO_MODE_SPLIT_HORIZONTAL }, // fallback -+ { "block_rl", RENDER_STEREO_MODE_SPLIT_HORIZONTAL }, // fallback - #endif -- { "mvc_lr", RENDER_STEREO_MODE_SPLIT_HORIZONTAL }, // fallback -- { "mvc_rl", RENDER_STEREO_MODE_SPLIT_HORIZONTAL }, // fallback + { "block_lr", RENDER_STEREO_MODE_SPLIT_HORIZONTAL }, // fallback + { "block_rl", RENDER_STEREO_MODE_SPLIT_HORIZONTAL }, // fallback ++#endif {} }; -From f1301d05093a677529ccc63fabbb161ea09a9d83 Mon Sep 17 00:00:00 2001 +From 89abe07219f314eb147833325a41323ca13932bc Mon Sep 17 00:00:00 2001 From: Anton Fedchin Date: Thu, 10 Mar 2016 18:11:33 +0300 -Subject: [PATCH 50/73] fixup! Revert supporting crappy tab/sbs subtitles. this +Subject: [PATCH 53/63] fixup! Revert supporting crappy tab/sbs subtitles. this fixes regular subtitles. --- - .../VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp | 9 +++++---- - 1 file changed, 5 insertions(+), 4 deletions(-) + xbmc/cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp | 1 + + 1 file changed, 1 insertion(+) diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp -index 3a080d06c90b0762482816928642e6de7810b539..7c0b70777556ac7694e7fc511cd4bb189fc42e08 100644 +index a8323f419e404037c4e5fb4d78fa1b45409337a7..7c0b70777556ac7694e7fc511cd4bb189fc42e08 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp -@@ -243,20 +243,20 @@ CDVDOverlay* CDVDOverlayCodecFFmpeg::GetOverlay() - } - } - -- RENDER_STEREO_MODE render_stereo_mode = g_graphicsContext.GetStereoMode(); -+ /*RENDER_STEREO_MODE render_stereo_mode = g_graphicsContext.GetStereoMode(); - if (render_stereo_mode != RENDER_STEREO_MODE_OFF) - { -- if (rect.h > m_height / 2) -+ if ((rect.h - rect.y) > m_height / 2) - { - m_height /= 2; - rect.h /= 2; - } -- else if (rect.w > m_width / 2) -+ else if ((rect.w - rect.x) > m_width / 2) - { - m_width /= 2; - rect.w /= 2; - } -- } -+ }*/ - - CDVDOverlayImage* overlay = new CDVDOverlayImage(); - @@ -290,6 +290,7 @@ CDVDOverlay* CDVDOverlayCodecFFmpeg::GetOverlay() m_SubtitleIndex++; @@ -51591,1045 +51806,57 @@ index 3a080d06c90b0762482816928642e6de7810b539..7c0b70777556ac7694e7fc511cd4bb18 } -From 7552084189bbac0c9b2a443fa071b1ebe85b1cf3 Mon Sep 17 00:00:00 2001 +From 6c4da5b733b9fd7092ad84c0213f99c9f917b1b5 Mon Sep 17 00:00:00 2001 From: popcornmix -Date: Tue, 10 Feb 2015 15:29:16 +0000 -Subject: [PATCH 51/73] [libcec] Add repeating keypress patch from popcornmix' - repo +Date: Sat, 26 Nov 2016 18:24:18 +0000 +Subject: [PATCH 54/63] DemuxMVC: fixup after SeekTime API change --- - tools/depends/target/libcec/Makefile | 1 + - tools/depends/target/libcec/popcornmix.patch | 859 +++++++++++++++++++++++++++ - 2 files changed, 860 insertions(+) - create mode 100644 tools/depends/target/libcec/popcornmix.patch + xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.cpp | 2 +- + xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) -diff --git a/tools/depends/target/libcec/Makefile b/tools/depends/target/libcec/Makefile -index f54af9e7ed3d0a9bef922517728c8b8db51d9d75..ddf996361ad5b46dd2b33fb035b2ed133914a612 100644 ---- a/tools/depends/target/libcec/Makefile -+++ b/tools/depends/target/libcec/Makefile -@@ -21,6 +21,7 @@ $(TARBALLS_LOCATION)/$(ARCHIVE): - $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) - rm -rf $(PLATFORM); mkdir -p $(PLATFORM)/build - cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) -+ cd $(PLATFORM); patch -p1 < ../popcornmix.patch - cd $(PLATFORM)/build; $(CMAKE) -DBUILD_SHARED_LIBS=1 -DSKIP_PYTHON_WRAPPER:STRING=1 -DCMAKE_INSTALL_LIBDIR=$(PREFIX)/lib .. +diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.cpp +index ade6a4454fc3915b0c787b1a4f72aedbd74903db..baefe44ca932ee98e482f1bed70d8949be71cfac 100644 +--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.cpp ++++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.cpp +@@ -188,7 +188,7 @@ DemuxPacket* CDemuxMVC::Read() + return nullptr; + } - $(LIBDYLIB): $(PLATFORM) -diff --git a/tools/depends/target/libcec/popcornmix.patch b/tools/depends/target/libcec/popcornmix.patch -new file mode 100644 -index 0000000000000000000000000000000000000000..8366a696562a934144cc9a21ea6f2cab3c69e655 ---- /dev/null -+++ b/tools/depends/target/libcec/popcornmix.patch -@@ -0,0 +1,859 @@ -+From ec982e9800ae312972d306b67779215a2add6cde Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Fri, 24 Oct 2014 13:45:21 +0100 -+Subject: [PATCH 1/6] Make released key polling wait for exact time until key -+ gets released -+ -+--- -+ src/libcec/CECClient.cpp | 16 ++++++++++++++-- -+ src/libcec/CECClient.h | 2 +- -+ src/libcec/CECProcessor.cpp | 8 +++++--- -+ src/libcec/LibCEC.cpp | 10 ++++++++-- -+ src/libcec/LibCEC.h | 4 +++- -+ 5 files changed, 31 insertions(+), 9 deletions(-) -+ -+diff --git a/src/libcec/CECClient.cpp b/src/libcec/CECClient.cpp -+index 35c2d3e..e307c0e 100644 -+--- a/src/libcec/CECClient.cpp -++++ b/src/libcec/CECClient.cpp -+@@ -1067,7 +1067,7 @@ void CCECClient::SetCurrentButton(const cec_user_control_code iButtonCode) -+ AddKey(key); -+ } -+ -+-void CCECClient::CheckKeypressTimeout(void) -++uint16_t CCECClient::CheckKeypressTimeout(void) -+ { -+ cec_keypress key; -+ -+@@ -1091,12 +1091,24 @@ void CCECClient::CheckKeypressTimeout(void) -+ } -+ else -+ { -+- return; -++ // time when this keypress will be released and we'd like to be called again -++ unsigned int timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -++ if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && m_iCurrentButton == comboKey && iTimeoutMs > 0) -++ timeout = iTimeoutMs - (iNow - m_buttontime) + 1; -++ else if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && m_iCurrentButton != comboKey) -++ timeout = CEC_BUTTON_TIMEOUT - (iNow - m_buttontime) + 1; -++ if (timeout > CEC_PROCESSOR_SIGNAL_WAIT_TIME) -++ { -++ LIB_CEC->AddLog(CEC_LOG_ERROR, "Unexpected timeout: %d (%.3f %.3f %.3f) k:%02x", timeout, iNow*1e-3, m_buttontime*1e-3, CEC_BUTTON_TIMEOUT*1e-3, m_iCurrentButton); -++ timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -++ } -++ return timeout; -+ } -+ } -+ -+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "key auto-released: %s (%1x)", ToString(key.keycode), key.keycode); -+ QueueAddKey(key); -++ return CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ } -+ -+ bool CCECClient::EnableCallbacks(void *cbParam, ICECCallbacks *callbacks) -+diff --git a/src/libcec/CECClient.h b/src/libcec/CECClient.h -+index 12f8a3b..c9ce5e3 100644 -+--- a/src/libcec/CECClient.h -++++ b/src/libcec/CECClient.h -+@@ -272,7 +272,7 @@ namespace CEC -+ virtual void AddKey(bool bSendComboKey = false); -+ virtual void AddKey(const cec_keypress &key); -+ virtual void SetCurrentButton(const cec_user_control_code iButtonCode); -+- virtual void CheckKeypressTimeout(void); -++ virtual uint16_t CheckKeypressTimeout(void); -+ virtual void SourceActivated(const cec_logical_address logicalAddress); -+ virtual void SourceDeactivated(const cec_logical_address logicalAddress); -+ -+diff --git a/src/libcec/CECProcessor.cpp b/src/libcec/CECProcessor.cpp -+index 99f71aa..604b950 100644 -+--- a/src/libcec/CECProcessor.cpp -++++ b/src/libcec/CECProcessor.cpp -+@@ -52,7 +52,6 @@ -+ using namespace CEC; -+ using namespace PLATFORM; -+ -+-#define CEC_PROCESSOR_SIGNAL_WAIT_TIME 1000 -+ #define ACTIVE_SOURCE_CHECK_INTERVAL 500 -+ #define TV_PRESENT_CHECK_INTERVAL 30000 -+ -+@@ -260,6 +259,7 @@ bool CCECProcessor::OnCommandReceived(const cec_command &command) -+ -+ void *CCECProcessor::Process(void) -+ { -++ uint16_t timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ m_libcec->AddLog(CEC_LOG_DEBUG, "processor thread started"); -+ -+ if (!m_connCheck) -+@@ -274,13 +274,13 @@ void *CCECProcessor::Process(void) -+ while (!IsStopped() && m_communication->IsOpen()) -+ { -+ // wait for a new incoming command, and process it -+- if (m_inBuffer.Pop(command, CEC_PROCESSOR_SIGNAL_WAIT_TIME)) -++ if (m_inBuffer.Pop(command, timeout)) -+ ProcessCommand(command); -+ -+ if (CECInitialised() && !IsStopped()) -+ { -+ // check clients for keypress timeouts -+- m_libcec->CheckKeypressTimeout(); -++ timeout = m_libcec->CheckKeypressTimeout(); -+ -+ // check if we need to replace handlers -+ ReplaceHandlers(); -+@@ -311,6 +311,8 @@ void *CCECProcessor::Process(void) -+ tvPresentCheck.Init(TV_PRESENT_CHECK_INTERVAL); -+ } -+ } -++ else -++ timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ } -+ -+ return NULL; -+diff --git a/src/libcec/LibCEC.cpp b/src/libcec/LibCEC.cpp -+index af36b79..5ccb8dd 100644 -+--- a/src/libcec/LibCEC.cpp -++++ b/src/libcec/LibCEC.cpp -+@@ -361,11 +361,17 @@ bool CLibCEC::IsValidPhysicalAddress(uint16_t iPhysicalAddress) -+ iPhysicalAddress <= CEC_MAX_PHYSICAL_ADDRESS; -+ } -+ -+-void CLibCEC::CheckKeypressTimeout(void) -++uint16_t CLibCEC::CheckKeypressTimeout(void) -+ { -++ uint16_t timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ // check all clients -+ for (std::vector::iterator it = m_clients.begin(); it != m_clients.end(); it++) -+- (*it)->CheckKeypressTimeout(); -++ { -++ uint16_t t = (*it)->CheckKeypressTimeout(); -++ if (t < timeout) -++ timeout = t; -++ } -++ return timeout; -+ } -+ -+ void CLibCEC::AddLog(const cec_log_level level, const char *strFormat, ...) -+diff --git a/src/libcec/LibCEC.h b/src/libcec/LibCEC.h -+index 6d9a229..d9d1e7b 100644 -+--- a/src/libcec/LibCEC.h -++++ b/src/libcec/LibCEC.h -+@@ -39,6 +39,8 @@ -+ #include "CECTypeUtils.h" -+ #include -+ -++#define CEC_PROCESSOR_SIGNAL_WAIT_TIME 1000 -++ -+ namespace CEC -+ { -+ class CAdapterCommunication; -+@@ -125,7 +127,7 @@ namespace CEC -+ -+ void AddLog(const cec_log_level level, const char *strFormat, ...); -+ void AddCommand(const cec_command &command); -+- void CheckKeypressTimeout(void); -++ uint16_t CheckKeypressTimeout(void); -+ void Alert(const libcec_alert type, const libcec_parameter ¶m); -+ -+ static bool IsValidPhysicalAddress(uint16_t iPhysicalAddress); -+-- -+1.9.1 -+ -+ -+From 41f0f3ec9ac136da3565c96fd5a7075499f3938d Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Fri, 24 Oct 2014 13:51:34 +0100 -+Subject: [PATCH 2/6] Keep track of time since initial button press and last -+ button update -+ -+--- -+ src/libcec/CECClient.cpp | 44 +++++++++++++++++++++++++++----------------- -+ src/libcec/CECClient.h | 3 ++- -+ 2 files changed, 29 insertions(+), 18 deletions(-) -+ -+diff --git a/src/libcec/CECClient.cpp b/src/libcec/CECClient.cpp -+index e307c0e..e7935b9 100644 -+--- a/src/libcec/CECClient.cpp -++++ b/src/libcec/CECClient.cpp -+@@ -54,7 +54,8 @@ CCECClient::CCECClient(CCECProcessor *processor, const libcec_configuration &con -+ m_bInitialised(false), -+ m_bRegistered(false), -+ m_iCurrentButton(CEC_USER_CONTROL_CODE_UNKNOWN), -+- m_buttontime(0), -++ m_initialButtontime(0), -++ m_updateButtontime(0), -+ m_iPreventForwardingPowerOffCommand(0), -+ m_iLastKeypressTime(0) -+ { -+@@ -981,9 +982,10 @@ void CCECClient::AddKey(bool bSendComboKey /* = false */) -+ CLockObject lock(m_mutex); -+ if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN) -+ { -+- key.duration = (unsigned int) (GetTimeMs() - m_buttontime); -++ unsigned int duration = (unsigned int) (GetTimeMs() - m_updateButtontime); -++ key.duration = (unsigned int) (GetTimeMs() - m_initialButtontime); -+ -+- if (key.duration > m_configuration.iComboKeyTimeoutMs || -++ if (duration > m_configuration.iComboKeyTimeoutMs || -+ m_configuration.iComboKeyTimeoutMs == 0 || -+ m_iCurrentButton != m_configuration.comboKey || -+ bSendComboKey) -+@@ -991,14 +993,15 @@ void CCECClient::AddKey(bool bSendComboKey /* = false */) -+ key.keycode = m_iCurrentButton; -+ -+ m_iCurrentButton = CEC_USER_CONTROL_CODE_UNKNOWN; -+- m_buttontime = 0; -++ m_initialButtontime = 0; -++ m_updateButtontime = 0; -+ } -+ } -+ } -+ -+ if (key.keycode != CEC_USER_CONTROL_CODE_UNKNOWN) -+ { -+- LIB_CEC->AddLog(CEC_LOG_DEBUG, "key released: %s (%1x)", ToString(key.keycode), key.keycode); -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "key released: %s (%1x) D:%dms", ToString(key.keycode), key.keycode, key.duration); -+ QueueAddKey(key); -+ } -+ } -+@@ -1012,7 +1015,7 @@ void CCECClient::AddKey(const cec_keypress &key) -+ AddKey(); -+ return; -+ } -+- -++ bool isrepeat = false; -+ cec_keypress transmitKey(key); -+ cec_user_control_code comboKey(m_configuration.clientVersion >= LIBCEC_VERSION_TO_UINT(2, 0, 5) ? -+ m_configuration.comboKey : CEC_USER_CONTROL_CODE_STOP); -+@@ -1035,22 +1038,27 @@ void CCECClient::AddKey(const cec_keypress &key) -+ AddKey(true); -+ } -+ -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "key pressed: %s (%1x) current(%lx) duration(%d)", ToString(transmitKey.keycode), transmitKey.keycode, m_iCurrentButton, key.duration); -++ -+ if (m_iCurrentButton == key.keycode) -+ { -+- m_buttontime = GetTimeMs(); -++ m_updateButtontime = GetTimeMs(); -++ isrepeat = true; -+ } -+ else -+ { -+- AddKey(); -++ if (m_iCurrentButton != transmitKey.keycode) -++ AddKey(); -+ if (key.duration == 0) -+ { -+ m_iCurrentButton = transmitKey.keycode; -+- m_buttontime = m_iCurrentButton == CEC_USER_CONTROL_CODE_UNKNOWN || key.duration > 0 ? 0 : GetTimeMs(); -++ m_initialButtontime = m_iCurrentButton == CEC_USER_CONTROL_CODE_UNKNOWN || key.duration > 0 ? 0 : GetTimeMs(); -++ m_updateButtontime = m_initialButtontime; -+ } -+ } -+ } -+ -+- if (key.keycode != comboKey || key.duration > 0) -++ if (!isrepeat && (key.keycode != comboKey || key.duration > 0)) -+ { -+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "key pressed: %s (%1x)", ToString(transmitKey.keycode), transmitKey.keycode); -+ QueueAddKey(transmitKey); -+@@ -1074,32 +1082,34 @@ uint16_t CCECClient::CheckKeypressTimeout(void) -+ { -+ CLockObject lock(m_mutex); -+ uint64_t iNow = GetTimeMs(); -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s T:%.3f", __FUNCTION__, iNow*1e-3); -+ cec_user_control_code comboKey(m_configuration.clientVersion >= LIBCEC_VERSION_TO_UINT(2, 0, 5) ? -+ m_configuration.comboKey : CEC_USER_CONTROL_CODE_STOP); -+ uint32_t iTimeoutMs(m_configuration.clientVersion >= LIBCEC_VERSION_TO_UINT(2, 0, 5) ? -+ m_configuration.iComboKeyTimeoutMs : CEC_DEFAULT_COMBO_TIMEOUT_MS); -+ -+ if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && -+- ((m_iCurrentButton == comboKey && iTimeoutMs > 0 && iNow - m_buttontime > iTimeoutMs) || -+- (m_iCurrentButton != comboKey && iNow - m_buttontime > CEC_BUTTON_TIMEOUT))) -++ ((m_iCurrentButton == comboKey && iTimeoutMs > 0 && iNow - m_updateButtontime > iTimeoutMs) || -++ (m_iCurrentButton != comboKey && iNow - m_updateButtontime > CEC_BUTTON_TIMEOUT))) -+ { -+- key.duration = (unsigned int) (iNow - m_buttontime); -++ key.duration = (unsigned int) (iNow - m_initialButtontime); -+ key.keycode = m_iCurrentButton; -+ -+ m_iCurrentButton = CEC_USER_CONTROL_CODE_UNKNOWN; -+- m_buttontime = 0; -++ m_initialButtontime = 0; -++ m_updateButtontime = 0; -+ } -+ else -+ { -+ // time when this keypress will be released and we'd like to be called again -+ unsigned int timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && m_iCurrentButton == comboKey && iTimeoutMs > 0) -+- timeout = iTimeoutMs - (iNow - m_buttontime) + 1; -++ timeout = iTimeoutMs - (iNow - m_updateButtontime) + 1; -+ else if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && m_iCurrentButton != comboKey) -+- timeout = CEC_BUTTON_TIMEOUT - (iNow - m_buttontime) + 1; -++ timeout = CEC_BUTTON_TIMEOUT - (iNow - m_updateButtontime) + 1; -+ if (timeout > CEC_PROCESSOR_SIGNAL_WAIT_TIME) -+ { -+- LIB_CEC->AddLog(CEC_LOG_ERROR, "Unexpected timeout: %d (%.3f %.3f %.3f) k:%02x", timeout, iNow*1e-3, m_buttontime*1e-3, CEC_BUTTON_TIMEOUT*1e-3, m_iCurrentButton); -++ LIB_CEC->AddLog(CEC_LOG_ERROR, "Unexpected timeout: %d (%.3f %.3f %.3f) k:%02x", timeout, iNow*1e-3, m_updateButtontime*1e-3, CEC_BUTTON_TIMEOUT*1e-3, m_iCurrentButton); -+ timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ } -+ return timeout; -+diff --git a/src/libcec/CECClient.h b/src/libcec/CECClient.h -+index c9ce5e3..611c68b 100644 -+--- a/src/libcec/CECClient.h -++++ b/src/libcec/CECClient.h -+@@ -404,7 +404,8 @@ namespace CEC -+ PLATFORM::CMutex m_mutex; /**< mutex for changes to this instance */ -+ PLATFORM::CMutex m_cbMutex; /**< mutex that is held when doing anything with callbacks */ -+ cec_user_control_code m_iCurrentButton; /**< the control code of the button that's currently held down (if any) */ -+- int64_t m_buttontime; /**< the timestamp when the button was pressed (in seconds since epoch), or 0 if none was pressed. */ -++ int64_t m_initialButtontime; /**< the timestamp when the button was initially pressed (in seconds since epoch), or 0 if none was pressed. */ -++ int64_t m_updateButtontime; /**< the timestamp when the button was updated (in seconds since epoch), or 0 if none was pressed. */ -+ int64_t m_iPreventForwardingPowerOffCommand; /**< prevent forwarding standby commands until this time */ -+ int64_t m_iLastKeypressTime; /**< last time a key press was sent to the client */ -+ cec_keypress m_lastKeypress; /**< the last key press that was sent to the client */ -+-- -+1.9.1 -+ -+ -+From 273ead6980b69eddf98810eb1eb33d94a7d74fce Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Tue, 28 Oct 2014 00:09:18 +0000 -+Subject: [PATCH 3/6] Support repeating button presses with configurable repeat -+ rate -+ -+--- -+ include/cectypes.h | 6 ++ -+ src/libcec/CECClient.cpp | 100 +++++++++++++++++++---- -+ src/libcec/CECClient.h | 6 +- -+ src/libcec/implementations/CECCommandHandler.cpp | 2 +- -+ 4 files changed, 96 insertions(+), 18 deletions(-) -+ -+diff --git a/include/cectypes.h b/include/cectypes.h -+index acff259..8f098ef 100644 -+--- a/include/cectypes.h -++++ b/include/cectypes.h -+@@ -1493,6 +1493,8 @@ struct libcec_configuration -+ XXX changed meaning in 2.2.0 to not break binary compatibility. next major (3.0) release will fix it in a nicer way */ -+ cec_user_control_code comboKey; /*!< key code that initiates combo keys. defaults to CEC_USER_CONTROL_CODE_F1_BLUE. CEC_USER_CONTROL_CODE_UNKNOWN to disable. added in 2.0.5 */ -+ uint32_t iComboKeyTimeoutMs; /*!< timeout until the combo key is sent as normal keypress */ -++ uint32_t iButtonRepeatRateMs; /*!< rate at which buttons autorepeat. 0 means rely on CEC device */ -++ uint32_t iButtonReleaseDelayMs;/*!< duration after last update until a button is considered released */ -+ -+ #ifdef __cplusplus -+ libcec_configuration(void) { Clear(); } -+@@ -1527,6 +1529,8 @@ struct libcec_configuration -+ cecVersion == other.cecVersion && -+ adapterType == other.adapterType && -+ iDoubleTapTimeout50Ms == other.iDoubleTapTimeout50Ms && -++ iButtonRepeatRateMs == other.iButtonRepeatRateMs && -++ iButtonReleaseDelayMs == other.iButtonReleaseDelayMs && -+ (other.clientVersion <= LIBCEC_VERSION_TO_UINT(2, 0, 4) || comboKey == other.comboKey) && -+ (other.clientVersion <= LIBCEC_VERSION_TO_UINT(2, 0, 4) || iComboKeyTimeoutMs == other.iComboKeyTimeoutMs) && -+ (other.clientVersion < LIBCEC_VERSION_TO_UINT(2, 1, 0) || bPowerOnScreensaver == other.bPowerOnScreensaver)); -+@@ -1567,6 +1571,8 @@ struct libcec_configuration -+ iDoubleTapTimeout50Ms = CEC_DOUBLE_TAP_TIMEOUT_50_MS; -+ comboKey = CEC_USER_CONTROL_CODE_STOP; -+ iComboKeyTimeoutMs = CEC_DEFAULT_COMBO_TIMEOUT_MS; -++ iButtonRepeatRateMs = 0; -++ iButtonReleaseDelayMs = CEC_BUTTON_TIMEOUT; -+ -+ memset(strDeviceName, 0, 13); -+ deviceTypes.Clear(); -+diff --git a/src/libcec/CECClient.cpp b/src/libcec/CECClient.cpp -+index e7935b9..598628d 100644 -+--- a/src/libcec/CECClient.cpp -++++ b/src/libcec/CECClient.cpp -+@@ -56,6 +56,10 @@ CCECClient::CCECClient(CCECProcessor *processor, const libcec_configuration &con -+ m_iCurrentButton(CEC_USER_CONTROL_CODE_UNKNOWN), -+ m_initialButtontime(0), -+ m_updateButtontime(0), -++ m_repeatButtontime(0), -++ m_releaseButtontime(0), -++ m_pressedButtoncount(0), -++ m_releasedButtoncount(0), -+ m_iPreventForwardingPowerOffCommand(0), -+ m_iLastKeypressTime(0) -+ { -+@@ -851,6 +855,9 @@ bool CCECClient::GetCurrentConfiguration(libcec_configuration &configuration) -+ configuration.bMonitorOnly = m_configuration.bMonitorOnly; -+ configuration.cecVersion = m_configuration.cecVersion; -+ configuration.adapterType = m_configuration.adapterType; -++ configuration.iDoubleTapTimeout50Ms = m_configuration.iDoubleTapTimeout50Ms; -++ configuration.iButtonRepeatRateMs = m_configuration.iButtonRepeatRateMs; -++ configuration.iButtonReleaseDelayMs = m_configuration.iButtonReleaseDelayMs; -+ -+ return true; -+ } -+@@ -894,6 +901,9 @@ bool CCECClient::SetConfiguration(const libcec_configuration &configuration) -+ m_configuration.cecVersion = configuration.cecVersion; -+ m_configuration.adapterType = configuration.adapterType; -+ m_configuration.iDoubleTapTimeout50Ms = configuration.iDoubleTapTimeout50Ms; -++ m_configuration.iButtonRepeatRateMs = configuration.iButtonRepeatRateMs; -++ m_configuration.iButtonReleaseDelayMs = configuration.iButtonReleaseDelayMs; -++ -+ m_configuration.deviceTypes.Add(configuration.deviceTypes[0]); -+ -+ if (m_configuration.clientVersion >= LIBCEC_VERSION_TO_UINT(2, 0, 5)) -+@@ -950,6 +960,7 @@ bool CCECClient::SetConfiguration(const libcec_configuration &configuration) -+ primary->ActivateSource(); -+ } -+ -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s: %d:%d:%d", __FUNCTION__, DoubleTapTimeoutMS(), m_configuration.iButtonRepeatRateMs, m_configuration.iButtonReleaseDelayMs); -+ return true; -+ } -+ -+@@ -973,11 +984,15 @@ void CCECClient::AddCommand(const cec_command &command) -+ } -+ } -+ -+-void CCECClient::AddKey(bool bSendComboKey /* = false */) -++void CCECClient::AddKey(bool bSendComboKey /* = false */, bool bButtonRelease /* = false */) -+ { -+ cec_keypress key; -+ key.keycode = CEC_USER_CONTROL_CODE_UNKNOWN; -+ -++ // we ignore button releases when supporting repeating keys -++ if (bButtonRelease && m_configuration.iButtonRepeatRateMs && m_configuration.iButtonReleaseDelayMs) -++ return; -++ -+ { -+ CLockObject lock(m_mutex); -+ if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN) -+@@ -995,6 +1010,10 @@ void CCECClient::AddKey(bool bSendComboKey /* = false */) -+ m_iCurrentButton = CEC_USER_CONTROL_CODE_UNKNOWN; -+ m_initialButtontime = 0; -+ m_updateButtontime = 0; -++ m_repeatButtontime = 0; -++ m_releaseButtontime = 0; -++ m_pressedButtoncount = 0; -++ m_releasedButtoncount = 0; -+ } -+ } -+ } -+@@ -1012,6 +1031,7 @@ void CCECClient::AddKey(const cec_keypress &key) -+ key.keycode < CEC_USER_CONTROL_CODE_SELECT) -+ { -+ // send back the previous key if there is one -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "Unexpected key %s (%1x) D:%dms", ToString(key.keycode), key.keycode, key.duration); -+ AddKey(); -+ return; -+ } -+@@ -1035,7 +1055,10 @@ void CCECClient::AddKey(const cec_keypress &key) -+ transmitKey.keycode = CEC_USER_CONTROL_CODE_DOT; -+ // default, send back the previous key -+ else -++ { -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "Combo key %s (%1x) D%dms:", ToString(key.keycode), key.keycode, key.duration); -+ AddKey(true); -++ } -+ } -+ -+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "key pressed: %s (%1x) current(%lx) duration(%d)", ToString(transmitKey.keycode), transmitKey.keycode, m_iCurrentButton, key.duration); -+@@ -1043,17 +1066,44 @@ void CCECClient::AddKey(const cec_keypress &key) -+ if (m_iCurrentButton == key.keycode) -+ { -+ m_updateButtontime = GetTimeMs(); -+- isrepeat = true; -++ m_releaseButtontime = m_updateButtontime + (m_configuration.iButtonReleaseDelayMs ? m_configuration.iButtonReleaseDelayMs : CEC_BUTTON_TIMEOUT); -++ // want to have seen some updated before considering a repeat -++ if (m_configuration.iButtonRepeatRateMs) -++ { -++ if (!m_repeatButtontime && m_pressedButtoncount > 1) -++ m_repeatButtontime = m_initialButtontime + DoubleTapTimeoutMS(); -++ isrepeat = true; -++ } -++ m_pressedButtoncount++; -+ } -+ else -+ { -+ if (m_iCurrentButton != transmitKey.keycode) -++ { -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "Changed key %s (%1x) D:%dms cur:%lx", ToString(transmitKey.keycode), transmitKey.keycode, transmitKey.duration, m_iCurrentButton); -+ AddKey(); -++ } -+ if (key.duration == 0) -+ { -+ m_iCurrentButton = transmitKey.keycode; -+- m_initialButtontime = m_iCurrentButton == CEC_USER_CONTROL_CODE_UNKNOWN || key.duration > 0 ? 0 : GetTimeMs(); -+- m_updateButtontime = m_initialButtontime; -++ if (m_iCurrentButton == CEC_USER_CONTROL_CODE_UNKNOWN) -++ { -++ m_initialButtontime = 0; -++ m_updateButtontime = 0; -++ m_repeatButtontime = 0; -++ m_releaseButtontime = 0; -++ m_pressedButtoncount = 0; -++ m_releasedButtoncount = 0; -++ } -++ else -++ { -++ m_initialButtontime = GetTimeMs(); -++ m_updateButtontime = m_initialButtontime; -++ m_repeatButtontime = 0; // set this on next update -++ m_releaseButtontime = m_initialButtontime + (m_configuration.iButtonReleaseDelayMs ? m_configuration.iButtonReleaseDelayMs : CEC_BUTTON_TIMEOUT); -++ m_pressedButtoncount = 1; -++ m_releasedButtoncount = 0; -++ } -+ } -+ } -+ } -+@@ -1072,12 +1122,16 @@ void CCECClient::SetCurrentButton(const cec_user_control_code iButtonCode) -+ key.duration = 0; -+ key.keycode = iButtonCode; -+ -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "SetCurrentButton %s (%1x) D:%dms cur:%lx", ToString(key.keycode), key.keycode, key.duration); -+ AddKey(key); -+ } -+ -+ uint16_t CCECClient::CheckKeypressTimeout(void) -+ { -++ // time when we'd like to be called again -++ unsigned int timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ cec_keypress key; -++ key.keycode = CEC_USER_CONTROL_CODE_UNKNOWN; -+ -+ { -+ CLockObject lock(m_mutex); -+@@ -1089,8 +1143,8 @@ uint16_t CCECClient::CheckKeypressTimeout(void) -+ m_configuration.iComboKeyTimeoutMs : CEC_DEFAULT_COMBO_TIMEOUT_MS); -+ -+ if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && -+- ((m_iCurrentButton == comboKey && iTimeoutMs > 0 && iNow - m_updateButtontime > iTimeoutMs) || -+- (m_iCurrentButton != comboKey && iNow - m_updateButtontime > CEC_BUTTON_TIMEOUT))) -++ ((m_iCurrentButton == comboKey && iTimeoutMs > 0 && iNow - m_updateButtontime >= iTimeoutMs) || -++ (m_iCurrentButton != comboKey && m_releaseButtontime && iNow >= (uint64_t)m_releaseButtontime))) -+ { -+ key.duration = (unsigned int) (iNow - m_initialButtontime); -+ key.keycode = m_iCurrentButton; -+@@ -1098,27 +1152,41 @@ uint16_t CCECClient::CheckKeypressTimeout(void) -+ m_iCurrentButton = CEC_USER_CONTROL_CODE_UNKNOWN; -+ m_initialButtontime = 0; -+ m_updateButtontime = 0; -++ m_repeatButtontime = 0; -++ m_releaseButtontime = 0; -++ m_pressedButtoncount = 0; -++ m_releasedButtoncount = 0; -++ } -++ else if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && -++ (m_iCurrentButton != comboKey && m_repeatButtontime && iNow >= (uint64_t)m_repeatButtontime)) -++ { -++ key.duration = 0; -++ key.keycode = m_iCurrentButton; -++ m_repeatButtontime = iNow + m_configuration.iButtonRepeatRateMs; -++ timeout = std::min((uint64_t)timeout, m_repeatButtontime - iNow); -+ } -+ else -+ { -+- // time when this keypress will be released and we'd like to be called again -+- unsigned int timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && m_iCurrentButton == comboKey && iTimeoutMs > 0) -+- timeout = iTimeoutMs - (iNow - m_updateButtontime) + 1; -+- else if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && m_iCurrentButton != comboKey) -+- timeout = CEC_BUTTON_TIMEOUT - (iNow - m_updateButtontime) + 1; -++ timeout = std::min((uint64_t)timeout, m_updateButtontime - iNow + iTimeoutMs); -++ if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && m_iCurrentButton != comboKey && m_releaseButtontime) -++ timeout = std::min((uint64_t)timeout, m_releaseButtontime - iNow); -++ if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && m_iCurrentButton != comboKey && m_repeatButtontime) -++ timeout = std::min((uint64_t)timeout, m_repeatButtontime - iNow); -+ if (timeout > CEC_PROCESSOR_SIGNAL_WAIT_TIME) -+ { -+- LIB_CEC->AddLog(CEC_LOG_ERROR, "Unexpected timeout: %d (%.3f %.3f %.3f) k:%02x", timeout, iNow*1e-3, m_updateButtontime*1e-3, CEC_BUTTON_TIMEOUT*1e-3, m_iCurrentButton); -++ LIB_CEC->AddLog(CEC_LOG_ERROR, "Unexpected timeout: %d (%.3f %.3f %.3f) k:%02x", timeout, iNow*1e-3, m_updateButtontime*1e-3, m_releaseButtontime*1e-3, m_iCurrentButton); -+ timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ } -+- return timeout; -+ } -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "key %s: %s (%1x) timeout:%dms (rel:%d,rep:%d,prs:%d,rel:%d)", key.keycode == CEC_USER_CONTROL_CODE_UNKNOWN ? "idle" : key.duration ? "released" : "repeated", -++ ToString(m_iCurrentButton), m_iCurrentButton, timeout, (int)(m_releaseButtontime ? m_releaseButtontime - iNow : 0), (int)(m_repeatButtontime ? m_repeatButtontime - iNow : 0), m_pressedButtoncount, m_releasedButtoncount); -+ } -+ -+- LIB_CEC->AddLog(CEC_LOG_DEBUG, "key auto-released: %s (%1x)", ToString(key.keycode), key.keycode); -+- QueueAddKey(key); -+- return CEC_PROCESSOR_SIGNAL_WAIT_TIME; -++ if (key.keycode != CEC_USER_CONTROL_CODE_UNKNOWN) -++ QueueAddKey(key); -++ -++ return timeout; -+ } -+ -+ bool CCECClient::EnableCallbacks(void *cbParam, ICECCallbacks *callbacks) -+diff --git a/src/libcec/CECClient.h b/src/libcec/CECClient.h -+index 611c68b..adeb5af 100644 -+--- a/src/libcec/CECClient.h -++++ b/src/libcec/CECClient.h -+@@ -269,7 +269,7 @@ namespace CEC -+ // callbacks -+ virtual void Alert(const libcec_alert type, const libcec_parameter ¶m) { QueueAlert(type, param); } -+ virtual void AddLog(const cec_log_message &message) { QueueAddLog(message); } -+- virtual void AddKey(bool bSendComboKey = false); -++ virtual void AddKey(bool bSendComboKey = false, bool bButtonRelease = false); -+ virtual void AddKey(const cec_keypress &key); -+ virtual void SetCurrentButton(const cec_user_control_code iButtonCode); -+ virtual uint16_t CheckKeypressTimeout(void); -+@@ -406,6 +406,10 @@ namespace CEC -+ cec_user_control_code m_iCurrentButton; /**< the control code of the button that's currently held down (if any) */ -+ int64_t m_initialButtontime; /**< the timestamp when the button was initially pressed (in seconds since epoch), or 0 if none was pressed. */ -+ int64_t m_updateButtontime; /**< the timestamp when the button was updated (in seconds since epoch), or 0 if none was pressed. */ -++ int64_t m_repeatButtontime; /**< the timestamp when the button will next repeat (in seconds since epoch), or 0 if repeat is disabled. */ -++ int64_t m_releaseButtontime; /**< the timestamp when the button will be released (in seconds since epoch), or 0 if none was pressed. */ -++ int32_t m_pressedButtoncount; /**< the number of times a button released message has been seen for this press. */ -++ int32_t m_releasedButtoncount; /**< the number of times a button pressed message has been seen for this press. */ -+ int64_t m_iPreventForwardingPowerOffCommand; /**< prevent forwarding standby commands until this time */ -+ int64_t m_iLastKeypressTime; /**< last time a key press was sent to the client */ -+ cec_keypress m_lastKeypress; /**< the last key press that was sent to the client */ -+diff --git a/src/libcec/implementations/CECCommandHandler.cpp b/src/libcec/implementations/CECCommandHandler.cpp -+index 6d6244e..d64186f 100644 -+--- a/src/libcec/implementations/CECCommandHandler.cpp -++++ b/src/libcec/implementations/CECCommandHandler.cpp -+@@ -770,7 +770,7 @@ int CCECCommandHandler::HandleUserControlRelease(const cec_command &command) -+ -+ CECClientPtr client = m_processor->GetClient(command.destination); -+ if (client) -+- client->AddKey(); -++ client->AddKey(false, true); -+ -+ return COMMAND_HANDLED; -+ } -+-- -+1.9.1 -+ -+ -+From 3336d0827f7fd159430f3431642b07090c06c869 Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Tue, 28 Oct 2014 01:21:35 +0000 -+Subject: [PATCH 4/6] Skip double press removal. It is handled through other -+ means. -+ -+--- -+ src/libcec/CECClient.cpp | 18 +----------------- -+ src/libcec/CECClient.h | 2 -- -+ 2 files changed, 1 insertion(+), 19 deletions(-) -+ -+diff --git a/src/libcec/CECClient.cpp b/src/libcec/CECClient.cpp -+index 598628d..dccd874 100644 -+--- a/src/libcec/CECClient.cpp -++++ b/src/libcec/CECClient.cpp -+@@ -60,11 +60,8 @@ CCECClient::CCECClient(CCECProcessor *processor, const libcec_configuration &con -+ m_releaseButtontime(0), -+ m_pressedButtoncount(0), -+ m_releasedButtoncount(0), -+- m_iPreventForwardingPowerOffCommand(0), -+- m_iLastKeypressTime(0) -++ m_iPreventForwardingPowerOffCommand(0) -+ { -+- m_lastKeypress.keycode = CEC_USER_CONTROL_CODE_UNKNOWN; -+- m_lastKeypress.duration = 0; -+ m_configuration.Clear(); -+ // set the initial configuration -+ SetConfiguration(configuration); -+@@ -1647,20 +1644,7 @@ void CCECClient::CallbackAddKey(const cec_keypress &key) -+ { -+ CLockObject lock(m_cbMutex); -+ if (m_configuration.callbacks && m_configuration.callbacks->CBCecKeyPress) -+- { -+- // prevent double taps -+- int64_t now = GetTimeMs(); -+- if (m_lastKeypress.keycode != key.keycode || -+- key.duration > 0 || -+- now - m_iLastKeypressTime >= DoubleTapTimeoutMS()) -+- { -+- // no double tap -+- if (key.duration == 0) -+- m_iLastKeypressTime = now; -+- m_lastKeypress = key; -+ m_configuration.callbacks->CBCecKeyPress(m_configuration.callbackParam, key); -+- } -+- } -+ } -+ -+ void CCECClient::CallbackAddLog(const cec_log_message &message) -+diff --git a/src/libcec/CECClient.h b/src/libcec/CECClient.h -+index adeb5af..43a713b 100644 -+--- a/src/libcec/CECClient.h -++++ b/src/libcec/CECClient.h -+@@ -411,8 +411,6 @@ namespace CEC -+ int32_t m_pressedButtoncount; /**< the number of times a button released message has been seen for this press. */ -+ int32_t m_releasedButtoncount; /**< the number of times a button pressed message has been seen for this press. */ -+ int64_t m_iPreventForwardingPowerOffCommand; /**< prevent forwarding standby commands until this time */ -+- int64_t m_iLastKeypressTime; /**< last time a key press was sent to the client */ -+- cec_keypress m_lastKeypress; /**< the last key press that was sent to the client */ -+ PLATFORM::SyncedBuffer m_callbackCalls; -+ }; -+ } -+-- -+1.9.1 -+ -+ -+From 0dd0234f620a546bfa843172648383f83d88088c Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Mon, 3 Nov 2014 23:28:04 +0000 -+Subject: [PATCH 5/6] Pass through duration on all button repeats -+ -+--- -+ src/libcec/CECClient.cpp | 34 ++++++++++++++++++++++++---------- -+ 1 file changed, 24 insertions(+), 10 deletions(-) -+ -+diff --git a/src/libcec/CECClient.cpp b/src/libcec/CECClient.cpp -+index dccd874..1946148 100644 -+--- a/src/libcec/CECClient.cpp -++++ b/src/libcec/CECClient.cpp -+@@ -986,10 +986,6 @@ void CCECClient::AddKey(bool bSendComboKey /* = false */, bool bButtonRelease /* -+ cec_keypress key; -+ key.keycode = CEC_USER_CONTROL_CODE_UNKNOWN; -+ -+- // we ignore button releases when supporting repeating keys -+- if (bButtonRelease && m_configuration.iButtonRepeatRateMs && m_configuration.iButtonReleaseDelayMs) -+- return; -+- -+ { -+ CLockObject lock(m_mutex); -+ if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN) -+@@ -1015,6 +1011,10 @@ void CCECClient::AddKey(bool bSendComboKey /* = false */, bool bButtonRelease /* -+ } -+ } -+ -++ // we don't forward releases when supporting repeating keys -++ if (bButtonRelease && m_configuration.iButtonRepeatRateMs) -++ return; -++ -+ if (key.keycode != CEC_USER_CONTROL_CODE_UNKNOWN) -+ { -+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "key released: %s (%1x) D:%dms", ToString(key.keycode), key.keycode, key.duration); -+@@ -1107,7 +1107,7 @@ void CCECClient::AddKey(const cec_keypress &key) -+ -+ if (!isrepeat && (key.keycode != comboKey || key.duration > 0)) -+ { -+- LIB_CEC->AddLog(CEC_LOG_DEBUG, "key pressed: %s (%1x)", ToString(transmitKey.keycode), transmitKey.keycode); -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "key pressed: %s (%1x, %d)", ToString(transmitKey.keycode), transmitKey.keycode, transmitKey.duration); -+ QueueAddKey(transmitKey); -+ } -+ } -+@@ -1129,6 +1129,7 @@ uint16_t CCECClient::CheckKeypressTimeout(void) -+ unsigned int timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ cec_keypress key; -+ key.keycode = CEC_USER_CONTROL_CODE_UNKNOWN; -++ key.duration = 0; -+ -+ { -+ CLockObject lock(m_mutex); -+@@ -1140,8 +1141,7 @@ uint16_t CCECClient::CheckKeypressTimeout(void) -+ m_configuration.iComboKeyTimeoutMs : CEC_DEFAULT_COMBO_TIMEOUT_MS); -+ -+ if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && -+- ((m_iCurrentButton == comboKey && iTimeoutMs > 0 && iNow - m_updateButtontime >= iTimeoutMs) || -+- (m_iCurrentButton != comboKey && m_releaseButtontime && iNow >= (uint64_t)m_releaseButtontime))) -++ m_iCurrentButton == comboKey && iTimeoutMs > 0 && iNow - m_updateButtontime >= iTimeoutMs) -+ { -+ key.duration = (unsigned int) (iNow - m_initialButtontime); -+ key.keycode = m_iCurrentButton; -+@@ -1155,9 +1155,23 @@ uint16_t CCECClient::CheckKeypressTimeout(void) -+ m_releasedButtoncount = 0; -+ } -+ else if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && -++ m_iCurrentButton != comboKey && m_releaseButtontime && iNow >= (uint64_t)m_releaseButtontime) -++ { -++ key.duration = (unsigned int) (iNow - m_initialButtontime); -++ key.keycode = CEC_USER_CONTROL_CODE_UNKNOWN; -++ -++ m_iCurrentButton = CEC_USER_CONTROL_CODE_UNKNOWN; -++ m_initialButtontime = 0; -++ m_updateButtontime = 0; -++ m_repeatButtontime = 0; -++ m_releaseButtontime = 0; -++ m_pressedButtoncount = 0; -++ m_releasedButtoncount = 0; -++ } -++ else if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && -+ (m_iCurrentButton != comboKey && m_repeatButtontime && iNow >= (uint64_t)m_repeatButtontime)) -+ { -+- key.duration = 0; -++ key.duration = (unsigned int) (iNow - m_initialButtontime); -+ key.keycode = m_iCurrentButton; -+ m_repeatButtontime = iNow + m_configuration.iButtonRepeatRateMs; -+ timeout = std::min((uint64_t)timeout, m_repeatButtontime - iNow); -+@@ -1176,8 +1190,8 @@ uint16_t CCECClient::CheckKeypressTimeout(void) -+ timeout = CEC_PROCESSOR_SIGNAL_WAIT_TIME; -+ } -+ } -+- LIB_CEC->AddLog(CEC_LOG_DEBUG, "key %s: %s (%1x) timeout:%dms (rel:%d,rep:%d,prs:%d,rel:%d)", key.keycode == CEC_USER_CONTROL_CODE_UNKNOWN ? "idle" : key.duration ? "released" : "repeated", -+- ToString(m_iCurrentButton), m_iCurrentButton, timeout, (int)(m_releaseButtontime ? m_releaseButtontime - iNow : 0), (int)(m_repeatButtontime ? m_repeatButtontime - iNow : 0), m_pressedButtoncount, m_releasedButtoncount); -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "Key %s: %s (duration:%d) (%1x) timeout:%dms (rel:%d,rep:%d,prs:%d,rel:%d)", ToString(m_iCurrentButton), key.keycode == CEC_USER_CONTROL_CODE_UNKNOWN ? "idle" : m_repeatButtontime ? "repeated" : "released", key.duration, -++ m_iCurrentButton, timeout, (int)(m_releaseButtontime ? m_releaseButtontime - iNow : 0), (int)(m_repeatButtontime ? m_repeatButtontime - iNow : 0), m_pressedButtoncount, m_releasedButtoncount); -+ } -+ -+ if (key.keycode != CEC_USER_CONTROL_CODE_UNKNOWN) -+-- -+1.9.1 -+ -+ -+From 1ea01f59d8186d4d53af41961aaccbbc11651115 Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Wed, 5 Nov 2014 21:04:25 +0000 -+Subject: [PATCH 6/6] squash: Fix for stop needing to be pressed twice -+ -+--- -+ src/libcec/CECClient.cpp | 17 ++++++++--------- -+ 1 file changed, 8 insertions(+), 9 deletions(-) -+ -+diff --git a/src/libcec/CECClient.cpp b/src/libcec/CECClient.cpp -+index 1946148..f4f114b 100644 -+--- a/src/libcec/CECClient.cpp -++++ b/src/libcec/CECClient.cpp -+@@ -1131,6 +1131,8 @@ uint16_t CCECClient::CheckKeypressTimeout(void) -+ key.keycode = CEC_USER_CONTROL_CODE_UNKNOWN; -+ key.duration = 0; -+ -++ if (m_iCurrentButton == CEC_USER_CONTROL_CODE_UNKNOWN) -++ return timeout; -+ { -+ CLockObject lock(m_mutex); -+ uint64_t iNow = GetTimeMs(); -+@@ -1140,8 +1142,7 @@ uint16_t CCECClient::CheckKeypressTimeout(void) -+ uint32_t iTimeoutMs(m_configuration.clientVersion >= LIBCEC_VERSION_TO_UINT(2, 0, 5) ? -+ m_configuration.iComboKeyTimeoutMs : CEC_DEFAULT_COMBO_TIMEOUT_MS); -+ -+- if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && -+- m_iCurrentButton == comboKey && iTimeoutMs > 0 && iNow - m_updateButtontime >= iTimeoutMs) -++ if (m_iCurrentButton == comboKey && iTimeoutMs > 0 && iNow - m_updateButtontime >= iTimeoutMs) -+ { -+ key.duration = (unsigned int) (iNow - m_initialButtontime); -+ key.keycode = m_iCurrentButton; -+@@ -1154,8 +1155,7 @@ uint16_t CCECClient::CheckKeypressTimeout(void) -+ m_pressedButtoncount = 0; -+ m_releasedButtoncount = 0; -+ } -+- else if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && -+- m_iCurrentButton != comboKey && m_releaseButtontime && iNow >= (uint64_t)m_releaseButtontime) -++ else if (m_iCurrentButton != comboKey && m_releaseButtontime && iNow >= (uint64_t)m_releaseButtontime) -+ { -+ key.duration = (unsigned int) (iNow - m_initialButtontime); -+ key.keycode = CEC_USER_CONTROL_CODE_UNKNOWN; -+@@ -1168,8 +1168,7 @@ uint16_t CCECClient::CheckKeypressTimeout(void) -+ m_pressedButtoncount = 0; -+ m_releasedButtoncount = 0; -+ } -+- else if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && -+- (m_iCurrentButton != comboKey && m_repeatButtontime && iNow >= (uint64_t)m_repeatButtontime)) -++ else if (m_iCurrentButton != comboKey && m_repeatButtontime && iNow >= (uint64_t)m_repeatButtontime) -+ { -+ key.duration = (unsigned int) (iNow - m_initialButtontime); -+ key.keycode = m_iCurrentButton; -+@@ -1178,11 +1177,11 @@ uint16_t CCECClient::CheckKeypressTimeout(void) -+ } -+ else -+ { -+- if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && m_iCurrentButton == comboKey && iTimeoutMs > 0) -++ if (m_iCurrentButton == comboKey && iTimeoutMs > 0) -+ timeout = std::min((uint64_t)timeout, m_updateButtontime - iNow + iTimeoutMs); -+- if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && m_iCurrentButton != comboKey && m_releaseButtontime) -++ if (m_iCurrentButton != comboKey && m_releaseButtontime) -+ timeout = std::min((uint64_t)timeout, m_releaseButtontime - iNow); -+- if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && m_iCurrentButton != comboKey && m_repeatButtontime) -++ if (m_iCurrentButton != comboKey && m_repeatButtontime) -+ timeout = std::min((uint64_t)timeout, m_repeatButtontime - iNow); -+ if (timeout > CEC_PROCESSOR_SIGNAL_WAIT_TIME) -+ { -+-- -+1.9.1 -+ +-bool CDemuxMVC::SeekTime(int time, bool backwords, double* startpts) ++bool CDemuxMVC::SeekTime(double time, bool backwords, double* startpts) + { + if (!m_pInput) + return false; +diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.h +index bbb836a61344689a83af68c821c05c212a86b097..54f91a02391368fbfbb4d669c003f42568347f62 100644 +--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.h ++++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMVC.h +@@ -36,7 +36,7 @@ public: + virtual void Abort(); + virtual void Flush(); + virtual DemuxPacket* Read(); +- virtual bool SeekTime(int time, bool backwords = false, double* startpts = nullptr); ++ virtual bool SeekTime(double time, bool backwords = false, double* startpts = nullptr); + virtual void SetSpeed(int iSpeed) { }; + virtual int GetStreamLength() { return 0; }; + virtual CDemuxStream* GetStream(int iStreamId) const override { return nullptr; }; -From 32d910f5fb777a2d18b2d81b8242e0abd48e6388 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sat, 19 Mar 2016 17:15:29 +0000 -Subject: [PATCH 52/73] cec: hack: pretend bump to 3.1.0 - ---- - tools/depends/target/libcec/Makefile | 1 + - tools/depends/target/libcec/bump.patch | 21 +++++++++++++++++++++ - 2 files changed, 22 insertions(+) - create mode 100644 tools/depends/target/libcec/bump.patch - -diff --git a/tools/depends/target/libcec/Makefile b/tools/depends/target/libcec/Makefile -index ddf996361ad5b46dd2b33fb035b2ed133914a612..39ba882d0c7e270b4d1d1d566027cbaffb76b587 100644 ---- a/tools/depends/target/libcec/Makefile -+++ b/tools/depends/target/libcec/Makefile -@@ -22,6 +22,7 @@ $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) - rm -rf $(PLATFORM); mkdir -p $(PLATFORM)/build - cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) - cd $(PLATFORM); patch -p1 < ../popcornmix.patch -+ cd $(PLATFORM); patch -p1 < ../bump.patch - cd $(PLATFORM)/build; $(CMAKE) -DBUILD_SHARED_LIBS=1 -DSKIP_PYTHON_WRAPPER:STRING=1 -DCMAKE_INSTALL_LIBDIR=$(PREFIX)/lib .. - - $(LIBDYLIB): $(PLATFORM) -diff --git a/tools/depends/target/libcec/bump.patch b/tools/depends/target/libcec/bump.patch -new file mode 100644 -index 0000000000000000000000000000000000000000..9e55e51068e7befd9d4ff003156ce1ff4cc56c0e ---- /dev/null -+++ b/tools/depends/target/libcec/bump.patch -@@ -0,0 +1,21 @@ -+commit 49a1728feabca68b8424a8b22abec9ee87b9aa99 -+Author: Lars Op den Kamp -+Date: Wed Jan 20 01:06:50 2016 +0100 -+ -+ bump to 3.1.0 -+ -+diff --git a/CMakeLists.txt b/CMakeLists.txt -+index 23d71fc..173f625 100644 -+--- a/CMakeLists.txt -++++ b/CMakeLists.txt -+@@ -2,8 +2,8 @@ project(libcec) -+ cmake_minimum_required(VERSION 2.8.9) -+ -+ set(LIBCEC_VERSION_MAJOR 3) -+-set(LIBCEC_VERSION_MINOR 0) -+-set(LIBCEC_VERSION_PATCH 0) -++set(LIBCEC_VERSION_MINOR 1) -++set(LIBCEC_VERSION_PATCH 0) -+ -+ # cec-client -+ add_subdirectory(src/cec-client) - -From 2e98d936f34bb32d80b7edfc86f10e4cd6073a85 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Tue, 28 Oct 2014 00:19:40 +0000 -Subject: [PATCH 53/73] [cec] Add settings for configuring button repeats - ---- - addons/resource.language.en_gb/resources/strings.po | 15 +++++++++++++++ - system/peripherals.xml | 4 +++- - xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 16 ++++++++++++++++ - 3 files changed, 34 insertions(+), 1 deletion(-) - -diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 7ace950c83e1497b4d96a31b33b524e7eafb1783..bdc5953503cf382091706240505c850084d84d94 100644 ---- a/addons/resource.language.en_gb/resources/strings.po -+++ b/addons/resource.language.en_gb/resources/strings.po -@@ -19714,3 +19714,18 @@ msgstr "" - msgctxt "#38206" - msgid "Max" - msgstr "" -+ -+#: system/peripherals.xml -+msgctxt "#38050" -+msgid "Remote button press delay before repeating (ms)" -+msgstr "" -+ -+#: system/peripherals.xml -+msgctxt "#38051" -+msgid "Remote button press repeat rate (ms)" -+msgstr "" -+ -+#: system/peripherals.xml -+msgctxt "#38052" -+msgid "Remote button press release time (ms)" -+msgstr "" -diff --git a/system/peripherals.xml b/system/peripherals.xml -index f939c0b685d96d022856544e7eb31a71338d9ba4..a4b8f7add4d915c1749628d62a9cbe9afe97d063 100644 ---- a/system/peripherals.xml -+++ b/system/peripherals.xml -@@ -31,7 +31,9 @@ - - - -- -+ -+ -+ - - - -diff --git a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp -index e6bcbce6911a1714e129ecd5aceead94769231f4..19b3c37bc18fcab30920b12902e8c3397a69dccc 100644 ---- a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp -+++ b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp -@@ -1287,6 +1287,20 @@ void CPeripheralCecAdapter::SetConfigurationFromLibCEC(const CEC::libcec_configu - m_configuration.bSendInactiveSource = config.bSendInactiveSource; - bChanged |= SetSetting("send_inactive_source", m_configuration.bSendInactiveSource == 1); - -+#if defined(CEC_DOUBLE_TAP_TIMEOUT_MS_OLD) -+ m_configuration.iDoubleTapTimeout50Ms = config.iDoubleTapTimeout50Ms; -+ bChanged |= SetSetting("double_tap_timeout_ms", (int)m_configuration.iDoubleTapTimeout50Ms * 50); -+#else -+ m_configuration.iDoubleTapTimeoutMs = config.iDoubleTapTimeoutMs; -+ bChanged |= SetSetting("double_tap_timeout_ms", (int)m_configuration.iDoubleTapTimeoutMs; -+#endif -+ -+ m_configuration.iButtonRepeatRateMs = config.iButtonRepeatRateMs; -+ bChanged |= SetSetting("button_repeat_rate_ms", (int)m_configuration.iButtonRepeatRateMs); -+ -+ m_configuration.iButtonReleaseDelayMs = config.iButtonReleaseDelayMs; -+ bChanged |= SetSetting("button_release_delay_ms", (int)m_configuration.iButtonReleaseDelayMs); -+ - m_configuration.iFirmwareVersion = config.iFirmwareVersion; - m_configuration.bShutdownOnStandby = config.bShutdownOnStandby; - -@@ -1391,6 +1405,8 @@ void CPeripheralCecAdapter::SetConfigurationFromSettings(void) - // backwards compatibility. will be removed once the next major release of libCEC is out - m_configuration.iDoubleTapTimeoutMs = GetSettingInt("double_tap_timeout_ms"); - #endif -+ m_configuration.iButtonRepeatRateMs = GetSettingInt("button_repeat_rate_ms"); -+ m_configuration.iButtonReleaseDelayMs = GetSettingInt("button_release_delay_ms"); - - if (GetSettingBool("pause_playback_on_deactivate")) - { - -From 4b033455b05332c157035752984e7c8da9ddce20 Mon Sep 17 00:00:00 2001 +From 08f34e983316fb995d27145fe023c5dbf7316df9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Nov 2014 23:17:46 +0000 -Subject: [PATCH 54/73] [cec] Don't discard buttons when repeat mode is enabled +Subject: [PATCH 55/63] [cec] Don't discard buttons when repeat mode is enabled --- xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp -index 19b3c37bc18fcab30920b12902e8c3397a69dccc..f859f44f6d5379154317b5760d7df720f0894e0d 100644 +index 30367a3fde956090afdca9930fa52e829f35046f..febacb3b7964eab3b8615a6a807e0f27d911b4da 100644 --- a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp +++ b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp -@@ -778,7 +778,10 @@ void CPeripheralCecAdapter::PushCecKeypress(const CecButtonPress &key) +@@ -803,7 +803,10 @@ void CPeripheralCecAdapter::PushCecKeypress(const CecButtonPress &key) CLog::Log(LOGDEBUG, "%s - received key %2x duration %d", __FUNCTION__, key.iButton, key.iDuration); CSingleLock lock(m_critSection); @@ -52642,20 +51869,20 @@ index 19b3c37bc18fcab30920b12902e8c3397a69dccc..f859f44f6d5379154317b5760d7df720 if (m_currentButton.iButton == key.iButton && m_currentButton.iDuration == 0) { -From 6e8d828760fc9a98acb6d7599926b9bc33ff4f4e Mon Sep 17 00:00:00 2001 +From fc196a50f90057e3eb1b6553347a9d400c717db8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 4 Nov 2014 18:50:00 +0000 -Subject: [PATCH 55/73] [cec] Temp - more logging +Subject: [PATCH 56/63] [cec] Temp - more logging --- xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp -index f859f44f6d5379154317b5760d7df720f0894e0d..f1c3a6d242183507c4ce9ebf4651b0c0f7e9c5c9 100644 +index febacb3b7964eab3b8615a6a807e0f27d911b4da..52d6e6a7ab68ce91faf5a3881b23ea7adde96cb8 100644 --- a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp +++ b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp -@@ -775,12 +775,15 @@ void CPeripheralCecAdapter::GetNextKey(void) +@@ -800,12 +800,15 @@ void CPeripheralCecAdapter::GetNextKey(void) void CPeripheralCecAdapter::PushCecKeypress(const CecButtonPress &key) { @@ -52672,7 +51899,7 @@ index f859f44f6d5379154317b5760d7df720f0894e0d..f1c3a6d242183507c4ce9ebf4651b0c0 if (m_configuration.iButtonRepeatRateMs == 0 && key.iDuration > 0) { if (m_currentButton.iButton == key.iButton && m_currentButton.iDuration == 0) -@@ -789,6 +792,7 @@ void CPeripheralCecAdapter::PushCecKeypress(const CecButtonPress &key) +@@ -814,6 +817,7 @@ void CPeripheralCecAdapter::PushCecKeypress(const CecButtonPress &key) if (m_bHasButton) m_currentButton.iDuration = key.iDuration; // ignore this one, since it's already been handled by xbmc @@ -52680,7 +51907,7 @@ index f859f44f6d5379154317b5760d7df720f0894e0d..f1c3a6d242183507c4ce9ebf4651b0c0 return; } // if we received a keypress with a duration set, try to find the same one without a duration set, and replace it -@@ -799,6 +803,7 @@ void CPeripheralCecAdapter::PushCecKeypress(const CecButtonPress &key) +@@ -824,6 +828,7 @@ void CPeripheralCecAdapter::PushCecKeypress(const CecButtonPress &key) if ((*it).iDuration == 0) { // replace this entry @@ -52688,7 +51915,7 @@ index f859f44f6d5379154317b5760d7df720f0894e0d..f1c3a6d242183507c4ce9ebf4651b0c0 (*it).iDuration = key.iDuration; return; } -@@ -808,6 +813,7 @@ void CPeripheralCecAdapter::PushCecKeypress(const CecButtonPress &key) +@@ -833,6 +838,7 @@ void CPeripheralCecAdapter::PushCecKeypress(const CecButtonPress &key) } } @@ -52697,128 +51924,10 @@ index f859f44f6d5379154317b5760d7df720f0894e0d..f1c3a6d242183507c4ce9ebf4651b0c0 } -From f422270e1333ba02c8c2321538ae171572e9879d Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 22 Jan 2016 12:29:41 +0000 -Subject: [PATCH 56/73] [cec] Update for libcec 3.1.0 - ---- - configure.ac | 4 ++-- - xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 4 ++-- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 3df753bde53593ecea534455056268f9f8a24c1a..738d23e3272cd56b095cef821a3993bb9aa69b55 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1453,9 +1453,9 @@ if test "x$use_libcec" != "xno"; then - # libcec is dyloaded, so we need to check for its headers and link any depends. - if test "x$use_libcec" != "xno"; then - if test "x$use_libcec" != "xauto"; then -- PKG_CHECK_MODULES([CEC],[libcec >= 3.0.0],,[use_libcec="no";AC_MSG_ERROR($libcec_disabled)]) -+ PKG_CHECK_MODULES([CEC],[libcec >= 3.1.0],,[use_libcec="no";AC_MSG_ERROR($libcec_disabled)]) - else -- PKG_CHECK_MODULES([CEC],[libcec >= 3.0.0],,[use_libcec="no";AC_MSG_RESULT($libcec_disabled)]) -+ PKG_CHECK_MODULES([CEC],[libcec >= 3.1.0],,[use_libcec="no";AC_MSG_RESULT($libcec_disabled)]) - fi - - if test "x$use_libcec" != "xno"; then -diff --git a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp -index f1c3a6d242183507c4ce9ebf4651b0c0f7e9c5c9..28a6a8148810da940f977976a627018c59a719db 100644 ---- a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp -+++ b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp -@@ -43,7 +43,7 @@ using namespace PERIPHERALS; - using namespace ANNOUNCEMENT; - using namespace CEC; - --#define CEC_LIB_SUPPORTED_VERSION LIBCEC_VERSION_TO_UINT(3, 0, 0) -+#define CEC_LIB_SUPPORTED_VERSION LIBCEC_VERSION_TO_UINT(3, 1, 0) - - /* time in seconds to ignore standby commands from devices after the screensaver has been activated */ - #define SCREENSAVER_TIMEOUT 20 -@@ -1329,7 +1329,7 @@ void CPeripheralCecAdapter::SetConfigurationFromLibCEC(const CEC::libcec_configu - void CPeripheralCecAdapter::SetConfigurationFromSettings(void) - { - // client version matches the version of libCEC that we originally used the API from -- m_configuration.clientVersion = LIBCEC_VERSION_TO_UINT(3, 0, 0); -+ m_configuration.clientVersion = CEC_LIB_SUPPORTED_VERSION; - - // device name 'XBMC' - snprintf(m_configuration.strDeviceName, 13, "%s", GetSettingString("device_name").c_str()); - -From 2748fd05bec256b540214e0e3e4cbbacac5aea31 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sat, 19 Mar 2016 14:46:41 +0000 -Subject: [PATCH 57/73] libcec: use system audio mode request instead of power - on to start AVR reliable - ---- - tools/depends/target/libcec/208.patch | 38 +++++++++++++++++++++++++++++++++++ - tools/depends/target/libcec/Makefile | 1 + - 2 files changed, 39 insertions(+) - create mode 100644 tools/depends/target/libcec/208.patch - -diff --git a/tools/depends/target/libcec/208.patch b/tools/depends/target/libcec/208.patch -new file mode 100644 -index 0000000000000000000000000000000000000000..3dc5adf022e80c3337ad69b7c7d7346daafbfdd3 ---- /dev/null -+++ b/tools/depends/target/libcec/208.patch -@@ -0,0 +1,38 @@ -+From f70c4d76e1d9c0219a3927b6b66090b7575e7933 Mon Sep 17 00:00:00 2001 -+From: Gerald Dachs -+Date: Thu, 17 Mar 2016 12:12:51 +0100 -+Subject: [PATCH] use system audio mode request instead of power on to start -+ AVR reliable -+ -+--- -+ src/libcec/devices/CECBusDevice.cpp | 13 +++++++++---- -+ 1 file changed, 9 insertions(+), 4 deletions(-) -+ -+diff --git a/src/libcec/devices/CECBusDevice.cpp b/src/libcec/devices/CECBusDevice.cpp -+index 55939d1..e2d5ea3 100644 -+--- a/src/libcec/devices/CECBusDevice.cpp -++++ b/src/libcec/devices/CECBusDevice.cpp -+@@ -1025,14 +1025,19 @@ bool CCECBusDevice::ActivateSource(uint64_t iDelay /* = 0 */) -+ bool bReturn(true); -+ if (iDelay == 0) -+ { -+- /** some AVRs fail to be powered up by the TV when it powers up. power up the AVR explicitly */ -++ /** send system audio mode request if AVR exists */ -+ if (m_iLogicalAddress != CECDEVICE_AUDIOSYSTEM) -+ { -+ CCECBusDevice* audioSystem(m_processor->GetDevice(CECDEVICE_AUDIOSYSTEM)); -+- if (audioSystem && audioSystem->IsPresent() && audioSystem->GetPowerStatus(m_iLogicalAddress) != CEC_POWER_STATUS_ON) -++ if (audioSystem && audioSystem->IsPresent()) -+ { -+- LIB_CEC->AddLog(CEC_LOG_DEBUG, "powering up the AVR"); -+- audioSystem->PowerOn(m_iLogicalAddress); -++ cec_command command; -++ -++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "sending system audio mode request for '%s'", ToString(m_iLogicalAddress)); -++ cec_command::Format(command, m_iLogicalAddress, CECDEVICE_AUDIOSYSTEM, CEC_OPCODE_SYSTEM_AUDIO_MODE_REQUEST); -++ command.parameters.PushBack((uint8_t) ((m_iPhysicalAddress >> 8) & 0xFF)); -++ command.parameters.PushBack((uint8_t) (m_iPhysicalAddress & 0xFF)); -++ bReturn = m_handler->Transmit(command, false, false); -+ } -+ } -+ -diff --git a/tools/depends/target/libcec/Makefile b/tools/depends/target/libcec/Makefile -index 39ba882d0c7e270b4d1d1d566027cbaffb76b587..4565dc9f6fc0b3e6b49133443c19e10767d475eb 100644 ---- a/tools/depends/target/libcec/Makefile -+++ b/tools/depends/target/libcec/Makefile -@@ -23,6 +23,7 @@ $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) - cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) - cd $(PLATFORM); patch -p1 < ../popcornmix.patch - cd $(PLATFORM); patch -p1 < ../bump.patch -+ cd $(PLATFORM); patch -p1 < ../208.patch - cd $(PLATFORM)/build; $(CMAKE) -DBUILD_SHARED_LIBS=1 -DSKIP_PYTHON_WRAPPER:STRING=1 -DCMAKE_INSTALL_LIBDIR=$(PREFIX)/lib .. - - $(LIBDYLIB): $(PLATFORM) - -From 25e789e48fd92bd81c780834328846abde00c69f Mon Sep 17 00:00:00 2001 +From dd28ae7d01450884dca135169ca72a6ac6344117 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Tue, 22 Mar 2016 09:51:52 +0100 -Subject: [PATCH 58/73] python: use kodi provided cert if available +Subject: [PATCH 57/63] python: use kodi provided cert if available --- xbmc/interfaces/python/XBPython.cpp | 6 ++++++ @@ -52842,10 +51951,10 @@ index bc84af9411ef55eaf5ba71a320b5cbfec5f49548..ff4ed7db26845905108ea0ae504e4f58 PyEval_AcquireLock(); else -From 2c9d4750f89d50ab7350a6f258d219190111c0b3 Mon Sep 17 00:00:00 2001 +From 2ed41ab819cb7060380c1f7cba57edbd0ad0fba8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 25 May 2016 18:31:17 +0100 -Subject: [PATCH 59/73] rbp: Hard code the number of buffers to improve audio +Subject: [PATCH 58/63] rbp: Hard code the number of buffers to improve audio sync --- @@ -52854,10 +51963,10 @@ Subject: [PATCH 59/73] rbp: Hard code the number of buffers to improve audio 2 files changed, 10 insertions(+) diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml -index 2572e25753712186f69390965ee1448bff3fadd5..5d9f716bac49f9850f1062a4d5ac851794eefbe3 100644 +index 7098edf32dff8c00e192229c3ffb060be6a42482..0ce6735e11fabd1d07a4860b9d985a4e1fd5f35a 100644 --- a/system/settings/rbp.xml +++ b/system/settings/rbp.xml -@@ -92,6 +92,12 @@ +@@ -85,6 +85,12 @@ @@ -52871,7 +51980,7 @@ index 2572e25753712186f69390965ee1448bff3fadd5..5d9f716bac49f9850f1062a4d5ac8517 diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp -index d38031da337aa9ff180c2866c5d5924c8537978e..370485e08080d421b12ad5ad4dd0f4985a55147d 100644 +index 54cf477648bba4583904cf122b4e66f6bbdd9469..908d73b151845c2f85a897ca5714fa1fac6cc603 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp @@ -1063,7 +1063,11 @@ void CRenderManager::UpdateDisplayLatency() @@ -52887,10 +51996,10 @@ index d38031da337aa9ff180c2866c5d5924c8537978e..370485e08080d421b12ad5ad4dd0f498 } -From 2881008fef3d6c44ad33d258fa9be3c3346ab8d6 Mon Sep 17 00:00:00 2001 +From 82f3257a709241542444806947dc2b573715e399 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 4 Jul 2016 18:30:03 +0100 -Subject: [PATCH 60/73] rbp: Update the GL libs to new naming scheme +Subject: [PATCH 59/63] rbp: Update the GL libs to new naming scheme As the opensource mesa GL library is getting more usable, the name collision wih the firmware GL driver is causing issues. As such we are renaming the firmware GL driver to avoid this. @@ -52904,7 +52013,7 @@ will be dropped at some point 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac -index 738d23e3272cd56b095cef821a3993bb9aa69b55..db912db732d5b55a5c8abfca0b4c7a04bf96d535 100644 +index 87bfbbfe8b833cec9cdef6b16d311471b162d564..dd67c5e53183b5c2c19de44bb246ed7b86372453 100644 --- a/configure.ac +++ b/configure.ac @@ -949,7 +949,7 @@ if test "$use_gles" = "yes"; then @@ -52942,10 +52051,10 @@ index ab06f968b3e314fca1ae001139f687dce9a5098b..87f1faa248b91a2e50758b23c0b9e5b0 else() find_library(OPENGLES_gl_LIBRARY NAMES OpenGLES diff --git a/tools/depends/configure.ac b/tools/depends/configure.ac -index a0bc386284f168c982b8cfed7e28768fd42459b5..dbe3ec83221396d1a5ae5b8715b7ca45f17d247c 100644 +index 3626ea5204eb561dc1ae0b64c6bb7253d2ec59ec..100ff3178bafe7434bd5456100b5bb7189a5378d 100644 --- a/tools/depends/configure.ac +++ b/tools/depends/configure.ac -@@ -432,7 +432,7 @@ if test "$target_platform" = "raspberry-pi" ; then +@@ -433,7 +433,7 @@ if test "$target_platform" = "raspberry-pi" ; then -isystem${use_firmware}/opt/vc/include \ -isystem${use_firmware}/opt/vc/include/interface/vcos/pthreads \ -isystem${use_firmware}/opt/vc/include/interface/vmcs_host/linux" @@ -52955,146 +52064,20 @@ index a0bc386284f168c982b8cfed7e28768fd42459b5..dbe3ec83221396d1a5ae5b8715b7ca45 fi -From c8be496ad1ad4e4abe988ac1a4fc264d518f7393 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 21 Apr 2016 16:49:02 +0100 -Subject: [PATCH 61/73] Revert "[settings] remove show EXIF picture information - setting" - -This reverts commit e7d90188436b6966eff23fd695e1a9d18f4af1b4. ---- - addons/resource.language.en_gb/resources/strings.po | 10 ++++++++++ - system/settings/settings.xml | 5 +++++ - xbmc/pictures/GUIWindowPictures.cpp | 2 +- - xbmc/pictures/PictureInfoLoader.cpp | 8 ++++++-- - xbmc/pictures/PictureInfoLoader.h | 1 + - xbmc/settings/Settings.cpp | 1 + - xbmc/settings/Settings.h | 1 + - 7 files changed, 25 insertions(+), 3 deletions(-) - -diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index bdc5953503cf382091706240505c850084d84d94..a459a333cd646462956e2e2925cc5bcbfb972bd8 100644 ---- a/addons/resource.language.en_gb/resources/strings.po -+++ b/addons/resource.language.en_gb/resources/strings.po -@@ -19729,3 +19729,13 @@ msgstr "" - msgctxt "#38052" - msgid "Remote button press release time (ms)" - msgstr "" -+ -+#. Description of setting "Pictures -> Show EXIF picture information" with label #38207 -+#: system/settings/settings.xml -+msgctxt "#38207" -+msgid "Show EXIF picture information" -+msgstr "" -+ -+msgctxt "#38208" -+msgid "If EXIF information exists (date, time, camera used, etc.), it will be displayed." -+msgstr "" -diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index 291a781e33496a0e6fe5cd869c857f5a851586ce..508055794481729aa6394b84d2527e6c2e9dc4e2 100644 ---- a/system/settings/settings.xml -+++ b/system/settings/settings.xml -@@ -1180,6 +1180,11 @@ - - - -+ -+ 0 -+ true -+ -+ - - 0 - true -diff --git a/xbmc/pictures/GUIWindowPictures.cpp b/xbmc/pictures/GUIWindowPictures.cpp -index 4b5ec502a49d5116cafd53441a6d823be0da6b54..072639baae58479ec7d746f96634de069ee87e34 100644 ---- a/xbmc/pictures/GUIWindowPictures.cpp -+++ b/xbmc/pictures/GUIWindowPictures.cpp -@@ -203,7 +203,7 @@ void CGUIWindowPictures::OnPrepareFileItems(CFileItemList& items) - if (StringUtils::EqualsNoCase(items[i]->GetLabel(), "folder.jpg")) - items.Remove(i); - -- if (items.GetFolderCount() == items.Size()) -+ if (items.GetFolderCount() == items.Size() || !CSettings::GetInstance().GetBool(CSettings::SETTING_PICTURES_USETAGS)) - return; - - // Start the music info loader thread -diff --git a/xbmc/pictures/PictureInfoLoader.cpp b/xbmc/pictures/PictureInfoLoader.cpp -index dd3347277c75c5e63a4a4db9af9cc46605bb5ea9..05304f9fc44285d5577f2056625cceb15347ae57 100644 ---- a/xbmc/pictures/PictureInfoLoader.cpp -+++ b/xbmc/pictures/PictureInfoLoader.cpp -@@ -43,6 +43,7 @@ void CPictureInfoLoader::OnLoaderStart() - m_mapFileItems->SetFastLookup(true); - - m_tagReads = 0; -+ m_loadTags = CSettings::GetInstance().GetBool(CSettings::SETTING_PICTURES_USETAGS); - - if (m_pProgressCallback) - m_pProgressCallback->SetProgressMax(m_pVecItems->GetFileCount()); -@@ -87,8 +88,11 @@ bool CPictureInfoLoader::LoadItemLookup(CFileItem* pItem) - if (pItem->HasPictureInfoTag()) - return false; - -- pItem->GetPictureInfoTag()->Load(pItem->GetPath()); -- m_tagReads++; -+ if (m_loadTags) -+ { // Nothing found, load tag from file -+ pItem->GetPictureInfoTag()->Load(pItem->GetPath()); -+ m_tagReads++; -+ } - - return true; - } -diff --git a/xbmc/pictures/PictureInfoLoader.h b/xbmc/pictures/PictureInfoLoader.h -index 000b54fe1bb1dd1963edd5cf208ea318a5a5499d..2a022ff0ff66d237f0ebd12092c7b5ce8244a511 100644 ---- a/xbmc/pictures/PictureInfoLoader.h -+++ b/xbmc/pictures/PictureInfoLoader.h -@@ -39,5 +39,6 @@ protected: - - CFileItemList* m_mapFileItems; - unsigned int m_tagReads; -+ bool m_loadTags; - }; - -diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp -index 8f7f14cce4281daeb1cf4ba18cb9304615ef17b8..69bd754cf2f97bc2416b4929e5fd6653e9e1fbc6 100644 ---- a/xbmc/settings/Settings.cpp -+++ b/xbmc/settings/Settings.cpp -@@ -297,6 +297,7 @@ const std::string CSettings::SETTING_AUDIOCDS_SETTINGS = "audiocds.settings"; - const std::string CSettings::SETTING_AUDIOCDS_EJECTONRIP = "audiocds.ejectonrip"; - const std::string CSettings::SETTING_MYMUSIC_SONGTHUMBINVIS = "mymusic.songthumbinvis"; - const std::string CSettings::SETTING_MYMUSIC_DEFAULTLIBVIEW = "mymusic.defaultlibview"; -+const std::string CSettings::SETTING_PICTURES_USETAGS = "pictures.usetags"; - const std::string CSettings::SETTING_PICTURES_GENERATETHUMBS = "pictures.generatethumbs"; - const std::string CSettings::SETTING_PICTURES_SHOWVIDEOS = "pictures.showvideos"; - const std::string CSettings::SETTING_PICTURES_DISPLAYRESOLUTION = "pictures.displayresolution"; -diff --git a/xbmc/settings/Settings.h b/xbmc/settings/Settings.h -index 038b8c6b9436ed30e2a670164cf1f9556382c8c6..583f1079ce70192d133c43335a27bc0a49350648 100644 ---- a/xbmc/settings/Settings.h -+++ b/xbmc/settings/Settings.h -@@ -254,6 +254,7 @@ public: - static const std::string SETTING_AUDIOCDS_EJECTONRIP; - static const std::string SETTING_MYMUSIC_SONGTHUMBINVIS; - static const std::string SETTING_MYMUSIC_DEFAULTLIBVIEW; -+ static const std::string SETTING_PICTURES_USETAGS; - static const std::string SETTING_PICTURES_GENERATETHUMBS; - static const std::string SETTING_PICTURES_SHOWVIDEOS; - static const std::string SETTING_PICTURES_DISPLAYRESOLUTION; - -From 6be024ea730bcd2513b897e122be3ca1fbb1416b Mon Sep 17 00:00:00 2001 +From 364926a71cd3cf33b948a2e1ef1fd13881a0a95e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 28 Jun 2016 14:46:01 +0100 -Subject: [PATCH 62/73] ffmpeg: hacky fix for files with GMC +Subject: [PATCH 60/63] ffmpeg: hacky fix for files with GMC --- xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -index 6ac2da1262bd7f6a8304ef3192d67d1ea8d910c5..563556d7ab6858a767af6df83e24737e3ade5663 100644 +index c3e8a84ed2cdb148717f05ca85aebb21bb2dab6e..0a46eef4d265f1d0bca9215fd92a355af7d242ca 100644 --- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -@@ -1436,8 +1436,8 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) +@@ -1457,8 +1457,8 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) stereoMode = GetStereoModeFromMetadata(m_pFormatContext->metadata); if (!stereoMode.empty()) st->stereo_mode = stereoMode; @@ -53106,10 +52089,10 @@ index 6ac2da1262bd7f6a8304ef3192d67d1ea8d910c5..563556d7ab6858a767af6df83e24737e { if (pStream->codec->codec_id == AV_CODEC_ID_PROBE) -From d926e32b95f3353f1d12a81709e8bbaab12f1be5 Mon Sep 17 00:00:00 2001 +From 2a1502990a40ce020d6f51681e6adffdea9a0bc8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 19 Jul 2016 20:39:18 +0100 -Subject: [PATCH 63/73] mmalrender: Add sharpness control +Subject: [PATCH 61/63] mmalrender: Add sharpness control --- addons/resource.language.en_gb/resources/strings.po | 2 +- @@ -53118,10 +52101,10 @@ Subject: [PATCH 63/73] mmalrender: Add sharpness control 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index a459a333cd646462956e2e2925cc5bcbfb972bd8..dc220fb9809e277b1be60653c7fa1a6f62ff5a2c 100644 +index 7c7969d381bf15ac1ba2fd8f16e463f6b12fe4c3..45cf0830ea6079a0f2ad22792f2497c5ad53b625 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po -@@ -8695,7 +8695,7 @@ msgstr "" +@@ -8694,7 +8694,7 @@ msgstr "" #: xbmc/video/dialogs/GUIDialogVideoSettings.cpp msgctxt "#16313" @@ -53131,20 +52114,20 @@ index a459a333cd646462956e2e2925cc5bcbfb972bd8..dc220fb9809e277b1be60653c7fa1a6f #empty string with id 16314 diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -index 96a8e61aa22094f95385a2b45ce50c0d6d6b1fc4..a0104d9ff67402e74ea8076dd47e9e9bd11a74f1 100644 +index d0b88727674b67b851a7b74cb946cafe64e3ff6e..0b73b7700ce8a63932d3fa3b90dda8cf80ac527c 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -@@ -403,6 +403,7 @@ CMMALRenderer::CMMALRenderer() : CThread("MMALRenderer"), m_processThread(this, - m_queue_process = nullptr; - m_error = 0.0; +@@ -411,6 +411,7 @@ CMMALRenderer::CMMALRenderer() : CThread("MMALRenderer"), m_processThread(this, + m_frameInterval = 0.0; + m_frameIntervalDiff = 1e5; m_vsync_count = ~0U; + m_sharpness = -2.0f; m_vout_width = 0; m_vout_height = 0; m_vout_aligned_width = 0; -@@ -750,6 +751,15 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) - - ManageRenderArea(); +@@ -845,6 +846,15 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) + goto exit; + } + // if sharpness setting has changed, we should update it + if (m_sharpness != CMediaSettings::GetInstance().GetCurrentVideoSettings().m_Sharpness) @@ -53158,7 +52141,7 @@ index 96a8e61aa22094f95385a2b45ce50c0d6d6b1fc4..a0104d9ff67402e74ea8076dd47e9e9b if (m_format != RENDER_FMT_MMAL) { if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -@@ -927,7 +937,8 @@ bool CMMALRenderer::Supports(ERENDERFEATURE feature) +@@ -1021,7 +1031,8 @@ bool CMMALRenderer::Supports(ERENDERFEATURE feature) feature == RENDERFEATURE_ZOOM || feature == RENDERFEATURE_ROTATION || feature == RENDERFEATURE_VERTICAL_SHIFT || @@ -53169,10 +52152,10 @@ index 96a8e61aa22094f95385a2b45ce50c0d6d6b1fc4..a0104d9ff67402e74ea8076dd47e9e9b return false; diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -index a056a25f4f74fc6be023404286e044dac9d8ca7c..5d3baa6534a2fe449990402ab805d84423fbc636 100644 +index e0e6f7c0e0546013ca74265aef54704fd332f8e4..69eae6cbef0131d20dc979dcb35915cd73967592 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h +++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -@@ -133,6 +133,7 @@ protected: +@@ -140,6 +140,7 @@ protected: RENDER_STEREO_MODE m_video_stereo_mode; RENDER_STEREO_MODE m_display_stereo_mode; bool m_StereoInvert; @@ -53181,848 +52164,17 @@ index a056a25f4f74fc6be023404286e044dac9d8ca7c..5d3baa6534a2fe449990402ab805d844 CCriticalSection m_sharedSection; MMAL_COMPONENT_T *m_vout; -From 1f66b2a9ff102af96f70d8fa6b9b8a80bfcb2dce Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Tue, 26 Jul 2016 19:00:03 +0100 -Subject: [PATCH 64/73] rbp: Ensure processinfo values are initialised - ---- - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp | 2 ++ - xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 5 ++--- - 2 files changed, 4 insertions(+), 3 deletions(-) - -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -index 654a927a0d4cbf877a3bb2616d62f46a63e7cadb..2c5144c44403de9d8ddea7cfbb0c7f8356b81784 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -@@ -598,6 +598,8 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) - m_speed = DVD_PLAYSPEED_NORMAL; - - m_processInfo.SetVideoDecoderName(m_pFormatName, true); -+ m_processInfo.SetVideoDimensions(m_decoded_width, m_decoded_height); -+ m_processInfo.SetVideoDAR(m_aspect_ratio); - - return true; - } -diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index 84f389f6e37381a22db024667eebe4e8113857db..f6fb241dfec9269f4e501248de4dc83d5fdc2d3a 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -739,9 +739,6 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, f - m_bAllowFullscreen = false; // only allow on first configure - } - -- m_processInfo.SetVideoDimensions(width, height); -- m_processInfo.SetVideoDAR(display_aspect); -- - unsigned int iDisplayWidth = width; - unsigned int iDisplayHeight = height; - -@@ -753,6 +750,8 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, f - - m_fFrameRate = DVD_TIME_BASE / CDVDCodecUtils::NormalizeFrameduration((double)DVD_TIME_BASE / framerate); - m_processInfo.SetVideoFps(m_fFrameRate); -+ m_processInfo.SetVideoDimensions(width, height); -+ m_processInfo.SetVideoDAR((float)iDisplayWidth / (float)iDisplayHeight); - - CLog::Log(LOGDEBUG,"%s - change configuration. video:%dx%d. framerate: %4.2f. %dx%d format: BYPASS", - __FUNCTION__, video_width, video_height, m_fFrameRate, iDisplayWidth, iDisplayHeight); - -From b958fb38ea881c4da2f98a4a3c9b5290e0b7fbed Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 16 Sep 2016 15:37:07 +0100 -Subject: [PATCH 65/73] MMAL: Indicate when picture came from still frame so - advanced deinterlace can be disabled - -MMAL Advanced deinterlace requires 3 frames of context so does not produce any output -from a dvd menu still. - -We cannot easily submit the same frame multiple times (the MMAL buffer headers contain -linked list pointers), so the simple solution is to switch to the simpler -deinterlace that does not require context for stills. ---- - xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 2 +- - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp | 4 ++-- - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h | 1 + - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp | 4 +++- - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h | 3 ++- - .../VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp | 10 ++++++++++ - 6 files changed, 19 insertions(+), 5 deletions(-) - -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index fc152c13ed5b17ccfbb0ab4c659dedf8fd63d6bd..ec2cc3d867d446a748024ce85e079aea8451fb85 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -@@ -243,7 +243,7 @@ enum AVPixelFormat CDVDVideoCodecFFmpeg::GetFormat(struct AVCodecContext * avctx - #ifdef HAS_MMAL - if (*cur == AV_PIX_FMT_YUV420P) - { -- MMAL::CDecoder* dec = new MMAL::CDecoder(ctx->m_processInfo); -+ MMAL::CDecoder* dec = new MMAL::CDecoder(ctx->m_processInfo, ctx->m_hints); - if(dec->Open(avctx, ctx->m_pCodecContext, *cur, ctx->m_uSurfacesCount)) - { - ctx->m_processInfo.SetVideoPixelFormat(pixFmtName ? pixFmtName : ""); -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -index 2c5144c44403de9d8ddea7cfbb0c7f8356b81784..1cb76f65a24bf46fe4e3fc1f54e99f284672d80b 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -@@ -71,6 +71,7 @@ CMMALVideoBuffer::CMMALVideoBuffer(CMMALVideo *omv, std::shared_ptr p - m_encoding = MMAL_ENCODING_UNKNOWN; - m_aspect_ratio = 0.0f; - m_rendered = false; -+ m_stills = false; - } - - CMMALVideoBuffer::~CMMALVideoBuffer() -@@ -258,8 +259,6 @@ void CMMALVideo::dec_output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buf - omvb->m_aligned_width = m_decoded_aligned_width; - omvb->m_aligned_height = m_decoded_aligned_height; - omvb->m_aspect_ratio = m_aspect_ratio; -- if (m_hints.stills) // disable interlace in dvd stills mode -- omvb->mmal_buffer->flags &= ~MMAL_BUFFER_HEADER_VIDEO_FLAG_INTERLACED; - omvb->m_encoding = m_dec_output->format->encoding; - { - CSingleLock lock(m_output_mutex); -@@ -841,6 +840,7 @@ bool CMMALVideo::GetPicture(DVDVideoPicture* pDvdVideoPicture) - pDvdVideoPicture->iFlags, buffer->mmal_buffer->flags, pDvdVideoPicture->MMALBuffer, pDvdVideoPicture->MMALBuffer->mmal_buffer); - assert(!(buffer->mmal_buffer->flags & MMAL_BUFFER_HEADER_FLAG_DECODEONLY)); - buffer->mmal_buffer->flags &= ~MMAL_BUFFER_HEADER_FLAG_USER3; -+ buffer->m_stills = m_hints.stills; - } - else - { -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h -index d39dc1ded1511e08556ed1129f58b23df9b1dbdd..1b21fe1a8a26c80dfb83a0af5a6ebd5c9cae42ca 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h -@@ -59,6 +59,7 @@ public: - float m_aspect_ratio; - MMALState m_state; - bool m_rendered; -+ bool m_stills; - const char *GetStateName() { - static const char *names[] = { "MMALStateNone", "MMALStateHWDec", "MMALStateFFDec", "MMALStateDeint", }; - if ((size_t)m_state < vcos_countof(names)) -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp -index 864650d488d0f5b3dc9f89f01aa5c3b845b92564..244dced9d7d5c4a9006a2e5a6d27f80fdf0f497a 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp -@@ -54,6 +54,7 @@ CMMALYUVBuffer::CMMALYUVBuffer(std::shared_ptr pool, uint32_t mmal_en - m_aspect_ratio = 0.0f; - mmal_buffer = nullptr; - m_rendered = false; -+ m_stills = false; - if (m_encoding == MMAL_ENCODING_I420) - size_pic = (m_aligned_width * m_aligned_height * 3) >> 1; - else if (m_encoding == MMAL_ENCODING_YUVUV128) -@@ -93,7 +94,7 @@ CMMALYUVBuffer::~CMMALYUVBuffer() - #undef CLASSNAME - #define CLASSNAME "CDecoder" - --CDecoder::CDecoder(CProcessInfo &processInfo) : m_processInfo(processInfo) -+CDecoder::CDecoder(CProcessInfo &processInfo, CDVDStreamInfo &hints) : m_processInfo(processInfo), m_hints(hints) - { - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s - create %p", CLASSNAME, __FUNCTION__, this); -@@ -289,6 +290,7 @@ bool CDecoder::GetPicture(AVCodecContext* avctx, AVFrame* frame, DVDVideoPicture - assert(picture->MMALBuffer->mmal_buffer); - picture->MMALBuffer->mmal_buffer->data = (uint8_t *)gmem->m_vc_handle; - picture->MMALBuffer->mmal_buffer->alloc_size = picture->MMALBuffer->mmal_buffer->length = gmem->m_numbytes; -+ picture->MMALBuffer->m_stills = m_hints.stills; - - // need to flush ARM cache so GPU can see it (HEVC will have already done this) - if (avctx->codec_id != AV_CODEC_ID_HEVC) -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h -index ffc61612ff3f2fef374cde67111939e4851ccc70..60aff83a3e55f11313d0d9186212e9badbb6d52e 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h -@@ -52,7 +52,7 @@ class CDecoder - : public CDVDVideoCodecFFmpeg::IHardwareDecoder - { - public: -- CDecoder(CProcessInfo& processInfo); -+ CDecoder(CProcessInfo& processInfo, CDVDStreamInfo &hints); - virtual ~CDecoder(); - virtual bool Open(AVCodecContext* avctx, AVCodecContext* mainctx, const enum AVPixelFormat, unsigned int surfaces); - virtual int Decode(AVCodecContext* avctx, AVFrame* frame); -@@ -73,6 +73,7 @@ protected: - CCriticalSection m_section; - std::shared_ptr m_pool; - enum AVPixelFormat m_fmt; -+ CDVDStreamInfo m_hints; - }; - - }; -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -index a0104d9ff67402e74ea8076dd47e9e9bd11a74f1..2f9af729c26f81327a666a59a90f707e53041774 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -@@ -526,6 +526,16 @@ void CMMALRenderer::Run() - if (interlace_method == VS_INTERLACEMETHOD_AUTO) - interlace_method = VS_INTERLACEMETHOD_MMAL_ADVANCED; - bool interlace = (omvb->mmal_buffer->flags & MMAL_BUFFER_HEADER_VIDEO_FLAG_INTERLACED) ? true:false; -+ -+ // advanced deinterlace requires 3 frames of context so disable when showing stills -+ if (omvb->m_stills) -+ { -+ if (interlace_method == VS_INTERLACEMETHOD_MMAL_ADVANCED) -+ interlace_method = VS_INTERLACEMETHOD_MMAL_BOB; -+ if (interlace_method == VS_INTERLACEMETHOD_MMAL_ADVANCED_HALF) -+ interlace_method = VS_INTERLACEMETHOD_MMAL_BOB_HALF; -+ } -+ - // we don't keep up when running at 60fps in the background so switch to half rate - if (!g_graphicsContext.IsFullScreenVideo()) - { - -From 2eff85dc93732ef5fed900a933680fa8ba10f104 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sun, 18 Sep 2016 15:19:02 +0100 -Subject: [PATCH 66/73] MMAL: Move pool into base class - ---- - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp | 2 +- - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h | 11 ++++++----- - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp | 2 +- - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h | 1 - - 4 files changed, 8 insertions(+), 8 deletions(-) - -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -index 1cb76f65a24bf46fe4e3fc1f54e99f284672d80b..d62539aed69306a682d8dc68e410cf7b4a1d6594 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -@@ -59,7 +59,7 @@ using namespace KODI::MESSAGING; - - - CMMALVideoBuffer::CMMALVideoBuffer(CMMALVideo *omv, std::shared_ptr pool) -- : m_omv(omv), m_pool(pool) -+ : CMMALBuffer(pool), m_omv(omv) - { - if (VERBOSE && g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, this); -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h -index 1b21fe1a8a26c80dfb83a0af5a6ebd5c9cae42ca..5c741d340d19b3765f96434ceb54745e4eccdc44 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h -@@ -45,10 +45,15 @@ - - enum MMALState { MMALStateNone, MMALStateHWDec, MMALStateFFDec, MMALStateDeint, }; - -+class CMMALVideo; -+class CMMALRenderer; -+class CMMALPool; -+ - // a mmal video frame - class CMMALBuffer : public IDVDResourceCounted - { - public: -+ CMMALBuffer(std::shared_ptr pool) : m_pool(pool) {} - virtual ~CMMALBuffer() {} - MMAL_BUFFER_HEADER_T *mmal_buffer; - unsigned int m_width; -@@ -60,6 +65,7 @@ public: - MMALState m_state; - bool m_rendered; - bool m_stills; -+ std::shared_ptr m_pool; - const char *GetStateName() { - static const char *names[] = { "MMALStateNone", "MMALStateHWDec", "MMALStateFFDec", "MMALStateDeint", }; - if ((size_t)m_state < vcos_countof(names)) -@@ -69,10 +75,6 @@ public: - } - }; - --class CMMALVideo; --class CMMALRenderer; --class CMMALPool; -- - // a mmal video frame - class CMMALVideoBuffer : public CMMALBuffer - { -@@ -81,7 +83,6 @@ public: - virtual ~CMMALVideoBuffer(); - CMMALVideo *m_omv; - protected: -- std::shared_ptr m_pool; - }; - - class CMMALVideo : public CDVDVideoCodec -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp -index 244dced9d7d5c4a9006a2e5a6d27f80fdf0f497a..b0db2746b6eb51b2222e8f2813b1eb14ff120a2e 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp -@@ -43,7 +43,7 @@ using namespace MMAL; - #define CLASSNAME "CMMALYUVBuffer" - - CMMALYUVBuffer::CMMALYUVBuffer(std::shared_ptr pool, uint32_t mmal_encoding, uint32_t width, uint32_t height, uint32_t aligned_width, uint32_t aligned_height, uint32_t size) -- : m_pool(pool) -+ : CMMALBuffer(pool), m_omv(omv) - { - uint32_t size_pic = 0; - m_width = width; -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h -index 60aff83a3e55f11313d0d9186212e9badbb6d52e..20eab3bed39fa11bd1454f6c6decd4ec601f3bca 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h -@@ -45,7 +45,6 @@ public: - - CGPUMEM *gmem; - private: -- std::shared_ptr m_pool; - }; - - class CDecoder - -From f3cd5d153db54994cebd549bf0181b030978a39e Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sun, 18 Sep 2016 16:20:30 +0100 -Subject: [PATCH 67/73] MMAL: Make setting the decoder more consistent between - MMALCodec and MMALFFMpeg - ---- - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp | 5 +++-- - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h | 3 ++- - .../cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp | 7 ++++--- - xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h | 8 +++++--- - 4 files changed, 14 insertions(+), 9 deletions(-) - -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp -index b0db2746b6eb51b2222e8f2813b1eb14ff120a2e..f20305acaf0ca73a928bc0927129f384c642474a 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp -@@ -42,8 +42,8 @@ using namespace MMAL; - - #define CLASSNAME "CMMALYUVBuffer" - --CMMALYUVBuffer::CMMALYUVBuffer(std::shared_ptr pool, uint32_t mmal_encoding, uint32_t width, uint32_t height, uint32_t aligned_width, uint32_t aligned_height, uint32_t size) -- : CMMALBuffer(pool), m_omv(omv) -+CMMALYUVBuffer::CMMALYUVBuffer(CDecoder *omv, std::shared_ptr pool, uint32_t mmal_encoding, uint32_t width, uint32_t height, uint32_t aligned_width, uint32_t aligned_height, uint32_t size) -+: CMMALBuffer(pool), m_omv(omv) - { - uint32_t size_pic = 0; - m_width = width; -@@ -244,6 +244,7 @@ bool CDecoder::Open(AVCodecContext *avctx, AVCodecContext* mainctx, enum AVPixel - CLog::Log(LOGERROR, "%s::%s Failed to create pool for decoder output", CLASSNAME, __func__); - return false; - } -+ m_pool->SetDecoder(this); - - std::list deintMethods; - deintMethods.push_back(EINTERLACEMETHOD::VS_INTERLACEMETHOD_AUTO); -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h -index 20eab3bed39fa11bd1454f6c6decd4ec601f3bca..b819c249b6c5f5fbb5c1a4ebd9d45fbdf8adb63b 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h -@@ -40,10 +40,11 @@ class CGPUPool; - class CMMALYUVBuffer : public CMMALBuffer - { - public: -- CMMALYUVBuffer(std::shared_ptr pool, uint32_t mmal_encoding, uint32_t width, uint32_t height, uint32_t aligned_width, uint32_t aligned_height, uint32_t size); -+ CMMALYUVBuffer(CDecoder *dec, std::shared_ptr pool, uint32_t mmal_encoding, uint32_t width, uint32_t height, uint32_t aligned_width, uint32_t aligned_height, uint32_t size); - virtual ~CMMALYUVBuffer(); - - CGPUMEM *gmem; -+ CDecoder *m_omv; - private: - }; - -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -index 2f9af729c26f81327a666a59a90f707e53041774..65e09af1c62b011656a15f662a2eb904ed03680e 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -@@ -71,6 +71,7 @@ CMMALPool::CMMALPool(const char *component_name, bool input, uint32_t num_buffer - - m_mmal_pool = mmal_port_pool_create(port, port->buffer_num, port->buffer_size); - m_closing = false; -+ m_software = false; - m_mmal_format = 0; - m_width = 0; - m_height = 0; -@@ -207,14 +208,14 @@ CMMALBuffer *CMMALPool::GetBuffer(uint32_t timeout) - // ffmpeg requirements - uint32_t aligned_width = m_aligned_width, aligned_height = m_aligned_height; - AlignedSize(m_avctx, aligned_width, aligned_height); -- if (m_dec) -+ if (!IsSoftware()) - { -- CMMALVideoBuffer *vid = new CMMALVideoBuffer(m_dec, shared_from_this()); -+ CMMALVideoBuffer *vid = new CMMALVideoBuffer(static_cast(m_dec), shared_from_this()); - omvb = vid; - } - else - { -- MMAL::CMMALYUVBuffer *yuv = new MMAL::CMMALYUVBuffer(shared_from_this(), m_mmal_format, m_width, m_height, aligned_width, aligned_height, m_size); -+ MMAL::CMMALYUVBuffer *yuv = new MMAL::CMMALYUVBuffer(static_cast(m_dec), shared_from_this(), m_mmal_format, m_width, m_height, aligned_width, aligned_height, m_size); - if (yuv) - { - CGPUMEM *gmem = yuv->gmem; -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -index 5d3baa6534a2fe449990402ab805d84423fbc636..b7a61eab678f8aedeff96795c9ba3a06157bb88d 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -@@ -62,13 +62,14 @@ public: - void ReleaseBuffer(CGPUMEM *gmem); - void Close(); - void Prime(); -- void SetDecoder(CMMALVideo *dec) { m_dec = dec; } -+ void SetDecoder(void *dec) { m_dec = dec; } - void SetFormat(uint32_t mmal_format, uint32_t width, uint32_t height, uint32_t aligned_width, uint32_t aligned_height, uint32_t size, AVCodecContext *avctx) -- { m_mmal_format = mmal_format; m_width = width; m_height = height; m_aligned_width = aligned_width; m_aligned_height = aligned_height; m_size = size, m_avctx = avctx; } -+ { m_mmal_format = mmal_format; m_width = width; m_height = height; m_aligned_width = aligned_width; m_aligned_height = aligned_height; m_size = size, m_avctx = avctx; m_software = true; } -+ bool IsSoftware() { return m_software; } - protected: - uint32_t m_mmal_format, m_width, m_height, m_aligned_width, m_aligned_height, m_size; - AVCodecContext *m_avctx; -- CMMALVideo *m_dec; -+ void *m_dec; - MMALState m_state; - bool m_input; - MMAL_POOL_T *m_mmal_pool; -@@ -76,6 +77,7 @@ protected: - CCriticalSection m_section; - std::deque m_freeBuffers; - bool m_closing; -+ bool m_software; - }; - - class CMMALRenderer : public CBaseRenderer, public CThread, public IRunnable - -From dc0a901b361cc7e40ed64d3b77c06a7a5f38a042 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sun, 18 Sep 2016 16:32:45 +0100 -Subject: [PATCH 68/73] MMAL: Set processInfo in pool - ---- - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp | 1 + - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp | 1 + - xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp | 1 + - xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h | 2 ++ - 4 files changed, 5 insertions(+) - -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -index d62539aed69306a682d8dc68e410cf7b4a1d6594..c65fc524273f2b6cc40cf6ff8e8beb8d0bc38440 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -@@ -481,6 +481,7 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) - return false; - } - m_pool->SetDecoder(this); -+ m_pool->SetProcessInfo(&m_processInfo); - m_dec = m_pool->GetComponent(); - - m_dec->control->userdata = (struct MMAL_PORT_USERDATA_T *)this; -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp -index f20305acaf0ca73a928bc0927129f384c642474a..d42e3090c9b38a43ee72fdc3780a244317ece11a 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp -@@ -245,6 +245,7 @@ bool CDecoder::Open(AVCodecContext *avctx, AVCodecContext* mainctx, enum AVPixel - return false; - } - m_pool->SetDecoder(this); -+ m_pool->SetProcessInfo(&m_processInfo); - - std::list deintMethods; - deintMethods.push_back(EINTERLACEMETHOD::VS_INTERLACEMETHOD_AUTO); -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -index 65e09af1c62b011656a15f662a2eb904ed03680e..297fca290f7d66b1eecad4da834865821864b53d 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -@@ -72,6 +72,7 @@ CMMALPool::CMMALPool(const char *component_name, bool input, uint32_t num_buffer - m_mmal_pool = mmal_port_pool_create(port, port->buffer_num, port->buffer_size); - m_closing = false; - m_software = false; -+ m_processInfo = nullptr; - m_mmal_format = 0; - m_width = 0; - m_height = 0; -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -index b7a61eab678f8aedeff96795c9ba3a06157bb88d..b7621a8cf37907d544987b06dd4528eed468abc0 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -@@ -63,6 +63,7 @@ public: - void Close(); - void Prime(); - void SetDecoder(void *dec) { m_dec = dec; } -+ void SetProcessInfo(CProcessInfo *processInfo) { m_processInfo = processInfo; } - void SetFormat(uint32_t mmal_format, uint32_t width, uint32_t height, uint32_t aligned_width, uint32_t aligned_height, uint32_t size, AVCodecContext *avctx) - { m_mmal_format = mmal_format; m_width = width; m_height = height; m_aligned_width = aligned_width; m_aligned_height = aligned_height; m_size = size, m_avctx = avctx; m_software = true; } - bool IsSoftware() { return m_software; } -@@ -78,6 +79,7 @@ protected: - std::deque m_freeBuffers; - bool m_closing; - bool m_software; -+ CProcessInfo *m_processInfo; - }; - - class CMMALRenderer : public CBaseRenderer, public CThread, public IRunnable - -From f9fcf79aa64dec676674a0237f15db390a225bce Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sun, 18 Sep 2016 18:35:55 +0100 -Subject: [PATCH 69/73] MMAL: Report deinterlace method to processinfo overlay - ---- - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp | 3 +-- - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h | 1 + - .../VideoRenderers/HwDecRender/MMALRenderer.cpp | 19 ++++++++++++++++++- - .../VideoRenderers/HwDecRender/MMALRenderer.h | 1 + - 4 files changed, 21 insertions(+), 3 deletions(-) - -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -index c65fc524273f2b6cc40cf6ff8e8beb8d0bc38440..1aca23f755ce273ca1e5e4ffdd8be02897e2304a 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -@@ -57,6 +57,7 @@ using namespace KODI::MESSAGING; - - #define VERBOSE 0 - -+void CMMALBuffer::SetVideoDeintMethod(std::string method) { if (m_pool) m_pool->SetVideoDeintMethod(method); } - - CMMALVideoBuffer::CMMALVideoBuffer(CMMALVideo *omv, std::shared_ptr pool) - : CMMALBuffer(pool), m_omv(omv) -@@ -376,8 +377,6 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) - if (hints.workaround_bugs & FF_BUG_GMC_UNSUPPORTED) - return false; - -- m_processInfo.SetVideoDeintMethod("none"); -- - std::list deintMethods; - deintMethods.push_back(EINTERLACEMETHOD::VS_INTERLACEMETHOD_AUTO); - deintMethods.push_back(EINTERLACEMETHOD::VS_INTERLACEMETHOD_MMAL_ADVANCED); -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h -index 5c741d340d19b3765f96434ceb54745e4eccdc44..baff1f031149da5d669536711cc0057b2db078e3 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h -@@ -66,6 +66,7 @@ public: - bool m_rendered; - bool m_stills; - std::shared_ptr m_pool; -+ void SetVideoDeintMethod(std::string method); - const char *GetStateName() { - static const char *names[] = { "MMALStateNone", "MMALStateHWDec", "MMALStateFFDec", "MMALStateDeint", }; - if ((size_t)m_state < vcos_countof(names)) -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -index 297fca290f7d66b1eecad4da834865821864b53d..a9566eb810c3b890ddbaa5651333cf4c547aa953 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -@@ -524,6 +524,7 @@ void CMMALRenderer::Run() - { - if (buffer->length > 0) - { -+ EINTERLACEMETHOD last_interlace_method = m_interlace_method; - EINTERLACEMETHOD interlace_method = CMediaSettings::GetInstance().GetCurrentVideoSettings().m_InterlaceMethod; - if (interlace_method == VS_INTERLACEMETHOD_AUTO) - interlace_method = VS_INTERLACEMETHOD_MMAL_ADVANCED; -@@ -555,6 +556,22 @@ void CMMALRenderer::Run() - else if (m_deint_input || interlace) - CheckConfigurationDeint(omvb->m_width, omvb->m_height, omvb->m_aligned_width, omvb->m_aligned_height, omvb->m_encoding, interlace_method); - -+ if (!m_deint_input) -+ m_interlace_method = VS_INTERLACEMETHOD_NONE; -+ -+ if (last_interlace_method == m_interlace_method) -+ ; -+ else if (m_interlace_method == VS_INTERLACEMETHOD_MMAL_ADVANCED) -+ omvb->SetVideoDeintMethod("adv(x2)"); -+ else if (m_interlace_method == VS_INTERLACEMETHOD_MMAL_ADVANCED_HALF) -+ omvb->SetVideoDeintMethod("adv(x1)"); -+ else if (m_interlace_method == VS_INTERLACEMETHOD_MMAL_BOB) -+ omvb->SetVideoDeintMethod("bob(x2)"); -+ else if (m_interlace_method == VS_INTERLACEMETHOD_MMAL_BOB_HALF) -+ omvb->SetVideoDeintMethod("bob(x1)"); -+ else -+ omvb->SetVideoDeintMethod("none"); -+ - if (m_deint_input) - { - MMAL_STATUS_T status = mmal_port_send_buffer(m_deint_input, omvb->mmal_buffer); -@@ -1150,7 +1167,7 @@ void CMMALRenderer::DestroyDeinterlace() - CLog::Log(LOGERROR, "%s::%s Failed to disable deinterlace output port(status=%x %s)", CLASSNAME, __func__, status, mmal_status_to_string(status)); - } - m_deint_output = nullptr; -- m_interlace_method = VS_INTERLACEMETHOD_NONE; -+ m_interlace_method = VS_INTERLACEMETHOD_MAX; - m_deint_width = 0; - m_deint_height = 0; - m_deint_aligned_width = 0; -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -index b7621a8cf37907d544987b06dd4528eed468abc0..5758deba4d5d30662507968ac7af0fb0497ae35e 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -@@ -67,6 +67,7 @@ public: - void SetFormat(uint32_t mmal_format, uint32_t width, uint32_t height, uint32_t aligned_width, uint32_t aligned_height, uint32_t size, AVCodecContext *avctx) - { m_mmal_format = mmal_format; m_width = width; m_height = height; m_aligned_width = aligned_width; m_aligned_height = aligned_height; m_size = size, m_avctx = avctx; m_software = true; } - bool IsSoftware() { return m_software; } -+ void SetVideoDeintMethod(std::string method) { if (m_processInfo) m_processInfo->SetVideoDeintMethod(method); } - protected: - uint32_t m_mmal_format, m_width, m_height, m_aligned_width, m_aligned_height, m_size; - AVCodecContext *m_avctx; - -From 85dc8a110e932cb99d9ae5f1366a2d683274ebb5 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Mon, 19 Sep 2016 19:56:07 +0100 -Subject: [PATCH 70/73] MMALRenderer: Ensure updated aspect ratio is seen in - the case of a single still frame - ---- - .../VideoRenderers/HwDecRender/MMALRenderer.cpp | 15 +++++++++++---- - .../VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h | 2 ++ - 2 files changed, 13 insertions(+), 4 deletions(-) - -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -index a9566eb810c3b890ddbaa5651333cf4c547aa953..81dd06167b65ab8c29300d68f3138fd0bb7f6a48 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -@@ -388,6 +388,7 @@ bool CMMALRenderer::CheckConfigurationVout(uint32_t width, uint32_t height, uint - Create(); - } - } -+ SetVideoRect(m_cachedSourceRect, m_cachedDestRect); - return true; - } - -@@ -417,6 +418,8 @@ CMMALRenderer::CMMALRenderer() : CThread("MMALRenderer"), m_processThread(this, - m_deint_height = 0; - m_deint_aligned_width = 0; - m_deint_aligned_height = 0; -+ m_cachedSourceRect.SetRect(0, 0, 0, 0); -+ m_cachedDestRect.SetRect(0, 0, 0, 0); - - m_queue_process = mmal_queue_create(); - m_processThread.Create(); -@@ -770,16 +773,22 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) - if (m_format == RENDER_FMT_MMAL) - omvb = m_buffers[source]; - -+ if (g_graphicsContext.GetStereoView() != RENDER_STEREO_VIEW_RIGHT) -+ { -+ ManageRenderArea(); -+ CRect view; -+ CBaseRenderer::GetVideoRect(m_cachedSourceRect, m_cachedDestRect, view); -+ } -+ - // we only want to upload frames once - if (omvb && omvb->m_rendered) - { - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s - MMAL: clear:%d flags:%x alpha:%d source:%d omvb:%p mmal:%p mflags:%x skipping", CLASSNAME, __func__, clear, flags, alpha, source, omvb, omvb->mmal_buffer, omvb->mmal_buffer->flags); -+ SetVideoRect(m_cachedSourceRect, m_cachedDestRect); - goto exit; - } - -- ManageRenderArea(); -- - // if sharpness setting has changed, we should update it - if (m_sharpness != CMediaSettings::GetInstance().GetCurrentVideoSettings().m_Sharpness) - { -@@ -795,7 +804,6 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) - CLog::Log(LOGDEBUG, "%s::%s - bypass: clear:%d flags:%x alpha:%d source:%d format:%d", CLASSNAME, __func__, clear, flags, alpha, source, m_format); - goto exit; - } -- SetVideoRect(m_sourceRect, m_destRect); - - if (omvb && omvb->mmal_buffer) - { -@@ -981,7 +989,6 @@ bool CMMALRenderer::Supports(ESCALINGMETHOD method) - void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect) - { - CSingleLock lock(m_sharedSection); -- assert(g_graphicsContext.GetStereoView() != RENDER_STEREO_VIEW_RIGHT); - - if (!m_vout_input) - return; -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -index 5758deba4d5d30662507968ac7af0fb0497ae35e..a2af6d5fd0f5fa6736cb3ca31ee6c778fa78e3f7 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -@@ -133,6 +133,8 @@ protected: - unsigned int m_extended_format; - int m_neededBuffers; - -+ CRect m_cachedSourceRect; -+ CRect m_cachedDestRect; - CRect m_src_rect; - CRect m_dst_rect; - RENDER_STEREO_MODE m_video_stereo_mode; - -From db293141be4e15f5d567d82fe151f2e2ede82aa1 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Tue, 19 Jul 2016 20:37:46 +0100 -Subject: [PATCH 71/73] mmalrender: Use computed framerate rather than version - from configure - ---- - .../VideoRenderers/HwDecRender/MMALRenderer.cpp | 58 ++++++++++++++++++++-- - .../VideoRenderers/HwDecRender/MMALRenderer.h | 5 +- - 2 files changed, 57 insertions(+), 6 deletions(-) - -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -index 81dd06167b65ab8c29300d68f3138fd0bb7f6a48..d3ddcdeea8a71f9c24656c0ff2f7f95e7e845906 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -@@ -34,6 +34,7 @@ - #include "cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h" - #include "xbmc/Application.h" - #include "linux/RBP.h" -+#include "cores/VideoPlayer/DVDClock.h" - - extern "C" { - #include "libavutil/imgutils.h" -@@ -405,6 +406,10 @@ CMMALRenderer::CMMALRenderer() : CThread("MMALRenderer"), m_processThread(this, - m_queue_render = nullptr; - m_queue_process = nullptr; - m_error = 0.0; -+ m_fps = 0.0; -+ m_lastPts = DVD_NOPTS_VALUE; -+ m_frameInterval = 0.0; -+ m_frameIntervalDiff = 1e5; - m_vsync_count = ~0U; - m_sharpness = -2.0f; - m_vout_width = 0; -@@ -452,14 +457,32 @@ void CMMALRenderer::Process() - CLog::Log(LOGDEBUG, "%s::%s - starting", CLASSNAME, __func__); - while (!bStop) - { -- g_RBP.WaitVsync(); - double dfps = g_graphicsContext.GetFPS(); -- if (dfps <= 0.0) -- dfps = m_fps; -+ double fps = 0.0; -+ double inc = 1.0; -+ g_RBP.WaitVsync(); -+ -+ CSingleLock lock(m_sharedSection); -+ // if good enough framerate measure then use it -+ if (dfps > 0.0 && m_frameInterval > 0.0 && m_frameIntervalDiff * 1e-6 < 1e-3) -+ { -+ fps = 1e6 / m_frameInterval; -+ inc = fps / dfps; -+ if (fabs(inc - 1.0) < 1e-2) -+ inc = 1.0; -+ else if (fabs(inc - 0.5) < 1e-2) -+ inc = 0.5; -+ else if (fabs(inc - 24.0/60.0) < 1e-2) -+ inc = 24.0/60.0; -+ if (m_deint) -+ inc *= 2.0; -+ } - // This algorithm is basically making the decision according to Bresenham's line algorithm. Imagine drawing a line where x-axis is display frames, and y-axis is video frames -- m_error += m_fps / dfps; -+ m_error += inc; -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s - debug vsync:%d queue:%d fps:%.2f/%.2f/%.2f inc:%f diff:%f", CLASSNAME, __func__, g_RBP.LastVsync(), mmal_queue_length(m_queue_render), fps, m_fps, dfps, inc, m_error); - // we may need to discard frames if queue length gets too high or video frame rate is above display frame rate -- while (mmal_queue_length(m_queue_render) > 2 || m_error > 1.0) -+ while (mmal_queue_length(m_queue_render) > 2 || (mmal_queue_length(m_queue_render) > 1 && m_error > 1.0)) - { - if (m_error > 1.0) - m_error -= 1.0; -@@ -655,6 +678,26 @@ void CMMALRenderer::Run() - CLog::Log(LOGDEBUG, "%s::%s - stopping", CLASSNAME, __func__); - } - -+void CMMALRenderer::UpdateFramerateStats(double pts) -+{ -+ double diff = 0.0; -+ if (m_lastPts != DVD_NOPTS_VALUE && pts != DVD_NOPTS_VALUE && pts - m_lastPts > 0.0 && pts - m_lastPts < DVD_SEC_TO_TIME(1./20.0)) -+ { -+ diff = pts - m_lastPts; -+ if (m_frameInterval == 0.0) -+ m_frameInterval = diff; -+ else if (diff > 0.0) -+ { -+ m_frameIntervalDiff = m_frameIntervalDiff * 0.9 + 0.1 * fabs(m_frameInterval - diff); -+ m_frameInterval = m_frameInterval * 0.9 + diff * 0.1; -+ } -+ } -+ if (pts != DVD_NOPTS_VALUE) -+ m_lastPts = pts; -+ if (VERBOSE && g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s pts:%.3f diff:%.3f m_frameInterval:%.6f m_frameIntervalDiff:%.6f", CLASSNAME, __func__, pts*1e-6, diff * 1e-6 , m_frameInterval * 1e-6, m_frameIntervalDiff *1e-6); -+} -+ - void CMMALRenderer::AddVideoPictureHW(DVDVideoPicture& pic, int index) - { - if (m_format != RENDER_FMT_MMAL) -@@ -669,6 +712,7 @@ void CMMALRenderer::AddVideoPictureHW(DVDVideoPicture& pic, int index) - CLog::Log(LOGDEBUG, "%s::%s MMAL - %p (%p) %i", CLASSNAME, __func__, buffer, buffer->mmal_buffer, index); - - m_buffers[index] = buffer->Acquire(); -+ UpdateFramerateStats(pic.pts); - } - - bool CMMALRenderer::Configure(unsigned int width, unsigned int height, unsigned int d_width, unsigned int d_height, float fps, unsigned flags, ERenderFormat format, unsigned extended_format, unsigned int orientation) -@@ -682,6 +726,10 @@ bool CMMALRenderer::Configure(unsigned int width, unsigned int height, unsigned - - m_fps = fps; - m_iFlags = flags; -+ m_error = 0.0; -+ m_lastPts = DVD_NOPTS_VALUE; -+ m_frameInterval = 0.0; -+ m_frameIntervalDiff = 1e5; - - // cause SetVideoRect to trigger - needed after a hdmi mode change - m_src_rect.SetRect(0, 0, 0, 0); -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -index a2af6d5fd0f5fa6736cb3ca31ee6c778fa78e3f7..69eae6cbef0131d20dc979dcb35915cd73967592 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -@@ -150,7 +150,9 @@ protected: - CThread m_processThread; - MMAL_BUFFER_HEADER_T m_quitpacket; - double m_error; -- -+ double m_lastPts; -+ double m_frameInterval; -+ double m_frameIntervalDiff; - uint32_t m_vout_width, m_vout_height, m_vout_aligned_width, m_vout_aligned_height; - // deinterlace - MMAL_COMPONENT_T *m_deint; -@@ -168,5 +170,6 @@ protected: - uint32_t m_vsync_count; - void ReleaseBuffers(); - void UnInitMMAL(); -+ void UpdateFramerateStats(double pts); - virtual void Run() override; - }; - -From e2e4983038147c5a0c104ed51c9a11eef1c787a0 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 13 Oct 2016 19:31:46 +0100 -Subject: [PATCH 72/73] MMALRender: Switch to deinterlace mode where frame - flags are exclusively used - -Ensures non-interlace frames are not deinterlaced when stream switches from interlaced to progressive -with software decode ---- - xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -index d3ddcdeea8a71f9c24656c0ff2f7f95e7e845906..2f1e5bfc280ca1d608650ae97dc7df3d8d5a438c 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -@@ -1338,7 +1338,7 @@ bool CMMALRenderer::CheckConfigurationDeint(uint32_t width, uint32_t height, uin - if (m_deint_output && (sizeChanged || deinterlaceChanged || encodingChanged)) - { - MMAL_PARAMETER_IMAGEFX_PARAMETERS_T imfx_param = {{MMAL_PARAMETER_IMAGE_EFFECT_PARAMETERS, sizeof(imfx_param)}, -- advanced_deinterlace ? MMAL_PARAM_IMAGEFX_DEINTERLACE_ADV : MMAL_PARAM_IMAGEFX_DEINTERLACE_FAST, 4, {3, 0, half_framerate, 1 }}; -+ advanced_deinterlace ? MMAL_PARAM_IMAGEFX_DEINTERLACE_ADV : MMAL_PARAM_IMAGEFX_DEINTERLACE_FAST, 4, {5, 0, half_framerate, 1 }}; - - status = mmal_port_parameter_set(m_deint_output, &imfx_param.hdr); - if (status != MMAL_SUCCESS) - -From ee966fcdd5219fc0ab777c9ad50d0e045d69f359 Mon Sep 17 00:00:00 2001 +From 60198462cb88a0e0bcee714c4d3d0b418b01af76 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 14 Oct 2016 15:37:53 +0100 -Subject: [PATCH 73/73] MMALFFMpeg: Report as SW decode in codec overlay info +Subject: [PATCH 62/63] MMALFFMpeg: Report as SW decode in codec overlay info --- xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index ec2cc3d867d446a748024ce85e079aea8451fb85..e180ba5b73fe9a521a585722d3959291e919c375 100644 +index 619515c9411172261d8f0bef24c5d679c35e5d7d..b31c984c0a507891f2754146a4c62802f0096505 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp @@ -579,7 +579,7 @@ void CDVDVideoCodecFFmpeg::UpdateName() @@ -54034,3 +52186,99 @@ index ec2cc3d867d446a748024ce85e079aea8451fb85..e180ba5b73fe9a521a585722d3959291 CLog::Log(LOGDEBUG, "CDVDVideoCodecFFmpeg - Updated codec: %s", m_name.c_str()); } + +From 7d4c324285dbe6d3a90c6f379178388841395f66 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 8 Nov 2016 17:29:02 +0000 +Subject: [PATCH 63/63] MMALRender: Reduce log spam + +--- + xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp | 4 ++-- + xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp | 6 ++++-- + .../cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp | 8 +++++--- + 3 files changed, 11 insertions(+), 7 deletions(-) + +diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp +index 2257c94a6b095d9b0926c418c1faaf2ebfadf088..dca872373080156100618d58d9782e2461fa2648 100644 +--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp ++++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp +@@ -224,7 +224,7 @@ static void dec_input_port_cb_static(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *bu + void CMMALVideo::dec_output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer) + { + if (!(buffer->cmd == 0 && buffer->length > 0)) +- if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ if (VERBOSE && g_advancedSettings.CanLogComponent(LOGVIDEO)) + CLog::Log(LOGDEBUG, "%s::%s port:%p buffer %p, len %d cmd:%x flags:%x", CLASSNAME, __func__, port, buffer, buffer->length, buffer->cmd, buffer->flags); + + bool kept = false; +@@ -617,7 +617,7 @@ void CMMALVideo::Dispose() + + void CMMALVideo::SetDropState(bool bDrop) + { +- if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ if (bDrop != m_dropState) + CLog::Log(LOGDEBUG, "%s::%s - bDrop(%d)", CLASSNAME, __func__, bDrop); + m_dropState = bDrop; + } +diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp +index d42e3090c9b38a43ee72fdc3780a244317ece11a..c0b3f19f2ef9cdef9adf00cf81154803b12feb4f 100644 +--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp ++++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp +@@ -42,6 +42,8 @@ using namespace MMAL; + + #define CLASSNAME "CMMALYUVBuffer" + ++#define VERBOSE 0 ++ + CMMALYUVBuffer::CMMALYUVBuffer(CDecoder *omv, std::shared_ptr pool, uint32_t mmal_encoding, uint32_t width, uint32_t height, uint32_t aligned_width, uint32_t aligned_height, uint32_t size) + : CMMALBuffer(pool), m_omv(omv) + { +@@ -72,13 +74,13 @@ CMMALYUVBuffer::CMMALYUVBuffer(CDecoder *omv, std::shared_ptr pool, u + gmem = m_pool->AllocateBuffer(size_pic); + if (gmem) + gmem->m_opaque = (void *)this; +- if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ if (VERBOSE && g_advancedSettings.CanLogComponent(LOGVIDEO)) + CLog::Log(LOGDEBUG, "%s::%s buf:%p gmem:%p mmal:%p %dx%d (%dx%d) size:%d %.4s", CLASSNAME, __FUNCTION__, this, gmem, mmal_buffer, m_width, m_height, m_aligned_width, m_aligned_height, gmem->m_numbytes, (char *)&m_encoding); + } + + CMMALYUVBuffer::~CMMALYUVBuffer() + { +- if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ if (VERBOSE && g_advancedSettings.CanLogComponent(LOGVIDEO)) + CLog::Log(LOGDEBUG, "%s::%s buf:%p gmem:%p mmal:%p %dx%d (%dx%d) size:%d %.4s", CLASSNAME, __FUNCTION__, this, gmem, mmal_buffer, m_width, m_height, m_aligned_width, m_aligned_height, gmem->m_numbytes, (char *)&m_encoding); + if (gmem) + m_pool->ReleaseBuffer(gmem); +diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp +index 0b73b7700ce8a63932d3fa3b90dda8cf80ac527c..f5f0f0d01227b3b4dcebb4a22a54dbcaac2d5ee9 100644 +--- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp ++++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp +@@ -638,7 +638,8 @@ void CMMALRenderer::Run() + if (m_queue_render) + { + mmal_queue_put(m_queue_render, buffer); +- CLog::Log(LOGDEBUG, "%s::%s send %p to m_queue_render", CLASSNAME, __func__, omvb); ++ if (VERBOSE && g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s send %p to m_queue_render", CLASSNAME, __func__, omvb); + kept = true; + } + else +@@ -646,7 +647,8 @@ void CMMALRenderer::Run() + CheckConfigurationVout(omvb->m_width, omvb->m_height, omvb->m_aligned_width, omvb->m_aligned_height, omvb->m_encoding); + if (m_vout_input) + { +- CLog::Log(LOGDEBUG, "%s::%s send %p to m_vout_input", CLASSNAME, __func__, omvb); ++ if (VERBOSE && g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s send %p to m_vout_input", CLASSNAME, __func__, omvb); + MMAL_STATUS_T status = mmal_port_send_buffer(m_vout_input, buffer); + if (status != MMAL_SUCCESS) + CLog::Log(LOGERROR, "%s::%s - Failed to send buffer %p to %s (status=0%x %s)", CLASSNAME, __func__, buffer, m_vout_input->name, status, mmal_status_to_string(status)); +@@ -765,7 +767,7 @@ int CMMALRenderer::GetImage(YV12Image *image, int source, bool readonly) + CLog::Log(LOGDEBUG, "%s::%s - invalid: format:%d image:%p source:%d ro:%d", CLASSNAME, __func__, m_format, image, source, readonly); + return -1; + } +- if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ if (VERBOSE && g_advancedSettings.CanLogComponent(LOGVIDEO)) + CLog::Log(LOGDEBUG, "%s::%s - MMAL: image:%p source:%d ro:%d", CLASSNAME, __func__, image, source, readonly); + return source; + } From 514878558d472a5d5fc288a9698ed0f8b7f25923 Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Wed, 30 Nov 2016 22:16:21 +0000 Subject: [PATCH 07/11] kodi: bump to 17.0-beta6-654f1b7 --- packages/mediacenter/kodi-theme-Estuary/package.mk | 2 +- packages/mediacenter/kodi/package.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/mediacenter/kodi-theme-Estuary/package.mk b/packages/mediacenter/kodi-theme-Estuary/package.mk index 903fb23075..b5c2255d36 100644 --- a/packages/mediacenter/kodi-theme-Estuary/package.mk +++ b/packages/mediacenter/kodi-theme-Estuary/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="kodi-theme-Estuary" -PKG_VERSION="17.0-beta5-e92818a" +PKG_VERSION="17.0-beta6-654f1b7" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi/package.mk b/packages/mediacenter/kodi/package.mk index 17f7384951..dc3abb1deb 100644 --- a/packages/mediacenter/kodi/package.mk +++ b/packages/mediacenter/kodi/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="kodi" -PKG_VERSION="17.0-beta5-e92818a" +PKG_VERSION="17.0-beta6-654f1b7" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" From 8fcd93a97e4da4afda8c3adabdfb2aa5db6761ed Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Wed, 30 Nov 2016 22:16:21 +0000 Subject: [PATCH 08/11] kodi: updates to binary add-ons --- .../mediacenter/kodi-binary-addons/adsp.freesurround/package.mk | 2 +- .../kodi-binary-addons/audiodecoder.fluidsynth/package.mk | 2 +- .../mediacenter/kodi-binary-addons/audiodecoder.ncsf/package.mk | 2 +- .../kodi-binary-addons/audiodecoder.timidity/package.mk | 2 +- .../mediacenter/kodi-binary-addons/inputstream.rtmp/package.mk | 2 +- .../kodi-binary-addons/peripheral.joystick/package.mk | 2 +- packages/mediacenter/kodi-binary-addons/pvr.argustv/package.mk | 2 +- packages/mediacenter/kodi-binary-addons/pvr.demo/package.mk | 2 +- packages/mediacenter/kodi-binary-addons/pvr.dvblink/package.mk | 2 +- .../mediacenter/kodi-binary-addons/pvr.dvbviewer/package.mk | 2 +- packages/mediacenter/kodi-binary-addons/pvr.filmon/package.mk | 2 +- .../mediacenter/kodi-binary-addons/pvr.hdhomerun/package.mk | 2 +- packages/mediacenter/kodi-binary-addons/pvr.hts/package.mk | 2 +- .../mediacenter/kodi-binary-addons/pvr.iptvsimple/package.mk | 2 +- .../kodi-binary-addons/pvr.mediaportal.tvserver/package.mk | 2 +- packages/mediacenter/kodi-binary-addons/pvr.mythtv/package.mk | 2 +- packages/mediacenter/kodi-binary-addons/pvr.nextpvr/package.mk | 2 +- packages/mediacenter/kodi-binary-addons/pvr.njoy/package.mk | 2 +- packages/mediacenter/kodi-binary-addons/pvr.octonet/package.mk | 2 +- packages/mediacenter/kodi-binary-addons/pvr.pctv/package.mk | 2 +- packages/mediacenter/kodi-binary-addons/pvr.stalker/package.mk | 2 +- packages/mediacenter/kodi-binary-addons/pvr.vbox/package.mk | 2 +- packages/mediacenter/kodi-binary-addons/pvr.vdr.vnsi/package.mk | 2 +- packages/mediacenter/kodi-binary-addons/pvr.vuplus/package.mk | 2 +- packages/mediacenter/kodi-binary-addons/pvr.wmc/package.mk | 2 +- .../kodi-binary-addons/visualization.projectm/package.mk | 2 +- .../kodi-binary-addons/visualization.shadertoy/package.mk | 2 +- .../kodi-binary-addons/visualization.spectrum/package.mk | 2 +- 28 files changed, 28 insertions(+), 28 deletions(-) diff --git a/packages/mediacenter/kodi-binary-addons/adsp.freesurround/package.mk b/packages/mediacenter/kodi-binary-addons/adsp.freesurround/package.mk index 4a06a63fb4..f09af1b525 100644 --- a/packages/mediacenter/kodi-binary-addons/adsp.freesurround/package.mk +++ b/packages/mediacenter/kodi-binary-addons/adsp.freesurround/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="adsp.freesurround" -PKG_VERSION="34f5040" +PKG_VERSION="61568b9" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi-binary-addons/audiodecoder.fluidsynth/package.mk b/packages/mediacenter/kodi-binary-addons/audiodecoder.fluidsynth/package.mk index afaaf0eeb3..b42c583cf7 100644 --- a/packages/mediacenter/kodi-binary-addons/audiodecoder.fluidsynth/package.mk +++ b/packages/mediacenter/kodi-binary-addons/audiodecoder.fluidsynth/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="audiodecoder.fluidsynth" -PKG_VERSION="cbd6d80" +PKG_VERSION="67fd270" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi-binary-addons/audiodecoder.ncsf/package.mk b/packages/mediacenter/kodi-binary-addons/audiodecoder.ncsf/package.mk index da962947ee..b8af5f5fbf 100644 --- a/packages/mediacenter/kodi-binary-addons/audiodecoder.ncsf/package.mk +++ b/packages/mediacenter/kodi-binary-addons/audiodecoder.ncsf/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="audiodecoder.ncsf" -PKG_VERSION="cd96c27" +PKG_VERSION="8835a04" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi-binary-addons/audiodecoder.timidity/package.mk b/packages/mediacenter/kodi-binary-addons/audiodecoder.timidity/package.mk index 86ef143fbc..b592e2006e 100644 --- a/packages/mediacenter/kodi-binary-addons/audiodecoder.timidity/package.mk +++ b/packages/mediacenter/kodi-binary-addons/audiodecoder.timidity/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="audiodecoder.timidity" -PKG_VERSION="310e909" +PKG_VERSION="20823d2" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi-binary-addons/inputstream.rtmp/package.mk b/packages/mediacenter/kodi-binary-addons/inputstream.rtmp/package.mk index b310f83211..e4df27eeae 100644 --- a/packages/mediacenter/kodi-binary-addons/inputstream.rtmp/package.mk +++ b/packages/mediacenter/kodi-binary-addons/inputstream.rtmp/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="inputstream.rtmp" -PKG_VERSION="76c9041" +PKG_VERSION="55437ac" PKG_LICENSE="GPL" PKG_SITE="http://www.kodi.tv" PKG_URL="https://github.com/notspiff/inputstream.rtmp/archive/$PKG_VERSION.tar.gz" diff --git a/packages/mediacenter/kodi-binary-addons/peripheral.joystick/package.mk b/packages/mediacenter/kodi-binary-addons/peripheral.joystick/package.mk index 4bb6644f13..fa49729e34 100644 --- a/packages/mediacenter/kodi-binary-addons/peripheral.joystick/package.mk +++ b/packages/mediacenter/kodi-binary-addons/peripheral.joystick/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="peripheral.joystick" -PKG_VERSION="ae86732" +PKG_VERSION="d09e0c6" PKG_REV="0" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi-binary-addons/pvr.argustv/package.mk b/packages/mediacenter/kodi-binary-addons/pvr.argustv/package.mk index d53fd78b19..d0d51b87c6 100644 --- a/packages/mediacenter/kodi-binary-addons/pvr.argustv/package.mk +++ b/packages/mediacenter/kodi-binary-addons/pvr.argustv/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="pvr.argustv" -PKG_VERSION="87cb678" +PKG_VERSION="7d3bdba" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi-binary-addons/pvr.demo/package.mk b/packages/mediacenter/kodi-binary-addons/pvr.demo/package.mk index 6f7ff8f620..1d8364044a 100644 --- a/packages/mediacenter/kodi-binary-addons/pvr.demo/package.mk +++ b/packages/mediacenter/kodi-binary-addons/pvr.demo/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="pvr.demo" -PKG_VERSION="01c68c8" +PKG_VERSION="9ebc62c" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi-binary-addons/pvr.dvblink/package.mk b/packages/mediacenter/kodi-binary-addons/pvr.dvblink/package.mk index 07c51c5d61..4d9bde0eb5 100644 --- a/packages/mediacenter/kodi-binary-addons/pvr.dvblink/package.mk +++ b/packages/mediacenter/kodi-binary-addons/pvr.dvblink/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="pvr.dvblink" -PKG_VERSION="043aa89" +PKG_VERSION="42207a0" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi-binary-addons/pvr.dvbviewer/package.mk b/packages/mediacenter/kodi-binary-addons/pvr.dvbviewer/package.mk index a21ee5ebe0..9dd4d0d9bf 100644 --- a/packages/mediacenter/kodi-binary-addons/pvr.dvbviewer/package.mk +++ b/packages/mediacenter/kodi-binary-addons/pvr.dvbviewer/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="pvr.dvbviewer" -PKG_VERSION="f72c62f" +PKG_VERSION="2449df9" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi-binary-addons/pvr.filmon/package.mk b/packages/mediacenter/kodi-binary-addons/pvr.filmon/package.mk index 59d4529ee1..754c89951f 100644 --- a/packages/mediacenter/kodi-binary-addons/pvr.filmon/package.mk +++ b/packages/mediacenter/kodi-binary-addons/pvr.filmon/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="pvr.filmon" -PKG_VERSION="e4f9900" +PKG_VERSION="ca709b9" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi-binary-addons/pvr.hdhomerun/package.mk b/packages/mediacenter/kodi-binary-addons/pvr.hdhomerun/package.mk index 1a7719bf18..04fdcb2464 100644 --- a/packages/mediacenter/kodi-binary-addons/pvr.hdhomerun/package.mk +++ b/packages/mediacenter/kodi-binary-addons/pvr.hdhomerun/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="pvr.hdhomerun" -PKG_VERSION="eef1bd1" +PKG_VERSION="ef45d3f" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi-binary-addons/pvr.hts/package.mk b/packages/mediacenter/kodi-binary-addons/pvr.hts/package.mk index 6c2a791817..65e52b1cc4 100644 --- a/packages/mediacenter/kodi-binary-addons/pvr.hts/package.mk +++ b/packages/mediacenter/kodi-binary-addons/pvr.hts/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="pvr.hts" -PKG_VERSION="c091da3" +PKG_VERSION="4f406f4" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi-binary-addons/pvr.iptvsimple/package.mk b/packages/mediacenter/kodi-binary-addons/pvr.iptvsimple/package.mk index db766b4257..7cf440593a 100644 --- a/packages/mediacenter/kodi-binary-addons/pvr.iptvsimple/package.mk +++ b/packages/mediacenter/kodi-binary-addons/pvr.iptvsimple/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="pvr.iptvsimple" -PKG_VERSION="adee8a7" +PKG_VERSION="d69778e" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi-binary-addons/pvr.mediaportal.tvserver/package.mk b/packages/mediacenter/kodi-binary-addons/pvr.mediaportal.tvserver/package.mk index 40c5464478..245ed0ee0a 100644 --- a/packages/mediacenter/kodi-binary-addons/pvr.mediaportal.tvserver/package.mk +++ b/packages/mediacenter/kodi-binary-addons/pvr.mediaportal.tvserver/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="pvr.mediaportal.tvserver" -PKG_VERSION="845479b" +PKG_VERSION="8ba6a79" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi-binary-addons/pvr.mythtv/package.mk b/packages/mediacenter/kodi-binary-addons/pvr.mythtv/package.mk index cb49adefa6..5b74be0427 100644 --- a/packages/mediacenter/kodi-binary-addons/pvr.mythtv/package.mk +++ b/packages/mediacenter/kodi-binary-addons/pvr.mythtv/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="pvr.mythtv" -PKG_VERSION="2f3dfcd" +PKG_VERSION="b22cfa0" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi-binary-addons/pvr.nextpvr/package.mk b/packages/mediacenter/kodi-binary-addons/pvr.nextpvr/package.mk index d6dc868be1..66aaf6757e 100644 --- a/packages/mediacenter/kodi-binary-addons/pvr.nextpvr/package.mk +++ b/packages/mediacenter/kodi-binary-addons/pvr.nextpvr/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="pvr.nextpvr" -PKG_VERSION="6a2128d" +PKG_VERSION="fe85f2a" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi-binary-addons/pvr.njoy/package.mk b/packages/mediacenter/kodi-binary-addons/pvr.njoy/package.mk index 551c8108d8..a81f2c43fb 100644 --- a/packages/mediacenter/kodi-binary-addons/pvr.njoy/package.mk +++ b/packages/mediacenter/kodi-binary-addons/pvr.njoy/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="pvr.njoy" -PKG_VERSION="b5d6565" +PKG_VERSION="3a32276" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi-binary-addons/pvr.octonet/package.mk b/packages/mediacenter/kodi-binary-addons/pvr.octonet/package.mk index 9773b156cb..0fd5a8be53 100644 --- a/packages/mediacenter/kodi-binary-addons/pvr.octonet/package.mk +++ b/packages/mediacenter/kodi-binary-addons/pvr.octonet/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="pvr.octonet" -PKG_VERSION="8549a31" +PKG_VERSION="ff2d4a7" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi-binary-addons/pvr.pctv/package.mk b/packages/mediacenter/kodi-binary-addons/pvr.pctv/package.mk index 9bf0cfcaaa..0fc65c677b 100644 --- a/packages/mediacenter/kodi-binary-addons/pvr.pctv/package.mk +++ b/packages/mediacenter/kodi-binary-addons/pvr.pctv/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="pvr.pctv" -PKG_VERSION="d6d969f" +PKG_VERSION="e829beb" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi-binary-addons/pvr.stalker/package.mk b/packages/mediacenter/kodi-binary-addons/pvr.stalker/package.mk index 3638a9f140..1886ac36d5 100644 --- a/packages/mediacenter/kodi-binary-addons/pvr.stalker/package.mk +++ b/packages/mediacenter/kodi-binary-addons/pvr.stalker/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="pvr.stalker" -PKG_VERSION="168e35f" +PKG_VERSION="fd800fd" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi-binary-addons/pvr.vbox/package.mk b/packages/mediacenter/kodi-binary-addons/pvr.vbox/package.mk index dd3569418c..49ba2cf681 100644 --- a/packages/mediacenter/kodi-binary-addons/pvr.vbox/package.mk +++ b/packages/mediacenter/kodi-binary-addons/pvr.vbox/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="pvr.vbox" -PKG_VERSION="810994a" +PKG_VERSION="4bc6f1e" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi-binary-addons/pvr.vdr.vnsi/package.mk b/packages/mediacenter/kodi-binary-addons/pvr.vdr.vnsi/package.mk index 92d5b6ca3d..27b0d470e9 100644 --- a/packages/mediacenter/kodi-binary-addons/pvr.vdr.vnsi/package.mk +++ b/packages/mediacenter/kodi-binary-addons/pvr.vdr.vnsi/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="pvr.vdr.vnsi" -PKG_VERSION="5b47bd0" +PKG_VERSION="4b06d83" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi-binary-addons/pvr.vuplus/package.mk b/packages/mediacenter/kodi-binary-addons/pvr.vuplus/package.mk index 0f2f6f5189..5301aefe16 100644 --- a/packages/mediacenter/kodi-binary-addons/pvr.vuplus/package.mk +++ b/packages/mediacenter/kodi-binary-addons/pvr.vuplus/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="pvr.vuplus" -PKG_VERSION="7ab30d3" +PKG_VERSION="d2c5442" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi-binary-addons/pvr.wmc/package.mk b/packages/mediacenter/kodi-binary-addons/pvr.wmc/package.mk index 554dd87435..83a48d6ada 100644 --- a/packages/mediacenter/kodi-binary-addons/pvr.wmc/package.mk +++ b/packages/mediacenter/kodi-binary-addons/pvr.wmc/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="pvr.wmc" -PKG_VERSION="d9eac84" +PKG_VERSION="bffb41d" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi-binary-addons/visualization.projectm/package.mk b/packages/mediacenter/kodi-binary-addons/visualization.projectm/package.mk index 1bb8940454..5f37b3532c 100644 --- a/packages/mediacenter/kodi-binary-addons/visualization.projectm/package.mk +++ b/packages/mediacenter/kodi-binary-addons/visualization.projectm/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="visualization.projectm" -PKG_VERSION="dcd7179" +PKG_VERSION="0487ebb" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi-binary-addons/visualization.shadertoy/package.mk b/packages/mediacenter/kodi-binary-addons/visualization.shadertoy/package.mk index f79d5a75f5..bdc5c29b7b 100644 --- a/packages/mediacenter/kodi-binary-addons/visualization.shadertoy/package.mk +++ b/packages/mediacenter/kodi-binary-addons/visualization.shadertoy/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="visualization.shadertoy" -PKG_VERSION="86ced78" +PKG_VERSION="e88fd6e" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi-binary-addons/visualization.spectrum/package.mk b/packages/mediacenter/kodi-binary-addons/visualization.spectrum/package.mk index cdafb4d5e1..1cd0c7f426 100644 --- a/packages/mediacenter/kodi-binary-addons/visualization.spectrum/package.mk +++ b/packages/mediacenter/kodi-binary-addons/visualization.spectrum/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="visualization.spectrum" -PKG_VERSION="34929f0" +PKG_VERSION="b3ed787" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" From 206679a738767e0d173c44b4c394b3ef718460b1 Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Wed, 30 Nov 2016 22:16:21 +0000 Subject: [PATCH 09/11] RBP: Remove obsolete patch --- .../RPi/patches/kodi/kodi-002-backport.patch | 185 ------------------ .../RPi2/patches/kodi/kodi-002-backport.patch | 185 ------------------ 2 files changed, 370 deletions(-) delete mode 100644 projects/RPi/patches/kodi/kodi-002-backport.patch delete mode 100644 projects/RPi2/patches/kodi/kodi-002-backport.patch diff --git a/projects/RPi/patches/kodi/kodi-002-backport.patch b/projects/RPi/patches/kodi/kodi-002-backport.patch deleted file mode 100644 index 3a2beee6ed..0000000000 --- a/projects/RPi/patches/kodi/kodi-002-backport.patch +++ /dev/null @@ -1,185 +0,0 @@ -From 1fc5cd103a26697df63075953d6fd556f39c02bd Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 26 Oct 2016 23:21:43 +0100 -Subject: [PATCH] squash: Restructure the pll adjust code to avoid adjustment - when sync display is disabled - ---- - .../AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 25 ++++++++-------------- - .../Engines/ActiveAE/ActiveAEStream.cpp | 17 ++++++++++++++- - .../AudioEngine/Engines/ActiveAE/ActiveAEStream.h | 3 ++- - xbmc/linux/RBP.cpp | 17 ++++++++++----- - xbmc/linux/RBP.h | 5 +++-- - 5 files changed, 42 insertions(+), 25 deletions(-) - -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -index 497b443..68399ab 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -@@ -34,10 +34,6 @@ using namespace ActiveAE; - #include "windowing/WindowingFactory.h" - #include "utils/log.h" - --#if defined(TARGET_RASPBERRY_PI) --#include "linux/RBP.h" --#endif -- - #define MAX_CACHE_LEVEL 0.4 // total cache time of stream in seconds - #define MAX_WATER_LEVEL 0.2 // buffered time after stream stages in seconds - #define MAX_BUFFER_TIME 0.1 // max time of a buffer in seconds -@@ -2457,21 +2453,18 @@ CSampleBuffer* CActiveAE::SyncStream(CActiveAEStream *stream) - if (!newerror || stream->m_syncState != CAESyncInfo::AESyncState::SYNC_INSYNC) - return ret; - -- if (stream->m_pllAdjust > 0) // pll adjust -- { --#if defined(TARGET_RASPBERRY_PI) -- double e = std::max(std::min(error / 50.0, 1.0), -1.0); -- double m_plladjust = 1.0 + e * stream->m_pllAdjust; -- double m_last_plladjust = g_RBP.AdjustHDMIClock(m_plladjust); -- CLog::Log(LOGDEBUG, "CDVDPlayerAudio::%s pll:%.5f (%.5f) error:%.6f e:%.6f a:%f", __FUNCTION__, m_plladjust, m_last_plladjust, error, e * stream->m_pllAdjust, stream->m_pllAdjust ); --#endif -- } -- else if (stream->m_resampleMode) -+ if (stream->m_resampleMode) - { - if (stream->m_processingBuffers) - { -- stream->m_processingBuffers->SetRR(stream->CalcResampleRatio(error), m_settings.atempoThreshold); -- CLog::Log(LOGDEBUG, "CDVDPlayerAudio::%s rr:%.5f threshold:%.3f error:%.6f", __FUNCTION__, stream->m_processingBuffers->GetRR(), m_settings.atempoThreshold, error); -+ double pllAdjustRequest = 0.0, pllAdjustActual = 0.0, e = 0.0; -+ if (stream->m_pllAdjust > 0.0) -+ { -+ e = std::max(std::min(error / 50.0, 1.0), - 1.0); -+ pllAdjustRequest = 1.0 + e * stream->m_pllAdjust; -+ } -+ stream->m_processingBuffers->SetRR(stream->CalcResampleRatio(error), m_settings.atempoThreshold, pllAdjustRequest, stream->m_pllAdjust, pllAdjustActual); -+ CLog::Log(LOGDEBUG, "ActiveAE::%s pll:%.5f (act:%.5f lim:%.5f) rr:%.5f threshold:%.3f error:%.6f", __FUNCTION__, pllAdjustRequest, pllAdjustActual, stream->m_pllAdjust, stream->m_processingBuffers->GetRR(), m_settings.atempoThreshold, error ); - } - } - else if (stream->m_processingBuffers) -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp -index 394459a..6b009dc 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp -@@ -29,6 +29,10 @@ - #include "ActiveAE.h" - #include "ActiveAEStream.h" - -+#if defined(TARGET_RASPBERRY_PI) -+#include "linux/RBP.h" -+#endif -+ - using namespace ActiveAE; - - /* typecast AE to CActiveAE */ -@@ -71,6 +75,7 @@ CActiveAEStream::CActiveAEStream(AEAudioFormat *format, unsigned int streamid) - m_lastPtsJump = 0; - m_errorInterval = 1000; - m_clockSpeed = 1.0; -+ m_pllAdjust = 0.0f; - } - - CActiveAEStream::~CActiveAEStream() -@@ -715,8 +720,18 @@ bool CActiveAEStreamBuffers::IsDrained() - return false; - } - --void CActiveAEStreamBuffers::SetRR(double rr, double atempoThreshold) -+void CActiveAEStreamBuffers::SetRR(double rr, double atempoThreshold, double pllAdjustRequest, double pllThreshold, double &pllAdjustActual) - { -+#if defined(TARGET_RASPBERRY_PI) -+ if (pllAdjustRequest > 0.0f) // pll adjust -+ { -+ pllAdjustActual = g_RBP.AdjustHDMIClock(pllAdjustRequest); -+ rr = 1.0; -+ } -+ else -+ pllAdjustActual = g_RBP.AdjustHDMIClock(1.0); -+#endif -+ - if (fabs(rr - 1.0) < atempoThreshold) - { - m_resampleBuffers->SetRR(rr); -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.h -index 927f93e..80ab096 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.h -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.h -@@ -103,7 +103,8 @@ class CActiveAEStreamBuffers - void Flush(); - void SetDrain(bool drain); - bool IsDrained(); -- void SetRR(double rr, double atempoThreshold); -+ void SetRR(double rr, double atempoThreshold, double pllAdjustRequest, double pllThreshold, double &pllAdjustActual); -+ void SetRR(double rr, double atempoThreshold) { double pllAdjustActual; SetRR(rr, atempoThreshold, 0.0, 0.0, pllAdjustActual); } - double GetRR(); - void FillBuffer(); - bool DoesNormalize(); -diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp -index 2efc281..5c0fbaf 100644 ---- a/xbmc/linux/RBP.cpp -+++ b/xbmc/linux/RBP.cpp -@@ -49,7 +49,8 @@ CRBP::CRBP() - m_DllBcmHost = new DllBcmHost(); - m_OMX = new COMXCore(); - m_display = DISPMANX_NO_HANDLE; -- m_last_pll_adjust = 1.0; -+ m_requested_pll_adjust = -1.0; -+ m_actual_pll_adjust = -1.0; - m_p = NULL; - m_x = 0; - m_y = 0; -@@ -166,7 +167,8 @@ void CRBP::CloseDisplay(DISPMANX_DISPLAY_HANDLE_T display) - assert(s == 0); - vc_dispmanx_display_close(m_display); - m_display = DISPMANX_NO_HANDLE; -- m_last_pll_adjust = 1.0; -+ m_requested_pll_adjust = -1.0; -+ m_actual_pll_adjust = -1.0; - } - - void CRBP::GetDisplaySize(int &width, int &height) -@@ -529,12 +531,17 @@ void CRBP::uninit_cursor() - double CRBP::AdjustHDMIClock(double adjust) - { - char response[80]; -+ -+ if (adjust == m_requested_pll_adjust) -+ return m_actual_pll_adjust; -+ -+ m_requested_pll_adjust = adjust; - vc_gencmd(response, sizeof response, "hdmi_adjust_clock %f", adjust); - char *p = strchr(response, '='); - if (p) -- m_last_pll_adjust = atof(p+1); -- CLog::Log(LOGDEBUG, "CRBP::%s(%.4f) = %.4f", __func__, adjust, m_last_pll_adjust); -- return m_last_pll_adjust; -+ m_actual_pll_adjust = atof(p+1); -+ CLog::Log(LOGDEBUG, "CRBP::%s(%.5f) = %.5f", __func__, adjust, m_actual_pll_adjust); -+ return m_actual_pll_adjust; - } - - #include "cores/VideoPlayer/DVDClock.h" -diff --git a/xbmc/linux/RBP.h b/xbmc/linux/RBP.h -index 92ed007..9c7f4b1 100644 ---- a/xbmc/linux/RBP.h -+++ b/xbmc/linux/RBP.h -@@ -83,7 +83,7 @@ class CRBP - void VSyncCallback(); - int GetMBox() { return m_mb; } - double AdjustHDMIClock(double adjust); -- double GetAdjustHDMIClock() { return m_last_pll_adjust; } -+ double GetAdjustHDMIClock() { return m_actual_pll_adjust; } - - void SuspendVideoOutput(); - void ResumeVideoOutput(); -@@ -112,7 +112,8 @@ class CRBP - int m_x; - int m_y; - bool m_enabled; -- double m_last_pll_adjust; -+ double m_requested_pll_adjust; -+ double m_actual_pll_adjust; - public: - void init_cursor(); - void set_cursor(const void *pixels, int width, int height, int hotspot_x, int hotspot_y); diff --git a/projects/RPi2/patches/kodi/kodi-002-backport.patch b/projects/RPi2/patches/kodi/kodi-002-backport.patch deleted file mode 100644 index 3a2beee6ed..0000000000 --- a/projects/RPi2/patches/kodi/kodi-002-backport.patch +++ /dev/null @@ -1,185 +0,0 @@ -From 1fc5cd103a26697df63075953d6fd556f39c02bd Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 26 Oct 2016 23:21:43 +0100 -Subject: [PATCH] squash: Restructure the pll adjust code to avoid adjustment - when sync display is disabled - ---- - .../AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 25 ++++++++-------------- - .../Engines/ActiveAE/ActiveAEStream.cpp | 17 ++++++++++++++- - .../AudioEngine/Engines/ActiveAE/ActiveAEStream.h | 3 ++- - xbmc/linux/RBP.cpp | 17 ++++++++++----- - xbmc/linux/RBP.h | 5 +++-- - 5 files changed, 42 insertions(+), 25 deletions(-) - -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -index 497b443..68399ab 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -@@ -34,10 +34,6 @@ using namespace ActiveAE; - #include "windowing/WindowingFactory.h" - #include "utils/log.h" - --#if defined(TARGET_RASPBERRY_PI) --#include "linux/RBP.h" --#endif -- - #define MAX_CACHE_LEVEL 0.4 // total cache time of stream in seconds - #define MAX_WATER_LEVEL 0.2 // buffered time after stream stages in seconds - #define MAX_BUFFER_TIME 0.1 // max time of a buffer in seconds -@@ -2457,21 +2453,18 @@ CSampleBuffer* CActiveAE::SyncStream(CActiveAEStream *stream) - if (!newerror || stream->m_syncState != CAESyncInfo::AESyncState::SYNC_INSYNC) - return ret; - -- if (stream->m_pllAdjust > 0) // pll adjust -- { --#if defined(TARGET_RASPBERRY_PI) -- double e = std::max(std::min(error / 50.0, 1.0), -1.0); -- double m_plladjust = 1.0 + e * stream->m_pllAdjust; -- double m_last_plladjust = g_RBP.AdjustHDMIClock(m_plladjust); -- CLog::Log(LOGDEBUG, "CDVDPlayerAudio::%s pll:%.5f (%.5f) error:%.6f e:%.6f a:%f", __FUNCTION__, m_plladjust, m_last_plladjust, error, e * stream->m_pllAdjust, stream->m_pllAdjust ); --#endif -- } -- else if (stream->m_resampleMode) -+ if (stream->m_resampleMode) - { - if (stream->m_processingBuffers) - { -- stream->m_processingBuffers->SetRR(stream->CalcResampleRatio(error), m_settings.atempoThreshold); -- CLog::Log(LOGDEBUG, "CDVDPlayerAudio::%s rr:%.5f threshold:%.3f error:%.6f", __FUNCTION__, stream->m_processingBuffers->GetRR(), m_settings.atempoThreshold, error); -+ double pllAdjustRequest = 0.0, pllAdjustActual = 0.0, e = 0.0; -+ if (stream->m_pllAdjust > 0.0) -+ { -+ e = std::max(std::min(error / 50.0, 1.0), - 1.0); -+ pllAdjustRequest = 1.0 + e * stream->m_pllAdjust; -+ } -+ stream->m_processingBuffers->SetRR(stream->CalcResampleRatio(error), m_settings.atempoThreshold, pllAdjustRequest, stream->m_pllAdjust, pllAdjustActual); -+ CLog::Log(LOGDEBUG, "ActiveAE::%s pll:%.5f (act:%.5f lim:%.5f) rr:%.5f threshold:%.3f error:%.6f", __FUNCTION__, pllAdjustRequest, pllAdjustActual, stream->m_pllAdjust, stream->m_processingBuffers->GetRR(), m_settings.atempoThreshold, error ); - } - } - else if (stream->m_processingBuffers) -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp -index 394459a..6b009dc 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp -@@ -29,6 +29,10 @@ - #include "ActiveAE.h" - #include "ActiveAEStream.h" - -+#if defined(TARGET_RASPBERRY_PI) -+#include "linux/RBP.h" -+#endif -+ - using namespace ActiveAE; - - /* typecast AE to CActiveAE */ -@@ -71,6 +75,7 @@ CActiveAEStream::CActiveAEStream(AEAudioFormat *format, unsigned int streamid) - m_lastPtsJump = 0; - m_errorInterval = 1000; - m_clockSpeed = 1.0; -+ m_pllAdjust = 0.0f; - } - - CActiveAEStream::~CActiveAEStream() -@@ -715,8 +720,18 @@ bool CActiveAEStreamBuffers::IsDrained() - return false; - } - --void CActiveAEStreamBuffers::SetRR(double rr, double atempoThreshold) -+void CActiveAEStreamBuffers::SetRR(double rr, double atempoThreshold, double pllAdjustRequest, double pllThreshold, double &pllAdjustActual) - { -+#if defined(TARGET_RASPBERRY_PI) -+ if (pllAdjustRequest > 0.0f) // pll adjust -+ { -+ pllAdjustActual = g_RBP.AdjustHDMIClock(pllAdjustRequest); -+ rr = 1.0; -+ } -+ else -+ pllAdjustActual = g_RBP.AdjustHDMIClock(1.0); -+#endif -+ - if (fabs(rr - 1.0) < atempoThreshold) - { - m_resampleBuffers->SetRR(rr); -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.h -index 927f93e..80ab096 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.h -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.h -@@ -103,7 +103,8 @@ class CActiveAEStreamBuffers - void Flush(); - void SetDrain(bool drain); - bool IsDrained(); -- void SetRR(double rr, double atempoThreshold); -+ void SetRR(double rr, double atempoThreshold, double pllAdjustRequest, double pllThreshold, double &pllAdjustActual); -+ void SetRR(double rr, double atempoThreshold) { double pllAdjustActual; SetRR(rr, atempoThreshold, 0.0, 0.0, pllAdjustActual); } - double GetRR(); - void FillBuffer(); - bool DoesNormalize(); -diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp -index 2efc281..5c0fbaf 100644 ---- a/xbmc/linux/RBP.cpp -+++ b/xbmc/linux/RBP.cpp -@@ -49,7 +49,8 @@ CRBP::CRBP() - m_DllBcmHost = new DllBcmHost(); - m_OMX = new COMXCore(); - m_display = DISPMANX_NO_HANDLE; -- m_last_pll_adjust = 1.0; -+ m_requested_pll_adjust = -1.0; -+ m_actual_pll_adjust = -1.0; - m_p = NULL; - m_x = 0; - m_y = 0; -@@ -166,7 +167,8 @@ void CRBP::CloseDisplay(DISPMANX_DISPLAY_HANDLE_T display) - assert(s == 0); - vc_dispmanx_display_close(m_display); - m_display = DISPMANX_NO_HANDLE; -- m_last_pll_adjust = 1.0; -+ m_requested_pll_adjust = -1.0; -+ m_actual_pll_adjust = -1.0; - } - - void CRBP::GetDisplaySize(int &width, int &height) -@@ -529,12 +531,17 @@ void CRBP::uninit_cursor() - double CRBP::AdjustHDMIClock(double adjust) - { - char response[80]; -+ -+ if (adjust == m_requested_pll_adjust) -+ return m_actual_pll_adjust; -+ -+ m_requested_pll_adjust = adjust; - vc_gencmd(response, sizeof response, "hdmi_adjust_clock %f", adjust); - char *p = strchr(response, '='); - if (p) -- m_last_pll_adjust = atof(p+1); -- CLog::Log(LOGDEBUG, "CRBP::%s(%.4f) = %.4f", __func__, adjust, m_last_pll_adjust); -- return m_last_pll_adjust; -+ m_actual_pll_adjust = atof(p+1); -+ CLog::Log(LOGDEBUG, "CRBP::%s(%.5f) = %.5f", __func__, adjust, m_actual_pll_adjust); -+ return m_actual_pll_adjust; - } - - #include "cores/VideoPlayer/DVDClock.h" -diff --git a/xbmc/linux/RBP.h b/xbmc/linux/RBP.h -index 92ed007..9c7f4b1 100644 ---- a/xbmc/linux/RBP.h -+++ b/xbmc/linux/RBP.h -@@ -83,7 +83,7 @@ class CRBP - void VSyncCallback(); - int GetMBox() { return m_mb; } - double AdjustHDMIClock(double adjust); -- double GetAdjustHDMIClock() { return m_last_pll_adjust; } -+ double GetAdjustHDMIClock() { return m_actual_pll_adjust; } - - void SuspendVideoOutput(); - void ResumeVideoOutput(); -@@ -112,7 +112,8 @@ class CRBP - int m_x; - int m_y; - bool m_enabled; -- double m_last_pll_adjust; -+ double m_requested_pll_adjust; -+ double m_actual_pll_adjust; - public: - void init_cursor(); - void set_cursor(const void *pixels, int width, int height, int hotspot_x, int hotspot_y); From 3722f864bd2a489dd63d99084ada66c1b908b250 Mon Sep 17 00:00:00 2001 From: kszaq Date: Wed, 30 Nov 2016 23:14:06 +0100 Subject: [PATCH 10/11] libcec: fix building after update to 4.0.0-3 --- .../aarch64/libcec-00-aocec-support.patch | 803 ------------------ .../libcec/libcec-00-amlogic-support.patch | 167 ++-- .../libcec/libcec-00-amlogic-support.patch | 167 ++-- 3 files changed, 178 insertions(+), 959 deletions(-) delete mode 100644 packages/devel/libcec/patches/aarch64/libcec-00-aocec-support.patch diff --git a/packages/devel/libcec/patches/aarch64/libcec-00-aocec-support.patch b/packages/devel/libcec/patches/aarch64/libcec-00-aocec-support.patch deleted file mode 100644 index b3cd656c99..0000000000 --- a/packages/devel/libcec/patches/aarch64/libcec-00-aocec-support.patch +++ /dev/null @@ -1,803 +0,0 @@ -diff --git a/README.md b/README.md -index dfaf4d6..87491ef 100644 ---- a/README.md -+++ b/README.md -@@ -93,6 +93,12 @@ To compile in support for Exynos devices, you have to pass the argument -DHAVE_E - cmake -DHAVE_EXYNOS_API=1 .. - ``` - -+### AOCEC -+To compile in support for AOCEC devices, you have to pass the argument -DHAVE_AOCEC_API=1 to cmake: -+``` -+cmake -DHAVE_AOCEC_API=1 .. -+``` -+ - ### TDA995x - To compile in support for TDA995x devices, you have to pass the argument -DHAVE_TDA995X_API=1 to cmake: - ``` -diff --git a/include/cectypes.h b/include/cectypes.h -index 0fdd48e..881a805 100644 ---- a/include/cectypes.h -+++ b/include/cectypes.h -@@ -309,6 +309,16 @@ namespace CEC { - #define CEC_EXYNOS_VIRTUAL_COM "Exynos" - - /*! -+ * the path to use for the AOCEC HDMI CEC device -+ */ -+#define CEC_AOCEC_PATH "/dev/aocec" -+ -+/*! -+ * the name of the virtual COM port to use for the AOCEC' CEC wire -+ */ -+#define CEC_AOCEC_VIRTUAL_COM "AOCEC" -+ -+/*! - * Mimimum client version - */ - #define CEC_MIN_LIB_VERSION 3 -@@ -877,7 +887,8 @@ typedef enum cec_adapter_type - ADAPTERTYPE_P8_DAUGHTERBOARD = 0x2, - ADAPTERTYPE_RPI = 0x100, - ADAPTERTYPE_TDA995x = 0x200, -- ADAPTERTYPE_EXYNOS = 0x300 -+ ADAPTERTYPE_EXYNOS = 0x300, -+ ADAPTERTYPE_AOCEC = 0x500 - } cec_adapter_type; - - /** force exporting through swig */ -diff --git a/src/libcec/CMakeLists.txt b/src/libcec/CMakeLists.txt -index a494533..d3eefa3 100644 ---- a/src/libcec/CMakeLists.txt -+++ b/src/libcec/CMakeLists.txt -@@ -87,6 +87,9 @@ set(CEC_HEADERS devices/CECRecordingDevice.h - adapter/Exynos/ExynosCEC.h - adapter/Exynos/ExynosCECAdapterDetection.h - adapter/Exynos/ExynosCECAdapterCommunication.h -+ adapter/AOCEC/AOCEC.h -+ adapter/AOCEC/AOCECAdapterDetection.h -+ adapter/AOCEC/AOCECAdapterCommunication.h - adapter/Pulse-Eight/USBCECAdapterMessageQueue.h - adapter/Pulse-Eight/USBCECAdapterCommunication.h - adapter/Pulse-Eight/USBCECAdapterCommands.h -diff --git a/src/libcec/adapter/AOCEC/AOCEC.h b/src/libcec/adapter/AOCEC/AOCEC.h -new file mode 100644 -index 0000000..560fbdd ---- /dev/null -+++ b/src/libcec/adapter/AOCEC/AOCEC.h -@@ -0,0 +1,55 @@ -+#pragma once -+/* -+ * This file is part of the libCEC(R) library. -+ * -+ * libCEC AOCEC Code Copyright (C) 2016 Gerald Dachs -+ * based heavily on: -+ * libCEC Exynos Code Copyright (C) 2014 Valentin Manea -+ * libCEC(R) is Copyright (C) 2011-2015 Pulse-Eight Limited. All rights reserved. -+ * libCEC(R) is an original work, containing original code. -+ * -+ * libCEC(R) is a trademark of Pulse-Eight Limited. -+ * -+ * This program is dual-licensed; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ * -+ * -+ * Alternatively, you can license this library under a commercial license, -+ * please contact Pulse-Eight Licensing for more information. -+ * -+ * For more information contact: -+ * Pulse-Eight Licensing -+ * http://www.pulse-eight.com/ -+ * http://www.pulse-eight.net/ -+ */ -+ -+ -+#define CEC_DEFAULT_PADDR 0x1000 -+ -+#define CEC_IOC_MAGIC 'C' -+#define CEC_IOC_GET_PHYSICAL_ADDR _IOR(CEC_IOC_MAGIC, 0x00, uint16_t) -+#define CEC_IOC_GET_VERSION _IOR(CEC_IOC_MAGIC, 0x01, int) -+#define CEC_IOC_GET_VENDOR_ID _IOR(CEC_IOC_MAGIC, 0x02, uint32_t) -+#define CEC_IOC_GET_PORT_INFO _IOR(CEC_IOC_MAGIC, 0x03, int) -+#define CEC_IOC_GET_PORT_NUM _IOR(CEC_IOC_MAGIC, 0x04, int) -+#define CEC_IOC_GET_SEND_FAIL_REASON _IOR(CEC_IOC_MAGIC, 0x05, uint32_t) -+#define CEC_IOC_SET_OPTION_WAKEUP _IOW(CEC_IOC_MAGIC, 0x06, uint32_t) -+#define CEC_IOC_SET_OPTION_ENALBE_CEC _IOW(CEC_IOC_MAGIC, 0x07, uint32_t) -+#define CEC_IOC_SET_OPTION_SYS_CTRL _IOW(CEC_IOC_MAGIC, 0x08, uint32_t) -+#define CEC_IOC_SET_OPTION_SET_LANG _IOW(CEC_IOC_MAGIC, 0x09, uint32_t) -+#define CEC_IOC_GET_CONNECT_STATUS _IOR(CEC_IOC_MAGIC, 0x0A, uint32_t) -+#define CEC_IOC_ADD_LOGICAL_ADDR _IOW(CEC_IOC_MAGIC, 0x0B, uint32_t) -+#define CEC_IOC_CLR_LOGICAL_ADDR _IOW(CEC_IOC_MAGIC, 0x0C, uint32_t) -+ -+#define CEC_MAX_FRAME_SIZE 16 -diff --git a/src/libcec/adapter/AOCEC/AOCECAdapterCommunication.cpp b/src/libcec/adapter/AOCEC/AOCECAdapterCommunication.cpp -new file mode 100644 -index 0000000..8edf981 ---- /dev/null -+++ b/src/libcec/adapter/AOCEC/AOCECAdapterCommunication.cpp -@@ -0,0 +1,343 @@ -+/* -+ * This file is part of the libCEC(R) library. -+ * -+ * libCEC AOCEC Code Copyright (C) 2016 Gerald Dachs -+ * based heavily on: -+ * libCEC Exynos Code Copyright (C) 2014 Valentin Manea -+ * libCEC(R) is Copyright (C) 2011-2015 Pulse-Eight Limited. All rights reserved. -+ * libCEC(R) is an original work, containing original code. -+ * -+ * libCEC(R) is a trademark of Pulse-Eight Limited. -+ * -+ * This program is dual-licensed; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ * -+ * -+ * Alternatively, you can license this library under a commercial license, -+ * please contact Pulse-Eight Licensing for more information. -+ * -+ * For more information contact: -+ * Pulse-Eight Licensing -+ * http://www.pulse-eight.com/ -+ * http://www.pulse-eight.net/ -+ */ -+ -+#include "env.h" -+#include -+#include -+ -+ -+#if defined(HAVE_AOCEC_API) -+#include "AOCEC.h" -+#include "AOCECAdapterCommunication.h" -+ -+#include "CECTypeUtils.h" -+#include "LibCEC.h" -+#include -+ -+using namespace CEC; -+using namespace P8PLATFORM; -+ -+#define LIB_CEC m_callback->GetLib() -+ -+ -+CAOCECAdapterCommunication::CAOCECAdapterCommunication(IAdapterCommunicationCallback *callback) : -+ IAdapterCommunication(callback), -+ m_bLogicalAddressChanged(false) -+{ -+ CLockObject lock(m_mutex); -+ -+ m_logicalAddresses.Clear(); -+ m_fd = INVALID_SOCKET_VALUE; -+} -+ -+ -+CAOCECAdapterCommunication::~CAOCECAdapterCommunication(void) -+{ -+ Close(); -+} -+ -+ -+bool CAOCECAdapterCommunication::IsOpen(void) -+{ -+ CLockObject lock(m_mutex); -+ return IsInitialised() && m_fd != INVALID_SOCKET_VALUE; -+} -+ -+ -+bool CAOCECAdapterCommunication::Open(uint32_t UNUSED(iTimeoutMs), bool UNUSED(bSkipChecks), bool bStartListening) -+{ -+ if (IsOpen()) -+ Close(); -+ -+ CLockObject lock(m_mutex); -+ -+ if ((m_fd = open(CEC_AOCEC_PATH, O_RDWR)) > 0) -+ { -+ uint32_t enable = true; -+ -+ if (ioctl(m_fd, CEC_IOC_SET_OPTION_SYS_CTRL, enable)) -+ { -+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL IOCTL CEC_IOC_SET_OPTION_SYS_CTRL failed !", __func__); -+ return false; -+ } -+ -+ if (!bStartListening || CreateThread()) { -+ return true; -+ } -+ close(m_fd); -+ m_fd = INVALID_SOCKET_VALUE; -+ } -+ return false; -+} -+ -+ -+void CAOCECAdapterCommunication::Close(void) -+{ -+ StopThread(0); -+ -+ CLockObject lock(m_mutex); -+ -+ uint32_t enable = false; -+ -+ if (ioctl(m_fd, CEC_IOC_SET_OPTION_SYS_CTRL, enable)) -+ { -+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL CEC_IOC_SET_OPTION_SYS_CTRL failed !", __func__); -+ } -+ -+ close(m_fd); -+ m_fd = INVALID_SOCKET_VALUE; -+} -+ -+ -+std::string CAOCECAdapterCommunication::GetError(void) const -+{ -+ std::string strError(m_strError); -+ return strError; -+} -+ -+int CAOCECAdapterCommunication::getFileDescriptor(void) -+{ -+ CLockObject lock(m_mutex); -+ -+ return m_fd; -+} -+ -+ -+ -+cec_adapter_message_state CAOCECAdapterCommunication::Write( -+ const cec_command &data, bool &UNUSED(bRetry), uint8_t UNUSED(iLineTimeout), bool UNUSED(bIsReply)) -+{ -+ uint8_t buffer[CEC_MAX_FRAME_SIZE]; -+ int32_t size = 1; -+ cec_adapter_message_state rc = ADAPTER_MESSAGE_STATE_ERROR; -+ -+ if (!IsOpen()) -+ return rc; -+ -+ CLockObject lock(m_mutex); -+ -+ if ((size_t)data.parameters.size + data.opcode_set > sizeof(buffer)) -+ { -+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: data size too large !", __func__); -+ return ADAPTER_MESSAGE_STATE_ERROR; -+ } -+ -+ buffer[0] = (data.initiator << 4) | (data.destination & 0x0f); -+ -+ if (data.opcode_set) -+ { -+ buffer[1] = data.opcode; -+ size++; -+ -+ memcpy(&buffer[size], data.parameters.data, data.parameters.size); -+ size += data.parameters.size; -+ } -+ -+ if (write(m_fd, (void *)buffer, size) == size) -+ { -+ rc = ADAPTER_MESSAGE_STATE_SENT_ACKED; -+ } -+ else -+ { -+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: write failed !", __func__); -+ } -+ -+ return rc; -+} -+ -+ -+uint16_t CAOCECAdapterCommunication::GetFirmwareVersion(void) -+{ -+ int version = 0; -+ -+ if (!IsOpen()) -+ return version; -+ -+ CLockObject lock(m_mutex); -+ -+ if (ioctl(m_fd, CEC_IOC_GET_VERSION, &version) < 0) -+ { -+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL CEC_IOC_GET_VERSION failed !", __func__); -+ } -+ return (uint16_t)version; -+} -+ -+ -+cec_vendor_id CAOCECAdapterCommunication::GetVendorId(void) -+{ -+ int vendor_id = CEC_VENDOR_UNKNOWN; -+ -+ if (!IsOpen()) -+ return cec_vendor_id(vendor_id); -+ -+ CLockObject lock(m_mutex); -+ -+ if (ioctl(m_fd, CEC_IOC_GET_VENDOR_ID, &vendor_id) < 0) -+ { -+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL CEC_IOC_GET_VENDOR_ID failed !", __func__); -+ } -+ return cec_vendor_id(vendor_id); -+} -+ -+ -+uint16_t CAOCECAdapterCommunication::GetPhysicalAddress(void) -+{ -+ int phys_addr = CEC_DEFAULT_PADDR; -+ -+ if (!IsOpen()) -+ return (uint16_t)phys_addr; -+ -+ CLockObject lock(m_mutex); -+ -+ if (ioctl(m_fd, CEC_IOC_GET_PHYSICAL_ADDR, &phys_addr) < 0) -+ { -+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL CEC_IOC_GET_PHYSICAL_ADDR failed !", __func__); -+ phys_addr = CEC_DEFAULT_PADDR; -+ } -+ return (uint16_t)phys_addr; -+} -+ -+ -+cec_logical_addresses CAOCECAdapterCommunication::GetLogicalAddresses(void) -+{ -+ return m_logicalAddresses; -+} -+ -+ -+bool CAOCECAdapterCommunication::SetLogicalAddresses(const cec_logical_addresses &addresses) -+{ -+ unsigned int log_addr = addresses.primary; -+ if (!IsOpen()) -+ return false; -+ -+ CLockObject lock(m_mutex); -+ -+ if (ioctl(m_fd, CEC_IOC_ADD_LOGICAL_ADDR, log_addr)) -+ { -+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL CEC_IOC_ADD_LOGICAL_ADDR failed !", __func__); -+ return false; -+ } -+ m_logicalAddresses = addresses; -+ m_bLogicalAddressChanged = true; -+ -+ return true; -+} -+ -+ -+void CAOCECAdapterCommunication::HandleLogicalAddressLost(cec_logical_address UNUSED(oldAddress)) -+{ -+ unsigned int log_addr = CECDEVICE_BROADCAST; -+ -+ if (!IsOpen()) -+ return; -+ -+ CLockObject lock(m_mutex); -+ -+ if (ioctl(m_fd, CEC_IOC_ADD_LOGICAL_ADDR, log_addr)) -+ { -+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL CEC_IOC_ADD_LOGICAL_ADDR failed !", __func__); -+ } -+} -+ -+ -+void *CAOCECAdapterCommunication::Process(void) -+{ -+ uint8_t buffer[CEC_MAX_FRAME_SIZE]; -+ uint32_t size; -+ fd_set rfds; -+ cec_logical_address initiator, destination; -+ struct timeval tv; -+ -+ if (!IsOpen()) -+ return 0; -+ -+ while (!IsStopped()) -+ { -+ int fd = getFileDescriptor(); -+ -+ if (fd == INVALID_SOCKET_VALUE) -+ { -+ break; -+ } -+ -+ FD_ZERO(&rfds); -+ FD_SET(fd, &rfds); -+ -+ tv.tv_sec = 1; -+ tv.tv_usec = 0; -+ -+ if (select(fd + 1, &rfds, NULL, NULL, &tv) >= 0 ) -+ { -+ -+ if (!FD_ISSET(fd, &rfds)) -+ continue; -+ -+ size = read(fd, buffer, CEC_MAX_FRAME_SIZE); -+ -+ if (size > 0) -+ { -+#if 0 // currently unused -+ if (buffer[0] == 0xff) // driver wants us to reread the physical address -+ { -+ if (!IsStopped()) -+ { -+ uint16_t iNewAddress = GetPhysicalAddress(); -+ m_callback->HandlePhysicalAddressChanged(iNewAddress); -+ } -+ continue; -+ } -+#endif -+ initiator = cec_logical_address(buffer[0] >> 4); -+ destination = cec_logical_address(buffer[0] & 0x0f); -+ -+ cec_command cmd; -+ -+ cec_command::Format( -+ cmd, initiator, destination, -+ ( size > 1 ) ? cec_opcode(buffer[1]) : CEC_OPCODE_NONE); -+ -+ for( uint8_t i = 2; i < size; i++ ) -+ cmd.parameters.PushBack(buffer[i]); -+ -+ if (!IsStopped()) -+ m_callback->OnCommandReceived(cmd); -+ } -+ } -+ } -+ -+ return 0; -+} -+ -+#endif // HAVE_AOCEC_API -diff --git a/src/libcec/adapter/AOCEC/AOCECAdapterCommunication.h b/src/libcec/adapter/AOCEC/AOCECAdapterCommunication.h -new file mode 100644 -index 0000000..f6a8a4a ---- /dev/null -+++ b/src/libcec/adapter/AOCEC/AOCECAdapterCommunication.h -@@ -0,0 +1,105 @@ -+#pragma once -+/* -+ * This file is part of the libCEC(R) library. -+ * -+ * libCEC AOCEC Code Copyright (C) 2016 Gerald Dachs -+ * based heavily on: -+ * libCEC Exynos Code Copyright (C) 2014 Valentin Manea -+ * libCEC(R) is Copyright (C) 2011-2015 Pulse-Eight Limited. All rights reserved. -+ * libCEC(R) is an original work, containing original code. -+ * -+ * libCEC(R) is a trademark of Pulse-Eight Limited. -+ * -+ * This program is dual-licensed; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ * -+ * -+ * Alternatively, you can license this library under a commercial license, -+ * please contact Pulse-Eight Licensing for more information. -+ * -+ * For more information contact: -+ * Pulse-Eight Licensing -+ * http://www.pulse-eight.com/ -+ * http://www.pulse-eight.net/ -+ */ -+ -+#include "env.h" -+ -+#if defined(HAVE_AOCEC_API) -+ -+#include -+#include -+#include "../AdapterCommunication.h" -+#include -+ -+namespace CEC -+{ -+ class CAOCECAdapterCommunication : public IAdapterCommunication, public P8PLATFORM::CThread -+ { -+ public: -+ /*! -+ * @brief Create a new Exynos HDMI CEC communication handler. -+ * @param callback The callback to use for incoming CEC commands. -+ */ -+ CAOCECAdapterCommunication(IAdapterCommunicationCallback *callback); -+ virtual ~CAOCECAdapterCommunication(void); -+ -+ /** @name IAdapterCommunication implementation */ -+ ///{ -+ bool Open(uint32_t iTimeoutMs = CEC_DEFAULT_CONNECT_TIMEOUT, bool bSkipChecks = false, bool bStartListening = true); -+ void Close(void); -+ bool IsOpen(void); -+ std::string GetError(void) const; -+ cec_adapter_message_state Write(const cec_command &data, bool &bRetry, uint8_t iLineTimeout, bool bIsReply); -+ -+ bool SetLineTimeout(uint8_t UNUSED(iTimeout)) { return true; } -+ bool StartBootloader(void) { return false; } -+ bool SetLogicalAddresses(const cec_logical_addresses &addresses); -+ cec_logical_addresses GetLogicalAddresses(void); -+ bool PingAdapter(void) { return IsInitialised(); } -+ uint16_t GetFirmwareVersion(void); -+ uint32_t GetFirmwareBuildDate(void) { return 0; } -+ bool IsRunningLatestFirmware(void) { return true; } -+ bool PersistConfiguration(const libcec_configuration & UNUSED(configuration)) { return false; } -+ bool GetConfiguration(libcec_configuration & UNUSED(configuration)) { return false; } -+ std::string GetPortName(void) { return std::string("AOCEC"); } -+ uint16_t GetPhysicalAddress(void); -+ bool SetControlledMode(bool UNUSED(controlled)) { return true; } -+ cec_vendor_id GetVendorId(void); -+ bool SupportsSourceLogicalAddress(const cec_logical_address address) { return address > CECDEVICE_TV && address <= CECDEVICE_BROADCAST; } -+ cec_adapter_type GetAdapterType(void) { return ADAPTERTYPE_AOCEC; } -+ uint16_t GetAdapterVendorId(void) const { return 1; } -+ uint16_t GetAdapterProductId(void) const { return 1; } -+ void HandleLogicalAddressLost(cec_logical_address oldAddress); -+ void SetActiveSource(bool UNUSED(bSetTo), bool UNUSED(bClientUnregistered)) {} -+ ///} -+ -+ /** @name P8PLATFORM::CThread implementation */ -+ ///{ -+ void *Process(void); -+ ///} -+ -+ private: -+ bool IsInitialised(void) const { return 1; }; -+ int getFileDescriptor(void); -+ -+ std::string m_strError; /**< current error message */ -+ -+ bool m_bLogicalAddressChanged; -+ cec_logical_addresses m_logicalAddresses; -+ P8PLATFORM::CMutex m_mutex; -+ int m_fd; -+ }; -+}; -+#endif -diff --git a/src/libcec/adapter/AOCEC/AOCECAdapterDetection.cpp b/src/libcec/adapter/AOCEC/AOCECAdapterDetection.cpp -new file mode 100644 -index 0000000..55f3ee0 ---- /dev/null -+++ b/src/libcec/adapter/AOCEC/AOCECAdapterDetection.cpp -@@ -0,0 +1,50 @@ -+/* -+ * This file is part of the libCEC(R) library. -+ * -+ * libCEC AOCEC Code Copyright (C) 2016 Gerald Dachs -+ * based heavily on: -+ * libCEC Exynos Code Copyright (C) 2014 Valentin Manea -+ * libCEC(R) is Copyright (C) 2011-2015 Pulse-Eight Limited. All rights reserved. -+ * libCEC(R) is an original work, containing original code. -+ * -+ * libCEC(R) is a trademark of Pulse-Eight Limited. -+ * -+ * This program is dual-licensed; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ * -+ * -+ * Alternatively, you can license this library under a commercial license, -+ * please contact Pulse-Eight Licensing for more information. -+ * -+ * For more information contact: -+ * Pulse-Eight Licensing -+ * http://www.pulse-eight.com/ -+ * http://www.pulse-eight.net/ -+ */ -+ -+#include "env.h" -+#include -+ -+#if defined(HAVE_AOCEC_API) -+#include "AOCECAdapterDetection.h" -+#include "AOCEC.h" -+ -+using namespace CEC; -+ -+bool CAOCECAdapterDetection::FindAdapter(void) -+{ -+ return access(CEC_AOCEC_PATH, 0) == 0; -+} -+ -+#endif -diff --git a/src/libcec/adapter/AOCEC/AOCECAdapterDetection.h b/src/libcec/adapter/AOCEC/AOCECAdapterDetection.h -new file mode 100644 -index 0000000..cacaa19 ---- /dev/null -+++ b/src/libcec/adapter/AOCEC/AOCECAdapterDetection.h -@@ -0,0 +1,46 @@ -+#pragma once -+/* -+ * This file is part of the libCEC(R) library. -+ * -+ * libCEC AOCEC Code Copyright (C) 2016 Gerald Dachs -+ * based heavily on: -+ * libCEC Exynos Code Copyright (C) 2014 Valentin Manea -+ * libCEC(R) is Copyright (C) 2011-2015 Pulse-Eight Limited. All rights reserved. -+ * libCEC(R) is an original work, containing original code. -+ * -+ * libCEC(R) is a trademark of Pulse-Eight Limited. -+ * -+ * This program is dual-licensed; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ * -+ * -+ * Alternatively, you can license this library under a commercial license, -+ * please contact Pulse-Eight Licensing for more information. -+ * -+ * For more information contact: -+ * Pulse-Eight Licensing -+ * http://www.pulse-eight.com/ -+ * http://www.pulse-eight.net/ -+ */ -+ -+#include "env.h" -+ -+namespace CEC -+{ -+ class CAOCECAdapterDetection -+ { -+ public: -+ static bool FindAdapter(void); -+ }; -+} -diff --git a/src/libcec/adapter/AdapterFactory.cpp b/src/libcec/adapter/AdapterFactory.cpp -index da05725..1e946e6 100644 ---- a/src/libcec/adapter/AdapterFactory.cpp -+++ b/src/libcec/adapter/AdapterFactory.cpp -@@ -58,6 +58,11 @@ - #include "Exynos/ExynosCECAdapterCommunication.h" - #endif - -+#if defined(HAVE_AOCEC_API) -+#include "AOCEC/AOCECAdapterDetection.h" -+#include "AOCEC/AOCECAdapterCommunication.h" -+#endif -+ - using namespace CEC; - - int8_t CAdapterFactory::FindAdapters(cec_adapter *deviceList, uint8_t iBufSize, const char *strDevicePath /* = NULL */) -@@ -126,8 +131,20 @@ int8_t CAdapterFactory::DetectAdapters(cec_adapter_descriptor *deviceList, uint8 - } - #endif - -+#if defined(HAVE_AOCEC_API) -+ if (iAdaptersFound < iBufSize && CAOCECAdapterDetection::FindAdapter()) -+ { -+ snprintf(deviceList[iAdaptersFound].strComPath, sizeof(deviceList[iAdaptersFound].strComPath), CEC_AOCEC_PATH); -+ snprintf(deviceList[iAdaptersFound].strComName, sizeof(deviceList[iAdaptersFound].strComName), CEC_AOCEC_VIRTUAL_COM); -+ deviceList[iAdaptersFound].iVendorId = 0; -+ deviceList[iAdaptersFound].iProductId = 0; -+ deviceList[iAdaptersFound].adapterType = ADAPTERTYPE_AOCEC; -+ iAdaptersFound++; -+ } -+#endif -+ - --#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) -+#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) && !defined(HAVE_AOCEC_API) - #error "libCEC doesn't have support for any type of adapter. please check your build system or configuration" - #endif - -@@ -146,6 +163,11 @@ IAdapterCommunication *CAdapterFactory::GetInstance(const char *strPort, uint16_ - return new CExynosCECAdapterCommunication(m_lib->m_cec); - #endif - -+#if defined(HAVE_AOCEC_API) -+ if (!strcmp(strPort, CEC_AOCEC_VIRTUAL_COM)) -+ return new CAOCECAdapterCommunication(m_lib->m_cec); -+#endif -+ - #if defined(HAVE_RPI_API) - if (!strcmp(strPort, CEC_RPI_VIRTUAL_COM)) - return new CRPiCECAdapterCommunication(m_lib->m_cec); -diff --git a/src/libcec/cmake/CheckPlatformSupport.cmake b/src/libcec/cmake/CheckPlatformSupport.cmake -index b8a16c8..93a97e6 100644 ---- a/src/libcec/cmake/CheckPlatformSupport.cmake -+++ b/src/libcec/cmake/CheckPlatformSupport.cmake -@@ -9,6 +9,7 @@ - # HAVE_RPI_API 1 if Raspberry Pi is supported - # HAVE_TDA995X_API 1 if TDA995X is supported - # HAVE_EXYNOS_API 1 if Exynos is supported -+# HAVE_AOCEC_API 1 if AOCEC is supported - # HAVE_P8_USB 1 if Pulse-Eight devices are supported - # HAVE_P8_USB_DETECT 1 if Pulse-Eight devices can be auto-detected - # HAVE_DRM_EDID_PARSER 1 if DRM EDID parsing is supported -@@ -132,6 +133,18 @@ else() - else() - set(HAVE_EXYNOS_API 0) - endif() -+ -+ # AOCEC -+ if (${HAVE_AOCEC_API}) -+ set(LIB_INFO "${LIB_INFO}, AOCEC") -+ set(HAVE_AOCEC_API 1) -+ set(CEC_SOURCES_ADAPTER_AOCEC adapter/AOCEC/AOCECAdapterDetection.cpp -+ adapter/AOCEC/AOCECAdapterCommunication.cpp) -+ source_group("Source Files\\adapter\\AOCEC" FILES ${CEC_SOURCES_ADAPTER_AOCEC}) -+ list(APPEND CEC_SOURCES ${CEC_SOURCES_ADAPTER_AOCEC}) -+ else() -+ set(HAVE_AOCEC_API 0) -+ endif() - endif() - - # rt -diff --git a/src/libcec/cmake/DisplayPlatformSupport.cmake b/src/libcec/cmake/DisplayPlatformSupport.cmake -index 9dcaacf..7ec10f5 100644 ---- a/src/libcec/cmake/DisplayPlatformSupport.cmake -+++ b/src/libcec/cmake/DisplayPlatformSupport.cmake -@@ -44,6 +44,12 @@ else() - message(STATUS "DRM support: no") - endif() - -+if (HAVE_AOCEC_API) -+ message(STATUS "AOCEC support: yes") -+else() -+ message(STATUS "AOCEC support: no") -+endif() -+ - if (HAVE_PYTHON) - message(STATUS "Python support: version ${PYTHONLIBS_VERSION_STRING} (${PYTHON_VERSION})") - else() -diff --git a/src/libcec/env.h.in b/src/libcec/env.h.in -index 0496aa0..fe6c83d 100644 ---- a/src/libcec/env.h.in -+++ b/src/libcec/env.h.in -@@ -72,6 +72,9 @@ - /* Define to 1 for Exynos support */ - #cmakedefine HAVE_EXYNOS_API @HAVE_EXYNOS_API@ - -+/* Define to 1 for AOCEC support */ -+#cmakedefine HAVE_AOCEC_API @HAVE_AOCEC_API@ -+ - /* Define to 1 for nVidia EDID parsing support (on selected models) */ - #cmakedefine HAVE_NVIDIA_EDID_PARSER @HAVE_NVIDIA_EDID_PARSER@ - diff --git a/projects/WeTek_Core/patches/libcec/libcec-00-amlogic-support.patch b/projects/WeTek_Core/patches/libcec/libcec-00-amlogic-support.patch index 02bedc7b9a..98ee13a51d 100644 --- a/projects/WeTek_Core/patches/libcec/libcec-00-amlogic-support.patch +++ b/projects/WeTek_Core/patches/libcec/libcec-00-amlogic-support.patch @@ -1,67 +1,76 @@ -diff --git a/README.md b/README.md -index dfaf4d6..0dffdcf 100644 ---- a/README.md -+++ b/README.md -@@ -93,6 +93,12 @@ To compile in support for Exynos devices, you have to pass the argument -DHAVE_E - cmake -DHAVE_EXYNOS_API=1 .. - ``` - -+### Amlogic -+To compile in support for Amlogic devices, you have to pass the argument -DHAVE_AMLOGIC_API=1 to cmake: -+``` -+cmake -DHAVE_AMLOGIC_API=1 .. -+``` -+ - ### TDA995x - To compile in support for TDA995x devices, you have to pass the argument -DHAVE_TDA995X_API=1 to cmake: - ``` +From b11257f5821e2f0bde0833d54697aa8ef7085065 Mon Sep 17 00:00:00 2001 +From: Gerald Dachs +Date: Thu, 3 Mar 2016 09:38:44 +0100 +Subject: [PATCH] new adapter for amlogic devices + +--- + include/cectypes.h | 15 +- + src/libcec/CMakeLists.txt | 3 + + src/libcec/adapter/AdapterFactory.cpp | 24 +- + src/libcec/adapter/Amlogic/AmlogicCEC.h | 41 +++ + .../Amlogic/AmlogicCECAdapterCommunication.cpp | 305 +++++++++++++++++++++ + .../Amlogic/AmlogicCECAdapterCommunication.h | 105 +++++++ + .../adapter/Amlogic/AmlogicCECAdapterDetection.cpp | 50 ++++ + .../adapter/Amlogic/AmlogicCECAdapterDetection.h | 46 ++++ + src/libcec/cmake/CheckPlatformSupport.cmake | 13 + + src/libcec/cmake/DisplayPlatformSupport.cmake | 6 + + src/libcec/env.h.in | 3 + + 11 files changed, 609 insertions(+), 2 deletions(-) + create mode 100644 src/libcec/adapter/Amlogic/AmlogicCEC.h + create mode 100644 src/libcec/adapter/Amlogic/AmlogicCECAdapterCommunication.cpp + create mode 100644 src/libcec/adapter/Amlogic/AmlogicCECAdapterCommunication.h + create mode 100644 src/libcec/adapter/Amlogic/AmlogicCECAdapterDetection.cpp + create mode 100644 src/libcec/adapter/Amlogic/AmlogicCECAdapterDetection.h + diff --git a/include/cectypes.h b/include/cectypes.h -index 0fdd48e..b7e1932 100644 +index 9c91842..1bc7b52 100644 --- a/include/cectypes.h +++ b/include/cectypes.h -@@ -309,6 +309,16 @@ namespace CEC { +@@ -276,6 +276,18 @@ namespace CEC { + */ #define CEC_EXYNOS_VIRTUAL_COM "Exynos" - /*! ++/*! + * the path to use for the Amlogic HDMI CEC device + */ -+#define CEC_AMLOGIC_PATH "/dev/AmlogicCEC" ++#define CEC_AMLOGIC_PATH "/dev/AmlogicCEC" + +/*! + * the name of the virtual COM port to use for the AMLOGIC' CEC wire + */ -+#define CEC_AMLOGIC_VIRTUAL_COM "Amlogic" ++#define CEC_AMLOGIC_VIRTUAL_COM "Amlogic" + +/*! - * Mimimum client version ++ + /** + * Maximum size of a data packet */ - #define CEC_MIN_LIB_VERSION 3 -@@ -877,7 +887,8 @@ typedef enum cec_adapter_type - ADAPTERTYPE_P8_DAUGHTERBOARD = 0x2, +@@ -861,7 +873,8 @@ typedef enum cec_adapter_type ADAPTERTYPE_RPI = 0x100, ADAPTERTYPE_TDA995x = 0x200, -- ADAPTERTYPE_EXYNOS = 0x300 -+ ADAPTERTYPE_EXYNOS = 0x300, -+ ADAPTERTYPE_AMLOGIC = 0x500 + ADAPTERTYPE_EXYNOS = 0x300, +- ADAPTERTYPE_AOCEC = 0x500 ++ ADAPTERTYPE_AOCEC = 0x500, ++ ADAPTERTYPE_AMLOGIC = 0x600 } cec_adapter_type; /** force exporting through swig */ diff --git a/src/libcec/CMakeLists.txt b/src/libcec/CMakeLists.txt -index a494533..e94b094 100644 +index d3eefa3..125512b 100644 --- a/src/libcec/CMakeLists.txt +++ b/src/libcec/CMakeLists.txt @@ -87,6 +87,9 @@ set(CEC_HEADERS devices/CECRecordingDevice.h adapter/Exynos/ExynosCEC.h adapter/Exynos/ExynosCECAdapterDetection.h adapter/Exynos/ExynosCECAdapterCommunication.h -+ adapter/Amlogic/AmlogicCEC.h ++ adapter/Amlogic/AmlogicCEC.h + adapter/Amlogic/AmlogicCECAdapterDetection.h + adapter/Amlogic/AmlogicCECAdapterCommunication.h - adapter/Pulse-Eight/USBCECAdapterMessageQueue.h - adapter/Pulse-Eight/USBCECAdapterCommunication.h - adapter/Pulse-Eight/USBCECAdapterCommands.h + adapter/AOCEC/AOCEC.h + adapter/AOCEC/AOCECAdapterDetection.h + adapter/AOCEC/AOCECAdapterCommunication.h diff --git a/src/libcec/adapter/AdapterFactory.cpp b/src/libcec/adapter/AdapterFactory.cpp -index da05725..824c5ff 100644 +index 1e946e6..7c26214 100644 --- a/src/libcec/adapter/AdapterFactory.cpp +++ b/src/libcec/adapter/AdapterFactory.cpp @@ -58,6 +58,11 @@ @@ -73,10 +82,10 @@ index da05725..824c5ff 100644 +#include "Amlogic/AmlogicCECAdapterCommunication.h" +#endif + - using namespace CEC; - - int8_t CAdapterFactory::FindAdapters(cec_adapter *deviceList, uint8_t iBufSize, const char *strDevicePath /* = NULL */) -@@ -126,8 +131,20 @@ int8_t CAdapterFactory::DetectAdapters(cec_adapter_descriptor *deviceList, uint8 + #if defined(HAVE_AOCEC_API) + #include "AOCEC/AOCECAdapterDetection.h" + #include "AOCEC/AOCECAdapterCommunication.h" +@@ -143,6 +148,18 @@ int8_t CAdapterFactory::DetectAdapters(cec_adapter_descriptor *deviceList, uint8 } #endif @@ -93,23 +102,22 @@ index da05725..824c5ff 100644 +#endif + --#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) -+#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) && !defined(HAVE_AMLOGIC_API) + #if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) && !defined(HAVE_AOCEC_API) #error "libCEC doesn't have support for any type of adapter. please check your build system or configuration" +@@ -177,7 +194,12 @@ IAdapterCommunication *CAdapterFactory::GetInstance(const char *strPort, uint16_ + return new CUSBCECAdapterCommunication(m_lib->m_cec, strPort, iBaudRate); #endif -@@ -146,6 +163,11 @@ IAdapterCommunication *CAdapterFactory::GetInstance(const char *strPort, uint16_ - return new CExynosCECAdapterCommunication(m_lib->m_cec); - #endif - +-#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) && !defined(HAVE_EXYNOS_API) +#if defined(HAVE_AMLOGIC_API) + if (!strcmp(strPort, CEC_AMLOGIC_VIRTUAL_COM)) + return new CAmlogicCECAdapterCommunication(m_lib->m_cec); +#endif + - #if defined(HAVE_RPI_API) - if (!strcmp(strPort, CEC_RPI_VIRTUAL_COM)) - return new CRPiCECAdapterCommunication(m_lib->m_cec); ++#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) && !defined(HAVE_EXYNOS_API) && !defined(HAVE_AMLOGIC_API) + return NULL; + #endif + } diff --git a/src/libcec/adapter/Amlogic/AmlogicCEC.h b/src/libcec/adapter/Amlogic/AmlogicCEC.h new file mode 100644 index 0000000..7b86982 @@ -162,7 +170,7 @@ new file mode 100644 index 0000000..5aeddda --- /dev/null +++ b/src/libcec/adapter/Amlogic/AmlogicCECAdapterCommunication.cpp -@@ -0,0 +1,305 @@ +@@ -0,0 +1,306 @@ +/* + * This file is part of the libCEC(R) library. + * @@ -417,7 +425,8 @@ index 0000000..5aeddda + + if (fd == INVALID_SOCKET_VALUE) + { -+ break; ++ Sleep(250); ++ continue; + } + + FD_ZERO(&rfds); @@ -688,22 +697,21 @@ index 0000000..8a7418d + }; +} diff --git a/src/libcec/cmake/CheckPlatformSupport.cmake b/src/libcec/cmake/CheckPlatformSupport.cmake -index b8a16c8..311cb52 100644 +index 532f213..382c39c 100644 --- a/src/libcec/cmake/CheckPlatformSupport.cmake +++ b/src/libcec/cmake/CheckPlatformSupport.cmake -@@ -9,6 +9,7 @@ - # HAVE_RPI_API 1 if Raspberry Pi is supported - # HAVE_TDA995X_API 1 if TDA995X is supported - # HAVE_EXYNOS_API 1 if Exynos is supported -+# HAVE_AMLOGIC_API 1 if Amlogic is supported - # HAVE_P8_USB 1 if Pulse-Eight devices are supported - # HAVE_P8_USB_DETECT 1 if Pulse-Eight devices can be auto-detected - # HAVE_DRM_EDID_PARSER 1 if DRM EDID parsing is supported -@@ -132,6 +133,18 @@ else() - else() - set(HAVE_EXYNOS_API 0) +@@ -11,6 +11,7 @@ + # HAVE_EXYNOS_API ON if Exynos is supported + # HAVE_AOCEC_API ON if AOCEC is supported + # HAVE_P8_USB ON if Pulse-Eight devices are supported ++# HAVE_AMLOGIC_API 1 if AMLOGIC is supported + # HAVE_P8_USB_DETECT ON if Pulse-Eight devices can be auto-detected + # HAVE_DRM_EDID_PARSER ON if DRM EDID parsing is supported + # +@@ -137,6 +138,18 @@ else() + list(APPEND CEC_SOURCES ${CEC_SOURCES_ADAPTER_EXYNOS}) endif() -+ + + # Amlogic + if (${HAVE_AMLOGIC_API}) + set(LIB_INFO "${LIB_INFO}, Amlogic") @@ -715,15 +723,16 @@ index b8a16c8..311cb52 100644 + else() + set(HAVE_AMLOGIC_API 0) + endif() - endif() - - # rt ++ + # AOCEC + if (${HAVE_AOCEC_API}) + set(LIB_INFO "${LIB_INFO}, AOCEC") diff --git a/src/libcec/cmake/DisplayPlatformSupport.cmake b/src/libcec/cmake/DisplayPlatformSupport.cmake -index 9dcaacf..464252e 100644 +index 7ec10f5..7a38d32 100644 --- a/src/libcec/cmake/DisplayPlatformSupport.cmake +++ b/src/libcec/cmake/DisplayPlatformSupport.cmake -@@ -44,6 +44,12 @@ else() - message(STATUS "DRM support: no") +@@ -56,5 +56,11 @@ else() + message(STATUS "Python support: no") endif() +if (HAVE_AMLOGIC_API) @@ -732,20 +741,22 @@ index 9dcaacf..464252e 100644 + message(STATUS "Amlogic support: no") +endif() + - if (HAVE_PYTHON) - message(STATUS "Python support: version ${PYTHONLIBS_VERSION_STRING} (${PYTHON_VERSION})") - else() + message(STATUS "lib info: ${LIB_INFO}") + diff --git a/src/libcec/env.h.in b/src/libcec/env.h.in -index 0496aa0..971f769 100644 +index fe6c83d..09304e1 100644 --- a/src/libcec/env.h.in +++ b/src/libcec/env.h.in -@@ -72,6 +72,9 @@ - /* Define to 1 for Exynos support */ - #cmakedefine HAVE_EXYNOS_API @HAVE_EXYNOS_API@ +@@ -78,6 +78,9 @@ + /* Define to 1 for nVidia EDID parsing support (on selected models) */ + #cmakedefine HAVE_NVIDIA_EDID_PARSER @HAVE_NVIDIA_EDID_PARSER@ +/* Define to 1 for Amlogic support */ +#cmakedefine HAVE_AMLOGIC_API @HAVE_AMLOGIC_API@ + - /* Define to 1 for nVidia EDID parsing support (on selected models) */ - #cmakedefine HAVE_NVIDIA_EDID_PARSER @HAVE_NVIDIA_EDID_PARSER@ + /* Define to 1 for DRM EDID parsing support */ + #cmakedefine HAVE_DRM_EDID_PARSER @HAVE_DRM_EDID_PARSER@ +-- +2.7.4 + diff --git a/projects/WeTek_Play/patches/libcec/libcec-00-amlogic-support.patch b/projects/WeTek_Play/patches/libcec/libcec-00-amlogic-support.patch index 02bedc7b9a..98ee13a51d 100644 --- a/projects/WeTek_Play/patches/libcec/libcec-00-amlogic-support.patch +++ b/projects/WeTek_Play/patches/libcec/libcec-00-amlogic-support.patch @@ -1,67 +1,76 @@ -diff --git a/README.md b/README.md -index dfaf4d6..0dffdcf 100644 ---- a/README.md -+++ b/README.md -@@ -93,6 +93,12 @@ To compile in support for Exynos devices, you have to pass the argument -DHAVE_E - cmake -DHAVE_EXYNOS_API=1 .. - ``` - -+### Amlogic -+To compile in support for Amlogic devices, you have to pass the argument -DHAVE_AMLOGIC_API=1 to cmake: -+``` -+cmake -DHAVE_AMLOGIC_API=1 .. -+``` -+ - ### TDA995x - To compile in support for TDA995x devices, you have to pass the argument -DHAVE_TDA995X_API=1 to cmake: - ``` +From b11257f5821e2f0bde0833d54697aa8ef7085065 Mon Sep 17 00:00:00 2001 +From: Gerald Dachs +Date: Thu, 3 Mar 2016 09:38:44 +0100 +Subject: [PATCH] new adapter for amlogic devices + +--- + include/cectypes.h | 15 +- + src/libcec/CMakeLists.txt | 3 + + src/libcec/adapter/AdapterFactory.cpp | 24 +- + src/libcec/adapter/Amlogic/AmlogicCEC.h | 41 +++ + .../Amlogic/AmlogicCECAdapterCommunication.cpp | 305 +++++++++++++++++++++ + .../Amlogic/AmlogicCECAdapterCommunication.h | 105 +++++++ + .../adapter/Amlogic/AmlogicCECAdapterDetection.cpp | 50 ++++ + .../adapter/Amlogic/AmlogicCECAdapterDetection.h | 46 ++++ + src/libcec/cmake/CheckPlatformSupport.cmake | 13 + + src/libcec/cmake/DisplayPlatformSupport.cmake | 6 + + src/libcec/env.h.in | 3 + + 11 files changed, 609 insertions(+), 2 deletions(-) + create mode 100644 src/libcec/adapter/Amlogic/AmlogicCEC.h + create mode 100644 src/libcec/adapter/Amlogic/AmlogicCECAdapterCommunication.cpp + create mode 100644 src/libcec/adapter/Amlogic/AmlogicCECAdapterCommunication.h + create mode 100644 src/libcec/adapter/Amlogic/AmlogicCECAdapterDetection.cpp + create mode 100644 src/libcec/adapter/Amlogic/AmlogicCECAdapterDetection.h + diff --git a/include/cectypes.h b/include/cectypes.h -index 0fdd48e..b7e1932 100644 +index 9c91842..1bc7b52 100644 --- a/include/cectypes.h +++ b/include/cectypes.h -@@ -309,6 +309,16 @@ namespace CEC { +@@ -276,6 +276,18 @@ namespace CEC { + */ #define CEC_EXYNOS_VIRTUAL_COM "Exynos" - /*! ++/*! + * the path to use for the Amlogic HDMI CEC device + */ -+#define CEC_AMLOGIC_PATH "/dev/AmlogicCEC" ++#define CEC_AMLOGIC_PATH "/dev/AmlogicCEC" + +/*! + * the name of the virtual COM port to use for the AMLOGIC' CEC wire + */ -+#define CEC_AMLOGIC_VIRTUAL_COM "Amlogic" ++#define CEC_AMLOGIC_VIRTUAL_COM "Amlogic" + +/*! - * Mimimum client version ++ + /** + * Maximum size of a data packet */ - #define CEC_MIN_LIB_VERSION 3 -@@ -877,7 +887,8 @@ typedef enum cec_adapter_type - ADAPTERTYPE_P8_DAUGHTERBOARD = 0x2, +@@ -861,7 +873,8 @@ typedef enum cec_adapter_type ADAPTERTYPE_RPI = 0x100, ADAPTERTYPE_TDA995x = 0x200, -- ADAPTERTYPE_EXYNOS = 0x300 -+ ADAPTERTYPE_EXYNOS = 0x300, -+ ADAPTERTYPE_AMLOGIC = 0x500 + ADAPTERTYPE_EXYNOS = 0x300, +- ADAPTERTYPE_AOCEC = 0x500 ++ ADAPTERTYPE_AOCEC = 0x500, ++ ADAPTERTYPE_AMLOGIC = 0x600 } cec_adapter_type; /** force exporting through swig */ diff --git a/src/libcec/CMakeLists.txt b/src/libcec/CMakeLists.txt -index a494533..e94b094 100644 +index d3eefa3..125512b 100644 --- a/src/libcec/CMakeLists.txt +++ b/src/libcec/CMakeLists.txt @@ -87,6 +87,9 @@ set(CEC_HEADERS devices/CECRecordingDevice.h adapter/Exynos/ExynosCEC.h adapter/Exynos/ExynosCECAdapterDetection.h adapter/Exynos/ExynosCECAdapterCommunication.h -+ adapter/Amlogic/AmlogicCEC.h ++ adapter/Amlogic/AmlogicCEC.h + adapter/Amlogic/AmlogicCECAdapterDetection.h + adapter/Amlogic/AmlogicCECAdapterCommunication.h - adapter/Pulse-Eight/USBCECAdapterMessageQueue.h - adapter/Pulse-Eight/USBCECAdapterCommunication.h - adapter/Pulse-Eight/USBCECAdapterCommands.h + adapter/AOCEC/AOCEC.h + adapter/AOCEC/AOCECAdapterDetection.h + adapter/AOCEC/AOCECAdapterCommunication.h diff --git a/src/libcec/adapter/AdapterFactory.cpp b/src/libcec/adapter/AdapterFactory.cpp -index da05725..824c5ff 100644 +index 1e946e6..7c26214 100644 --- a/src/libcec/adapter/AdapterFactory.cpp +++ b/src/libcec/adapter/AdapterFactory.cpp @@ -58,6 +58,11 @@ @@ -73,10 +82,10 @@ index da05725..824c5ff 100644 +#include "Amlogic/AmlogicCECAdapterCommunication.h" +#endif + - using namespace CEC; - - int8_t CAdapterFactory::FindAdapters(cec_adapter *deviceList, uint8_t iBufSize, const char *strDevicePath /* = NULL */) -@@ -126,8 +131,20 @@ int8_t CAdapterFactory::DetectAdapters(cec_adapter_descriptor *deviceList, uint8 + #if defined(HAVE_AOCEC_API) + #include "AOCEC/AOCECAdapterDetection.h" + #include "AOCEC/AOCECAdapterCommunication.h" +@@ -143,6 +148,18 @@ int8_t CAdapterFactory::DetectAdapters(cec_adapter_descriptor *deviceList, uint8 } #endif @@ -93,23 +102,22 @@ index da05725..824c5ff 100644 +#endif + --#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) -+#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) && !defined(HAVE_AMLOGIC_API) + #if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) && !defined(HAVE_AOCEC_API) #error "libCEC doesn't have support for any type of adapter. please check your build system or configuration" +@@ -177,7 +194,12 @@ IAdapterCommunication *CAdapterFactory::GetInstance(const char *strPort, uint16_ + return new CUSBCECAdapterCommunication(m_lib->m_cec, strPort, iBaudRate); #endif -@@ -146,6 +163,11 @@ IAdapterCommunication *CAdapterFactory::GetInstance(const char *strPort, uint16_ - return new CExynosCECAdapterCommunication(m_lib->m_cec); - #endif - +-#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) && !defined(HAVE_EXYNOS_API) +#if defined(HAVE_AMLOGIC_API) + if (!strcmp(strPort, CEC_AMLOGIC_VIRTUAL_COM)) + return new CAmlogicCECAdapterCommunication(m_lib->m_cec); +#endif + - #if defined(HAVE_RPI_API) - if (!strcmp(strPort, CEC_RPI_VIRTUAL_COM)) - return new CRPiCECAdapterCommunication(m_lib->m_cec); ++#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) && !defined(HAVE_EXYNOS_API) && !defined(HAVE_AMLOGIC_API) + return NULL; + #endif + } diff --git a/src/libcec/adapter/Amlogic/AmlogicCEC.h b/src/libcec/adapter/Amlogic/AmlogicCEC.h new file mode 100644 index 0000000..7b86982 @@ -162,7 +170,7 @@ new file mode 100644 index 0000000..5aeddda --- /dev/null +++ b/src/libcec/adapter/Amlogic/AmlogicCECAdapterCommunication.cpp -@@ -0,0 +1,305 @@ +@@ -0,0 +1,306 @@ +/* + * This file is part of the libCEC(R) library. + * @@ -417,7 +425,8 @@ index 0000000..5aeddda + + if (fd == INVALID_SOCKET_VALUE) + { -+ break; ++ Sleep(250); ++ continue; + } + + FD_ZERO(&rfds); @@ -688,22 +697,21 @@ index 0000000..8a7418d + }; +} diff --git a/src/libcec/cmake/CheckPlatformSupport.cmake b/src/libcec/cmake/CheckPlatformSupport.cmake -index b8a16c8..311cb52 100644 +index 532f213..382c39c 100644 --- a/src/libcec/cmake/CheckPlatformSupport.cmake +++ b/src/libcec/cmake/CheckPlatformSupport.cmake -@@ -9,6 +9,7 @@ - # HAVE_RPI_API 1 if Raspberry Pi is supported - # HAVE_TDA995X_API 1 if TDA995X is supported - # HAVE_EXYNOS_API 1 if Exynos is supported -+# HAVE_AMLOGIC_API 1 if Amlogic is supported - # HAVE_P8_USB 1 if Pulse-Eight devices are supported - # HAVE_P8_USB_DETECT 1 if Pulse-Eight devices can be auto-detected - # HAVE_DRM_EDID_PARSER 1 if DRM EDID parsing is supported -@@ -132,6 +133,18 @@ else() - else() - set(HAVE_EXYNOS_API 0) +@@ -11,6 +11,7 @@ + # HAVE_EXYNOS_API ON if Exynos is supported + # HAVE_AOCEC_API ON if AOCEC is supported + # HAVE_P8_USB ON if Pulse-Eight devices are supported ++# HAVE_AMLOGIC_API 1 if AMLOGIC is supported + # HAVE_P8_USB_DETECT ON if Pulse-Eight devices can be auto-detected + # HAVE_DRM_EDID_PARSER ON if DRM EDID parsing is supported + # +@@ -137,6 +138,18 @@ else() + list(APPEND CEC_SOURCES ${CEC_SOURCES_ADAPTER_EXYNOS}) endif() -+ + + # Amlogic + if (${HAVE_AMLOGIC_API}) + set(LIB_INFO "${LIB_INFO}, Amlogic") @@ -715,15 +723,16 @@ index b8a16c8..311cb52 100644 + else() + set(HAVE_AMLOGIC_API 0) + endif() - endif() - - # rt ++ + # AOCEC + if (${HAVE_AOCEC_API}) + set(LIB_INFO "${LIB_INFO}, AOCEC") diff --git a/src/libcec/cmake/DisplayPlatformSupport.cmake b/src/libcec/cmake/DisplayPlatformSupport.cmake -index 9dcaacf..464252e 100644 +index 7ec10f5..7a38d32 100644 --- a/src/libcec/cmake/DisplayPlatformSupport.cmake +++ b/src/libcec/cmake/DisplayPlatformSupport.cmake -@@ -44,6 +44,12 @@ else() - message(STATUS "DRM support: no") +@@ -56,5 +56,11 @@ else() + message(STATUS "Python support: no") endif() +if (HAVE_AMLOGIC_API) @@ -732,20 +741,22 @@ index 9dcaacf..464252e 100644 + message(STATUS "Amlogic support: no") +endif() + - if (HAVE_PYTHON) - message(STATUS "Python support: version ${PYTHONLIBS_VERSION_STRING} (${PYTHON_VERSION})") - else() + message(STATUS "lib info: ${LIB_INFO}") + diff --git a/src/libcec/env.h.in b/src/libcec/env.h.in -index 0496aa0..971f769 100644 +index fe6c83d..09304e1 100644 --- a/src/libcec/env.h.in +++ b/src/libcec/env.h.in -@@ -72,6 +72,9 @@ - /* Define to 1 for Exynos support */ - #cmakedefine HAVE_EXYNOS_API @HAVE_EXYNOS_API@ +@@ -78,6 +78,9 @@ + /* Define to 1 for nVidia EDID parsing support (on selected models) */ + #cmakedefine HAVE_NVIDIA_EDID_PARSER @HAVE_NVIDIA_EDID_PARSER@ +/* Define to 1 for Amlogic support */ +#cmakedefine HAVE_AMLOGIC_API @HAVE_AMLOGIC_API@ + - /* Define to 1 for nVidia EDID parsing support (on selected models) */ - #cmakedefine HAVE_NVIDIA_EDID_PARSER @HAVE_NVIDIA_EDID_PARSER@ + /* Define to 1 for DRM EDID parsing support */ + #cmakedefine HAVE_DRM_EDID_PARSER @HAVE_DRM_EDID_PARSER@ +-- +2.7.4 + From 1085b0934bdb6b1ef3b82310eec6892ab77e8546 Mon Sep 17 00:00:00 2001 From: kszaq Date: Wed, 30 Nov 2016 23:14:34 +0100 Subject: [PATCH 11/11] kodi: fix builing after update to 17b5 --- ...-AESinkALSA-force-default-device-for-non-passthrough.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/mediacenter/kodi/patches/aarch64/kodi-0002-AESinkALSA-force-default-device-for-non-passthrough.patch b/packages/mediacenter/kodi/patches/aarch64/kodi-0002-AESinkALSA-force-default-device-for-non-passthrough.patch index db678e8be5..e5f0b5181d 100644 --- a/packages/mediacenter/kodi/patches/aarch64/kodi-0002-AESinkALSA-force-default-device-for-non-passthrough.patch +++ b/packages/mediacenter/kodi/patches/aarch64/kodi-0002-AESinkALSA-force-default-device-for-non-passthrough.patch @@ -11,7 +11,7 @@ diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp b/xbmc/cores/AudioEngin index 6a9066b..4d7f85d 100644 --- a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp +++ b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp -@@ -535,9 +535,8 @@ bool CAESinkALSA::Initialize(AEAudioFormat &format, std::string &device) +@@ -535,8 +535,8 @@ bool CAESinkALSA::Initialize(AEAudioFormat &format, std::string &device) m_passthrough = false; } #if defined(HAS_LIBAMCODEC) @@ -19,6 +19,6 @@ index 6a9066b..4d7f85d 100644 + if (!m_passthrough && device.find("hdmi:CARD=AMLM8AUDIO") != std::string::npos) { - aml_set_audio_passthrough(m_passthrough); - device = "default"; ++ device = "default"; } #endif