Commit graph

46 commits

Author SHA1 Message Date
Víctor Manuel Jáquez Leal
c9bd45f05d plugins: handle GL params through context query
If the element instantiated the GL display and context, they should
handle them too through the context query.

https://bugzilla.gnome.org/show_bug.cgi?id=777409
2017-01-27 13:35:40 +01:00
Víctor Manuel Jáquez Leal
1605a2646a pluginutil: add gst_caps_is_video_raw() 2016-11-03 08:35:29 +01:00
Víctor Manuel Jáquez Leal
0541ef4510 pluginutil: const params to gst_video_info_changed()
Since they are not modified, we should mark them as const.
2016-07-29 15:25:09 +02:00
Víctor Manuel Jáquez Leal
eb621c970e vaapi: register only the available encoders
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-22 17:23:23 +02:00
Víctor Manuel Jáquez Leal
a9e7eac108 plugins: add gst_vaapi_driver_is_whitelisted()
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-07-22 17:23:23 +02:00
Víctor Manuel Jáquez Leal
3d9f8dd41f pluginutil: add gst_video_info_force_nv12_if_encoded()
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-08 10:19:01 +02:00
Víctor Manuel Jáquez Leal
2562cd51be pluginutil: add gst_video_info_changed() helper
This function is shared among different elements, so let factorized it.

https://bugzilla.gnome.org/show_bug.cgi?id=765435
2016-06-08 10:19:01 +02:00
Víctor Manuel Jáquez Leal
8d42c95b0f plugin: use allowed caps filter from element
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-18 18:28:43 +02:00
Víctor Manuel Jáquez Leal
2d7d38cb9c plugin: remove function parameter
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-18 18:28:43 +02:00
Víctor Manuel Jáquez Leal
d4f00383ed unify caps template for VAAPI encoders and decoders
There is no difference in VAAPI surface caps between encoders and decoders.
Thus, the patch makes a simplification by removing encoders specific caps and
shares the same definition of VAAPI surfaces caps for all the elements.
2016-03-30 16:55:26 +02:00
Sreerenj Balachandran
fd04a7c046 gst/vaapi: keep precedence for NV12 over I420
Use NV12 as default "assumption" format all over.
NV12 is the default high priority format used my most of the
vaapi-drivers.
2016-03-29 15:02:46 +03:00
Scott D Phillips
eea3f0cdb2 Add P010 video format support
The P010 video format is the native format used by the vaapi intel driver
for HEVCMain10 decode . Add support for planes and images of this video format.

https://bugzilla.gnome.org/show_bug.cgi?id=759181
2016-03-29 14:34:00 +03:00
Víctor Manuel Jáquez Leal
b2707c8eec plugins: fix context query handling
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-09 16:18:19 +01:00
Víctor Manuel Jáquez Leal
6d9f31e305 vaapidecode: use caps to check the features
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-10-20 12:32:44 +02:00
Víctor Manuel Jáquez Leal
ee5d8ee202 vaapidecodebin: ensure VPP before going to READY
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-13 17:34:42 +02:00
Víctor Manuel Jáquez Leal
66f05af288 refactor vaapi caps strings for pad templates
Refactor the main vaapi caps strings into three macros:
GST_VAAPI_MAKE_SURFACE_CAPS, GST_VAAPI_MAKE_ENC_SURFACE_CAPS and
GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS.

Those are in gstvaapipluginutil.h so all the elements could use them, instead
of re-declaring them every time.

No functional changes.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2015-08-05 14:26:37 +02:00
Víctor Manuel Jáquez Leal
3024640d4f plugins: remove gstreamer-0.10 crumbs
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-05-12 12:19:57 +02:00
Víctor Manuel Jáquez Leal
8b36e25f47 Removal of gstreamer-1.0 support
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-03 17:09:08 +03:00
Víctor Manuel Jáquez Leal
d256f1d283 Removal of gstreamer-0.10 support
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-04-03 16:55:27 +03:00
Víctor Manuel Jáquez Leal
9799875df4 vaapidecode: delayed src caps negotiation
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-26 12:24:55 +02:00
Gwenole Beauchesne
8c93c842ef plugins: add support for BGRA textures.
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-24 15:20:03 +01:00
Gwenole Beauchesne
a4d88db0fd plugins: preserve framerate when updating src caps video format.
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-11-18 18:39:32 +01:00
Gwenole Beauchesne
493337c4b1 vaapipostproc: add support for "download" capability.
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-22 18:20:46 +02:00
Gwenole Beauchesne
95d1826dca plugins: add helper for detecting VA surfaces in caps.
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-08-21 09:36:36 +02:00
Gwenole Beauchesne
6bf3c1863c legal: update copyright notice dates. 2014-01-22 19:02:35 +01:00
Gwenole Beauchesne
ef9819ecf4 plugins: add helpers to create video caps with features.
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
2014-01-14 19:14:41 +01:00
Gwenole Beauchesne
113bd3a5f2 plugins: factor out construction of template caps.
Add new helper functions to build video template caps.
- gst_vaapi_video_format_new_template_caps():
  create GstCaps with size, frame rate and PAR to full range
