platform/upstream/gstreamer.git
3 years agoh264parse: don't invalidate the last PPS when parsing a new SPS
Michael Olbrich [Thu, 28 Jan 2021 11:28:03 +0000 (12:28 +0100)]
h264parse: don't invalidate the last PPS when parsing a new SPS

When a SPS is received then any previous PPS remains valid. So don't clear
the PPS flag from the parser state.

This is important because there are encoders that don't generated a PPS after
every SPS.

Closes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/571

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2019>

3 years agoh265parse: Detect height change on field-based interlaced files
Vivia Nikolaidou [Wed, 17 Feb 2021 13:15:09 +0000 (15:15 +0200)]
h265parse: Detect height change on field-based interlaced files

The first time update_src_caps is called, there's no frame parsed yet,
therefore we don't know whether the file has alternate-field interlacing
mode. If we run it again after we have a frame, it might be that now we
have the SEI pic_struct parsed, and therefore we know that it's
field-based interlaced, and therefore the height must be multiplied by
two. Earlier on this was not detected as a change.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2022>

3 years agova: add multiple-vpp example
Víctor Manuel Jáquez Leal [Sat, 19 Sep 2020 19:39:06 +0000 (21:39 +0200)]
va: add multiple-vpp example

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2015>

3 years agova: allocator: set workaround only for i965 driver
Víctor Manuel Jáquez Leal [Mon, 15 Feb 2021 14:54:11 +0000 (15:54 +0100)]
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>

3 years agoh265parse: Fix FPS/duration for interlaced files
Vivia Nikolaidou [Wed, 17 Feb 2021 11:46:03 +0000 (13:46 +0200)]
h265parse: Fix FPS/duration for interlaced files

There can be h265 files with frame-based, not field-based, interlacing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2020>

3 years agova: allocator: MT-safe queue & dequeue dmabuf-based memories
Víctor Manuel Jáquez Leal [Fri, 12 Feb 2021 17:43:00 +0000 (18:43 +0100)]
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>

3 years agova: pool, allocator: free memories at bufferpool's stop()
Víctor Manuel Jáquez Leal [Mon, 15 Feb 2021 14:34:56 +0000 (15:34 +0100)]
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>

3 years agova: allocator: remove unused public functions
Víctor Manuel Jáquez Leal [Fri, 12 Feb 2021 14:40:33 +0000 (15:40 +0100)]
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>

3 years agova: pool: simplify the logic
Víctor Manuel Jáquez Leal [Fri, 12 Feb 2021 12:26:24 +0000 (13:26 +0100)]
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>

3 years agova: pool: use allocator pool at alloc()
Víctor Manuel Jáquez Leal [Sun, 7 Feb 2021 15:12:56 +0000 (16:12 +0100)]
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>

3 years agova: allocator: log buffer at dmabuf setup and prepare
Víctor Manuel Jáquez Leal [Mon, 8 Feb 2021 11:25:07 +0000 (12:25 +0100)]
va: allocator: log buffer at dmabuf setup and prepare

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2013>

3 years agod3d11: Add support for deinterlacing by using ID3D11VideoProcessor interface
Seungha Yang [Thu, 21 Jan 2021 15:10:28 +0000 (00:10 +0900)]
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>

3 years agod3d11: Add a method for conversion from DXGI format to GstVideoFormat
Seungha Yang [Sat, 13 Feb 2021 21:23:55 +0000 (06:23 +0900)]
d3d11: Add a method for conversion from DXGI format to GstVideoFormat

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2016>

3 years agoh264parse: fix timestamping of interlaced fields in output
Mathieu Duponchelle [Fri, 22 Jan 2021 02:26:29 +0000 (03:26 +0100)]
h264parse: fix timestamping of interlaced fields in output

Instead of relying on GstBaseParse default behaviour of computing
the duration of a parsed buffer based on the framerate passed
to gst_base_parse_set_framerate(), we instead compute the duration
ourselves, as we have more information available.

In particular, this means we now output buffers with a duration
that matches that of raw interlaced buffers when each field is
output in a separate buffer.

This fixes DTS interpolation performed by GstBaseParse, as the
previous behaviour of outputting each field with the duration of
a full frame was messing up the base class calculations.

When not enough information is available, h264parse simply falls
back to calculating the duration based on the framerate and hope
for the best as was the case previously.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1973>

3 years agod3d11decoder: Take account of min buffers of downstream buffer pool
Seungha Yang [Sun, 14 Feb 2021 12:01:32 +0000 (21:01 +0900)]
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>

