From 618094ed6ad5b01165de2111410dafbe4160598c Mon Sep 17 00:00:00 2001
From: Rainer Hochecker <fernetmenta@online.de>
Date: Tue, 31 May 2016 13:28:48 +0200
Subject: [PATCH 1/3] VideoPlayer: expose stream player info to GUI

---
 xbmc/GUIInfoManager.cpp                            |  60 +++++++
 xbmc/cores/DataCacheCore.cpp                       | 166 ++++++++++++++++-
 xbmc/cores/DataCacheCore.h                         |  55 +++++-
 .../VideoPlayer/DVDCodecs/Audio/DVDAudioCodec.h    |   6 +-
 .../DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp        |   3 +-
 .../DVDCodecs/Audio/DVDAudioCodecFFmpeg.h          |   4 +-
 .../DVDCodecs/Audio/DVDAudioCodecPassthrough.cpp   |   9 +-
 .../DVDCodecs/Audio/DVDAudioCodecPassthrough.h     |   4 +-
 .../VideoPlayer/DVDCodecs/DVDFactoryCodec.cpp      |   6 +-
 xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.h |   3 +-
 .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp        |  30 +++-
 .../DVDCodecs/Video/DVDVideoCodecFFmpeg.h          |   1 +
 xbmc/cores/VideoPlayer/DVDCodecs/Video/DXVA.cpp    |   6 +-
 xbmc/cores/VideoPlayer/DVDCodecs/Video/DXVA.h      |   5 +-
 xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.cpp   |  19 +-
 xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.h     |   5 +-
 xbmc/cores/VideoPlayer/DVDCodecs/Video/VDPAU.cpp   |   4 +-
 xbmc/cores/VideoPlayer/DVDCodecs/Video/VDPAU.h     |   6 +-
 xbmc/cores/VideoPlayer/DVDCodecs/Video/VTB.cpp     |   4 +-
 xbmc/cores/VideoPlayer/DVDCodecs/Video/VTB.h       |   6 +-
 xbmc/cores/VideoPlayer/Process/ProcessInfo.cpp     | 199 +++++++++++++++++++++
 xbmc/cores/VideoPlayer/Process/ProcessInfo.h       |  47 +++++
 xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp        |  11 +-
 xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp        |   5 +
 xbmc/cores/omxplayer/OMXPlayerAudio.cpp            |   1 +
 xbmc/cores/omxplayer/OMXPlayerVideo.cpp            |   7 +
 xbmc/cores/paplayer/VideoPlayerCodec.cpp           |   4 +-
 xbmc/cores/paplayer/VideoPlayerCodec.h             |   2 +
 xbmc/guiinfo/GUIInfoLabels.h                       |  14 ++
 29 files changed, 662 insertions(+), 30 deletions(-)

diff --git a/xbmc/GUIInfoManager.cpp b/xbmc/GUIInfoManager.cpp
index 0d37f1f..ab5cb12 100644
--- a/xbmc/GUIInfoManager.cpp
+++ b/xbmc/GUIInfoManager.cpp
@@ -2108,6 +2108,22 @@ const infomap videoplayer[] =    {{ "title",            VIDEOPLAYER_TITLE },
                                   { "episodename",      VIDEOPLAYER_EPISODENAME }
 };
 
+const infomap player_process[] =
+{
+  { "videodecoder", PLAYER_PROCESS_VIDEODECODER },
+  { "deintmethod", PLAYER_PROCESS_DEINTMETHOD },
+  { "pixformat", PLAYER_PROCESS_PIXELFORMAT },
+  { "videowidth", PLAYER_PROCESS_VIDEOWIDTH },
+  { "videoheight", PLAYER_PROCESS_VIDEOHEIGHT },
+  { "videofps", PLAYER_PROCESS_VIDEOFPS },
+  { "videodar", PLAYER_PROCESS_VIDEODAR },
+  { "videohwdecoder", PLAYER_PROCESS_VIDEOHWDECODER },
+  { "audiodecoder", PLAYER_PROCESS_AUDIODECODER },
+  { "audiochannels", PLAYER_PROCESS_AUDIOCHANNELS },
+  { "audiosamplerate", PLAYER_PROCESS_AUDIOSAMPLERATE },
+  { "audiobitspersample", PLAYER_PROCESS_AUDIOBITSPERSAMPLE }
+};
+
 /// \page modules__General__List_of_gui_access
 /// \section modules__General__List_of_gui_access_Container Container
 /// @{
@@ -5320,6 +5336,14 @@ int CGUIInfoManager::TranslateSingleString(const std::string &strCondition, bool
           return videoplayer[i].val;
       }
     }
+    else if (cat.name == "player_process")
+    {
+      for (size_t i = 0; i < sizeof(player_process) / sizeof(infomap); i++)
+      {
+        if (prop.name == player_process[i].str)
+          return videoplayer[i].val;
+      }
+    }
     else if (cat.name == "slideshow")
     {
       for (size_t i = 0; i < sizeof(slideshow) / sizeof(infomap); i++)
@@ -5993,6 +6017,27 @@ std::string CGUIInfoManager::GetLabel(int info, int contextWindow, std::string *
       strLabel = info.language;
     }
     break;
+  case PLAYER_PROCESS_VIDEODECODER:
+      strLabel = g_dataCacheCore.GetVideoDecoderName();
+      break;
+  case PLAYER_PROCESS_DEINTMETHOD:
+      strLabel = g_dataCacheCore.GetVideoDeintMethod();
+      break;
+  case PLAYER_PROCESS_PIXELFORMAT:
+      strLabel = g_dataCacheCore.GetVideoPixelFormat();
+      break;
+  case PLAYER_PROCESS_VIDEOFPS:
+      strLabel = StringUtils::FormatNumber(g_dataCacheCore.GetVideoFps());
+      break;
+  case PLAYER_PROCESS_VIDEODAR:
+      strLabel = StringUtils::FormatNumber(CServiceBroker::GetDataCacheCore().GetVideoDAR());
+      break;
+  case PLAYER_PROCESS_AUDIODECODER:
+      strLabel = g_dataCacheCore.GetAudioDecoderName();
+      break;
+  case PLAYER_PROCESS_AUDIOCHANNELS:
+      strLabel = g_dataCacheCore.GetAudioChannels();
+      break;
   case RDS_AUDIO_LANG:
   case RDS_CHANNEL_COUNTRY:
   case RDS_TITLE:
@@ -6555,6 +6600,18 @@ bool CGUIInfoManager::GetInt(int &value, int info, int contextWindow, const CGUI
     case SYSTEM_BATTERY_LEVEL:
       value = g_powerManager.BatteryLevel();
       return true;
+    case PLAYER_PROCESS_VIDEOWIDTH:
+      value = g_dataCacheCore.GetVideoWidth();
+      return true;
+    case PLAYER_PROCESS_VIDEOHEIGHT:
+      value = g_dataCacheCore.GetVideoHeight();
+      return true;
+    case PLAYER_PROCESS_AUDIOSAMPLERATE:
+      value = g_dataCacheCore.GetAudioSampleRate();
+      return true;
+    case PLAYER_PROCESS_AUDIOBITSPERSAMPLE:
+      value = g_dataCacheCore.GetAudioBitsPerSampe();
+      return true;
   }
   return false;
 }
@@ -7090,6 +7147,9 @@ bool CGUIInfoManager::GetBool(int condition1, int contextWindow, const CGUIListI
                    !m_currentFile->GetPVRRadioRDSInfoTag()->GetSMSStudio().empty() ||
                    !m_currentFile->GetPVRRadioRDSInfoTag()->GetPhoneStudio().empty());
     break;
