Permalink
Browse files

Merge pull request #5084 from popcornmix/dvdrefactor

[players] Make omxplayer be derived from dvdplayer [RFC]
  • Loading branch information...
2 parents d3f48dd + 2d11034 commit 661706dc4a27b223d14bc463e5e71489d598b477 @FernetMenta FernetMenta committed Sep 4, 2014
Showing with 729 additions and 5,254 deletions.
  1. +12 −1 language/English/strings.po
  2. +9 −0 system/settings/settings.xml
  3. +4 −21 xbmc/ApplicationPlayer.cpp
  4. +0 −3 xbmc/ApplicationPlayer.h
  5. +0 −2 xbmc/addons/Visualisation.cpp
  6. +0 −2 xbmc/cores/DummyVideoPlayer.h
  7. +0 −2 xbmc/cores/ExternalPlayer/ExternalPlayer.h
  8. +6 −6 xbmc/cores/IPlayer.h
  9. +0 −20 xbmc/cores/dvdplayer/DVDAudio.cpp
  10. +0 −5 xbmc/cores/dvdplayer/DVDAudio.h
  11. +463 −142 xbmc/cores/dvdplayer/DVDPlayer.cpp
  12. +70 −9 xbmc/cores/dvdplayer/DVDPlayer.h
  13. +3 −5 xbmc/cores/dvdplayer/DVDPlayerAudio.h
  14. +3 −1 xbmc/cores/dvdplayer/DVDPlayerVideo.h
  15. +79 −1 xbmc/cores/dvdplayer/IDVDPlayer.h
  16. +1 −2 xbmc/cores/omxplayer/Makefile.in
  17. +0 −20 xbmc/cores/omxplayer/OMXAudio.cpp
  18. +0 −4 xbmc/cores/omxplayer/OMXAudio.h
  19. +0 −4,432 xbmc/cores/omxplayer/OMXPlayer.cpp
  20. +0 −508 xbmc/cores/omxplayer/OMXPlayer.h
  21. +26 −12 xbmc/cores/omxplayer/OMXPlayerAudio.cpp
  22. +2 −4 xbmc/cores/omxplayer/OMXPlayerAudio.h
  23. +20 −13 xbmc/cores/omxplayer/OMXPlayerVideo.cpp
  24. +2 −2 xbmc/cores/omxplayer/OMXPlayerVideo.h
  25. +3 −2 xbmc/cores/omxplayer/OMXVideo.cpp
  26. +1 −1 xbmc/cores/omxplayer/OMXVideo.h
  27. +2 −2 xbmc/cores/omxplayer/omxplayer_advancedsettings.xml
  28. +0 −14 xbmc/cores/playercorefactory/PlayerCoreConfig.h
  29. +0 −7 xbmc/cores/playercorefactory/PlayerCoreFactory.cpp
  30. +0 −6 xbmc/cores/playercorefactory/PlayerCoreFactory.h
  31. +19 −5 xbmc/linux/OMXClock.cpp
  32. +1 −0 xbmc/linux/OMXClock.h
  33. +3 −0 xbmc/settings/SettingConditions.cpp
