Skip to content

Commit

Permalink
Merge remote-tracking branch 'mainline/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
FernetMenta committed Oct 20, 2017
2 parents ba19816 + 922a6bb commit d2fba45
Show file tree
Hide file tree
Showing 16 changed files with 218 additions and 124 deletions.
16 changes: 4 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -421,18 +421,10 @@ if(CMAKE_GENERATOR STREQUAL "Unix Makefiles")
endif()

# Prepare add-on build env
core_file_read_filtered(bindings ${CMAKE_SOURCE_DIR}/xbmc/addons/addon-bindings.mk)
foreach(header ${bindings})
get_filename_component(file ${header} NAME)
configure_file(${CMAKE_SOURCE_DIR}/${header} ${CORE_BUILD_DIR}/include/${APP_NAME_LC}/${file} COPYONLY)
endforeach()
file(GLOB_RECURSE ADDON_HEADERS
RELATIVE ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi
${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/*.h)
foreach(header ${ADDON_HEADERS})
configure_file(${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/${header}
${CORE_BUILD_DIR}/include/kodi/${header} COPYONLY)
endforeach()
include(${CORE_SOURCE_DIR}/xbmc/addons/AddonBindings.cmake)
file(COPY ${CORE_ADDON_BINDINGS_FILES} ${CORE_ADDON_BINDINGS_DIRS}/
DESTINATION ${CORE_BUILD_DIR}/include/${APP_NAME_LC}
REGEX ".txt" EXCLUDE)

set(APP_LIB_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/${APP_NAME_LC})
set(APP_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include/${APP_NAME_LC})
Expand Down
14 changes: 4 additions & 10 deletions cmake/scripts/common/PrepareEnv.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,11 @@ file(COPY ${CORE_SOURCE_DIR}/cmake/scripts/common/AddonHelpers.cmake
${CORE_SOURCE_DIR}/cmake/scripts/common/AddOptions.cmake
DESTINATION ${APP_LIB_DIR})

# copy standard add-on include files
file(COPY ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/
DESTINATION ${APP_INCLUDE_DIR} REGEX ".txt" EXCLUDE)

### copy all the addon binding header files to include/kodi
# parse addon-bindings.mk to get the list of header files to copy
core_file_read_filtered(bindings ${CORE_SOURCE_DIR}/xbmc/addons/addon-bindings.mk)
foreach(header ${bindings})
# copy the header file to include/kodi
configure_file(${CORE_SOURCE_DIR}/${header} ${APP_INCLUDE_DIR} COPYONLY)
endforeach()
include(${CORE_SOURCE_DIR}/xbmc/addons/AddonBindings.cmake)
file(COPY ${CORE_ADDON_BINDINGS_FILES} ${CORE_ADDON_BINDINGS_DIRS}/
DESTINATION ${APP_INCLUDE_DIR}
REGEX ".txt" EXCLUDE)

### processing additional tools required by the platform
if(EXISTS ${CORE_SOURCE_DIR}/cmake/scripts/${CORE_SYSTEM_NAME}/tools/)
Expand Down
11 changes: 3 additions & 8 deletions cmake/scripts/linux/Install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,13 @@ if(NOT WITH_TEXTUREPACKER)
endif()

# Install kodi-addon-dev headers
install(DIRECTORY ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/
include(${CMAKE_SOURCE_DIR}/xbmc/addons/AddonBindings.cmake)
install(DIRECTORY ${CORE_ADDON_BINDINGS_DIRS}/
DESTINATION ${includedir}/${APP_NAME_LC}
COMPONENT kodi-addon-dev
REGEX ".txt" EXCLUDE)

install(FILES ${CMAKE_SOURCE_DIR}/xbmc/cores/VideoPlayer/Interface/Addon/DemuxPacket.h
${CMAKE_SOURCE_DIR}/xbmc/cores/VideoPlayer/Interface/Addon/DemuxCrypto.h
${CMAKE_SOURCE_DIR}/xbmc/cores/VideoPlayer/Interface/Addon/TimingConstants.h
${CMAKE_SOURCE_DIR}/xbmc/cores/AudioEngine/Utils/AEChannelData.h
${CMAKE_SOURCE_DIR}/xbmc/filesystem/IFileTypes.h
${CMAKE_SOURCE_DIR}/xbmc/input/ActionIDs.h
${CMAKE_SOURCE_DIR}/xbmc/input/XBMC_vkeys.h
install(FILES ${CORE_ADDON_BINDINGS_FILES}
DESTINATION ${includedir}/${APP_NAME_LC}
COMPONENT kodi-addon-dev)

Expand Down
1 change: 1 addition & 0 deletions cmake/treedata/optional/common/aml.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
xbmc/cores/RetroPlayer/process/amlogic cores/RetroPlayer/process/amlogic # AML
xbmc/windowing/amlogic windowing/amlogic # AML

2 changes: 1 addition & 1 deletion tools/buildsteps/windows/buildhelpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ do_download() {
for patch in ${patches[@]}; do
echo "Applying patch ${patch}"
if [[ -f $patch ]]; then
patch -d $LOCALSRCDIR -i $patch -N -r - || exit $?
patch -d $LOCALSRCDIR -i $patch -N -r -
fi
done
}
Expand Down
16 changes: 16 additions & 0 deletions xbmc/addons/AddonBindings.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# List contains only add-on related headers not present in
# ./addons/kodi-addon-dev-kit/include/kodi
#

# Keep this in alphabetical order
set(CORE_ADDON_BINDINGS_FILES
${CORE_SOURCE_DIR}/xbmc/cores/AudioEngine/Utils/AEChannelData.h
${CORE_SOURCE_DIR}/xbmc/filesystem/IFileTypes.h
${CORE_SOURCE_DIR}/xbmc/input/ActionIDs.h
${CORE_SOURCE_DIR}/xbmc/input/XBMC_vkeys.h
)

set(CORE_ADDON_BINDINGS_DIRS
${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/
${CORE_SOURCE_DIR}/xbmc/cores/VideoPlayer/Interface/Addon
)
13 changes: 0 additions & 13 deletions xbmc/addons/addon-bindings.mk

This file was deleted.

6 changes: 6 additions & 0 deletions xbmc/cores/RetroPlayer/process/amlogic/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
if(CORE_PLATFORM_NAME_LC STREQUAL aml)
set(SOURCES RPProcessInfoAmlogic.cpp)
set(HEADERS RPProcessInfoAmlogic.h)

core_add_library(rp-process-amlogic)
endif()
34 changes: 34 additions & 0 deletions xbmc/cores/RetroPlayer/process/amlogic/RPProcessInfoAmlogic.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright (C) 2017 Team Kodi
* http://kodi.tv
*
* This Program 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, 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; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/

#include "RPProcessInfoAmlogic.h"

using namespace KODI;
using namespace RETRO;

CRPProcessInfo* CRPProcessInfoAmlogic::Create()
{
return new CRPProcessInfoAmlogic();
}

void CRPProcessInfoAmlogic::Register()
{
CRPProcessInfo::RegisterProcessControl(CRPProcessInfoAmlogic::Create);
}
35 changes: 35 additions & 0 deletions xbmc/cores/RetroPlayer/process/amlogic/RPProcessInfoAmlogic.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright (C) 2017 Team Kodi
* http://kodi.tv
*
* This Program 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, 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; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
#pragma once

#include "cores/RetroPlayer/process/RPProcessInfo.h"

namespace KODI
{
namespace RETRO
{
class CRPProcessInfoAmlogic : public CRPProcessInfo
{
public:
static CRPProcessInfo* Create();
static void Register();
};
}
}
1 change: 0 additions & 1 deletion xbmc/pvr/PVRGUIInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ CPVRGUIInfo::CPVRGUIInfo(void) :

CPVRGUIInfo::~CPVRGUIInfo(void)
{
Stop();
}

void CPVRGUIInfo::ResetProperties(void)
Expand Down
60 changes: 24 additions & 36 deletions xbmc/pvr/PVRManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ CPVRManager::CPVRManager(void) :
m_recordings(new CPVRRecordings),
m_timers(new CPVRTimers),
m_addons(new CPVRClients),
m_guiInfo(new CPVRGUIInfo),
m_guiActions(new CPVRGUIActions),
m_database(new CPVRDatabase),
m_bFirstStart(true),
m_bEpgsCreated(false),
m_managerState(ManagerStateStopped),
Expand Down Expand Up @@ -232,6 +234,7 @@ CPVREpgContainer& CPVRManager::EpgContainer()
void CPVRManager::Clear(void)
{
m_pendingUpdates.Clear();
m_epgContainer.Clear();

CSingleLock lock(m_critSection);

Expand Down Expand Up @@ -265,15 +268,14 @@ void CPVRManager::Init()
CJobManager::GetInstance().AddJob(new CPVRStartupJob(), nullptr);
}

void CPVRManager::Reinit()
{
Init();
}

void CPVRManager::Start()
{
CSingleLock initLock(m_startStopMutex);

// Prevent concurrent starts
if (IsInitialising())
return;

// Note: Stop() must not be called while holding pvr manager's mutex. Stop() calls
// StopThread() which can deadlock if the worker thread tries to acquire pvr manager's
// lock while StopThread() is waiting for the worker to exit. Thus, we introduce another
Expand All @@ -285,13 +287,9 @@ void CPVRManager::Start()
if (!m_addons->HasCreatedClients())
return;

ResetProperties();
CLog::Log(LOGNOTICE, "PVR Manager: Starting");
SetState(ManagerStateStarting);

m_pendingUpdates.Start();

m_database->Open();

/* create the pvrmanager thread, which will ensure that all data will be loaded */
Create();
SetPriority(-1);
Expand All @@ -301,39 +299,36 @@ void CPVRManager::Stop(void)
{
CSingleLock initLock(m_startStopMutex);

/* check whether the pvrmanager is loaded */
// Prevent concurrent stops
if (IsStopped())
return;

/* stop playback if needed */
if (IsPlaying())
{
CLog::Log(LOGNOTICE,"PVRManager - %s - stopping PVR playback", __FUNCTION__);
CLog::Log(LOGDEBUG,"PVRManager - %s - stopping PVR playback", __FUNCTION__);
CApplicationMessenger::GetInstance().SendMsg(TMSG_MEDIA_STOP);
}

CLog::Log(LOGNOTICE, "PVR Manager: Stopping");
SetState(ManagerStateStopping);

m_pendingUpdates.Stop();

/* stop the EPG updater, since it might be using the pvr add-ons */
m_epgContainer.Stop();
m_guiInfo->Stop();

CLog::Log(LOGNOTICE, "PVRManager - stopping");
StopThread();

/* stop all update threads */
SetState(ManagerStateInterrupted);

StopThread();
CSingleLock lock(m_critSection);

if (m_guiInfo)
m_guiInfo->Stop();
UnloadComponents();
m_database->Close();

/* close database */
const CPVRDatabasePtr database(GetTVDatabase());
if (database)
database->Close();
ResetProperties();

CLog::Log(LOGNOTICE, "PVR Manager: Stopped");
SetState(ManagerStateStopped);
}

Expand All @@ -342,10 +337,6 @@ void CPVRManager::Unload()
// stop pvr manager thread and clear all pvr data
Stop();
Clear();

// stop epg container thread and clear all epg data
m_epgContainer.Stop();
m_epgContainer.Clear();
}

void CPVRManager::Deinit()
Expand Down Expand Up @@ -416,7 +407,7 @@ void CPVRManager::PublishEvent(PVREvent event)

void CPVRManager::Process(void)
{
m_epgContainer.Stop();
m_database->Open();

/* load the pvr data from the db and clients if it's not already loaded */
XbmcThreads::EndTime progressTimeout(30000); // 30 secs
Expand All @@ -427,12 +418,17 @@ void CPVRManager::Process(void)
}

if (!IsInitialising())
{
CLog::Log(LOGNOTICE, "PVR Manager: Start aborted");
return;
}

m_guiInfo->Start();
m_epgContainer.Start(true);
m_pendingUpdates.Start();

SetState(ManagerStateStarted);
CLog::Log(LOGNOTICE, "PVR Manager: Started");

/* main loop */
CLog::Log(LOGDEBUG, "PVRManager - %s - entering main loop", __FUNCTION__);
Expand Down Expand Up @@ -470,14 +466,6 @@ void CPVRManager::Process(void)
}

CLog::Log(LOGDEBUG, "PVRManager - %s - leaving main loop", __FUNCTION__);

UnloadComponents();

if (IsStarted())
{
CLog::Log(LOGNOTICE, "PVRManager - %s - no add-ons enabled anymore. restarting the pvrmanager", __FUNCTION__);
Reinit();
}
}

bool CPVRManager::SetWakeupCommand(void)
Expand Down
5 changes: 0 additions & 5 deletions xbmc/pvr/PVRManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,6 @@ namespace PVR
*/
void Init(void);

/*!
* @brief Reinit PVRManager.
*/
void Reinit(void);

/*!
* @brief Start the PVRManager, which loads all PVR data and starts some threads to update the PVR data.
*/
Expand Down

0 comments on commit d2fba45

Please sign in to comment.