vdr-plugin-softhddevice-drm-gles 1.5.9-20e15de
cDrmBuffer Class Reference

#include <drmbuffer.h>

Public Member Functions

 cDrmBuffer (void)
 cDrmBuffer constructor
 
 cDrmBuffer (cDrmBuffer *src)
 cDrmBuffer constructor
 
void Setup (int, uint32_t, uint32_t, uint32_t, AVDRMFrameDescriptor *, bool)
 Setup the buffer.
 
void Destroy (void)
 Clear and destroy the buffer object and its parameters.
 
void FillBlack (void)
 Color the buffer black.
 
uint32_t Width (void)
 
void SetWidth (uint32_t width)
 
uint32_t Height (void)
 
void SetHeight (uint32_t height)
 
uint32_t PixFmt (void)
 
void SetPixFmt (uint32_t pixFmt)
 
bool IsDirty (void)
 
void MarkClean (void)
 
void MarkDirty (void)
 
bool IsPresentationPending (void)
 
void SetPresentationPending (bool pending)
 
int Id (void)
 
void SetId (int id)
 
void SetFdDrm (int fdDrm)
 
int NumPlanes (void)
 
void SetNumPlanes (int numPlanes)
 
int DmaBufHandle (void)
 
void SetDmaBufHandle (uint32_t fd)
 
void SetNumObjects (int numObjects)
 
void SetObjectIndex (int idx, uint32_t objIdx)
 
uint8_t * Plane (int idx)
 
uint32_t PrimeHandle (int idx)
 
uint32_t * PrimeHandle (void)
 
void SetHandle (int idx, uint32_t handle)
 
uint32_t Offset (int idx)
 
uint32_t * Offset (void)
 
void SetOffset (int idx, uint32_t offset)
 
uint32_t Pitch (int idx)
 
uint32_t * Pitch (void)
 
void SetPitch (int idx, uint32_t pitch)
 
uint32_t Size (int idx)
 
uint32_t * Size (void)
 
void SetSize (int idx, uint32_t size)
 
void SetDestroyAfterUse (bool val)
 
void PresentationFinished (void)
 
void SetSizeOnScreen (int x, int y, int w, int h)
 
cRect GetScreenRect (void)
 

Public Attributes

AVFrame * frame = nullptr
 associated AVFrame
 

Private Attributes

uint32_t m_width
 buffer width
 
uint32_t m_height
 buffer height
 
uint32_t m_pixFmt
 buffer pixel format
 
cRect m_rectOnScreen
 dimensions on screen - set at pageflip, needed for grab
 
bool m_dirty
 true, if the buffer is dirty (it was written to)
 
uint32_t m_fbId
 framebuffer id
 
int m_drmDeviceFd
 drm device file descriptor
 
int m_numPlanes
 number of planes in the buffer
 
int m_dmaBufHandle [4]
 DMA-BUF file descriptor.
 
int m_numObjects
 number of prime objects in the buffer
 
int m_objIdx [4]
 index of the objects
 
uint32_t m_objectPrimeHandle [4]
 primedata objects prime handles (count is numObjects, index is objIdx)
 
uint8_t * m_pPlane [4]
 array of the plane data
 
uint32_t m_planePrimeHandle [4]
 array of the plane handles
 
uint32_t m_offset [4]
 array of the plane offset
 
uint32_t m_pitch [4]
 array of the plane pitch
 
uint32_t m_size [4] {0}
 array of the plane size
 
bool m_presentationPending = false
 true, if buffer is pending presentation
 
bool m_destroyAfterUse = false
 true, if buffer should be destroyed after use
 
bool m_closeHandleOnDestroy
 true, if DMA-BUF handle should be closed on destroy
 

Detailed Description

Definition at line 51 of file drmbuffer.h.

Constructor & Destructor Documentation

◆ cDrmBuffer() [1/2]

cDrmBuffer::cDrmBuffer ( void  )

cDrmBuffer constructor

Parameters
devicepointer to cSoftHdDevice

Definition at line 51 of file drmbuffer.cpp.

References m_dirty, m_dmaBufHandle, m_numPlanes, and m_pPlane.

◆ cDrmBuffer() [2/2]

cDrmBuffer::cDrmBuffer ( cDrmBuffer src)

cDrmBuffer constructor

Clone a cDrmBuffer

Parameters
srcsrc buffer to be cloned
Returns
a new cDrmBuffer object cloned from src

Definition at line 71 of file drmbuffer.cpp.

References L_GRAB, LOGDEBUG2, LOGERROR, m_dirty, m_dmaBufHandle, m_numObjects, m_numPlanes, m_objIdx, m_offset, m_pitch, m_planePrimeHandle, m_pPlane, and m_size.

