Commit graph

1207 commits

Author SHA1 Message Date
Zhao Halley
bbd7a130e2 vaapisink: fix build without VA/GLX support. 2013-06-05 11:09:37 +02:00
Gwenole Beauchesne
e712abba11 plugins: allow buffer mappings to GstVaapiSurfaceProxy.
Allow plain gst_buffer_map() interface to work with gstreamer-vaapi
video buffers, i.e. expose the underlying GstVaapiSurfaceProxy to the
caller. This is the only sensible enough thing to do in this mode as
the underlying surface pixels need to be extracted through an explicit
call to the gst_video_frame_map() function instead.

A possible use-case of this is to implement a "handoff" signal handler
to fakesink or identity element for further processing.
2013-06-05 11:09:37 +02:00
Gwenole Beauchesne
eb9dd361f8 plugins: silence check for direct-rendering mode in video memory.
Fix gst_vaapi_video_allocator_new() to silently check for direct-rendering
mode support, and not trigger fatal-criticals if either test surface or
image could not be created. Typical case: pixel format mismatch, e.g. NV12
supported by most hardware vs. I420 supported by most software decoders.
2013-06-05 11:09:37 +02:00
Gwenole Beauchesne
33f6415696 plugins: improve video memory flags safety checks.
On map, ensure we have GST_MAP_WRITE flags since this is only what we
support for now. Likewise, on unmap, make sure that the VA image is
unmapped for either read or write, while still committing it to the
VA surface if write was requested.
2013-06-05 11:09:37 +02:00
Gwenole Beauchesne
18031dc6ff surface: fix memory leak through unreleased parent context.
Break the circular references between GstVaapiContext and its children
GstVaapiSurfaces. Since the VA surfaces held an extra reference to the
context, which holds a reference to its VA surfaces, then none of those
were released.

How does this impact support for subpictures?

The only situation when the parent context needs to disappear is when
it is replaced with another one because of a resolution change in the
video stream for instance, or a normal destroy. In this case, it does
not really matter to apply subpictures to the peer surfaces since they
are either gone, or those that are left in the pipe can probably bear
a reinstantiation of the subpictures for it.

