diff options
author | Thomas Reufer <thomas@reufer.ch> | 2014-10-06 12:45:17 +0200 |
---|---|---|
committer | Thomas Reufer <thomas@reufer.ch> | 2014-10-06 12:45:17 +0200 |
commit | 5249b7a1795e554ffab7e2fb7b5626d0f5eddf0e (patch) | |
tree | adbf8fbda3709480b890839be015fdf5e99e2844 /display.h | |
parent | 50ae3a6c391be3150e2803a82d5af06f1c80ecb2 (diff) | |
download | vdr-plugin-rpihddevice-5249b7a1795e554ffab7e2fb7b5626d0f5eddf0e.tar.gz vdr-plugin-rpihddevice-5249b7a1795e554ffab7e2fb7b5626d0f5eddf0e.tar.bz2 |
introduce HDMI mode settings and move display handling to cRpiDisplay
Diffstat (limited to 'display.h')
-rw-r--r-- | display.h | 78 |
1 files changed, 74 insertions, 4 deletions
@@ -7,26 +7,96 @@ #ifndef DISPLAY_H #define DISPLAY_H +#include "tools.h" + +extern "C" { #include "interface/vmcs_host/vc_dispmanx_types.h" +} class cRpiDisplay { public: - static int Open(int device); - static void Close(void); + static cRpiDisplay* GetInstance(void); + static void DropInstance(void); static int GetSize(int &width, int &height); + static int GetSize(int &width, int &height, double &aspect); + + static cRpiVideoPort::ePort GetVideoPort(void); + static bool IsProgressive(void); + + static int Get(int &width, int &height, int &frameRate, bool &interlaced); + static int Set(int width, int height, int frameRate, bool interlaced); + static int AddElement(DISPMANX_ELEMENT_HANDLE_T &element, int width, int height, int layer); static int Snapshot(uint8_t* frame, int width, int height); +protected: + + cRpiDisplay(int width, int height, int frameRate, + cRpiVideoPort::ePort port); + virtual ~cRpiDisplay(); + + virtual int SetMode(int width, int height, int frameRate, bool interlaced) { + return 0; + } + + int m_width; + int m_height; + int m_frameRate; + bool m_interlaced; + cRpiVideoPort::ePort m_port; + + static cRpiDisplay *s_instance; + +private: + + cRpiDisplay(const cRpiDisplay&); + cRpiDisplay& operator= (const cRpiDisplay&); + + class cHandles; + cHandles *m_handles; +}; + +class cRpiHDMIDisplay : public cRpiDisplay +{ + +public: + + cRpiHDMIDisplay(int width, int height, int frameRate, int group, int mode); + virtual ~cRpiHDMIDisplay(); + private: - static DISPMANX_DISPLAY_HANDLE_T s_display; - static DISPMANX_UPDATE_HANDLE_T s_update; + virtual int SetMode(int width, int height, int frameRate, bool interlaced); + int SetMode(int group, int mode); + + class ModeList; + ModeList *m_modes; + + int m_group; + int m_mode; + + int m_startGroup; + int m_startMode; + bool m_modified; +}; + +class cRpiCompositeDisplay : public cRpiDisplay +{ + +public: + + cRpiCompositeDisplay(int width, int height, int frameRate); + +private: + virtual int SetMode(int width, int height, int frameRate, bool interlaced) { + return 0; + } }; #endif |