Skip to content
Permalink
Browse files

remove DataCacheCore from systemGlobals

  • Loading branch information...
FernetMenta authored and popcornmix committed Jun 22, 2016
1 parent d2165e9 commit e12400a502d16ba2098ba939ec2edc3b7e6a635b
@@ -37,6 +37,7 @@
#include "cores/AudioEngine/AEFactory.h"
#include "cores/AudioEngine/Engines/ActiveAE/AudioDSPAddons/ActiveAEDSP.h"
#include "cores/AudioEngine/Utils/AEUtil.h"
#include "cores/DataCacheCore.h"
#include "cores/playercorefactory/PlayerCoreFactory.h"
#include "PlayListPlayer.h"
#include "Autorun.h"
@@ -6018,25 +6018,25 @@ std::string CGUIInfoManager::GetLabel(int info, int contextWindow, std::string *
}
break;
case PLAYER_PROCESS_VIDEODECODER:
strLabel = g_dataCacheCore.GetVideoDecoderName();
strLabel = CServiceBroker::GetDataCacheCore().GetVideoDecoderName();
break;
case PLAYER_PROCESS_DEINTMETHOD:
strLabel = g_dataCacheCore.GetVideoDeintMethod();
strLabel = CServiceBroker::GetDataCacheCore().GetVideoDeintMethod();
break;
case PLAYER_PROCESS_PIXELFORMAT:
strLabel = g_dataCacheCore.GetVideoPixelFormat();
strLabel = CServiceBroker::GetDataCacheCore().GetVideoPixelFormat();
break;
case PLAYER_PROCESS_VIDEOFPS:
strLabel = StringUtils::FormatNumber(g_dataCacheCore.GetVideoFps());
strLabel = StringUtils::FormatNumber(CServiceBroker::GetDataCacheCore().GetVideoFps());
break;
case PLAYER_PROCESS_VIDEOASPECTRATIO:
strLabel = StringUtils::FormatNumber(CServiceBroker::GetDataCacheCore().GetVideoAspectRatio());
break;
case PLAYER_PROCESS_AUDIODECODER:
strLabel = g_dataCacheCore.GetAudioDecoderName();
strLabel = CServiceBroker::GetDataCacheCore().GetAudioDecoderName();
break;
case PLAYER_PROCESS_AUDIOCHANNELS:
strLabel = g_dataCacheCore.GetAudioChannels();
strLabel = CServiceBroker::GetDataCacheCore().GetAudioChannels();
break;
case RDS_AUDIO_LANG:
case RDS_CHANNEL_COUNTRY:
@@ -6601,16 +6601,16 @@ bool CGUIInfoManager::GetInt(int &value, int info, int contextWindow, const CGUI
value = g_powerManager.BatteryLevel();
return true;
case PLAYER_PROCESS_VIDEOWIDTH:
value = g_dataCacheCore.GetVideoWidth();
value = CServiceBroker::GetDataCacheCore().GetVideoWidth();
return true;
case PLAYER_PROCESS_VIDEOHEIGHT:
value = g_dataCacheCore.GetVideoHeight();
value = CServiceBroker::GetDataCacheCore().GetVideoHeight();
return true;
case PLAYER_PROCESS_AUDIOSAMPLERATE:
value = g_dataCacheCore.GetAudioSampleRate();
value = CServiceBroker::GetDataCacheCore().GetAudioSampleRate();
return true;
case PLAYER_PROCESS_AUDIOBITSPERSAMPLE:
value = g_dataCacheCore.GetAudioBitsPerSampe();
value = CServiceBroker::GetDataCacheCore().GetAudioBitsPerSampe();
return true;
}
return false;
@@ -7148,7 +7148,7 @@ bool CGUIInfoManager::GetBool(int condition1, int contextWindow, const CGUIListI
!m_currentFile->GetPVRRadioRDSInfoTag()->GetPhoneStudio().empty());
break;
case PLAYER_PROCESS_VIDEOHWDECODER:
bReturn = g_dataCacheCore.IsVideoHwDecoder();
bReturn = CServiceBroker::GetDataCacheCore().IsVideoHwDecoder();
break;
default: // default, use integer value different from 0 as true
{
@@ -9150,7 +9150,7 @@ void CGUIInfoManager::UpdateAVInfo()
{
if(g_application.m_pPlayer->IsPlaying())
{
if (g_dataCacheCore.HasAVInfoChanges())
if (CServiceBroker::GetDataCacheCore().HasAVInfoChanges())
{
SPlayerVideoStreamInfo video;
SPlayerAudioStreamInfo audio;
@@ -50,3 +50,8 @@ ActiveAE::CActiveAEDSP &CServiceBroker::GetADSP()
{
return g_application.m_ServiceManager->GetADSPManager();
}

CDataCacheCore &CServiceBroker::GetDataCacheCore()
{
return g_application.m_ServiceManager->GetDataCacheCore();
}
@@ -40,6 +40,7 @@ namespace PVR
}

class XBPython;
class CDataCacheCore;

class CServiceBroker
{
@@ -50,4 +51,5 @@ class CServiceBroker
static XBPython &GetXBPython();
static PVR::CPVRManager &GetPVRManager();
static ActiveAE::CActiveAEDSP& GetADSP();
static CDataCacheCore& GetDataCacheCore();
};
@@ -21,6 +21,7 @@
#include "ServiceManager.h"
#include "addons/BinaryAddonCache.h"
#include "cores/AudioEngine/Engines/ActiveAE/AudioDSPAddons/ActiveAEDSP.h"
#include "cores/DataCacheCore.h"
#include "utils/log.h"
#include "interfaces/AnnouncementManager.h"
#include "interfaces/generic/ScriptInvocationManager.h"
@@ -49,6 +50,7 @@ bool CServiceManager::Init2()

m_ADSPManager.reset(new ActiveAE::CActiveAEDSP());
m_PVRManager.reset(new PVR::CPVRManager());
m_dataCacheCore.reset(new CDataCacheCore());

m_binaryAddonCache.reset( new ADDON::CBinaryAddonCache());
m_binaryAddonCache->Init();
@@ -104,3 +106,8 @@ ActiveAE::CActiveAEDSP& CServiceManager::GetADSPManager()
{
return *m_ADSPManager;
}

CDataCacheCore& CServiceManager::GetDataCacheCore()
{
return *m_dataCacheCore;
}
@@ -42,6 +42,7 @@ class CPVRManager;
}

class XBPython;
class CDataCacheCore;

class CServiceManager
{
@@ -56,6 +57,7 @@ class CServiceManager
XBPython& GetXBPython();
PVR::CPVRManager& GetPVRManager();
ActiveAE::CActiveAEDSP& GetADSPManager();
CDataCacheCore& GetDataCacheCore();

protected:
std::unique_ptr<ADDON::CAddonMgr> m_addonMgr;
@@ -64,4 +66,5 @@ class CServiceManager
std::unique_ptr<XBPython> m_XBPython;
std::unique_ptr<PVR::CPVRManager> m_PVRManager;
std::unique_ptr<ActiveAE::CActiveAEDSP> m_ADSPManager;
std::unique_ptr<CDataCacheCore> m_dataCacheCore;
};
@@ -19,7 +19,6 @@
*/
#include "system.h"
#include "SectionLoader.h"
#include "cores/DataCacheCore.h"
#include "GUILargeTextureManager.h"
#include "guilib/TextureManager.h"
#include "utils/AlarmClock.h"
@@ -71,6 +70,3 @@ std::map<std::string, std::string> CSpecialProtocol::m_pathMap;
#endif

CZipManager g_ZipManager;

CDataCacheCore g_dataCacheCore;

@@ -20,12 +20,18 @@

#include "cores/DataCacheCore.h"
#include "threads/SingleLock.h"
#include "ServiceBroker.h"

CDataCacheCore::CDataCacheCore()
{
m_hasAVInfoChanges = false;
}

CDataCacheCore& GetInstance()
{
return CServiceBroker::GetDataCacheCore();
}

bool CDataCacheCore::HasAVInfoChanges()
{
bool ret = m_hasAVInfoChanges;
@@ -28,6 +28,7 @@ class CDataCacheCore
{
public:
CDataCacheCore();
static CDataCacheCore& GetInstance();
bool HasAVInfoChanges();
void SignalVideoInfoChange();
void SignalAudioInfoChange();
@@ -83,3 +84,4 @@ class CDataCacheCore
int bitsPerSample;
} m_playerAudioInfo;
};

@@ -19,6 +19,7 @@
*/

#include "ProcessInfo.h"
#include "ServiceBroker.h"
#include "cores/DataCacheCore.h"
#include "threads/SingleLock.h"

@@ -82,7 +83,7 @@ void CProcessInfo::SetVideoDecoderName(std::string name, bool isHw)
m_videoIsHWDecoder = isHw;
m_videoDecoderName = name;

g_dataCacheCore.SetVideoDecoderName(m_videoDecoderName, m_videoIsHWDecoder);
CServiceBroker::GetDataCacheCore().SetVideoDecoderName(m_videoDecoderName, m_videoIsHWDecoder);
}

std::string CProcessInfo::GetVideoDecoderName()
@@ -105,7 +106,7 @@ void CProcessInfo::SetVideoDeintMethod(std::string method)

m_videoDeintMethod = method;

g_dataCacheCore.SetVideoDeintMethod(m_videoDeintMethod);
CServiceBroker::GetDataCacheCore().SetVideoDeintMethod(m_videoDeintMethod);
}

