Kodi Documentation 23.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CVideoBuffer Class Reference

#include <VideoBuffer.h>

Inheritance diagram for CVideoBuffer:
CMediaCodecVideoBuffer CStarfishVideoBuffer CVideoBufferDRMPRIME CVideoBufferFFmpeg CVideoBufferSysMem CVideoBufferWasmMedia CVideoBufferWebCodecs DXVA::CVideoBuffer VAAPI::CVaapiRenderPicture VDPAU::CVdpauRenderPicture VTB::CVideoBufferVTB

Public Member Functions

 CVideoBuffer ()=delete
 
virtual ~CVideoBuffer ()=default
 
void Acquire ()
 
void Acquire (std::shared_ptr< IVideoBufferPool > pool)
 
void Release ()
 
int GetId () const
 
virtual AVPixelFormat GetFormat ()
 
virtual uint8_t * GetMemPtr ()
 
virtual void GetPlanes (uint8_t *(&planes)[YuvImage::MAX_PLANES])
 
virtual void GetStrides (int(&strides)[YuvImage::MAX_PLANES])
 
virtual void SetPixelFormat (const AVPixelFormat pixFormat)
 
virtual void SetDimensions (int width, int height, const int(&strides)[YuvImage::MAX_PLANES])
 
virtual void SetDimensions (int width, int height, const int(&strides)[YuvImage::MAX_PLANES], const int(&planeOffsets)[YuvImage::MAX_PLANES])
 
virtual void SyncStart ()
 Begin CPU access to the buffer memory.
 
virtual void SyncEnd ()
 End CPU access to the buffer memory. Counterpart to SyncStart().
 
virtual AVDRMFrameDescriptor * GetDescriptor () const
 Return an AVDRMFrameDescriptor for platform-buffer-aware callers.
 
virtual ReductionResult ReduceForAnalysis (KODI::VIDEO::GEOMETRY::ReducedFrame &reduction, unsigned int sourceWidth, unsigned int sourceHeight, unsigned int targetWidth)
 Produce a small CPU-readable copy of the picture, for analysis that survives downscaling, when GetPlanes() exposes nothing. Not supported by default.
 

Static Public Member Functions

static bool CopyPicture (YuvImage *pDst, YuvImage *pSrc)
 
static bool CopyNV12Picture (YuvImage *pDst, YuvImage *pSrc)
 
static bool CopyYUV422PackedPicture (YuvImage *pDst, YuvImage *pSrc)
 

Protected Member Functions

 CVideoBuffer (int id)
 

Protected Attributes

AVPixelFormat m_pixFormat = AV_PIX_FMT_NONE
 
std::atomic_int m_refCount
 
int m_id
 
std::shared_ptr< IVideoBufferPool > m_pool
 

Constructor & Destructor Documentation

◆ CVideoBuffer() [1/2]

CVideoBuffer::CVideoBuffer ( )
delete

◆ ~CVideoBuffer()

virtual CVideoBuffer::~CVideoBuffer ( )
virtualdefault

Reimplemented in DXVA::CVideoBuffer.

◆ CVideoBuffer() [2/2]

CVideoBuffer::CVideoBuffer ( int id)
explicitprotected

Member Function Documentation

◆ Acquire() [1/2]

void CVideoBuffer::Acquire ( )

◆ Acquire() [2/2]

void CVideoBuffer::Acquire ( std::shared_ptr< IVideoBufferPool > pool)

◆ CopyNV12Picture()

bool CVideoBuffer::CopyNV12Picture ( YuvImage * pDst,
YuvImage * pSrc )
static

◆ CopyPicture()

bool CVideoBuffer::CopyPicture ( YuvImage * pDst,
YuvImage * pSrc )
static

◆ CopyYUV422PackedPicture()

bool CVideoBuffer::CopyYUV422PackedPicture ( YuvImage * pDst,
YuvImage * pSrc )
static

