diff options
Diffstat (limited to 'osdmanager.c')
-rw-r--r-- | osdmanager.c | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/osdmanager.c b/osdmanager.c index e5dd46d..83a0fde 100644 --- a/osdmanager.c +++ b/osdmanager.c @@ -2,9 +2,18 @@ #include "osdmanager.h" cOsdManager::cOsdManager(void) { + osd = NULL; } -bool cOsdManager::setOsd() { +void cOsdManager::Lock(void) { + mutex.Lock(); +} + +void cOsdManager::Unlock(void) { + mutex.Unlock(); +} + +bool cOsdManager::CreateOsd(void) { osd = cOsdProvider::NewOsd(cOsd::OsdLeft(), cOsd::OsdTop()); if (osd) { tArea Area = { 0, 0, cOsd::OsdWidth() - 1, cOsd::OsdHeight() - 1, 32 }; @@ -15,7 +24,14 @@ bool cOsdManager::setOsd() { return false; } -void cOsdManager::setBackground() { +void cOsdManager::DeleteOsd(void) { + Lock(); + delete osd; + osd = NULL; + Unlock(); +} + +void cOsdManager::SetBackground(void) { if (config.displayStatusHeader && config.scaleVideo) { int widthStatus = cOsd::OsdWidth() - geoManager.statusHeaderHeight * 16 / 9; @@ -27,12 +43,20 @@ void cOsdManager::setBackground() { } -cPixmap *cOsdManager::requestPixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort) { - return osd->CreatePixmap(Layer, ViewPort, DrawPort); +cPixmap *cOsdManager::CreatePixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort) { + if (osd) + return osd->CreatePixmap(Layer, ViewPort, DrawPort); + return NULL; } -void cOsdManager::releasePixmap(cPixmap *pixmap) { - if (!pixmap) +void cOsdManager::DestroyPixmap(cPixmap *pixmap) { + if (!osd || !pixmap) return; osd->DestroyPixmap(pixmap); } + +void cOsdManager::Flush(void) { + if (osd) { + osd->Flush(); + } +} |