DXR3 and subtitles in 1.5.x

Message ID 47CF0CCB.70309@ventoso.org
State New
Headers

Commit Message

Luca Olivetti March 5, 2008, 9:12 p.m. UTC
  En/na Sami Sundell ha escrit:
> On Wed, Mar 05, 2008 at 05:51:07PM +0100, Klaus Schmidinger wrote:
> 
>> I'd say this whole thing is a DXR3 problem, not a core VDR problem.
>> Therefore I'm afraid I can't contribute to the solution...
> 
> Looks like it, but thanks anyway.
> 
> ... found the 0.2.x-branch in the dxr3 plugin CVS, which gives me

Yes, that's the "good" one (I don't think anybody is working on the HEAD 
version).

> picture but still bleeding subtitles. Now it won't crash if I try to
> access the OSD, it just stops responding to remote. :P

Well, I also had to modify dvbsubtitle.c (with some hints from the 
dxr3-plugin mailing list), and since I go from one vdr version to the 
next one with the patch, I forgot it.
Attached is a diff from the stock dvbsubtitle.c in 1.5.17 and the 
version I'm using.
I don't know if it's a good or bad patch but it works here, no bleeding 
and the lirc remote is responsive.
I also cannot say if any of the other patches I have make a difference.

Bye
  

Comments

Klaus Schmidinger March 5, 2008, 9:21 p.m. UTC | #1
On 03/05/08 22:12, Luca Olivetti wrote:
> En/na Sami Sundell ha escrit:
>> On Wed, Mar 05, 2008 at 05:51:07PM +0100, Klaus Schmidinger wrote:
>>
>>> I'd say this whole thing is a DXR3 problem, not a core VDR problem.
>>> Therefore I'm afraid I can't contribute to the solution...
>>
>> Looks like it, but thanks anyway.
>>
>> ... found the 0.2.x-branch in the dxr3 plugin CVS, which gives me
> 
> Yes, that's the "good" one (I don't think anybody is working on the HEAD
> version).
> 
>> picture but still bleeding subtitles. Now it won't crash if I try to
>> access the OSD, it just stops responding to remote. :P
> 
> Well, I also had to modify dvbsubtitle.c (with some hints from the
> dxr3-plugin mailing list), and since I go from one vdr version to the
> next one with the patch, I forgot it.
> Attached is a diff from the stock dvbsubtitle.c in 1.5.17 and the
> version I'm using.
> I don't know if it's a good or bad patch but it works here, no bleeding
> and the lirc remote is responsive.
> I also cannot say if any of the other patches I have make a difference.

There's one thing I can say: this patch is not going into the official
VDR source. The problem is in the DXR3 plugin: the correct way to handle this
is for the OSD object to truthfully report whether it can handle the
requested areas or not, and if it claims to be able to handle them,
then do so

Klaus
  
Sami Sundell March 5, 2008, 10:35 p.m. UTC | #2
On Wed, Mar 05, 2008 at 10:12:43PM +0100, Luca Olivetti wrote:

> Well, I also had to modify dvbsubtitle.c (with some hints from the
> dxr3-plugin mailing list), and since I go from one vdr version to the  

Thanks for the info and the patch - I've spent this evening looking at
the sources and got the feeling that the cvs version of dxr3 won't alone
help in getting the subs working. I was just in the middle of modifying
the said dvbsubtitle.c - good that I won't have to do that alone :P

The problems with no picture went away once I noticed that generating a
new deb package of VDR and installing it also requires installing the
headers and rebuilding the dxr3 plugin against them...

> I don't know if it's a good or bad patch but it works here, no
> bleeding  and the lirc remote is responsive.

Ok, now the subtitles work, but I still have problems with subtitles and
OSD together - remote becomes unresponsive and I get errors:

Mar  5 23:45:42 dvd vdr: [5102] ERROR: attempt to open OSD while it is
already open - using dummy OSD!

Closer to goal, though 8)
  
Luca Olivetti March 5, 2008, 11:26 p.m. UTC | #3
En/na Klaus Schmidinger ha escrit:

> 
> There's one thing I can say: this patch is not going into the official

Sure, I understand that

> VDR source. The problem is in the DXR3 plugin: the correct way to handle this
> is for the OSD object to truthfully report whether it can handle the
> requested areas or not, and if it claims to be able to handle them,
> then do so

