Commit graph

8 commits

Author SHA1 Message Date
Gwenole Beauchesne
ab94048ea0 decoder: fix double buffer free with some VA drivers.
vaRenderPicture() implicitly disposes VA buffers. Some VA drivers would
push the VA buffer object into a list of free buffers to be re-used. However,
reference pictures (and data) that was kept would explicitly release the VA
buffer object later on, thus possibly destroying a valid (re-used) object.

Besides, some other VA drivers don't support correctly the vaRenderPicture()
semantics for VA buffers disposal and would leak memory if there is no explicit
vaDestroyBuffer(). The temporary workaround is to explcitily destroy VA buffers
right after vaRenderPicture(). All VA drivers need to be aligned.
2012-02-13 10:10:35 +01:00
Gwenole Beauchesne
fe791efc28 decoder: allocate proxy surface earlier.
This simplifies gst_vaapi_picture_output() to only update the presentation
timestamp and submit the proxy to the decoder for output.
2012-01-31 11:34:17 +01:00
Gwenole Beauchesne
399875ee86 decoder: fix memory leak of VA objects on exit.
On sequence end, if the last decoded picture is not output for rendering,
then the proxy surface is not created. In this case, the original surface
must be released explicitly to the context.
2012-01-31 11:29:06 +01:00
Gwenole Beauchesne
0fb1147d9c Add header for system-dependent definitions. 2012-01-30 19:52:10 +01:00
Gwenole Beauchesne
a79c7f9fa6 decoder: optimize slice data buffers initialization.
VA drivers may have a faster means to transfer user buffers to GPU
buffers than using memcpy(). In particular, on Intel Gen graphics, we
can use pwrite(). This provides for faster upload of bitstream and can
help higher bitrates.

vaapi_create_buffer() helper function was also updated to allow for
un-mapped buffers and pre-initialized data for buffers.
2012-01-30 10:32:14 +01:00
Gwenole Beauchesne
4a46b5d6c4 decoder: retain proxy surface until the GstVaapiPicture is destroyed.
Keep a valid reference to the proxy in GstVaapiPicture so that frames
marked as "used for reference" could be kept during the lifetime of the
picture. i.e. don't release them too soon as they could be re-used right
away.
2012-01-27 15:56:32 +01:00
Gwenole Beauchesne
7b19745141 decoder: simplify output of decoded frames.
Drop obsolete gst_vaapi_decoder_push_surface() that was no longer used.
Change gst_vaapi_decoder_push_surface_proxy() semantics to assume PTS
is already set correctly and reference count increased, if necessary.
2012-01-27 13:28:12 +01:00
Gwenole Beauchesne
e5d12e8853 decoder: rework the internal VA objects API.
The new API simplifies a lot reference counting and makes it more
flexible for future additions/changes. The GstVaapiCodecInfo is
also gone. Rather, new helper macros are provided to allocate
picture, slice and quantization matrix parameter buffers.
2012-01-27 13:28:11 +01:00