platform/upstream/gstreamer.git
4 years agosctp: Do downward state change logic after chaining up.
Jan Schmidt [Fri, 30 Oct 2020 11:52:18 +0000 (22:52 +1100)]
sctp: Do downward state change logic after chaining up.

Call the parent state_change function first when changing state
downward, to make sure that the element has stopped before cleaning
it up.

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

4 years agodtls: Avoid bio_buffer assertion on shutdown.
Jan Schmidt [Fri, 30 Oct 2020 11:49:22 +0000 (22:49 +1100)]
dtls: Avoid bio_buffer assertion on shutdown.

On shutdown, a previous iteration of dtsl_connection_process()
might be incomplete and leave a partial bio_buffer behind.

If the DTLS connection is already marked closed, drop out
of dtls_connection_process early without asserting.

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

4 years agowebrtc: Fix a race on shutdown.
Jan Schmidt [Fri, 30 Oct 2020 05:31:18 +0000 (16:31 +1100)]
webrtc: Fix a race on shutdown.

The main context can disappear in gst_webrtc_bin_enqueue_task()
between checking the is_closed flag and enqueueing a source on the
main context. Protect the main context with the object lock instead
of the PC lock, and hold a ref briefly to make sure it stays alive.

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

4 years agowebrtc: Set the DSCP markings based on the priority
Olivier Crête [Wed, 8 Jul 2020 21:24:36 +0000 (17:24 -0400)]
webrtc: Set the DSCP markings based on the priority

This matches how the WebRTC javascript API works and the Chrome implementation.

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

4 years agortpsender: Add API to set the priority
Olivier Crête [Thu, 9 Jul 2020 17:39:03 +0000 (13:39 -0400)]
rtpsender: Add API to set the priority

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

4 years agortptransceiver: Store the SSRC of the current stream
Olivier Crête [Thu, 9 Jul 2020 17:42:35 +0000 (13:42 -0400)]
rtptransceiver: Store the SSRC of the current stream

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

4 years agowebrtc: Save the media kind in the transceiver
Olivier Crête [Wed, 8 Jul 2020 23:13:33 +0000 (19:13 -0400)]
webrtc: Save the media kind in the transceiver

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

4 years agowebrtcbin: Remove unused function
Olivier Crête [Thu, 9 Jul 2020 17:45:20 +0000 (13:45 -0400)]
webrtcbin: Remove unused function

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

4 years agowebrtc: Document more objects
Olivier Crête [Sat, 3 Oct 2020 01:38:00 +0000 (21:38 -0400)]
webrtc: Document more objects

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

4 years agod3d11decoder: Allow 10bits only profiles
Seungha Yang [Fri, 30 Oct 2020 15:37:48 +0000 (00:37 +0900)]
d3d11decoder: Allow 10bits only profiles

HEVC_VLD_Main10 and VP9_VLD_10bit_Profile2 might not support
8bit format (i.e., NV12) depending on GPU vendor.

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

4 years agodecklink: Remove \n from debug output
Sebastian Dröge [Sun, 25 Oct 2020 11:33:21 +0000 (13:33 +0200)]
decklink: Remove \n from debug output

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

4 years agodecklink: Correctly indent everything
Sebastian Dröge [Sun, 25 Oct 2020 11:32:26 +0000 (13:32 +0200)]
decklink: Correctly indent everything

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

4 years agodecklink: Add a default profile id
Sebastian Dröge [Sun, 25 Oct 2020 11:30:55 +0000 (13:30 +0200)]
decklink: Add a default profile id

This causes no changes to the profile but keeps the existing settings.
The profile can also be changed from e.g. the card's configuration
application and in that case probably should be left alone.

The default is the new value as it keeps the profile setting as it is,
which is consistent with the previous behaviour in 1.18.

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

4 years agodecklink: Mark internal function as static
Sebastian Dröge [Sun, 25 Oct 2020 11:14:11 +0000 (13:14 +0200)]
decklink: Mark internal function as static

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

4 years agodecklink: Remove some dead code
Sebastian Dröge [Sun, 25 Oct 2020 11:13:37 +0000 (13:13 +0200)]
decklink: Remove some dead code

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

4 years agodecklink: Update enum value bounds check in gst_decklink_get_mode()
Sebastian Dröge [Fri, 30 Oct 2020 08:02:32 +0000 (10:02 +0200)]
decklink: Update enum value bounds check in gst_decklink_get_mode()

