summaryrefslogtreecommitdiff
path: root/gst/vaapi/gstvaapipluginutil.c
AgeCommit message (Collapse)AuthorFilesLines
2016-11-03pluginutil: add gst_caps_is_video_raw()Víctor Manuel Jáquez Leal1-0/+15
2016-10-27docs: add missing long descriptionsVíctor Manuel Jáquez Leal1-0/+2
2016-07-29pluginutil: const params to gst_video_info_changed()Víctor Manuel Jáquez Leal1-1/+1
Since they are not modified, we should mark them as const.
2016-07-22vaapi: register only the available encodersVíctor Manuel Jáquez Leal1-0/+23
In order to register only the available encoders, this patch queries the created test VA display, which uses the currently used back-end (X11, Wayland, DRM, …) on the used display device. https://bugzilla.gnome.org/show_bug.cgi?id=724352
2016-07-22pluginutil: set GLX display typeVíctor Manuel Jáquez Leal1-1/+8
The function gst_vaapi_create_display_from_gl_context() cretes a GstVaapiDisplay given a GstGLContext. But it didn't created a GLX VA display when the GL platform was GLX, but a plain X11 VA display. This patch fixes that, by querying the GL platform earlier. https://bugzilla.gnome.org/show_bug.cgi?id=766206
2016-07-22plugins: add gst_vaapi_driver_is_whitelisted()Víctor Manuel Jáquez Leal1-0/+48
Move some of the logic in gst_vaapi_plugin_base_driver_is_whitelisted() to a new function gst_vaapi_driver_is_whitelisted(), in this way, it can be used when registering the plugin's feature set with the test VA display. https://bugzilla.gnome.org/show_bug.cgi?id=724352
2016-06-08pluginutil: add gst_video_info_force_nv12_if_encoded()Víctor Manuel Jáquez Leal1-0/+16
This lines repeat a couple times in the code, so it would be better to put it a helper function. https://bugzilla.gnome.org/show_bug.cgi?id=765435
2016-06-08pluginutil: add gst_video_info_changed() helperVíctor Manuel Jáquez Leal1-0/+22
This function is shared among different elements, so let factorized it. https://bugzilla.gnome.org/show_bug.cgi?id=765435
2016-05-20plugins: use GstVideoInfo accessorsVíctor Manuel Jáquez Leal1-8/+7
Instead of access to GstVideInfo members directly, use their accessors macros. This patch makes more resistance to future changes in GStreamer core.
2016-04-18plugin: use allowed caps filter from elementVíctor Manuel Jáquez Leal1-6/+6
Instead of using the srcpad template caps for filtering the peer caps, the function gst_vaapi_find_preferred_caps_feature(), now receives a new parameter for the element's allowed caps. With this modification, the vaapipostproc element simplifies a bit its code. https://bugzilla.gnome.org/show_bug.cgi?id=765223
2016-04-18plugin: remove function parameterVíctor Manuel Jáquez Leal1-2/+2
The native format parameter in gst_vaapi_find_preferred_caps_feature() can be saved if the out format is used for both: in and out. Thus the code is more readable. https://bugzilla.gnome.org/show_bug.cgi?id=765223
2016-04-18plugin: honour negotiated formatVíctor Manuel Jáquez Leal1-14/+66
Instead of setting the requested format by the caller, the function gst_vaapi_find_preferred_caps_feature() now returns, in the output parameter, the negotiated format. A new helper function was added: gst_vaapi_find_preferred_format(), which, given the format list from the negotiated caps, will choose the best one, if possible, given the native format. https://bugzilla.gnome.org/show_bug.cgi?id=765223
2016-04-18plugin: simplify caps feature selectionVíctor Manuel Jáquez Leal1-64/+27
This patch simplifies the function gst_vaapi_find_preferred_caps_feature(). Instead of intersecting custom caps to find the preferred feature, the peer caps are traversed in order to find the preferred feature, according to an ordered feature priority list. In the case of GLTextureUploadMeta, the colour format is computed using GstVideoInfo of the selected fixed caps. https://bugzilla.gnome.org/show_bug.cgi?id=765223
2016-04-13plugins: fix compilation when EGL/GLX is disabledVíctor Manuel Jáquez Leal1-0/+2
The compiler might complain of gst_vaapi_create_display_from_handle() being unused if both EGL and GLX are disabled. This patch avoid that compilation error.
2016-03-29gst/vaapi: keep precedence for NV12 over I420Sreerenj Balachandran1-1/+1
Use NV12 as default "assumption" format all over. NV12 is the default high priority format used my most of the vaapi-drivers.
2016-03-09plugins: fix gstgl and vaapi memory leaksVineeth TM1-3/+5
1\ Unref gl_display and gl_window as soon they are not needed. 2\ Remove an unneeded display type check, since is handled by gst_vaapi_created_display_from_handle() 3\ Unref vaapi's display if the display cannot be bind to a GL API. Modified-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> https://bugzilla.gnome.org/show_bug.cgi?id=763354
2016-02-16vaapi: Fix various compiler warnings and disable -Wredundant-decls for nowSebastian Dröge1-2/+2
2016-02-03plugins: fix code styleVíctor Manuel Jáquez Leal1-5/+4
Minor code style changes by executing gst-indent in gst/vaapi directory. Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-02-02vaapi: fix 'ISO C90 forbids mixed declarations and code' compiler warningsTim-Philipp Müller1-2/+2
Declare variables at the beginning of a code block, which is how it's done in GStreamer. https://bugzilla.gnome.org/show_bug.cgi?id=759192
2016-01-25Remove old gst version guardsVíctor Manuel Jáquez Leal1-6/+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-09plugins: fix context query handlingVíctor Manuel Jáquez Leal1-3/+2
The current context query handling design is flawed: the function gst_vaapi_reply_to_query() returns FALSE either if the query is not a GST_CONTEXT_QUERY of if the query could not be handled correctly. But the pad query function should handle differently each case. This patch changes the gst_vaapi_reply_to_query() for gst_vaapi_handle_context_query() and changes it usage in all the vaapi plugins to match the correct context query handling. Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> https://bugzilla.gnome.org/show_bug.cgi?id=757598
2015-11-09plugin: don't lose previous context at queryVíctor Manuel Jáquez Leal1-2/+9
When processing the GST_CONTEXT_QUERY we should not lose the previous context in the query, we should only add our display structure. This patch copies the old context, if it is there, and stamp our display on it. Otherwise, a new context is created. Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> https://bugzilla.gnome.org/show_bug.cgi?id=757598
2015-11-09plugins: check if display is set in syncVíctor Manuel Jáquez Leal1-5/+5
Since the context messages are sync'ed, the display assignation happens in the same thread, hence we can know if the display was found or not as soon we call for it. In order to take advantage of it, gst_vaapi_video_context_prepare() receives, as a new parameter, the address of the plugin's display, and reports back if the display was found and set. Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> https://bugzilla.gnome.org/show_bug.cgi?id=757598
2015-11-09plugins: set display through contextVíctor Manuel Jáquez Leal1-1/+0
Instead of setting the display to the plugin directly after its creation, do it through the gstreamer's context mechanism, avoiding double assignations. Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> https://bugzilla.gnome.org/show_bug.cgi?id=757598
2015-10-20vaapidecode: use caps to check the featuresVíctor Manuel Jáquez Leal1-17/+29
Instead of calling gst_vaapi_find_preferred_caps_feature(), which is expensive, we check the caps from the allocation query, to check the negotiated feature. In order to do this verification a new utility function has been implemented: gst_vaapi_caps_feature_contains(). As this new function shared its logic with gst_caps_has_vaapi_surface(), both have been refactorized. Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> https://bugzilla.gnome.org/show_bug.cgi?id=756686
2015-08-31multiview: initial attempt at stereo/multiview supportJan Schmidt1-0/+7
Add support for marking caps and buffers for multiview or stereoscopic output. https://bugzilla.gnome.org/show_bug.cgi?id=750835
2015-08-13vaapidecodebin: ensure VPP before going to READYVíctor Manuel Jáquez Leal1-0/+15
There are sometimes that the VA-API display context is not shared among the pipeline, but it is important to know it before going to READY state (when the pipeline is already linked). One instance of this case is this: gst-launch-1.0 filesrc location=media ! decodebin ! vaapipostproc ! vaapisink This patch adds a new function in gstvaapipluginutil called gst_vaapi_create_test_display(). Its purpose is to create a disposable VA-API display, which only will be used for verify if the VAEntrypointVideoProc is available by the hardware. Afterwards, it should be unrefed. If the vaapidecodebin is going to READY state, and the element still doesn't know if VPP is available, the last resort is to create a new instance of the VA-API display and test for it. https://bugzilla.gnome.org/show_bug.cgi?id=749554
2015-08-06gstvaapivideocontext: remove unused parameterVíctor Manuel Jáquez Leal1-20/+1
gst_vaapi_video_context_prepare() received an unused parameter. This patch removes it and the structure passed by the caller. This a left over of "Removal of gstreamer-1.0 support" (commit 8b36e25f). Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2015-08-04plugins: don't use gst_pad_get_allowed_caps()Víctor Manuel Jáquez Leal1-2/+4
gst_pad_get_allowed_caps() query the pad and the peer pad. In the case decoders, that is OK, but in the case of the postproc might lead loops, since the gst_base_transform_query_caps() forwards the query upstream and forth. Instead of gst_pad_get_allowed_caps() we only query the peer with gst_pad_peer_query_caps() using the pad's template as filter. Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> https://bugzilla.gnome.org/show_bug.cgi?id=752558
2015-06-30gst/vaapi: Switch to upstreram like indentation.Sreerenj Balachandran1-4/+6
gst-indent for all gst/vaapi/*.c source files
2015-05-12plugins: remove gstreamer-0.10 crumbsVíctor Manuel Jáquez Leal1-8/+4
GstVideoContext was used in gstreamer-0.10, which is not supported anymore. Still, its definition was still in the code. This patch removes it. https://bugzilla.gnome.org/show_bug.cgi?id=749113
2015-04-03Removal of gstreamer-1.0 supportVíctor Manuel Jáquez Leal1-176/+0
The support for GStreamer 1.0 has been obsoleted in 0.5.10 release. GStreamer 1.2 is the a minimal requirement for building the gstreamer-vaapi. This patch removes all the pre-processor conditional code compilation guarded for gstreamer-1.0. Thus, all the video converters were removed too. https://bugzilla.gnome.org/show_bug.cgi?id=745728 Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com> Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2015-04-03update and move gstcompat.hVíctor Manuel Jáquez Leal1-1/+1
The purpose of gstcompat.h is to couple the API differences among gstreamer-1.0 and gstreamer-0.10. Since gstreamer-0.10 is obsolete, the code in this compatibility layer shall be removed. Nevertheless, the gstcompat.h header should be kept, if new incompatibilites appear in the future, but it shall live in gst/vaapi, not in gst-libs. This patch removes the crumbs defined gstcompat.h and moves it to gst/vaapi. In order to avoid layer violations, gstcompat.h includes sysdeps.h and all the includes in gst/vaapi of sysdeps.h are replaced with gstcompat.h https://bugzilla.gnome.org/show_bug.cgi?id=745728 Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com> Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2015-04-03Removal of gstreamer-0.10 supportVíctor Manuel Jáquez Leal1-43/+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-26vaapidecode: delayed src caps negotiationVíctor Manuel Jáquez Leal1-2/+4
Currently the src caps are set immediately after the sink caps are set, but in that moment the pipeline might not fully constructed and the video sink has not negotiated its supported caps and features. As a consequence, in many cases of playback, the least optimized caps feature is forced. This is partially the responsible of bug #744039. Also, vaapidecode doesn't attend the reconfigure events from downstream, which is a problem too, since the video sink can be changed with different caps features. This patch delays the src caps, setting them until the first frame arrives to the decoder, assuming until that very moment the whole pipeline is already negotiated. Particularly, it checks if the src pad needs to be reconfigured, as a consequence of a reconfiguration event from downstream. A key part of this patch is the new GstVaapiCapsFeature GST_VAAPI_CAPS_FEATURE_NOT_NEGOTIATED, which is returned when the src pad doesn't have a peer yet. Also, for a better report of the caps allowed through the src pad and its peer, this patch uses gst_pad_get_allowed_caps() instead of gst_pad_peer_query_caps() when looking for the preferred feature. v3: move the input_state unref to close(), since videodecoder resets at some events such as navigation. v4: a) the state_changed() callback replaces the input_state if the media changed, so this case is also handled. b) since the parameter ref_state in gst_vaapidecode_update_src_caps() is always the input_state, the parameter were removed. c) there were a lot of repeated code handling the input_state, so I refactored it with the function gst_vaapi_decode_input_state_replace(). https://bugzilla.gnome.org/show_bug.cgi?id=744618 Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2015-02-24plugins: add support for BGRA textures.Gwenole Beauchesne1-10/+47
Some frameworks (EFL) expect BGRA textures for storage. However, adding support for that broadly into GStreamer framework implies two kinds of hacks: (i) libgstgl helpers currently do not support BGRA textures correctly, (ii) we need to better parse downstream suggested caps and intersect them with what the VA plugin elements can offer to them for GL texturing.
2015-02-24plugins: fix support for Wayland/EGL running alongside X11.Gwenole Beauchesne1-2/+34
When multiple display servers are available, the glimagesink element (from GStreamer 1.4) may not be able to derive a global display in Wayland. Rather, a "window"-specific display is created. In this case, the GstGLDisplay handle available through GstGLContext is invalid. So, try to improve heuristics for display server characterisation in those particular situations.
2015-02-24plugins: add initial support for EGL.Gwenole Beauchesne1-10/+120
Add initial support for EGL through GstVideoGLTextureUploadMeta. Fix gst_vaapi_ensure_display() to allocate a GstVaapiDisplay off the downstream supplied GstGLContext configuration, i.e. use its native display handle to create a GstVaapiDisplay of type X11 or Wayland ; and use the desired OpenGL API to allocate the GstVaapiDisplayEGL wrapper. https://bugzilla.gnome.org/show_bug.cgi?id=741079
2015-02-24plugins: ensure VA display matches GL context expectations.Gwenole Beauchesne1-2/+1
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-01-27display: refine the meaning of display type.Gwenole Beauchesne1-3/+0
Make gst_vaapi_display_get_display_type() return the actual VA display type. Conversely, add a gst_vaapi_display_get_class_type() function to return the type of the GstVaapiDisplay instance. The former is used to identify the display server onto which the application is running, and the latter to identify the original object class.
2015-01-27pluginutil: Fix clearing of subtitle overlaySimon Farnsworth1-6/+3
dvbsuboverlay signals no subtitles present by not setting GstVideoOverlayCompositionMeta on a buffer. Detect this, and remove subtitles whenever we have no overlay composition to hand. Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
2014-11-18plugins: preserve framerate when updating src caps video format.Gwenole Beauchesne1-0/+17
In the current implementation, gst_video_info_set_format() would reset the whole GstVideoInfo structure first, prior to setting video format and size. So, coleteral information like framerate or pixel-aspect- ratio are lost. Provide and use a unique gst_video_info_change_format() for overcome this issue, i.e. only have it change the format and video size, and copy over the rest of the fields. https://bugzilla.gnome.org/show_bug.cgi?id=734665
2014-08-22vaapipostproc: add support for "download" capability.Gwenole Beauchesne1-0/+24
Allow implicit conversions to raw video formats, while still keeping VA surfaces underneath. This allows for chaining the vaapipostproc element to a software-only element that takes care of maps/unmaps. e.g. xvimagesink. https://bugzilla.gnome.org/show_bug.cgi?id=720174
2014-08-22plugins: fix memory leaks.Gwenole Beauchesne1-0/+1
2014-08-21plugins: add helper for detecting VA surfaces in caps.Gwenole Beauchesne1-0/+44
Introduce new gst_caps_has_vaapi_surface() helper function to detect whether the supplied caps has VA surfaces. With GStreamer >= 1.2, this implies a check for memory:VASurface caps features, and format=ENCODED for earlier versions of GStreamer.
2014-07-28vaapidecode: simplify bufferpool configuration.Gwenole Beauchesne1-0/+13
Rework the logics behind the configuration of an adequate bufferpool, especially when OpenGL meta or additional capsfeatures are needed. Besides, for GStreamer >= 1.4, the first capsfeatures that gets matched, and that is not system memory, is now selected by default.
2014-07-25vaapisink: add support for "display-name" property.Gwenole Beauchesne1-3/+4
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
2014-07-23plugins: expose I420 format for interop with SW elements.Gwenole Beauchesne1-1/+1
Always expose I420 format by default when the VA surface could be mapped for interoperability with non harware accelerated elements. However, the default behaviour remains the auto-plugging of vaapi elements, down to the sink. Side effect: "direct-rendering" mode is also disabled most of the times as plain memcpy() from uncached speculative write combining memory is not going to be efficient enough.
2014-01-22legal: update copyright notice dates.Gwenole Beauchesne1-1/+1
2014-01-14plugins: add helpers to create video caps with features.Gwenole Beauchesne1-0/+92
Add gst_vaapi_video_format_new_template_caps_with_features() helper function to add the supplied caps feature string on GStreamer >= 1.2. Add gst_vaapi_find_preferred_caps_feature() helper function to discover the "best" caps feature to use for the supplied pad. In practice, we will always favor memory:VASurface first, then meta:GLTextureUploadMeta, and finally the system memory caps. https://bugzilla.gnome.org/show_bug.cgi?id=719372