[MPlayer-dev-eng] [patch] dvd navigation for 20020402

Arpi arpi at thot.banki.hu
Wed Apr 3 04:33:12 CEST 2002


Hi,

> Ah-ha!  Thank you.  I've attached the resulting patch (for anyone 
> interested in seeing a box while the highlighting isn't work yet).  It 
> gets applied on top of the first patch.
> 
> I still think it might be handy to have an arbitrary line-drawing 
> routine, but that's just me.  :)

sooner or later - we have to implement some vector-based OSD renderer code,
with ability of rendering lines, transparent box, bitmap (normal or
scretched, b/w or color) and text using one or more fonts (in mplayer or ttf
format).

it may render postscript files runtime :)
would be interesting - mplayer with embedded postscript viewer :)

or just develop some much simper format... maybe linked list of objects
could be the solution, so objects could be added/removed/modified runtime
from other parts of teh code (like at mplayer.c). each object could have
a appear and disappear timestamp, and also a lifetime flag (if set, it
should be automagically deleted when time>disappear_timestamp).

so, what about this:

typedef struct {
  int x,y   // position
  int type; // enum of nothing(=disabled),point,line,box,text,bitmap...
  int flags // never hurts and helps later when we're extending struct :)
            // could add flags for bw vs. color, normal vs. scaled bitmap
  int bbox[4] // bounding box - usefull for osd reset etc...
              // should be calculated by the OSD core, not by the caller
  int color[4]; // r,g,b,a or y,u,v,a (another flag? :))
  union {
    struct {
      char* string;
      int fontsize;
      int fontid;
    } text;
    struct {
      int x1,y1,x2,y2;
    } line;
    struct {
      int w,h;
    } box;
    ...
  } params;
} mp_osd_obj_t;

we need functions, like
  mp_osd_obj_t* osd_add_obj();
  osd_del_obj(mp_osd_obj_t* obj);
  osd_set_text(mp_osd_obj_t* obj,char* text,int fontid,int fontsize);
  osd_set_box(mp_osd_obj_t* obj,int w,int h);
  ...

ok, design done. let's implement :)
any volunteers? :)


A'rpi / Astral & ESP-team

--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu



More information about the MPlayer-dev-eng mailing list