Commit graph

2485 commits

Author SHA1 Message Date
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
e070d3ebed vaapi: instantiate a VA display when registering
This patch tries to instantiate a GstVaapiDisplay when registering the plugin
features, if it fails, no gstreamer-vaapi element is registering.

The purpose of this patch is to avoid a situation where the user has
gstreamer-vaapi installed but their VA-API setup is not functional, which may
lead to unexpected behavior.

https://bugzilla.gnome.org/show_bug.cgi?id=724352
2016-07-22 17:23:23 +02:00
Víctor Manuel Jáquez Leal
1cba2f3633 vaapi: declare external dependencies
There are two main external dependencies that define the feature set of this
plugin: a) the kernel and b) the VA driver

This patch tracks both dependencies, if any of them change, GStreamer will
re-inspect the plugin.

The kernel is tracked through the device files /dev/dri/card*

The VA driver is tracked through the files VA_DRIVERS_PATH/*_drv_video.so,
where VA_DRIVERS_PATH is the one defined in libva package configuration. Also,
the environment variables LIBVA_DRIVERS_PATH and LIBVA_DRIVER_NAME are tracked
since they modify the driver lookup.

Additionally, the environment variable GST_VAAPI_ALL_DRIVERS is tracked too.

https://bugzilla.gnome.org/show_bug.cgi?id=724352
2016-07-22 17:23:23 +02:00
Víctor Manuel Jáquez Leal
024d540195 vaapidecode: remove unneeded initializations
GObject's memory is set to zero, so there is no need to initialize to zero or
NULL it's class variables.
2016-07-22 17:18:16 +02:00
Víctor Manuel Jáquez Leal
955cdb84e6 plugins: remove undefined macros 2016-07-22 17:18:09 +02:00
Víctor Manuel Jáquez Leal
7472826a36 Revert "gstvaapisurface_drm: release image when done"
This reverts commit 1dbcc8a0e1  and commit
372a03a9e3.

While the dmabuf handle is exported, the derive image must exist, otherwise
the image's VA buffer is invalid, thus the dmabuf handle is never released,
leading into a file descriptors leak.
2016-07-22 17:15:58 +02:00
Víctor Manuel Jáquez Leal
3efc2f70b7 encoder: h265: fix code-style 2016-07-22 17:15:38 +02:00
Víctor Manuel Jáquez Leal
6cbb607ec9 vaapipostproc: update filters at color balance
This is a fix for a regression of previous commit, which updates the filters
only when the property is set, because it is also required to update the
filter when the color balance interface change its values.
2016-07-22 16:55:59 +02:00
Hyunjun Ko
73d4da2e79 vaapipostproc: make it enable/disable pass-through mode
In case that sink caps and src caps are same, and no filtering parameter set,
pass-through mode is enabled.
If new filtering parameter is set during playback, it makes it reconfiguring,
so that pass-through mode is changed

In addition, updating filter is performed during reconfiguration, if needed.

https://bugzilla.gnome.org/show_bug.cgi?id=751876
2016-07-22 12:08:20 +02:00
Hyunjun Ko
cc6df605a1 vaapipostproc: checking and updating filter parameter only when it's set
This patch is to avoid checking filter value at every frame.

https://bugzilla.gnome.org/show_bug.cgi?id=751876
2016-07-22 12:08:20 +02:00
Allen Zhang
d9ef88230f decoder: h265: handle the SEI NAL units included in codec_data
The prefix/suffix SEI nal units can appear in codec_data too
which weren't handled before. Parse these SEI headers to
fix the segfault.

https://bugzilla.gnome.org/show_bug.cgi?id=768544
2016-07-21 11:24:31 +03:00
Víctor Manuel Jáquez Leal
b138e5e042 build: doc: do not redefine MAINTAINERCLEANFILES
MAINTAINERCLEANFILES is defined in gtk-doc-plugins.mak, thus instead of
overload it, the files should be added.
2016-07-15 17:35:41 +02:00
Sreerenj Balachandran
6c6007ad94 encoder: h264: Fix MVC encode while enabling dct8x8
Pack the transform_8x8_mode_flag and other necessary rbsp data
in packed_pps header for MVC encode.

https://bugzilla.gnome.org/show_bug.cgi?id=768647
2016-07-15 14:41:27 +03:00
Víctor Manuel Jáquez Leal
9f4796756d vaapisink: demote a debug message to trace
Reduces noise when debugging.
2016-07-14 12:31:02 +02:00
Jagyum Koo
0d1d097273 wayland: Error check before using cached wl_display
A planar(or some other) buffer allocation may fail on the driver, then
the wayland connection becomes invalid, not able to send request or
receive any event. So we need to set up a new wayland connection if
there's an error detected on the cached wl_display.

https://bugzilla.gnome.org/show_bug.cgi?id=768761

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-07-14 12:18:10 +02:00
Stefan Sauer
f8eb0c84d9 Automatic update of common submodule
From ac2f647 to f49c55e
2016-07-11 21:15:57 +02:00
Víctor Manuel Jáquez Leal
cf1dd3790f vaapiencode: demote a log to trace level
Removes noise when debugging.
2016-07-11 19:07:30 +02:00
Hyunjun Ko
d94001b820 vaapiencode: implement flush() vmethod
In order to handle correctly seek and other operations, vaapiencode should
flush all the remaining data from the encoder without pushing it downstream.

This patch implements the flush() vmethod, only after of pausing the
source pad task, and restarting it again after the flush stop.

https://bugzilla.gnome.org/show_bug.cgi?id=767176

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-07-11 19:03:52 +02:00
Víctor Manuel Jáquez Leal
fcc08627e5 decoder: vc1: flush dpb only if opened
Flush the decode picture buffer, if and only if, the decoder is
started. Otherwise the dpb structure might be NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=742922
2016-07-11 10:44:06 +02:00
Hyunjun Ko
19c0c8a973 vaapidecode: drop non-keyframe in reverse playback
To avoid surface-exhausted situation during reverse playback,
drop frames except for key frame.

Also, to avoid the corruption of the parser state, flush() vmethod
doesn't destroy the VA decoder when playing in reverse.

https://bugzilla.gnome.org/show_bug.cgi?id=742922

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-07-11 10:42:46 +02:00
Víctor Manuel Jáquez Leal
c9a5801c35 vaapidecode: unref output frame earlier
The queue in GstVaapiDecode adds an extra reference to the frames. This patch
unref that extra reference earlier making the code simpler to follow.

https://bugzilla.gnome.org/show_bug.cgi?id=768652
2016-07-11 10:40:15 +02:00
Víctor Manuel Jáquez Leal
cb0ec6b60c vaapidecode: remove gst_vaapidecode_internal_flush()
As gst_vaapidecode_finish() is the only callee of
gst_vaapidecode_internal_flush(), it is better to inline it.

https://bugzilla.gnome.org/show_bug.cgi?id=768652
2016-07-11 10:40:14 +02:00
Víctor Manuel Jáquez Leal
b392b4f064 vaapidecode: flush output adapter at drain()
Calling drain() vmethod means "decode any data it can at this point, but that
more data may arrive after". Hence, vaapidecode should check if there is data
in the output adapter and process them, without destroying the decoded picture
buffer (dpb).

Since this operation is done by gst_vaapidecode_internal_flush(), the operation
was refactored into a new function gst_vaapidecode_flush_output_adapter().

https://bugzilla.gnome.org/show_bug.cgi?id=768652
2016-07-11 10:40:14 +02:00
Víctor Manuel Jáquez Leal
03e85bbc0f vaapidecode: call purge at flush()
Calling flush() vmethod means "to flush all remaining data from the decoder
without pushing it downstream".

Nonetheless flush() is calling gst_vaapidecode_internal_flush(), which calls
gst_video_decoder_have_frame() if there is still something in the input
adapter, which may push buffers to downstream by calling handle_frame().

This patch changes this behavior by calling gst_vaapidecode_purge() rather
than gst_vaapidecode_internal_flush(), which does what we want: flushes the VA
decoder and releases all the rest of decoded frames.

https://bugzilla.gnome.org/show_bug.cgi?id=768652
2016-07-11 10:40:14 +02:00
Víctor Manuel Jáquez Leal
6970dc1277 test: elements: remove spurious linkage
Element tests only need to link against gstreamer libraries.
2016-07-06 18:38:37 +02:00
Sebastian Dröge
f7ea48597e configure: Require GLib >= 2.40 like everywhere else 2016-07-06 14:41:21 +03:00
Sebastian Dröge
9bc53dd3ca Back to development 2016-07-06 13:51:21 +03:00
Sebastian Dröge
27c55d34ed Release 1.9.1 2016-07-06 13:48:07 +03:00
Víctor Manuel Jáquez Leal
2310273a69 tests: elements: rotate orientation event 2016-07-05 21:01:52 +02:00
Hyunjun Ko
da4d916a8c tests: elements: Add testsuite for vaapisink
https://bugzilla.gnome.org/show_bug.cgi?id=765798
2016-07-05 21:01:38 +02:00
Hyunjun Ko
e8fabf6a99 vaapisink: add support for GST_TAG_IMAGE_ORIENTATION
https://bugzilla.gnome.org/show_bug.cgi?id=765798
2016-07-05 20:17:12 +02:00
Víctor Manuel Jáquez Leal
649c00d3c7 vaapipostproc: return caps template if no display
This patch is a fix for my bad review of commit 6d73ca8d. The element should
be able to return the available raw caps handled by the VA display, but that
only should happen when there a VA display. If there's none, the element
should use the caps template.

https://bugzilla.gnome.org/show_bug.cgi?id=768161
2016-06-29 14:05:18 +02:00
Matthew Waters
6d73ca8da2 vaapipostproc: don't require a vaapi display for all caps queries
This delays the requirement of having a GstVaapiDisplay until later

https://bugzilla.gnome.org/show_bug.cgi?id=768161
2016-06-29 21:35:06 +10:00
Víctor Manuel Jáquez Leal
22647090be utils: report VP9 profiles
Add VP9Profile0-3 name mapping.
2016-06-28 16:34:30 +02:00
Víctor Manuel Jáquez Leal
326011af58 vaapi: nest includes under USE_ENCODER macro
This is a missed changeset from commit 1c05c53, since also header includes
should be nested.
2016-06-28 16:33:55 +02:00
Víctor Manuel Jáquez Leal
1c05c53b02 vaapi: nest encoders under USE_ENCODER macro
Though USE_{JPEG,VP8,VP9,H265}_ENCODER macros definition depend on USE_ENCODER
macro, it is clearer to nest them, showing explicitly the dependency relation.
2016-06-28 11:54:33 +02:00
Víctor Manuel Jáquez Leal
80c4396830 vaapivideocontext: check if query context is NULL
Under certain conditions the element might receive a positive context query
but without a context instance. This situation will lead to a segmentation
fault when traversing the context list in the pipeline.

https://bugzilla.gnome.org/show_bug.cgi?id=767946
2016-06-24 12:24:55 +02:00
Scott D Phillips
60cd511fad remove unused glibcompat.h
glibcompat.h is no longer doing anything. Remove it.

Signed-off-by: Scott D Phillips <scott.d.phillips@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=767886
2016-06-23 12:47:52 +02:00
Scott D Phillips
4aec5bdd72 encoder: h264: Use high profile by default
Change defaults for max-bframes, cabac, and dct8x8 to be enabled
by default. This will cause the default profile to be high instead
of baseline. In most situations this is the right decision, and
the profile can still be lowered in the case of caps restrictions.

Signed-off-by: Scott D Phillips <scott.d.phillips@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=757941
2016-06-23 12:28:50 +02:00
Víctor Manuel Jáquez Leal
55e244817d vaapidecodebin: element warning if missing element
Raise an element warning if a required element is not available, thus the
pipeline will post a warning message and the application will be informed.
2016-06-23 12:25:39 +02:00
Hyunjun Ko
05cf583c97 decoder: h265: fix to release all dpb pictures
Without this, all dpb pictures are not released during flush,
because we used the global dpb_count variable for checking the
dpb fullness which get decremented in dpb_remove_index()
routine during each loop iteration.

https://bugzilla.gnome.org/show_bug.cgi?id=767934
2016-06-22 15:11:56 +03:00
Nicolas Dufresne
c5681cff6a Automatic update of common submodule
From ac2f647 to f363b32
2016-06-21 11:48:54 -04:00
Hyunjun Ko
2fb05613a0 vaapi: fix minor leaks
https://bugzilla.gnome.org/show_bug.cgi?id=767868
2016-06-21 11:08:48 +03:00
Víctor Manuel Jáquez Leal
fc8fbddc5c vaapi: remove an already included header
gst/gst.h is already included in gstcompat.h
2016-06-17 18:16:09 +02:00
Víctor Manuel Jáquez Leal
c3c7f08e5d vaapidecodebin: add vp9 in sink pad template 2016-06-17 18:16:09 +02:00
Víctor Manuel Jáquez Leal
aee9166c7f vaapisink: return caps template if no display
If vaapisink received a caps query before getting a VA display, it returned
only the surfaces related caps. This behavior broke the autovideosink
negotiation.

This patch returns the pad's template caps if no VA display, otherwise the
caps are crafted as before.

https://bugzilla.gnome.org/show_bug.cgi?id=767699
2016-06-16 13:18:15 +02:00
Scott D Phillips
57ee937b8c decoder: vp9: Update comment about context resets
Clarify that vaapi context resets are never needed for vp9, but
that ensure_context() needs called when the size increases so that
new surfaces can be allocated.

Signed-off-by: Scott D Phillips <scott.d.phillips@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=767474
2016-06-15 20:50:20 +02:00
Scott D Phillips
ad9fcb9386 gstvaapicontext: control reset_on_resize with option
Signed-off-by: Scott D Phillips <scott.d.phillips@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=767474
2016-06-15 20:50:20 +02:00
Scott D Phillips
b5bf2e83f7 vaapivideobufferpool: add video meta to config when needed
In cases where we know the video meta must be present, add it to
the pool configuration.

Signed-off-by: Scott D Phillips <scott.d.phillips@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=766184
2016-06-15 15:44:00 +02:00
Scott D Phillips
2e5367a23c plugins: retry pool config
if gst_buffer_pool_set_config returns FALSE, check the modified
config and retry set_config if the config is still acceptable.

Signed-off-by: Scott D Phillips <scott.d.phillips@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=766184
2016-06-14 17:25:58 +02:00