+    case PLAYER_PROCESS_VIDEOHWDECODER:
+        bReturn = g_dataCacheCore.IsVideoHwDecoder();
+        break;
     default: // default, use integer value different from 0 as true
       {
         int val;
diff --git a/xbmc/cores/DataCacheCore.cpp b/xbmc/cores/DataCacheCore.cpp
index 68cf2fb..cbb0a4f 100644
--- a/xbmc/cores/DataCacheCore.cpp
+++ b/xbmc/cores/DataCacheCore.cpp
@@ -19,6 +19,12 @@
 */
 
 #include "cores/DataCacheCore.h"
+#include "threads/SingleLock.h"
+
+CDataCacheCore::CDataCacheCore()
+{
+  m_hasAVInfoChanges = false;
+}
 
 bool CDataCacheCore::HasAVInfoChanges()
 {
@@ -35,4 +41,162 @@ void CDataCacheCore::SignalVideoInfoChange()
 void CDataCacheCore::SignalAudioInfoChange()
 {
   m_hasAVInfoChanges = true;
-}
\ No newline at end of file
+}
+
+void CDataCacheCore::SetVideoDecoderName(std::string name, bool isHw)
+{
+  CSingleLock lock(m_videoPlayerSection);
+
+  m_playerVideoInfo.decoderName = name;
+  m_playerVideoInfo.isHwDecoder = isHw;
+}
+
+std::string CDataCacheCore::GetVideoDecoderName()
+{
+  CSingleLock lock(m_videoPlayerSection);
+
+  return m_playerVideoInfo.decoderName;
+}
+
+bool CDataCacheCore::IsVideoHwDecoder()
+{
+  CSingleLock lock(m_videoPlayerSection);
+
+  return m_playerVideoInfo.isHwDecoder;
+}
+
+
+void CDataCacheCore::SetVideoDeintMethod(std::string method)
+{
+  CSingleLock lock(m_videoPlayerSection);
+
+  m_playerVideoInfo.deintMethod = method;
+}
+
+std::string CDataCacheCore::GetVideoDeintMethod()
+{
+  CSingleLock lock(m_videoPlayerSection);
+
+  return m_playerVideoInfo.deintMethod;
+}
+
+void CDataCacheCore::SetVideoPixelFormat(std::string pixFormat)
+{
+  CSingleLock lock(m_videoPlayerSection);
+
+  m_playerVideoInfo.pixFormat = pixFormat;
+}
+
+std::string CDataCacheCore::GetVideoPixelFormat()
+{
+  CSingleLock lock(m_videoPlayerSection);
+
+  return m_playerVideoInfo.pixFormat;
+}
+
+void CDataCacheCore::SetVideoDimensions(int width, int height)
+{
+  CSingleLock lock(m_videoPlayerSection);
+
+  m_playerVideoInfo.width = width;
+  m_playerVideoInfo.height = height;
+}
+
+int CDataCacheCore::GetVideoWidth()
+{
+  CSingleLock lock(m_videoPlayerSection);
+
+  return m_playerVideoInfo.width;
+}
+
+int CDataCacheCore::GetVideoHeight()
+{
+  CSingleLock lock(m_videoPlayerSection);
+
+  return m_playerVideoInfo.height;
+}
+
+void CDataCacheCore::SetVideoFps(float fps)
+{
+  CSingleLock lock(m_videoPlayerSection);
+
+  m_playerVideoInfo.fps = fps;
+}
+
+float CDataCacheCore::GetVideoFps()
+{
+  CSingleLock lock(m_videoPlayerSection);
+
+  return m_playerVideoInfo.fps;
+}
+
+void CDataCacheCore::SetVideoDAR(float dar)
+{
+  CSingleLock lock(m_videoPlayerSection);
+
+  m_playerVideoInfo.dar = dar;
+}
+
+float CDataCacheCore::GetVideoDAR()
+{
+  CSingleLock lock(m_videoPlayerSection);
+
+  return m_playerVideoInfo.dar;
+}
+
+// player audio info
+void CDataCacheCore::SetAudioDecoderName(std::string name)
+{
+  CSingleLock lock(m_audioPlayerSection);
+
+  m_playerAudioInfo.decoderName = name;
+}
+
+std::string CDataCacheCore::GetAudioDecoderName()
+{
+  CSingleLock lock(m_audioPlayerSection);
+
+  return m_playerAudioInfo.decoderName;
+}
+
+void CDataCacheCore::SetAudioChannels(std::string channels)
+{
+  CSingleLock lock(m_audioPlayerSection);
+
+  m_playerAudioInfo.channels = channels;
+}
+
+std::string CDataCacheCore::GetAudioChannels()
+{
+  CSingleLock lock(m_audioPlayerSection);
+
+  return m_playerAudioInfo.channels;
+}
+
+void CDataCacheCore::SetAudioSampleRate(int sampleRate)
+{
+  CSingleLock lock(m_audioPlayerSection);
+
+  m_playerAudioInfo.sampleRate = sampleRate;
+}
+
+int CDataCacheCore::GetAudioSampleRate()
+{
+  CSingleLock lock(m_audioPlayerSection);
+
+  return m_playerAudioInfo.sampleRate;
+}
+
+void CDataCacheCore::SetAudioBitsPerSample(int bitsPerSample)
+{
+  CSingleLock lock(m_audioPlayerSection);
+
+  m_playerAudioInfo.bitsPerSample = bitsPerSample;
+}
+
+int CDataCacheCore::GetAudioBitsPerSampe()
+{
+  CSingleLock lock(m_audioPlayerSection);
+
+  return m_playerAudioInfo.bitsPerSample;
+}
diff --git a/xbmc/cores/DataCacheCore.h b/xbmc/cores/DataCacheCore.h
index 0df013d..e16c81f 100644
--- a/xbmc/cores/DataCacheCore.h
+++ b/xbmc/cores/DataCacheCore.h
@@ -20,15 +20,68 @@
 *
 */
 
+#include <atomic>
+#include <string>
+#include "threads/CriticalSection.h"
+
 class CDataCacheCore
 {
 public:
+  CDataCacheCore();
   bool HasAVInfoChanges();
   void SignalVideoInfoChange();
   void SignalAudioInfoChange();
 
+  // player video info
+  void SetVideoDecoderName(std::string name, bool isHw);
+  std::string GetVideoDecoderName();
+  bool IsVideoHwDecoder();
+  void SetVideoDeintMethod(std::string method);
+  std::string GetVideoDeintMethod();
+  void SetVideoPixelFormat(std::string pixFormat);
+  std::string GetVideoPixelFormat();
+  void SetVideoDimensions(int width, int height);
+  int GetVideoWidth();
+  int GetVideoHeight();
+  void SetVideoFps(float fps);
+  float GetVideoFps();
+  void SetVideoDAR(float dar);
+  float GetVideoDAR();
+
+  // player audio info
+  void SetAudioDecoderName(std::string name);
+  std::string GetAudioDecoderName();
+  void SetAudioChannels(std::string channels);
+  std::string GetAudioChannels();
+  void SetAudioSampleRate(int sampleRate);
+  int GetAudioSampleRate();
+  void SetAudioBitsPerSample(int bitsPerSample);
+  int GetAudioBitsPerSampe();
+  
 protected:
-  volatile bool m_hasAVInfoChanges;
+  std::atomic_bool m_hasAVInfoChanges;
+
+  CCriticalSection m_videoPlayerSection;
+  struct SPlayerVideoInfo
+  {
+    std::string decoderName;
+    bool isHwDecoder;
+    std::string deintMethod;
+    std::string pixFormat;
+    int width;
+    int height;
+    float fps;
+    float dar;
+  } m_playerVideoInfo;
+
+  CCriticalSection m_audioPlayerSection;
+  struct SPlayerAudioInfo
+  {
+    std::string decoderName;
+    std::string channels;
+    int sampleRate;
+    int bitsPerSample;
+  } m_playerAudioInfo;
 };
 
 extern CDataCacheCore g_dataCacheCore;
\ No newline at end of file
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodec.h b/xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodec.h
index 7e0da61..bb698da 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodec.h
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodec.h
@@ -23,6 +23,7 @@
 #include "system.h"
 #include "cores/AudioEngine/Utils/AEAudioFormat.h"
 #include "cores/AudioEngine/Utils/AEUtil.h"
+#include "cores/VideoPlayer/Process/ProcessInfo.h"
 #include "DVDClock.h"
 
 
@@ -64,7 +65,7 @@ class CDVDAudioCodec
 {
 public:
 
-  CDVDAudioCodec() {}
+  CDVDAudioCodec(CProcessInfo &processInfo) : m_processInfo(processInfo) {}
   virtual ~CDVDAudioCodec() {}
 
   /*
@@ -138,4 +139,7 @@ class CDVDAudioCodec
    * should return the ffmpeg profile value
    */
   virtual int GetProfile() { return 0; }
+
+protected:
+  CProcessInfo &m_processInfo;
 };
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp
index a21894e..f5880cc 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp
@@ -35,7 +35,7 @@ extern "C" {
 #include "cores/AudioEngine/Utils/AEUtil.h"
 #endif
 
-CDVDAudioCodecFFmpeg::CDVDAudioCodecFFmpeg() : CDVDAudioCodec()
+CDVDAudioCodecFFmpeg::CDVDAudioCodecFFmpeg(CProcessInfo &processInfo) : CDVDAudioCodec(processInfo)
 {
   m_pCodecContext = NULL;
 
@@ -126,6 +126,7 @@ bool CDVDAudioCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options
   m_iSampleFormat = AV_SAMPLE_FMT_NONE;
   m_matrixEncoding = AV_MATRIX_ENCODING_NONE;
 
+  m_processInfo.SetAudioDecoderName(m_pCodecContext->codec->name);
   return true;
 }
 
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.h b/xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.h
index a15317a..d5760bb 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.h
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.h
@@ -29,10 +29,12 @@ extern "C" {
 #include "libswresample/swresample.h"
 }
 
+class CProcessInfo;
+
 class CDVDAudioCodecFFmpeg : public CDVDAudioCodec
 {
 public:
-  CDVDAudioCodecFFmpeg();
+  CDVDAudioCodecFFmpeg(CProcessInfo &processInfo);
   virtual ~CDVDAudioCodecFFmpeg();
   virtual bool Open(CDVDStreamInfo &hints, CDVDCodecOptions &options);
   virtual void Dispose();
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodecPassthrough.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodecPassthrough.cpp
index 1fb00e1..8009297 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodecPassthrough.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodecPassthrough.cpp
@@ -29,7 +29,8 @@
 
 #define TRUEHD_BUF_SIZE 61440
 
-CDVDAudioCodecPassthrough::CDVDAudioCodecPassthrough(void) :
+CDVDAudioCodecPassthrough::CDVDAudioCodecPassthrough(CProcessInfo &processInfo) :
+  CDVDAudioCodec(processInfo),
   m_buffer(NULL),
   m_bufferSize(0),
   m_trueHDoffset(0)
@@ -51,22 +52,26 @@ bool CDVDAudioCodecPassthrough::Open(CDVDStreamInfo &hints, CDVDCodecOptions &op
     case AV_CODEC_ID_AC3:
       format.m_streamInfo.m_type = CAEStreamInfo::STREAM_TYPE_AC3;
       format.m_streamInfo.m_sampleRate = hints.samplerate;
+      m_processInfo.SetAudioDecoderName("PT_AC3");
       break;
 
     case AV_CODEC_ID_EAC3:
       format.m_streamInfo.m_type = CAEStreamInfo::STREAM_TYPE_EAC3;
       format.m_streamInfo.m_sampleRate = hints.samplerate;
+      m_processInfo.SetAudioDecoderName("PT_EAC3");
       break;
 
     case AV_CODEC_ID_DTS:
       format.m_streamInfo.m_type = CAEStreamInfo::STREAM_TYPE_DTSHD;
       format.m_streamInfo.m_sampleRate = hints.samplerate;
+      m_processInfo.SetAudioDecoderName("PT_DTSHD");
       break;
 
     case AV_CODEC_ID_TRUEHD:
       format.m_streamInfo.m_type = CAEStreamInfo::STREAM_TYPE_TRUEHD;
       format.m_streamInfo.m_sampleRate = hints.samplerate;
       m_trueHDBuffer.reset(new uint8_t[TRUEHD_BUF_SIZE]);
+      m_processInfo.SetAudioDecoderName("PT_TRUEHD");
       break;
 
     default:
@@ -83,6 +88,8 @@ bool CDVDAudioCodecPassthrough::Open(CDVDStreamInfo &hints, CDVDCodecOptions &op
 
     // only get the dts core from the parser if we don't support dtsHD
     m_parser.SetCoreOnly(true);
+
+    m_processInfo.SetAudioDecoderName("PT_DTS");
   }
 
   m_dataSize = 0;
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodecPassthrough.h b/xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodecPassthrough.h
index a04e736..4005429 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodecPassthrough.h
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodecPassthrough.h
@@ -29,10 +29,12 @@
 #include "cores/AudioEngine/Utils/AEStreamInfo.h"
 #include "cores/AudioEngine/Utils/AEBitstreamPacker.h"
 
+class CProcessInfo;
+
 class CDVDAudioCodecPassthrough : public CDVDAudioCodec
 {
 public:
-  CDVDAudioCodecPassthrough();
+  CDVDAudioCodecPassthrough(CProcessInfo &processInfo);
   virtual ~CDVDAudioCodecPassthrough();
 
   virtual bool Open(CDVDStreamInfo &hints, CDVDCodecOptions &options);
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.cpp
index bb5bfe0..9717412 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.cpp
@@ -173,7 +173,7 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, CProces
   return nullptr;;
 }
 
-CDVDAudioCodec* CDVDFactoryCodec::CreateAudioCodec(CDVDStreamInfo &hint, bool allowpassthrough, bool allowdtshddecode)
+CDVDAudioCodec* CDVDFactoryCodec::CreateAudioCodec(CDVDStreamInfo &hint, CProcessInfo &processInfo, bool allowpassthrough, bool allowdtshddecode)
 {
   CDVDAudioCodec* pCodec = NULL;
   CDVDCodecOptions options;
@@ -184,12 +184,12 @@ CDVDAudioCodec* CDVDFactoryCodec::CreateAudioCodec(CDVDStreamInfo &hint, bool al
   // we don't use passthrough if "sync playback to display" is enabled
   if (allowpassthrough)
   {
-    pCodec = OpenCodec(new CDVDAudioCodecPassthrough(), hint, options);
+    pCodec = OpenCodec(new CDVDAudioCodecPassthrough(processInfo), hint, options);
     if (pCodec)
       return pCodec;
   }
 
-  pCodec = OpenCodec(new CDVDAudioCodecFFmpeg(), hint, options);
+  pCodec = OpenCodec(new CDVDAudioCodecFFmpeg(processInfo), hint, options);
   if (pCodec)
     return pCodec;
 
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.h b/xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.h
index 45e794b98..d11c700 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.h
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.h
@@ -41,7 +41,8 @@ class CDVDFactoryCodec
   static CDVDVideoCodec* CreateVideoCodec(CDVDStreamInfo &hint,
                                           CProcessInfo &processInfo,
                                           const CRenderInfo &info = CRenderInfo());
-  static CDVDAudioCodec* CreateAudioCodec(CDVDStreamInfo &hint, bool allowpassthrough = true, bool allowdtshddecode = true);
+  static CDVDAudioCodec* CreateAudioCodec(CDVDStreamInfo &hint, CProcessInfo &processInfo,
+                                          bool allowpassthrough = true, bool allowdtshddecode = true);
   static CDVDOverlayCodec* CreateOverlayCodec(CDVDStreamInfo &hint );
 
   static CDVDAudioCodec* OpenCodec(CDVDAudioCodec* pCodec, CDVDStreamInfo &hint, CDVDCodecOptions &options );
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
index 0414d85..967d518 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
@@ -68,6 +68,7 @@ extern "C" {
 #include "libavfilter/avfilter.h"
 #include "libavfilter/buffersink.h"
 #include "libavfilter/buffersrc.h"
+#include "libavutil/pixdesc.h"
 }
 
 enum DecoderState
@@ -88,11 +89,12 @@ enum EFilterFlags {
   FILTER_ROTATE              = 0x40,  //< rotate image according to the codec hints
 };
 
-enum AVPixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx
-                                                , const AVPixelFormat * fmt )
+enum AVPixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx, const AVPixelFormat * fmt)
 {
   CDVDVideoCodecFFmpeg* ctx  = (CDVDVideoCodecFFmpeg*)avctx->opaque;
 
+  const char* pixFmtName = av_get_pix_fmt_name(*fmt);
+
   // if frame threading is enabled hw accel is not allowed
   if(ctx->m_decoderState != STATE_HW_SINGLE)
   {
@@ -122,9 +124,10 @@ enum AVPixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avct
     if(VDPAU::CDecoder::IsVDPAUFormat(*cur) && CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_USEVDPAU))
     {
       CLog::Log(LOGNOTICE,"CDVDVideoCodecFFmpeg::GetFormat - Creating VDPAU(%ix%i)", avctx->width, avctx->height);
-      VDPAU::CDecoder* vdp = new VDPAU::CDecoder();
+      VDPAU::CDecoder* vdp = new VDPAU::CDecoder(ctx->m_processInfo);
       if(vdp->Open(avctx, ctx->m_pCodecContext, *cur, ctx->m_uSurfacesCount))
       {
+        ctx->m_processInfo.SetVideoPixelFormat(pixFmtName ? pixFmtName : "");
         ctx->SetHardware(vdp);
         return *cur;
       }
@@ -137,9 +140,10 @@ enum AVPixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avct
      !ctx->m_hints.dvd && !ctx->m_hints.stills)
   {
     CLog::Log(LOGNOTICE, "CDVDVideoCodecFFmpeg::GetFormat - Creating DXVA(%ix%i)", avctx->width, avctx->height);
-    DXVA::CDecoder* dec = new DXVA::CDecoder();
+    DXVA::CDecoder* dec = new DXVA::CDecoder(ctx->m_processInfo);
     if(dec->Open(avctx, ctx->m_pCodecContext, *cur, ctx->m_uSurfacesCount))
     {
+      ctx->m_processInfo.SetVideoPixelFormat(pixFmtName ? pixFmtName : "");
       ctx->SetHardware(dec);
       return *cur;
     }
@@ -151,9 +155,10 @@ enum AVPixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avct
     // mpeg4 vaapi decoding is disabled
     if(*cur == AV_PIX_FMT_VAAPI_VLD && CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_USEVAAPI))
     {
-      VAAPI::CDecoder* dec = new VAAPI::CDecoder();
+      VAAPI::CDecoder* dec = new VAAPI::CDecoder(ctx->m_processInfo);
       if(dec->Open(avctx, ctx->m_pCodecContext, *cur, ctx->m_uSurfacesCount) == true)
       {
+        ctx->m_processInfo.SetVideoPixelFormat(pixFmtName ? pixFmtName : "");
         ctx->SetHardware(dec);
         return *cur;
       }
@@ -165,9 +170,10 @@ enum AVPixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avct
 #ifdef TARGET_DARWIN
     if (*cur == AV_PIX_FMT_VIDEOTOOLBOX && CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_USEVTB))
     {
-      VTB::CDecoder* dec = new VTB::CDecoder();
+      VTB::CDecoder* dec = new VTB::CDecoder(ctx->m_processInfo);
       if(dec->Open(avctx, ctx->m_pCodecContext, *cur, ctx->m_uSurfacesCount))
       {
+        ctx->m_processInfo.SetVideoPixelFormat(pixFmtName ? pixFmtName : "");
         ctx->SetHardware(dec);
         return *cur;
       }
@@ -183,6 +189,7 @@ enum AVPixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avct
       ctx->m_pCodecContext->hwaccel_context = (void *)ctx->m_options.m_opaque_pointer;
       if(dec->Open(avctx, ctx->m_pCodecContext, *cur, ctx->m_uSurfacesCount))
       {
+        ctx->m_processInfo.SetVideoPixelFormat(pixFmtName ? pixFmtName : "");
         ctx->SetHardware(dec);
         return *cur;
       }
@@ -193,6 +200,7 @@ enum AVPixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avct
     cur++;
   }
 
+  ctx->m_processInfo.SetVideoPixelFormat(pixFmtName ? pixFmtName : "");
   ctx->m_decoderState = STATE_HW_FAILED;
   return avcodec_default_get_format(avctx, fmt);
 }
@@ -226,6 +234,7 @@ CDVDVideoCodecFFmpeg::CDVDVideoCodecFFmpeg(CProcessInfo &processInfo) : CDVDVide
   m_skippedDeint = 0;
   m_droppedFrames = 0;
   m_interlaced = false;
+  m_DAR = 1.0;
 }
 
 CDVDVideoCodecFFmpeg::~CDVDVideoCodecFFmpeg()
@@ -385,6 +394,9 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options
   }
 
   UpdateName();
+
+  m_processInfo.SetVideoDecoderName(m_name, m_pHardware ? true : false);
+  m_processInfo.SetVideoDimensions(m_pCodecContext->coded_width, m_pCodecContext->coded_height);
   return true;
 }
 
@@ -746,6 +758,12 @@ bool CDVDVideoCodecFFmpeg::GetPictureCommon(DVDVideoPicture* pDvdVideoPicture)
   if (aspect_ratio <= 0.0)
     aspect_ratio = (float)pDvdVideoPicture->iWidth / (float)pDvdVideoPicture->iHeight;
 
+  if (m_DAR != aspect_ratio)
+  {
+    m_DAR = aspect_ratio;
+    m_processInfo.SetVideoDAR(m_DAR);
+  }
+
   /* XXX: we suppose the screen has a 1.0 pixel ratio */ // CDVDVideo will compensate it.
   pDvdVideoPicture->iDisplayHeight = pDvdVideoPicture->iHeight;
   pDvdVideoPicture->iDisplayWidth  = ((int)RINT(pDvdVideoPicture->iHeight * aspect_ratio)) & -3;
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h
index 4ef2982..20bc1ff 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h
@@ -119,6 +119,7 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec
   bool   m_requestSkipDeint;
   int    m_codecControlFlags;
   bool m_interlaced;
+  double m_DAR;
   CDVDStreamInfo m_hints;
   CDVDCodecOptions m_options;
 };
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DXVA.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DXVA.cpp
index f8730c5..fb83b42 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DXVA.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DXVA.cpp
@@ -29,6 +29,7 @@
 #include <d3d11.h>
 #include <Initguid.h>
 #include <windows.h>