The widescreen modes moved after GST_DECKLINK_MODE_2160p60 and using
them now would cause an assertion. This is a regression from
309f6187fef890c7ffa49305f38e89beac3b1423.

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

4 years agottmlparse: Handle whitespace before XML declaration
Chris Bass [Tue, 25 Aug 2020 13:56:50 +0000 (14:56 +0100)]
ttmlparse: Handle whitespace before XML declaration

When ttmlparse is in, e.g., an MPEG-DASH pipeline, there may be
whitespace between successive TTML documents in ttmlparse's accumulated
input. As libxml2 will fail to parse documents that have whitespace
before the opening XML declaration, ensure that any preceding whitespace
is not passed to libxml2.

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

4 years agottmlparse: Ensure only single TTML doc parsed
Chris Bass [Tue, 25 Aug 2020 13:54:31 +0000 (14:54 +0100)]
ttmlparse: Ensure only single TTML doc parsed

The parser handles only one TTML file at a time, therefore if there are
multiple TTML documets in the input, parse only the first.

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

4 years agoamc: Fix crash when encoding AVC
Xavier Claessens [Thu, 29 Oct 2020 17:43:16 +0000 (13:43 -0400)]
amc: Fix crash when encoding AVC

gstamcvideoenc.c calls gst_amc_avc_profile_to_string() with alternatives
set to NULL which causes a crash.

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

4 years agoisac: add iSAC plugin
Guillaume Desmottes [Thu, 19 Mar 2020 14:07:47 +0000 (15:07 +0100)]
isac: add iSAC plugin

Wrapper on the iSAC reference encoder and decoder from webrtc,
see https://en.wikipedia.org/wiki/Internet_Speech_Audio_Codec

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

4 years agotranscodebin: Create the decodebin in _init
Thibault Saunier [Wed, 28 Oct 2020 14:49:54 +0000 (11:49 -0300)]
transcodebin: Create the decodebin in _init

This way user can request pads right from the beginning

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

4 years agotranscodebin: Accept more than one stream
Philippe Normand [Sun, 25 Oct 2020 18:04:05 +0000 (18:04 +0000)]
transcodebin: Accept more than one stream

Look-up the stream matching the given ID also after building the stream list
from the received collection. Without this change the transcoder would discard
the second incoming stream.

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

4 years agotranscodebin: Port to decodebin3
Thibault Saunier [Fri, 20 Mar 2020 12:27:48 +0000 (09:27 -0300)]
transcodebin: Port to decodebin3

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

4 years agouritranscodebin: Move to using a urisourcebin for our source.
Thibault Saunier [Thu, 19 Mar 2020 12:35:57 +0000 (09:35 -0300)]
uritranscodebin: Move to using a urisourcebin for our source.

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

4 years agotranscoder: Base sync transcoding variant on a GMainLoop
Thibault Saunier [Thu, 19 Mar 2020 12:34:54 +0000 (09:34 -0300)]
transcoder: Base sync transcoding variant on a GMainLoop

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

4 years agowaylandsink: release frame callback when destroyed
Randy Li [Thu, 29 Oct 2020 06:13:05 +0000 (06:13 +0000)]
waylandsink: release frame callback when destroyed

We would use a frame callback from the surface to indicate
that last buffer is rendered, but when we destroy the surface
and that callback is not back yet, it may cause the wayland event
queue crash.

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

4 years agortmp2src: Set buffer timestamp on output buffer
Seungha Yang [Wed, 28 Oct 2020 10:00:43 +0000 (19:00 +0900)]
rtmp2src: Set buffer timestamp on output buffer

This timestamp information would be useful for queue2 element
when calculating time level and also it makes buffering decision
more reliable.

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

4 years agod3d11videoprocessor: Fix wrong input/output supportability check
Seungha Yang [Tue, 27 Oct 2020 15:47:49 +0000 (00:47 +0900)]
d3d11videoprocessor: Fix wrong input/output supportability check

The flag argument of ID3D11VideoProcessorEnumerator::CheckVideoProcessorFormat
method is output value, not input.

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

