summaryrefslogtreecommitdiff
path: root/gst/vaapi/gstvaapipluginbase.h
AgeCommit message (Collapse)AuthorFilesLines
2020-08-12plugins: remove gst_vaapi_plugin_base_get_allowed_srcpad_raw_caps()Víctor Manuel Jáquez Leal1-5/+0
Since nobody uses it, just remove it. Thus extract_allowed_surface_formats() is refactored to attend only gst_vaapi_plugin_base_get_allowed_sinkpad_raw_caps(). Now a surface is created when the image chorma is different from the previous one. And if the driver has the quirk, it outputs all the supported image formats without trying them. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/381>
2020-01-06plugins: base: add GstVideoAggregator subclass supportU. Artie Eoff1-0/+29
2019-12-11plugins: base: manage pad-specific data in a single structU. Artie Eoff1-24/+35
Define a struct (GstVaapiPadPrivate) to encapsulate the pad-specific data (i.e. buffer pool, allocator, info, caps, etc.). Add an interface to retrieve the data struct for a given pad. Finally, update the base plugin to use the data struct throughout the implementation. This will enable us to easily extend the base plugin in the future to allow for N-to-1 pad subclasses (e.g. overlay/ composite).
2019-12-11plugins: use plugin base macros to access pad specific dataU. Artie Eoff1-0/+8
Don't access base struct fields directly since the underlying definition can change. Instead, use the accessor macros.
2018-12-24plugins: Add more check for allowed raw caps.He Junyan1-1/+6
The gst_vaapi_plugin_base_get_allowed_raw_caps is used for both sink pad and src pad, which cause some bugs. For sink pad, we need to verify vaPutImage() while for the src pad we need to verify vaGetImage(). For vaapidecoderXXX kind of plugins, the case is more complex. We need to verify whether the decoded result(in some surface, NV12 format most of the time) can be vaGetImage to some raw image format. Add more check to fix all these problems. https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/issues/123 Signed-off-by: He Junyan <junyan.he@hotmail.com>
2018-02-20plugins: add gst_vaapi_copy_va_buffer()Víctor Manuel Jáquez Leal1-0/+6
This helper function aims to copy buffers with VA memory to dumb buffers, when GstVideoMeta is not available dowstream. https://bugzilla.gnome.org/show_bug.cgi?id=785054
2018-02-20plugins: add COPY_OUTPUT_FRAME flagVíctor Manuel Jáquez Leal1-0/+4
This patch add the member copy_output_frame and set it TRUE when when downstream didn't request GstVideoMeta API, the caps are raw and the internal allocator is the VA-API one. https://bugzilla.gnome.org/show_bug.cgi?id=785054
2018-02-20plugins: store the first downstream allocator if availableVíctor Manuel Jáquez Leal1-0/+2
The allocator will be required if we need to allocate a buffer to store the frame with the expected strides. https://bugzilla.gnome.org/show_bug.cgi?id=785054
2017-10-20plugins: add gst_vaapi_plugin_base_set_srcpad_can_dmabuf()Víctor Manuel Jáquez Leal1-0/+5
This patch refactors the code by adding the function vaapi_plugin_base_set_srcpad_can_dmabuf(), it determines if the passed GstGLContext can handle dmabuf-based buffers. The function is exposed publicly since it is intended to be used later at GstVaapiDisplay instantiation. https://bugzilla.gnome.org/show_bug.cgi?id=788503
2017-08-22plugins: include main gstgl headerVíctor Manuel Jáquez Leal1-4/+0
Instead including particular gstgl header files in a header file that doesn't export a gstgl symbol, the main gstgl header file is included in gstvaapipluginutil.c where the symbols are used. https://bugzilla.gnome.org/show_bug.cgi?id=786597
2017-04-12plugins: enable direct rendering with envvarVíctor Manuel Jáquez Leal1-0/+2
Direct rendering (use vaDeriveImage rather than vaPutImage) has better performance in some Intel platforms (Haswell, for example) but in others (Skylake) is the opposite. In order to have some control, the patch enables the direct rendering through the environment variable GST_VAAPI_ENABLE_DIRECT_RENDERING. Also it seems to generating some problems with gallium/radeon backend. See bug #779642. https://bugzilla.gnome.org/show_bug.cgi?id=775848
2017-02-02plugins: check if negotiate dmabuf with downstreamVíctor Manuel Jáquez Leal1-0/+3
In order to enable, in the future, dmabuf-based buffers, the vaapi base plugin needs to check if downstream can import dmabuf buffers. This patch checks if downstream can handle dmabuf, by introspecting the shared GL context. If the GL context is EGL/GLES2 and have the extension EGL_EXT_image_dma_buf_import, then dmabuf can be negotiated. Original-patch-by: Julien Isorce <j.isorce@samsung.com>
2017-01-27plugins: create a GL context on certain conditionsVíctor Manuel Jáquez Leal1-0/+6
If a GstVaapiDisplay is not found in the GStreamer context sharing, then VAAPI elements look for a local GstGLContext in gst context sharing mechanism ('gst.gl.local.context'). If this GstGLContext not found either then, only the VAAPI decoders and the VAAPI post-processor, will try to instantiate a new GstGLContext. If a valid GstGLContext is received, then a new GstVaapiDisplay will be instantiated with the platform, API and windowing specified by the instantiated GstGLContext. Original-Patch-By: Matt Fischer <matt.fischer@garmin.com> https://bugzilla.gnome.org/show_bug.cgi?id=777409
2016-07-22plugins: remove gst_vaapi_plugin_base_driver_is_whitelisted()Víctor Manuel Jáquez Leal1-4/+0
Since nobody is calling gst_vaapi_plugin_base_driver_is_whitelisted(), it is deleted.
2016-07-22plugins: remove common change_state() vmethodVíctor Manuel Jáquez Leal1-29/+0
Remove the common change_state() vmethod for all the plugins, since no one is using it.
2016-07-22plugins: remove undefined macrosVíctor Manuel Jáquez Leal1-4/+0
2016-06-08plugins: use an unique allocator per padVíctor Manuel Jáquez Leal1-0/+2
Instead of instantiating an allocator per vaapivideobufferpool, only one allocator is instantiated per element's pad and shared among future pools. If the pad's caps changes, the allocator is reset. https://bugzilla.gnome.org/show_bug.cgi?id=765435
2016-05-24plugins: remove unused variablesVíctor Manuel Jáquez Leal1-2/+0
This variables stopped to be used since commit 001a5c63, which removed the gstvaapiuploader.
2016-04-29plugin: fix macro processor checkVíctor Manuel Jáquez Leal1-1/+1
Instead of #ifdef it should be used #if becasuse USE_GST_GL_HELPERS is always defined in config.h, but it would be 0 or 1 depending on the configure output. https://bugzilla.gnome.org/show_bug.cgi?id=765702
2016-04-22vaapidecode: search driver in whitelistVíctor Manuel Jáquez Leal1-0/+33
If the backend driver vendor string is not in a white-list, and the environment variable GST_VAAPI_ALL_DRIVERS is not set either, the decoder will change it state from NULL to READY, hence the auto-plug mechanism will look for another decoder. This patch assumes the GstContext has already being shared along the pipeline and the element has a valid GstVaapiDisplay instance. https://bugzilla.gnome.org/show_bug.cgi?id=764673
2016-04-22plugins: rework set_context() vmethod definitionVíctor Manuel Jáquez Leal1-0/+15
In bug 757598 was added the set_context() vmethod chain up in GstVaapiPluginBase. But it is buggy, since the parent_class address is assigned to the last element which called gst_vaapi_plugin_base_class_init(). No error has shown up since none of the element's base classes redefined set_context() vmethod from GstElement, so always the correct function was called. Still this code is wrong and this patch make it right. Since set_context() is the same code, a macro is used to implement that code in all the gst-vaapi elements. https://bugzilla.gnome.org/show_bug.cgi?id=765368
2016-04-18plugins: remove param in gst_vaapi_plugin_base_decide_allocation()Víctor Manuel Jáquez Leal1-1/+1
2016-04-18remove custom allocation queryVíctor Manuel Jáquez Leal1-1/+1
When resolving bug 753914, a custom allocation query was added, overlapping the responsibilities of GstVideoDecoder. But with the merge of the patches from bug 764421 this overlapping was not required anymore. This patch restores this situation setting the allocation_caps in the GstVideoCodecState when needed. https://bugzilla.gnome.org/show_bug.cgi?id=764316
2016-03-24Make vaapidecode to advertise the cropped values in srcpad, but negotiate ↵Sreerenj Balachandran1-1/+1
pool only if needed -- Maintaing decoded surface resoluton and actual display resoultion separately -- Before pushing every frames downstream, check for the requirement of pool negoation and output_state negotiation: This is needed to avoid multiple issuses with cropping, multi-resoluton video handling, more complex multi resolution decode scenarios for vp9decode, possible wrong behaviour from upstream element to report uncropped values etc. Due to these reasons, We can't just reliably use the resolution change notification from libgstvaapi for pool renegotiation too. This is slight overhead, but safe enough. Optimization could be possible though. https://bugzilla.gnome.org/show_bug.cgi?id=753914
2016-02-02plugins: use the same pre-processor macroVíctor Manuel Jáquez Leal1-1/+1
In gstvaapipluginbase.c we are using the macro USE_GST_GL_HELPERS to guard the code related with GstGL. Nonetheless, in gstvaapipluginbase.h we are using HAVE_GST_GL_GL_H macro in order to include the GstGLContext's header. We should use only one to be homogeneous. This patch sets USE_GST_GL_HELPERS in the header file. Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-01-25Remove old gst version guardsVíctor Manuel Jáquez Leal1-5/+0
As gstreamer-vaapi now only supports from GStreamer 1.6, this patch removes all the old GStreamer version guards. Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2015-11-09plugin: guard pointers to pad query functionsVíctor Manuel Jáquez Leal1-2/+5
Since gstreamer 1.4 is not required to have pad query functions if the query vmethods are used. This patch guards out the pad query functions for gstreamer < 1.4 Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> https://bugzilla.gnome.org/show_bug.cgi?id=757629
2015-08-04remove gstvaapiuploaderVíctor Manuel Jáquez Leal1-19/+5
Working on bug #744042 I realized that the gstvaapiuploader is practically not used. This patch removes the gstvaapiuploader and add the method gst_vaapi_plugin_base_get_allowed_raw_caps () that returns the raw caps that the system can handle, which is used by vaapisink and vaapipostproc. Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> https://bugzilla.gnome.org/show_bug.cgi?id=752777
2015-04-03Removal of gstreamer-0.10 supportVíctor Manuel Jáquez Leal1-4/+0
This patch removes all the pre-processor conditional code compilation guarded for gstreamer-0.10. https://bugzilla.gnome.org/show_bug.cgi?id=745728 https://bugzilla.gnome.org/show_bug.cgi?id=732666 Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2015-02-24plugins: ensure VA display matches GL context expectations.Gwenole Beauchesne1-0/+5
If a GstGLContext is supplied by the downstream element, then make sure that the VA plugin element gets a compatible display to what is requested by the GL context. e.g. re-allocate a VA/GLX display when a GLX context is provided by the downstream element.
2015-02-24plugins: record downstream GstGLContext.Gwenole Beauchesne1-0/+11
Record GL context supplied by downstream elements. This can be useful, and further needed, to enforce run-time check that the GL context is compatible for use by libgstvaapi. e.g. check that we don't create a VA/GLX display for EGL/X11 contexts. https://bugzilla.gnome.org/show_bug.cgi?id=725643 Original-path-by: Matthew Waters <ystreet00@gmail.com>
2014-08-22plugins: factor out decide_allocation() hook.Gwenole Beauchesne1-0/+8
Add a default decide_allocation() hook to GstVaapiPluginBase. The caps feature argument can be used to force a bufferpool with a specific kind of memory.
2014-08-21plugins: fix detection of raw video caps.Gwenole Beauchesne1-0/+1
Use the new gst_caps_has_vaapi_surface() helper function to better detect raw video caps, and in particular those from RGB colorspace. https://bugzilla.gnome.org/show_bug.cgi?id=734665
2014-07-25vaapisink: add support for "display-name" property.Gwenole Beauchesne1-0/+8
Add a "display-name" property to vaapisink so that the end user could select the desired output. Keep "display-name" in-line with the existing "display" (GstVaapiDisplayXXX type). So, for X11 or GLX, the "display-name" is the usual display name as we know for XOpenDisplay(); for Wayland, the "display-name" is the name used for wl_display_connect(); and for DRM, the "display-name" is actually the DRI device name. https://bugzilla.gnome.org/show_bug.cgi?id=722247
2013-12-18plugins: factor out support for raw YUV buffers on sink pads.Gwenole Beauchesne1-0/+34
Factor out propose_allocation() hooks, creation of video buffer pool for the sink pad, conversion from raw YUV buffers to VA surface backed buffers. Update vaapidecode, vaapiencode and vaapipostproc to cope with the new GstVaapiPluginBase abilities.
2013-12-18plugins: factor out pad caps.Gwenole Beauchesne1-0/+34
2013-12-18plugins: factor out GstImplementsInterface.Gwenole Beauchesne1-0/+8
2013-12-18plugins: factor out display creation process.Gwenole Beauchesne1-0/+15
Move common VA display creation code to GstVaapiPluginBase, with the default display type remaining "any". Also add a "display-changed" hook so that subclasses could perform additional tasks when/if the VA display changed, due to a new display type request for instance. All plug-ins are updated to cope with the new internal APIs.
2013-12-18plugins: add new base object, store display in there.Gwenole Beauchesne1-0/+130
Introduce a new GstVaapiPluginBase object that will contain all common data structures and perform all common tasks. First step is to have a single place to hold VA displays. While we are at it, also make sure to store and subsequently release the appropriate debug category for the subclasses.