std::string CProcessInfo::GetVideoDeintMethod()
@@ -121,7 +122,7 @@ void CProcessInfo::SetVideoPixelFormat(std::string pixFormat)

m_videoPixelFormat = pixFormat;

g_dataCacheCore.SetVideoPixelFormat(m_videoPixelFormat);
CServiceBroker::GetDataCacheCore().SetVideoPixelFormat(m_videoPixelFormat);
}

std::string CProcessInfo::GetVideoPixelFormat()
@@ -138,7 +139,7 @@ void CProcessInfo::SetVideoDimensions(int width, int height)
m_videoWidth = width;
m_videoHeight = height;

g_dataCacheCore.SetVideoDimensions(m_videoWidth, m_videoHeight);
CServiceBroker::GetDataCacheCore().SetVideoDimensions(m_videoWidth, m_videoHeight);
}

void CProcessInfo::GetVideoDimensions(int &width, int &height)
@@ -155,7 +156,7 @@ void CProcessInfo::SetVideoFps(float fps)

m_videoFPS = fps;

g_dataCacheCore.SetVideoFps(m_videoFPS);
CServiceBroker::GetDataCacheCore().SetVideoFps(m_videoFPS);
}

float CProcessInfo::GetVideoFps()
@@ -191,10 +192,10 @@ void CProcessInfo::ResetAudioCodecInfo()
m_audioSampleRate = 0;;
m_audioBitsPerSample = 0;

