vdr-plugin-softhddevice-drm-gles 1.6.4-d0291bb
cOglThread Class Reference

OpenGL Commands Processing Thread. More...

#include <openglosd.h>

Public Member Functions

 cOglThread (cCondWait *startWait, int maxCacheSize, cSoftHdDevice *device)
 
virtual ~cOglThread (void)
 
void RequestStop (void)
 
void Stop (void)
 
void DoCmd (cOglCmd *)
 
int StoreImage (const cImage &)
 
void DropImageData (int)
 
sOglImageGetImageRef (int)
 
int MaxTextureSize (void)
 
void LockOutputFb (void)
 
void UnlockOutputFb (void)
 

Protected Member Functions

virtual void Action (void)
 

Private Member Functions

bool InitOpenGL (void)
 
bool InitShaders (void)
 
void DeleteShaders (void)
 
bool InitVertexBuffers (void)
 
void DeleteVertexBuffers (void)
 
void Cleanup (void)
 
void CleanupImageCache (void)
 
int GetFreeSlot (void)
 
void ClearSlot (int slot)
 
void eglAcquireContext (void)
 

Private Attributes

cCondWaitm_startWait
 
cCondWait m_wait
 
bool m_stalled = false
 
std::queue< cOglCmd * > m_commands
 
GLint m_maxTextureSize = 0
 
sOglImage m_imageCache [OGL_MAX_OSDIMAGES]
 
long m_memCached = 0
 
long m_maxCacheSize
 
cVideoRenderm_pRender
 
std::mutex m_mutex
 

Detailed Description

OpenGL Commands Processing Thread.

Continuosly executes OpenGL commands

Every OSD draw or flush which is invoked by VDR is transposed into an OpenGL command. cOglThread holds a fifo-queue of these commands. It continuosly checks for commands on the queue, pops them and sends them to the hardware.

On startup it initiates all necessary OpenGL bits.

Definition at line 713 of file openglosd.h.

Constructor & Destructor Documentation

◆ cOglThread()

cOglThread::cOglThread ( cCondWait startWait,
int  maxCacheSize,
cSoftHdDevice device 
)

◆ ~cOglThread()

virtual cOglThread::~cOglThread ( void  )
inlinevirtual

Definition at line 716 of file openglosd.h.

Member Function Documentation

◆ Action()

◆ Cleanup()

void cOglThread::Cleanup ( void  )
private

◆ CleanupImageCache()

void cOglThread::CleanupImageCache ( void  )
private

Definition at line 1671 of file openglosd.cpp.

References DropImageData(), m_imageCache, and OGL_MAX_OSDIMAGES.

Referenced by RequestStop(), and Stop().

◆ ClearSlot()

void cOglThread::ClearSlot ( int  slot)
private

◆ DeleteShaders()

void cOglThread::DeleteShaders ( void  )
private

Definition at line 1945 of file openglosd.cpp.

References Shaders, and stCount.

Referenced by Cleanup().

◆ DeleteVertexBuffers()

void cOglThread::DeleteVertexBuffers ( void  )
private

Definition at line 1964 of file openglosd.cpp.

References vbCount, and VertexBuffers.

Referenced by Cleanup().

◆ DoCmd()

void cOglThread::DoCmd ( cOglCmd cmd)

Definition at line 1694 of file openglosd.cpp.

References m_commands, m_stalled, m_wait, and OGL_CMDQUEUE_SIZE.

Referenced by DropImageData(), and StoreImage().

◆ DropImageData()

void cOglThread::DropImageData ( int  imageHandle)

Definition at line 1805 of file openglosd.cpp.

References ClearSlot(), DoCmd(), GetImageRef(), and m_memCached.

Referenced by CleanupImageCache(), and StoreImage().

◆ eglAcquireContext()

void cOglThread::eglAcquireContext ( void  )
private

◆ GetFreeSlot()

int cOglThread::GetFreeSlot ( void  )
private

Definition at line 1770 of file openglosd.cpp.

References m_imageCache, OGL_MAX_OSDIMAGES, and sOglImage::used.