+#include "cores/VideoPlayer/Process/ProcessInfo.h"
 #include "cores/VideoPlayer/VideoRenderers/RenderManager.h"
 #include "../DVDCodecUtils.h"
 #include "DXVA.h"
@@ -689,8 +690,9 @@ CRenderPicture::~CRenderPicture()
 // DXVA Decoder
 //-----------------------------------------------------------------------------
 
-CDecoder::CDecoder()
- : m_event(true)
+CDecoder::CDecoder(CProcessInfo& processInfo)
+ : m_event(true),
+   m_processInfo(processInfo)
 {
   m_event.Set();
   m_state     = DXVA_OPEN;
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DXVA.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DXVA.h
index ab756f7..2170515 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DXVA.h
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DXVA.h
@@ -28,6 +28,8 @@
 #include "libavcodec/d3d11va.h"
 #include "threads/Event.h"
 
+class CProcessInfo;
+
 namespace DXVA {
 
 #define CHECK(a) \
@@ -114,7 +116,7 @@ class CDecoder
   , public ID3DResource
 {
 public:
-  CDecoder();
+  CDecoder(CProcessInfo& processInfo);
  ~CDecoder();
 
   // IHardwareDecoder overrides
@@ -163,6 +165,7 @@ class CDecoder
   unsigned int m_surface_alignment;
   CCriticalSection m_section;
   CEvent m_event;
+  CProcessInfo& m_processInfo;
 };
 
 };
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.cpp
index c014ce2..1b4c8e8 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.cpp
@@ -24,6 +24,7 @@
 #include "DVDVideoCodec.h"
 #include "cores/VideoPlayer/DVDCodecs/DVDCodecUtils.h"
 #include "cores/VideoPlayer/DVDClock.h"
+#include "cores/VideoPlayer/Process/ProcessInfo.h"
 #include "utils/log.h"
 #include "utils/StringUtils.h"
 #include "threads/SingleLock.h"
@@ -444,7 +445,9 @@ bool CVideoSurfaces::HasRefs()
 // VAAPI
 //-----------------------------------------------------------------------------
 
-CDecoder::CDecoder() : m_vaapiOutput(&m_inMsgEvent)
+CDecoder::CDecoder(CProcessInfo& processInfo) :
+  m_vaapiOutput(&m_inMsgEvent),
+  m_processInfo(processInfo)
 {
   m_vaapiConfig.videoSurfaces = &m_videoSurfaces;
 
@@ -453,6 +456,7 @@ CDecoder::CDecoder() : m_vaapiOutput(&m_inMsgEvent)
   m_vaapiConfig.context = 0;
   m_vaapiConfig.contextId = VA_INVALID_ID;
   m_vaapiConfig.configId = VA_INVALID_ID;
+  m_vaapiConfig.processInfo = &m_processInfo;
   m_avctx = NULL;
   m_getBufferError = 0;
 }
@@ -2016,6 +2020,7 @@ void COutput::InitCycle()
       delete m_pp;
       m_pp = NULL;
       DropVppProcessedPictures();
+      m_config.processInfo->SetVideoDeintMethod("unknown");
     }
     if (!m_pp)
     {
@@ -2034,6 +2039,17 @@ void COutput::InitCycle()
       {
         m_pp->Init(method);
         m_currentDiMethod = method;
+
+        if (method == VS_INTERLACEMETHOD_DEINTERLACE)
+          m_config.processInfo->SetVideoDeintMethod("yadif");
+        else if (method == VS_INTERLACEMETHOD_RENDER_BOB)
+          m_config.processInfo->SetVideoDeintMethod("render-bob");
+        else if (method == VS_INTERLACEMETHOD_VAAPI_BOB)
+          m_config.processInfo->SetVideoDeintMethod("vaapi-bob");
+        else if (method == VS_INTERLACEMETHOD_VAAPI_MADI)
+          m_config.processInfo->SetVideoDeintMethod("vaapi-madi");
+        else if (method == VS_INTERLACEMETHOD_VAAPI_MACI)
+          m_config.processInfo->SetVideoDeintMethod("vaapi-maci");
       }
       else
       {
@@ -2066,6 +2082,7 @@ void COutput::InitCycle()
       {
         m_pp->Init(method);
         m_currentDiMethod = method;
+        m_config.processInfo->SetVideoDeintMethod("none");
       }
       else
       {
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.h
index cc744c7..08c5dfc 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.h
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.h
@@ -48,6 +48,7 @@ extern "C" {
 
 using namespace Actor;
 
+class CProcessInfo;
 
 #define FULLHD_WIDTH                       1920
 
@@ -125,6 +126,7 @@ struct CVaapiConfig
   VAProfile profile;
   VAConfigAttrib attrib;
   Display *x11dsp;
+  CProcessInfo *processInfo;
 };
 
 /**
@@ -411,7 +413,7 @@ class CDecoder
 
 public:
 
-  CDecoder();
+  CDecoder(CProcessInfo& processInfo);
   virtual ~CDecoder();
 
   virtual bool Open      (AVCodecContext* avctx, AVCodecContext* mainctx, const enum AVPixelFormat, unsigned int surfaces = 0);
@@ -468,6 +470,7 @@ class CDecoder
 
   int m_codecControl;
   std::vector<EINTERLACEMETHOD> m_diMethods;
+  CProcessInfo& m_processInfo;
 };
 
 //-----------------------------------------------------------------------------
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VDPAU.cpp
index 331b719..377c72b 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VDPAU.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VDPAU.cpp
@@ -25,6 +25,7 @@
 #include "windowing/WindowingFactory.h"
 #include "guilib/GraphicContext.h"
 #include "guilib/TextureManager.h"
+#include "cores/VideoPlayer/Process/ProcessInfo.h"
 #include "cores/VideoPlayer/VideoRenderers/RenderManager.h"
 #include "DVDVideoCodecFFmpeg.h"
 #include "DVDClock.h"
@@ -467,13 +468,14 @@ int CVideoSurfaces::Size()
 // CVDPAU
 //-----------------------------------------------------------------------------
 
-CDecoder::CDecoder() : m_vdpauOutput(&m_inMsgEvent)
+CDecoder::CDecoder(CProcessInfo& processInfo) : m_vdpauOutput(&m_inMsgEvent), m_processInfo(processInfo)
 {
   m_vdpauConfig.videoSurfaces = &m_videoSurfaces;
 
   m_vdpauConfigured = false;
   m_DisplayState = VDPAU_OPEN;
   m_vdpauConfig.context = 0;
+  m_vdpauConfig.processInfo = &m_processInfo;
 }
 
 bool CDecoder::Open(AVCodecContext* avctx, AVCodecContext* mainctx, const enum AVPixelFormat fmt, unsigned int surfaces)
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VDPAU.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VDPAU.h
index 56601a1..59432ad 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VDPAU.h
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VDPAU.h
@@ -70,6 +70,8 @@ extern "C" {
 #define FULLHD_WIDTH                       1920
 #define MAX_PIC_Q_LENGTH                   20 //for non-interop_yuv this controls the max length of the decoded pic to render completion Q
 
+class CProcessInfo;
+
 namespace VDPAU
 {
 
@@ -182,6 +184,7 @@ struct CVdpauConfig
   uint32_t maxReferences;
   bool useInteropYuv;
   CVDPAUContext *context;
+  CProcessInfo *processInfo;
 };
 
 /**
@@ -556,7 +559,7 @@ class CDecoder
     uint32_t aux; /* optional extra parameter... */
   };
 
-  CDecoder();
+  CDecoder(CProcessInfo& processInfo);
   virtual ~CDecoder();
 
   virtual bool Open      (AVCodecContext* avctx, AVCodecContext* mainctx, const enum AVPixelFormat, unsigned int surfaces = 0);
@@ -623,6 +626,7 @@ class CDecoder
   CVdpauRenderPicture *m_presentPicture;
 
   int m_codecControl;
+  CProcessInfo& m_processInfo;
 };
 
 }
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VTB.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VTB.cpp
index 253aefd..287b7c1 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VTB.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VTB.cpp
@@ -21,6 +21,7 @@
 #ifdef TARGET_DARWIN
 #include "platform/darwin/osx/CocoaInterface.h"
 #include "platform/darwin/DarwinUtils.h"