Well, it isn't so simple, since color management with the dxr3 uses many 
tricks.
Natively it's only capable of 2bpp, but with a lot of tricks it manages 
4bpp for a typical osd. If it reports 2bpp, most everything would work 
(I think osd teletext wouldn't) but with a very dull osd, if it reports 
4bpp everything works as long as there's no antialiasing.

Bye
  
Sami Sundell March 5, 2008, 11:57 p.m. UTC | #4
On Thu, Mar 06, 2008 at 12:35:54AM +0200, Sami Sundell wrote:

> Ok, now the subtitles work, but I still have problems with subtitles
> and OSD together - remote becomes unresponsive and I get errors:
> 
> Mar  5 23:45:42 dvd vdr: [5102] ERROR: attempt to open OSD while it is
> already open - using dummy OSD!

... and this went away when I changed the cDxr3SubpictureOsd constructor
to call the cOsd with proper level. Unless I'm missing something - and I
bet I am - the system seems to be working smoothly now.

Thanks for all!
  
Luca Olivetti March 6, 2008, 8:34 a.m. UTC | #5
En/na Sami Sundell ha escrit:
> On Thu, Mar 06, 2008 at 12:35:54AM +0200, Sami Sundell wrote:
> 
>> Ok, now the subtitles work, but I still have problems with subtitles
>> and OSD together - remote becomes unresponsive and I get errors:
>>
>> Mar  5 23:45:42 dvd vdr: [5102] ERROR: attempt to open OSD while it is
>> already open - using dummy OSD!
> 
> ... and this went away when I changed the cDxr3SubpictureOsd constructor
> to call the cOsd with proper level. Unless I'm missing something - and I
> bet I am - the system seems to be working smoothly now.

Mmh, it should be already doing it, look at line 39

http://dxr3plugin.cvs.sourceforge.net/dxr3plugin/dxr3/dxr3osd_subpicture.c?revision=1.1.2.18&view=markup&pathrev=vdr-dxr3-0-2

Bye
  
Luca Olivetti March 6, 2008, 8:39 a.m. UTC | #6
En/na Luca Olivetti ha escrit:

>> ... and this went away when I changed the cDxr3SubpictureOsd constructor
>> to call the cOsd with proper level. Unless I'm missing something - and I
>> bet I am - the system seems to be working smoothly now.
> 
> Mmh, it should be already doing it, look at line 39
> 
> http://dxr3plugin.cvs.sourceforge.net/dxr3plugin/dxr3/dxr3osd_subpicture.c?revision=1.1.2.18&view=markup&pathrev=vdr-dxr3-0-2 

(slaps on head), ok, that's calling it with 0, in my local copy I'm 
calling it with Level (probably the problem was introduced when I made 
the patch for the cvs version supporting older vdr releases).
Sorry for all the trouble.

Ville, are you listening? ;-)

Bye
  
Ville Skyttä March 6, 2008, 6:05 p.m. UTC | #7
On Thursday 06 March 2008, Luca Olivetti wrote:
> En/na Luca Olivetti ha escrit:
> >> ... and this went away when I changed the cDxr3SubpictureOsd constructor
> >> to call the cOsd with proper level. Unless I'm missing something - and I
> >> bet I am - the system seems to be working smoothly now.
> >
> > Mmh, it should be already doing it, look at line 39
> >
> > http://dxr3plugin.cvs.sourceforge.net/dxr3plugin/dxr3/dxr3osd_subpicture.
> >c?revision=1.1.2.18&view=markup&pathrev=vdr-dxr3-0-2
>
> (slaps on head), ok, that's calling it with 0, in my local copy I'm
> calling it with Level (probably the problem was introduced when I made
> the patch for the cvs version supporting older vdr releases).
> Sorry for all the trouble.
>
> Ville, are you listening? ;-)

Sure; committed, thanks!
  

Patch

--- vdr-1.5.17.orig/dvbsubtitle.c	2007-11-25 14:33:08.000000000 +0100
+++ vdr-1.5.17/dvbsubtitle.c	2008-01-20 19:24:05.785023000 +0100
@@ -983,13 +983,22 @@ 
      return;
   tArea *Areas = Page->GetAreas();
   int NumAreas = Page->regions.Count();
-  int Bpp = 8;
   bool Reduced = false;
-  while (osd->CanHandleAreas(Areas, NumAreas) != oeOk) {
+  for (int i = 0; i < NumAreas; i++) {
+    if (Areas[i].bpp > 2) {
+      Areas[i].bpp = 2;
+      Reduced = true;
+    }
+  }
+  
+  /*
+  int Bpp = 4;
+  bool Reduced = false;
+  //while (osd->CanHandleAreas(Areas, NumAreas) != oeOk) {
         int HalfBpp = Bpp / 2;
         if (HalfBpp >= 2) {
            for (int i = 0; i < NumAreas; i++) {
-               if (Areas[i].bpp >= Bpp) {
+               while (Areas[i].bpp >= Bpp) {
                   Areas[i].bpp = HalfBpp;
                   Reduced = true;
                   }
@@ -998,7 +1007,9 @@ 
            }
         else
            return; // unable to draw bitmaps
+  //
         }
+  */      
   if (Reduced) {
      for (int i = 0; i < NumAreas; i++) {
          cSubtitleRegion *sr = Page->regions.Get(i);