[Libva] Concurrent decoding/rendering in the same va context?

Gwenole Beauchesne gb.devel at gmail.com
Wed Oct 3 07:12:02 PDT 2012


Hi,

2012/10/2 Pawel Osciak <posciak at google.com>:

> The overlap happens in a way that it is possible for Decode() for frame n on
> thread 1 to begin while Render() is still running for frame n-1. Thus, it's
> possible for a surface that is being vaPutSurface() from to be used as
> reference in Decode() on the other thread, but it's not possible for two
> Decode() calls or two Render() calls to run concurrently.
>
> Should this work? Has anyone got a similar setup to run successfully?

Yes, this should work. AFAIK, I had implemented something along those
lines in a proprietary media player. On the Open Source side, I think
that was also the implied process for Lightspark. Though, the patches
I wrote are mostly obsolete nowadays.

This all depends on your codec layer. If you are using
FFmpeg/hwaccel/vaapi, just make sure to use a recursive lock instead
of a normal one. I know you are not using FFmpeg, it was just an
example. :)

Regards,
Gwenole.


More information about the Libva mailing list