summaryrefslogtreecommitdiff
path: root/gst/vaapi
AgeCommit message (Collapse)AuthorFilesLines
2013-07-22plugins: handle video cropping in X11 pixmap converter.Gwenole Beauchesne1-2/+16
Use GstVideoCropMeta in GStreamer 1.0 or any other render rectangle we could decode from the stream.
2013-07-22plugins: add support for "x11-pixmap" video converter type.Gwenole Beauchesne5-3/+305
Install a new video converter that supports X11 pixmap targets for X11 backends only, or make the GLX converter creation function chain up to the X11 converter whenever requested.
2013-07-18plugins: fix display type comparison in gst_vaapi_create_display().Emilio López1-1/+1
After the code got moved to create the gst_vaapi_create_display() helper, this comparison was not updated to dereference the newly-created pointer, so the code was comparing the pointer itself to the type, and therefore failing to retrieve the VA display. This fixes the following error (and gets gst-vaapi decoding again): ERROR vaapidecode gstvaapidecode.c:807:gst_vaapidecode_ensure_allowed_caps: failed to retrieve VA display https://bugzilla.gnome.org/show_bug.cgi?id=704410 Signed-off-by: Emilio López <emilio@elopez.com.ar>
2013-07-15Fix new video format API.Gwenole Beauchesne2-3/+3
Fix new internal video format API, based on GstVideoFormat, to not clobber with system symbols. So replace the gst_video_format_* prefix with gst_vaapi_video_format_ prefix, even if the format type remains GstVideoFormat.
2013-07-15plugins: simlpify gst_vaapi_create_display() helper.Gwenole Beauchesne1-7/+2
Simplify gst_vaapi_create_display() helper as gst_vaapi_display_XXX_new() performs the necessary validation checks for the underlying VA display prior to returning to the caller. So, if an error occurred, then NULL is really returned in that case.
2013-07-15plugins: add gst_vaapi_create_display() helper.Víctor Manuel Jáquez Leal1-20/+29
https://bugzilla.gnome.org/show_bug.cgi?id=703235 Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2013-07-12plugins: don't reallocate pool allocator for the same caps.Gwenole Beauchesne1-4/+9
If the video buffer pool config doesn't have new caps, then it's not necessary to reinstantiate the allocator. That could be a costly operation as we could do some extra heavy checking in there.
2013-07-12plugins: fix ref counting of GstVaapiVideoMemory allocator.Gwenole Beauchesne1-1/+2
Fix reference counting issue whereby gst_memory_init() does not hold an extra reference to the GstAllocator. So, there could be situations where the last instance of GstVaapiVideoAllocator gets released before a dangling GstVaapiVideoMemory object, thus possibly leading to a crash.
2013-07-12vaapiupload: use implicit color conversion to NV12.Gwenole Beauchesne1-0/+15
Always perform conversion of sources buffers to NV12 since this is the way we tested for this capability in ensure_allowed_caps(). This also saves memory bandwidth for further rendering. However, this may not preserve quality since the YUV buffers are down-sampled to 4:2:0.
2013-07-11vaapidownload: fix src caps format error.Wind Yuan1-2/+2
This fixes direct linking of vaapidownload element to xvimagesink with VA drivers supporting vaGetImage() from the native VA surface format to a different VA image format. i.e. color conversion during download. http://bugzilla.gnome.org/show_bug.cgi?id=703937 Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2013-07-11vaapidownload: fix debug string for image formats.Gwenole Beauchesne1-5/+5
The image is now expressed as a standard GstVideoFormat, which is not a FOURCC but rather a regular enum value. This is a regression introduced in commit 09397fa.
2013-07-10plugins: clean-up video uploader helper.Gwenole Beauchesne1-17/+6
Fix gst_vaapi_uploader_get_buffer() to not assign caps since they were already negotiated beforehand, and they are not used from the buffer in upstream elements. Clean-up gst_vaapi_uploader_ensure_caps() to use the new image caps represented as a GstVideoInfo.
2013-07-10plugins: use GstVideoInfo in video uploader helper.Gwenole Beauchesne1-29/+50
2013-07-10plugins: allow creation of VA surfaces with explicit pixel format.Gwenole Beauchesne1-2/+17
Adapt GstVaapiVideoMemory allocator to support creation of VA surfaces with an explicit pixel format. This allows for direct rendering to VA surface memory from a software decoder.
2013-07-10Use GstVideoInfo for video pools.Gwenole Beauchesne2-17/+32
Get rid of GstCaps to create surface/image pool, and use GstVideoInfo structures instead. Those are smaller, and allows for streamlining libgstvaapi more.
2013-07-09plugins: port to new video format API.Gwenole Beauchesne3-24/+16
2013-07-08vaapisink: fix creation of GLX texture.Gwenole Beauchesne1-11/+38
Fix creation of GLX texture, to not depend on the GstCaps video size that could be wrong, especially in presence of frame cropping. So, use the size from the source VA surfaces. An optimization could be to reduce the texture size to the actual visible size on screen. i.e. scale down the texture size to match the screen dimensions, while preserving the VA surface aspect ratio. However, some VA drivers don't honour that.
2013-07-08plugins: add support for video cropping.Gwenole Beauchesne3-17/+82
Add support for GstVideoCropMeta in GStreamer >= 1.0.x builds and gst-vaapi specific meta information to hold video cropping details. Make the sink support video cropping in X11 and GLX modes.
2013-07-08plugins: add helper functions to set the render rectangle.Sreerenj Balachandran2-0/+52
Some video clips may have a clipping region that needs to propogate to the renderer. These helper functions make it possible to attach that clipping region, as a GstVaapiRectangle, the the video meta associated with the buffer. Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com> signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2013-06-27vaapisink: expose the raw video formats in static caps template.Sreerenj Balachandran1-1/+3
Expose all raw video formats in the static caps template since the vaapisink is supporting raw data. We will get the exact set of formats supported by the driver dynamically through the _get_caps() routine. This also fixes an inconsistency wrt. GStreamer 0.10 builds. https://bugzilla.gnome.org/show_bug.cgi?id=702178 Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2013-06-27vaapisink: add "use-glx" property for OpenGL rendering.Gwenole Beauchesne2-5/+25
Now that VA/GLX capable buffers are generated by default on X11, thus depending on a VA/GLX display, we stil want to use vaPutSurface() for rendering since it is faster. Anyway, OpenGL rendering in vaapisink was only meant for testing and enabling "fancy" effects to play with. This has no real value. So, disable OpenGL rendering by default.
2013-06-27plugins: try to allocate a GLX display first over an X11 one.Víctor Manuel Jáquez Leal1-5/+5
If the gstreamer-vaapi plug-in elements are built with GLX support, then try to allocate a GstVaapiDisplayGLX first before resorting to a VA/X11 display next. https://bugzilla.gnome.org/show_bug.cgi?id=701742
2013-06-05vaapisink: fix build without VA/GLX support.Zhao Halley1-0/+2
2013-06-05plugins: allow buffer mappings to GstVaapiSurfaceProxy.Gwenole Beauchesne2-3/+80
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-05plugins: silence check for direct-rendering mode in video memory.Gwenole Beauchesne1-2/+4
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-05plugins: improve video memory flags safety checks.Gwenole Beauchesne1-2/+5
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-05-27vaapisink: fix one-time initialization when display property is set.Gwenole Beauchesne1-1/+2
Fix gst_vaapisink_ensure_display() to perform one-time initialization tasks even if the `display' property was explicitly set.
2013-05-23uploader: fix memory leak in GStreamer 0.10 builds.Zhao Halley1-6/+1
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-23plugins: fix gst_vaapi_video_meta_new_from_pool().Gwenole Beauchesne1-29/+45
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-23plugins: cope with GST_VAAPI_IS_xxx() macros removal.Gwenole Beauchesne3-7/+7
2013-05-07plugins: cope with new GstVaapiMiniObject objects.Gwenole Beauchesne11-93/+77
2013-04-25decoder: add gst_vaapi_decoder_get_frame_with_timeout().Gwenole Beauchesne1-1/+2
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-18vaapidecode: rework heuristics to detect decode timeout.Gwenole Beauchesne1-5/+21
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-18vaapidecode: rework GstVideoDecoder::handle_frame() with a task.Gwenole Beauchesne1-56/+73
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-18plugins: use gst_object_unref() wherever applicable.Gwenole Beauchesne4-8/+8
Use gst_object_unref() wherever applicable, e.g. objects derived from GstElement, GstVideoPool, etc.
2013-04-17vaapipostproc: minor clean-ups.Gwenole Beauchesne1-9/+5
Use g_clear_object() wherever appropriate and remove dead-code.
2013-04-17vaapipostproc: fix reference counting buf for passthrough mode.Gwenole Beauchesne1-2/+5
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-17vaapipostproc: port to GStreamer 1.0.Gwenole Beauchesne5-38/+114
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-16surfaceproxy: drop user-data support from GstVaapiSurfaceProxy.Gwenole Beauchesne1-2/+2
Drop user-data support from GstVaapiSurfaceProxy. Rather make it explicit to call some user-provided function when the surface proxy is released.
2013-04-15decoder: make gst_vaapi_decoder_get_codec_state() return the original state.Gwenole Beauchesne1-4/+2
Make gst_vaapi_decoder_get_codec_state() return the original codec state, i.e. make the GstVaapiDecoder object own the return state so that callers that want an extra reference to it would just gst_video_codec_state_ref() it before usage. This aligns the behaviour with what we had before with gst_vaapi_decoder_get_caps(). This is an ABI incompatible change, library major version was bumped from previous release (0.5.2).
2013-04-15plugins: mark a few more functions as internal.Gwenole Beauchesne2-0/+3
Mark the following functions are internal, i.e. private to the vaapi plug-in: - gst_vaapi_video_buffer_pool_get_type() - gst_vaapi_video_converter_glx_get_type() - gst_vaapi_video_converter_glx_new()
2013-04-15plugins: implement GstSurfaceMeta API.Gwenole Beauchesne1-2/+108
Implement GstSurfaceMeta API for GStreamer 1.0.x. Even though this is an unstable/deprecated API, this makes it possible to support Clutter sink with minimal changes. Tested against clutter-gst 1.9.92.
2013-04-12vaapisink: optimize GstVideoOverlayInterface::expose().Gwenole Beauchesne1-6/+11
When render-mode is "overlay", then it is not really useful to peek into the GstBaseSink::last_buffer, since we have our own video_buffer already recorded and maintained into GstVaapiSink.
2013-04-12vaapisink: fix memory leak of GstSample objects.Gwenole Beauchesne1-1/+2
Fix memory leak of GstSample objects in GstVideoOverlayInterface::expose(). This also fixes extra unreferencing of the underlying GstBuffer in the common path afterwards (for both 0.10 or 1.0).
2013-04-12plugins: fix description for gst-inspect.Gwenole Beauchesne1-9/+15
Fix the name of the plug-in element reported to gst-inspect-1.0. i.e. we need an explicit definition for GStreamer >= 1.0 because the GST_PLUGIN_DEFINE incorrectly uses #name for creating the plug-in name, instead of using macro expansion (and let further expansion of macros) through e.g. G_STRINGIFY().
2013-04-10Fix make dist to include all source files, in any case.Gwenole Beauchesne1-7/+27
Fix make dist to allow build for either GStreamer 0.10 or 1.0. i.e. make sure to include all source files in either case while generating source tarballs.
2013-04-10plugins: implement direct-rendering mode for raw YUV buffer uploads.Gwenole Beauchesne2-2/+38
Allow direct-rendering (writes) into target VA surfaces.
2013-04-10plugins: implement uploads from raw YUV buffers for GStreamer 1.0.Gwenole Beauchesne3-5/+242
Implement GstVideoMeta::{,un}map() to support raw YUV buffer upload when the last component is unmapped. Downloads are not supported yet. The aim was to first support SW decoding + HW accelerated rendering (vaapisink). e.g. for Wayland.
2013-04-10vaapidecode: submit all decoded frames before decoding a new one.Gwenole Beauchesne1-0/+8
Make sure to purge all pending frames that were already decoded prior to decoding a new one. This helps release VA surfaces as early as possible.
2013-04-10vaapidecode: reply to CAPS queries.Gwenole Beauchesne1-3/+17
Handle GST_QUERY_CAPS, which is the GStreamer 1.0 mechanism to retrieve the set of allowed caps, i.e. it works similar to GstPad::get_caps(). This fixes fallback to SW decoding if no HW decoder is available.