16#include <libavutil/imgutils.h>
17#include <libswscale/swscale.h>
22#include <drm_fourcc.h>
38#define TRANSPARENT 0x00
39#define UNMULTIPLY(color, alpha) ((0xff * color) / alpha)
40#define BLEND(back, front, alpha) ((front * alpha) + (back * (255 - alpha))) / 255
120 for (
int i = 0;
i <
buf->NumPlanes();
i++) {
206 for (
unsigned long index = 0; index < width * height; index++) {
210 for (
int i = 0;
i < 3;
i++) {
220 for (
int i = 0;
i < 3;
i++) {
276 for (
int y = 0; y <
srcH; y++) {
312 m_rect.Set(
buf->GetScreenRect().Point(),
buf->GetScreenRect().Size());
331 if (width == 0 || height == 0) {
412 *size =
grab->GetSize();
414 *width =
grab->GetWidth();
416 *height =
grab->GetHeight();
422 return grab->GetData();
429 int width,
int height)
cRect m_rect
rect of the grabbed data
struct cDrmBuffer * m_pBuf
pointer to original buffer
int m_screenWidth
pixel screenwidth
int m_quality
quality of the jpeg image
uint8_t * m_grabbedImage
pointer to the finished grabbed image
int m_grabbedWidth
pixel width of the grabbed image
int m_screenHeight
pixel screenheight
bool m_isActive
true, if a grab process is currently running
int m_grabbedSize
data size of the grabbed image
bool m_isJpeg
true, if a jpeg image was requested
int m_grabbedHeight
pixel height of the grabbed image
cVideoRender * m_pRender
pointer to cVideoRender object
cGrabBuffer * GetGrabbedPipBuffer(void)
cGrabBuffer * GetGrabbedVideoBuffer(void)
cGrabBuffer * GetGrabbedOsdBuffer(void)
Grabbing Interface Header File.
#define UNMULTIPLY(color, alpha)
#define LOGDEBUG2
log to LOG_DEBUG and add a prefix
#define BLEND(back, front, alpha)
#define LOGERROR
log to LOG_ERR
static uint8_t * ScaleRgb24(uint8_t *src, int *size, int srcW, int srcH, int dstW, int dstH)
Scale an image.
static uint8_t * BufToRgb(cDrmBuffer *buf, int *size, int dstW, int dstH, enum AVPixelFormat dstPixFmt)
Convert a DRM buffer to rgb format image.
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...
enum AVPixelFormat DrmFormatToAVFormat(cDrmBuffer *buf)
Convert a DRM format to a ffmpeg AV format.
bool Start(bool, int, int, int, int, int)
Start a grab in the video renderer.
void FreeDrmBuf(void)
Free the grabbed drm buffer.
static int BlitVideo(uint8_t *dst, uint8_t *src, int dstW, int dstH, int dstX, int dstY, int srcW, int srcH)
Blit the video on black background.
void SetDrmBuf(cDrmBuffer *)
Set the grab buffer and the dimensions how it is presented on the screen.
uint8_t * CreateJpeg(uint8_t *image, int *size, int quality, int width, int height)
Call rgb to jpeg for C Plugin.
bool ProcessGrab(void)
Start the conversion.
#define LOGFATAL
log to LOG_ERR and abort
static void AlphaBlend(uint8_t *result, uint8_t *front, uint8_t *back, const unsigned int width, const unsigned int height)
Blend two images.
const char * GrabtypeToString(Grabtype t)
int TriggerGrab(void)
Trigger a screen grab.
void ClearGrabBuffers(void)
Clear the grab drm buffers.
Video Renderer (Display) Header File.