Member Function Documentation

◆ Destroy()

◆ DmaBufHandle()

int cDrmBuffer::DmaBufHandle ( void  )
inline

Definition at line 82 of file drmbuffer.h.

References m_dmaBufHandle.

Referenced by cDecodingStrategySoftware::PrepareDrmBuffer().

◆ FillBlack()

void cDrmBuffer::FillBlack ( void  )

Color the buffer black.

Definition at line 409 of file drmbuffer.cpp.

References m_height, m_pPlane, and m_width.

Referenced by cVideoRender::Init().

◆ GetScreenRect()

cRect cDrmBuffer::GetScreenRect ( void  )
inline

Definition at line 103 of file drmbuffer.h.

References m_rectOnScreen.

Referenced by cGrabBuffer::SetDrmBuf().

◆ Height()

◆ Id()

int cDrmBuffer::Id ( void  )
inline

◆ IsDirty()

◆ IsPresentationPending()

bool cDrmBuffer::IsPresentationPending ( void  )
inline

Definition at line 74 of file drmbuffer.h.

References m_presentationPending.

◆ MarkClean()

void cDrmBuffer::MarkClean ( void  )
inline

Definition at line 72 of file drmbuffer.h.

References m_dirty.

Referenced by cVideoRender::SetOsdBuffer().

◆ MarkDirty()

void cDrmBuffer::MarkDirty ( void  )
inline

Definition at line 73 of file drmbuffer.h.

References m_dirty.

Referenced by cVideoRender::OsdClear(), and cVideoRender::OsdDrawARGB().

◆ NumPlanes()

int cDrmBuffer::NumPlanes ( void  )
inline

Definition at line 80 of file drmbuffer.h.

References m_numPlanes.

Referenced by BufToRgb(), cGrabBuffer::FreeDrmBuf(), and cSoftHdGrab::GetGrab().

◆ Offset() [1/2]

uint32_t cDrmBuffer::Offset ( int  idx)
inline

Definition at line 90 of file drmbuffer.h.

References m_offset.

Referenced by BufToRgb(), and cSoftHdGrab::GetGrab().

◆ Offset() [2/2]

uint32_t * cDrmBuffer::Offset ( void  )
inline

Definition at line 91 of file drmbuffer.h.

References m_offset.

◆ Pitch() [1/2]

uint32_t cDrmBuffer::Pitch ( int  idx)
inline

◆ Pitch() [2/2]

uint32_t * cDrmBuffer::Pitch ( void  )
inline

Definition at line 94 of file drmbuffer.h.

References m_pitch.

◆ PixFmt()

uint32_t cDrmBuffer::PixFmt ( void  )
inline

Definition at line 68 of file drmbuffer.h.

References m_pixFmt.

Referenced by DrmFormatToAVFormat().

◆ Plane()

uint8_t * cDrmBuffer::Plane ( int  idx)
inline

◆ PresentationFinished()

void cDrmBuffer::PresentationFinished ( void  )

Definition at line 461 of file drmbuffer.cpp.

References Destroy(), frame, m_destroyAfterUse, and m_presentationPending.

Referenced by cVideoRender::DisplayFrame().

◆ PrimeHandle() [1/2]

uint32_t cDrmBuffer::PrimeHandle ( int  idx)
inline

Definition at line 87 of file drmbuffer.h.

References m_planePrimeHandle.

Referenced by cSoftHdGrab::GetGrab(), and cDecodingStrategySoftware::PrepareDrmBuffer().

◆ PrimeHandle() [2/2]

uint32_t * cDrmBuffer::PrimeHandle ( void  )
inline

Definition at line 88 of file drmbuffer.h.

References m_planePrimeHandle.

◆ SetDestroyAfterUse()

void cDrmBuffer::SetDestroyAfterUse ( bool  val)
inline

◆ SetDmaBufHandle()

void cDrmBuffer::SetDmaBufHandle ( uint32_t  fd)
inline

Definition at line 83 of file drmbuffer.h.

References m_dmaBufHandle.

Referenced by cDecodingStrategySoftware::PrepareDrmBuffer().

◆ SetFdDrm()

void cDrmBuffer::SetFdDrm ( int  fdDrm)
inline

Definition at line 79 of file drmbuffer.h.

References m_drmDeviceFd.

◆ SetHandle()

void cDrmBuffer::SetHandle ( int  idx,
uint32_t  handle 
)
inline

Definition at line 89 of file drmbuffer.h.

References m_planePrimeHandle.

◆ SetHeight()

