platform/upstream/gstreamer.git
18 months agodash: mpdclient: fix divide by 0 if segment has no duration
Guillaume Desmottes [Mon, 17 Apr 2023 09:36:55 +0000 (11:36 +0200)]
dash: mpdclient: fix divide by 0 if segment has no duration

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

18 months agod3d11compositor: Reconfigure resource only when output caps is changed
Seungha Yang [Mon, 17 Apr 2023 14:06:54 +0000 (23:06 +0900)]
d3d11compositor: Reconfigure resource only when output caps is changed

GstD3D11Converter setup is heavy operation since it requires
shader compile, GPU resource allocation, some math, mutex, etc.
We can avoid it if negotiated caps is not changed.

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

18 months agoqtdemux: Fix av1C parsing
Edward Hervey [Mon, 17 Apr 2023 07:28:43 +0000 (09:28 +0200)]
qtdemux: Fix av1C parsing

This is a regression introduced by
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3882

The av1c codec configuration parsing would always fail due to an off-by-one
error, the content of an atom starting at offset 8 (i.e. the 9th byte) and not
9 (the 10th byte).

Also introduce a break in order to not get stray warnings

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

18 months agomultifile: error out if no filename was set
Tim-Philipp Müller [Wed, 12 Apr 2023 11:47:02 +0000 (12:47 +0100)]
multifile: error out if no filename was set

Fixes #2483

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

18 months agoqtwindow: unref caps in destructor
Matthias Fuchs [Thu, 6 Apr 2023 06:55:46 +0000 (08:55 +0200)]
qtwindow: unref caps in destructor

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

18 months agov4l2: Fix use after free of fmtdesc part 2
Nicolas Dufresne [Wed, 12 Apr 2023 21:18:13 +0000 (17:18 -0400)]
v4l2: Fix use after free of fmtdesc part 2

Add missing code in merge commit e890e6e8d8bd
("v4l2: Fix use after free of fmtdesc"). The v4l2object code was
missing.

Related to https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4317

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

18 months agov4l2: Fix use after free of fmtdesc
Nicolas Dufresne [Wed, 12 Apr 2023 21:18:13 +0000 (17:18 -0400)]
v4l2: Fix use after free of fmtdesc

The decoder needs to force another enumeration of the format. For
this it was clearing the v4l2object insternal list, leaving a fmtdesc
pointer pointing to freed memory. This patch clears the fmtdesc pointer
that has just been free. It also makes sure the probe function does not
use the cached formats list. The probe function will restore the current
fmtdesc pointer based on the currently configured pixelformat.

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

18 months agov4l2: videodec: Prefer acquired caps over anything downstream
Nicolas Dufresne [Fri, 31 Mar 2023 14:32:54 +0000 (10:32 -0400)]
v4l2: videodec: Prefer acquired caps over anything downstream

As we don't have anything smart in the fixation process, we may endup with
a format that has a lower bitdepth, even if downstream can handle higher
depth. it is notably the case when negotiating with deinterlace, which places
is non-passthrough caps before its passthrough one. This makes the generic
fixation prefer the formats natively supported by deinterlace element over
the HW 10bit format. As some HW can downscale 10bit to 8bit, this can break
10bit decoding.

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

18 months agov4l2: videodec: Remove leading space in comment
Nicolas Dufresne [Fri, 31 Mar 2023 14:31:07 +0000 (10:31 -0400)]
v4l2: videodec: Remove leading space in comment

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

18 months agotests: allocators: Fix fdmem test with recent GLib
Jan Alexander Steffens (heftig) [Mon, 10 Apr 2023 14:06:19 +0000 (16:06 +0200)]
tests: allocators: Fix fdmem test with recent GLib

The test failed with recent GLib, where `g_close` emits a critical
warning on EBADF. Remove the `g_close` check from `test_fdmem` and add
another version that tests `GST_FD_MEMORY_FLAG_DONT_CLOSE`.

We will depend on the Valgrind test run to warn us about leaked FDs.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2480
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4422>

18 months agoimagesequencesrc: Properly set default location
Jan Alexander Steffens (heftig) [Fri, 3 Mar 2023 18:40:22 +0000 (18:40 +0000)]
imagesequencesrc: Properly set default location

Noticed this because the generic_states test kept segfaulting at random.
GLibC 2.37 can crash when NULL is supplied as a format string.

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

18 months agogst: tracer: Initialize tracing infrastructure even if the debug system is not compil...
Sebastian Dröge [Wed, 12 Apr 2023 07:58:31 +0000 (10:58 +0300)]
gst: tracer: Initialize tracing infrastructure even if the debug system is not compiled in

There is a separate #define for the tracing infrastructure.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2467

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

18 months agosrtpdec: fix "srtp-key" check
Michael Olbrich [Thu, 19 Jul 2018 15:21:22 +0000 (17:21 +0200)]
srtpdec: fix "srtp-key" check

The original code was:

if (!gst_structure_get (s, "srtp-key", GST_TYPE_BUFFER, &buf, NULL) || !buf) {
  goto error;
} else {
  stream->key = buf;
}

