49:cOsd(left, top, level)
52 LOGDEBUG2(
L_OSD,
"osd: %s: %dx%d%+d%+d, %d", __FUNCTION__, OsdWidth(), OsdHeight(), left, top, level);
106 if (!IsTrueColor()) {
110 for (i = 0; (bitmap = GetBitmap(i)); i++)
119 return cOsd::SetAreas(areas, n);
136 if (!IsTrueColor()) {
143 LOGDEBUG2(
L_OSD,
"osd: %s: FIXME: should be truecolor", __FUNCTION__);
148 for (i = 0; (bitmap = GetBitmap(i)); ++i) {
165 x2 = bitmap->Width() - 1;
166 y2 = bitmap->Height() - 1;
167 }
else if (!bitmap->Dirty(x1, y1, x2, y2)) {
172 xs = bitmap->X0() + Left();
173 ys = bitmap->Y0() + Top();
205 if (w > width - xs - x1) {
212 if (h > height - ys - y1) {
213 h = height - ys - y1;
219 if (w > bitmap->Width() || h > bitmap->Height())
222 argb = (uint8_t *) malloc(w * h *
sizeof(uint32_t));
223 for (y = y1; y <= y2; ++y) {
224 for (x = x1; x <= x2; ++x) {
225 ((uint32_t *) argb)[x - x1 + (y - y1) * w] =
226 bitmap->GetColor(x, y);
229 LOGDEBUG2(
L_OSD,
"osd: %s: draw %dx%d%+d%+d bm", __FUNCTION__, w, h, xs + x1, ys + y1);
242 while ((pm = (
dynamic_cast < cPixmapMemory *
>(RenderPixmaps())))) {
251 x = pm->ViewPort().X();
252 y = pm->ViewPort().Y();
253 w = pm->ViewPort().Width();
254 h = pm->ViewPort().Height();
255 stride = w *
sizeof(tColor);
274 if (h > Height() - y)
302 LOGDEBUG2(
L_OSD,
"osd: %s: draw %dx%d%+d%+d*%d -> %+d%+d %p", __FUNCTION__, w, h, xp, yp, stride, x, y, pm->Data());
352 LOGDEBUG(
"osdprovider: %s: %d, %d, %d, device detached, using dummy osd", __FUNCTION__, left, top, level);
357 LOGDEBUG(
"osdprovider: %s: %d, %d, %d, OpenGL disabled, using software rendering", __FUNCTION__, left, top, level);
361 if (StartOpenGlThread()) {
362 LOGDEBUG2(
L_OSD,
"osdprovider: %s: %d, %d, %d, using OpenGL OSD support", __FUNCTION__, left, top, level);
366 LOGDEBUG(
"osdprovider: %s: %d, %d, %d, OpenGL failed, using software rendering", __FUNCTION__, left, top, 999);
371 LOGDEBUG(
"osdprovider: %s: %d, %d, %d, device detached, using dummy osd", __FUNCTION__, left, top, level);
375 LOGDEBUG2(
L_OSD,
"osdprovider: %s: %d, %d, %d", __FUNCTION__, left, top, level);
394void cSoftOsdProvider::OsdSizeChanged(
void) {
397 cSoftOsdProvider::StopOpenGlThread();
398 cSoftOsdProvider::UpdateOsdSize();
404bool cSoftOsdProvider::StartOpenGlThread(
void) {
406 LOGDEBUG2(
L_OPENGL,
"osdprovider: %s: OpenGL OSD disabled, OpenGL worker thread NOT started", __FUNCTION__);
410 if (m_pOglThread.get()) {
411 if (m_pOglThread->Active()) {
414 m_pOglThread.reset();
417 LOGDEBUG2(
L_OPENGL,
"osdprovider: %s: Trying to start OpenGL worker thread", __FUNCTION__);
421 if (m_pOglThread->Active()) {
422 LOGINFO(
"OpenGL worker thread started");
426 LOGDEBUG2(
L_OPENGL,
"osdprovider: %s: OpenGL worker thread NOT started", __FUNCTION__);
433void cSoftOsdProvider::StopOpenGlThread(
void) {
435 LOGDEBUG2(
L_OPENGL,
"osdprovider: %s: stopping OpenGL worker thread", __FUNCTION__);
436 m_pOglThread->Stop();
437 LOGINFO(
"OpenGL worker thread stopped");
439 m_pOglThread.reset();
445int cSoftOsdProvider::StoreImageData(
const cImage &Image)
447 if (StartOpenGlThread()) {
448 int imgHandle = m_pOglThread->StoreImage(Image);
457const cImage *cSoftOsdProvider::GetImageData(
int ImageHandle) {
458 return cOsdProvider::GetImageData(ImageHandle);
464void cSoftOsdProvider::DropImageData(
int imgHandle)
466 if (StartOpenGlThread())
467 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.