Commit graph

4328 commits

Author SHA1 Message Date
Seungha Yang
8794f4b713 d3d11: Documentation update
* Update class metadata
  * for wrapper bin elements to be distinguishable from internal element.
  * D3D11 -> Direct3D11 for consistency
* Add missing Since mark everywhere
* Update plugin cache

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2029>
2021-02-23 03:34:11 +09:00
Seungha Yang
6c6237fe50 d3d11: Reorganize class hierarchy of convert elements
AS-IS:
D3D11Convert class is baseclass of D3D11ColorConvert and D3D11Scale
* GstD3D11Convert
  |_ GstD3D11ColorConvert
  |_ GstD3D11Scale

TO-BE:
Introducing a new base class for color conversion and/or rescale elements
* GstD3D11BaseConvert
  |_ GstD3D11Convert
  |_ GstD3D11ColorConvert
  |_ GstD3D11Scale

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2029>
2021-02-23 01:49:54 +09:00
Seungha Yang
7330ea8dbf d3d11deinterlace: Add missing system memory caps features on templates
This element can support system memory

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2029>
2021-02-21 17:35:40 +09:00
Víctor Manuel Jáquez Leal
2696a2795d va: filter, vpp: process colorimetry
A new filter method were added: gst_va_filter_set_formats(). In this
way the input & output GstVideoInfo are processed only once per stream
negotiation, and not per frame.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2023>
2021-02-20 17:03:43 +00:00
Víctor Manuel Jáquez Leal
d4682fa136 va: filter: check if filter is open on set_orientation()
Because the method requires pipeline_caps is filled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2023>
2021-02-20 17:03:43 +00:00
Víctor Manuel Jáquez Leal
812973fb6b va: filter: human readable background color
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2023>
2021-02-20 17:03:43 +00:00
Víctor Manuel Jáquez Leal
c6c71c0c0c va: filter: fail immediately if vaBeginPicture() fails
There's no need to try vaRenderPicture() if vaBeginPicture() failed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2023>
2021-02-20 17:03:43 +00:00
Víctor Manuel Jáquez Leal
b7988b4de8 va: filter: destroy pipeline buffer after destroying filters
In 6ae24948 the pipeline buffer destroy were removing assuming it
wasn't required. Nonetheless, debugging the code it looks like a
buffer leak in iHD driver since the ID of the buffer kept increasing.

The difference now is that first the filter buffers are destroy first
and later the pipeline buffer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2023>
2021-02-20 17:03:43 +00:00
He Junyan
2e9a096282 va: vpp: Add raw buffer copy when needed.
Just like the decoder, the vapostproc also needs to copy the output
buffer to raw buffer if downstream elements only supports raw caps
and does not support the video meta.

The pipeline like:
  gst-launch-1.0 filesrc location=xxxx ! h264parse ! vah264dec ! \
  vapostproc ! capsfilter caps=video/x-raw,width=55,height=128 ! \
  filesink location=xxx
needs this logic to dump the data correctly.

fixes: #1523

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2026>
2021-02-19 23:12:29 +08:00
Seungha Yang
8d1a79e520 wasapi2device: Make wasapi2 device distinguishable from wasapi device
Both wasapi2 and wasapi plugins use WASAPI API. So "device.api=wasapi"
would make sense for the wasapi2 plugin as well. But people would be
confused by the identical "device.api=wasapi" property if intended
plugin is wasapi, not wasapi2. This change will make them distinguishable
by using "device.api" device property.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2024>
2021-02-18 21:46:08 +09:00
Seungha Yang
6da109cdb0 wasapi2: Always build if Windows 10 SDK is available
Add support for building wasapi2 plugin if Windows 10 SDK is
available on system

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1951>
2021-02-18 19:46:17 +09:00
Víctor Manuel Jáquez Leal
7a47a7b4c4 va: allocator: set workaround only for i965 driver
In commit 117453b9 a i965 driver workaround was added for all drivers, because
at that time we didn't have a driver implementation API.