So use "srtp-key" if it is set so a non NULL buffer. The condition was
incorrectly inverted in ad7ffe64a66ab48d81671651031c449149db4973 to:

if (gst_structure_get (s, "srtp-key", GST_TYPE_BUFFER, &buf, NULL) || !buf) {
  stream->key = buf;
} ...

Fix the condition so it works as originally intended and avoid accessing
'buf' uninitialised.

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

18 months agoadaptivedemux2: fix critical when using an unsupported URI
Guillaume Desmottes [Tue, 11 Apr 2023 15:54:23 +0000 (17:54 +0200)]
adaptivedemux2: fix critical when using an unsupported URI

adaptivedemux2 only supports http(s), trying to use it with, say,
file:// was raising a CRITICAL in libsoup.

Fix #2476

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

18 months agoglvideoflip: fix leaked caps
Matthias Fuchs [Thu, 6 Apr 2023 06:54:30 +0000 (08:54 +0200)]
glvideoflip: fix leaked caps

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

18 months agoglcontext_wgl: fix missing unref
Matthias Fuchs [Wed, 5 Apr 2023 11:20:19 +0000 (13:20 +0200)]
glcontext_wgl: fix missing unref

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

18 months agod3d11videosink: fix race conditions in win32 window
Aleksandr Slobodeniuk [Mon, 27 Mar 2023 07:20:27 +0000 (09:20 +0200)]
d3d11videosink: fix race conditions in win32 window

One race condition is the fact that the window object
can be destroyed while running some routine in the UI
thread (such as resizing). To avoid that situation we make
UI thread hold a reference on the window object while it's
running.
Other probpematic case is when the window handle is reused:
if we stop and start the pipeline very fast,
so the sink creates a new window object that is going to use
the same window handle as the previous one.
And finally the case when the pipeline is stopped immediatelly
right after starting, this one is also handled in this commit.

NOTE: a unit test that reproduces this cases have been added
in the previous commit.

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

18 months agod3d11videosink: add gstcheck test for win32 window
Aleksandr Slobodeniuk [Tue, 21 Mar 2023 17:17:12 +0000 (18:17 +0100)]
d3d11videosink: add gstcheck test for win32 window

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

18 months agod3d11videosink: Enhancement for initial window size decision
Seungha Yang [Sat, 1 Apr 2023 15:29:24 +0000 (00:29 +0900)]
d3d11videosink: Enhancement for initial window size decision

Use AdjustWindowRect() method to calculate window size so that
video scene can be rendered on client area without black borders

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

18 months agoBack to development
Tim-Philipp Müller [Tue, 11 Apr 2023 23:31:17 +0000 (00:31 +0100)]
Back to development

18 months agoRelease 1.22.2
Tim-Philipp Müller [Tue, 11 Apr 2023 16:29:28 +0000 (17:29 +0100)]
Release 1.22.2

18 months agogst-plugins-base: update translations
Tim-Philipp Müller [Mon, 10 Apr 2023 12:49:55 +0000 (13:49 +0100)]
gst-plugins-base: update translations

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

18 months agogstreamer: update translations
Tim-Philipp Müller [Mon, 10 Apr 2023 12:49:41 +0000 (13:49 +0100)]
gstreamer: update translations

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

18 months agoavmux: fix element leak
Tim-Philipp Müller [Mon, 10 Apr 2023 17:06:17 +0000 (18:06 +0100)]
avmux: fix element leak

Fixes #2473

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

18 months agoavdeinterlace: fix element leak
Tim-Philipp Müller [Mon, 10 Apr 2023 16:59:21 +0000 (17:59 +0100)]
avdeinterlace: fix element leak

Fixes #2473

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

18 months agoh264decoder: Enable low-latency bumping in case of pic_order_cnt_type 2
Seungha Yang [Mon, 10 Apr 2023 11:10:50 +0000 (20:10 +0900)]
h264decoder: Enable low-latency bumping in case of pic_order_cnt_type 2

In case of POC type 2, output order is equal to decoding order
(no frame reordering)

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2447
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4383>

18 months agoh264decoder: Fix for latency report
Seungha Yang [Thu, 6 Apr 2023 11:48:17 +0000 (20:48 +0900)]
h264decoder: Fix for latency report

The minimum latency answered by an element should be the maximum
latency from the element's perspective. Also consider max_reorder_frames
update as a sequence change

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

18 months agoh264decoder: Ignore invalid max_num_reorder_frames in VUI
Seungha Yang [Thu, 6 Apr 2023 11:26:24 +0000 (20:26 +0900)]
h264decoder: Ignore invalid max_num_reorder_frames in VUI

It's not fatal and can be ignored

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

18 months agoh265decoder: Fix for latency report when src caps is not configured
Seungha Yang [Thu, 6 Apr 2023 10:40:12 +0000 (19:40 +0900)]
h265decoder: Fix for latency report when src caps is not configured

Depending on subclass, negotiation might not happen on new_sequence()

Fixing regression introduced by the commit
4a4823b9728fbb944e05d89e0fee681ab5b33e25

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

