Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: patch OSD color on linuxppc



Ralph Metzler wrote:
> 
> Jean Martin writes:
>  > --- dvb.c    Sat Apr 13 00:01:13 2002
>  > +++ dvbmodppc.c      Sat Apr 13 00:01:04 2002
>  >
>  > @@ -1899,9 +1899,15 @@
>  >                  if (copy_from_user(colors, dc->data, sizeof(colors)))
>  >                          return -EFAULT;
>  >                  for (i=0; i<len; i++)
>  > -                        OSDSetColor(dvb, dc->color+i,
>  > +#ifndef __powerpc__
>  > +                       OSDSetColor(dvb, dc->color+i,
>  >                                      colors[i*4]  , colors[i*4+1],
>  >                                      colors[i*4+2], colors[i*4+3]);
>  > +#else
>  > +                       OSDSetColor(dvb, dc->color+i,
>  > +                                    colors[i*4+3]  ,colors[i*4+2],
>  > +                                    colors[i*4+1], colors[i*4+0]);
>  > +#endif
>  >                  return 0;
>  >          }
>  >          case OSD_SetTrans:
> 
> No, this only seems to be necessary because VDR treats the palette as an array
> of u32 (or enums to be specific) but it is defined as an array of u8.
> VDR uses enum entries with ABGR ABGR ... which translate to
> R G B A R G B A ... on little-endian but A B G R A B G R ...
> on big-endian when casting u32* to u8*. It should use u8 arrays
> with the right order instead.

I don't have a PPC, so I can't test this. But maybe this helps:

--- dvbosd.c    2002/01/13 16:25:18     1.12
+++ dvbosd.c    2002/04/13 11:34:48     1.13
@@ -25,6 +25,9 @@
 
 int cPalette::Index(eDvbColor Color)
 {
+#if __BYTE_ORDER == __BIG_ENDIAN
+  Color = eDvbColor(((Color & 0xFF) << 24) | ((Color & 0xFF00) << 8) | ((Color & 0xFF0000) >> 8) | ((Color & 0xFF000000) >> 24));
+#endif
   for (int i = 0; i < numColors; i++) {
       if (color[i] == Color) {
          used[i] = true;

Klaus
-- 
_______________________________________________________________

Klaus Schmidinger                       Phone: +49-8635-6989-10
CadSoft Computer GmbH                   Fax:   +49-8635-6989-40
Hofmark 2                               Email:   kls@cadsoft.de
D-84568 Pleiskirchen, Germany           URL:     www.cadsoft.de
_______________________________________________________________


-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.


Home | Main Index | Thread Index