Merge pull request #4314 from MartijnKaijser/beta1
[vuplus_xbmc] / xbmc / linux / RBP.h
1 #pragma once
2 /*
3  *      Copyright (C) 2005-2013 Team XBMC
4  *      http://xbmc.org
5  *
6  *  This Program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2, or (at your option)
9  *  any later version.
10  *
11  *  This Program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with XBMC; see the file COPYING.  If not, see
18  *  <http://www.gnu.org/licenses/>.
19  *
20  */
21
22 #ifndef USE_VCHIQ_ARM
23 #define USE_VCHIQ_ARM
24 #endif
25 #ifndef __VIDEOCORE4__
26 #define __VIDEOCORE4__
27 #endif
28 #ifndef HAVE_VMCS_CONFIG
29 #define HAVE_VMCS_CONFIG
30 #endif
31
32 #if defined(HAVE_CONFIG_H) && !defined(TARGET_WINDOWS)
33 #include "config.h"
34 #define DECLARE_UNUSED(a,b) a __attribute__((unused)) b;
35 #endif
36
37 #if defined(TARGET_RASPBERRY_PI)
38 #include "DllBCM.h"
39 #include "OMXCore.h"
40 #include "threads/CriticalSection.h"
41
42 class CRBP
43 {
44 public:
45   CRBP();
46   ~CRBP();
47
48   bool Initialize();
49   void LogFirmwareVerison();
50   void Deinitialize();
51   int GetArmMem() { return m_arm_mem; }
52   int GetGpuMem() { return m_gpu_mem; }
53   bool GetCodecMpg2() { return m_codec_mpg2_enabled; }
54   bool GetCodecWvc1() { return m_codec_wvc1_enabled; }
55   void GetDisplaySize(int &width, int &height);
56   // stride can be null for packed output
57   unsigned char *CaptureDisplay(int width, int height, int *stride, bool swap_red_blue, bool video_only = true);
58   DllOMX *GetDllOMX() { return m_OMX ? m_OMX->GetDll() : NULL; }
59
60 private:
61   DllBcmHost *m_DllBcmHost;
62   bool       m_initialized;
63   bool       m_omx_initialized;
64   bool       m_omx_image_init;
65   int        m_arm_mem;
66   int        m_gpu_mem;
67   bool       m_codec_mpg2_enabled;
68   bool       m_codec_wvc1_enabled;
69   COMXCore   *m_OMX;
70   class DllLibOMXCore;
71   CCriticalSection m_critSection;
72 };
73
74 extern CRBP g_RBP;
75 #endif