void cDrmBuffer::SetHeight ( uint32_t  height)
inline

Definition at line 67 of file drmbuffer.h.

References m_height.

◆ SetId()

void cDrmBuffer::SetId ( int  id)
inline

Definition at line 78 of file drmbuffer.h.

References m_fbId.

◆ SetNumObjects()

void cDrmBuffer::SetNumObjects ( int  numObjects)
inline

Definition at line 84 of file drmbuffer.h.

References m_numObjects.

◆ SetNumPlanes()

void cDrmBuffer::SetNumPlanes ( int  numPlanes)
inline

Definition at line 81 of file drmbuffer.h.

References m_numPlanes.

◆ SetObjectIndex()

void cDrmBuffer::SetObjectIndex ( int  idx,
uint32_t  objIdx 
)
inline

Definition at line 85 of file drmbuffer.h.

References m_objIdx.

◆ SetOffset()

void cDrmBuffer::SetOffset ( int  idx,
uint32_t  offset 
)
inline

Definition at line 92 of file drmbuffer.h.

References m_offset.

◆ SetPitch()

void cDrmBuffer::SetPitch ( int  idx,
uint32_t  pitch 
)
inline

Definition at line 95 of file drmbuffer.h.

References m_pitch.

◆ SetPixFmt()

void cDrmBuffer::SetPixFmt ( uint32_t  pixFmt)
inline

Definition at line 69 of file drmbuffer.h.

References m_pixFmt.

◆ SetPresentationPending()

void cDrmBuffer::SetPresentationPending ( bool  pending)
inline

Definition at line 75 of file drmbuffer.h.

References m_presentationPending.

Referenced by cVideoRender::PushFrame().

◆ SetSize()

void cDrmBuffer::SetSize ( int  idx,
uint32_t  size 
)
inline

Definition at line 98 of file drmbuffer.h.

References m_size.

◆ SetSizeOnScreen()

void cDrmBuffer::SetSizeOnScreen ( int  x,
int  y,
int  w,
int  h 
)
inline

◆ Setup()

void cDrmBuffer::Setup ( int  drmDeviceFd,
uint32_t  width,
uint32_t  height,
uint32_t  pixFmt,
AVDRMFrameDescriptor *  primedata,
bool  closeHandleOnDestroy 
)

Setup the buffer.

Parameters
drmDeviceFddrm device file descriptor
widthbuffer width
heightbuffer height
pixFmtbuffer pixel format
primedataAVDRMFrameDescriptor or NULL (if this is a software buffer)

Definition at line 275 of file drmbuffer.cpp.

References format_plane_info::bitspp, FindFormat(), L_DRM, LOGDEBUG2, LOGERROR, LOGFATAL, m_closeHandleOnDestroy, m_dirty, m_dmaBufHandle, m_drmDeviceFd, m_fbId, m_height, m_numObjects, m_numPlanes, m_objectPrimeHandle, m_objIdx, m_offset, m_pitch, m_pixFmt, m_planePrimeHandle, m_pPlane, m_size, m_width, format_info::num_planes, format_info::planes, format_plane_info::xsub, and format_plane_info::ysub.

Referenced by cVideoRender::Init(), cDecodingStrategySoftware::PrepareDrmBuffer(), and cDecodingStrategyHardware::PrepareDrmBuffer().

◆ SetWidth()

void cDrmBuffer::SetWidth ( uint32_t  width)
inline

Definition at line 65 of file drmbuffer.h.

References m_width.

◆ Size() [1/2]

uint32_t cDrmBuffer::Size ( int  idx)
inline

Definition at line 96 of file drmbuffer.h.

References m_size.

Referenced by BufToRgb(), cGrabBuffer::FreeDrmBuf(), and cSoftHdGrab::GetGrab().

◆ Size() [2/2]

uint32_t * cDrmBuffer::Size ( void  )
inline

Definition at line 97 of file drmbuffer.h.

References m_size.

◆ Width()

Member Data Documentation

◆ frame

◆ m_closeHandleOnDestroy

bool cDrmBuffer::m_closeHandleOnDestroy
private

true, if DMA-BUF handle should be closed on destroy

Definition at line 132 of file drmbuffer.h.

Referenced by Destroy(), and Setup().

◆ m_destroyAfterUse

bool cDrmBuffer::m_destroyAfterUse = false
private

true, if buffer should be destroyed after use

Definition at line 131 of file drmbuffer.h.

Referenced by Destroy(), PresentationFinished(), and SetDestroyAfterUse().

◆ m_dirty

bool cDrmBuffer::m_dirty
private

true, if the buffer is dirty (it was written to)