4 years agonvcodec: nvsldec: Add support for CUDA memory
Seungha Yang [Sat, 24 Oct 2020 17:27:52 +0000 (02:27 +0900)]
nvcodec: nvsldec: Add support for CUDA memory

Add CUDA memory support. Note that zero copying is not supported yet

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

4 years agod3d11memory: Adjust log level for some spammy debug messages
Seungha Yang [Sun, 25 Oct 2020 20:15:33 +0000 (05:15 +0900)]
d3d11memory: Adjust log level for some spammy debug messages

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

4 years agod3d11convert: Use ID3D11VideoProcessor only if device supports colorspace
Seungha Yang [Sun, 25 Oct 2020 20:11:45 +0000 (05:11 +0900)]
d3d11convert: Use ID3D11VideoProcessor only if device supports colorspace

Check whether conversion with given combination of input/output
format and dxgi colorspace is supported or not by driver.
If not, we should use shader.

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

4 years agod3d11videoprocessor: Add a method for device's conversion caps check
Seungha Yang [Sun, 25 Oct 2020 20:09:40 +0000 (05:09 +0900)]
d3d11videoprocessor: Add a method for device's conversion caps check

Add a wrapper method for
ID3D11VideoProcessorEnumerator1::CheckVideoProcessorFormatConversion.

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

4 years agod3d11format: Map more colorimetry with dxgi colorspace
Seungha Yang [Sun, 25 Oct 2020 20:04:55 +0000 (05:04 +0900)]
d3d11format: Map more colorimetry with dxgi colorspace

Map more logically identical set of GstVideoColorimetry formats
with dxgi color space.

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

4 years agova: pool: Set the video_alignment after we get image info.
He Junyan [Sun, 25 Oct 2020 15:13:46 +0000 (23:13 +0800)]
va: pool: Set the video_alignment after we get image info.

The set_format() of the allocator may change the stride of the
alloc_info. We should update the video_align.stride_align based
on it. Or, we get a warning in gst_video_meta_validate_alignment().

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

4 years agova: h264dec: Set the padding to VideoAlignment's right.
He Junyan [Mon, 26 Oct 2020 03:50:59 +0000 (11:50 +0800)]
va: h264dec: Set the padding to VideoAlignment's right.

In our va implemenation, we just use image's info to map the buffer.
The padding info just plays a role as a place holder to expand the
allocation size in caps when decoding size is bigger than display
size. So the padding_right or padding_left does not change the result.
But we find if using padding_left, it is hard to meet the requirement
of gst_video_meta_validate_alignment(), when the video meta's stride
is different from the allocation width.

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

4 years agova: basedec: No need to call base class' decide_allocation().
He Junyan [Sun, 25 Oct 2020 17:22:12 +0000 (01:22 +0800)]
va: basedec: No need to call base class' decide_allocation().

We have already done the jobs in gst_va_base_dec_decide_allocation()
and no need to call base class' decide_allocation() again. The base
class' decide_allocation() will set_format() again and let use do the
image/surface testing again, which is low performance and no needed.

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

4 years agova: allocator: use _update_image_info() to set allocator parameters.
He Junyan [Tue, 20 Oct 2020 06:31:22 +0000 (14:31 +0800)]
va: allocator: use _update_image_info() to set allocator parameters.

Use this standalone function to update the allocator info and make
all ensure_image() and mem_alloc() API clean.
We also change the default way of using image. We now set the non
derive manner as the default manner, and if it fails, then fallback
to the derived image manner.
On a lot of platforms, the derived image does not have caches, so the
read and write operations have very low performance.

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

4 years agova: allocator: Add a helper function to update the image info.
He Junyan [Tue, 20 Oct 2020 06:09:35 +0000 (14:09 +0800)]
va: allocator: Add a helper function to update the image info.

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

4 years agova: allocator: Decide the allocator's parameters when set_format().
He Junyan [Mon, 19 Oct 2020 15:32:44 +0000 (23:32 +0800)]
va: allocator: Decide the allocator's parameters when set_format().

Moving the parameters testing and setting from the allocator_alloc_full()
to the allocator_try(). The allocator_alloc_full() will be called every
time when we need to allocate a new memory. But all these parameters such
as the surface and the image format, rt_format, etc, are unchanged during
the whole allocator lifetime. Just setting them in set_format() is enough.

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

