platform/upstream/gstreamer.git
2 years agoci: remove jenkins files which are no longer used
Tim-Philipp Müller [Mon, 21 Feb 2022 09:42:49 +0000 (09:42 +0000)]
ci: remove jenkins files which are no longer used

Fixes #1031

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1763>

2 years agortpsource: fix rtp_source_get_nack_deadlines doc
Guillaume Desmottes [Tue, 22 Feb 2022 09:13:28 +0000 (10:13 +0100)]
rtpsource: fix rtp_source_get_nack_deadlines doc

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1775>

2 years agortpbasepayload: Copy all buffer metadata instead of just GstMetas for the input meta...
Sebastian Dröge [Tue, 22 Feb 2022 08:54:23 +0000 (10:54 +0200)]
rtpbasepayload: Copy all buffer metadata instead of just GstMetas for the input meta buffer

This gives RTP header extensions some more metadata to work from.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1774>

2 years agogl: Mark GL memory GType functions as deprecated
Sebastian Dröge [Mon, 21 Feb 2022 12:23:27 +0000 (14:23 +0200)]
gl: Mark GL memory GType functions as deprecated

They can't be used in any useful way. The type of every GstMemory is
always GST_TYPE_MEMORY and the subtyping relationship has to be
implemented on top of that via the associated allocator and mem_type
string.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1764>

2 years agogl: Add `#ifndef GST_REMOVE_DEPRECATED` for existing deprecated API
Sebastian Dröge [Mon, 21 Feb 2022 13:12:04 +0000 (15:12 +0200)]
gl: Add `#ifndef GST_REMOVE_DEPRECATED` for existing deprecated API

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1764>

2 years agogl: Add versioned `Deprecated` marker to gst_gl_display_find_window
Sebastian Dröge [Mon, 21 Feb 2022 13:08:44 +0000 (15:08 +0200)]
gl: Add versioned `Deprecated` marker to gst_gl_display_find_window

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1764>

2 years agogl: Replace existing G_DEPRECATED_FOR usage with GST_GL_DEPRECATED_FOR
Sebastian Dröge [Mon, 21 Feb 2022 13:05:55 +0000 (15:05 +0200)]
gl: Replace existing G_DEPRECATED_FOR usage with GST_GL_DEPRECATED_FOR

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1764>

2 years agogl: Add GST_GL_DEPRECATED
Sebastian Dröge [Mon, 21 Feb 2022 13:02:02 +0000 (15:02 +0200)]
gl: Add GST_GL_DEPRECATED

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1764>

2 years agod3d11: Remove non-existing gst_d3d11_memory_get_type() API from header
Sebastian Dröge [Mon, 21 Feb 2022 12:17:11 +0000 (14:17 +0200)]
d3d11: Remove non-existing gst_d3d11_memory_get_type() API from header

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1764>

2 years agov4l2codecs: Support YUV420M format
Dmitry Osipenko [Mon, 14 Feb 2022 20:30:45 +0000 (23:30 +0300)]
v4l2codecs: Support YUV420M format

YUV420M format of V4L essentially is I420 with separate memory planes.
It's used by NVIDIA Tegra V4L decoder. Support this format by v4l2codecs.

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

2 years agoulpfecenc: slightly safer dispose impl
Matthew Waters [Mon, 21 Feb 2022 02:27:06 +0000 (13:27 +1100)]
ulpfecenc: slightly safer dispose impl

Technically dispose can be called more than once (even if gstelement is
not actually set up to do that) so need to protect against that.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1761>

2 years agoulpfecenc: fix unmatched free() call
Matthew Waters [Mon, 21 Feb 2022 02:24:07 +0000 (13:24 +1100)]
ulpfecenc: fix unmatched free() call

One must always match a g_slice_new with a g_slice_free and a g_new with
a g_free.  This was not the case for the internal ctx struct.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1761>

2 years agortpulpfecenc: add some debug logging
Matthew Waters [Tue, 9 Nov 2021 06:37:24 +0000 (17:37 +1100)]
rtpulpfecenc: add some debug logging

Like, what configuration we are using or whether a fec packet is
generated.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1761>

2 years agomatroska-demux: Emit a warning when no codec data found
Nirbheek Chauhan [Fri, 18 Feb 2022 09:53:13 +0000 (15:23 +0530)]
matroska-demux: Emit a warning when no codec data found

It is bad if an mkv file does not have codec data for the ProRes
variant, so we should emit a warning. ffmpeg does the same thing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1739>

2 years agoaudiovisualizer: shader: Fix dframe out of bound write
Sebastian Groß [Sun, 20 Feb 2022 13:05:05 +0000 (14:05 +0100)]
audiovisualizer: shader: Fix dframe out of bound write

shader_fade_and_move_horiz_out writes a complete stride at the end of its
dframe data

This led to SIGSEGV since the stride reached into sframe->map[0]->memory
which could not be umpapped later on.

This is due to `d` is increased twice. Once at the end of the upper loop
and at the start of the lower loop.
The corresponding dframe stride is therefore skipped.

