49 : cOsd(left, top, level),
53 LOGDEBUG2(
L_OSD,
"osd: %s: %dx%d%+d%+d, %d", __FUNCTION__, OsdWidth(), OsdHeight(), left, top, level);
103 if (!IsTrueColor()) {
107 for (i = 0; (bitmap = GetBitmap(i)); i++)
116 return cOsd::SetAreas(areas, n);
132 if (!IsTrueColor()) {
139 LOGDEBUG2(
L_OSD,
"osd: %s: FIXME: should be truecolor", __FUNCTION__);
144 for (i = 0; (bitmap = GetBitmap(i)); ++i) {
161 x2 = bitmap->Width() - 1;
162 y2 = bitmap->Height() - 1;
163 }
else if (!bitmap->Dirty(x1, y1, x2, y2)) {
168 xs = bitmap->X0() + Left();
169 ys = bitmap->Y0() + Top();
201 if (w > width - xs - x1) {
208 if (h > height - ys - y1) {
209 h = height - ys - y1;
215 if (w > bitmap->Width() || h > bitmap->Height())
218 argb = (uint8_t *) malloc(w * h *
sizeof(uint32_t));
219 for (y = y1; y <= y2; ++y) {
220 for (x = x1; x <= x2; ++x) {
221 ((uint32_t *) argb)[x - x1 + (y - y1) * w] =
222 bitmap->GetColor(x, y);
225 LOGDEBUG2(
L_OSD,
"osd: %s: draw %dx%d%+d%+d bm", __FUNCTION__, w, h, xs + x1, ys + y1);
238 while ((pm = (
dynamic_cast < cPixmapMemory *
>(RenderPixmaps())))) {
247 x = pm->ViewPort().X();
248 y = pm->ViewPort().Y();
249 w = pm->ViewPort().Width();
250 h = pm->ViewPort().Height();
251 stride = w *
sizeof(tColor);
270 if (h > Height() - y)
298 LOGDEBUG2(
L_OSD,
"osd: %s: draw %dx%d%+d%+d*%d -> %+d%+d %p", __FUNCTION__, w, h, xp, yp, stride, x, y, pm->Data());
349 LOGDEBUG(
"osdprovider: %s: %d, %d, %d, device detached, using dummy osd", __FUNCTION__, left, top, level);
354 LOGDEBUG(
"osdprovider: %s: %d, %d, %d, OpenGL disabled, using software rendering", __FUNCTION__, left, top, level);
358 if (StartOpenGlThread()) {
359 LOGDEBUG2(
L_OSD,
"osdprovider: %s: %d, %d, %d, using OpenGL OSD support", __FUNCTION__, left, top, level);
363 LOGDEBUG(
"osdprovider: %s: %d, %d, %d, OpenGL failed, using software rendering", __FUNCTION__, left, top, 999);
368 LOGDEBUG(
"osdprovider: %s: %d, %d, %d, device detached, using dummy osd", __FUNCTION__, left, top, level);
372 LOGDEBUG2(
L_OSD,
"osdprovider: %s: %d, %d, %d", __FUNCTION__, left, top, level);
391void cSoftOsdProvider::OsdSizeChanged(
void) {
394 cSoftOsdProvider::StopOpenGlThread();
395 cSoftOsdProvider::UpdateOsdSize();
401bool cSoftOsdProvider::StartOpenGlThread(
void) {
403 LOGDEBUG2(
L_OPENGL,
"osdprovider: %s: OpenGL OSD disabled, OpenGL worker thread NOT started", __FUNCTION__);
407 if (m_pOglThread.get()) {
408 if (m_pOglThread->Active()) {
411 m_pOglThread.reset();
414 LOGDEBUG2(
L_OPENGL,
"osdprovider: %s: Trying to start OpenGL worker thread", __FUNCTION__);
418 if (m_pOglThread->Active()) {
419 LOGINFO(
"OpenGL worker thread started");
423 LOGDEBUG2(
L_OPENGL,
"osdprovider: %s: OpenGL worker thread NOT started", __FUNCTION__);
430void cSoftOsdProvider::StopOpenGlThread(
void) {
432 LOGDEBUG2(
L_OPENGL,
"osdprovider: %s: stopping OpenGL worker thread", __FUNCTION__);
433 m_pOglThread->Stop();
434 LOGINFO(
"OpenGL worker thread stopped");
436 m_pOglThread.reset();
442int cSoftOsdProvider::StoreImageData(
const cImage &Image)
444 if (StartOpenGlThread()) {
445 int imgHandle = m_pOglThread->StoreImage(Image);
454const cImage *cSoftOsdProvider::GetImageData(
int ImageHandle) {
455 return cOsdProvider::GetImageData(ImageHandle);
461void cSoftOsdProvider::DropImageData(
int imgHandle)
463 if (StartOpenGlThread())
464 m_pOglThread->DropImageData(imgHandle);
cDummyOsd - dummy osd class
void OsdDrawARGB(int, int, int, int, int, const uint8_t *, int, int)
Draw an OSD pixmap.
bool IsOsdProviderSet(void) const
virtual void GetOsdSize(int &, int &, double &)
Returns the width, height and aspect ratio the OSD.
void ResetOsdProvider(void)
bool IsDetached(void) const
Returns true, if the device is detached.
void OsdClose(void)
Close the OSD.
virtual cOsd * CreateOsd(int, int, uint)
Create a new OSD.
virtual ~cSoftOsdProvider()
cOsdProvider destructor
cOsd * m_pOsd
pointer to single OSD (currently not really used in cSoftOsdProvider?)
virtual bool ProvidesTrueColor(void)
Check if this OSD provider is able to handle a true color OSD.
cSoftOsdProvider(cSoftHdDevice *)
cOsdProvider constructor
cSoftHdDevice * m_pDevice
pointer to the cSoftHdDevice object
cSoftOsd - SoftHdDevice plugin software OSD class
virtual void Flush(void)
Actually commit all data to the OSD hardware.
int m_osdLevel
current osd level
virtual ~cSoftOsd(void)
cSoftOsd destructor
virtual eOsdError SetAreas(const tArea *, int)
Set the sub-areas to the given areas.
cSoftHdDevice * m_pDevice
pointer to the cSoftHdDevice object
virtual void SetActive(bool)
Sets this OSD to be the active one.
bool m_dirty
flag to force redrawing everything
cSoftOsd(int, int, uint, cSoftHdDevice *)
cSoftOsd constructor
Logger class header file.
Osd class - hardware accelerated (OpenGL/ES) - header file.
Device class header file.
Softhddevice osd header file.