- gst_vaapi_video_format_new_template_caps_from_list():
  try to create a "simplified" list from the supplied formats
2013-12-21 12:35:24 +01:00
Gwenole Beauchesne
528b5adc5a plugins: factor out construction of GValue from GstVideoFormat.
Add new helper functions to build GValues from GstVideoFormat:
- gst_vaapi_value_set_format():
  build a GValue from the supplied video format
- gst_vaapi_value_set_format_list():
  build a GValue list from the supplied array of video formats
2013-12-21 12:35:24 +01:00
Gwenole Beauchesne
b80257389d plugins: re-indent common and video context creation utils. 2013-12-21 12:35:23 +01:00
Gwenole Beauchesne
6f2dfb71e6 plugins: factor out display creation process.
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-18 16:38:57 +01:00
Gwenole Beauchesne
c516311a1a legal: update copyright notice dates. 2013-11-22 06:39:20 +01:00
Gwenole Beauchesne
15519ebe3d legal: add per-file authorship information.
Credit original authors on a per-file basis as we cannot expect people
to know all country-specific rules, or bother browsing through the git
history.
2013-11-22 06:39:15 +01:00
Gwenole Beauchesne
f0d50cfbc2 vaapipostproc: add support for "mixed" interlace mode.
Add support for "mixed" interlace-mode, whereby the video frame buffer
shall be deinterlaced only if its flags mention that's actually an
interlaced frame buffer.
2013-10-09 18:30:06 +02:00
Gwenole Beauchesne
393e86e3d0 plugins: add helper function to disable deinterlacing in caps.
Add gst_caps_set_interlaced() helper function that would reset the
interlace-mode field to "progressive" for GStreamer >= 1.0, or the
interlaced field to "false" for GStreamer 0.10.
2013-10-04 19:30:36 +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
95b865968c plugins: use common helper function to apply compositions.
Use common gst_vaapi_apply_composition() helper function to apply compositions
attached to a buffer in vaapisink or GstVaapiVideoConverterGLX.
2013-03-21 18:16:14 +01:00
Gwenole Beauchesne
bd397a536b pluginutils: add G_PRIMITIVE_SWAP() helper macro.
This macro helps swapping variables while maintaining the correct underlying
and primitive type.
2012-09-06 13:39:50 +02:00
Gwenole Beauchesne
cff117b54d plugins: fix display type selection and propagation.
If vaapisink is in the GStreamer pipeline, then we shall allocate a
unique GstVaapiDisplay and propagate it upstream. i.e. subsequent
queries from vaapidecode shall get a valid answer from vaapisink.
2012-07-25 14:52:05 +02:00
Gwenole Beauchesne
437bc925f6 display: add display types.
Move display types from gstvaapipluginutil.* to gstvaapidisplay.* so that
we could simplify characterization of a GstVaapiDisplay. Also rename "auto"
type to "any", and add a "display-type" attribute.
2012-07-25 14:37:11 +02:00
Gwenole Beauchesne
6b4ff307b3 plugins: declare helper functions as internal. 2012-07-24 16:14:51 +02:00
Gwenole Beauchesne
753a56e9a1 pluginutils: improve automatic display type selection. 2012-07-24 15:57:57 +02:00
Gwenole Beauchesne
aa64ce0bed pluginutils: cosmetics (indentation fixes). 2012-07-24 15:57:57 +02:00
Gwenole Beauchesne
8f132b7936 configure: drop check for --enable-vaapisink-glx.
vaapisink is now built with support for multiple display types, whenever
they are enabled. The new "display" attribute is used to select a particular
renderer.
2012-07-24 15:57:57 +02:00
Gwenole Beauchesne
92f11799d1 legal: fix year for some copyright notices. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
872694fda5 vaapipluingutils: add helper to append surface caps to YUV caps. 2012-01-05 11:04:29 +01:00
Nicolas Dufresne
99c5d18f41 Port to GstVideoContext interface.
This new interface allows for upstream and downstream display sharing
that works in both static and dynamic pipelines.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2011-12-08 14:58:58 +01:00
Renamed from gst-libs/gst/vaapi/gstvaapiutils_gst.h (Browse further)