+#include "cores/VideoPlayer/Process/ProcessInfo.h"
 #include "DVDVideoCodec.h"
 #include "DVDCodecs/DVDCodecUtils.h"
 #include "utils/log.h"
@@ -34,7 +35,7 @@ extern "C" {
 using namespace VTB;
 
 
-CDecoder::CDecoder()
+CDecoder::CDecoder(CProcessInfo& processInfo) : m_processInfo(processInfo)
 {
   m_avctx = nullptr;
 }
@@ -86,6 +87,7 @@ bool CDecoder::Open(AVCodecContext *avctx, AVCodecContext* mainctx, enum AVPixel
   mainctx->pix_fmt = fmt;
   mainctx->hwaccel_context = avctx->hwaccel_context;
 
+  m_processInfo.SetVideoDeintMethod("none");
   return true;
 }
 
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VTB.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VTB.h
index 1e097d4..bad295b 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VTB.h
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VTB.h
@@ -23,6 +23,8 @@
 
 #include "DVDVideoCodecFFmpeg.h"
 
+class CProcessInfo;
+
 namespace VTB
 {
 
@@ -30,7 +32,7 @@ class CDecoder
   : public CDVDVideoCodecFFmpeg::IHardwareDecoder
 {
 public:
-  CDecoder();
+  CDecoder(CProcessInfo& processInfo);
  ~CDecoder();
   virtual bool Open(AVCodecContext* avctx, AVCodecContext* mainctx, const enum AVPixelFormat, unsigned int surfaces = 0);
   virtual int Decode(AVCodecContext* avctx, AVFrame* frame);
@@ -43,7 +45,7 @@ class CDecoder
 protected:
   unsigned m_renderbuffers_count;
   AVCodecContext *m_avctx;
-
+  CProcessInfo& m_processInfo;
 };
 
 }
diff --git a/xbmc/cores/VideoPlayer/Process/ProcessInfo.cpp b/xbmc/cores/VideoPlayer/Process/ProcessInfo.cpp
index ceaa256..fc1f5dd 100644
--- a/xbmc/cores/VideoPlayer/Process/ProcessInfo.cpp
+++ b/xbmc/cores/VideoPlayer/Process/ProcessInfo.cpp
@@ -19,6 +19,8 @@
  */
 
 #include "ProcessInfo.h"
+#include "cores/DataCacheCore.h"
+#include "threads/SingleLock.h"
 
 // Override for platform ports
 #if !defined(PLATFORM_OVERRIDE)
@@ -51,3 +53,200 @@ bool CProcessInfo::AllowDTSHDDecode()
 {
   return true;
 }
+
+void CProcessInfo::ResetVideoCodecInfo()
+{
+  CSingleLock lock(m_videoCodecSection);
+
+  m_videoIsHWDecoder = false;
+  m_videoDecoderName = "unknown";
+  m_videoDeintMethod = "unknown";
+  m_videoPixelFormat = "unknown";
+  m_videoWidth = 0;
+  m_videoHeight = 0;
+  m_videoFPS = 0.0;
+
+  g_dataCacheCore.SetVideoDecoderName(m_videoDecoderName, m_videoIsHWDecoder);
+  g_dataCacheCore.SetVideoDeintMethod(m_videoDeintMethod);
+  g_dataCacheCore.SetVideoPixelFormat(m_videoPixelFormat);
+  g_dataCacheCore.SetVideoDimensions(m_videoWidth, m_videoHeight);
+  g_dataCacheCore.SetVideoFps(m_videoFPS);
+}
+
+void CProcessInfo::SetVideoDecoderName(std::string name, bool isHw)
+{
+  CSingleLock lock(m_videoCodecSection);
+
+  m_videoIsHWDecoder = isHw;
+  m_videoDecoderName = name;
+
+  g_dataCacheCore.SetVideoDecoderName(m_videoDecoderName, m_videoIsHWDecoder);
+}
+
+std::string CProcessInfo::GetVideoDecoderName()
+{
+  CSingleLock lock(m_videoCodecSection);
+
+  return m_videoDecoderName;
+}
+
+bool CProcessInfo::IsVideoHwDecoder()
+{
+  CSingleLock lock(m_videoCodecSection);
+
+  return m_videoIsHWDecoder;
+}
+
+void CProcessInfo::SetVideoDeintMethod(std::string method)
+{
+  CSingleLock lock(m_videoCodecSection);
+
+  m_videoDeintMethod = method;
+
+  g_dataCacheCore.SetVideoDeintMethod(m_videoDeintMethod);
+}
+
+std::string CProcessInfo::GetVideoDeintMethod()
+{
+  CSingleLock lock(m_videoCodecSection);
+
+  return m_videoDeintMethod;
+}
+
+void CProcessInfo::SetVideoPixelFormat(std::string pixFormat)
+{
+  CSingleLock lock(m_videoCodecSection);
+
+  m_videoPixelFormat = pixFormat;
+
+  g_dataCacheCore.SetVideoPixelFormat(m_videoPixelFormat);
+}
+
+std::string CProcessInfo::GetVideoPixelFormat()
+{
+  CSingleLock lock(m_videoCodecSection);
+
+  return m_videoPixelFormat;
+}
+
+void CProcessInfo::SetVideoDimensions(int width, int height)
+{
+  CSingleLock lock(m_videoCodecSection);
+
+  m_videoWidth = width;
+  m_videoHeight = height;
+
+  g_dataCacheCore.SetVideoDimensions(m_videoWidth, m_videoHeight);
+}
+
+void CProcessInfo::GetVideoDimensions(int &width, int &height)
+{
+  CSingleLock lock(m_videoCodecSection);
+
+  width = m_videoWidth;
+  height = m_videoHeight;
+}
+
+void CProcessInfo::SetVideoFps(float fps)
+{
+  CSingleLock lock(m_videoCodecSection);
+
+  m_videoFPS = fps;
+
+  g_dataCacheCore.SetVideoFps(m_videoFPS);
+}
+
+float CProcessInfo::GetVideoFps()
+{
+  CSingleLock lock(m_videoCodecSection);
+
+  return m_videoFPS;
+}
+
+void CProcessInfo::SetVideoDAR(float dar)
+{
+  CSingleLock lock(m_videoCodecSection);
+
+  m_videoDAR = dar;
+
+  CServiceBroker::GetDataCacheCore().SetVideoDAR(m_videoDAR);
+}
+
+float CProcessInfo::GetVideoDAR()
+{
+  CSingleLock lock(m_videoCodecSection);
+
+  return m_videoDAR;
+}
+
+// player audio info
+void CProcessInfo::ResetAudioCodecInfo()
+{
+  CSingleLock lock(m_audioCodecSection);
+
+  m_audioDecoderName = "unknown";
+  m_audioChannels = "unknown";
+  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);
+}
+
+void CProcessInfo::SetAudioDecoderName(std::string name)
+{
+  CSingleLock lock(m_audioCodecSection);
+
+  m_audioDecoderName = name;
+}
+
+std::string CProcessInfo::GetAudioDecoderName()
+{
+  CSingleLock lock(m_audioCodecSection);
+
+  return m_audioDecoderName;
+}
+
+void CProcessInfo::SetAudioChannels(std::string channels)
+{
+  CSingleLock lock(m_audioCodecSection);
+
+  m_audioChannels = channels;
+}
+
+std::string CProcessInfo::GetAudioChannels()
+{
+  CSingleLock lock(m_audioCodecSection);
+
+  return m_audioChannels;
+}
+
+void CProcessInfo::SetAudioSampleRate(int sampleRate)
+{
+  CSingleLock lock(m_audioCodecSection);
+
+  m_audioSampleRate = sampleRate;
+}
+
+int CProcessInfo::GetAudioSampleRate()
+{
+  CSingleLock lock(m_audioCodecSection);
+
+  return m_audioSampleRate;
+}
+
+void CProcessInfo::SetAudioBitsPerSample(int bitsPerSample)
+{
+  CSingleLock lock(m_audioCodecSection);
+
+  m_audioBitsPerSample = bitsPerSample;
+}
+
+int CProcessInfo::GetAudioBitsPerSampe()
+{
+  CSingleLock lock(m_audioCodecSection);
+
+  return m_audioBitsPerSample;
+}
diff --git a/xbmc/cores/VideoPlayer/Process/ProcessInfo.h b/xbmc/cores/VideoPlayer/Process/ProcessInfo.h
index b8a4e46..0ec9a2c 100644
--- a/xbmc/cores/VideoPlayer/Process/ProcessInfo.h
+++ b/xbmc/cores/VideoPlayer/Process/ProcessInfo.h
@@ -20,6 +20,8 @@
 #pragma once
 
 #include "cores/IPlayer.h"