3 years agoopenh264enc: Add support for main and high profiles
Thibault Saunier [Thu, 29 Oct 2020 13:54:45 +0000 (10:54 -0300)]
openh264enc: Add support for main and high profiles

Those are supported (to a certain extent) so we should not limit
ourself to baseline

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1789>

3 years agocodecs: mpeg2decoder: Move frame_unref to handle_frame.
He Junyan [Thu, 11 Feb 2021 08:04:12 +0000 (16:04 +0800)]
codecs: mpeg2decoder: Move frame_unref to handle_frame.

In the current code, we call frame_unref only when the frame is
outputted. This is OK for normal playback, but when seek happens,
the frames stored in DPB is not outputted and causes some memory
leak.
The correct way is that we should call frame_unref every time we
finish the handle_frame(), which is also the behaviour of H264/H265
decoder.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2014>

3 years agod3d11h265dec: Add support for interlaced stream
Seungha Yang [Sat, 6 Feb 2021 17:26:02 +0000 (02:26 +0900)]
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>

3 years agocodecs: h265decoder: Add support for interlaced stream
Seungha Yang [Sat, 6 Feb 2021 15:21:06 +0000 (00:21 +0900)]
codecs: h265decoder: Add support for interlaced stream

* Invoke GstH265DecoderClass::new_sequence() method per interlaced
  stream status update so that subclass can update caps.
* Parse picture timing SEI and set buffer flags on GstH265Picture
  object. Subclass can refer to it like that of our h264decoder
  implementation.
* Remove pointless GstH265PictureField enum

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2008>

3 years agovah265dec: Don't need to pass picture structure to VA
Seungha Yang [Tue, 9 Feb 2021 15:59:05 +0000 (00:59 +0900)]
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>

3 years agonvh265sldec: Remove pointless field picture parameter setup
Seungha Yang [Sat, 6 Feb 2021 13:02:59 +0000 (22:02 +0900)]
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>

3 years agova: vpp: Make the global lock only to DMA buffer's import.
He Junyan [Sun, 7 Feb 2021 16:07:26 +0000 (00:07 +0800)]
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>

3 years agova: allocator: log dmabuf and surface at pool push or pop
Víctor Manuel Jáquez Leal [Fri, 5 Feb 2021 13:05:53 +0000 (14:05 +0100)]
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>

3 years agova: h265dec: fix HVC1 stream format name
Víctor Manuel Jáquez Leal [Tue, 2 Feb 2021 05:43:27 +0000 (06:43 +0100)]
va: h265dec: fix HVC1 stream format name

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1999>

3 years agova: basedec: refactor context query
Víctor Manuel Jáquez Leal [Mon, 1 Feb 2021 22:19:27 +0000 (23:19 +0100)]
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>

3 years agova: filter: use a common GParamFlags definition
Víctor Manuel Jáquez Leal [Mon, 21 Dec 2020 17:10:44 +0000 (18:10 +0100)]
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>

3 years agova: h264dec: remove spurious if validation
Víctor Manuel Jáquez Leal [Fri, 22 Jan 2021 15:54:05 +0000 (16:54 +0100)]
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>

3 years agova: vpp: fix frame copy
Víctor Manuel Jáquez Leal [Fri, 5 Feb 2021 17:13:32 +0000 (18:13 +0100)]
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>

3 years agova: vpp: request video and alignment metas for src pool
Víctor Manuel Jáquez Leal [Tue, 2 Feb 2021 17:05:46 +0000 (18:05 +0100)]
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>

3 years agova: vpp: transform_size() must return FALSE
Víctor Manuel Jáquez Leal [Thu, 4 Feb 2021 15:43:02 +0000 (16:43 +0100)]
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>

3 years agova: vpp: copy input buffer flags and timestamps
Víctor Manuel Jáquez Leal [Tue, 2 Feb 2021 15:22:34 +0000 (16:22 +0100)]
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>

3 years agova: vpp: handle context query
Víctor Manuel Jáquez Leal [Mon, 1 Feb 2021 22:55:11 +0000 (23:55 +0100)]
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>

3 years agova: vpp: don't copy color, size or orientation video metas
Víctor Manuel Jáquez Leal [Mon, 1 Feb 2021 22:50:12 +0000 (23:50 +0100)]
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>

3 years agova: vpp: don't break passthrough if no color balance required
Víctor Manuel Jáquez Leal [Fri, 5 Feb 2021 15:46:00 +0000 (16:46 +0100)]
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>