18 months agoh264decoder: Fix for latency report when src caps is not configured
Seungha Yang [Thu, 6 Apr 2023 10:36:03 +0000 (19:36 +0900)]
h264decoder: Fix for latency report when src caps is not configured

Depending on subclass, negotiation might not happen on new_sequence()

Fixing regression introduced by the commit
4a4823b9728fbb944e05d89e0fee681ab5b33e25

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

18 months agogstd3d11window: fix memory leak
Wang Chuan [Mon, 10 Apr 2023 09:31:29 +0000 (17:31 +0800)]
gstd3d11window: fix memory leak

GstStructure may leak when using external HWND

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

18 months agomeson: add missing source_filename in the dav1d wrap
Jordan Petridis [Thu, 30 Mar 2023 12:57:34 +0000 (15:57 +0300)]
meson: add missing source_filename in the dav1d wrap

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

18 months agodebugqroverlay: fix string leak
Tim-Philipp Müller [Sun, 26 Mar 2023 15:49:32 +0000 (16:49 +0100)]
debugqroverlay: fix string leak

g_string_free(.., FALSE) gives us ownership of the string
already, no need to duplicate that again with g_strdup(),
and doing so will leak the string returned by g_string_free()
here. Caught by compiler warnings in newer GLib versions.

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

18 months agotwcc: Better handle duplicate packets
Edward Hervey [Tue, 4 Apr 2023 07:21:47 +0000 (09:21 +0200)]
twcc: Better handle duplicate packets

The previous code would only check if two packets in a row were duplicates. If
not (i.e. a packet is a duplicate of a packet received slightly before) the code
would generate completely bogus FCI because it assumes there were no duplicates
present in the array.

In order to be efficient, just store all received packets and remove the
duplicates just before the FCI is generated once the array of observations have
been sorted by seqnum.

Fixes TWCC usage with moderate to high packet duplication.

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

18 months agodecklinkaudiosink: Fix playback when video caps is configured before audio
Seungha Yang [Fri, 7 Apr 2023 13:13:24 +0000 (22:13 +0900)]
decklinkaudiosink: Fix playback when video caps is configured before audio

Scheduled playback starts on videosink's state change or on caps
but it's possible that audiosink is configure without caps yet.
Try start scheduled playback on audiosink's caps event as well

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

18 months agogst-plugins-base: gl: wayland: cleanup on close
Rouven Czerwinski [Thu, 6 Apr 2023 05:58:03 +0000 (07:58 +0200)]
gst-plugins-base: gl: wayland: cleanup on close

The proxy and queue are created in the gst_gl_window_wayland_egl_open()
function and will be recreated on open. This leaks both objects, the
wayland client documentation mentions that they should be destroyed
using the appropriate destroy functions.

Found during valgrind memory leak testing, these blocks were marked as
definitely lost.

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

18 months agoosxvideosink: fix broken aspect ration and frame drawing region
Alexande B [Fri, 4 Nov 2022 21:04:21 +0000 (22:04 +0100)]
osxvideosink: fix broken aspect ration and frame drawing region

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

18 months agortsp-server: media: First set state to PLAYING again temporarily, then send EOS
Sebastian Dröge [Tue, 4 Apr 2023 17:03:31 +0000 (20:03 +0300)]
rtsp-server: media: First set state to PLAYING again temporarily, then send EOS

Sending the EOS event while the pipeline is PAUSED can deadlock on the
stream lock if a sink is currently blocked because of pre-rolling.

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

19 months agosdp: Skip source-specific caps fields when creating an SDP media from caps
Sebastian Dröge [Tue, 4 Apr 2023 16:21:56 +0000 (19:21 +0300)]
sdp: Skip source-specific caps fields when creating an SDP media from caps

Regression from https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2132

We parse the source-specific fields from the SDP and put it into the
caps, but when converting caps into an SDP again this would need special
handling. By default it would end up as part of the fmtp field, which is
simply wrong.

Automatically putting it into the caps and SDP will need some more work.

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

19 months agodecklink: fix 10 bit RGB (r210) format auto detection
Wojciech Kapsa [Tue, 4 Apr 2023 10:22:31 +0000 (12:22 +0200)]
decklink: fix 10 bit RGB (r210) format auto detection

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2391

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

19 months agortspsrc: Skip PTs with caps incompatible to the global caps
Sebastian Dröge [Tue, 4 Apr 2023 16:23:14 +0000 (19:23 +0300)]
rtspsrc: Skip PTs with caps incompatible to the global caps

Otherwise empty caps are created while all following code assumes that
the caps will have exactly one structure, and then run into assertions.

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

19 months agotools: Count argc after parsing GOption on Windows
Seungha Yang [Thu, 30 Mar 2023 19:40:58 +0000 (04:40 +0900)]
tools: Count argc after parsing GOption on Windows

Existing codes rely on modified argc value by g_option_context_parse()
but g_option_context_parse_strv() is used in case of Windows.
Count arguments after the option parsing manually.
Fixing command "gst-inspect-1.0.exe -b"

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

19 months agoalsasink: Fix for being stuck in stop_streaming_threads state
Robert Rosengren [Thu, 30 Mar 2023 14:09:06 +0000 (16:09 +0200)]
alsasink: Fix for being stuck in stop_streaming_threads state