Rewind `d` and start at the correct position.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1751>

2 years agotests/clock: avoid a race cranking
Matthew Waters [Wed, 3 Nov 2021 06:05:07 +0000 (17:05 +1100)]
tests/clock: avoid a race cranking

Scenario:
- Source 1 requesting and waiting a clock id
- Source 2 requesting and waiting on a clock id
- Test attempting to crank both sources in the same GstHarness

gst_test_clock_crank() originally dropped locks between the retrieving
of the next clock id and advancing to the next clock id.  This would
mean that both sources would race each other attempting to complete
their clock waits.  Sometimes the operations would be performed in the
correct order, other times they would not and a FALSE return value would
be produced.

This would lead to an assertion in gst_harness_push_from_src() expecting
that all clock cranks to succeed.

Fix by ensuring that the clock wait produced is dealt with before
processing the next by not dropping the relevant locks after retrieving
the next clock id.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1299>

2 years agod3d11screencapturesrc: Use staging buffer pool for performance
Seungha Yang [Sun, 20 Feb 2022 14:59:46 +0000 (23:59 +0900)]
d3d11screencapturesrc: Use staging buffer pool for performance

By using staging pool/buffer, we can avoid per frame
staging texture -> system memory copy.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1756>

2 years agodoc: Add NV12_16L32S into the cache
Nicolas Dufresne [Sun, 20 Feb 2022 20:20:07 +0000 (15:20 -0500)]
doc: Add NV12_16L32S into the cache

Autogenerated by CI

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1567>

2 years agotests: video: Add a unit test for stride extrapolation
Nicolas Dufresne [Fri, 18 Feb 2022 20:25:17 +0000 (15:25 -0500)]
tests: video: Add a unit test for stride extrapolation

This is a minimal unit test the show that the stride extrapolation can work
with all pixel format we support. This minimal verify that the extrapolation
match the stride we set into GstVideoInfo with 320x240 for all the pixel
format we support. The tiles formats are skipped, since their stride is
set as two 16bit integers, and we also skip over palette planes.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1567>

2 years agov4l2codecs: Enable MediaTek MM21 (NV12_16L32S)
Nicolas Dufresne [Wed, 26 Jan 2022 18:39:40 +0000 (13:39 -0500)]
v4l2codecs: Enable MediaTek MM21 (NV12_16L32S)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1567>

2 years agov4l2codecs: Add support for multi planar buffers
Nicolas Dufresne [Wed, 19 Jan 2022 20:53:05 +0000 (15:53 -0500)]
v4l2codecs: Add support for multi planar buffers

V4L2 have some pixel formats that produces 2 dmabuf, this add
support for these format.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1567>

2 years agov4l2transform: Handle caps changes
Nicolas Dufresne [Wed, 26 Jan 2022 15:06:50 +0000 (10:06 -0500)]
v4l2transform: Handle caps changes

As this element is single threaded, we only need to stop the objects to
allow changing the format again. Fixes assertion notably on shutdown and
on some other situation where the format may be set twice without
actually activating the element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1567>

2 years agov4l2object: Avoid crash on early failure
Nicolas Dufresne [Wed, 26 Jan 2022 14:55:09 +0000 (09:55 -0500)]
v4l2object: Avoid crash on early failure

This happens while an external error lead to an early shutdown.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1567>

2 years agovideo4linux2: Add MM21 support
Nicolas Dufresne [Tue, 25 Jan 2022 19:34:32 +0000 (14:34 -0500)]
video4linux2: Add MM21 support

This enables mtk-vcodec and MDP driver from mainline Linux kernel.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1567>

2 years agoPort plugins to gst_video_format_info_extrapolate_stride()
Nicolas Dufresne [Tue, 25 Jan 2022 19:08:47 +0000 (14:08 -0500)]
Port plugins to gst_video_format_info_extrapolate_stride()

This reduces code duplication and simplify addition of new
pixel formats into related plugins.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1567>

2 years agovideo: Add an helper to extrapolate strides
Nicolas Dufresne [Tue, 25 Jan 2022 19:04:13 +0000 (14:04 -0500)]
video: Add an helper to extrapolate strides

Many of the legacy APIs, specifically in the Linux Kernel, have a
single stride for the pictures. In this context, it is common
to extrapolate the other strides based on the selected pixel
format. Such function have been copy pasted from video4linux2
plugin into wayland, kms and v4l2codecs plugins.

This patch implements a generalized from of that function and
make it available to everyone through the video library.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1567>

2 years agovideo: Add NV12_16L32S aka Mediatek MM21 support
Nicolas Dufresne [Fri, 3 Dec 2021 02:46:59 +0000 (21:46 -0500)]
video: Add NV12_16L32S aka Mediatek MM21 support

Unlike other simple tiled formats, the Mediatek HW use different tile size
per-plane. The tile size is scaled according to the subsampling. Effectively,
using the name 16L32S to represent linearly layout tiles of size 16x32 bytes
in the Y plane, and 16x16 in the UV plane. In order to make this specificity
discoverable, a new SUBTILES flags have been added.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1567>

