[MPlayer-dev-eng] Patch: Display OSD in the black stripes area with vo SMon Feb 11 16:13:18 2002

Fredrik Kuivinen freku045 at student.liu.se
Tue Feb 12 18:29:05 CET 2002


On Mon, Feb 11, 2002 at 04:15:15PM +0200, Arpi wrote:
> Hi,
> 
> > > > I think the OSD part will be registered as cosmetic changes.
> > > > 
> > > 
> > > And the rule "No cosmetic changes are allowed in cvs" will apply? If that is
> > > the case I don't think it is a cosmetic change. It is pretty useless to render
> > > the OSD in every frame if it isn't needed. And I don't see anyway to detect
> > > when the OSD changed without this patch.
> > 	For osd_func use a last value. After each rendering save the osd_func
> > 	value and on the next frame compare it to the current value to see if there
> > 	were any change.
> > 	Beside this imho this stuff must be done in a generic way, not per driver,
> > 	but I'm not the good one to debate on this point ;) .
> 
> I agree in both things, especially in the second. It is usefull for every
> drivers, why don't you implement it as generic code?
> Or is your implementation SDL-specific, i mean use few bounding box / clip
> rect features of sdl?
>

I really don't see how to do it in a generic way. At least not with the current
interface to libvo and how codecs interact with it.

One way would be to draw the OSD before it got to the libvo drivers. To do that
we would need a way to change the frame between the codec and the libvo driver.
This will probably be possible in a simple way when (if?) the filter layer gets
finished. But as it is now I don't know how to do it. Any hints?

> anyway i don't like that cosmetics chanegs at mplayer.c everywhere
> 

If we are going to display OSD above and/or below the image it will be useful
to know when the OSD changed because we can skip rendering those parts in most
of the frames. As I see it there are mainly two ways to detect wether the OSD
changed or not.

1. The one who is "responsible" for the OSD content notifies libvo
   drivers that the OSD was changed. This is what I tried to implement.

2. The libvo drivers stores old OSD contents and then checks if they have
   changed. This needs to be done in every frame. It will probably be quite
   hard to detect as there are a few different types of subtitles.

The changes I made to mplayer.c, sub.c and find_sub.c aren't specific to the
SDL libvo driver. They are useful for every driver that wants to know when the
OSD changed.

/ Fredrik Kuivinen




More information about the MPlayer-dev-eng mailing list