Referenced by StoreImage().

◆ GetImageRef()

sOglImage * cOglThread::GetImageRef ( int  slot)

Definition at line 1797 of file openglosd.cpp.

References m_imageCache, and OGL_MAX_OSDIMAGES.

Referenced by DropImageData(), and StoreImage().

◆ InitOpenGL()

bool cOglThread::InitOpenGL ( void  )
private
Todo:
: InitOpenGL has no "return false", but cOglThread::Action() checks against the return value.

Definition at line 1908 of file openglosd.cpp.

References eglAcquireContext(), GL_CHECK, cVideoRender::GlInitiated(), L_OPENGL, LOGDEBUG2, m_pRender, vbText, and VertexBuffers.

Referenced by Action().

◆ InitShaders()

bool cOglThread::InitShaders ( void  )
private

Definition at line 1932 of file openglosd.cpp.

References L_OPENGL, LOGDEBUG2, Shaders, and stCount.

Referenced by Action().

◆ InitVertexBuffers()

bool cOglThread::InitVertexBuffers ( void  )
private

Definition at line 1951 of file openglosd.cpp.

References L_OPENGL, LOGDEBUG2, vbCount, and VertexBuffers.

Referenced by Action().

◆ LockOutputFb()

void cOglThread::LockOutputFb ( void  )
inline

Definition at line 725 of file openglosd.h.

References m_mutex.

◆ MaxTextureSize()

int cOglThread::MaxTextureSize ( void  )
inline

Definition at line 724 of file openglosd.h.

References m_maxTextureSize.

◆ RequestStop()

void cOglThread::RequestStop ( void  )

Definition at line 1680 of file openglosd.cpp.

References CleanupImageCache().

◆ Stop()

void cOglThread::Stop ( void  )

Definition at line 1686 of file openglosd.cpp.

References Cleanup(), CleanupImageCache(), and m_stalled.

◆ StoreImage()

int cOglThread::StoreImage ( const cImage image)

◆ UnlockOutputFb()

void cOglThread::UnlockOutputFb ( void  )
inline

Definition at line 726 of file openglosd.h.

References m_mutex.

Member Data Documentation

◆ m_commands

std::queue<cOglCmd*> cOglThread::m_commands
private

Definition at line 733 of file openglosd.h.

Referenced by Action(), and DoCmd().

◆ m_imageCache

sOglImage cOglThread::m_imageCache[OGL_MAX_OSDIMAGES]
private

Definition at line 735 of file openglosd.h.

Referenced by CleanupImageCache(), ClearSlot(), cOglThread(), GetFreeSlot(), and GetImageRef().

◆ m_maxCacheSize

long cOglThread::m_maxCacheSize
private

Definition at line 737 of file openglosd.h.

Referenced by StoreImage().

◆ m_maxTextureSize

GLint cOglThread::m_maxTextureSize = 0
private

Definition at line 734 of file openglosd.h.

Referenced by Action(), MaxTextureSize(), and StoreImage().

◆ m_memCached

long cOglThread::m_memCached = 0
private

Definition at line 736 of file openglosd.h.

Referenced by DropImageData(), and StoreImage().

◆ m_mutex

std::mutex cOglThread::m_mutex
private

Definition at line 739 of file openglosd.h.

Referenced by Action(), LockOutputFb(), and UnlockOutputFb().

◆ m_pRender

cVideoRender* cOglThread::m_pRender
private

Definition at line 738 of file openglosd.h.

Referenced by eglAcquireContext(), and InitOpenGL().

◆ m_stalled

bool cOglThread::m_stalled = false
private

Definition at line 732 of file openglosd.h.

Referenced by Action(), DoCmd(), and Stop().

◆ m_startWait

cCondWait* cOglThread::m_startWait
private

Definition at line 730 of file openglosd.h.

Referenced by Action().

◆ m_wait

cCondWait cOglThread::m_wait
private

Definition at line 731 of file openglosd.h.

Referenced by Action(), and DoCmd().


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