4 years agoopencv: allow compilation against 4.5.x
Nicola Murino [Sun, 18 Oct 2020 15:59:44 +0000 (17:59 +0200)]
opencv: allow compilation against 4.5.x

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

4 years agojpeg2000parse: sub-sampling parse should take component into account
Aaron Boxer [Tue, 24 Mar 2020 13:18:28 +0000 (09:18 -0400)]
jpeg2000parse: sub-sampling parse should take component into account

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

4 years agojpeg2000parse: no pts interpolation with subframe.
Stéphane Cerveau [Tue, 21 Apr 2020 12:16:45 +0000 (14:16 +0200)]
jpeg2000parse: no pts interpolation with subframe.

The jpeg2000parser must not interpolate PTS with subframes.

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

4 years agojpeg2000parse: support frame and stripe alignment in caps
Aaron Boxer [Mon, 13 Jan 2020 19:01:19 +0000 (14:01 -0500)]
jpeg2000parse: support frame and stripe alignment in caps

forward alignment and num-stripes caps properties

Use caps height when setting caps for subframe

We want downstream to use full frame height, not subframe height

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

4 years agodecklink: Reset skip counters when starting the sources
Sebastian Dröge [Sun, 25 Oct 2020 09:46:29 +0000 (11:46 +0200)]
decklink: Reset skip counters when starting the sources

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

4 years agodecklink*src: Post a warning message on the bus about dropped frames
Vivia Nikolaidou [Thu, 10 May 2018 11:05:12 +0000 (14:05 +0300)]
decklink*src: Post a warning message on the bus about dropped frames

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

4 years agodecklink*src: Aggregate dropped frame/packet logging
Georg Lippitsch [Tue, 28 Nov 2017 12:44:18 +0000 (13:44 +0100)]
decklink*src: Aggregate dropped frame/packet logging

decklink*src currently prints a log entry for every dropped frame and
audio packet. That completely spams the logs.

This change aggregates information about dropped packets and only prints
a message once when dropping starts, and a summary when dropping ends.

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

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

4 years agod3d11memory: Protect view object with lock
Seungha Yang [Sat, 24 Oct 2020 11:59:55 +0000 (20:59 +0900)]
d3d11memory: Protect view object with lock

Make resource allocation more thread-safe

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

4 years agod3d11convert: Add support for conversion using ID3D11VideoProcessor
Seungha Yang [Fri, 23 Oct 2020 17:47:22 +0000 (02:47 +0900)]
d3d11convert: Add support for conversion using ID3D11VideoProcessor

