Accelerated subtitle rendering in 1.0

Arnaud Vrac rawoul at gmail.com
Tue Aug 7 06:19:20 PDT 2012


On Mon, Aug 6, 2012 at 11:01 PM, Tim-Philipp Müller <t.i.m at zen.co.uk> wrote:
> On Mon, 2012-08-06 at 22:41 +0200, Arnaud Vrac wrote:
>
>> I did do that, as I said I removed the queues from the pipeline for
>> simplicity. However it still stalls. I guess this won't happen if I
>> have a single element for rendering.
>
> Ah, sorry, missed that bit.
>
> Your overlay element would probably need to generate a GAP event if an
> input buffer does not have an overlay composition attached. This should
> then also preroll the overlay sink. Alternatively, you can set the
> overlay sink to async=false.
>

Generating a gap event does not trigger preroll, instead I send an
empty buffer with the GAP flag set and it now works.

>
>> ARGB is fine, however I still need to blend all the rectangles in a
>> single transparent framebuffer, meaning that I have to use a library
>> like pixman. It's ok, but it wouldn't add much code to get a
>> gst_video_overlay_composition_render function that does not blend with
>> the destination surface pixels. I think it would be a good addition to
>> the public API.
>
> Ah, right that would be
>
> http://cgit.freedesktop.org/gstreamer/gst-plugins-base/tree/docs/design/draft-subtitle-overlays.txt#n423
>
> then I guess ?
>
> Feel free to provide a patch for that :)

Actually the gst_video_blend function is buggy, blending the overlay
on top of a transparent frame should be the same as doing a copy of
the overlay on top of the frame. The destination alpha is not modified
in the current implementation. I have attached a patch that properly
implements the 'over' operator for blending.

With this patch I can render the overlay directly using the
gst_video_overlay_composition_blend function and cache the result
until the overlay seqnum changes.

-- 
Arnaud Vrac
-------------- next part --------------
A non-text attachment was scrubbed...
Name: video_blend_over.patch
Type: application/octet-stream
Size: 5254 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20120807/184dd8cc/attachment.obj>


More information about the gstreamer-devel mailing list