+#include "threads/CriticalSection.h"
+#include <string>
 
 class CProcessInfo
 {
@@ -29,6 +31,51 @@ class CProcessInfo
   virtual EINTERLACEMETHOD GetFallbackDeintMethod();
   virtual bool AllowDTSHDDecode();
 
+  // player video info
+  void ResetVideoCodecInfo();
+  void SetVideoDecoderName(std::string name, bool isHw);
+  std::string GetVideoDecoderName();
+  bool IsVideoHwDecoder();
+  void SetVideoDeintMethod(std::string method);
+  std::string GetVideoDeintMethod();
+  void SetVideoPixelFormat(std::string pixFormat);
+  std::string GetVideoPixelFormat();
+  void SetVideoDimensions(int width, int height);
+  void GetVideoDimensions(int &width, int &height);
+  void SetVideoFps(float fps);
+  float GetVideoFps();
+  void SetVideoDAR(float dar);
+  float GetVideoDAR();
+
+  // player audio info
+  void ResetAudioCodecInfo();
+  void SetAudioDecoderName(std::string name);
+  std::string GetAudioDecoderName();
+  void SetAudioChannels(std::string channels);
+  std::string GetAudioChannels();
+  void SetAudioSampleRate(int sampleRate);
+  int GetAudioSampleRate();
+  void SetAudioBitsPerSample(int bitsPerSample);
+  int GetAudioBitsPerSampe();
+
 protected:
   CProcessInfo();
+
+  // player video info
+  bool m_videoIsHWDecoder;
+  std::string m_videoDecoderName;
+  std::string m_videoDeintMethod;
+  std::string m_videoPixelFormat;
+  int m_videoWidth;
+  int m_videoHeight;
+  float m_videoFPS;
+  float m_videoDAR;
+  CCriticalSection m_videoCodecSection;
+
+  // player audio info
+  std::string m_audioDecoderName;
+  std::string m_audioChannels;
+  int m_audioSampleRate;
+  int m_audioBitsPerSample;
+  CCriticalSection m_audioCodecSection;
 };
diff --git a/xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp b/xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp
index fb1d993..2422815 100644
--- a/xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp
+++ b/xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp
@@ -90,11 +90,13 @@ CVideoPlayerAudio::~CVideoPlayerAudio()
 
 bool CVideoPlayerAudio::OpenStream(CDVDStreamInfo &hints)
 {
+  m_processInfo.ResetAudioCodecInfo();
+
   CLog::Log(LOGNOTICE, "Finding audio codec for: %i", hints.codec);
   bool allowpassthrough = !CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_USEDISPLAYASCLOCK);
   if (hints.realtime)
     allowpassthrough = false;
-  CDVDAudioCodec* codec = CDVDFactoryCodec::CreateAudioCodec(hints, allowpassthrough, m_processInfo.AllowDTSHDDecode());
+  CDVDAudioCodec* codec = CDVDFactoryCodec::CreateAudioCodec(hints, m_processInfo, allowpassthrough, m_processInfo.AllowDTSHDDecode());
   if(!codec)
   {
     CLog::Log(LOGERROR, "Unsupported audio codec");
@@ -451,6 +453,11 @@ void CVideoPlayerAudio::Process()
 
           m_streaminfo.channels = audioframe.format.m_channelLayout.Count();
 
+
+          m_processInfo.SetAudioChannels(audioframe.format.m_channelLayout);
+          m_processInfo.SetAudioSampleRate(audioframe.format.m_sampleRate);
+          m_processInfo.SetAudioBitsPerSample(audioframe.bits_per_sample);
+
           m_messageParent.Put(new CDVDMsg(CDVDMsg::PLAYER_AVCHANGE));
         }
 
@@ -595,7 +602,7 @@ bool CVideoPlayerAudio::SwitchCodecIfNeeded()
   bool allowpassthrough = !CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_USEDISPLAYASCLOCK);
   if (m_streaminfo.realtime)
     allowpassthrough = false;