Moving from PLAYING to NULL will set the stop_streaming_threads to TRUE,
but when moving back upwards its not reset to FALSE (as only done in
uncalled init and resume callbacks).

Fix by reseting value in the prepare callback.

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

19 months agov4l2object: Add support for YVU420M format
Shengqi Yu [Tue, 28 Mar 2023 07:29:46 +0000 (15:29 +0800)]
v4l2object: Add support for YVU420M format

This is a multi-planar format with planes non contiguous in memory. It
is intended to be used only in drivers and applications that support the
multi-planar API.

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

19 months agogit: prevent CRLF line ending conversion for patches on Windows
Tim-Philipp Müller [Thu, 30 Mar 2023 12:48:02 +0000 (13:48 +0100)]
git: prevent CRLF line ending conversion for patches on Windows

Otherwise the patch file might get line endings converted on git
checkout on Windows if the git option core.autocrlf=true is set,
and then the patches won't apply later when Meson tries to apply
them to the downloaded source code from tarball.

This could cause the pango patches not applying to the pango
subproject on Windows in some settings, and then the subproject
setup would fail and the pango plugin would not be built.

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

19 months agotypefindfunctions: Increase xml typefinder closing brace limit
Ilie Halip [Sat, 18 Mar 2023 09:54:15 +0000 (11:54 +0200)]
typefindfunctions: Increase xml typefinder closing brace limit

If the first XML element in a DASH manifest has its closing brance
beyond the first 512 bytes (because of, e.g. lots of attributes),
the MPD typefinder fails. Try to read a larger block, and then
smaller blocks until 512 bytes.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2385

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

19 months agortsp: gstrtspurl: gst_rtsp_url_get_request_uri: use rtsps scheme for tls transport...
Bart Van Severen [Tue, 28 Mar 2023 13:49:36 +0000 (15:49 +0200)]
rtsp: gstrtspurl: gst_rtsp_url_get_request_uri: use rtsps scheme for tls transport methods

gst_rtsp_url_get_request_uri returns rtsp://... url when requested url is rtsps://, this is not
in accordance with https://www.rfc-editor.org/rfc/rfc7826.html#section-19.2.
This also impedes setting up a rtsps session with a live555 rtsp server.

Don't expose other than rtsp and rtsps internal gstreamer rtsp url schemes
to avoid regression:
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2412

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

19 months agoRevert "rtsp: gstrtspurl: gst_rtsp_url_get_request_uri: fix incorrect scheme for...
Bart Van Severen [Tue, 28 Mar 2023 13:38:07 +0000 (15:38 +0200)]
Revert "rtsp: gstrtspurl: gst_rtsp_url_get_request_uri: fix incorrect scheme for tls transport methods"

This reverts commit 024ef7659d3cb1ceee6628646aa37001399be92d because it causes a regression:
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2412

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

19 months agogtkwaylandsink: Destroy GstWlWindow when parent GtkWindow is destroyed
Colin Kinloch [Thu, 16 Mar 2023 16:02:26 +0000 (16:02 +0000)]
gtkwaylandsink: Destroy GstWlWindow when parent GtkWindow is destroyed

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

19 months agovkmemory: flush whole size
Víctor Manuel Jáquez Leal [Wed, 29 Mar 2023 10:58:14 +0000 (12:58 +0200)]
vkmemory: flush whole size

Running element_vkcolorconver test with Vulkan validation layer this error is
raised:

Code 0 : Validation Error: [ VUID-VkMappedMemoryRange-size-01390 ] Object 0:
handle = 0x100000000010, type = VK_OBJECT_TYPE_DEVICE_MEMORY;
| MessageID = 0xdd4e6d8b
| vkFlushMappedMemoryRanges: Size in pMemRanges[0] is 0x4, which is not a
multiple of VkPhysicalDeviceLimits::nonCoherentAtomSize (0x40) and offset +
size (0x0 + 0x4 = 0x4) not equal to the memory size (0xb). The Vulkan spec
states: If size is not equal to VK_WHOLE_SIZE, size must either be a multiple of
VkPhysicalDeviceLimits::nonCoherentAtomSize, or offset plus size must equal the
size of memory

The reason of is that the image size used in the test doesn't comply hardware
restrictions. In order to avoid juggling with image size and hardware
restrictions, this patch proposes to use VK_WHOLE_SIZE macro.

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

19 months agotests: vkimage: add VK_IMAGE_USAGE_SAMPLED_BIT usage bit
Víctor Manuel Jáquez Leal [Wed, 29 Mar 2023 10:44:00 +0000 (12:44 +0200)]
tests: vkimage: add VK_IMAGE_USAGE_SAMPLED_BIT usage bit

Running tests with Vulkan Validation enabled show an error on vkimage tests:

