[MPlayer-dev-eng] [PATCH] SSA/ASS subtitles support

Evgeniy Stepanov eugeni.stepanov at gmail.com
Thu Apr 20 00:37:53 CEST 2006


On Thursday 20 April 2006 00:14, Reimar Döffinger wrote:
> > > 2) how difficult would it be to make a vo support this? I think for
> > > this it would be preferable if only the ass_draw_bitmap was in the
> > > filter and the rendering would be done some place outside, with the
> > > ass_draw_bitmap function being called via a VF_ message. Such a drawing
> > > function would be easy to implement in the vos as well, and vf_vo could
> > > pass such a message on to the vo if none of the filters accepted it.
> > > Thus there shouldn't be any need for special cases.
> > > Or is there too much data that the other functions currently in vf_ass
> > > need and is only available there?
> >
> > We can render subtitles from somewhere before decode_video() into an
> > alpha buffer, and blend it into image later (in vf_ass or some vo_). But
> > would not blending a large (full video dimensions in the worst case)
> > image be too slow ? What is the possible gain of this ?
>
> You misunderstood. Not a full image, just the same size as
> ass_draw_bitmap. Or more precisely, the idea is: move everything except
> the ass_draw_bitmap function out of vf_ass and into libass.
> There, place all ass_draw_bitmap calls by something along the lines
> vf->control(vf, VFCTRL_PERIODIC_UPDATE, &struct_with_draw_params);
> (a helper function similar to af_control_any_rev might be helpful).
> I guess this is not a requirement, but with the current design I fear it
> might be very hard to extend. I also admit, that with my proposed
> changes, we almost get a second vf_osd...

Libass generates series of small bitmaps and passes them to vf_ass. vf_ass 
keeps this bitmaps and blends them into every frame passing through it. Did I 
get it right this time ? :)

This is surely possible. ass_draw_bitmap needs only a bitmap (single alpha 
plane), a color, and a point where to put it. Clipping code can be moved to, 
say, render_text. All the data needed by (libass minus ass_draw_bitmap) is 
kept in libass' static vars, and is accessible from anywhere.




More information about the MPlayer-dev-eng mailing list