Definition at line 112 of file drmbuffer.h.

Referenced by cDrmBuffer(), cDrmBuffer(), Destroy(), IsDirty(), MarkClean(), MarkDirty(), and Setup().

◆ m_dmaBufHandle

int cDrmBuffer::m_dmaBufHandle[4]
private

DMA-BUF file descriptor.

Definition at line 119 of file drmbuffer.h.

Referenced by cDrmBuffer(), cDrmBuffer(), Destroy(), DmaBufHandle(), SetDmaBufHandle(), and Setup().

◆ m_drmDeviceFd

int cDrmBuffer::m_drmDeviceFd
private

drm device file descriptor

Definition at line 115 of file drmbuffer.h.

Referenced by Destroy(), SetFdDrm(), and Setup().

◆ m_fbId

uint32_t cDrmBuffer::m_fbId
private

framebuffer id

Definition at line 114 of file drmbuffer.h.

Referenced by Destroy(), Id(), SetId(), and Setup().

◆ m_height

uint32_t cDrmBuffer::m_height
private

buffer height

Definition at line 107 of file drmbuffer.h.

Referenced by Destroy(), FillBlack(), Height(), SetHeight(), and Setup().

◆ m_numObjects

int cDrmBuffer::m_numObjects
private

number of prime objects in the buffer

Definition at line 120 of file drmbuffer.h.

Referenced by cDrmBuffer(), Destroy(), SetNumObjects(), and Setup().

◆ m_numPlanes

int cDrmBuffer::m_numPlanes
private

number of planes in the buffer

Definition at line 117 of file drmbuffer.h.

Referenced by cDrmBuffer(), cDrmBuffer(), Destroy(), NumPlanes(), SetNumPlanes(), and Setup().

◆ m_objectPrimeHandle

uint32_t cDrmBuffer::m_objectPrimeHandle[4]
private

primedata objects prime handles (count is numObjects, index is objIdx)

Definition at line 122 of file drmbuffer.h.

Referenced by Destroy(), and Setup().

◆ m_objIdx

int cDrmBuffer::m_objIdx[4]
private

index of the objects

Definition at line 121 of file drmbuffer.h.

Referenced by cDrmBuffer(), Destroy(), SetObjectIndex(), and Setup().

◆ m_offset

uint32_t cDrmBuffer::m_offset[4]
private

array of the plane offset

Definition at line 126 of file drmbuffer.h.

Referenced by cDrmBuffer(), Destroy(), Offset(), Offset(), SetOffset(), and Setup().

◆ m_pitch

uint32_t cDrmBuffer::m_pitch[4]
private

array of the plane pitch

Definition at line 127 of file drmbuffer.h.

Referenced by cDrmBuffer(), Destroy(), Pitch(), Pitch(), SetPitch(), and Setup().

◆ m_pixFmt

uint32_t cDrmBuffer::m_pixFmt
private

buffer pixel format

Definition at line 108 of file drmbuffer.h.

Referenced by PixFmt(), SetPixFmt(), and Setup().

◆ m_planePrimeHandle

uint32_t cDrmBuffer::m_planePrimeHandle[4]
private

array of the plane handles

Definition at line 125 of file drmbuffer.h.

Referenced by cDrmBuffer(), Destroy(), PrimeHandle(), PrimeHandle(), SetHandle(), and Setup().

◆ m_pPlane

uint8_t* cDrmBuffer::m_pPlane[4]
private

array of the plane data

Definition at line 124 of file drmbuffer.h.

Referenced by cDrmBuffer(), cDrmBuffer(), Destroy(), FillBlack(), Plane(), and Setup().

◆ m_presentationPending

bool cDrmBuffer::m_presentationPending = false
private

true, if buffer is pending presentation

Definition at line 130 of file drmbuffer.h.

Referenced by IsPresentationPending(), PresentationFinished(), and SetPresentationPending().

◆ m_rectOnScreen

cRect cDrmBuffer::m_rectOnScreen
private

dimensions on screen - set at pageflip, needed for grab

Definition at line 110 of file drmbuffer.h.

Referenced by GetScreenRect(), and SetSizeOnScreen().

◆ m_size

uint32_t cDrmBuffer::m_size[4] {0}
private

array of the plane size

Definition at line 128 of file drmbuffer.h.

Referenced by cDrmBuffer(), Destroy(), SetSize(), Setup(), Size(), and Size().

◆ m_width

uint32_t cDrmBuffer::m_width
private

buffer width

Definition at line 106 of file drmbuffer.h.

Referenced by Destroy(), FillBlack(), Setup(), SetWidth(), and Width().


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