3 years agova: vpp: use gst_clear_caps()
Víctor Manuel Jáquez Leal [Fri, 15 Jan 2021 13:07:19 +0000 (14:07 +0100)]
va: vpp: use gst_clear_caps()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2007>

3 years agova: filter: don't destroy pipeline buffer
Víctor Manuel Jáquez Leal [Tue, 2 Feb 2021 15:23:28 +0000 (16:23 +0100)]
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>

3 years agova: filter: lock member variables access
Víctor Manuel Jáquez Leal [Mon, 1 Feb 2021 15:57:49 +0000 (16:57 +0100)]
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>

3 years agosrt: preserve ABI compatibility
Jakub Adam [Wed, 3 Feb 2021 22:39:00 +0000 (23:39 +0100)]
srt: preserve ABI compatibility

Reintroduce socket descriptor parameter removed in 327ad84e to
"caller-added" and "caller-removed" signals, just set it always to zero.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2004>

3 years agod3d11decoder: Fix deadlock when DPB texture pool is full
Seungha Yang [Wed, 3 Feb 2021 18:42:05 +0000 (03:42 +0900)]
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>

3 years agod3d11memory: Add a method for querying texture array size
Seungha Yang [Tue, 2 Feb 2021 10:10:13 +0000 (19:10 +0900)]
d3d11memory: Add a method for querying texture array size

... and the number of textures in use.

Direct3D11 texture array is usually used for decoder DPB pool,
and d3d11 decoder elements might want to know
whether there's available texture resource or not.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2003>

3 years agosrt: don't pass SRT socket ID to "caller-added,removed" signals
Jakub Adam [Mon, 14 Dec 2020 19:34:15 +0000 (20:34 +0100)]
srt: don't pass SRT socket ID to "caller-added,removed" signals

The caller's IP and port is enough for unique identification. Don't leak
the socket handle since using it in unadvised libsrt calls from the
application could break the SRT element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1772>

3 years agosrtobject: add caller address to stats structure
Jakub Adam [Wed, 4 Nov 2020 16:14:03 +0000 (17:14 +0100)]
srtobject: add caller address to stats structure

In listener mode, gst_stats() returns an independent set of
statistics for every connected caller. Having the caller's IP and port
present in each structure allows to correlate the statistics with a
particular caller that has been announced by "caller-added" signal.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1772>

3 years agoh265parse: Support for alternate-field interlacing
Vivia Nikolaidou [Wed, 3 Feb 2021 12:27:14 +0000 (14:27 +0200)]
h265parse: Support for alternate-field interlacing

Also don't set interlacing information on the caps, see #1313

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1996>

3 years agoh264/h265parse: Add VideoTimeCodeMeta to the outgoing buffer
Jan Alexander Steffens (heftig) [Tue, 2 Feb 2021 17:25:31 +0000 (18:25 +0100)]
h264/h265parse: Add VideoTimeCodeMeta to the outgoing buffer

The parsers attempted to add the meta to the incoming buffer, which
might not be the outgoing buffer or may not have been writable yet.

To fix this, call `gst_buffer_make_writable` earlier and make sure to
use the `parse_buffer` to add the meta.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1521

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2002>

3 years agova: sort the device queue
Haihao Xiang [Wed, 27 Jan 2021 07:32:26 +0000 (15:32 +0800)]
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>

3 years agov4l2decoder: Small documentation fix
Seungha Yang [Mon, 1 Feb 2021 19:33:09 +0000 (04:33 +0900)]
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>

3 years agov4l2codecs: h264: Enable 1 frame delay on non-live
Nicolas Dufresne [Fri, 29 Jan 2021 14:43:07 +0000 (09:43 -0500)]
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>

3 years agov4l2codecs: Add support for render delay
Nicolas Dufresne [Fri, 29 Jan 2021 14:41:22 +0000 (09:41 -0500)]
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>

3 years agov4l2codecs: Coding style fix
Nicolas Dufresne [Wed, 27 Jan 2021 20:55:43 +0000 (15:55 -0500)]
v4l2codecs: Coding style fix

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1881>

3 years agov4l2codecs: Poll inside set_done()
Nicolas Dufresne [Wed, 27 Jan 2021 20:53:49 +0000 (15:53 -0500)]
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>

3 years agov4l2codecs: Make request structure ref-counted
Nicolas Dufresne [Fri, 18 Dec 2020 21:36:16 +0000 (16:36 -0500)]
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>

