vdr-plugin-softhddevice-drm-gles 1.6.7
cSoftHdGrab Class Reference

Grabbing Processor. More...

#include <grab.h>

Public Member Functions

 cSoftHdGrab (cVideoRender *render)
 
bool IsActive (void)
 
bool Start (bool, int, int, int, int, int)
 Start a grab in the video renderer.
 
uint8_tImage (void)
 
int Size (void)
 
bool ProcessGrab (void)
 Start the conversion.
 
void Finish (void)
 Clean up.
 

Private Member Functions

uint8_tGetGrabbedVideoData (int *, int *, int *, int *, int *)
 
uint8_tGetGrabbedPipData (int *, int *, int *, int *, int *)
 
uint8_tGetGrabbedOsdData (int *, int *, int *, int *, int *)
 
uint8_tGetGrabbedData (int *, int *, int *, int *, int *, cGrabBuffer *)
 Convert the cloned drm buffer data to RGB(void, pip) or ARGB (osd) and return a pointer to the raw data.
 

Private Attributes

cVideoRenderm_pRender
 pointer to cVideoRender object
 
uint8_tm_grabbedImage
 pointer to the finished grabbed image
 
int m_grabbedSize
 data size of the grabbed image
 
std::atomic< boolm_active = false
 true, if a grab process is currently running
 
bool m_isJpeg = true
 true, if a jpeg image was requested
 
int m_quality
 quality of the jpeg image
 
int m_grabbedWidth
 pixel width of the grabbed image
 
int m_grabbedHeight
 pixel height of the grabbed image
 
int m_screenWidth
 pixel screenwidth
 
int m_screenHeight
 pixel screenheight
 

Detailed Description

Grabbing Processor.

Handles the grabbing workflow from triggering the grab to returning the result

Definition at line 79 of file grab.h.

Constructor & Destructor Documentation

◆ cSoftHdGrab()

cSoftHdGrab::cSoftHdGrab ( cVideoRender render)
inline

Definition at line 81 of file grab.h.

Member Function Documentation

◆ Finish()

void cSoftHdGrab::Finish ( void  )

Clean up.

Clears the dedicated buffers in the renderer again and sets the grab inactive.

Definition at line 695 of file grab.cpp.

References cVideoRender::ClearGrabBuffers(), m_active, and m_pRender.

Referenced by cSoftHdDevice::GrabImage(), ProcessGrab(), and Start().

◆ GetGrabbedData()

uint8_t * cSoftHdGrab::GetGrabbedData ( int size,
int width,
int height,
int x,
int y,
cGrabBuffer grab 
)
private

Convert the cloned drm buffer data to RGB(void, pip) or ARGB (osd) and return a pointer to the raw data.

Parameters
[out]sizesize of the grabbed buffer
[out]widthwidth of the grabbed buffer
[out]heightheight of the grabbed buffer
[out]xx offset of the grabbed buffer
[out]yy offset of the grabbed buffer
[in]grabgrabbed buffer
Returns
a pointer to the raw buffer data

Definition at line 733 of file grab.cpp.

Referenced by GetGrabbedOsdData(), GetGrabbedPipData(), and GetGrabbedVideoData().

◆ GetGrabbedOsdData()

uint8_t * cSoftHdGrab::GetGrabbedOsdData ( int size,
int width,
int height,
int x,
int y 
)
private

Definition at line 713 of file grab.cpp.

References GetGrabbedData(), cVideoRender::GetGrabbedOsdBuffer(), and m_pRender.

Referenced by ProcessGrab().

◆ GetGrabbedPipData()

uint8_t * cSoftHdGrab::GetGrabbedPipData ( int size,
int width,
int height,
int x,
int y 
)
private

Definition at line 707 of file grab.cpp.

References GetGrabbedData(), cVideoRender::GetGrabbedPipBuffer(), and m_pRender.

Referenced by ProcessGrab().

◆ GetGrabbedVideoData()

uint8_t * cSoftHdGrab::GetGrabbedVideoData ( int size,
int width,
int height,
int x,
int y 
)
private

Definition at line 701 of file grab.cpp.

References GetGrabbedData(), cVideoRender::GetGrabbedVideoBuffer(), and m_pRender.

Referenced by ProcessGrab().

◆ Image()

uint8_t * cSoftHdGrab::Image ( void  )
inline

Definition at line 85 of file grab.h.

References m_grabbedImage.

Referenced by cSoftHdDevice::GrabImage().