Now there's one. This patch set the workaround only for the i965 driver.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2021>
2021-02-17 12:51:05 +00:00
Víctor Manuel Jáquez Leal
3be9a1baa0 va: allocator: MT-safe queue & dequeue dmabuf-based memories
One problem that va dmabuf allocator had is when preparing a buffer from
dmabuf memories in the allocator pool, specially when a buffer is composed by
several memories. This memories have to be by certain number and in certain
order.

This patch stores the number of memories and their address in order when a
dmabuf-based buffer is created and when preparing a buffer, it is reconstructed
with this info.

Finally, instead of pushing the memories as soon as they are unrefed, they are
hold until GstVaBufferSurface's ref_mems_count reaches zero (all the memories
related with that buffer/surface are unrefed). Until that happen, all the
memories are pushed back into the queue, locked, assuring that all the memories
related with a single buffer (with the same surface) remain contiguous, so the
buffer reconstruction is assured.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2013>
2021-02-17 09:10:37 +01:00
Víctor Manuel Jáquez Leal
21ce99b209 va: pool, allocator: free memories at bufferpool's stop()
This patch frees the memories in the allocator's pool after the bufferpool frees
all its buffers, sync'ing them at stop() vmethod.

By doing it, the current logic in flush_start() is not valid, so the vmethod is removed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2013>
2021-02-17 09:10:37 +01:00
Víctor Manuel Jáquez Leal
0ec17904e1 va: allocator: remove unused public functions
Deleted the public functions:

gst_va_dmabuf_allocator_wait_for_memory()
gst_va_allocator_wait_for_memory()

And all the support for wait, cond in allocator's pool.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2013>
2021-02-17 09:10:37 +01:00
Víctor Manuel Jáquez Leal
1ee9b202a6 va: pool: simplify the logic
Instead of removing memories from buffers at reset_buffer()/release_buffer() the
bufferpool operation is kept as originally designed, still the allocator pool is
used too. Thus, this patch restores the buffer size configuration while removing
release_buffer(), reset_buffer() and acquire_buffer() vmethods overloads.

Then, when the bufferpool base class decides to discard a buffer, the VA
surface-based memory is returned to the allocator pool when its last reference
is freed, and later reused if a new buffer is allocated again.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2013>
2021-02-17 09:10:37 +01:00
Víctor Manuel Jáquez Leal
8deec238cb va: pool: use allocator pool at alloc()
Check if the allocator pool has memories available before creating a
new one, but only iif pool is not starting.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2013>
2021-02-17 09:10:37 +01:00
Víctor Manuel Jáquez Leal
800a49e8de va: allocator: log buffer at dmabuf setup and prepare
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2013>
2021-02-17 09:10:37 +01:00
Seungha Yang
cfbc580575 d3d11: Add support for deinterlacing by using ID3D11VideoProcessor interface
Add a new element d3d11deinterlace to support deinterlacing.
Similar to d3d11videosink and d3d11compositor, this element is
a wrapper bin of set of child elements including helpful
conversion elements (upload/download and color convert)
to make this element configurable between non-d3d11 elements.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2016>
2021-02-17 03:52:19 +09:00
Seungha Yang
5006d91208 d3d11decoder: Take account of min buffers of downstream buffer pool
Since our decoder DPB texture pool cannot be grown once it's
configured, we should pre-allocate sufficient number of textures
for zero-copy playback (but not too many).
The "min buffers" allocation query parameter can be a hint for
the number of required textures in addition to DPB size.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2017>
2021-02-15 17:24:06 +09:00
Seungha Yang
e8df47b022 d3d11h265dec: Add support for interlaced stream
Note that we have no D3D11 deinterlace element yet.