3 years agov4l2codecs: Rework handling of queues and pending requests
Nicolas Dufresne [Mon, 14 Dec 2020 22:07:01 +0000 (17:07 -0500)]
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>

3 years agodecklink: Fixed decklinkvideosink auto format detection
Staz M [Fri, 29 Jan 2021 07:09:05 +0000 (02:09 -0500)]
decklink: Fixed decklinkvideosink auto format detection

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1994>

3 years agonvh264sldec: Add support for output-delay to improve throughput performance
Seungha Yang [Wed, 27 Jan 2021 19:03:37 +0000 (04:03 +0900)]
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>

3 years agocodecs: h264decoder: Add support for output delay
Seungha Yang [Tue, 29 Dec 2020 10:54:35 +0000 (19:54 +0900)]
codecs: h264decoder: Add support for output delay

Some decoding APIs support delayed output or a command for decoding
a frame doesn't need to be sequential to corresponding command for
getting decoded frame. For instance, subclass might be able to
request decoding for multiple frames and then get for one (oldest)
decoded frame or so.
If aforementioned case is supported by specific decoding API,
delayed output might show better throughput performance.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1925>

3 years agoldac: Use pkg-config instead of raw lib/header search
Arun Raghavan [Wed, 27 Jan 2021 22:09:07 +0000 (17:09 -0500)]
ldac: Use pkg-config instead of raw lib/header search

The ldacBT library includes pkg-config files for the standard and ABR
libraries, so let's just use that instead of doing a header/library
search.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1990>

3 years agod3d11videosink: Don't limit max buffers of buffer pool
Seungha Yang [Wed, 27 Jan 2021 17:02:28 +0000 (02:02 +0900)]
d3d11videosink: Don't limit max buffers of buffer pool

In some case, especially reverse playback, we would need more than
two buffers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1989>

3 years agod3d11: Suppress some warning debug messages
Seungha Yang [Tue, 26 Jan 2021 19:34:13 +0000 (04:34 +0900)]
d3d11: Suppress some warning debug messages

* Don't warn for live object, since ID3D11Debug itself seems to be
  holding refcount of ID3D11Device at the moment we called
  ID3D11Debug::ReportLiveDeviceObjects(). It would report live object
  always
* Device might not be able to support some formats (e.g., P010)
  especially in case of WARP device. We don't need to warn about that.
* gst_d3d11_device_new() can be used for device enumeration. Don't warn
  even if we cannot create D3D11 device with given adapter index therefore.
* Don't warn for HLSL compiler warning. It's just noise and
  should not be critical thing at all

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1986>

3 years agoexamples: Add d3d11videosink examples for shared-texture use cases
Seungha Yang [Thu, 10 Dec 2020 20:23:20 +0000 (05:23 +0900)]
examples: Add d3d11videosink examples for shared-texture use cases

Add two examples to demonstrate "draw-on-shared-texture" use cases.

d3d11videosink will draw application's own texture without copy
by using:
- Enable "draw-on-shared-texture" property
- make use of "begin-draw" and "draw" signals

And then, application will render the shared application's texture
to swapchain's backbuffer by using
1) Direct3D11 APIs
2) Or, Direct3D9Ex + interop APIs

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1873>

3 years agod3d11videosink: Add support for drawing on application's own texture
Seungha Yang [Wed, 23 Dec 2020 14:49:12 +0000 (23:49 +0900)]
d3d11videosink: Add support for drawing on application's own texture

Add a way to support drawing on application's texture instead of
usual window handle.
To make use of this new feature, application should follow below step.
1) Enable this feature by using "draw-on-shared-texture" property
2) Watch "begin-draw" signal
3) On "begin-draw" signal handler, application can request drawing
   by using "draw" signal action. Note that "draw" signal action
   should be happen before "begin-draw" signal handler is returned

NOTE 1) For texture sharing, creating a texture with
D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX flag is strongly recommend
if possible because we cannot ensure sync a texture
which was created with D3D11_RESOURCE_MISC_SHARED
and it would cause glitch with ID3D11VideoProcessor use case.

NOTE 2) Direct9Ex doesn't support texture sharing which was
created with D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX. In other words,
D3D11_RESOURCE_MISC_SHARED is the only option for Direct3D11/Direct9Ex interop.

NOTE 3) Because of missing synchronization around ID3D11VideoProcessor,
If shared texture was created with D3D11_RESOURCE_MISC_SHARED,
d3d11videosink might use fallback texture to convert DXVA texture
to normal Direct3D texture. Then converted texture will be
copied to user-provided shared texture.

