[gst-devel] Text rendering

Gergely Nagy gergely.nagy at gmail.com
Sun Feb 20 09:31:25 CET 2005


> 1. Kindly throw some light on your proposal(s) from the point of view
> of what I am interested in: video2text. :)

> 2. Having the text-renderer output the pre-rendered images for each
> char. and video-mixer actualy blitting them, would'nt we have no
> choice but to do a malloc/free for each char? If that is true, then
> kindly forget it as I was doing such a thing (mistakenly) and it
> turned out to be a performance hell.

If you plan to reuse the chars, then no free is involved. My idea was
a text-cacher-bin, that takes a text stream, renders the text
char-by-char (if a char was previously rendered, reuses the same
buffer - no copying involved), then passes all that to a mixer, with
appropriately set up params so you'll get the chars merged into
rendered text. The only thing that is mallo/freed in each iteration is
the final output buffer. However, with some clever optimisation, even
that can be optimised away (have the cacher bin provide a buffer,
which it clears at the start of each iteration, then passes that to
the mixer to merge the chars onto. Clearing memory is probably faster
than newly allocating and then clearing it).

>    I suppose you people are not proposing this but what makes me
> doubtfull is the assertion of Gergely that blitting should be done
> inside the mixer and not the renderer.

That might depend on the use-case.. At the moment, I can't see any
real disadvantage of having no blitting in the renderer.

> 4. As I suppose we agree on using cairo for all these stuff, so is
> there way you can scale/select a font size in terms of pixels?

I'm not 100% convinced a generic cairo renderer is the best solution
here, but using cairo to do the rendering, that I can certainly agree
with.

> I am possitive there must be. I failed to understand the concerns of
> Gergely on the font sizes, so I'll request him to explain it a bit in
> his next email.

Umm. Did I have concerns about font sizes?




More information about the gstreamer-devel mailing list