If downstream is not support format:Interlaced caps feature including all
D3D11 the other elements, aspect-ratio will be adjusted as an
alternative approach.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2008>
2021-02-09 16:19:41 +00:00
Seungha Yang
b00b1654f3 vah265dec: Don't need to pass picture structure to VA
This code came from gstvaapidecoder_h265 implementation
but picture structure is always GST_VAAPI_PICTURE_STRUCTURE_FRAME.
Moreover, in theory, VA doesn't need to know picture structure for
decoding HEVC stream.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2008>
2021-02-09 16:19:41 +00:00
Seungha Yang
ce8d7b83d5 nvh265sldec: Remove pointless field picture parameter setup
HEVC has no decoding flow for interlaced, field picture referencing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2008>
2021-02-09 16:19:41 +00:00
He Junyan
188e01ca44 va: vpp: Make the global lock only to DMA buffer's import.
The normal gst_va_buffer_get_surface does not need a global lock.
Too big lock may make the performance lower.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2009>
2021-02-09 15:07:19 +08:00
Víctor Manuel Jáquez Leal
03847b65ca va: allocator: log dmabuf and surface at pool push or pop
In order to keep track of the dmabuf fds and surfaces numbers log messages are
added at memory_release() (queue push) and prepare_buffer() (queue pop).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1999>
2021-02-05 21:25:20 +01:00
Víctor Manuel Jáquez Leal
64cca0f791 va: h265dec: fix HVC1 stream format name
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1999>
2021-02-05 21:25:20 +01:00
Víctor Manuel Jáquez Leal
43cb1b5dcf va: basedec: refactor context query
Context query is handled either by source and sink queries. This patch
factors-out its handling in a common utility function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1999>
2021-02-05 21:25:20 +01:00
Víctor Manuel Jáquez Leal
532b20cf05 va: filter: use a common GParamFlags definition
Instead of repeating the same code along gst_va_filter_install_properties()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1999>
2021-02-05 21:24:02 +01:00
Víctor Manuel Jáquez Leal
5e78c4bafc va: h264dec: remove spurious if validation
The first if checks for caps, thus else doesn't need to recheck for the
opposite.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1999>
2021-02-05 21:24:02 +01:00
Víctor Manuel Jáquez Leal
688ade3cfc va: vpp: fix frame copy
There were two problems with frame copy:

1. The input video info are from the format color, not form the allocated VA
surface, it's needed to update the sink video info according with the
allocator's data.

2. The parameters of `gst_video_frame_copy()` were backwards.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2007>
2021-02-05 18:54:25 +01:00
Víctor Manuel Jáquez Leal
bcbe620006 va: vpp: request video and alignment metas for src pool
This is for the pool used when importing raw video frames to surfaces.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2007>
2021-02-05 18:54:25 +01:00
Víctor Manuel Jáquez Leal
f7aafa74ab va: vpp: transform_size() must return FALSE
transform_size() basetransform vmethod is used when there's no output buffer
pool and allocates a system memory buffer. With VA this cannot be allowed, since
it needs VASurfaces to process.

Thus transform_size() is not required, but to play safe let's return FALSE.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2007>
2021-02-05 18:54:25 +01:00
Víctor Manuel Jáquez Leal
47a808a4b3 va: vpp: copy input buffer flags and timestamps
Strictly speaking right now it's not required do this copy, but let's play safe
and assume in the future this metadata might be required while doing the
postprocessing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2007>
2021-02-05 18:54:25 +01:00
Víctor Manuel Jáquez Leal
4c7218d7ae va: vpp: handle context query
Previously vapostproc didn't communicate its context through query mechanism,
which is required for context sharing. This patch completes this missing bits.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2007>
2021-02-05 18:52:56 +01:00
Víctor Manuel Jáquez Leal
da363a20fe va: vpp: don't copy color, size or orientation video metas
If they are processed by the element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2007>
2021-02-05 18:52:56 +01:00
Víctor Manuel Jáquez Leal
a29b56008a va: vpp: don't break passthrough if no color balance required
The function `_add_filter_cb_buffer()` returned TRUE if no color balance filter
are required, but that's is wrong, since it will break the passthrough. This
patch return FALSE which is the correct value for the situation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2007>
2021-02-05 18:52:56 +01:00
Víctor Manuel Jáquez Leal
b6e8741c29 va: vpp: use gst_clear_caps()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2007>
2021-02-05 18:52:23 +01:00
Víctor Manuel Jáquez Leal
6ae2494887 va: filter: don't destroy pipeline buffer
This was only required by i915 driver before libva-2.0 because it didn't
conform.