-  CDVDAudioCodec *codec = CDVDFactoryCodec::CreateAudioCodec(m_streaminfo, allowpassthrough, m_processInfo.AllowDTSHDDecode());
+  CDVDAudioCodec *codec = CDVDFactoryCodec::CreateAudioCodec(m_streaminfo, m_processInfo, allowpassthrough, m_processInfo.AllowDTSHDDecode());
   if (!codec || codec->NeedPassthrough() == m_pAudioCodec->NeedPassthrough()) {
     // passthrough state has not changed
     delete codec;
diff --git a/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp b/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp
index 8e5d33dc..fd260d43 100644
--- a/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp
+++ b/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp
@@ -120,6 +120,8 @@ double CVideoPlayerVideo::GetOutputDelay()
 
 bool CVideoPlayerVideo::OpenStream( CDVDStreamInfo &hint )
 {
+  m_processInfo.ResetVideoCodecInfo();
+
   CRenderInfo info;
   info = m_renderManager.GetRenderInfo();
 
@@ -156,11 +158,13 @@ void CVideoPlayerVideo::OpenStream(CDVDStreamInfo &hint, CDVDVideoCodec* codec)
   {
     m_fFrameRate = DVD_TIME_BASE / CDVDCodecUtils::NormalizeFrameduration((double)DVD_TIME_BASE * hint.fpsscale / hint.fpsrate);
     m_bFpsInvalid = false;
+    m_processInfo.SetVideoFps(m_fFrameRate);
   }
   else
   {
     m_fFrameRate = 25;
     m_bFpsInvalid = true;
+    m_processInfo.SetVideoFps(0);
   }
 
   m_pullupCorrection.ResetVFRDetection();
@@ -1023,6 +1027,7 @@ void CVideoPlayerVideo::CalcFrameRate()
         CLog::Log(LOGDEBUG,"%s framerate was:%f calculated:%f", __FUNCTION__, m_fFrameRate, m_fStableFrameRate / m_iFrameRateCount);
         m_fFrameRate = m_fStableFrameRate / m_iFrameRateCount;
         m_bFpsInvalid = false;
+        m_processInfo.SetVideoFps(m_fFrameRate);
       }
 
       //reset the stored framerates
diff --git a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp b/xbmc/cores/omxplayer/OMXPlayerAudio.cpp
index 50a5b17..6161962 100644
--- a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp
+++ b/xbmc/cores/omxplayer/OMXPlayerAudio.cpp
@@ -100,6 +100,7 @@ bool OMXPlayerAudio::OpenStream(CDVDStreamInfo &hints)
 {
   m_bad_state = false;
 
+  m_processInfo.ResetAudioCodecInfo();
   COMXAudioCodecOMX *codec = new COMXAudioCodecOMX();
 
   if(!codec || !codec->Open(hints))
diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp
index 236f1b3..0ec7f15 100644
--- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp
+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp
@@ -515,6 +515,8 @@ bool OMXPlayerVideo::OpenDecoder()
   if(!m_av_clock)
     return false;
 
+  m_processInfo.ResetVideoCodecInfo();
+
   if (m_hints.fpsrate && m_hints.fpsscale)
     m_fFrameRate = DVD_TIME_BASE / CDVDCodecUtils::NormalizeFrameduration((double)DVD_TIME_BASE * m_hints.fpsscale / m_hints.fpsrate);
   else
@@ -525,6 +527,8 @@ bool OMXPlayerVideo::OpenDecoder()
     CLog::Log(LOGINFO, "OMXPlayerVideo::OpenDecoder : Invalid framerate %d, using forced 25fps and just trust timestamps\n", (int)m_fFrameRate);
     m_fFrameRate = 25;
   }
+  m_processInfo.SetVideoFps(m_fFrameRate);
+
   // use aspect in stream if available
   if (m_hints.forced_aspect)
     m_fForcedAspectRatio = m_hints.aspect;
@@ -705,6 +709,9 @@ 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.SetVideoAspectRatio(display_aspect);
+
   unsigned int iDisplayWidth  = width;
   unsigned int iDisplayHeight = height;
 
diff --git a/xbmc/cores/paplayer/VideoPlayerCodec.cpp b/xbmc/cores/paplayer/VideoPlayerCodec.cpp
index 9056cf8..32add6c 100644
--- a/xbmc/cores/paplayer/VideoPlayerCodec.cpp
+++ b/xbmc/cores/paplayer/VideoPlayerCodec.cpp
@@ -46,6 +46,8 @@ VideoPlayerCodec::VideoPlayerCodec()
   m_pResampler = NULL;
   m_needConvert = false;
   m_channels = 0;
+
+  m_processInfo.reset(CProcessInfo::CreateInstance());
 }
 
 VideoPlayerCodec::~VideoPlayerCodec()
@@ -165,7 +167,7 @@ bool VideoPlayerCodec::Init(const CFileItem &file, unsigned int filecache)
 
   CDVDStreamInfo hint(*pStream, true);
 
-  m_pAudioCodec = CDVDFactoryCodec::CreateAudioCodec(hint);
+  m_pAudioCodec = CDVDFactoryCodec::CreateAudioCodec(hint, *m_processInfo.get());
   if (!m_pAudioCodec)
   {
     CLog::Log(LOGERROR, "%s: Could not create audio codec", __FUNCTION__);
diff --git a/xbmc/cores/paplayer/VideoPlayerCodec.h b/xbmc/cores/paplayer/VideoPlayerCodec.h
index 81379bd..042f4f7 100644
--- a/xbmc/cores/paplayer/VideoPlayerCodec.h
+++ b/xbmc/cores/paplayer/VideoPlayerCodec.h
@@ -73,6 +73,8 @@ class VideoPlayerCodec : public ICodec
   bool m_needConvert;
   AEAudioFormat m_srcFormat;
   int m_channels;
+
+  std::unique_ptr<CProcessInfo> m_processInfo;
 };
 
 #endif
diff --git a/xbmc/guiinfo/GUIInfoLabels.h b/xbmc/guiinfo/GUIInfoLabels.h
index 27d6bc2..96edafa 100644
--- a/xbmc/guiinfo/GUIInfoLabels.h
+++ b/xbmc/guiinfo/GUIInfoLabels.h
@@ -562,6 +562,20 @@
 #define RDS_CHANNEL_COUNTRY         (RDS_DATA_START + 44)
 #define RDS_DATA_END                RDS_CHANNEL_COUNTRY
 
+#define PLAYER_PROCESS              1500
+#define PLAYER_PROCESS_VIDEODECODER (PLAYER_PROCESS)
+#define PLAYER_PROCESS_DEINTMETHOD (PLAYER_PROCESS + 1)
+#define PLAYER_PROCESS_PIXELFORMAT (PLAYER_PROCESS + 2)
+#define PLAYER_PROCESS_VIDEOWIDTH (PLAYER_PROCESS + 3)
+#define PLAYER_PROCESS_VIDEOHEIGHT (PLAYER_PROCESS + 4)
+#define PLAYER_PROCESS_VIDEOFPS (PLAYER_PROCESS + 5)
+#define PLAYER_PROCESS_VIDEODAR (PLAYER_PROCESS + 6)
+#define PLAYER_PROCESS_VIDEOHWDECODER (PLAYER_PROCESS + 7)
+#define PLAYER_PROCESS_AUDIODECODER (PLAYER_PROCESS + 8)
+#define PLAYER_PROCESS_AUDIOCHANNELS (PLAYER_PROCESS + 9)
+#define PLAYER_PROCESS_AUDIOSAMPLERATE (PLAYER_PROCESS + 10)
+#define PLAYER_PROCESS_AUDIOBITSPERSAMPLE (PLAYER_PROCESS + 11)
+
 #define WINDOW_PROPERTY             9993
 #define WINDOW_IS_TOPMOST           9994
 #define WINDOW_IS_VISIBLE           9995

From 6855680f52c826aa2a2e2684c5607e00a6f8fff1 Mon Sep 17 00:00:00 2001
From: Rainer Hochecker <fernetmenta@online.de>
Date: Wed, 22 Jun 2016 18:48:10 +0200
Subject: [PATCH 2/3] remove DataCacheCore from systemGlobals

---
 xbmc/Application.cpp                           |  1 +
 xbmc/GUIInfoManager.cpp                        | 24 ++++++++++-----------
 xbmc/ServiceBroker.cpp                         |  5 +++++
 xbmc/ServiceBroker.h                           |  2 ++
 xbmc/ServiceManager.cpp                        |  7 +++++++
 xbmc/ServiceManager.h                          |  3 +++
 xbmc/SystemGlobals.cpp                         |  4 ----
 xbmc/cores/DataCacheCore.cpp                   |  6 ++++++
 xbmc/cores/DataCacheCore.h                     |  5 ++---
 xbmc/cores/VideoPlayer/Process/ProcessInfo.cpp | 29 +++++++++++++-------------
 xbmc/cores/VideoPlayer/VideoPlayer.cpp         | 14 +++++++------
 xbmc/cores/paplayer/PAPlayer.cpp               |  3 ++-
 12 files changed, 63 insertions(+), 40 deletions(-)

diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
index cdcf53e..baada48 100644
--- a/xbmc/Application.cpp
+++ b/xbmc/Application.cpp
@@ -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"
diff --git a/xbmc/GUIInfoManager.cpp b/xbmc/GUIInfoManager.cpp
index ab5cb12..7d42106 100644
--- a/xbmc/GUIInfoManager.cpp
+++ b/xbmc/GUIInfoManager.cpp
@@ -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_VIDEODAR:
       strLabel = StringUtils::FormatNumber(CServiceBroker::GetDataCacheCore().GetVideoDAR());
       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;
diff --git a/xbmc/ServiceBroker.cpp b/xbmc/ServiceBroker.cpp
index fff03c3..dd5c640 100644
--- a/xbmc/ServiceBroker.cpp
+++ b/xbmc/ServiceBroker.cpp
@@ -50,3 +50,8 @@ ActiveAE::CActiveAEDSP &CServiceBroker::GetADSP()
 {
   return g_application.m_ServiceManager->GetADSPManager();
 }
+
+CDataCacheCore &CServiceBroker::GetDataCacheCore()
+{
+  return g_application.m_ServiceManager->GetDataCacheCore();
+}
diff --git a/xbmc/ServiceBroker.h b/xbmc/ServiceBroker.h
index 32add30..9f9de19 100644
--- a/xbmc/ServiceBroker.h
+++ b/xbmc/ServiceBroker.h
@@ -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();
 };
diff --git a/xbmc/ServiceManager.cpp b/xbmc/ServiceManager.cpp
index 3cc188c..4cf4440 100644
--- a/xbmc/ServiceManager.cpp
+++ b/xbmc/ServiceManager.cpp
@@ -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;
+}
\ No newline at end of file
diff --git a/xbmc/ServiceManager.h b/xbmc/ServiceManager.h
index 9b7806f6..5c7a9a8 100644
--- a/xbmc/ServiceManager.h
+++ b/xbmc/ServiceManager.h
@@ -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;
 };