So, parent_context is set to NULL when the parent context is destroyed,
other VA surfaces can still get subpictures attached to them, individually
not as a whole. i.e. subpictures for surface S1 will be created from
active composition buffers and associated to S1, subpictures for S2 will
be created from the next active composition buffers, etc. We don't try
to cache the subpictures in those cases (pending surfaces until EOS
is reached, or pending surfaces until new surfaces matching new VA context
get to be used instead).
2013-05-30 19:32:58 +02:00
Gwenole Beauchesne
c12dc19b8b vaapisink: fix one-time initialization when display property is set.
Fix gst_vaapisink_ensure_display() to perform one-time initialization
tasks even if the `display' property was explicitly set.
2013-05-27 17:21:11 +02:00
Gwenole Beauchesne
382542c747 window: fix GLX window initialization.
Make sure to create the GLX context once the window object has completed
its creation. Since gl_resize() relies on the newly created window size,
then we cannot simply overload the GstVaapiWindowClass::create() hook.
So, we just call into gst_vaapi_window_glx_ensure_context() once the
window object is created in the gst_vaapi_window_glx_new*() functions.
2013-05-27 17:21:10 +02:00
Gwenole Beauchesne
b1e5dfab96 display: validate display types. 2013-05-27 17:20:35 +02:00
Gwenole Beauchesne
b40cd3b382 display: drop internal NAME_PREFIX, store the real display name.
Always store a valid display name/device path, instead of adding a
particular prefix. i.e. make it simply a strdup(), or "" if it was
initially NULL.
2013-05-27 16:21:08 +02:00
Gwenole Beauchesne
71ab07d9c6 display: make it possible to lookup the display cache by type.
Make it possible to add extra an extra filter to most of display cache
lookup functions so that the GstVaapiDisplay instance can really match
a compatible and existing display by type, instead of relying on extra
string tags (e.g. "X11:" prefix, etc.).
2013-05-27 16:07:15 +02:00
Gwenole Beauchesne
c957823e8a display: cope with new display cache API. 2013-05-27 16:07:15 +02:00
Gwenole Beauchesne
b59445b2ab display: rework display cache API.
Simplify display cache API, while making it more flexible. We can now create
custom lookup functions with gst_vaapi_display_cache_lookup_custom().
2013-05-27 16:07:15 +02:00
Gwenole Beauchesne
811c1abbc6 tests: improve check for display cache.
Improve check for display cache infrastructure. In particular, for X11 and
GLX backends, we need to make sure that we can create a GstVaapiDisplayX11
from another GstVaapiDisplayGLX, i.e. underlying X11 and VA displays can be
shared. Besides, allocating a GstVaapiDisplayGLX while a GstVaapiDisplayX11
already exists will have to generate different VA displays.
2013-05-27 16:07:15 +02:00
Zhao Halley
dadf0ef978 uploader: fix memory leak in GStreamer 0.10 builds.
In GStreamer 0.10 builds, gst_vaapi_uploader_get_buffer() was used
but it exhibited a memory leak because the surface generated for the
GstVaapiVideoMeta totally lost its parent video pool. So, it was not
possible to release that surface back to the parent pool when the meta
gets released, and the memory consumption kept growing.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2013-05-23 19:22:48 +02:00
Gwenole Beauchesne
35eaa9e763 plugins: fix gst_vaapi_video_meta_new_from_pool().
Since GST_VAAPI_IS_xxx_VIDEO_POOL() was only testing for NULL and not
the underlying object type, the gst_vaapi_video_meta_new_from_pool()
was hereby totally broken. Fixed this regression by using the newly
provided gst_vaapi_video_pool_get_object_type() function.
2013-05-23 19:01:34 +02:00
Gwenole Beauchesne
e52ea35b11 plugins: cope with GST_VAAPI_IS_xxx() macros removal. 2013-05-23 19:01:34 +02:00
Gwenole Beauchesne
3c751b2dfd tests: cope with GST_VAAPI_IS_xxx() macros removal. 2013-05-23 19:01:34 +02:00
Gwenole Beauchesne
809c7e097b libs: add query for GstVaapiVideoPool object types.
Add API to identify the underlying GstVaapiVideoPool object type.
2013-05-23 19:01:34 +02:00
Gwenole Beauchesne
67eea92044 libs: drop GST_VAAPI_IS_xxx() helper macros.
Drop obsolete GST_VAAPI_IS_xxx() helper macros since we are no longer
deriving from GObject and so those were only checking for whether the
argument was NULL or not. This is now irrelevant, and even confusing
to some extent, because we no longer have type checking.

Note: this incurs more type checking (review) but the libgstvaapi is
rather small, so this is manageable.
2013-05-23 18:15:48 +02:00
Gwenole Beauchesne
f77e1642dc Bump library major version.
The whole libgstvaapi libraries got a major refresh to get rid of GObject.
This is a fundamental change that requires a new SONAME. More changes are
underway to streamline the core libraries.

So far, the net result is a reduction of .text size (code) by 32KB, i.e. -10%.
On one particular test (sintel HD trailer), the total number of executed
instruction was reduced by 8%.
2013-05-07 18:56:28 +02:00
Gwenole Beauchesne
85d50c1c63 docs: cope with removed APIs.
Some APIs are dead because they are no longer based on GObject.
2013-05-07 18:40:52 +02:00
Gwenole Beauchesne
9535bb9950 plugins: cope with new GstVaapiMiniObject objects. 2013-05-07 18:19:03 +02:00
Gwenole Beauchesne
da403b62d0 tests: cope with new GstVaapiMiniObject objects. 2013-05-07 18:19:03 +02:00
Gwenole Beauchesne
98bee4240f display: fix set_synchronous() to lock display. 2013-05-07 18:19:03 +02:00
Gwenole Beauchesne
4cf1213b04 videopool: simplify creation of video objects pool. 2013-05-07 18:19:03 +02:00
Gwenole Beauchesne
c2abeb1290 libs: simplify GstVaapiID definitions.
Make GstVaapiID a gsize instead of guessing an underlying integer large
enough to hold all bits of a pointer. Also drop GST_VAAPI_ID_NONE since
this is plain zero and that it is no longer passed as varargs.
2013-05-07 18:19:03 +02:00
Gwenole Beauchesne
4ffdc98ab4 libs: drop obsolete function helpers and objects.
Drop obsolete GstVaapiID related function helpers for passing them as
GValues.
2013-05-07 17:51:27 +02:00
Gwenole Beauchesne
915cef5e01 libs: use GstVaapiMiniObject for display objects. 2013-05-07 17:51:27 +02:00
Gwenole Beauchesne
3cc7b26961 libs: use GstVaapiMiniObject for video decoders.
Port GstVaapiDecoder and GstVaapiDecoder{MPEG2,MPEG4,JPEG,H264,VC1} to
GstVaapiMiniObject. Add gst_vaapi_decoder_set_codec_state_changed_func()
helper function to let the user add a callback to a function triggered
whenever the codec state (e.g. caps) changes.
2013-05-07 17:51:27 +02:00
Gwenole Beauchesne
2e6ff64a34 libs: use GstVaapiMiniObject for video object pools.
Port GstVaapiVideoPool, GstVaapiSurfacePool and GstVaapiImagePool to
GstVaapiMiniObject. Drop gst_vaapi_video_pool_get_caps() since it was
no longer used for a long time. Make object allocators static, i.e.
local to the shared library.
2013-05-07 17:51:27 +02:00
Gwenole Beauchesne
98c7068937 libs: use GstVaapiObject for texture objects. 2013-05-07 17:51:27 +02:00
Gwenole Beauchesne
8402b04ac9 libs: use GstVaapiObject for window objects. 2013-05-07 17:51:27 +02:00
Gwenole Beauchesne
6c46179709 libs: use GstVaapiObject for VA objects. 2013-05-07 17:51:27 +02:00
Gwenole Beauchesne
1f15c28a1b Port GstVaapiObject to GstVaapiMiniObject. 2013-05-07 17:51:27 +02:00
Gwenole Beauchesne
6439169db5 libs: refine GstVaapiMiniObject.
Drop support for user-defined data since this capability was not used
so far and GstVaapiMiniObject represents the smallest reference counted
object type. Add missing GST_VAAPI_MINI_OBJECT_CLASS() helper macro.

Besides, since GstVaapiMiniObject is a libgstvaapi internal object, it
is also possible to further simplify the layout of the object. i.e. merge
GstVaapiMiniObjectBase into GstVaapiMiniObject.
2013-05-07 17:51:27 +02:00
Gwenole Beauchesne
da2493f731 decoder: update picture size from the bitstream.
Propagate the picture size from the bitstream to the GstVaapiDecoder,
and subsequent user who installed a signal on notify::caps. This fixes
decoding of TS streams when the demuxer failed to extract the required
information.
2013-05-07 16:43:51 +02:00
Gwenole Beauchesne
5ea1a675ab decoder: fix raw decoding mode.
Fix gst_vaapi_decoder_get_surface() to actually transfer ownership of the
surface proxy to the caller.
2013-04-25 14:20:55 +02:00
Gwenole Beauchesne
c43a2d497a decoder: add gst_vaapi_decoder_get_frame_with_timeout().
Add gst_vaapi_decoder_get_frame_with_timeout() helper function that will
wait for a frame to be decoded, until the specified timeout in microseconds,
prior to returning to the caller.

This is a fix to performance regression from 851cc0, whereby the vaapidecode
loop executed on the srcpad task was called to often, thus starving all CPU
resources.
2013-04-25 14:18:00 +02:00
Gwenole Beauchesne
4b91e31a76 Bump version for development. 2013-04-19 14:38:59 +02:00
Gwenole Beauchesne
af9202b253 0.5.3. 2013-04-18 19:09:45 +02:00
Gwenole Beauchesne
46b77ea4da NEWS: updates. 2013-04-18 19:08:39 +02:00
Gwenole Beauchesne
d2bf4ffd97 vaapidecode: rework heuristics to detect decode timeout.
Rework heuristics to detect when downstream element ran into errors,
and thus failing to release any VA surface in due time for the current
frame to get decoded. In particular, recalibrate the render time base
when the first frame gets submitted downstream, or when there is no
timestamp that could be inferred.
2013-04-18 18:54:40 +02:00
Gwenole Beauchesne
851cc000c2 vaapidecode: rework GstVideoDecoder::handle_frame() with a task.
Rework GstVideoDecoder::handle_frame() to decode the current frame,
while possibly waiting for a free surface, and separately submit all
decoded frames from a task. This makes it possible to pop and render
decoded frames as soon as possible.
2013-04-18 18:46:01 +02:00
Gwenole Beauchesne
9d8bac313f plugins: use gst_object_unref() wherever applicable.
Use gst_object_unref() wherever applicable, e.g. objects derived from
GstElement, GstVideoPool, etc.
2013-04-18 17:16:43 +02:00
Gwenole Beauchesne
0db4133347 docs: drop obsolete plug-ins.
Drop documentation for obsolete plug-ins, even for GStreamer 0.10.
i.e. vaapiupload and vaapidownload are no longer the recommended
plug-ins to use.
2013-04-17 14:35:39 +02:00
Gwenole Beauchesne
cb076da7e1 debian: fix build of GStreamer 0.10 packages.
Fix build of Debian packages to scan the actual GStreamer API version
from the generated changelog file.
2013-04-17 14:35:39 +02:00
Gwenole Beauchesne
a0e587667a vaapipostproc: minor clean-ups.
Use g_clear_object() wherever appropriate and remove dead-code.
2013-04-17 10:58:04 +02:00
Gwenole Beauchesne
6b259abc02 vaapipostproc: fix reference counting buf for passthrough mode.
Fix reference counting bug for passthrough mode, whereby the input buffer
was propagated as is downstream through gst_pad_push() without increasing
its reference count before. The was a problem when gst_pad_push() returns
an error and we further decrease the reference count of the input buffer.
2013-04-17 10:53:03 +02:00
Gwenole Beauchesne
945516c9c7 vaapipostproc: port to GStreamer 1.0.
Add support for interlaced streams with GStreamer 1.0 too. Basically,
this enables vaapipostproc, though it is not auto-plugged yet. We also
make sure to reply to CAPS queries, and happily handle CAPS events.
2013-04-17 10:18:45 +02:00
Gwenole Beauchesne
2909d0229d decoder: fix GstVideoCodecFrame flags for interlaced contents.
Fix support for interlaced contents with GStreamer 0.10. In particular,
propagate GstVaapiSurfaceProxy frame flags to GstVideoCodecFrame flags
correctly.

This is a regression from commit 87e5717.
2013-04-17 10:14:55 +02:00