Also changes the way _destroy_filters() is called, now inside a locked block, so
it must not lock in it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2006>
2021-02-05 16:54:07 +01:00
Víctor Manuel Jáquez Leal
599e16fde8 va: filter: lock member variables access
While gst_va_filter_open() and gst_va_filter_close() remain non-thread-safe, the
other API calls that modify member variables are locked.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2005>
2021-02-04 11:12:37 +01:00
Seungha Yang
6bdf09d252 d3d11decoder: Fix deadlock when DPB texture pool is full
Unlike other stateless decoder implementations (e.g., VA),
our DPB pool cannot be grown since we are using
texture array (pre-allocated, fixed-size d3d11 texture pool).
So, if there's no more available texture to use,
there's no way other than copying it to downstream's
d3d11 buffer pool. Otherwise deadlock will happen.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2003>
2021-02-03 20:46:22 +00:00
Haihao Xiang
956d6e8ff7 va: sort the device queue
If so, the elements will be registered per drm node in order of
renderD128, renderD129, ... etc, an element with constant name will be
registered on renderD128 on a hardware with multiple drm nodes.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1988>
2021-02-02 10:28:04 +08:00
Seungha Yang
95e1ce7e7a v4l2decoder: Small documentation fix
Fixing documentation even though those methods are v4l2codecs plugin internals

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2000>
2021-02-02 04:33:33 +09:00
Nicolas Dufresne
99ebbf72ef v4l2codecs: h264: Enable 1 frame delay on non-live
When doing non-live decoding, enable 1 frame of delay. This will ensure
that we queue the next decoding job before we actually wait for the previous
to complete. This improves throughput notably on RK3399.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1881>
2021-01-29 19:44:48 +00:00
Nicolas Dufresne
241a490084 v4l2codecs: Add support for render delay
This add support for render delay in the decoder helper.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1881>
2021-01-29 19:44:48 +00:00
Nicolas Dufresne
88b93416fe v4l2codecs: Coding style fix
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1881>
2021-01-29 19:44:48 +00:00
Nicolas Dufresne
13a40b1da9 v4l2codecs: Poll inside set_done()
This removes the need for the gst_v4l2_decoder_is_done() helper and
simplify slightly the subclass code.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1881>
2021-01-29 19:44:48 +00:00
Nicolas Dufresne
1c2f391b57 v4l2codecs: Make request structure ref-counted
This adds a non-thread safe refcount to the GstV4l2Request. This will
allow holding on more then one request in order to implement render
delay. This is made non-thread safe for speed as we know this will all
happen on the same streaming thread.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1881>
2021-01-29 19:44:48 +00:00
Nicolas Dufresne
3db6f45ca9 v4l2codecs: Rework handling of queues and pending requests
Starting from this patch, all queue and dequeue operation happening
on V4L2 is now abstracted with the request. Buffers are dequeued
automatically when pending requests are marked done and only 1 in-flight
request is now used.

Along with fixing issues with request not being reused with slice
decoders, this change reduces the memory footprint by allocating only
two bitstream buffers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1881>
2021-01-29 19:44:48 +00:00
Staz M
180ab8377f decklink: Fixed decklinkvideosink auto format detection
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1994>
2021-01-29 16:49:07 +00:00
Seungha Yang
fba807bead nvh264sldec: Add support for output-delay to improve throughput performance
NVDEC API support delaying getting decoded output, and recommended
delay by API document is 4 frames. In case that throughput is
more critical factor than latency, we can prefer delayed output
as recommended by NVIDIA.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1925>
2021-01-29 16:22:28 +00:00