2 years agogstv4l2tuner: return NULL if no norm set
Rouven Czerwinski [Wed, 2 Feb 2022 11:49:29 +0000 (12:49 +0100)]
gstv4l2tuner: return NULL if no norm set

If the video4linux device supports norms but has no norm set, norm is
returned as an uninitialized variable after the ioctl call, leading to
gst_v4l2_tuner_get_norm_by_std_id() returning a random norm from the
supported norms. Catch this case and instead return NULL to indicate
that no norm is setup.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1625>

2 years agowinscreencap: Remove dxgiscreencapsrc element
Seungha Yang [Sat, 19 Feb 2022 21:36:45 +0000 (06:36 +0900)]
winscreencap: Remove dxgiscreencapsrc element

We have the d3d11screencapturesrc element in d3d11 plugin
which is obviously better than this element in terms of performance
and design, so we don't need to make people be confused by two separate elements.

Let's pick the better implementation and remove unnecessary one.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1750>

2 years agowpe: Clean up build script
Jan Alexander Steffens (heftig) [Tue, 8 Feb 2022 14:23:17 +0000 (15:23 +0100)]
wpe: Clean up build script

Use feature.require to check for gstgl and exit early if 'wpe' is
disabled (don't even check for wpe-webkit-1.1).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1668>

2 years agodirectshow: Fix build warnings
Seungha Yang [Fri, 18 Feb 2022 15:37:34 +0000 (00:37 +0900)]
directshow: Fix build warnings

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1744>

2 years agodirectshow: Merge plugins into single directshow plugin
Seungha Yang [Fri, 18 Feb 2022 15:14:38 +0000 (00:14 +0900)]
directshow: Merge plugins into single directshow plugin

... and lower rank of dshowvideosink and dshowdeviceprovider
to GST_RANK_MARGINAL since we don't prefer this plugin
by default

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1744>

2 years agodirectshow: Remove white spaces
Seungha Yang [Fri, 18 Feb 2022 15:12:55 +0000 (00:12 +0900)]
directshow: Remove white spaces

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1744>

2 years agovulkanshaderspv: SPIRV based filter
Martin Reboredo [Tue, 19 Oct 2021 19:10:06 +0000 (16:10 -0300)]
vulkanshaderspv: SPIRV based filter

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1197>

2 years agoscenarios: Update for videoaggregator rounding behavior change
Seungha Yang [Fri, 18 Feb 2022 18:26:00 +0000 (03:26 +0900)]
scenarios: Update for videoaggregator rounding behavior change

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1747>

2 years agovideoaggregator: Use floor() to calculate current position
Seungha Yang [Fri, 18 Feb 2022 16:58:20 +0000 (01:58 +0900)]
videoaggregator: Use floor() to calculate current position

... instead of round(). Depending on framerate, calculated position
may not be clearly represented by using uint64, 30000/1001 for example.
Then the result of round() can be sliglhtly larger (1ns) than
buffer timestamp. And that will cause unnecessary frame delay.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1747>

2 years agov4l2codecs: vp9: Fix reset_frame_context parameter
Nicolas Dufresne [Fri, 18 Feb 2022 21:23:09 +0000 (16:23 -0500)]
v4l2codecs: vp9: Fix reset_frame_context parameter

It was assumed that the kernel parameters would match with the bitstream value
but instead the author when with another set of value. Surprisingly, this
makes no difference with the resulting fluster score.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1748>

2 years agov4l2codecs: vp9: Only fill compressed headers if needed
Nicolas Dufresne [Fri, 18 Feb 2022 21:02:27 +0000 (16:02 -0500)]
v4l2codecs: vp9: Only fill compressed headers if needed

Fixes: 13944cf3ee871722 ("v4l2codecs: vp9: Make compressed hdr control optional")
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1748>

2 years agov4l2: include <sys/ioccom.h> on Illumos
Tim Mooney [Sat, 15 Jan 2022 05:42:27 +0000 (23:42 -0600)]
v4l2: include <sys/ioccom.h> on Illumos

Needed for _IOR/_IORW

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1524>

2 years agodoc: Fix doc comment for GstChildProxy
Nicolas Dufresne [Tue, 2 Nov 2021 19:58:49 +0000 (15:58 -0400)]
doc: Fix doc comment for GstChildProxy

This removes warning like:

../subprojects/gstreamer/gst/gstchildproxy.h:57: Error: Gst: identifier not found on the first line:
   * #GstChildProxyInterface::get_child_by_name:
     ^

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1297>

2 years agobase: audioencoder: Keep serialize event behind buffers
Nicolas Dufresne [Thu, 28 Oct 2021 21:09:34 +0000 (17:09 -0400)]
base: audioencoder: Keep serialize event behind buffers

If a serialized event arrives behind a buffer, it should not be send before
it. This fixes the pending event handling so that only early pending events,
the one that arrrived or was generated while the adapter was empty get send
before pushing buffer. All other events are not pushed after.

This issue lead the latency tracer to think our audio encoder did not have any
latency. This was testing with opusenc in a live pipeline.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1266>

2 years agoAdd build files and fix build for gst-plugins-bad dshowsinkwrapper plugin
Loic Le Page [Wed, 26 Jan 2022 20:06:45 +0000 (21:06 +0100)]
Add build files and fix build for gst-plugins-bad dshowsinkwrapper plugin

dshowsinkwrapper plugin is the old dshowvideosink plugin that has been
renamed to be compliant with the actuel plugin name in the source code.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1577>

2 years agoAdd build files and fix build for gst-plugins-bad dshowsrcwrapper plugin
Loic Le Page [Wed, 26 Jan 2022 20:03:10 +0000 (21:03 +0100)]
Add build files and fix build for gst-plugins-bad dshowsrcwrapper plugin

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1577>

2 years agoAdd build files and fix build for gst-plugins-bad dshowdecwrapper plugin
Loic Le Page [Wed, 26 Jan 2022 19:58:12 +0000 (20:58 +0100)]
Add build files and fix build for gst-plugins-bad dshowdecwrapper plugin

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1577>

2 years agoAdd directshow strmbase library source code from Microsoft repo
Loic Le Page [Wed, 26 Jan 2022 19:43:09 +0000 (20:43 +0100)]
Add directshow strmbase library source code from Microsoft repo

Original repo is here:
https://github.com/microsoft/Windows-classic-samples

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1577>

2 years agoMove all directshow plugins to the same sub-folder
Loïc Le Page [Wed, 16 Feb 2022 13:53:12 +0000 (14:53 +0100)]
Move all directshow plugins to the same sub-folder

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1577>

2 years agomatroska: default prores fourcc apcn
Sebastian Wick [Thu, 17 Feb 2022 16:36:22 +0000 (17:36 +0100)]
matroska: default prores fourcc apcn

If there is no codec private data for prores it should default to Apple
ProRes 422 Standard Definition (apcn). Can be tested with
strobe_scientist.mkv from
https://developers.google.com/media/vp9/hdr-encoding

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1734>

2 years agoqtdemux: Do not send unnecessary GAP events
Seungha Yang [Tue, 16 Nov 2021 08:35:25 +0000 (17:35 +0900)]
qtdemux: Do not send unnecessary GAP events

Each stream may have its own segment timeline
(i.g., different segment.start or segment.base)
depending on edit-list and composition-to-decode atom.

Make sure whether time position of a stream has been actually
far behind than that of current target stream.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1352>

2 years agomeson: check for libsocket and libnsl
Tim Mooney [Sat, 15 Jan 2022 06:04:05 +0000 (00:04 -0600)]
meson: check for libsocket and libnsl

If present, add '-lsocket' and '-lnsl' to network_deps.

ext/curl/meson.build: add network_deps to dependencies
gst/festival/meson.build: same
sys/shm/meson.build: same

Fixes linking issues on Illumos distros.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1525>

2 years agovaapioverlay: inline sinkpad scaling support
Haihao Xiang [Sat, 20 Nov 2021 02:47:24 +0000 (18:47 -0800)]
vaapioverlay: inline sinkpad scaling support

Often, users will need to scale inputs (e.g.
with vaapipostproc) before they are submitted
to the vaapioverlay.  However, this results in
multiple VPP passes/operations in the pipeline
which creates unnecessary process overhead.

This change allows for inputs to be submitted
at original scale to vaapioverlay with per-sinkpad
scale dimensions specified so they can be scaled
and blended/composited in a single VPP pass/operation
to avoid the unnecessary process overhead.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1380>

2 years agovaapioverlay: use vpp blend state iif using alpha
U. Artie Eoff [Fri, 19 Nov 2021 22:46:34 +0000 (14:46 -0800)]
vaapioverlay: use vpp blend state iif using alpha

Don't set VAAPI vpp blend flags if alpha == 1.0,
i.e. fully opaque.  This can avoid extra processing
overhead on some drivers that apply blending
unconditionally when flags are present, even if the
end result is the same without blend flags (i.e. all
opaque alpha channels).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1380>

2 years agod3d11: Add support for AYUV, AYUV64, and RGBA64_LE formats
Seungha Yang [Mon, 14 Feb 2022 13:59:01 +0000 (22:59 +0900)]
d3d11: Add support for AYUV, AYUV64, and RGBA64_LE formats

Note that AYUV and AYUV64 formats will be used to expand format
support, especially some packed YUV formats (e.g., Y410, YUY2)
are common DXGI formats used for hardware decoder/encoder on Windows
but those formats cannot be used as a render target. We need to handle
them differently without pixel shader help, using compute shader
for example.

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

2 years agod3d11: Reorganize format mapping table
Seungha Yang [Sun, 13 Feb 2022 11:32:48 +0000 (20:32 +0900)]
d3d11: Reorganize format mapping table

... and handle GST <-> D3D11 format mapping in a single place to
make adding format easier

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

2 years agod3d11: Store device format in struct
Seungha Yang [Sat, 12 Feb 2022 19:36:39 +0000 (04:36 +0900)]
d3d11: Store device format in struct

Holding pointer to struct was unsafe approach because
the pointer to d3d11 format will be invalidated once d3d11 device
object is released

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

2 years agogstinfo,ptpclock,libcheck: Use GetCurrentProcessId() instead of getpid() on Windows
Seungha Yang [Sun, 6 Feb 2022 13:54:42 +0000 (22:54 +0900)]
gstinfo,ptpclock,libcheck: Use GetCurrentProcessId() instead of getpid() on Windows

getpid() shouldn't be used in case of UWP. Use GetCurrentProcessId()
instead which provides exactly the same functionality and can be
used with UWP as well.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1006>

2 years agocheck: Disable some tests if pipe() is unavailable for UWP build
Seungha Yang [Sun, 6 Feb 2022 17:49:15 +0000 (02:49 +0900)]
check: Disable some tests if pipe() is unavailable for UWP build

pipe() and _pipe() are not allowed on UWP

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1006>

2 years agomeson: Do hard build error for some MSVC warnings
Seungha Yang [Fri, 1 Oct 2021 11:27:28 +0000 (20:27 +0900)]
meson: Do hard build error for some MSVC warnings

Handle various MSVC warnings as errors for development version.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1006>

2 years agoRemove some trailing white spaces
Seungha Yang [Tue, 8 Feb 2022 14:30:00 +0000 (23:30 +0900)]
Remove some trailing white spaces

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1006>

2 years agov4l2codecs: h264: Correct scaling matrix ABI check
Dmitry Osipenko [Mon, 14 Feb 2022 13:18:54 +0000 (16:18 +0300)]
v4l2codecs: h264: Correct scaling matrix ABI check

Scaling matrix V4L UAPI control not presents on NVIDIA Tegra, the default
matrix should be used in this case. Mark scaling matrix presence optional.

Fixes: 47bfa71530c ("v4l2codecs: h264: Improve ABI check ")
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1726>

2 years agomsdkdec: Enable SFC scaling for AVC and HEVC
Mengkejiergeli Ba [Fri, 21 Jan 2022 07:32:09 +0000 (15:32 +0800)]
msdkdec: Enable SFC scaling for AVC and HEVC

Decoder SFC only supports down-scaling at most to 1/8.
For example, given a 4K bistream, SFC can scale it to 1080p via:
"msdkh265dec ! video/x-raw,width=1920,height=1080 ! glimagesink"

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1444>

2 years agomsdkdec: Enable SFC csc for AVC and HEVC
Mengkejiergeli Ba [Wed, 15 Dec 2021 03:49:40 +0000 (11:49 +0800)]
msdkdec: Enable SFC csc for AVC and HEVC

Decoder SFC will be triggered when default output format is not accept at
downstream. One use case below can work without using msdkvpp:
"! msdkh265dec ! "video/x-raw,format=BGRA" ! glimagesink",

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1444>

2 years agomsdkdec: Add SFC codes
Mengkejiergeli Ba [Wed, 17 Nov 2021 09:05:09 +0000 (17:05 +0800)]
msdkdec: Add SFC codes

SFC refers to Scaler Format Converter, more details here:
https://01.org/sites/default/files/documentation/intel-gfx-prm-osrc-kbl-vol15-sfc.pdf
By attaching mfxExtDecVideoProcessing buffer to mfxVideoParam, decoder
can do SFC for csc and scaling.

MSDK will check if surface bitdepth equals to input when no SFC is
triggered, which means in the case of SFC, there is no need to update
surface bitdepth via gst_msdk_update_mfx_frame_info_from_mfx_video_param.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1444>

2 years agosubprojects: Switch gst-plugins-rs.wrap to the main branch
Sebastian Dröge [Wed, 16 Feb 2022 07:54:07 +0000 (09:54 +0200)]
subprojects: Switch gst-plugins-rs.wrap to the main branch

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1725>

2 years agod3d11converter: Fix for missing GRAY conversion
Seungha Yang [Tue, 15 Feb 2022 17:23:58 +0000 (02:23 +0900)]
d3d11converter: Fix for missing GRAY conversion

Add missing Y410 -> GRAY and GRAY -> semi-planar conversion

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1724>

2 years agod3d11converter: Don't use FIXME_OBJECT for non-GstObject
Seungha Yang [Tue, 15 Feb 2022 17:11:53 +0000 (02:11 +0900)]
d3d11converter: Don't use FIXME_OBJECT for non-GstObject

... and print ERROR messages for unexpected input/output formats

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1724>

2 years agoqtmux: Don't post an error message if pushing a sample failed with FLUSHING
Sebastian Dröge [Thu, 8 Apr 2021 09:18:09 +0000 (12:18 +0300)]
qtmux: Don't post an error message if pushing a sample failed with FLUSHING

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1711>

2 years agova: Delete the display lock/unlock when we call VA-API.
He Junyan [Wed, 10 Nov 2021 07:18:24 +0000 (15:18 +0800)]
va: Delete the display lock/unlock when we call VA-API.

According to the VA-API's description, they are MT-safe, we do not
need to care about that in our middleware layer. The lock/unlock
operations have overhead and make the performance lower.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1333>

2 years agoopenaptx: Support libfreeaptx
Jan Alexander Steffens (heftig) [Tue, 8 Feb 2022 14:22:39 +0000 (15:22 +0100)]
openaptx: Support libfreeaptx

[libfreeaptx][1] is a fork of libopenapt 0.2.0, used by pipewire.

[1]: https://github.com/iamthehorker/libfreeaptx

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1642
Closes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1589
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1667>

2 years agoci: Increase cerbero trigger timeout to 3h
Nirbheek Chauhan [Mon, 14 Feb 2022 23:28:13 +0000 (04:58 +0530)]
ci: Increase cerbero trigger timeout to 3h

All cerbero jobs explicitly override the default project timeout from
1h to 3h, so this should also be 3h. It is quite common for cerbero
trigger jobs to timeout due to slow download speeds from the artifact
server to FDO gitlab.

https://gitlab.freedesktop.org/heirecka/gstreamer/-/jobs/18803342
https://gitlab.freedesktop.org/gstreamer/cerbero/-/jobs/18803360

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1686>

2 years agomeson: Don't build lame plugin with -Dlame=disabled
Heiko Becker [Fri, 11 Feb 2022 20:35:54 +0000 (21:35 +0100)]
meson: Don't build lame plugin with -Dlame=disabled

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1686>

2 years agod3d11converter: Fix RGB to GRAY conversion
Seungha Yang [Mon, 14 Feb 2022 17:26:46 +0000 (02:26 +0900)]
d3d11converter: Fix RGB to GRAY conversion

Fix typo in shader code

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

2 years agotsdemux: unlock mutex on -1 start_offfset
Stéphane Cerveau [Mon, 14 Feb 2022 11:57:44 +0000 (12:57 +0100)]
tsdemux: unlock mutex on -1 start_offfset

Closing #1013

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1694>

2 years agod3d11download: Fix decide_allocation
Seungha Yang [Sun, 13 Feb 2022 13:39:46 +0000 (22:39 +0900)]
d3d11download: Fix decide_allocation

Caps should be parsed in any cases.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1691>

2 years agovaapi: Use meson's features for option selection.
Víctor Manuel Jáquez Leal [Wed, 9 Feb 2022 05:01:34 +0000 (06:01 +0100)]
vaapi: Use meson's features for option selection.

Modernize option selection, so if a required dependency is missing,
produce a meaningful error message.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1676>

2 years agomeson: va: Add va option check into plugin's build.
He Junyan [Sun, 13 Feb 2022 02:49:31 +0000 (10:49 +0800)]
meson: va: Add va option check into plugin's build.

Because the liblibgstva is built unconditionally, we now move the
va option check into va plugin's build.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1685>

2 years agomeson: va: Remove va option check from gst-libs
He Junyan [Sun, 13 Feb 2022 02:39:37 +0000 (10:39 +0800)]
meson: va: Remove va option check from gst-libs

 Building libgstva-1.0 unconditionally for the va implementation can be
 used by non-va plugins such as MSDK even when va plugin is disabled

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1685>

2 years agodtlstransport: Notify ICE transport property changes
Philippe Normand [Sat, 12 Feb 2022 10:05:11 +0000 (10:05 +0000)]
dtlstransport: Notify ICE transport property changes

The application might track the underlying ICE transport, so not notifying
changes might lead to use-after-free issues.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1688>

2 years agojpegdec: Pull row_stride from GST_VIDEO_FRAME_PLANE_STRIDE()
Marek Vasut [Fri, 11 Feb 2022 22:55:57 +0000 (23:55 +0100)]
jpegdec: Pull row_stride from GST_VIDEO_FRAME_PLANE_STRIDE()

The libjpeg-turbo internal state might not be correctly initialized for
the first frame in a stream, pull the frame stride from gstreamer frame
metadata instead, which is correct even for the first frame, and which
makes this code consistent with the surrounding lines.

Fixes: e6d83d8f96 ("jpegdec: Support libjpeg-turbo colorspace conversion")
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1687>

2 years agojpegdec: Call gst_jpeg_turbo_parse_ext_fmt_convert() before jpeg_start_decompress()
Marek Vasut [Fri, 11 Feb 2022 22:44:24 +0000 (23:44 +0100)]
jpegdec: Call gst_jpeg_turbo_parse_ext_fmt_convert() before jpeg_start_decompress()

It is imperative that the libjpeg-turbo state is properly initialized
before jpeg_start_decompress() is called. Make sure cinfo.out_color_space
and cinfo.raw_data_out are set to their final values matching their peer
caps before calling jpeg_start_decompress().

Fixes: e6d83d8f96 ("jpegdec: Support libjpeg-turbo colorspace conversion")
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1687>

2 years agojpegdec: Factor out gst_jpeg_turbo_parse_ext_fmt_convert()
Marek Vasut [Fri, 11 Feb 2022 22:44:20 +0000 (23:44 +0100)]
jpegdec: Factor out gst_jpeg_turbo_parse_ext_fmt_convert()

Pull out peer caps checking code into gst_jpeg_turbo_parse_ext_fmt_convert().
This code is used by libjpeg-turbo extras to determine whether peer is capable
of handling buffers into which libjpeg-turbo can directly decode data. This
kind of check must be performed before jpeg_start_decompress() is called in
gst_jpeg_dec_prepare_decode() as well as in gst_jpeg_dec_negotiate(), hence
the common code.

This commit does modify the code a little to make it easier to call from both
call sites without much duplication, hence the extra `if (*clrspc)` test.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1687>

2 years agoRevert "jpegdec: only allow conversions from RGB"
Marek Vasut [Fri, 11 Feb 2022 22:29:27 +0000 (23:29 +0100)]
Revert "jpegdec: only allow conversions from RGB"

This reverts commit 2aa2477208c029b0e1b8232d69f4f99a3bf1d473.
The commit is completely wrong, libjpeg-turbo is perfectly capable
of decoding I420 (YUV) to RGB. The test case provided alongside the
aforementioned commit passes without this revert because it decodes
image of JCS_YCrCb color space, so the new `if (clrspc == JCS_RGB)`
condition is false on that image, and the libjpeg-turbo decoding
does not get used. The real bug is hidden by that commit.

The real problem is in the call order of gst_jpeg_dec_prepare_decode()
and gst_jpeg_dec_negotiate(). The gst_jpeg_dec_prepare_decode() calls
jpeg_start_decompress() which sets up internal state of the libjpeg,
however, neither cinfo.out_color_space nor cinfo.raw_data_out are
set correctly yet. Those two are set up in gst_jpeg_dec_negotiate()
which is called a bit later. Therefore, the real fix is the set up
cinfo.out_color_space and cinfo.raw_data_out before calling
jpeg_start_decompress(). This is however a separate patch.

Fixes: 2aa2477208 ("jpegdec: only allow conversions from RGB")
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1687>

2 years agovavpp: Fix the caps leak in the transform_caps() function.
He Junyan [Sat, 12 Feb 2022 06:51:51 +0000 (14:51 +0800)]
vavpp: Fix the caps leak in the transform_caps() function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1689>

2 years agomeson: d3d11: Remove d3d11 option check from gst-libs
Seungha Yang [Fri, 11 Feb 2022 15:51:56 +0000 (00:51 +0900)]
meson: d3d11: Remove d3d11 option check from gst-libs

Build gstd3d11-1.0 unconditionally for d3d11 implementation can be used
by non-d3d11 plugins even when d3d11 plugin is disabled

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1684>

2 years agod3d11: Update build-time dependency
Seungha Yang [Thu, 10 Feb 2022 13:31:06 +0000 (22:31 +0900)]
d3d11: Update build-time dependency

Remove all the d3d11 and dxgi header version dependent ifdef
and bump the minimum requirement to d3d11_4.h and dxgi1_6.h.
We are already failing support old Visual Studio (Windows SDK actually)
such as Visual Studio 2015. Note that our MinGW toolchain satisfies
the requirement.

From runtime point of view, this change should be fine since
we are checking OS version with IUnknown::QueryInterface()
everywhere in order to check API availability

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1684>

2 years agovideoaggregator: Fix for unhandled negative rate
Seungha Yang [Fri, 7 Jan 2022 11:02:46 +0000 (20:02 +0900)]
videoaggregator: Fix for unhandled negative rate

Nagative rates have been considered only in
gst_video_aggregator_advance_on_timeout(). Update other places
to fix broken reverse playback.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1500>

2 years agotypefindfunctions: Fix WebVTT format detection
Seungha Yang [Wed, 25 Aug 2021 11:18:20 +0000 (20:18 +0900)]
typefindfunctions: Fix WebVTT format detection

If WebVTT file consists of "WebVTT" header without body,
the file size can be smaller than 10 bytes.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1359>

2 years agonavigation: add more constructors for navigation events
Vivienne Watermeier [Mon, 31 Jan 2022 12:01:10 +0000 (13:01 +0100)]
navigation: add more constructors for navigation events

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1610>

2 years agoMSDK: Import VA surface as encoder's input.
He Junyan [Sat, 8 May 2021 09:54:34 +0000 (17:54 +0800)]
MSDK: Import VA surface as encoder's input.

We make all MSDK encoders declare "memory:VAMemory" feature. Then
the pipeline such as:
  gst-launch-1.0 -vf filesrc location=xxx.h264 ! h264parse ! \
       vah264dec ! msdkh265enc ! fakesink
will choose VA memory caps between the VA decoder and MSDK encoder.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1087>

2 years agoMSDK: Add helper function to peek VA surface of VA kind gstbuffer.
He Junyan [Sat, 8 May 2021 09:26:27 +0000 (17:26 +0800)]
MSDK: Add helper function to peek VA surface of VA kind gstbuffer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1087>

2 years agoMSDK: Handle context query into the encoder's query function.
He Junyan [Sat, 8 May 2021 07:51:11 +0000 (15:51 +0800)]
MSDK: Handle context query into the encoder's query function.

The MSDK encoder's query function is not set and it just forwards
all query to its base class. We now need to answer the context
query correctly. Other VA plugins need to query the VA display.

By the way, the current query of "gst.msdk.Context" is also missing.
The other MSDK elements must depend on the bin's context message(
sent in context_propagate()) to set their MsdkContext correctly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1087>