Code 0 : Validation Error: [ VUID-VkImageViewCreateInfo-image-04441 ]
Object 0: VK_NULL_HANDLE, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle
= 0x50000000005, type = VK_OBJECT_TYPE_IMAGE;
| MessageID = 0xb75da543
| Invalid usage flag for VkImage 0x50000000005[] used by vkCreateImageView(). In
this case, VkImage should have VK_IMAGE_USAGE_SAMPLED_BIT |
VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT |
VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT |
VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT |
VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR |
VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT |
VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR |
VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR |
VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR |
VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR | VK_IMAGE_USAGE_SAMPLE_WEIGHT_BIT_QCOM
| VK_IMAGE_USAGE_SAMPLE_BLOCK_MATCH_BIT_QCOM set during creation.
The Vulkan spec states: image must have been created with a usage value
containing at least one of the usages defined in the valid image usage list for
image views

This patch adds VK_IMAGE_USAGE_SAMPLED_BIT to the usage bits in test.

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

19 months agovkfullscreenquad: set enable_clear as TRUE by default
Víctor Manuel Jáquez Leal [Wed, 29 Mar 2023 09:04:20 +0000 (11:04 +0200)]
vkfullscreenquad: set enable_clear as TRUE by default

While using the validation layer with this pipeline:

gst-launch-1.0 videotestsrc num-buffers=10 ! vulkanupload ! vulkancolorconvert ! vulkansink

The validation layer throws this message:

Code 0 : Validation Error: [ VUID-VkAttachmentDescription-format-06699 ]
Object 0: handle = 0x5555562e9610, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x52b3229e |
vkCreateRenderPass: pCreateInfo->pAttachments[0] format is
VK_FORMAT_B8G8R8A8_UNORM and loadOp is VK_ATTACHMENT_LOAD_OP_LOAD, but
initialLayout is VK_IMAGE_LAYOUT_UNDEFINED.
The Vulkan spec states: If format includes a color or depth aspect and loadOp is
VK_ATTACHMENT_LOAD_OP_LOAD, then initialLayout must not be VK_IMAGE_LAYOUT_UNDEFINED

When creating the render pass the loadOp can be either
`VK_ATTACHMENT_LOAD_OP_CLEAR` or `VK_ATTACHMENT_LOAD_OP_LOAD` depending on
`enable_clear`. While `enable_clear` is FALSE by default (which means
`VK_ATTACHMENT_LOAD_OP_LOAD`). Nonetheless, its value is explicitly changed by
`vkoverlaycompositor` to FALSE too!

This behavior was introduced in merge request #2470 where
`VK_ATTACHMENT_LOAD_OP_CLEAR` was a fixed value for loadOp. Thus, the bug
consists in a missing initialization of `enable_clear` to TRUE from that merge
request.

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

19 months agovulkanswapper: correctly handle force-aspect-ratio=false
Matthew Waters [Mon, 27 Mar 2023 05:28:04 +0000 (16:28 +1100)]
vulkanswapper: correctly handle force-aspect-ratio=false

It was simply ignored so actually handle it.

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

19 months agoopenjpegdec: allow multithread decoding only in subframe mode
Stéphane Cerveau [Mon, 13 Feb 2023 11:05:27 +0000 (12:05 +0100)]
openjpegdec: allow multithread decoding only in subframe mode

To avoid mis-ordered frames, allow multithread decoding only in
subframe mode.

Fixes #1786

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

19 months agodatetime: Return G_MAXFLOAT instead of G_MAXDOUBLE for no timezone offset
Sebastian Dröge [Fri, 24 Mar 2023 16:34:36 +0000 (18:34 +0200)]
datetime: Return G_MAXFLOAT instead of G_MAXDOUBLE for no timezone offset

Returning G_MAXDOUBLE from a function returning a float is not going to
work well and MSVC also correctly warns about this.

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

19 months agodecodebin3: fix hang issue when remove failing stream
Haihua Hu [Mon, 27 Mar 2023 03:18:09 +0000 (11:18 +0800)]
decodebin3: fix hang issue when remove failing stream

Need mark selection_update to true when update selection,
otherwise, pipeline will not handle this selection update
sometimes when this flag has been reset

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

19 months agortpjpegdepay: fix logic error when checking if an EOI is present
Tim-Philipp Müller [Thu, 23 Mar 2023 16:40:54 +0000 (16:40 +0000)]
rtpjpegdepay: fix logic error when checking if an EOI is present

We wouldn't add the missing EOI marker if the frame ended with
either 0xFF NN or 0xNN D9.

Fixes #2407

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

19 months agod3d11bufferpool: Fix invalid access in debug print loop
Seungha Yang [Thu, 23 Mar 2023 15:23:42 +0000 (00:23 +0900)]
d3d11bufferpool: Fix invalid access in debug print loop

Add missing condition check in for loop

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

19 months agonvh264encoder: Fix template caps
Seungha Yang [Tue, 21 Mar 2023 11:06:12 +0000 (20:06 +0900)]
nvh264encoder: Fix template caps

It should include progressive as well

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

19 months agoqtdemux: Fix seek adjustment with SNAP_AFTER flag
Piotr Brzeziński [Mon, 20 Mar 2023 15:35:45 +0000 (16:35 +0100)]
qtdemux: Fix seek adjustment with SNAP_AFTER flag