diff --git a/xbmc/SystemGlobals.cpp b/xbmc/SystemGlobals.cpp
index 9354471..3d1cb55 100644
--- a/xbmc/SystemGlobals.cpp
+++ b/xbmc/SystemGlobals.cpp
@@ -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;
-
diff --git a/xbmc/cores/DataCacheCore.cpp b/xbmc/cores/DataCacheCore.cpp
index cbb0a4f..43a24f1 100644
--- a/xbmc/cores/DataCacheCore.cpp
+++ b/xbmc/cores/DataCacheCore.cpp
@@ -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;
diff --git a/xbmc/cores/DataCacheCore.h b/xbmc/cores/DataCacheCore.h
index e16c81f..646f512 100644
--- a/xbmc/cores/DataCacheCore.h
+++ b/xbmc/cores/DataCacheCore.h
@@ -28,6 +28,7 @@ class CDataCacheCore
 {
 public:
   CDataCacheCore();
+  static CDataCacheCore& GetInstance();
   bool HasAVInfoChanges();
   void SignalVideoInfoChange();
   void SignalAudioInfoChange();
@@ -82,6 +83,4 @@ class CDataCacheCore
     int sampleRate;
     int bitsPerSample;
   } m_playerAudioInfo;
-};
-
-extern CDataCacheCore g_dataCacheCore;
\ No newline at end of file
+};
\ No newline at end of file
diff --git a/xbmc/cores/VideoPlayer/Process/ProcessInfo.cpp b/xbmc/cores/VideoPlayer/Process/ProcessInfo.cpp
index fc1f5dd..bfd7d58 100644
--- a/xbmc/cores/VideoPlayer/Process/ProcessInfo.cpp
+++ b/xbmc/cores/VideoPlayer/Process/ProcessInfo.cpp
@@ -19,6 +19,7 @@
  */
 
 #include "ProcessInfo.h"
+#include "ServiceBroker.h"
 #include "cores/DataCacheCore.h"
 #include "threads/SingleLock.h"
 
@@ -66,11 +67,11 @@ void CProcessInfo::ResetVideoCodecInfo()
   m_videoHeight = 0;
   m_videoFPS = 0.0;
 
-  g_dataCacheCore.SetVideoDecoderName(m_videoDecoderName, m_videoIsHWDecoder);
-  g_dataCacheCore.SetVideoDeintMethod(m_videoDeintMethod);
-  g_dataCacheCore.SetVideoPixelFormat(m_videoPixelFormat);
-  g_dataCacheCore.SetVideoDimensions(m_videoWidth, m_videoHeight);
-  g_dataCacheCore.SetVideoFps(m_videoFPS);
+  CServiceBroker::GetDataCacheCore().SetVideoDecoderName(m_videoDecoderName, m_videoIsHWDecoder);
+  CServiceBroker::GetDataCacheCore().SetVideoDeintMethod(m_videoDeintMethod);
+  CServiceBroker::GetDataCacheCore().SetVideoPixelFormat(m_videoPixelFormat);
+  CServiceBroker::GetDataCacheCore().SetVideoDimensions(m_videoWidth, m_videoHeight);
+  CServiceBroker::GetDataCacheCore().SetVideoFps(m_videoFPS);
 }
 
 void CProcessInfo::SetVideoDecoderName(std::string name, bool isHw)
@@ -80,7 +81,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()
@@ -103,7 +104,7 @@ void CProcessInfo::SetVideoDeintMethod(std::string method)
 
   m_videoDeintMethod = method;
 
-  g_dataCacheCore.SetVideoDeintMethod(m_videoDeintMethod);
+  CServiceBroker::GetDataCacheCore().SetVideoDeintMethod(m_videoDeintMethod);
 }
 
 std::string CProcessInfo::GetVideoDeintMethod()
@@ -119,7 +120,7 @@ void CProcessInfo::SetVideoPixelFormat(std::string pixFormat)
 
   m_videoPixelFormat = pixFormat;
 
-  g_dataCacheCore.SetVideoPixelFormat(m_videoPixelFormat);
+  CServiceBroker::GetDataCacheCore().SetVideoPixelFormat(m_videoPixelFormat);
 }
 
 std::string CProcessInfo::GetVideoPixelFormat()
@@ -136,7 +137,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)
@@ -153,7 +154,7 @@ void CProcessInfo::SetVideoFps(float fps)
 
   m_videoFPS = fps;
 
-  g_dataCacheCore.SetVideoFps(m_videoFPS);
+  CServiceBroker::GetDataCacheCore().SetVideoFps(m_videoFPS);
 }
 
 float CProcessInfo::GetVideoFps()
@@ -189,10 +190,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)
diff --git a/xbmc/cores/VideoPlayer/VideoPlayer.cpp b/xbmc/cores/VideoPlayer/VideoPlayer.cpp
index 9ed9176..5205414 100644
--- a/xbmc/cores/VideoPlayer/VideoPlayer.cpp
+++ b/xbmc/cores/VideoPlayer/VideoPlayer.cpp
@@ -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"
 
@@ -545,8 +547,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
@@ -2872,8 +2874,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();
@@ -3596,8 +3598,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;
 }
diff --git a/xbmc/cores/paplayer/PAPlayer.cpp b/xbmc/cores/paplayer/PAPlayer.cpp
index 17e1cfc..6bd5180 100644
--- a/xbmc/cores/paplayer/PAPlayer.cpp
+++ b/xbmc/cores/paplayer/PAPlayer.cpp
@@ -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)

From 0337c933aaf3a438edba894780838f5c1fbb00f5 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Fri, 24 Jun 2016 19:37:32 +0100
Subject: [PATCH 3/3] rbp: Update to use new processInfo data cache

---
 .../VideoPlayer/DVDCodecs/Video/MMALCodec.cpp      | 19 +++++++++++++++++
 xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp          |  3 ++-
 xbmc/cores/omxplayer/OMXAudioCodecOMX.h            |  4 +++-
 xbmc/cores/omxplayer/OMXPlayerAudio.cpp            | 24 +++++++++++++++++++---
 xbmc/cores/omxplayer/OMXPlayerVideo.cpp            | 10 ++++-----
 xbmc/cores/omxplayer/OMXVideo.cpp                  | 20 +++++++++++++++++-
 xbmc/cores/omxplayer/OMXVideo.h                    |  4 +++-
 7 files changed, 72 insertions(+), 12 deletions(-)

diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp
index 3d026cd..51ded6b2 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp
@@ -177,6 +177,10 @@ void CMMALVideo::PortSettingsChanged(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *bu
     m_decoded_height = m_es_format->es->video.crop.height;
     m_decoded_aligned_width = m_es_format->es->video.width;
     m_decoded_aligned_height = m_es_format->es->video.height;
+
+    m_processInfo.SetVideoDimensions(m_decoded_width, m_decoded_height);
+    m_processInfo.SetVideoDAR(m_aspect_ratio);
+
     if (g_advancedSettings.CanLogComponent(LOGVIDEO))
       CLog::Log(LOGDEBUG, "%s::%s format changed: %dx%d (%dx%d) %.2f", CLASSNAME, __func__, m_decoded_width, m_decoded_height, m_decoded_aligned_width, m_decoded_aligned_height, m_aspect_ratio);
   }
@@ -360,6 +364,15 @@ bool CMMALVideo::CreateDeinterlace(EINTERLACEMETHOD interlace_method)
   bool advanced_deinterlace = interlace_method == VS_INTERLACEMETHOD_MMAL_ADVANCED || interlace_method == VS_INTERLACEMETHOD_MMAL_ADVANCED_HALF;
   bool half_framerate = interlace_method == VS_INTERLACEMETHOD_MMAL_ADVANCED_HALF || interlace_method == VS_INTERLACEMETHOD_MMAL_BOB_HALF;
 
+  if (advanced_deinterlace && !half_framerate)
+     m_processInfo.SetVideoDeintMethod("adv(x2)");
+  else if (advanced_deinterlace && half_framerate)
+     m_processInfo.SetVideoDeintMethod("adv(x1)");
+  else if (!advanced_deinterlace && !half_framerate)
+     m_processInfo.SetVideoDeintMethod("bob(x2)");
+  else if (!advanced_deinterlace && half_framerate)
+     m_processInfo.SetVideoDeintMethod("bob(x1)");
+
   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 }};
 
@@ -437,6 +450,8 @@ bool CMMALVideo::DestroyDeinterlace()
   if (g_advancedSettings.CanLogComponent(LOGVIDEO))
     CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__);
 
+  m_processInfo.SetVideoDeintMethod("none");
+
   assert(m_deint);
   assert(m_dec_output == m_deint->output[0]);
 
@@ -526,6 +541,8 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options)
   if (!CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_USEMMAL) || hints.software)
     return false;
 
+  m_processInfo.SetVideoDeintMethod("none");
+
   m_hints = hints;
   m_renderer = (CMMALRenderer *)options.m_opaque_pointer;
   MMAL_STATUS_T status;
@@ -732,6 +749,8 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options)
   m_preroll = !m_hints.stills;
   m_speed = DVD_PLAYSPEED_NORMAL;
 
+  m_processInfo.SetVideoDecoderName(m_pFormatName, true);
+
   return true;
 }
 
diff --git a/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp b/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp
index 20f706c..d8cef9c 100644
--- a/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp
+++ b/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp
@@ -33,7 +33,7 @@
 #define AUDIO_DECODE_OUTPUT_BUFFER (32*1024)
 static const char rounded_up_channels_shift[] = {0,0,1,2,2,3,3,3,3};
 
-COMXAudioCodecOMX::COMXAudioCodecOMX()
+COMXAudioCodecOMX::COMXAudioCodecOMX(CProcessInfo &processInfo) : m_processInfo(processInfo)
 {
   m_pBufferOutput = NULL;
   m_iBufferOutputAlloced = 0;
@@ -134,6 +134,7 @@ bool COMXAudioCodecOMX::Open(CDVDStreamInfo &hints)
 
   m_iSampleFormat = AV_SAMPLE_FMT_NONE;
   m_desiredSampleFormat = m_pCodecContext->sample_fmt == AV_SAMPLE_FMT_S16 ? AV_SAMPLE_FMT_S16 : AV_SAMPLE_FMT_FLTP;
+  m_processInfo.SetAudioDecoderName(m_pCodecContext->codec->name);
   return true;
 }
 
