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