|
vdr-plugin-softhddevice-drm-gles 1.4.0
|
#include <drmbuffer.h>
Public Member Functions | |
| cDrmBuffer (void) | |
| cDrmBuffer constructor More... | |
| cDrmBuffer (cDrmBuffer *src) | |
| cDrmBuffer constructor More... | |
| virtual | ~cDrmBuffer (void) |
| cDrmBuffer destructor More... | |
| void | Setup (int, uint32_t, uint32_t, uint32_t, AVDRMFrameDescriptor *, bool) |
| Setup the buffer. More... | |
| void | Destroy (void) |
| Clear and destroy the buffer object and its parameters. More... | |
| void | InitBo (int, uint32_t, uint32_t, uint32_t, struct gbm_bo *) |
| void | FillBlack (void) |
| Color the buffer black. More... | |
| 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) |
Public Attributes | |
| AVFrame * | frame = nullptr |
| associated AVFrame More... | |
Private Attributes | |
| uint32_t | m_width |
| buffer width More... | |
| uint32_t | m_height |
| buffer height More... | |
| uint32_t | m_pixFmt |
| buffer pixel format More... | |
| bool | m_dirty |
| true, if the buffer is dirty (it was written to) More... | |
| uint32_t | m_fbId |
| framebuffer id More... | |
| int | m_drmDeviceFd |
| drm device file descriptor More... | |
| int | m_numPlanes |
| number of planes in the buffer More... | |
| int | m_dmaBufHandle [4] |
| DMA-BUF file descriptor. More... | |
| int | m_numObjects |
| number of prime objects in the buffer More... | |
| int | m_objIdx [4] |
| index of the objects More... | |
| uint32_t | m_objectPrimeHandle [4] |
| primedata objects prime handles (count is numObjects, index is objIdx) More... | |
| uint8_t * | m_pPlane [4] |
| array of the plane data More... | |
| uint32_t | m_planePrimeHandle [4] |
| array of the plane handles More... | |
| uint32_t | m_offset [4] |
| array of the plane offset More... | |
| uint32_t | m_pitch [4] |
| array of the plane pitch More... | |
| uint32_t | m_size [4] {0} |
| array of the plane size More... | |
| bool | m_presentationPending = false |
| true, if buffer is pending presentation More... | |
| bool | m_destroyAfterUse = false |
| true, if buffer should be destroyed after use More... | |
| bool | m_closeHandleOnDestroy |
| true, if DMA-BUF handle should be closed on destroy More... | |
Definition at line 52 of file drmbuffer.h.
| cDrmBuffer::cDrmBuffer | ( | void | ) |
cDrmBuffer constructor
| device | pointer to cSoftHdDevice |
Definition at line 40 of file drmbuffer.cpp.
References m_dirty, m_dmaBufHandle, m_numPlanes, and m_pPlane.
| cDrmBuffer::cDrmBuffer | ( | cDrmBuffer * | src | ) |
cDrmBuffer constructor
Clone a cDrmBuffer
| src | src buffer to be cloned |
Definition at line 60 of file drmbuffer.cpp.
References L_GRAB, LOGDEBUG2, LOGERROR, m_dirty, m_dmaBufHandle, m_fbId, m_height, m_numObjects, m_numPlanes, m_objIdx, m_offset, m_pitch, m_pixFmt, m_planePrimeHandle, m_pPlane, m_size, and m_width.
|
virtual |
cDrmBuffer destructor
Definition at line 157 of file drmbuffer.cpp.
| void cDrmBuffer::Destroy | ( | void | ) |
Clear and destroy the buffer object and its parameters.
Definition at line 164 of file drmbuffer.cpp.
References L_DRM, LOGDEBUG2, LOGERROR, m_closeHandleOnDestroy, m_destroyAfterUse, m_dirty, m_dmaBufHandle, m_drmDeviceFd, m_fbId, m_height, m_numObjects, m_numPlanes, m_objectPrimeHandle, m_objIdx, m_offset, m_pitch, m_planePrimeHandle, m_pPlane, m_size, and m_width.
Referenced by cVideoRender::DisplayBlackFrame(), cVideoRender::Exit(), and PresentationFinished().
|
inline |
Definition at line 85 of file drmbuffer.h.
References m_dmaBufHandle.
Referenced by cDecodingStrategySoftware::PrepareDrmBuffer().
| void cDrmBuffer::FillBlack | ( | void | ) |
Color the buffer black.
Definition at line 404 of file drmbuffer.cpp.
References m_height, m_pPlane, and m_width.
Referenced by cVideoRender::Init().
|
inline |
Definition at line 69 of file drmbuffer.h.
References m_height.
Referenced by BufToRgb(), cVideoRender::Grab(), cVideoRender::Init(), cVideoRender::OsdClear(), cVideoRender::OsdDrawARGB(), cVideoRender::SetOsdBuffer(), cVideoRender::SetPipBuffer(), and cVideoRender::SetVideoBuffer().
|
inline |
Definition at line 80 of file drmbuffer.h.
References m_fbId.
Referenced by cVideoRender::Init(), cVideoRender::PageFlip(), cVideoRender::SetOsdBuffer(), cVideoRender::SetPipBuffer(), and cVideoRender::SetVideoBuffer().
| void cDrmBuffer::InitBo | ( | int | , |
| uint32_t | , | ||
| uint32_t | , | ||
| uint32_t | , | ||
| struct gbm_bo * | |||
| ) |
|
inline |
Definition at line 74 of file drmbuffer.h.
References m_dirty.
Referenced by cDrmBufferPool::DestroyAllExcept(), cVideoRender::DisplayFrame(), cDecodingStrategySoftware::PrepareDrmBuffer(), cDecodingStrategyHardware::PrepareDrmBuffer(), and cVideoRender::SetOsdBuffer().
|
inline |
Definition at line 77 of file drmbuffer.h.
References m_presentationPending.
|
inline |
Definition at line 75 of file drmbuffer.h.
References m_dirty.
Referenced by cVideoRender::SetOsdBuffer().
|
inline |
Definition at line 76 of file drmbuffer.h.
References m_dirty.
Referenced by cVideoRender::OsdClear(), and cVideoRender::OsdDrawARGB().
|
inline |
Definition at line 83 of file drmbuffer.h.
References m_numPlanes.
Referenced by BufToRgb(), cVideoRender::ConvertOsdBufToRgb(), cVideoRender::ConvertPipBufToRgb(), cVideoRender::ConvertVideoBufToRgb(), and cSoftHdGrab::FreeBuf().
|
inline |
Definition at line 93 of file drmbuffer.h.
References m_offset.
Referenced by BufToRgb(), cVideoRender::ConvertOsdBufToRgb(), cVideoRender::ConvertPipBufToRgb(), and cVideoRender::ConvertVideoBufToRgb().
|
inline |
Definition at line 94 of file drmbuffer.h.
References m_offset.
|
inline |
Definition at line 96 of file drmbuffer.h.
References m_pitch.
Referenced by BufToRgb(), cVideoRender::ConvertOsdBufToRgb(), cVideoRender::ConvertPipBufToRgb(), cVideoRender::ConvertVideoBufToRgb(), cVideoRender::OsdClear(), cVideoRender::OsdDrawARGB(), and cDecodingStrategySoftware::PrepareDrmBuffer().
|
inline |
Definition at line 97 of file drmbuffer.h.
References m_pitch.
|
inline |
Definition at line 71 of file drmbuffer.h.
References m_pixFmt.
Referenced by DrmFormatToAVFormat().
|
inline |
Definition at line 89 of file drmbuffer.h.
References m_pPlane.
Referenced by BufToRgb(), cVideoRender::ConvertOsdBufToRgb(), cVideoRender::ConvertPipBufToRgb(), cVideoRender::ConvertVideoBufToRgb(), cSoftHdGrab::FreeBuf(), cVideoRender::OsdClear(), cVideoRender::OsdDrawARGB(), and cDecodingStrategySoftware::PrepareDrmBuffer().
| void cDrmBuffer::PresentationFinished | ( | void | ) |
Definition at line 456 of file drmbuffer.cpp.
References Destroy(), frame, m_destroyAfterUse, and m_presentationPending.
Referenced by cVideoRender::DisplayFrame().
|
inline |
Definition at line 90 of file drmbuffer.h.
References m_planePrimeHandle.
Referenced by cVideoRender::ConvertOsdBufToRgb(), cVideoRender::ConvertPipBufToRgb(), cVideoRender::ConvertVideoBufToRgb(), and cDecodingStrategySoftware::PrepareDrmBuffer().
|
inline |
Definition at line 91 of file drmbuffer.h.
References m_planePrimeHandle.
|
inline |
Definition at line 103 of file drmbuffer.h.
References m_destroyAfterUse.
Referenced by cVideoRender::ClearDecoderToDisplayQueue(), and cBufferStrategyUseOnce::GetBuffer().
|
inline |
Definition at line 86 of file drmbuffer.h.
References m_dmaBufHandle.
Referenced by cDecodingStrategySoftware::PrepareDrmBuffer().
|
inline |
Definition at line 82 of file drmbuffer.h.
References m_drmDeviceFd.
|
inline |
Definition at line 92 of file drmbuffer.h.
References m_planePrimeHandle.
|
inline |
Definition at line 70 of file drmbuffer.h.
References m_height.
|
inline |
Definition at line 81 of file drmbuffer.h.
References m_fbId.
|
inline |
Definition at line 87 of file drmbuffer.h.
References m_numObjects.
|
inline |
Definition at line 84 of file drmbuffer.h.
References m_numPlanes.
|
inline |
Definition at line 88 of file drmbuffer.h.
References m_objIdx.
|
inline |
Definition at line 95 of file drmbuffer.h.
References m_offset.
|
inline |
Definition at line 98 of file drmbuffer.h.
References m_pitch.
|
inline |
Definition at line 72 of file drmbuffer.h.
References m_pixFmt.
|
inline |
Definition at line 78 of file drmbuffer.h.
References m_presentationPending.
|
inline |
Definition at line 101 of file drmbuffer.h.
References m_size.
| void cDrmBuffer::Setup | ( | int | drmDeviceFd, |
| uint32_t | width, | ||
| uint32_t | height, | ||
| uint32_t | pixFmt, | ||
| AVDRMFrameDescriptor * | primedata, | ||
| bool | closeHandleOnDestroy | ||
| ) |
Setup the buffer.
| drmDeviceFd | drm device file descriptor |
| width | buffer width |
| height | buffer height |
| pixFmt | buffer pixel format |
| primedata | AVDRMFrameDescriptor or NULL (if this is a software buffer) |
Definition at line 270 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().
|
inline |
Definition at line 68 of file drmbuffer.h.
References m_width.
|
inline |
Definition at line 99 of file drmbuffer.h.
References m_size.
Referenced by BufToRgb(), cVideoRender::ConvertOsdBufToRgb(), cVideoRender::ConvertPipBufToRgb(), cVideoRender::ConvertVideoBufToRgb(), and cSoftHdGrab::FreeBuf().
|
inline |
Definition at line 100 of file drmbuffer.h.
References m_size.
|
inline |
Definition at line 67 of file drmbuffer.h.
References m_width.
Referenced by BufToRgb(), cVideoRender::Grab(), cVideoRender::Init(), cVideoRender::OsdClear(), cVideoRender::OsdDrawARGB(), cVideoRender::SetOsdBuffer(), cVideoRender::SetPipBuffer(), and cVideoRender::SetVideoBuffer().
| AVFrame* cDrmBuffer::frame = nullptr |
associated AVFrame
Definition at line 102 of file drmbuffer.h.
Referenced by cVideoRender::DisplayBlackFrame(), cVideoRender::DisplayFrame(), cVideoRender::PageFlip(), PresentationFinished(), cVideoRender::SetPipBuffer(), and cVideoRender::SetVideoBuffer().
|
private |
true, if DMA-BUF handle should be closed on destroy
Definition at line 131 of file drmbuffer.h.
|
private |
true, if buffer should be destroyed after use
Definition at line 130 of file drmbuffer.h.
Referenced by Destroy(), PresentationFinished(), and SetDestroyAfterUse().
|
private |
true, if the buffer is dirty (it was written to)
Definition at line 111 of file drmbuffer.h.
Referenced by cDrmBuffer(), Destroy(), IsDirty(), MarkClean(), MarkDirty(), and Setup().
|
private |
DMA-BUF file descriptor.
Definition at line 118 of file drmbuffer.h.
Referenced by cDrmBuffer(), Destroy(), DmaBufHandle(), SetDmaBufHandle(), and Setup().
|
private |
drm device file descriptor
Definition at line 114 of file drmbuffer.h.
Referenced by Destroy(), SetFdDrm(), and Setup().
|
private |
framebuffer id
Definition at line 113 of file drmbuffer.h.
Referenced by cDrmBuffer(), Destroy(), Id(), SetId(), and Setup().
|
private |
buffer height
Definition at line 108 of file drmbuffer.h.
Referenced by cDrmBuffer(), Destroy(), FillBlack(), Height(), SetHeight(), and Setup().
|
private |
number of prime objects in the buffer
Definition at line 119 of file drmbuffer.h.
Referenced by cDrmBuffer(), Destroy(), SetNumObjects(), and Setup().
|
private |
number of planes in the buffer
Definition at line 116 of file drmbuffer.h.
Referenced by cDrmBuffer(), Destroy(), NumPlanes(), SetNumPlanes(), and Setup().
|
private |
primedata objects prime handles (count is numObjects, index is objIdx)
Definition at line 121 of file drmbuffer.h.
|
private |
index of the objects
Definition at line 120 of file drmbuffer.h.
Referenced by cDrmBuffer(), Destroy(), SetObjectIndex(), and Setup().
|
private |
array of the plane offset
Definition at line 125 of file drmbuffer.h.
Referenced by cDrmBuffer(), Destroy(), Offset(), SetOffset(), and Setup().
|
private |
array of the plane pitch
Definition at line 126 of file drmbuffer.h.
Referenced by cDrmBuffer(), Destroy(), Pitch(), SetPitch(), and Setup().
|
private |
buffer pixel format
Definition at line 109 of file drmbuffer.h.
Referenced by cDrmBuffer(), PixFmt(), SetPixFmt(), and Setup().
|
private |
array of the plane handles
Definition at line 124 of file drmbuffer.h.
Referenced by cDrmBuffer(), Destroy(), PrimeHandle(), SetHandle(), and Setup().
|
private |
array of the plane data
Definition at line 123 of file drmbuffer.h.
Referenced by cDrmBuffer(), Destroy(), FillBlack(), Plane(), and Setup().
|
private |
true, if buffer is pending presentation
Definition at line 129 of file drmbuffer.h.
Referenced by IsPresentationPending(), PresentationFinished(), and SetPresentationPending().
|
private |
array of the plane size
Definition at line 127 of file drmbuffer.h.
Referenced by cDrmBuffer(), Destroy(), SetSize(), Setup(), and Size().
|
private |
buffer width
Definition at line 107 of file drmbuffer.h.
Referenced by cDrmBuffer(), Destroy(), FillBlack(), Setup(), SetWidth(), and Width().