g_dataCacheCore.SetAudioDecoderName(m_audioDecoderName);
g_dataCacheCore.SetAudioChannels(m_audioChannels);
g_dataCacheCore.SetAudioSampleRate(m_audioSampleRate);
g_dataCacheCore.SetAudioBitsPerSample(m_audioBitsPerSample);
CServiceBroker::GetDataCacheCore().SetAudioDecoderName(m_audioDecoderName);
CServiceBroker::GetDataCacheCore().SetAudioChannels(m_audioChannels);
CServiceBroker::GetDataCacheCore().SetAudioSampleRate(m_audioSampleRate);
CServiceBroker::GetDataCacheCore().SetAudioBitsPerSample(m_audioBitsPerSample);
}

void CProcessInfo::SetAudioDecoderName(std::string name)
@@ -45,6 +45,7 @@
#include "guilib/GUIWindowManager.h"
#include "guilib/StereoscopicsManager.h"
#include "Application.h"
#include "ServiceBroker.h"
#include "messaging/ApplicationMessenger.h"

#include "DVDDemuxers/DVDDemuxCC.h"
@@ -81,6 +82,7 @@
#include "cores/omxplayer/OMXHelper.h"
#endif
#include "VideoPlayerAudio.h"
#include "cores/DataCacheCore.h"
#include "windowing/WindowingFactory.h"
#include "DVDCodecs/DVDCodecUtils.h"
#include "filesystem/SpecialProtocol.h"
@@ -601,8 +603,8 @@ void CSelectionStreams::Update(CDVDInputStream* input, CDVDDemux* demuxer, std::
Update(s);
}
}
g_dataCacheCore.SignalAudioInfoChange();
g_dataCacheCore.SignalVideoInfoChange();
CServiceBroker::GetDataCacheCore().SignalAudioInfoChange();
CServiceBroker::GetDataCacheCore().SignalVideoInfoChange();
}

int CSelectionStreams::CountSource(StreamType type, StreamSource source) const
@@ -2934,8 +2936,8 @@ void CVideoPlayer::HandleMessages()
else if (pMsg->IsType(CDVDMsg::PLAYER_AVCHANGE))
{
UpdateStreamInfos();
g_dataCacheCore.SignalAudioInfoChange();
g_dataCacheCore.SignalVideoInfoChange();
CServiceBroker::GetDataCacheCore().SignalAudioInfoChange();
CServiceBroker::GetDataCacheCore().SignalVideoInfoChange();
}

pMsg->Release();
@@ -3658,8 +3660,8 @@ bool CVideoPlayer::OpenStream(CCurrentStream& current, int64_t demuxerId, int iS
}
}

g_dataCacheCore.SignalAudioInfoChange();
g_dataCacheCore.SignalVideoInfoChange();
CServiceBroker::GetDataCacheCore().SignalAudioInfoChange();
CServiceBroker::GetDataCacheCore().SignalVideoInfoChange();

return res;
}
@@ -21,6 +21,7 @@
#include "PAPlayer.h"
#include "CodecFactory.h"
#include "FileItem.h"
#include "ServiceBroker.h"
#include "settings/AdvancedSettings.h"
#include "settings/Settings.h"
#include "music/tags/MusicInfoTag.h"
@@ -1130,7 +1131,7 @@ void PAPlayer::UpdateGUIData(StreamInfo *si)
total -= m_currentStream->m_startOffset;
m_playerGUIData.m_totalTime = total;

g_dataCacheCore.SignalAudioInfoChange();
CServiceBroker::GetDataCacheCore().SignalAudioInfoChange();
}

void PAPlayer::OnJobComplete(unsigned int jobID, bool success, CJob *job)

0 comments on commit e12400a

Please sign in to comment.
You can’t perform that action at this time.