diff --git a/xbmc/cores/omxplayer/OMXAudioCodecOMX.h b/xbmc/cores/omxplayer/OMXAudioCodecOMX.h
index c06a323..3b2a0f3 100644
--- a/xbmc/cores/omxplayer/OMXAudioCodecOMX.h
+++ b/xbmc/cores/omxplayer/OMXAudioCodecOMX.h
@@ -31,11 +31,12 @@ extern "C" {
 
 #include "DVDStreamInfo.h"
 #include "linux/PlatformDefs.h"
+#include "cores/VideoPlayer/Process/ProcessInfo.h"
 
 class COMXAudioCodecOMX
 {
 public:
-  COMXAudioCodecOMX();
+  COMXAudioCodecOMX(CProcessInfo &processInfo);
   virtual ~COMXAudioCodecOMX();
   bool Open(CDVDStreamInfo &hints);
   void Dispose();
@@ -52,6 +53,7 @@ class COMXAudioCodecOMX
   unsigned int GetFrameSize() { return m_frameSize; }
 
 protected:
+  CProcessInfo &m_processInfo;
   AVCodecContext* m_pCodecContext;
   SwrContext*     m_pConvert;
   enum AVSampleFormat m_iSampleFormat;
diff --git a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp b/xbmc/cores/omxplayer/OMXPlayerAudio.cpp
index 6161962..1e5d2b9 100644
--- a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp
+++ b/xbmc/cores/omxplayer/OMXPlayerAudio.cpp
@@ -43,6 +43,7 @@
 #include "linux/RBP.h"
 #include "cores/AudioEngine/AEFactory.h"
 #include "cores/DataCacheCore.h"
+#include "ServiceBroker.h"
 
 #include <algorithm>
 #include <iomanip>
@@ -101,7 +102,7 @@ bool OMXPlayerAudio::OpenStream(CDVDStreamInfo &hints)
   m_bad_state = false;
 
   m_processInfo.ResetAudioCodecInfo();
-  COMXAudioCodecOMX *codec = new COMXAudioCodecOMX();
+  COMXAudioCodecOMX *codec = new COMXAudioCodecOMX(m_processInfo);
 
   if(!codec || !codec->Open(hints))
   {
@@ -143,7 +144,7 @@ void OMXPlayerAudio::OpenStream(CDVDStreamInfo &hints, COMXAudioCodecOMX *codec)
   m_format.m_sampleRate    = 0;
   m_format.m_channelLayout = 0;
 
-  g_dataCacheCore.SignalAudioInfoChange();
+  CServiceBroker::GetDataCacheCore().SignalAudioInfoChange();
 }
 
 void OMXPlayerAudio::CloseStream(bool bWaitForBuffers)
@@ -188,6 +189,7 @@ bool OMXPlayerAudio::CodecChange()
   {
     m_hints.channels = m_pAudioCodec->GetChannels();
     m_hints.samplerate = m_pAudioCodec->GetSampleRate();
+    m_hints.bitspersample = m_pAudioCodec->GetBitsPerSample();
   }
 
   /* only check bitrate changes on AV_CODEC_ID_DTS, AV_CODEC_ID_AC3, AV_CODEC_ID_EAC3 */
@@ -204,7 +206,11 @@ bool OMXPlayerAudio::CodecChange()
      (!m_passthrough && minor_change) || !m_DecoderOpen)
   {
     m_hints_current = m_hints;
-    g_dataCacheCore.SignalAudioInfoChange();
+
+    m_processInfo.SetAudioSampleRate(m_hints.samplerate);
+    m_processInfo.SetAudioBitsPerSample(m_hints.bitspersample);
+
+    CServiceBroker::GetDataCacheCore().SignalAudioInfoChange();
     return true;
   }
 
@@ -562,11 +568,23 @@ bool OMXPlayerAudio::OpenDecoder()
 
   CAEChannelInfo channelMap;
   if (m_pAudioCodec && !m_passthrough)
+  {
     channelMap = m_pAudioCodec->GetChannelMap();
+  }
   else if (m_passthrough)
+  {
     // we just want to get the channel count right to stop OMXAudio.cpp rejecting stream
     // the actual layout is not used
     channelMap = AE_CH_LAYOUT_5_1;
+
+    if (m_hints.codec == AV_CODEC_ID_AC3)
+      m_processInfo.SetAudioDecoderName("PT_AC3");
+    else if (m_hints.codec == AV_CODEC_ID_EAC3)
+      m_processInfo.SetAudioDecoderName("PT_EAC3");
+    else
+      m_processInfo.SetAudioDecoderName("PT_DTS");
+  }
+  m_processInfo.SetAudioChannels(channelMap);
   bool bAudioRenderOpen = m_omxAudio.Initialize(m_format, m_av_clock, m_hints, channelMap, m_passthrough);
 
   m_codec_name = "";
diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp
index 0ec7f15..6efd0d5 100644
--- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp
+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp
@@ -73,8 +73,7 @@ OMXPlayerVideo::OMXPlayerVideo(OMXClock *av_clock,
 : CThread("OMXPlayerVideo")
 , IDVDStreamPlayerVideo(processInfo)
 , m_messageQueue("video")
-, m_omxVideo(renderManager)
-, m_codecname("")
+, m_omxVideo(renderManager, processInfo)
 , m_messageParent(parent)
 , m_renderManager(renderManager)
 {
@@ -471,7 +470,7 @@ void OMXPlayerVideo::Process()
 
         if (m_syncState == IDVDStreamPlayer::SYNC_STARTING && !bRequestDrop && settings_changed)
         {
-          m_codecname = m_omxVideo.GetDecoderName();
+          m_processInfo.SetVideoDecoderName(m_omxVideo.GetDecoderName(), true);
           m_syncState = IDVDStreamPlayer::SYNC_WAITSYNC;
           SStartMsg msg;
           msg.player = VideoPlayer_VIDEO;
@@ -548,7 +547,7 @@ bool OMXPlayerVideo::OpenDecoder()
     CLog::Log(LOGINFO, "OMXPlayerVideo::OpenDecoder : Video codec %s width %d height %d profile %d fps %f\n",
         m_omxVideo.GetDecoderName().c_str() , m_hints.width, m_hints.height, m_hints.profile, m_fFrameRate);
 
-    m_codecname = m_omxVideo.GetDecoderName();
+    m_processInfo.SetVideoDecoderName(m_omxVideo.GetDecoderName(), true);
   }
 
   return bVideoDecoderOpen;
@@ -710,7 +709,7 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, f
   }
 
   m_processInfo.SetVideoDimensions(width, height);
-  m_processInfo.SetVideoAspectRatio(display_aspect);
+  m_processInfo.SetVideoDAR(display_aspect);
 
   unsigned int iDisplayWidth  = width;
   unsigned int iDisplayHeight = height;
@@ -722,6 +721,7 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, f
     iDisplayWidth = (int) (iDisplayHeight * display_aspect);
 
   m_fFrameRate = DVD_TIME_BASE / CDVDCodecUtils::NormalizeFrameduration((double)DVD_TIME_BASE / framerate);
+  m_processInfo.SetVideoFps(m_fFrameRate);
 
   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);
diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp
index 4c165bf..b2bb0a8 100644
--- a/xbmc/cores/omxplayer/OMXVideo.cpp
+++ b/xbmc/cores/omxplayer/OMXVideo.cpp
@@ -65,8 +65,9 @@
 
 #define MAX_TEXT_LENGTH 1024
 
-COMXVideo::COMXVideo(CRenderManager& renderManager) : m_video_codec_name("")
+COMXVideo::COMXVideo(CRenderManager& renderManager, CProcessInfo &processInfo) : m_video_codec_name("")
 , m_renderManager(renderManager)
+, m_processInfo(processInfo)
 {
   m_is_open           = false;
   m_extradata         = NULL;
@@ -244,6 +245,19 @@ bool COMXVideo::PortSettingsChanged(ResolutionUpdateInfo &resinfo)
     EINTERLACEMETHOD interlace_method = m_renderManager.AutoInterlaceMethod(CMediaSettings::GetInstance().GetCurrentVideoSettings().m_InterlaceMethod);
     bool advanced_deinterlace = interlace_method == VS_INTERLACEMETHOD_MMAL_ADVANCED || interlace_method == VS_INTERLACEMETHOD_MMAL_ADVANCED_HALF;
     bool half_framerate = interlace_method == VS_INTERLACEMETHOD_MMAL_ADVANCED_HALF || interlace_method == VS_INTERLACEMETHOD_MMAL_BOB_HALF;
+
+    if (advanced_deinterlace && !half_framerate)
+       m_processInfo.SetVideoDeintMethod("adv(x2)");
+    else if (advanced_deinterlace && half_framerate)
+       m_processInfo.SetVideoDeintMethod("adv(x1)");
+    else if (!advanced_deinterlace && !half_framerate)
+       m_processInfo.SetVideoDeintMethod("bob(x2)");
+    else if (!advanced_deinterlace && half_framerate)
+       m_processInfo.SetVideoDeintMethod("bob(x1)");
+
+    if (!half_framerate)
+      resinfo.framerate *= 2.0f;
+
     if (!advanced_deinterlace)
     {
       // Image_fx assumed 3 frames of context. simple deinterlace doesn't require this
@@ -280,6 +294,10 @@ bool COMXVideo::PortSettingsChanged(ResolutionUpdateInfo &resinfo)
       return false;
     }
   }
+  else
+  {
+    m_processInfo.SetVideoDeintMethod("none");
+  }
 
   if(m_deinterlace)
   {
diff --git a/xbmc/cores/omxplayer/OMXVideo.h b/xbmc/cores/omxplayer/OMXVideo.h
index 46e79cb..fd101e7 100644
--- a/xbmc/cores/omxplayer/OMXVideo.h
+++ b/xbmc/cores/omxplayer/OMXVideo.h
@@ -34,6 +34,7 @@
 #include "threads/CriticalSection.h"
 #include "xbmc/rendering/RenderSystem.h"
 #include "cores/VideoPlayer/VideoRenderers/RenderManager.h"
+#include "cores/VideoPlayer/Process/ProcessInfo.h"
 #include <string>
 
 #define VIDEO_BUFFERS 60
@@ -53,7 +54,7 @@ struct ResolutionUpdateInfo {
 class COMXVideo
 {
 public:
-  COMXVideo(CRenderManager& renderManager);
+  COMXVideo(CRenderManager& renderManager, CProcessInfo &processInfo);
   ~COMXVideo();
 
   // Required overrides
@@ -112,6 +113,7 @@ class COMXVideo
   OMX_DISPLAYTRANSFORMTYPE m_transform;
   bool              m_settings_changed;
   CRenderManager&   m_renderManager;
+  CProcessInfo&     m_processInfo;
   static bool NaluFormatStartCodes(enum AVCodecID codec, uint8_t *in_extradata, int in_extrasize);
   CCriticalSection m_critSection;
 };