◆ GetDescriptor()

virtual AVDRMFrameDescriptor * CVideoBuffer::GetDescriptor ( ) const
inlinevirtual

Return an AVDRMFrameDescriptor for platform-buffer-aware callers.

Default no-op returning nullptr. Overridden by DRM PRIME buffer types (e.g. CVideoBufferDMA) that carry a DMA-BUF descriptor. Lets cross- platform callers query for a platform handle without needing to know the concrete buffer type.

Reimplemented in CVideoBufferDMA, CVideoBufferDRMPRIME, and CVideoBufferDRMPRIMEFFmpeg.

◆ GetFormat()

AVPixelFormat CVideoBuffer::GetFormat ( )
virtual

◆ GetId()

int CVideoBuffer::GetId ( ) const
inline

◆ GetMemPtr()

virtual uint8_t * CVideoBuffer::GetMemPtr ( )
inlinevirtual

Reimplemented in CVideoBufferDMA, and CVideoBufferSysMem.

◆ GetPlanes()

virtual void CVideoBuffer::GetPlanes ( uint8_t *(&) planes[YuvImage::MAX_PLANES])
inlinevirtual

◆ GetStrides()

virtual void CVideoBuffer::GetStrides ( int(&) strides[YuvImage::MAX_PLANES])
inlinevirtual

◆ ReduceForAnalysis()

virtual ReductionResult CVideoBuffer::ReduceForAnalysis ( KODI::VIDEO::GEOMETRY::ReducedFrame & reduction,
unsigned int sourceWidth,
unsigned int sourceHeight,
unsigned int targetWidth )
inlinevirtual

Produce a small CPU-readable copy of the picture, for analysis that survives downscaling, when GetPlanes() exposes nothing. Not supported by default.

reduction is written only on Produced, and its plane vectors are reused across calls. The height follows the source shape, and a source already smaller is copied at its size.

Reimplemented in DXVA::CVideoBuffer, and VTB::CVideoBufferVTB.

◆ Release()

void CVideoBuffer::Release ( )

◆ SetDimensions() [1/2]

virtual void CVideoBuffer::SetDimensions ( int width,
int height,
const int(&) strides[YuvImage::MAX_PLANES] )
inlinevirtual

Reimplemented in CVideoBufferDMA, and CVideoBufferSysMem.

◆ SetDimensions() [2/2]

virtual void CVideoBuffer::SetDimensions ( int width,
int height,
const int(&) strides[YuvImage::MAX_PLANES],
const int(&) planeOffsets[YuvImage::MAX_PLANES] )
inlinevirtual

Reimplemented in CVideoBufferDMA, and CVideoBufferSysMem.

◆ SetPixelFormat()

virtual void CVideoBuffer::SetPixelFormat ( const AVPixelFormat pixFormat)
inlinevirtual

Reimplemented in CVideoBufferSysMem.

◆ SyncEnd()

virtual void CVideoBuffer::SyncEnd ( )
inlinevirtual

End CPU access to the buffer memory. Counterpart to SyncStart().

Reimplemented in CVideoBufferDMA.

◆ SyncStart()

virtual void CVideoBuffer::SyncStart ( )
inlinevirtual

Begin CPU access to the buffer memory.

Default no-op. Overridden by buffer subclasses (e.g. CVideoBufferDMA) that need to coordinate CPU-side reads/writes with GPU/DMA access. Callers can invoke unconditionally without knowing the concrete buffer type.

Reimplemented in CVideoBufferDMA.

Member Data Documentation

◆ m_id

int CVideoBuffer::m_id
protected

◆ m_pixFormat

AVPixelFormat CVideoBuffer::m_pixFormat = AV_PIX_FMT_NONE
protected

◆ m_pool

std::shared_ptr<IVideoBufferPool> CVideoBuffer::m_pool
protected

◆ m_refCount

std::atomic_int CVideoBuffer::m_refCount
protected

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