vdr-plugin-softhddevice-drm-gles 1.6.2
grab.h
Go to the documentation of this file.
1// SPDX-License-Identifier: AGPL-3.0-or-later
2
12#ifndef __GRAB_H
13#define __GRAB_H
14
15#include <cstdint>
16
17#include <vdr/osd.h>
18
19class cDrmBuffer;
20class cVideoRender;
21
32
33inline const char* GrabtypeToString(Grabtype t) {
34 switch(t) {
35 case Grabtype::GRABVIDEO: return "VIDEO";
36 case Grabtype::GRABPIP: return "PIP";
37 case Grabtype::GRABOSD: return "OSD";
38 }
39 return "Unknown";
40}
41
50public:
51 cGrabBuffer(void) = default;
52
53 void FreeDrmBuf(void);
54 void SetDrmBuf(cDrmBuffer *);
55
56 // setters and getters
58 void SetSize(int size) { m_size = size; };
59
60 int GetX(void) { return m_rect.X(); };
61 int GetY(void) { return m_rect.Y(); };
62 int GetWidth(void) { return m_rect.Width(); };
63 int GetHeight(void) { return m_rect.Height(); };
64 uint8_t *GetData(void) { return m_pResult; };
65 int GetSize(void) { return m_size; };
66 cDrmBuffer *GetDrmBuf(void) { return m_pBuf; };
67private:
68 uint8_t *m_pResult = nullptr;
69 struct cDrmBuffer *m_pBuf = nullptr;
70 int m_size = 0;
72};
73
80public:
81 cSoftHdGrab(cVideoRender *render) : m_pRender(render) {};
82
83 bool Active(void) { return m_isActive; };
84 bool Start(bool, int, int, int, int, int);
85 uint8_t *Image(void) { return m_grabbedImage; };
86 int Size(void) { return m_grabbedSize; };
87
88private:
92 bool m_isActive = false;
93
94 bool m_isJpeg = true;
100
101 bool ProcessGrab(void);
102 uint8_t *GetGrab(int *, int *, int *, int *, int *, Grabtype);
103};
104
107#endif
DRM Buffer.
Definition drmbuffer.h:47
Grabbing Buffer.
Definition grab.h:49
void SetData(uint8_t *result)
Definition grab.h:57
void SetSize(int size)
Definition grab.h:58
uint8_t * GetData(void)
Definition grab.h:64
uint8_t * m_pResult
pointer to grabbed image
Definition grab.h:68
cRect m_rect
rect of the grabbed data
Definition grab.h:71
int GetHeight(void)
Definition grab.h:63
cGrabBuffer(void)=default
int GetSize(void)
Definition grab.h:65
int GetWidth(void)
Definition grab.h:62
int m_size
size of grabbed data
Definition grab.h:70
struct cDrmBuffer * m_pBuf
pointer to original buffer
Definition grab.h:69
int GetY(void)
Definition grab.h:61
cDrmBuffer * GetDrmBuf(void)
Definition grab.h:66
int GetX(void)
Definition grab.h:60
Grabbing Processor.
Definition grab.h:79
int m_screenWidth
pixel screenwidth
Definition grab.h:98
int m_quality
quality of the jpeg image
Definition grab.h:95
uint8_t * m_grabbedImage
pointer to the finished grabbed image
Definition grab.h:90
int m_grabbedWidth
pixel width of the grabbed image
Definition grab.h:96
int m_screenHeight
pixel screenheight
Definition grab.h:99
bool m_isActive
true, if a grab process is currently running
Definition grab.h:92
int m_grabbedSize
data size of the grabbed image
Definition grab.h:91
uint8_t * Image(void)
Definition grab.h:85
bool m_isJpeg
true, if a jpeg image was requested
Definition grab.h:94
int m_grabbedHeight
pixel height of the grabbed image
Definition grab.h:97
bool Active(void)
Definition grab.h:83
cVideoRender * m_pRender
pointer to cVideoRender object
Definition grab.h:89
int Size(void)
Definition grab.h:86
cSoftHdGrab(cVideoRender *render)
Definition grab.h:81
Video Renderer.
uint8_t * GetGrab(int *, int *, int *, int *, int *, Grabtype)
Convert the cloned drm buffer data to RGB(void, pip) or ARGB (osd) and return a pointer to the raw da...
Definition grab.cpp:373
bool Start(bool, int, int, int, int, int)
Start a grab in the video renderer.
Definition grab.cpp:329
void FreeDrmBuf(void)
Free the grabbed drm buffer.
Definition grab.cpp:290
void SetDrmBuf(cDrmBuffer *)
Set the grab buffer and the dimensions how it is presented on the screen.
Definition grab.cpp:309
bool ProcessGrab(void)
Start the conversion.
Definition grab.cpp:447
Grabtype
Definition grab.h:27
const char * GrabtypeToString(Grabtype t)
Definition grab.h:33
@ GRABPIP
Definition grab.h:29
@ GRABOSD
Definition grab.h:30
@ GRABVIDEO
Definition grab.h:28