* Why not use generic appsink approach?
In order for application to be able to store video data
which was produced by GStreamer in application's own texture,
there would be two possible approaches,
one is copying our texture into application's own texture,
and the other is drawing on application's own texture directly.
The former (appsink way) cannot be a zero-copy by nature.
In order to support zero-copy processing, we need to draw on
application's own texture directly.

For example, assume that application wants RGBA texture.
Then we can imagine following case.

"d3d11h264dec ! d3d11convert ! video/x-raw(memory:D3D11Memory),format=RGBA ! appsink"
                             ^
                             |_ allocate new Direct3D texture for RGBA format

In above case, d3d11convert will allocate new texture(s) for RGBA format
and then application will copy again the our RGBA texutre into
application's own texture. One texture allocation plus per frame GPU copy will hanppen
in that case therefore.
Moreover, in order for application to be able to access
our texture, we need to allocate texture with additional flags for
application's Direct3D11 device to be able to read texture data.
That would be another implementation burden on our side

But with this MR, we can configure pipeline in this way
"d3d11h264dec ! d3d11videosink".

In that way, we can save at least one texture allocation and
per frame texutre copy since d3d11videosink will convert incoming texture
into application's texture format directly without copy.

* What if we expose texture without conversion and application does
  conversion by itself?
As mentioned above, for application to be able to access our texture
from application's Direct3D11 device, we need to allocate texture
in a special form. But in some case, that might not be possible.
Also, if a texture belongs to decoder DPB, exposing such texture
to application is unsafe and usual Direct3D11 shader cannot handle
such texture. To convert format, ID3D11VideoProcessor API needs to
be used but that would be a implementation burden for application.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1873>

3 years agodashsink: add h265 codec support
Haihua Hu [Wed, 20 Jan 2021 12:04:20 +0000 (20:04 +0800)]
dashsink: add h265 codec support

Return hvc1 for video/x-h265 mime type in mpd helper function

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1966>

3 years agoav1parse: set the default alignment for input and output.
He Junyan [Sat, 23 Jan 2021 15:25:30 +0000 (23:25 +0800)]
av1parse: set the default alignment for input and output.

1. Set the default output alignment to frame, rather than current
   alignment of obu. This make it the same behaviour as h264/h265
   parse, which default align to AU.
2. Set the default input alignment to byte. It can handle the "not
   enough data" error while the OBU alignment can not. Also make it
   conform to the comments.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1979>

3 years agotest: Add more test cases for the av1parse obu aligned output.
He Junyan [Sat, 23 Jan 2021 11:26:59 +0000 (19:26 +0800)]
test: Add more test cases for the av1parse obu aligned output.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1979>

3 years agoav1parse: Reset the annex_b when meet TU inside a buffer.
He Junyan [Sat, 23 Jan 2021 11:21:21 +0000 (19:21 +0800)]
av1parse: Reset the annex_b when meet TU inside a buffer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1979>

3 years agoav1parse: Output each OBU when output is aligned to obu.
He Junyan [Sat, 23 Jan 2021 11:05:57 +0000 (19:05 +0800)]
av1parse: Output each OBU when output is aligned to obu.

The current behaviour for obu aligned output is not very precise.
Several OBUs will be output together within one gst buffer. We
should output each gst buffer just containing one OBU. This is
the same way as the h264/h265 parse do when NAL aligned.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1979>

3 years agoav1parse: Always copy the OBU to cache.
He Junyan [Sat, 23 Jan 2021 09:38:12 +0000 (17:38 +0800)]
av1parse: Always copy the OBU to cache.

The current optimization when input align and out out align are
the same is not very correct. We simply copy the data from input
buffer to output buffer, but we failed to consider the dropping of
OBUs. When we need to drop some OBUs(such as filter out the OBUs
of some temporal ID), we can not do simple copy. So we need to
always copy the input OBUs into a cache.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1979>

3 years agoav1parse: Improve the logic when to drop the OBU.
He Junyan [Sat, 23 Jan 2021 09:26:25 +0000 (17:26 +0800)]
av1parse: Improve the logic when to drop the OBU.

When drop some OBU, we need to go on. The current manner will make
the data access out range of the buffer mapping.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1979>

3 years agoext/ldac: Move duplicate sampling rates into #define
Marijn Suijten [Tue, 26 Jan 2021 10:12:28 +0000 (11:12 +0100)]
ext/ldac: Move duplicate sampling rates into #define

