From patchwork Sun Apr 3 19:20:49 2005 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ville_Skytt=C3=A4?= X-Patchwork-Id: 11843 Received: from smtp1.pp.htv.fi ([213.243.153.34]) by www.linuxtv.org with esmtp (Exim 4.34) id 1DIAeC-0005kD-8t for vdr@linuxtv.org; Sun, 03 Apr 2005 21:20:36 +0200 Received: from cs78130200.pp.htv.fi (cs78130200.pp.htv.fi [62.78.130.200]) by smtp1.pp.htv.fi (Postfix) with ESMTP id 2364E7FC7C for ; Sun, 3 Apr 2005 22:20:50 +0300 (EEST) Subject: Re: [vdr] Patch: dxr3plugin OSD don't turn pink From: Ville =?ISO-8859-1?Q?Skytt=E4?= To: vdr@linuxtv.org In-Reply-To: <425022ED.7060008@compuserve.de> References: <424A9224.4000608@compuserve.de> <1112217417.31596.17.camel@bobcat.mine.nu> <424E66B0.1030901@ventoso.org> <424E6E6E.9000307@compuserve.de> <424E72B6.8000903@ventoso.org> <424E757F.2040804@ventoso.org> <424E7743.8060801@ventoso.org> <424E7852.60808@ventoso.org> <424E793E.9040202@ventoso.org> <1112448795.23456.48.camel@bobcat.mine.nu> <424ECCA5.1030309@ventoso.org> <1112461894.12964.1.camel@bobcat.mine.nu> <424FD272.2050808@ventoso.org> <424FEA9E.1050207@ventoso.org> <42501BA4.8070902@compuserve.de> <42502096.7030109@ventoso.org> <425022ED.7060008@compuserve.de> Date: Sun, 03 Apr 2005 22:20:49 +0300 Message-Id: <1112556049.24368.75.camel@bobcat.mine.nu> Mime-Version: 1.0 X-Mailer: Evolution 2.0.4 (2.0.4-2) X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Klaus Schmidinger's VDR List-Id: Klaus Schmidinger's VDR List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Apr 2005 19:20:39 -0000 Status: O X-Status: X-Keywords: X-UID: 1389 On Sun, 2005-04-03 at 19:07 +0200, Martin Cap wrote: > Hi ! > > The OSD still sucks, but I guess we made it suck a little less :) Indeed, seems so, at least mostly. This change introduces/triggers one new crash here, though. Not that tvonscreen >= 0.6.0 would be usable with DXR3 here anyway, I gave 0.7.0 a try with Martin's change applied; the exact change against vdr- dxr3-0-2 branch I'm using is attached. Every time the tvonscreen OSD is closed, I get a crash, backtrace attached. If I don't apply the patch, there's no crash, but parts of the tvonscreen OSD remain visible seemingly forever after closing it. Tvonscreen 0.5.2 continues to work pretty much ok with or without the patch applied. Fixes to the above are of course welcome, but unless I see more new issues while testing this patch some more, I'll go ahead and apply it next week. > Bye, > Martin Cap > > Luca Olivetti wrote: > > Martin Cap wrote: > > > >> Hi, Luca works great ! > > > > > > It works here too, even with yaepg. If you remove the logo display it's > > also possible to use the elchi skin with text2skin 1.0 (both with > > cDxr3PaletteManager or cPalette). Unfortunately the other skins > > available for text2skin 1.0 need more than the 16 colours the dxr3 is > > capable of showing. #0 0x00ad5c2e in cSPUEncoder::Cmd (this=0xb13440, cmd=11613248, color=0, x0=0, y0=0, x1=-84280061, y1=2, data=0x5060506) at dxr3interface_spu_encoder.c:405 405 *(cp+xx) = 0x00; (gdb) bt #0 0x00ad5c2e in cSPUEncoder::Cmd (this=0xb13440, cmd=11613248, color=0, x0=0, y0=0, x1=-84280061, y1=2, data=0x5060506) at dxr3interface_spu_encoder.c:405 #1 0x00add81b in cDxr3SubpictureOsd::~cDxr3SubpictureOsd () at streambuf:187 Index: Makefile =================================================================== RCS file: /cvsroot/dxr3plugin/dxr3/Makefile,v retrieving revision 1.1.2.10 diff -u -r1.1.2.10 Makefile --- Makefile 30 Mar 2005 21:22:48 -0000 1.1.2.10 +++ Makefile 3 Apr 2005 18:29:13 -0000 @@ -60,7 +60,7 @@ ### The object files (add further files here): OBJS = $(PLUGIN).o dxr3multichannelaudio.o dxr3sysclock.o dxr3colormanager.o dxr3syncbuffer.o dxr3audiodecoder.o \ -dxr3blackframe.o dxr3palettemanager.o dxr3nextpts.o dxr3pesframe.o dxr3demuxdevice.o dxr3configdata.o \ +dxr3blackframe.o dxr3nextpts.o dxr3pesframe.o dxr3demuxdevice.o dxr3configdata.o \ dxr3log.o dxr3ffmpeg.o dxr3interface_spu_encoder.o dxr3i18n.o \ dxr3interface.o dxr3device.o dxr3outputthread.o dxr3osd.o dxr3osd_subpicture.o dxr3spudecoder.o \ dxr3cpu.o dxr3memcpy.o Index: dxr3interface_spu_encoder.c =================================================================== RCS file: /cvsroot/dxr3plugin/dxr3/Attic/dxr3interface_spu_encoder.c,v retrieving revision 1.1.2.6 diff -u -r1.1.2.6 dxr3interface_spu_encoder.c --- dxr3interface_spu_encoder.c 30 Mar 2005 21:11:55 -0000 1.1.2.6 +++ dxr3interface_spu_encoder.c 3 Apr 2005 18:29:13 -0000 @@ -45,6 +45,7 @@ #include #include #include +#include "dxr3tools.h" namespace XineScaler { @@ -310,6 +311,7 @@ break; case OSD_SetPalette: + { // Spu->Cmd(OSD_SetPalette, 0, NumColors - 1, 0, 0, 0, Colors); // (firstcolor{color},lastcolor{x0},data) // Set a number of entries in the palette @@ -328,23 +330,18 @@ for (int x = color, i = 0; x <= x0; x++,i++) { - m_palManager.AddColor((int)*col & 0xFFFFFF); - - idx = m_palManager.GetIndex((int)*col & 0xFFFFFF); - if (m_palManager.HasChanged()) - { - cDxr3Interface::Instance().SetPalette(m_palManager.GetPalette()); - } - + idx = m_palManager.Index(Tools::Rgb2YCrCb(*col & 0x00FFFFFF)); opacity = ((*col & 0xFF000000) >> 24) * 0xF / 0xFF; m_windows[m_lastwindow].colors[i] = (opacity << 4) | idx; m_windows[m_lastwindow].opacity[i] = opacity; col++; } + int colors = 0; + cDxr3Interface::Instance().SetPalette((unsigned int*)m_palManager.Colors(colors)); return 0; break; - + } case OSD_SetBlock: // (x0,y0,x1,y1,increment{color},data) // fills pixels x0,y0 through x1,y1 with the content of data[] @@ -395,12 +392,7 @@ #else if ((col = (eDvbColor*)m_windows[m_lastwindow].colors) != NULL) #endif - { - for (size_t i = 0; i < m_windows[m_lastwindow].NumColors; ++i) - { - m_palManager.RemoveColor((int)(col[i]) & 0xFFFFFF); - } - } + m_palManager.Reset(); // clear osd for (size_t i = m_windows[m_lastwindow].y0; i <= m_windows[m_lastwindow].y1; ++i) @@ -449,7 +441,7 @@ // This should be done in cSPUEncoder::cSPUEncoder - m_palManager.Clear(); + m_palManager.Reset(); return 0; break; Index: dxr3interface_spu_encoder.h =================================================================== RCS file: /cvsroot/dxr3plugin/dxr3/Attic/dxr3interface_spu_encoder.h,v retrieving revision 1.1.2.1 diff -u -r1.1.2.1 dxr3interface_spu_encoder.h --- dxr3interface_spu_encoder.h 14 Mar 2005 22:21:07 -0000 1.1.2.1 +++ dxr3interface_spu_encoder.h 3 Apr 2005 18:29:13 -0000 @@ -33,7 +33,6 @@ #include #include #include "dxr3vdrincludes.h" -#include "dxr3palettemanager.h" #include "dxr3colormanager.h" #include "dxr3interface.h" #include "dxr3singleton.h" @@ -138,7 +137,7 @@ void CalculateActiveOsdArea(); sOSD_Window m_windows[8]; - cDxr3PaletteManager m_palManager; + cPalette m_palManager; // name for hysterical raisins ;) cColorManager* m_ColorManager; encodedata m_encodeddata; int m_lastwindow;