2 years agoMSDK: Handle context query into the VPP's query function.
He Junyan [Tue, 17 Aug 2021 14:36:59 +0000 (22:36 +0800)]
MSDK: Handle context query into the VPP's query function.

The MSDK VPP's query function is not set and it just forwards
all query to its base class. We now need to answer the context
query correctly. Other VA plugins need to query the VA display.

By the way, the current query of "gst.msdk.Context" is also missing.
The other MSDK elements must depend on the bin's context message(
sent in context_propagate()) to set their MsdkContext correctly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1087>

2 years agoMSDK: Handle context query into the decoder's query function.
He Junyan [Tue, 17 Aug 2021 14:34:43 +0000 (22:34 +0800)]
MSDK: Handle context query into the decoder's query function.

The MSDK decoder's query function is not set and it just forwards
all query to its base class. We now need to answer the context
query correctly. Other VA plugins need to query the VA display.

By the way, the current query of "gst.msdk.Context" is also missing.
The other MSDK elements must depend on the bin's context message(
sent in context_propagate()) to set their MsdkContext correctly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1087>

2 years agoMSDK: Add a handle_context_query() helper function.
He Junyan [Tue, 17 Aug 2021 14:33:18 +0000 (22:33 +0800)]
MSDK: Add a handle_context_query() helper function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1087>