With GST_SEEK_FLAG_SNAP_AFTER present, the previous version would
adjust seek time based on the keyframe farthest away from desired_time.
This was incorrect, because we always want the *earliest* suitable keyframe
to seek to, not the last one.
With this fix, in case of the SNAP_AFTER, we now look for the closest keyframe
that can be found after desired_time. Behaviour for SNAP_BEFORE should remain
unchanged.

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

19 months agov4l2object: mark jpeg as parsed
Michael Tretter [Tue, 31 Jan 2023 15:02:03 +0000 (16:02 +0100)]
v4l2object: mark jpeg as parsed

Assuming that V4L2 CAPTURE devices always use one buffer per JPEG image, we can
always mark JPEGs provided by a V4L2 element as parsed.

The V4L2 elements require that JPEG images sent to V4L2 OUTPUT devices must
always be parsed.

This is necessary to link a V4L2 CAPTURE device with a V4L2 OUTPUT device
without explicitly marking the stream as parsed or adding a jpegparse into the
pipeline.

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

19 months agogtkwaylandsink: Fix crash when rendering after the window is closed
Colin Kinloch [Mon, 20 Mar 2023 17:44:23 +0000 (17:44 +0000)]
gtkwaylandsink: Fix crash when rendering after the window is closed

Continuation of https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4197

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

19 months agoparsebin: Improve elementary stream handling
Edward Hervey [Mon, 20 Mar 2023 15:16:34 +0000 (16:16 +0100)]
parsebin: Improve elementary stream handling

The goal of parsebin is to figure out which elements to link together in order
to provide elementary streams given any random input.

The problem is that deciding whether a given stream should still have more
elements plugged in or not was dependent on ... the presence of compatible
decoders (sic).

Instead of that, if we can't plug anymore elements on a given stream *and* it is
detected as being an elementary stream, expose it.

Fixes #2118

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

19 months agourisourcebin: Activate pad before transferring sticky events
Edward Hervey [Mon, 20 Mar 2023 10:53:35 +0000 (11:53 +0100)]
urisourcebin: Activate pad before transferring sticky events

Otherwise they get refused since the pad is flushing

Fixes #2384 for good

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

19 months agoksdeviceprovider: Fix leak in gst_dshow_device_provider_start
Adrien De Coninck [Sun, 19 Mar 2023 20:21:31 +0000 (21:21 +0100)]
ksdeviceprovider: Fix leak in gst_dshow_device_provider_start

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

19 months agodshowdeviceprovider: Fix leak in gst_dshow_device_provider_start
Adrien De Coninck [Sun, 19 Mar 2023 19:57:18 +0000 (20:57 +0100)]
dshowdeviceprovider: Fix leak in gst_dshow_device_provider_start

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

19 months agomatroskademux: Make gst_byte_reader_get_data() usage less confusing
Sebastian Dröge [Fri, 17 Mar 2023 15:13:39 +0000 (17:13 +0200)]
matroskademux: Make gst_byte_reader_get_data() usage less confusing

This is effectively the same behaviour but retrieving 0 bytes of data is
confusing to read.

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

19 months agoflacenc: Fix mapping of GStreamer image tag type to FLAC image tag type
Sebastian Dröge [Fri, 17 Mar 2023 14:48:51 +0000 (16:48 +0200)]
flacenc: Fix mapping of GStreamer image tag type to FLAC image tag type

These enums are not compatible so just casting them does not work.

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

19 months agoplugins: Fix various trivial clang compiler warnings
Sebastian Dröge [Fri, 17 Mar 2023 14:32:45 +0000 (16:32 +0200)]
plugins: Fix various trivial clang compiler warnings

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

19 months agotsdemux: Fix reading of extended Opus channel configuration
Sebastian Dröge [Fri, 17 Mar 2023 13:51:53 +0000 (15:51 +0200)]
tsdemux: Fix reading of extended Opus channel configuration

Argument evaluation order is implementation defined in C, and gcc is
evaluating right-to-left (works) while clang is evaluating left-to-right
(does not work).

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

19 months agoh264decoder: Fix DPB bumping process
Seungha Yang [Fri, 17 Mar 2023 14:28:58 +0000 (23:28 +0900)]
h264decoder: Fix DPB bumping process

As per spec C.4.5.3 "Bumping", if bumping is needed but DPB holds
no "output needed" picture, then a picture that has the smallest
POC should be considered first for output

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

19 months agourisourcebin: Propagate sticky events from parsebin
Edward Hervey [Fri, 17 Mar 2023 08:58:55 +0000 (09:58 +0100)]
urisourcebin: Propagate sticky events from parsebin

If sticky events are present on parsebin source pads, we propagate them to the
multiqueue source pads. Those will be propagated on the new urisourcebin source
pads like in the other code paths.

This ensures that STREAM_START event are present on new source pads. If CAPS
event are also present (not guaranteed), they will also be available.

Fixes #2384

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

19 months agonvencoder: Fix CQP option setting
Seungha Yang [Fri, 17 Mar 2023 16:33:20 +0000 (01:33 +0900)]
nvencoder: Fix CQP option setting

... and zero initialize LUID and CUDA device list to address
coverity issue

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