Because there was a typo in one of the duplicates already (see previous
commit) it is much safer to specify these once and only once.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1985>

3 years agoext/ldac: Fix typo in 88200(0) stereo encoder sampling rate
Marijn Suijten [Tue, 26 Jan 2021 10:02:21 +0000 (11:02 +0100)]
ext/ldac: Fix typo in 88200(0) stereo encoder sampling rate

Fixes: a57681455 ("ext: Add LDAC encoder")
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1985>

3 years agod3d11: Add support for MPEG-2 video decoding
Seungha Yang [Sun, 10 Jan 2021 16:06:24 +0000 (01:06 +0900)]
d3d11: Add support for MPEG-2 video decoding

Add DXVA/Direct3D11 API based MPEG-2 decoder element

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1969>

3 years agowpesrc: fix possible small deadlock on shutdown
Matthew Waters [Fri, 27 Nov 2020 05:18:29 +0000 (16:18 +1100)]
wpesrc: fix possible small deadlock on shutdown

Problem is that unreffing the EGLImage/SHM Buffer while holding the
images_mutex lock may deadlock when a new buffer is advertised and
an attempt is made to lock the images_mutex there.

The advertisement of the new image/buffer is performed in the
WPEContextThread and the blocking dispatch when unreffing wants to run
something on the WPEContextThread however images_mutex has already been
locked by the destructor.

Delay unreffing images/buffers outside of images_mutex and instead just
clear the relevant fields within the lock.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1843>

3 years agodashsink: fix double unref of sinkpad caps
Haihua Hu [Wed, 20 Jan 2021 10:16:17 +0000 (18:16 +0800)]
dashsink: fix double unref of sinkpad caps

no need to unref caps in gst_mpd_helper_get_XXX_codec_from_mime
it will be unref in caller gst_dash_sink_get_stream_metadata()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1981>

3 years agocodecparsers: av1: Fix a typo in frame_restoration_type setting.
He Junyan [Fri, 22 Jan 2021 08:56:24 +0000 (16:56 +0800)]
codecparsers: av1: Fix a typo in frame_restoration_type setting.

Fixes: #1500
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1974>

3 years agoav1parse: Fix some issues in the src caps.
He Junyan [Fri, 22 Jan 2021 06:01:01 +0000 (14:01 +0800)]
av1parse: Fix some issues in the src caps.

1. Add the mono_chrome to identify 4:0:0 chroma-format.
2. Correct the mapping between subsampling_x/y and chroma-format.
   There is no 4:4:0 format definition in AV1. And 4:4:4 should
   let both subsampling_x/y be equal to 0.
3. Send the chroma-format when the color space is not RGB.

Fixes: #1502
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1974>

3 years agovp9parse: Fix the subsampling_x/y to chroma format mapping.
He Junyan [Fri, 22 Jan 2021 05:25:50 +0000 (13:25 +0800)]
vp9parse: Fix the subsampling_x/y to chroma format mapping.

The chroma format 4:4:4 needs both subsampling_x and subsampling_y
equal to 0.

Fixes: #1502
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1974>

3 years agovulkan: remove duplicated check
Matthew Waters [Fri, 22 Jan 2021 10:10:59 +0000 (21:10 +1100)]
vulkan: remove duplicated check

Checking the same value twice is pointless

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1504

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1977>

3 years agoldac: also look for the ldac/ldacBT.h header.
Matthew Waters [Fri, 22 Jan 2021 08:26:18 +0000 (19:26 +1100)]
ldac: also look for the ldac/ldacBT.h header.

Otherwise there will be a scenario where the library can be found but
not the header and a compilation build error will result

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1975>

3 years agova: filter: fix assignation to proper variable
Víctor Manuel Jáquez Leal [Fri, 22 Jan 2021 08:35:30 +0000 (09:35 +0100)]
va: filter: fix assignation to proper variable

Fix the result of a wrong copy&paste

Fixes: #1501
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1976>

3 years agomfvideoenc: Add support for P010 d3d11 texture
Seungha Yang [Wed, 20 Jan 2021 19:41:44 +0000 (04:41 +0900)]
mfvideoenc: Add support for P010 d3d11 texture

Add P010 Direct3D11 texture format support

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1970>

3 years agod3d11: Don't use hardcoded maximum resolution value
Seungha Yang [Tue, 19 Jan 2021 17:29:43 +0000 (02:29 +0900)]
d3d11: Don't use hardcoded maximum resolution value