2 years agoMSDK: Improve the GstContext setting logic.
He Junyan [Tue, 17 Aug 2021 13:51:58 +0000 (21:51 +0800)]
MSDK: Improve the GstContext setting logic.

We now can use the gst va lib's display to create our MSDK context,
and use its helper functions to simplify our code. The improved logic
is like this:
1. Every MSDK element should use gst_msdk_context_find() to find a MSDK
context from neighbour. If valid, reuse it.
2. Use gst_msdk_ensure_new_context(). It will first query neighbours
about the GstVaDisplay, if found(e.g. some VA element is connected),
use gst_msdk_context_from_external_display() to create a MSDK context.
3. Then, creating the MSDK context from scratch. It creates both the
display and MSDK context.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1087>

2 years agoMSDK: Add new_with_va_display() helper function to create context.
He Junyan [Sat, 8 May 2021 05:49:23 +0000 (13:49 +0800)]
MSDK: Add new_with_va_display() helper function to create context.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1087>

2 years agoMSDK: Use the VA display object to replace the raw display handle.
He Junyan [Sat, 8 May 2021 03:44:57 +0000 (11:44 +0800)]
MSDK: Use the VA display object to replace the raw display handle.

The VA display object from VA lib is a common defined object. which
contain the whole display things. It is easier to use, and more important,
we can share it with the other VA plugins and keep all the VA related
plugins working on the same GPU device.
We also delete the useless gst_msdk_context_get_fd() API.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1087>