◆ IsActive()

bool cSoftHdGrab::IsActive ( void  )
inline

Definition at line 83 of file grab.h.

References m_active.

Referenced by cSoftHdDevice::GrabImage().

◆ ProcessGrab()

bool cSoftHdGrab::ProcessGrab ( void  )

Start the conversion.

This does the following: 1) Get grabbed video data if available, otherwise create a black screen for video 2) Get grabbed pip data if available 3) Get grabbed osd data if available 4) Blit the video data into a black background image if it is scaled 5) If available, blit the pip data onto it 6) If available, blit the osd data onto it respecting alpha values 7) Scale the result to the user requested size 8) Create a jpg or pnm image as requested

Returns
true, if grab succeeded, false otherwise

Definition at line 780 of file grab.cpp.

References AlphaBlend(), BlitVideo(), CreateJpeg(), Finish(), GetGrabbedOsdData(), GetGrabbedPipData(), GetGrabbedVideoData(), L_GRAB, LOGDEBUG2, m_grabbedHeight, m_grabbedImage, m_grabbedSize, m_grabbedWidth, m_isJpeg, m_quality, m_screenHeight, m_screenWidth, and ScaleRgb24().

Referenced by cSoftHdDevice::GrabImage().

◆ Size()

int cSoftHdGrab::Size ( void  )
inline

Definition at line 86 of file grab.h.

References m_grabbedSize.

Referenced by cSoftHdDevice::GrabImage().

◆ Start()

bool cSoftHdGrab::Start ( bool  jpeg,
int  quality,
int  width,
int  height,
int  screenWidth,
int  screenHeight 
)

Start a grab in the video renderer.

Parameters
jpegflag true, create JPEG data
qualityJPEG quality
widthwidth of requested grab image
heightheight of requested grab image
screenWidthcurrent screen width
screenHeightcurrent screen height

Definition at line 661 of file grab.cpp.

References cVideoRender::ClearGrabBuffers(), Finish(), L_GRAB, LOGDEBUG2, m_active, m_grabbedHeight, m_grabbedImage, m_grabbedWidth, m_isJpeg, m_pRender, m_quality, m_screenHeight, m_screenWidth, and cVideoRender::TriggerGrab().

Referenced by cSoftHdDevice::GrabImage().

Member Data Documentation

◆ m_active

std::atomic<bool> cSoftHdGrab::m_active = false
private

true, if a grab process is currently running

Definition at line 94 of file grab.h.

Referenced by Finish(), IsActive(), and Start().

◆ m_grabbedHeight

int cSoftHdGrab::m_grabbedHeight
private

pixel height of the grabbed image

Definition at line 99 of file grab.h.

Referenced by ProcessGrab(), and Start().

◆ m_grabbedImage

uint8_t* cSoftHdGrab::m_grabbedImage
private

pointer to the finished grabbed image

Definition at line 92 of file grab.h.

Referenced by Image(), ProcessGrab(), and Start().

◆ m_grabbedSize

int cSoftHdGrab::m_grabbedSize
private

data size of the grabbed image

Definition at line 93 of file grab.h.

Referenced by ProcessGrab(), and Size().

◆ m_grabbedWidth

int cSoftHdGrab::m_grabbedWidth
private

pixel width of the grabbed image

Definition at line 98 of file grab.h.

Referenced by ProcessGrab(), and Start().

◆ m_isJpeg

bool cSoftHdGrab::m_isJpeg = true
private

true, if a jpeg image was requested

Definition at line 96 of file grab.h.

Referenced by ProcessGrab(), and Start().

◆ m_pRender

cVideoRender* cSoftHdGrab::m_pRender
private

pointer to cVideoRender object

Definition at line 91 of file grab.h.

Referenced by Finish(), GetGrabbedOsdData(), GetGrabbedPipData(), GetGrabbedVideoData(), and Start().

◆ m_quality

int cSoftHdGrab::m_quality
private

quality of the jpeg image

Definition at line 97 of file grab.h.

Referenced by ProcessGrab(), and Start().

◆ m_screenHeight

int cSoftHdGrab::m_screenHeight
private

pixel screenheight

Definition at line 101 of file grab.h.

Referenced by ProcessGrab(), and Start().

◆ m_screenWidth

int cSoftHdGrab::m_screenWidth
private

pixel screenwidth

Definition at line 100 of file grab.h.

Referenced by ProcessGrab(), and Start().


The documentation for this class was generated from the following files: