vdr-plugin-softhddevice-drm-gles 1.6.4-d0291bb
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
54public:
55 cGrabBuffer(void) = default;
56
57 void FreeDrmBuf(void);
58 void SetDrmBuf(cDrmBuffer *);
59
60 // setters and getters
62 void SetSize(int size) { m_size = size; };
63
64 int GetX(void) { return m_rect.X(); };
65 int GetY(void) { return m_rect.Y(); };
66 int GetWidth(void) { return m_rect.Width(); };
67 int GetHeight(void) { return m_rect.Height(); };
68 uint8_t *GetData(void) { return m_pResult; };
69 int GetSize(void) { return m_size; };
70 cDrmBuffer *GetDrmBuf(void) { return m_pBuf; };
71private:
72 uint8_t *m_pResult = nullptr;
73 struct cDrmBuffer *m_pBuf = nullptr;
74 int m_size = 0;
76};
77
86public:
87 cSoftHdGrab(cVideoRender *render) : m_pRender(render) {};
88
89 bool Active(void) { return m_isActive; };
90 bool Start(bool, int, int, int, int, int);
91 uint8_t *Image(void) { return m_grabbedImage; };
92 int Size(void) { return m_grabbedSize; };
93
94private:
98 bool m_isActive = false;
99
100 bool m_isJpeg = true;
106
107 bool ProcessGrab(void);
108 uint8_t *GetGrab(int *, int *, int *, int *, int *, Grabtype);
109};
110
111#endif
DRM Buffer.
Definition drmbuffer.h:46
Grabbing Buffer.
Definition grab.h:53
void SetData(uint8_t *result)
Definition grab.h:61
void SetSize(int size)
Definition grab.h:62
uint8_t * GetData(void)
Definition grab.h:68
uint8_t * m_pResult
pointer to grabbed image
Definition grab.h:72
cRect m_rect
rect of the grabbed data
Definition grab.h:75
int GetHeight(void)
Definition grab.h:67
cGrabBuffer(void)=default
void FreeDrmBuf(void)
Free the grabbed drm buffer.
Definition grab.cpp:301
int GetSize(void)
Definition grab.h:69
int GetWidth(void)
Definition grab.h:66
void SetDrmBuf(cDrmBuffer *)
Set the grab buffer and the dimensions how it is presented on the screen.
Definition grab.cpp:320
int m_size
size of grabbed data
Definition grab.h:74
struct cDrmBuffer * m_pBuf
pointer to original buffer
Definition grab.h:73
int GetY(void)
Definition grab.h:65
cDrmBuffer * GetDrmBuf(void)
Definition grab.h:70
int GetX(void)
Definition grab.h:64
Grabbing Processor.
Definition grab.h:85
int m_screenWidth
pixel screenwidth
Definition grab.h:104
int m_quality
quality of the jpeg image
Definition grab.h:101
uint8_t * m_grabbedImage
pointer to the finished grabbed image
Definition grab.h:96
int m_grabbedWidth
pixel width of the grabbed image
Definition grab.h:102
int m_screenHeight
pixel screenheight
Definition grab.h:105
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:384
bool Start(bool, int, int, int, int, int)
Start a grab in the video renderer.
Definition grab.cpp:340
bool m_isActive
true, if a grab process is currently running
Definition grab.h:98
int m_grabbedSize
data size of the grabbed image
Definition grab.h:97
uint8_t * Image(void)
Definition grab.h:91
bool m_isJpeg
true, if a jpeg image was requested
Definition grab.h:100
bool ProcessGrab(void)
Start the conversion.
Definition grab.cpp:449
int m_grabbedHeight
pixel height of the grabbed image
Definition grab.h:103
bool Active(void)
Definition grab.h:89
cVideoRender * m_pRender
pointer to cVideoRender object
Definition grab.h:95
int Size(void)
Definition grab.h:92
cSoftHdGrab(cVideoRender *render)
Definition grab.h:87
Video Renderer.
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