Maximum supported texture dimension is pre-defined based on
feature level and it couldn't be INT_MAX in any case.
See also https://docs.microsoft.com/en-us/windows/win32/direct3d11/overviews-direct3d-11-devices-downlevel-intro

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1964>

3 years agodoc: Add the av1 parse element.
He Junyan [Sat, 16 Jan 2021 11:14:06 +0000 (19:14 +0800)]
doc: Add the av1 parse element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1614>

3 years agocodecparsers: Exclude the size of obu_size when identify OBU.
He Junyan [Sat, 16 Jan 2021 08:48:38 +0000 (16:48 +0800)]
codecparsers: Exclude the size of obu_size when identify OBU.

obu->obu_size does not contain the bytes of obu_size itself, we need
to exclude it when doing the saint check.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1614>

3 years agotest: Add test cases for av1parse element.
He Junyan [Wed, 6 Jan 2021 15:33:24 +0000 (23:33 +0800)]
test: Add test cases for av1parse element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1614>

3 years agovideoparsers: av1: Add the AV1 parse.
He Junyan [Tue, 22 Sep 2020 06:54:19 +0000 (14:54 +0800)]
videoparsers: av1: Add the AV1 parse.

This AV1 parse implements the conversion between alignment of obu,
tu and frame, and the conversion between stream-format of obu-stream
and annexb.

TODO:
1. May need a property of operating_point to filter the OBUs
2. May add a property to disable deep parse.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1614>

3 years agocodecs: mpeg2decoder: Fix a typo in header file's comment.
He Junyan [Tue, 19 Jan 2021 16:57:05 +0000 (00:57 +0800)]
codecs: mpeg2decoder: Fix a typo in header file's comment.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1963>

3 years agod3d11videosink: Fix ugly thread name for Win32 window impl.
Seungha Yang [Mon, 18 Jan 2021 11:30:44 +0000 (20:30 +0900)]
d3d11videosink: Fix ugly thread name for Win32 window impl.

Don't need to put Win32 twice

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1962>

3 years agod3d11videosink: Fix MSVC build warnings around UWP code
Seungha Yang [Mon, 18 Jan 2021 11:28:14 +0000 (20:28 +0900)]
d3d11videosink: Fix MSVC build warnings around UWP code

gstd3d11window_corewindow.cpp(408): warning C4189:
  'storage': local variable is initialized but not referenced
gstd3d11window_corewindow.cpp(490): warning C4189:
  'self': local variable is initialized but not referenced
gstd3d11window_swapchainpanel.cpp(481): warning C4189:
  'self': local variable is initialized but not referenced

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1962>

3 years agod3d11: Allow building UWP features with Desktop features if possible
Seungha Yang [Mon, 18 Jan 2021 10:17:14 +0000 (19:17 +0900)]
d3d11: Allow building UWP features with Desktop features if possible

WINAPI_PARTITION_DESKTOP and WINAPI_PARTITION_APP can coexist.
Although UWP only binaries should be used for production stage,
this change will be useful for development stage

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1962>

3 years agod3d11decoder: Do more retry for ID3D11VideoContext::DecoderBeginFrame failure
Seungha Yang [Sun, 27 Dec 2020 17:35:38 +0000 (02:35 +0900)]
d3d11decoder: Do more retry for ID3D11VideoContext::DecoderBeginFrame failure

Some GPUs (especially NVIDIA) are complaining that GPU is still busy
even we did 50 times of retry with 1ms sleep per failure.
Because DXVA/D3D11 doesn't provide API for "GPU-IS-READY-TO-DECODE"
like signal, there seems to be still no better solution other than sleep.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1913>

3 years agod3d11videosink: Fix build error on UWP
Seungha Yang [Mon, 18 Jan 2021 10:23:30 +0000 (19:23 +0900)]
d3d11videosink: Fix build error on UWP

gstd3d11videosink.c(662): error C2065: 'sink': undeclared identifier

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1961>

3 years agova: Fix some gst_object_unref error because the pointer is NULL.
He Junyan [Sat, 16 Jan 2021 17:16:17 +0000 (01:16 +0800)]
va: Fix some gst_object_unref error because the pointer is NULL.

!1957 introduces some error of gst_object_unref for NULL pointer.
Fixes all of them.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1959>

3 years agova: Make the caps pointer operation atomic in vadecoder.
He Junyan [Fri, 15 Jan 2021 08:05:06 +0000 (16:05 +0800)]
va: Make the caps pointer operation atomic in vadecoder.