19 months agowebrtc: Fix segfault traversing ice transports
Albert Sjölund [Thu, 16 Mar 2023 12:33:46 +0000 (13:33 +0100)]
webrtc: Fix segfault traversing ice transports

Previously, reassigning loop index l in nicestream.c
could cause a segfault if l->data was null, as it could
reassign l to a null variable, triggering the loop
postassignment l->next, which then segfaults due to
l now being null. It is instead moved into the loop.
_delete_transport already performs the reassignment
inline.

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

19 months agowasapi2: Fix potential crash on device activation failure
Seungha Yang [Thu, 16 Mar 2023 14:09:53 +0000 (23:09 +0900)]
wasapi2: Fix potential crash on device activation failure

The activation object is live in COM thread already and therefore
self refcount hack is pointless.

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

19 months agowebrtc: patch leak caused by early return
Albert Sjölund [Thu, 16 Mar 2023 12:25:39 +0000 (13:25 +0100)]
webrtc: patch leak caused by early return

In webrtc_data_channel_send functions, both data and string,
an early return on a non-open datachannel caused it to leak
the buffer used for pushing to appsrc, meaning any buffer
sent after leaving the open state was leaked in full.

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

19 months agoinputselector: Wake up streaming thread before PLAYING_TO_PAUSED transition
Vivia Nikolaidou [Thu, 16 Mar 2023 10:38:23 +0000 (12:38 +0200)]
inputselector: Wake up streaming thread before PLAYING_TO_PAUSED transition

Also take object lock before iterating the pads.

https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1772

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

19 months agod3d11videosink: Fix tearing in case of fullscreen mode
Seungha Yang [Wed, 15 Mar 2023 13:05:33 +0000 (22:05 +0900)]
d3d11videosink: Fix tearing in case of fullscreen mode

DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING and DXGI_PRESENT_ALLOW_TEARING should
be used only if required, when user wants Vsync off for example.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2376
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4188>

19 months agod3d11converter: Fix conversion backend selection
Seungha Yang [Wed, 15 Mar 2023 15:53:31 +0000 (00:53 +0900)]
d3d11converter: Fix conversion backend selection

Intended behavior was selecting video processor only if pixel shader
is disabled, since we prefer shader over video processor

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

19 months agoavviddec: Drop decoder stream lock when calling send_packet
Nicolas Dufresne [Tue, 14 Mar 2023 18:27:39 +0000 (14:27 -0400)]
avviddec: Drop decoder stream lock when calling send_packet

This is already done for every other calls to send_packet. The deadlock occures
since FFMPeg 6.0. The decoder tries to get a buffer from a thread during
the draining process, and blocks trying to get the video decoder stream lock
already heald by the drain function.

Fixes #2383

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

19 months agod3d11compositor: Fix composition error on release_pad()
Seungha Yang [Tue, 14 Mar 2023 13:08:54 +0000 (22:08 +0900)]
d3d11compositor: Fix composition error on release_pad()

Composition might be still in progress while it's being released

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

19 months agomatroskamux: Set rate/channels in Opus template caps
Arun Raghavan [Fri, 10 Mar 2023 18:10:16 +0000 (13:10 -0500)]
matroskamux: Set rate/channels in Opus template caps

For some reason these were missed, and if caps didn't have them, we would emit
an invalid Matroska file with a 0 value for Sampling Frequency or channels.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2354
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4172>

19 months agortpopusdepay: Assume 48 kHz if sprop-maxcapturerate is missing
Arun Raghavan [Fri, 10 Mar 2023 17:06:08 +0000 (12:06 -0500)]
rtpopusdepay: Assume 48 kHz if sprop-maxcapturerate is missing

This matches 7587, section 6.1:

>   sprop-maxcapturerate:  a hint about the maximum input sampling rate
>      [...]
>      bandwidths (Table 1).  By default, the sender is assumed to have
>      no limitations, i.e., 48000.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2354
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4172>

19 months agozxing: add support for zxing-c++ 2.0
Antonio Rojas [Sat, 7 Jan 2023 15:18:03 +0000 (16:18 +0100)]
zxing: add support for zxing-c++ 2.0

format is a C++ string in 2.0

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

19 months agovulkanoverlaycompositor: don't do a potential use after free
Matthew Waters [Fri, 10 Mar 2023 05:47:17 +0000 (16:47 +1100)]
vulkanoverlaycompositor: don't do a potential use after free

Removing a meta from a buffer means one doesn't have access to it
anymore.  Instead use the already reffed composition directly.

Fixes a use-after-free in the following pipeline:

... ! vulkanupload ! timeoverlay ! vulkanoverlaycompositor ! ...

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

19 months agocea708overlay: fix HCR interpretation
Matthew Waters [Thu, 9 Mar 2023 03:38:13 +0000 (14:38 +1100)]
cea708overlay: fix HCR interpretation

An unsigned counter with a for (i = end; i >= 0; i--), can be optimized to
infinite loop as an unsigned value will always be >= 0.

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

19 months agoh264parse: Validate VUI framerate
Seungha Yang [Tue, 7 Mar 2023 14:46:50 +0000 (23:46 +0900)]
h264parse: Validate VUI framerate