@@ -6196,7 +6196,18 @@ msgctxt "#13457"
msgid "Prefer VAAPI render method"
msgstr ""
-#empty strings from id 13458 to 13499
+#: system/settings/settings.xml
+msgctxt "#13458"
+msgid "Allow hardware acceleration (OMXPlayer)"
+msgstr ""
+
+#. Description of setting "Videos -> Playback -> Allow hardware acceleration (OMXPlayer)" with label #13457
+#: system/settings/settings.xml
+msgctxt "#13459"
+msgid "Use OMXPlayer for decoding of video files."
+msgstr ""
+
+#empty strings from id 13460 to 13499
#: system/settings/settings.xml
msgctxt "#13500"
@@ -752,6 +752,15 @@
<default>true</default>
<control type="toggle" />
</setting>
+ <setting id="videoplayer.useomxplayer" type="boolean" label="13458" help="13459">
+ <requirement>HAS_OMXPLAYER</requirement>
+ <dependencies>
+ <dependency type="enable" setting="videoplayer.decodingmethod" operator="is">1</dependency>
+ </dependencies>
+ <level>2</level>
+ <default>true</default>
+ <control type="toggle" />
+ </setting>
<setting id="videoplayer.useomx" type="boolean" label="13430" help="36161">
<requirement>HAVE_LIBOPENMAX</requirement>
<dependencies>
View
@@ -64,9 +64,6 @@ void CApplicationPlayer::ClosePlayerGapless(PLAYERCOREID newCore)
return;
bool gaplessSupported = (m_eCurrentPlayer == EPC_DVDPLAYER || m_eCurrentPlayer == EPC_PAPLAYER);
-#if defined(HAS_OMXPLAYER)
- gaplessSupported = gaplessSupported || (m_eCurrentPlayer == EPC_OMXPLAYER);
-#endif
gaplessSupported = gaplessSupported && (m_eCurrentPlayer == newCore);
if (!gaplessSupported)
{
@@ -116,20 +113,6 @@ bool CApplicationPlayer::HasPlayer() const
return player != NULL;
}
-void CApplicationPlayer::RegisterAudioCallback(IAudioCallback* pCallback)
-{
- boost::shared_ptr<IPlayer> player = GetInternal();
- if (player)
- player->RegisterAudioCallback(pCallback);
-}
-
-void CApplicationPlayer::UnRegisterAudioCallback()
-{
- boost::shared_ptr<IPlayer> player = GetInternal();
- if (player)
- player->UnRegisterAudioCallback();
-}
-
int CApplicationPlayer::GetChapter()
{
boost::shared_ptr<IPlayer> player = GetInternal();
@@ -621,28 +604,28 @@ void CApplicationPlayer::GetRenderFeatures(std::vector<int> &renderFeatures)
{
boost::shared_ptr<IPlayer> player = GetInternal();
if (player)
- player->GetRenderFeatures(renderFeatures);
+ player->OMXGetRenderFeatures(renderFeatures);
}
void CApplicationPlayer::GetDeinterlaceMethods(std::vector<int> &deinterlaceMethods)
{
boost::shared_ptr<IPlayer> player = GetInternal();
if (player)
- player->GetDeinterlaceMethods(deinterlaceMethods);
+ player->OMXGetDeinterlaceMethods(deinterlaceMethods);
}
void CApplicationPlayer::GetDeinterlaceModes(std::vector<int> &deinterlaceModes)
{
boost::shared_ptr<IPlayer> player = GetInternal();
if (player)
- player->GetDeinterlaceModes(deinterlaceModes);
+ player->OMXGetDeinterlaceModes(deinterlaceModes);
}
void CApplicationPlayer::GetScalingMethods(std::vector<int> &scalingMethods)
{
boost::shared_ptr<IPlayer> player = GetInternal();
if (player)
- player->GetScalingMethods(scalingMethods);
+ player->OMXGetScalingMethods(scalingMethods);
}
void CApplicationPlayer::SetPlaySpeed(int iSpeed, bool bApplicationMuted)
View
@@ -37,7 +37,6 @@ namespace PVR
class CPVRChannel;
}
-class IAudioCallback;
class CAction;
class CPlayerOptions;
class CStreamDetails;
@@ -133,7 +132,6 @@ class CApplicationPlayer
void Pause();
bool QueueNextFile(const CFileItem &file);
bool Record(bool bOnOff);
- void RegisterAudioCallback(IAudioCallback* pCallback);
void Seek(bool bPlus = true, bool bLargeStep = false, bool bChapterOverride = false);
int SeekChapter(int iChapter);
void SeekPercentage(float fPercent = 0);
@@ -150,5 +148,4 @@ class CApplicationPlayer
void SetVolume(float volume);
bool SwitchChannel(const PVR::CPVRChannel &channel);
void ToFFRW(int iSpeed = 0);
- void UnRegisterAudioCallback();
};
@@ -109,7 +109,6 @@ bool CVisualisation::Create(int x, int y, int w, int h, void *device)
CreateBuffers();
- g_application.m_pPlayer->RegisterAudioCallback(this);
CAEFactory::RegisterAudioCallback(this);
return true;
@@ -174,7 +173,6 @@ void CVisualisation::Render()
void CVisualisation::Stop()
{
- g_application.m_pPlayer->UnRegisterAudioCallback();
CAEFactory::UnregisterAudioCallback();
if (Initialized())
{
@@ -28,8 +28,6 @@ class CDummyVideoPlayer : public IPlayer, public CThread
public:
CDummyVideoPlayer(IPlayerCallback& callback);
virtual ~CDummyVideoPlayer();
- virtual void RegisterAudioCallback(IAudioCallback* pCallback) {}
- virtual void UnRegisterAudioCallback() {}
virtual bool OpenFile(const CFileItem& file, const CPlayerOptions &options);
virtual bool CloseFile();
virtual bool IsPlaying() const;
@@ -35,8 +35,6 @@ class CExternalPlayer : public IPlayer, public CThread
CExternalPlayer(IPlayerCallback& callback);
virtual ~CExternalPlayer();
virtual bool Initialize(TiXmlElement* pConfig);
- virtual void RegisterAudioCallback(IAudioCallback* pCallback) {}
- virtual void UnRegisterAudioCallback() {}
virtual bool OpenFile(const CFileItem& file, const CPlayerOptions &options);
virtual bool CloseFile(bool reopen = false);
virtual bool IsPlaying() const;
View
@@ -128,8 +128,6 @@ class IPlayer
IPlayer(IPlayerCallback& callback): m_callback(callback){};
virtual ~IPlayer(){};
virtual bool Initialize(TiXmlElement* pConfig) { return true; };
- virtual void RegisterAudioCallback(IAudioCallback* pCallback) {};
- virtual void UnRegisterAudioCallback() {};
virtual bool OpenFile(const CFileItem& file, const CPlayerOptions& options){ return false;}
virtual bool QueueNextFile(const CFileItem &file) { return false; }
virtual void OnNothingToQueueNotify() {}
@@ -221,22 +219,24 @@ class IPlayer
virtual bool SwitchChannel(const PVR::CPVRChannel &channel) { return false; }
+ // Note: the following "OMX" methods are deprecated and will be removed in the future
+ // They should be handled by the video renderer, not the player
/*!
\brief If the player uses bypass mode, define its rendering capabilities
*/
- virtual void GetRenderFeatures(std::vector<int> &renderFeatures) {};
+ virtual void OMXGetRenderFeatures(std::vector<int> &renderFeatures) {};
/*!
\brief If the player uses bypass mode, define its deinterlace algorithms
*/
- virtual void GetDeinterlaceMethods(std::vector<int> &deinterlaceMethods) {};
+ virtual void OMXGetDeinterlaceMethods(std::vector<int> &deinterlaceMethods) {};
/*!
\brief If the player uses bypass mode, define how deinterlace is set
*/
- virtual void GetDeinterlaceModes(std::vector<int> &deinterlaceModes) {};
+ virtual void OMXGetDeinterlaceModes(std::vector<int> &deinterlaceModes) {};
/*!
\brief If the player uses bypass mode, define its scaling capabilities
*/
- virtual void GetScalingMethods(std::vector<int> &scalingMethods) {};
+ virtual void OMXGetScalingMethods(std::vector<int> &scalingMethods) {};
/*!
\brief define the audio capabilities of the player (default=all)
*/
@@ -95,7 +95,6 @@ CDVDAudio::CDVDAudio(volatile bool &bStop)
: m_bStop(bStop)
{
m_pAudioStream = NULL;
- m_pAudioCallback = NULL;
m_bPassthrough = false;
m_iBitsPerSample = 0;
m_iBitrate = 0;
@@ -146,9 +145,6 @@ bool CDVDAudio::Create(const DVDAudioFrame &audioframe, AVCodecID codec, bool ne
SetDynamicRangeCompression((long)(CMediaSettings::Get().GetCurrentVideoSettings().m_VolumeAmplification * 100));
- if (m_pAudioCallback)
- RegisterAudioCallback(m_pAudioCallback);
-
return true;
}
@@ -225,22 +221,6 @@ void CDVDAudio::Drain()
m_pAudioStream->Drain(true);
}
-void CDVDAudio::RegisterAudioCallback(IAudioCallback* pCallback)
-{
- CSingleLock lock (m_critSection);
- m_pAudioCallback = pCallback;
- if (m_pAudioStream)
- m_pAudioStream->RegisterAudioCallback(pCallback);
-}
-
-void CDVDAudio::UnRegisterAudioCallback()
-{
- CSingleLock lock (m_critSection);
- if (m_pAudioStream)
- m_pAudioStream->UnRegisterAudioCallback();
- m_pAudioCallback = NULL;
-}
-
void CDVDAudio::SetVolume(float volume)
{
CSingleLock lock (m_critSection);
@@ -52,17 +52,13 @@ class CPTSOutputQueue
};
class CSingleLock;
-class IAudioCallback;
class CDVDAudio
{
public:
CDVDAudio(volatile bool& bStop);
~CDVDAudio();
- void RegisterAudioCallback(IAudioCallback* pCallback);
- void UnRegisterAudioCallback();
-
void SetVolume(float fVolume);
void SetDynamicRangeCompression(long drc);
float GetCurrentAttenuation();
@@ -97,7 +93,6 @@ class CDVDAudio
bool m_bPaused;
volatile bool& m_bStop;
- IAudioCallback* m_pAudioCallback; //the viz audio callback
//counter that will go from 0 to m_iSpeed-1 and reset, data will only be output when speedstep is 0
//int m_iSpeedStep;
};
Oops, something went wrong.

0 comments on commit 661706d

Please sign in to comment.