[FFmpeg-devel] [PATCH] Try to make new VDPAU usable by adding context to callback.
nfxjfg at googlemail.com
Sat Aug 10 00:58:36 CEST 2013
On Sat, 10 Aug 2013 00:17:05 +0200
Reimar Döffinger <Reimar.Doeffinger at gmx.de> wrote:
> On Fri, Aug 09, 2013 at 10:48:01PM +0200, Reimar Döffinger wrote:
> > Using VDPAU correctly means checking for preemption
> > and possibly regenerating the context all the time.
> > With the current API there is no context or other
> > user-defined pointer and thus this in not possible
> > unless using some hack like global variables.
> > This introduces a new decode function that gets
> > both the AVCodecContext and AVFrame in addition,
> > in both the user can store additional opaque data.
> > Unfortunately the HWAccel API has no way of providing
> > API/ABI compatibility, so a currently disallowed
> > state (render pointer being NULL) is used to extend it.
> > An alloc function is added as well to ease future extensions.
Maybe add that preemption might reload the vdpau driver, making all
vdpau driver entrypoints (like decoder_render) potentially invalid.
Keeping the vdpau API calls completely out of libavcodec simplifies the
user code greatly, because you don't have to worry about coordinating
libavcodec's use of that API.
> This version is now working.
> I'll try to make one with proper minor bump and APIchanges,
> which I'd then consider final.
> So about now would be a good time to complain about it...
I think it looks good, but av_alloc_vdpau_hwaccel() is unnecessary. Or
at least it should be in a separate commit.
More information about the ffmpeg-devel