A few streams contain invalid/wrong framerate in VUI. Do validate
it based on the spec and ignore invalid VUI framerate values.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1753
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4131>

19 months agojpegparse: demote and promote log messages level
Víctor Manuel Jáquez Leal [Tue, 28 Feb 2023 17:48:24 +0000 (18:48 +0100)]
jpegparse: demote and promote log messages level

Before those levels where when implementing the plugin. Now these
levels are for reporting issues from users.

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

19 months agojpegparse: reset parse state when the SOI is not the first marker
He Junyan [Sun, 12 Feb 2023 14:37:01 +0000 (22:37 +0800)]
jpegparse: reset parse state when the SOI is not the first marker

There may be garbage or some bits before a SOI comes in some problematic
mjpeg streams. For example, some network error may cause the EOI marker
of the previous frame lost, and when the new frame's SOI comes, we still
use the state of the last frame, which will generate errors.

For this kind of frames without EOI, if that frame already has some data
(the SOS segment is detected), we still push it as a frame with CORRUPTED
flag set. But if not, we just discard all the data before the new SOI.

Co-Authored-By: Víctor Jáquez <vjaquez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4130>

19 months agortspsrc: Consider "451: Parameter Not Understood" when handling broken control urls
Matt Feury [Mon, 6 Mar 2023 19:56:08 +0000 (19:56 +0000)]
rtspsrc: Consider "451: Parameter Not Understood" when handling broken control urls

similar to https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3854

it seems that some implementations return this when
the server does not implement URL handling correctly

this fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2334

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

20 months agoBack to development
Tim-Philipp Müller [Sat, 4 Mar 2023 16:13:04 +0000 (16:13 +0000)]
Back to development

20 months agoRelease 1.22.1
Tim-Philipp Müller [Sat, 4 Mar 2023 13:42:32 +0000 (13:42 +0000)]
Release 1.22.1

20 months agovtdec: Correctly retrieve reorder queue length from SPS
Piotr Brzeziński [Thu, 23 Feb 2023 13:14:57 +0000 (14:14 +0100)]
vtdec: Correctly retrieve reorder queue length from SPS

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

20 months agoalsasink: Fix stall when going from PLAYING to NULL (stucked at PAUSED) with uac1...
Nicolas Beland [Wed, 1 Mar 2023 21:26:20 +0000 (16:26 -0500)]
alsasink: Fix stall when going from PLAYING to NULL (stucked at PAUSED) with uac1 gadget

This happened with a uac1 gadget which for some reason does not behave nicely.

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

20 months agoadaptivedemux2: Fix buffering treshold initialization
Edward Hervey [Fri, 3 Mar 2023 07:21:08 +0000 (08:21 +0100)]
adaptivedemux2: Fix buffering treshold initialization

Properly initialize the stream default recommended buffering threshold so that
a default (10s) value is used until the subclass can provide a proper value

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2064

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

20 months agoinputselector: Avoid deadlock when shutting down
Vivia Nikolaidou [Thu, 2 Mar 2023 13:51:08 +0000 (15:51 +0200)]
inputselector: Avoid deadlock when shutting down

Transition from PLAYING to PAUSED unschedules any pending clock wait,
but there was no guard that prevented another input buffer then waiting
again while in PAUSED before dataflow stops. Use a new `playing` flag to
avoid this, and exit the chain function if instead of playing we're now
flushing. Basically the same as the clocksync element.

Closes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1772

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

20 months agovalidate: Protect init function with a recursive mutex
Thibault Saunier [Wed, 1 Mar 2023 03:56:51 +0000 (00:56 -0300)]
validate: Protect init function with a recursive mutex

In tests in the rust bindings we end up with 2 thread initializing
concurrently, and it should not be a problem, -validate should be MT
safe.

Using a recursive mutex as we might recursively init for some reason
and we are not on the hot path here in any case.

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

20 months agovalidate:scenario: sink refs when building
Thibault Saunier [Wed, 1 Mar 2023 03:43:01 +0000 (00:43 -0300)]
validate:scenario: sink refs when building

Scenarios are no owned by anyone, even if they are GstObjects

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

20 months agoavfvideosrc: Fix description and trailing whitespace
Jan Schmidt [Tue, 28 Feb 2023 19:36:15 +0000 (06:36 +1100)]
avfvideosrc: Fix description and trailing whitespace

Minor fix to mention that the element is also useful on MacOS,
and remove some trailing whitespace

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

20 months agoavfvideosrc: Don't wait on main thread for permissions request
Jan Schmidt [Tue, 28 Feb 2023 19:32:19 +0000 (06:32 +1100)]
avfvideosrc: Don't wait on main thread for permissions request

Recursively invoking the NSMainLoop can cause crashes in
applications that don't expect it. Instead of waiting for
permission to be granted, move the wait later - until we
actually need device permissions when starting the capture
session. That moves the wait into the streaming thread
instead of the application thread that's setting the pipeline
state to READY.

Instead of a manual state change implementation to open
and close the device, use the basesrc start/stop methods that
are intended for the purpose.

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