The vadecoder's srcpad_caps and sinkpad_caps pointers are outside of the
mutex protection. Just make all operation for them atomic.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1957>

3 years agova: Fix a latent race condition in vabasedec.
He Junyan [Fri, 15 Jan 2021 07:22:07 +0000 (15:22 +0800)]
va: Fix a latent race condition in vabasedec.

The vabasedec's display and decoder are created/destroyed between
the gst_va_base_dec_open/close pair. All the data and event handling
functions are between this pair and so the accessing to these pointers
are safe. But the query function can be called anytime. So we need to:
1. Make these pointers operation in open/close and query atomic.
2. Hold an extra ref during query function to avoid it destroyed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1957>

3 years agodecklinkaudiosrc: Allow disabling audio sample alignment code by setting the alignmen...
Sebastian Dröge [Thu, 14 Jan 2021 12:37:32 +0000 (14:37 +0200)]
decklinkaudiosrc: Allow disabling audio sample alignment code by setting the alignment-threshold to 0

And handle setting it to GST_CLOCK_TIME_NONE as always aligning without
ever detecting a discont.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1956>

3 years agomfvideoenc: Add support for Direct3D11 texture
Seungha Yang [Sun, 20 Dec 2020 20:11:03 +0000 (05:11 +0900)]
mfvideoenc: Add support for Direct3D11 texture

Initial support for d3d11 texture so that encoder can copy
upstream d3d11 texture into encoder's own texture pool without
downloading memory.

This implementation requires MFTEnum2() API for creating
MFT (Media Foundation Transform) object for specific GPU but
the API is Windows 10 desktop only. So UWP is not target
of this change.
See also https://docs.microsoft.com/en-us/windows/win32/api/mfapi/nf-mfapi-mftenum2

Note that, for MF plugin to be able to support old OS versions
without breakage, this commit will load MFTEnum2() symbol
by using g_module_open()

Summary of required system environment:
- Needs Windows 10 (probably at least RS 1 update)
- GPU should support ExtendedNV12SharedTextureSupported feature
- Desktop application only (UWP is not supported yet)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1903>

3 years agowebrtc: expose transport property on sender and receiver
Mathieu Duponchelle [Tue, 12 Jan 2021 18:12:42 +0000 (19:12 +0100)]
webrtc: expose transport property on sender and receiver

As advised by !1366#note_629558 , the nice transport should be
accessed through:

> transceiver->sender/receiver->transport/rtcp_transport->icetransport

All the objects on the path can be accessed through properties
except sender/receiver->transport. This patch addresses that.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1952>

3 years agod3d11: Move core methods to gst-libs
Seungha Yang [Sun, 20 Dec 2020 17:47:45 +0000 (02:47 +0900)]
d3d11: Move core methods to gst-libs

Move d3d11 device, memory, buffer pool and minimal method
to gst-libs so that other plugins can access d3d11 resource.
Since Direct3D is primary graphics API on Windows, we need
this infrastructure for various plugins can share GPU resource
without downloading GPU memory.
Note that this implementation is public only for -bad scope
for now.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/464>

3 years agova: allocator: Fix deadlock caused by double lock
Seungha Yang [Mon, 11 Jan 2021 15:13:22 +0000 (00:13 +0900)]
va: allocator: Fix deadlock caused by double lock

Trivial bug fix for deadlock

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1949>

3 years agowpesrc: replace object lock usage with a new lock
Matthew Waters [Mon, 4 Jan 2021 08:34:40 +0000 (19:34 +1100)]
wpesrc: replace object lock usage with a new lock

Using the object lock is problematic for anything that can dispatch to
another thread which is what createWPEView() does inside
gst_wpe_src_start().  Using the object lock there can cause a deadlock.

One example of such a deadlock is when createWPEView is called, but
another (or the same) wpesrc is on the WPEContextThread and e.g. posts a
bus message.  This message propagations takes and releases the object
lock of numerous elements in quick succession for determining various
information about the elements in the bin.  If the object lock is
already held, then the message propagation will block and stall bin
processing (state changes, other messages) and wpe servicing any events.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1490

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1934>

3 years agocodecs: h264picture: Count only complete complementary field pair for dpb fullness...
Seungha Yang [Sun, 10 Jan 2021 14:16:55 +0000 (23:16 +0900)]
codecs: h264picture: Count only complete complementary field pair for dpb fullness decision

Our DPB implementation was designed as such that allowing
temporary DPB overflow in the middle of field picture decoding
and incomplete field pair should not trigger DPB bumping.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1947>