2 years agoMSDK: Add the gst va lib into MSDK's dependency.
He Junyan [Fri, 11 Feb 2022 03:11:03 +0000 (11:11 +0800)]
MSDK: Add the gst va lib into MSDK's dependency.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1087>

2 years agoav1parse: Add temporal unit check when TD is absent.
He Junyan [Thu, 10 Feb 2022 04:52:30 +0000 (12:52 +0800)]
av1parse: Add temporal unit check when TD is absent.

The current manner for deciding the new temporal unit is based on
temporal delimiter(TD) OBU. We only start a new temporal unit when
the TD comes.
But some streams do not have TD at all, which makes the output "TU"
alignment fail to work. We now add check based on the relationship
between the different layers and it can successfully judge the TU edge.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1634>

2 years agoav1parse: let the parse continue when MISSING_OBU_REFERENCE error.
He Junyan [Fri, 4 Feb 2022 09:12:15 +0000 (17:12 +0800)]
av1parse: let the parse continue when MISSING_OBU_REFERENCE error.

Some streams may have verbose OBUs before a valid sequence header. We
should let the parse continue rather than return a error.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1634>

2 years agoav1parse: Continue when we fail to detect the alignment.
He Junyan [Fri, 4 Feb 2022 03:40:18 +0000 (11:40 +0800)]
av1parse: Continue when we fail to detect the alignment.

Some streams may have problematic OBUs at the beginning, which causes
the parse fail to detect the alignment and return error. For example,
there may be verbose OBUs before a valid sequence, which should be
discarded until we meet a valid sequence. We should let the parse
continue when we meet such cases, rather than just return error.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1634>