Output texture of d3d11 decoder cannot have the bind flag
D3D11_BIND_SHADER_RESOURCE (meaning that it cannot be used for shader
input resource). So d3d11convert (and it's subclasses) was copying
texture into another internal texture to use d3d11 shader.
It's obviously overhead and we can avoid texture copy for
colorspace conversion or resizing via ID3D11VideoProcessor
as it supports decoder output texture.
This commit would be a visible optimization for d3d11 decoder with
d3d11compositor use case because we can avoid texture copy per frame.

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

4 years agod3d11memory: Store ID3D11VideoProcessorOutputView object
Seungha Yang [Fri, 23 Oct 2020 17:33:29 +0000 (02:33 +0900)]
d3d11memory: Store ID3D11VideoProcessorOutputView object

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

4 years agocodecs: h265decoder: Fix picture leaks because of reference set.
He Junyan [Fri, 23 Oct 2020 14:29:57 +0000 (22:29 +0800)]
codecs: h265decoder: Fix picture leaks because of reference set.

The last frame's reference set has no one to cleanup. We need to
clean all pictures in the stop() func.
We also add a helper function to cleanup all the pictures in the
reference picture set.

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

4 years agocodecs: h265decoder: Fix 3 ref array leaks in finalize.
He Junyan [Fri, 23 Oct 2020 13:21:05 +0000 (21:21 +0800)]
codecs: h265decoder: Fix 3 ref array leaks in finalize.

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

4 years agod3d11window: Reuse ID3D11VideoProcessorInputView if possible
Seungha Yang [Fri, 23 Oct 2020 07:59:00 +0000 (16:59 +0900)]
d3d11window: Reuse ID3D11VideoProcessorInputView if possible

GstMemory object could be disposed if GstBuffer is not allocated
by GstD3D11BufferPool such as via gst_buffer_copy() and/or
gst_buffer_make_writable(). So attaching qdata on GstMemory
object would cause unnecessary view alloc/free.
By using view pool which is implemented in GstD3D11Allocator,
we can avoid redundant view alloc/free.

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

4 years agod3d11memory: Implement ID3D11VideoProcessorInputView pool
Seungha Yang [Wed, 21 Oct 2020 07:28:11 +0000 (16:28 +0900)]
d3d11memory: Implement ID3D11VideoProcessorInputView pool

Similar to ID3D11VideoDecoderOutputView pool implementation

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

4 years agoMeson: Use pkg-config generator
Xavier Claessens [Sat, 7 Apr 2018 20:33:47 +0000 (16:33 -0400)]
Meson: Use pkg-config generator

4 years agoh265decoder: Add support for l0/l1
Nicolas Dufresne [Fri, 31 Jul 2020 00:23:37 +0000 (20:23 -0400)]
h265decoder: Add support for l0/l1

Add support for reference list needed for VA-API and some V4L2 decoders.

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

4 years agoh265decoder: Sync with the H264 implementation
Nicolas Dufresne [Tue, 28 Jul 2020 22:37:38 +0000 (18:37 -0400)]
h265decoder: Sync with the H264 implementation

This ensures that we get the last reference to picture being outputed,
avoiding GstBuffer structure copies and simplifying the buffer management.

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

4 years agod3d11decoder: Directly access ID3D11VideoDecoderOutputView for decoding
Seungha Yang [Tue, 20 Oct 2020 08:31:17 +0000 (17:31 +0900)]
d3d11decoder: Directly access ID3D11VideoDecoderOutputView for decoding

Decoder output view is stored in GstD3D11Memory object instead of
wrapper struct now. So qdata is no more required.

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

4 years agod3d11memory: Implement ID3D11VideoDecoderOutputView pool
Seungha Yang [Mon, 19 Oct 2020 16:59:35 +0000 (01:59 +0900)]
d3d11memory: Implement ID3D11VideoDecoderOutputView pool

Similar to texture-array pool, we can reuse decoder output view
since the life time of output view is identical to that of texture-array.
In this way, we can avoid frequent output view alloc/free.

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

4 years agod3d11memory: Move to GArray to store texture-array status
Seungha Yang [Sun, 4 Oct 2020 14:39:05 +0000 (23:39 +0900)]
d3d11memory: Move to GArray to store texture-array status

The size D3D11_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION is 2048
which is too large in practice especially for a texture
of dpb

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

4 years agova: Add VP9 decoder
Víctor Manuel Jáquez Leal [Mon, 12 Oct 2020 17:20:10 +0000 (19:20 +0200)]
va: Add VP9 decoder

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

4 years agowpe: Convert launch lines to markdown and move since tag
Philippe Normand [Fri, 16 Oct 2020 14:46:20 +0000 (15:46 +0100)]
wpe: Convert launch lines to markdown and move since tag

Seems like the examples don't appear in the generated docs because the Since tag
was badly positioned in the doc blurb.

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

4 years agocodecs: vp9decoder: Add segmentation to picture.
Víctor Manuel Jáquez Leal [Fri, 16 Oct 2020 08:35:36 +0000 (10:35 +0200)]
codecs: vp9decoder: Add segmentation to picture.

VA-API needs AC and DC quant scales for both luma and chroma, and the loop
filter level for current frame, but these values are not available outside
the private GstVp9Parser structure. And these values may change from frame
to frame, so they are picture specific.

This patch add GstVp9Segmentation structure array to GstVp9Picture to expose
it to derived classes. This approach is safer than passing the parser at
picture handling flow.

Also, this patch, in order to solve Documentation CI, mark as private the
GstVp9Picture structure.

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

4 years agocodecs: vp9decoder: Pass parser as new_sequence() parameter.
Víctor Manuel Jáquez Leal [Mon, 12 Oct 2020 09:07:47 +0000 (11:07 +0200)]
codecs: vp9decoder: Pass parser as new_sequence() parameter.

In order to know the chroma format, besides profile, subsampling_x and
subsampling_y are needed (Spec 7.2.2 Color config semantics). These values are
in GstVp9Parser but not in  GstVp9Framehdr.

Also, bit_depth is available in parser but not frame header. Evenmore, those
values are copied to picture structure later.

In case of VA-API, to configure the pipeline, it is require to know the chroma
format and depth.

It is possible to know chroma and depth through caps coming from vp9parser, but
it requires string parsing. It would be less error prone to get these values
through the parser structure at new_sequence() virtual method.

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

4 years agortpsrc: Cleanup on BYE, timeout or when pad is reused
Nicolas Dufresne [Wed, 23 Sep 2020 20:43:30 +0000 (16:43 -0400)]
rtpsrc: Cleanup on BYE, timeout or when pad is reused

In this patch, we enabled 'autoremove' feature of rtpbin and also call
'clear-ssrc' on the rtpssrcdemux element when a pad is being reused. This
ensure that the jitterbuffer is removed and no threads accumulates.

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

4 years agortpsrc: re-use the same src pad for streams that have the same payload type
George Kiagiadakis [Fri, 4 Sep 2020 11:18:13 +0000 (14:18 +0300)]
rtpsrc: re-use the same src pad for streams that have the same payload type

Also use payload type when naming pads, this will make it easier to identify
pads and simplify the code.

Fixes #1395

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

4 years agod3d11: Introduce d3d11compositor element
Seungha Yang [Tue, 2 Jun 2020 16:26:12 +0000 (01:26 +0900)]
d3d11: Introduce d3d11compositor element

Add new video composition element which is equivalent to compositor
and glvideomixer elements. When d3d11 decoder elements are used,
d3d11compositor can do efficient graphics memory handling
(zero copying or at least copying memory on GPU memory space).

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

4 years agod3d11shader: Allow drawing without shader resource view
Seungha Yang [Wed, 5 Aug 2020 08:27:30 +0000 (17:27 +0900)]
d3d11shader: Allow drawing without shader resource view

... for the case that we are rendering on target without input texture.
For example, we might want to draw arbitrary shape on render target view
without shader resource view.

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

4 years agod3d11convert: Add new subclasses for only color convert or resize
Seungha Yang [Sun, 2 Aug 2020 18:19:34 +0000 (03:19 +0900)]
d3d11convert: Add new subclasses for only color convert or resize

New d3d11colorconvert and d3d11scale elements will perform only
colorspace conversion and rescale, respectively. Those new elements
would be useful when only colorspace conversion or rescale is required
and the other part should be done by another elements.

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

4 years agod3d11colorconverter: Allow setting alpha value to use
Seungha Yang [Sat, 1 Aug 2020 11:16:52 +0000 (20:16 +0900)]
d3d11colorconverter: Allow setting alpha value to use

... used for reordering case for now. In other words, non-alpha formats
such as NV12 is not supported case yet.

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

4 years agod3d11colorconverter: Add support conversion with blending
Seungha Yang [Tue, 2 Jun 2020 16:20:41 +0000 (01:20 +0900)]
d3d11colorconverter: Add support conversion with blending

This is pre-work for d3d11compositor support

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

4 years agod3d11colorconverter: Add method to support updating destination rect
Seungha Yang [Tue, 2 Jun 2020 15:59:15 +0000 (00:59 +0900)]
d3d11colorconverter: Add method to support updating destination rect

It's equivalent to GST_VIDEO_CONVERTER_OPT_DEST_* options of GstVideoConverter

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

4 years agod3d11: Clarify target rect to be updated
Seungha Yang [Tue, 2 Jun 2020 15:46:13 +0000 (00:46 +0900)]
d3d11: Clarify target rect to be updated

Rename internal methods to clarify which rect (i.e., input or output)
should be updated

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

4 years agonvcodec: Report latency in decoder based on max-display-delay
Julian Bouzas [Fri, 2 Oct 2020 14:02:38 +0000 (10:02 -0400)]
nvcodec: Report latency in decoder based on max-display-delay

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

4 years agonvcodec: Add max-display-delay decoder property
Julian Bouzas [Fri, 2 Oct 2020 13:22:34 +0000 (09:22 -0400)]
nvcodec: Add max-display-delay decoder property

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

4 years agonvcodec: Fix compiler error if OpenGL is not enabled
Julian Bouzas [Thu, 24 Sep 2020 15:25:33 +0000 (11:25 -0400)]
nvcodec: Fix compiler error if OpenGL is not enabled

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

4 years agonvcodec: Add missing CUDAMemory src caps in h264 decoder
Julian Bouzas [Thu, 24 Sep 2020 14:33:58 +0000 (10:33 -0400)]
nvcodec: Add missing CUDAMemory src caps in h264 decoder

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

4 years agonvcodec: Add missing CUDAMemory sink caps in h264 and h265 encoders
Julian Bouzas [Wed, 23 Sep 2020 17:49:43 +0000 (13:49 -0400)]
nvcodec: Add missing CUDAMemory sink caps in h264 and h265 encoders

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

4 years agonvcodec: Fix description of cudadownload element
Julian Bouzas [Tue, 22 Sep 2020 17:07:19 +0000 (13:07 -0400)]
nvcodec: Fix description of cudadownload element

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

4 years agotests: Add CUDA filter unit tests
Seungha Yang [Sun, 11 Aug 2019 06:02:04 +0000 (15:02 +0900)]
tests: Add CUDA filter unit tests

Adding a test for buffer meta and colorspace conversion

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

4 years agonvcodec: Add CUDA video scale element
Seungha Yang [Wed, 16 Oct 2019 13:43:09 +0000 (22:43 +0900)]
nvcodec: Add CUDA video scale element

Add new element for video resizing using CUDA

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

4 years agonvcodec: Add CUDA video convert element
Seungha Yang [Wed, 16 Oct 2019 13:42:55 +0000 (22:42 +0900)]
nvcodec: Add CUDA video convert element

Add new element for colorspace conversion using CUDA.

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

4 years agonvcodec: Add generic CUDA video convert object
Seungha Yang [Wed, 16 Oct 2019 13:42:39 +0000 (22:42 +0900)]
nvcodec: Add generic CUDA video convert object

Introducing generic video convert object similar to video-converter
but using CUDA.

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

4 years agonvcodec: Add support runtime CUDA kernel source compilation
Seungha Yang [Wed, 16 Oct 2019 13:42:24 +0000 (22:42 +0900)]
nvcodec: Add support runtime CUDA kernel source compilation

Add util functions for runtime CUDA kernel source compilation
using NVRTC library. Like other nvcodec dependent libraries,
NVRTC library will be loaded via g_module_open.

Note that the NVRTC library naming is not g_module_open friendly
on Windows.
(i.e., nvrtc64_{CUDA major version}{CUDA minor version}.dll).
So users can specify the dll name using GST_NVCODEC_NVRTC_LIBNAME
environment.

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

4 years agonvcodec: Add CUDA upload/download elements with base class for CUDA filters
Seungha Yang [Wed, 16 Oct 2019 13:42:06 +0000 (22:42 +0900)]
nvcodec: Add CUDA upload/download elements with base class for CUDA filters

Similar to glupload/gldownload elements but for CUDA memory.
It will help transfer memory between system and nvidia GPU

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

4 years agonvcodec: Peer direct access support
Seungha Yang [Wed, 16 Oct 2019 13:21:05 +0000 (22:21 +0900)]
nvcodec: Peer direct access support

If support direct access each other, use device to device memory copy
without staging host memory

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

4 years agocudacontext: Enable direct CUDA memory access over multiple GPUs
Seungha Yang [Fri, 30 Aug 2019 08:19:44 +0000 (17:19 +0900)]
cudacontext: Enable direct CUDA memory access over multiple GPUs

If each device context can access each other, enable peer access
for better interoperability.

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

4 years agonvenc: Support CUDA buffer pool
Seungha Yang [Fri, 30 Aug 2019 04:57:15 +0000 (13:57 +0900)]
nvenc: Support CUDA buffer pool

When upstream support CUDA memory (only nvdec for now), we will create
CUDA buffer pool.

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

4 years agonvdec: Support CUDA buffer pool
Seungha Yang [Fri, 30 Aug 2019 04:55:25 +0000 (13:55 +0900)]
nvdec: Support CUDA buffer pool

If downstream can accept CUDA memory caps feature (currently nvenc only),
always CUDA memory is preferred.

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

4 years agonvcodec: Add CUDA specific memory and bufferpool
Seungha Yang [Mon, 19 Aug 2019 09:02:56 +0000 (18:02 +0900)]
nvcodec: Add CUDA specific memory and bufferpool

Introducing CUDA buffer pool with generic CUDA memory support.
Likewise GL memory, any elements which are able to access CUDA device
memory directly can map this CUDA memory without upload/download
overhead via the "GST_MAP_CUDA" map flag.
Also usual GstMemory map/unmap is also possible with internal staging memory.

For staging, CUDA Host allocated memory is used (see CuMemAllocHost API).
The memory is allowing system access but has lower overhead
during GPU upload/download than normal system memory.

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

4 years agocodecparsers: h264parser: guard against ref_pic_markings overflow
Andrew Wesie [Fri, 16 Oct 2020 11:29:02 +0000 (12:29 +0100)]
codecparsers: h264parser: guard against ref_pic_markings overflow

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

4 years agohlssink2: fix and flesh out docs
Tim-Philipp Müller [Thu, 15 Oct 2020 23:48:01 +0000 (00:48 +0100)]
hlssink2: fix and flesh out docs

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

4 years agomeson: update glib minimum version to 2.56
Stéphane Cerveau [Thu, 15 Oct 2020 16:26:48 +0000 (18:26 +0200)]
meson: update glib minimum version to 2.56

In order to support the symbol g_enum_to_string in various
project using GStreamer ( gst-validate etc.), the glib minimum
version should be 2.56.0.

Remove compat code as glib requirement
is now > 2.56

Version used by Ubuntu 18.04 LTS

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

4 years agod3d11: vp8dec: No need to check show_frame flag when output_picture.
He Junyan [Sun, 11 Oct 2020 17:04:13 +0000 (01:04 +0800)]
d3d11: vp8dec: No need to check show_frame flag when output_picture.

The VP8 base class has already handled it for us.

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

4 years agocodecs: vp8decoder: handle the show_frame check in base class.
He Junyan [Sun, 11 Oct 2020 16:57:24 +0000 (00:57 +0800)]
codecs: vp8decoder: handle the show_frame check in base class.

Move the show_frame check from sub class to vp8 decoder's base class.
Calling the sub class' output_picture() function only when the frame
is displayed and marking the other automatically as decode only.

This is done to avoid logic and code repetition in subclasses.

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

4 years agocodecs: vp9decoder: handle the show_frame check in base class
Seungha Yang [Thu, 15 Oct 2020 17:06:49 +0000 (02:06 +0900)]
codecs: vp9decoder: handle the show_frame check in base class

Same as vp8 decoder update https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1670

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

4 years agov4l2codecs: vp8: Allow baseclass from skipping frames
Nicolas Dufresne [Thu, 15 Oct 2020 16:08:19 +0000 (12:08 -0400)]
v4l2codecs: vp8: Allow baseclass from skipping frames

In preparation for !1670, this will allow the base class from skipping frames
that should not be displayed. Previously it would complain about unordered
decoding taking place in the driver.

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

4 years agov4l2codecs: decoder: Unmark previously pending request
Nicolas Dufresne [Thu, 15 Oct 2020 16:05:45 +0000 (12:05 -0400)]
v4l2codecs: decoder: Unmark previously pending request

requests are executed in order, so while dequeuing sink buffers for previous
request, also mark these request as no longer pending. This will allow reusing
the request later.

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

4 years agov4l2codecs: decoder: Properly remove pending requests
Nicolas Dufresne [Thu, 15 Oct 2020 15:35:04 +0000 (11:35 -0400)]
v4l2codecs: decoder: Properly remove pending requests

Pass the pointer instead of NULL in order to find and remove properly any
pending request from the queue. This coding error was leading to use after
free in error and early exit cases.

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

4 years agova: basedec: Create the other pool anyway.
He Junyan [Wed, 14 Oct 2020 11:04:44 +0000 (19:04 +0800)]
va: basedec: Create the other pool anyway.

Fix a bug in _create_other_pool(). The old way of checking the
base->other_pool make that other_pool never be changed until the
gst_va_base_dec_stop() to stop the current decoding context.
But in some stream, the resolution may change during the decoding
process, and we need to re-negotiate the buffer pool. Then, the
old other_pool can not be clean correctly and the new correct one
can not be created.

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

4 years agova: basedec: Should unmap src frame when dst frame map failing.
He Junyan [Wed, 14 Oct 2020 08:54:54 +0000 (16:54 +0800)]
va: basedec: Should unmap src frame when dst frame map failing.

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