Commit graph

4416 commits

Author SHA1 Message Date
Yinhang Liu 3883ae8c2a msdk: Fix initialization of the msdk_session.impl_idx
This fixes the issue of msdk_session.impl_idx not being initialized.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4448>
2023-05-15 01:22:29 +00:00
Sebastian Dröge bb2c5981fe pulse: Change bitfield booleans to normal gbooleans
Assigning TRUE (1) to a signed 1 bit integer will cause truncation
from 1 to -1 because the only non-zero value that can be stored is -1
due to how two's-complement works.

As this is a proper GObject let's not bother with all this and simply
use a normal gboolean instead.

../subprojects/gst-plugins-good/ext/pulse/pulsesink.c:1490:19: warning: implicit truncation from 'int' to a one-bit
        wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
  pbuf->in_commit = TRUE;
                  ^ ~~~~

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4617>
2023-05-14 15:58:35 +00:00
Sebastian Dröge f9a3b3eacf rtpjitterbuffer: Fix uninitialized variable compiler warning
It could indeed be used uninitialized, but only if one of the
g_return_val_if_fail() caused an early return.

../subprojects/gst-plugins-good/gst/rtpmanager/rtpjitterbuffer.c: In function ‘rtp_jitter_buffer_append_query’:
../subprojects/gst-plugins-good/gst/rtpmanager/rtpjitterbuffer.c🔢10: warning: ‘head’ may be used uninitialized
      [-Wmaybe-uninitialized]
 1234 |   return head;
      |          ^~~~
../subprojects/gst-plugins-good/gst/rtpmanager/rtpjitterbuffer.c:1232:12: note: ‘head’ was declared here
 1232 |   gboolean head;
      |            ^~~~

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4616>
2023-05-14 14:26:05 +00:00
Sebastian Dröge 186d8a99cc avviddec: Temporarily unlock stream lock while flushing buffers
This can call into the decoder again from other threads and try to take
the stream lock from there, which would cause a deadlock.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4610>
2023-05-13 10:20:32 +00:00
Seungha Yang e34397ab09 d3d11: Update element meta
Make them consistent, update outdated description and fix some typos

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4619>
2023-05-12 20:13:58 +00:00
Mathieu Duponchelle 9914b34bf5 parse/grammar: fix missing unref of looked up child
the target parameter of gst_child_proxy_lookup() is (transfer full)

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2560
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4622>
2023-05-12 19:07:09 +00:00
Víctor Manuel Jáquez Leal 7df7efdc3f vulkan: minor meson clean ups
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4621>
2023-05-12 18:04:52 +00:00
Sebastian Dröge 0219b6f6fa ptp-helper: Add some tests for functionality and memory safety of unsafe code
These tests are mostly for ensuring that the calls to system APIs are
done correctly and that there are no memory bugs (that would be caught
by valgrind) in the unsafe code.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4458>
2023-05-12 17:06:01 +00:00
Philippe Normand fe4f034c8a wpe: Add support for the WPEWebKit 2.0 API version
Most notably this disables console messages support when the 2.0 API is used,
because there is no replacement for it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4159>
2023-05-12 14:20:31 +00:00
Michael Olbrich b660f258a6 theoradec: make sure the selected pool accepts the new config
If gst_buffer_pool_set_config() fails then the pool will use its old
config. This may include different width or height when
pic_width/pic_height != frame_width/frame_height.
As a result, the assertions in theora_handle_image() will fail.

So check the result of gst_buffer_pool_set_config() and only use the pool
if it succeeds. Otherwise let the parrent decide_allocation() create a new
pool.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4600>
2023-05-12 14:37:06 +02:00
Michael Olbrich 802b3b9898 theoradec: add another assert to check the buffer size
If the buffer has no video meta then the meta is created from the local
data. In this case, the other asserts don't actually check anything. So add
another one to ensure that the buffer is actually large enough.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4600>
2023-05-12 14:37:06 +02:00
Michael Olbrich 9dd6b08fcc theoradec: remove unused codec state variable
The last user of this state was removed in 9a541157cf "theoradec: Fix
decoding in the presence of GstVideoCropMeta".

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4600>
2023-05-12 14:37:06 +02:00
Nirbheek Chauhan 681f042f27 meson: Install viv-fb GL headers, needed by i.MX
Needed by qmlglsink at build time to allocate a viv-fb display.

Without this, the GL fastpath doesn't work, and performance is really
bad.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4613>
2023-05-12 15:05:56 +05:30
Yinhang Liu f04a1eee71 video: video-info-dma: Fix return value
The return value of gst_video_info_dma_drm_new_from_caps is a pointer type,
and should not return a boolean type. Fix this issue.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4612>
2023-05-12 15:38:08 +08:00
Matthew Waters b10ec569d7 webrtc: advertise end-of-candidate with an empty candidate string
Just like what is done in the browsers.  When this is sent to the peer,
they will be able to know that no more candidates are coming and can
complete ICE.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4598>
2023-05-12 04:52:22 +00:00
Piotr Brzeziński 5e45a1b1bd macos: Set activation policy in osxvideosink and glimagesink
Upon creating a window, glimagesink and osxvideosink now set the policy to
NSApplicationActivationPolicyRegular, which lets us show an icon in the Dock
for convenience and appear in the top menu bar like other apps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4573>
2023-05-12 01:14:44 +02:00
Lukas Geiger 1815061e26 macos: Set activation policy in gst_macos_main
Setting the policy to NSApplicationActivationPolicyAccessory by default makes
sure that we can activate windows programmatically or by clicking on them.
Without that, windows would disappear if you clicked outside them and there
would be no way to bring them to front again. This change also allows osxvideosink
to receive navigation events correctly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4573>
2023-05-12 01:11:19 +02:00
Piotr Brzeziński f60c87769f macos: Remove old NSApp workaround related code
This is no longer needed since the introduction of `gst_macos_main()` in 1.22.
Before that existed, we had a patch for GLib in Cerbero, which did work but made it
impossible to update GLib at all. The code being removed was a fail-safe in case of
running without said patch being applied. It's no longer needed, since for macOS
we just wrap our GStreamer with an NSApplication using `gst_macos_main()`.

Warnings will be displayed if no NSApp/NSRunLoop is found wherever needed,
pointing the user towards using the new API.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4366>
2023-05-11 20:30:19 +02:00
Tim-Philipp Müller 0c4a702e82 qtdemux: add unit test for edit list regression
File is the mp4 file from #2549 with the mdat atom
zeroed out and compressed. We compress twice because
apparently compressing 5MB of zeroes effectively in
one run is too difficult for gzip.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4560>
2023-05-11 16:45:37 +00:00
Mathieu Duponchelle 3d3d2ed447 Revert "qtdemux: fix conditions for end of segment in reverse playback"
This reverts commit 9deb3c27ac.

The test case that was described in the associated MR
(https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/262)
remains adequately fixed by a related MR that was merged later
(https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/275).

It introduced incorrect logic that broke edit lists as described in
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2549

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2549
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4560>
2023-05-11 16:45:37 +00:00
Piotr Brzeziński 560d20a2c0 osxvideosink: fix deadlock upon closing output window
Invoking gst_osx_video_sink_osxwindow_destroy() can currently cause a deadlock
because showFrame() keeps trying to get the same lock as well. Moving the lock
closer to where it's actually needed seems to be enough to fix the issue for now.

Reported-by: Alexande B <abobrikovich@gmail.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4559>
2023-05-11 06:35:02 +00:00
Víctor Manuel Jáquez Leal ad2d1ce393 vkshaderspv: fix example
Use the correct element names.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4594>
2023-05-10 20:14:07 +02:00
Seungha Yang ebcebe548d d3d11videosink: Don't clear prepared buffer on unlock_stop()
That can be called between prepare() and render() which results in
unexpected error flow return

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4583>
2023-05-10 16:20:41 +00:00
Tong Wu b05659859a msdk: fix a not referenced build error
Error Type: error C4189: ‘dma_caps’: local variable is initialized but not referenced

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4587>
2023-05-10 07:57:45 +00:00
Edward Hervey 1fb4a76c35 mpeg2dec: Fix conflicting type declaration
It was always a GstFlowReturn

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4588>
2023-05-10 08:58:36 +02:00
Matthew Waters 21b232ce30 closedcaption: write 0x00 padding instead of 0x80 in cc_data/cdp
Depending on the exact output format, 0x00 may be a better default for
padding than 0x80.  0x00 is the recommended padding value when used in
CDP (and cc_data) but is not when used in s334-1a.  See CTA-708-E 4.3.5
amd SMPTE 334-1-2007 5.3.2.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4578>
2023-05-10 00:52:01 +00:00
Sebastian Dröge 4e8af5c41d ges: discoverer-manager: Don't mark signals as action signals
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4579>
2023-05-09 18:19:11 +00:00
Sebastian Dröge b34cbe9bf1 ges: discoverer-manager: Mark discovered signal error parameter as nullable
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4579>
2023-05-09 18:19:11 +00:00
Seungha Yang 74b7493fd3 h264decoder: Drop nonexisting picture silently without error
If end_picture() was not successful, we do drop corresponding
GstVideoCodecFrame and therefore gst_video_decoder_get_frame()
will return nullptr which is expected behavior.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4561>
2023-05-09 17:02:48 +00:00
François Laignel 6675ed9aae rtpmanager/rtsession: data race leading to critical warnings
This is a fix for a data race leading to:

> GLib-CRITICAL: g_hash_table_foreach:
>   assertion 'version == hash_table->version' failed

Identified sequence:

* `rtp_session_on_timeout` acquires the lock on `session` and proceeds with its
  processing.
* `rtp_session_process_rtcp` is called (debug log : received RTCP packet) and
  attempts to acquire the lock on `session`, which is still held by
  `rtp_session_on_timeout`.
* as part of an hash table iterator, `rtp_session_on_timeout` transitively
  invokes `source_caps` which releases the lock on `session` so as to call
  `session->callbacks.caps`.
* Since `rtp_session_process_rtcp` was waiting for the lock to be released, it
  succeeds in acquiring it and proceeds with `rtp_session_process_rr` which
  transitively calls `g_hash_table_insert` via `add_source`.
* After `source_caps` re-acquires the lock and gives the control flow back to
  `rtp_session_on_timeout`, the hash table iterator is changed, resulting in the
  assertion failure.

This commits copies `sess->ssrcs[sess->mask_idx]` and iterates on the copy so
the iterator is not affected by a concurrent change due to the lock being
released in the `source_caps` callback.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4555>
2023-05-09 16:05:29 +00:00
Philippe Normand fd194a0a2b rtpdtmfdepay: Classify as RTP element
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4582>
2023-05-09 15:18:47 +00:00
Philippe Normand a51fd006e6 rtpdtmfsrc: Classify as RTP source
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4582>
2023-05-09 15:18:47 +00:00
Nirbheek Chauhan 93be699ab2 meson: Add more qt options and eliminate all automagic
The qt5 and qt6 plugins will now correctly error out if you enable the
option, and you can also now explicitly ensure that wayland, x11,
eglfs support is actually functional by enabling the options. It was
too easy to build non-functional support for these.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4537>
2023-05-09 13:18:38 +00:00
Yinhang Liu cb5c0e47c8 msdk: Remove unreachable statement
The execution cannot reach the statement: "gst_caps_unref(dma_caps);",
so remove it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4449>
2023-05-09 05:57:06 +00:00
Tim-Philipp Müller 8b9f1278b2 jack: tone down log ERRORs in case no JACK server is running
jackaudiosink and jackaudiosrc have a rank and might be plugged
as part of auto-plugging inside playbin and playsink or the
autoaudiosink/autoaudiosrc elements, so we don't really want to
spew ERROR log messages in that case, which is consistent with
what alsasink and pulseaudiosink do.

This is less noticable on Linux because pulseaudiosink has a
higher and alsasink which has the same rank comes before jack
in the alphabet.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4545>
2023-05-08 21:20:20 +00:00
Philippe Normand b75114983e webrtcdatachannel: Bind to parent webrtcbin using a weak reference
The previous approach of using a simple pointer could lead to a use-after-free
in case a data-channel was created and its parent webrtcbin was disposed soon
after.

Fixes #2103

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4160>
2023-05-08 19:20:22 +00:00
Maxim P. DEMENTYEV f9c24cd7e7 plugin ext dep INFO: Adding var name and value part number
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4570>
2023-05-08 14:39:24 +00:00
Matthew Waters 8ca6547f49 webrtc/nice: support consent-freshness RFC7675
As is supported by libwebrtc already.  This allows ICE components to
transition to failed if consent to send from the peer is revoked or if
multiple consent packets are lost.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4542>
2023-05-08 13:50:44 +00:00
Sebastian Dröge 4cbd8d6fc6 pbutils: discoverer: Mark gst_discoverer_stream_info_get_stream_id() as nullable
It can return NULL in certain situations.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4572>
2023-05-08 15:26:58 +03:00
Seungha Yang c789b66971 pluginloader-win32: Use UWP compatible Windows API
CreateFile2 API should be used in case of UWP

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4556>
2023-05-06 19:13:29 +00:00
Seungha Yang 4449881b08 d3d11: Add support for IPC
Adding d3d11ipcsrc and d3d11ipcsink elements so that Direct3D11 textures
can be shared between processes

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4514>
2023-05-06 03:19:09 +09:00
Seungha Yang 7b6f7e6e36 d3d11memory: Don't clear wrapped texture memory
The external texture may hold already rendered scene and therefore
it should not be cleared in alloc method

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4554>
2023-05-05 13:18:06 +00:00
Ruben Gonzalez 7d9747490b onnx: Fix typo in documented pipeline
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4552>
2023-05-05 13:16:42 +02:00
Víctor Manuel Jáquez Leal 6258914b1d vkdebug: fix type compilation warning
Since VkMemoryHeapFlagBits is an enum, while VkMemoryHeapFlags is the expected
alias of VkFlags.

This issue is spotted by warning of gcc 13.1.1

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4547>
2023-05-05 10:05:40 +00:00
Mathieu Duponchelle 020fd3d14d videoflip: fix setting of method property at construction time
Since c2f890ab, element properties are gathered from the parse-launch
line and passed at object construction.

This caused the following issue to happen in videoflip:

* videoflip installed a CONSTRUCT property named method, now deprecated
* videoflip now also overrides that property with a video-direction
  property

GObject construction causes method to be set first at construct time,
with the user-provided value, then video-direction with the default
value.

The user-provided value was thus overridden, causing a regression.

Fix by not installing the properties as CONSTRUCT, and explicitly
implementing constructed() instead in order to ensure that we do still
call gst_video_flip_set_method() at least once during construction.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4536>
2023-05-05 08:57:04 +00:00
Camilo Celis Guzman 0cee3cd833 rtpvp8pay: rtpvp9pay: access picture_id property atomically
Atomically set and get the picture_id. This changeset only atomically gets
the picture-id when such property is queried on the element, on every other
place where it is accessed internally it is accessed directly.

This is because there is no MT scenario where we would be modifying this value
and reading it internally in parallel.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4530>
2023-05-05 07:45:19 +00:00
Camilo Celis Guzman e4d8cda9a1 rtpvp8pay, rtpvp9pay: increment PictureID on FLUSH_START
In recent versions of Chrome (M106) a change on their jitter buffer means that
they are very susceptible to PictureID discontinuities.

Then avoid at all cost resetting the PictureID. Moreover, according to
the RFCs for VP8 and VP9 payloads; the PictureID can start off at any
random value. So there is no logical problem of incrementing it here
rather than resetting it, as long as it is a different PictureID.

WebRTC's recent corruption issue:
https://bugs.chromium.org/p/webrtc/issues/detail?id=15101

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4530>
2023-05-05 07:45:19 +00:00
Camilo Celis Guzman f159fd8568 rtpvp8pay, rtpvp9pay: expose picture-id as a property
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4530>
2023-05-05 07:45:19 +00:00
Camilo Celis Guzman 38d5899eba rtpvp9pay: tests: remove unused struct and argument on test
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4530>
2023-05-05 07:45:19 +00:00
Camilo Celis Guzman 11187a81c3 rtpvp9pay: add picture-id-offset property
Bring the VP9 payloader in sync in this regard to the VP8 payloader

Allowing setting the picture id to a known value is useful when testing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4530>
2023-05-05 07:45:19 +00:00
Camilo Celis Guzman 7cffb40c2e rtpvp9pay: minor refactor of PictureID logic
This brings the logic inline with the vp8pay

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4530>
2023-05-05 07:45:19 +00:00
Camilo Celis Guzman a79616ea7a rtpvp8pay: avoid reseting PictureID if NO_PICTURE_ID mode is set
There is no logical change here, as `& (1 << nbits) - 1` would produce also 0
when NO_PICTURE_ID mode is choosen. However, this avoid computing a random
integer that is actually unused.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4530>
2023-05-05 07:45:19 +00:00
Camilo Celis Guzman 7dd6375c5e rtpvp8pay, rtpvp9pay: use GType like name for PictureIDMode
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4530>
2023-05-05 07:45:19 +00:00
U. Artie Eoff 649d59b88b gst-libav: add avvideocompare element
The avvideocompare element compares two incoming video buffers using
the specified comparison method (e.g. ssim or psnr).  The first
video buffer is passthrough, unchanged.

The comparison is calculated by using libav's ssim or psnr filters.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3366>
2023-05-04 19:34:06 +00:00
Seungha Yang ddcc5676d3 mfvideoenc: Allow only even resolution numbers
Some H/W vendors support odd resolution if D3D11 texture is used
or via IMF2DBuffer, but not all vendors support it.
Also software MFT does not allow odd resolution.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1165
Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2537
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4540>
2023-05-04 18:06:45 +00:00
Sebastian Dröge a79774be74 gstreamer: pluginloader: Remove unnecessary Windows special cases
The Windows plugin loader is in a separate file.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4541>
2023-05-04 09:25:49 +03:00
Sebastian Dröge 7e12f8fb6a gstreamer: #undef a few local #defines after usage
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4541>
2023-05-04 00:17:47 +03:00
Sebastian Dröge 58fcfd8721 gstreamer: ptpclock: Remove unnecessary empty line
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4541>
2023-05-04 00:15:33 +03:00
Sebastian Dröge 914c094764 gstreamer: Fix minor memory leak in error path for internal path depth helper function
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4541>
2023-05-04 00:14:29 +03:00
Sebastian Dröge f9dff72726 ptp: Allow relocation of GStreamer installation for finding PTP helper process
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4538>
2023-05-03 17:01:07 +00:00
Sebastian Dröge 5cb245b011 gst: pluginloader: De-duplicate count_directories() private function
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4538>
2023-05-03 17:01:07 +00:00
Xabier Rodriguez Calvar 021572de93 qtdemux: emit no-more-pads after pruning old pads
If we don't do that, clients can rely on this signal to see the final pad
topology but it won't be the real one as some of them will disappear after
emitting that signal. This can happen after injecting a different init segment.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4535>
2023-05-03 12:06:00 +00:00
Nicolas Dufresne 3bd43672ec v4l2: device provider: Fix GMainLoop leak
On very quick start/stop, the mainloop may never be run. As a side
effect, our idle stop function is not really being ran, so we can't rely
on that to free the main loop. Simply unref the mainloop when the
thread have completely stop.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4521>
2023-05-03 10:04:58 +00:00
Carlos Rafael Giani 3fbcf5fcf3 qtdemux: Only set appsink sync property and check for async state changes
By keeping async to TRUE, a deadlock is avoided where the appsink is
filled with data after a flushing seek but before its PAUSED->PLAYING
state change finishes. If that happens, the appsink is stuck, because
its internal condition variable waits for the appsink to have more room
for data. The basesink's preroll lock is held during this, and it also
tries to acquire that lock during the state change -> deadlock.
By keeping async to TRUE, this flood of data does not happen.

Also, setting the max-buffers property to 1 is unnecessary - the test
runner will anyway detect excess memory usage if it happens.

Other property adjustments turned out to just be redundant.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4200>
2023-05-03 08:47:56 +00:00
Carlos Rafael Giani 0071c97128 qtdemux: Add audio clipping meta when playing gapless m4a content
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4200>
2023-05-03 08:47:55 +00:00
Carlos Rafael Giani 51ebda4df5 qtdemux: use qtdemux debug category instead of default in qtdemux_tags.c
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4200>
2023-05-03 08:47:55 +00:00
Philippe Normand 4db12345d1 webrtcbin: Fix potential deadlock when closing before any data was sent
A blocking pad probe is added on new sink pads, it's usually removed after the
caps have been negotiated or the signaling state switched to stable, but if that
never happens and the pad is released we kept the pad probe active, leaving the
pad blocked, preventing clean disposal.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4529>
2023-05-03 02:29:31 +00:00
Tim-Philipp Müller 83026f6289 amrnb, amrwbdec: move AMR-NB and AMR-WB plugins to -good
Fedora ships these libraries as part of the main distribution now,
and they are decades old anyway so don't implement any of the newer
features.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4512>
2023-05-02 23:33:12 +00:00
Jan Schmidt e1faaefea0 glvideomixer: Implement force-live and min-upstream-latency properties
Proxy the force-live and min-upstream-latency propertyies to the internal
glvideomixerelement at construction time. force-live has to be set
during construction of the glvideomixerelement, so that has to be
deferred until the _constructed() call. Make sure that all other
existing proxied properties will still get set once the element
is created.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4494>
2023-05-02 22:47:38 +00:00
François Laignel 5ef2ce69ff rtpmanager/rtsession: race conditions leading to critical warnings
While testing the [implementation for insertable streams] in `webrtcsink` &
`webrtcsrc`, I encountered critical warnings, which turned out to result from
two race conditions in `rtpsession`. Both race conditions produce:

> GLib-CRITICAL: g_hash_table_foreach:
>   assertion 'version == hash_table->version' failed

This commit fixes one of the race conditions observed.

In its simplest form, the test consists in 2 pipelines and a Signalling server:

* pipelines_sink: audiotestsrc ! webrtcsink
* pipelines_src: webrtcsrc ! appsrc

1. Set `pipelines_sink` to `Playing`.
2. The Signalling server delivers the `producer_id`.
3. Initialize `pipelines_src` to establish a session with `producer_id`.
4. Set `pipelines_src` to `Playing`.
5. Wait for a buffer to be received by the `appsrc`.
6. Set `pipelines_src` to `Null`.
7. Set `pipelines_sink` to `Null`.

The race condition happens in the following sequence:

* `webrtcsink` runs a task to periodically retrieve statistics from `webrtcbin`.
  This transitively ends up executing `rtp_session_create_stats`.
* `pipelines_sink` is set to `Null`.
* In `Paused` to `Ready`, `gst_rtp_session_change_state()` calls
  `rtp_session_reset()`.
* The assertion failure occurs when `rtp_session_reset` is called while
  `rtp_session_create_stats` is executing.

This is because `rtp_session_create_stats` acquires the lock on `session` prior
to calling `g_hash_table_foreach`, but `rtp_session_reset` doesn't acquire the
lock before calling `g_hash_table_remove_all`.

Acquiring the lock in `rtp_session_reset` fixes the issue.

[implementing insertable streams support]: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1176

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4528>
2023-05-02 21:56:39 +00:00
Guillaume Desmottes 5a7ed3c89d srt: assert instead of segfault when passing no error to ERROR_TO_WARNING
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4524>
2023-05-02 21:01:45 +00:00
Guillaume Desmottes 3a5510f61c srt: fix segfault if send_headers() failed
The error handling code was assuming that 'internal_error' was set,
while we were passing the caller GError.
The internal error is already propagated to the caller later on.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4524>
2023-05-02 21:01:45 +00:00
Tim-Philipp Müller f64acbf9e5 pluginfeature: fix unexpected version check behaviour for git versions
check_version(1.23.1) would return TRUE for a git development version
like 1.23.0.1, which is quite confusing and somewhat unexpected.

We fixed this up in the version check macros already in !2501, so this
updates the run-time check accordingly as well.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4513>
2023-05-02 18:09:42 +00:00
Xabier Rodriguez Calvar 66c15bc753 qtdemux: Fix segfault in cenc sample grouping
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4523>
2023-05-02 11:32:01 +02:00
Philippe Normand d9c853f165 dtlstransport: Keep strong ref of dtls encoder/decoder
Otherwise get_property() calls for the client, certificate and/or
remote-certificate properties might access moved objects, since the encoder and
decoder are added to the transportsendbin.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4519>
2023-05-02 03:54:53 +00:00
Nicolas Dufresne 51fa6a2656 v4l2: pool: Flush events on capture queue
Unfortunately streamoff does not flush the events, and this can cause all
sort of issues. Flush events on capture queue. We also return
GST_V4L2_FLOW_RESOLUTION_CHANGE in case a resolution change was seen.
This allow skipping streamon(capture) on flush, which could lead to a
configuration miss-match, or failure if the buffers aren't of the right
size.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4437>
2023-05-01 15:08:10 -04:00
Nicolas Dufresne 00492234bd v4l2: videodec: Detect flushes while setting up the capture
As we missed the fact we were flushing, we could create and activate
that buffer pool, and wait on it, causing a hang. We detect that we
are flushing by checking the related pad state.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4437>
2023-05-01 13:45:39 -04:00
Nicolas Dufresne c9841a5383 v4l2: bufferpool: Don't copy buffer when flushing
Threshold handling can race with flushing operation. This can lead to
avoidable buffer copies. Simply check and return the flushing status.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4437>
2023-05-01 13:45:16 -04:00
Nicolas Dufresne c6be3d7505 v4l2: videodec: Don't forcibly drain on resolution changes
Let the driver detects the change and reconfigure the capture side
transparently from there. This avoid reallocation of the output buffers,
and eliminates the need to stop and restart the capture task. This is
only happening if the driver have support for this, otherwise the old
behaviour is maintained.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4437>
2023-05-01 13:44:53 -04:00
Nicolas Dufresne f58d5dfd30 v4l2: videodec: Remove the spurious srccaps probe
We don't need to probe the srccaps in set_format() anymore, this
handled already in the capture thread while setting up the capture
queue.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4437>
2023-05-01 13:44:41 -04:00
Nicolas Dufresne 4a53beeb1f v4l2: videodec: Improve few logs
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4437>
2023-05-01 13:44:37 -04:00
Nicolas Dufresne fca61fad4d v4l2: videodec: Only warn of incomplete drain on success
We may have hit an error, or just flushing in order to stop the thread,
in which case, not having drain everything is expected and not a
driver bug.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4437>
2023-05-01 13:44:19 -04:00
Nicolas Dufresne 4dded20929 v4l2: bufferpool: Don't assert when orphaning is not needed
This may happen when shutting down and should not cause
any harm. This removes the associated assert when shutting
down the pipeline, notably with CTRL+C.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4437>
2023-05-01 13:43:36 -04:00
Nicolas Dufresne 66849fbdd1 v4l2: videodec: Wait for source change event
Stop doing capture buffer allocation based on guesses
and wait for the source change event when available.
Unlike stateless decoder, the stateful decoder is not aware of
the coded resolution, and this may lead to the wrong result
even when using TRY_FMT.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4437>
2023-05-01 13:43:16 -04:00
Nicolas Dufresne 5c820862fd v4l2: object: Move the GstPoll into v4l2object
Moves the GstPoll from the buffer pool into v4l2object. This will be
needed to poll for events before the pool has been created.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4437>
2023-05-01 13:43:03 -04:00
Nicolas Dufresne 457dd19a90 v4l2: object: Fix bogus debug objects pointers
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4437>
2023-05-01 13:42:59 -04:00
Nicolas Dufresne 52b916bdf5 v4l2: videodec: Move the capture setup into the processing loop
In previous implementation that job was split between handle_frame and
the processing loop and it wasn't clear if this mechanism was race
free. The capture setup would also be tried for every buffer, which was
not necessary.

This also simplify the handling of SRC_CH event, dropping the unneeded
atomic boolean.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4437>
2023-05-01 13:42:35 -04:00
Nicolas Dufresne 1ca7f6949e v4l2: videodec: Ensure object is inactive on failure
Sprinkle stop() calls in error case to guaranty that the capture object
is inactive on failure. Not doing so could allow some code to be called
in unexpected (and possibly undefined) conditions.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4437>
2023-05-01 13:42:02 -04:00
Mihail Ivanchev 8e64dea5c6 gstcodectimestamper: remove PC file generation from plugin's own meson.build
The file generated here is incomplete; it is generated for all plugins in a loop at an upper level.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4518>
2023-05-01 16:41:32 +00:00
jeri.li 2b63e30852 v4l2bufferpool: add lock as atomic operation for seek
When seek flush, gst v4l2 buffer pool flush is not atomic which will
lead double enqueue buffer (qbuf) issue, and v4l2 buffer pool qbuf is
also not atomic which will lead no free buffer found in the pool.
1. add lock for calculate enqueue number in streamon function
2. add lock for v4l2 capture end streamoff in pool flush function
3. lock the whole funciton of v4l2 buffer pool qbuf, then the buffer
   pool index and qbuf operation are atomic

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4465>
2023-05-01 15:53:02 +00:00
Haihua Hu 1c488626da v4l2src: fix cannot reuse current caps when fixate caps in negotiation
when regotiation happens, v4l2src will check if it can reuse current caps,
but we need check if current caps is subset of all query caps from downstream
instead of check it with query caps one by one.

Assuming that the current caps is not the subset of first caps from query caps,
it will go to try fmt. when try fmt success, v4l2src will make pending_set_fmt
to TRUE and going to reset.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4500>
2023-05-01 15:05:26 +00:00
Thibault Saunier ceb0aca906 sharp: Mark _reserved fields as padding
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3911>
2023-04-29 21:52:19 -04:00
Thibault Saunier 40a6f2dc91 discover: Avoid double freee when creating info from cache file
Passing ownership to the function as the created info is made owner.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3911>
2023-04-29 06:54:10 -04:00
Thibault Saunier 0f229aa62a discoverer: Add serializing unknown stream type support
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3911>
2023-04-29 06:54:10 -04:00
Thibault Saunier e8e5508d1d ges: Add test for the newly added DiscovererManager object
Making pep8 happy on the way

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3911>
2023-04-29 06:54:10 -04:00
Thibault Saunier 98e5c5e862 ges: Implement a new GESDiscovererManager object
Allowing better control over the way discovery happens and allowing
us to expose a proper API.

This also adds the potential of implementing more multi-threaded
discovery in a clean way in the future.

This allows us to cleanly expose the new
GstDiscoverer::load-serialize-info signal.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3911>
2023-04-29 06:54:10 -04:00
Thibault Saunier 9e994ea616 discoverer: Add a signal to retrieve serialized GstDiscovererInfo
This allows user to serialize the GstDiscovererInfo in other places
than the default folder, like a database when running web services for
examples.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3911>
2023-04-29 06:47:55 -04:00
He Junyan 96e576a818 va: h265enc: map the mbbrc to correct enum value in get_property()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4509>
2023-04-28 16:46:24 +00:00
He Junyan 5d1c35bd16 va: h264enc: map the mbbrc to correct enum value in get_property()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4509>
2023-04-28 16:46:24 +00:00
Thibault Saunier 187d91627c rtpsrc: Give better names to internal elements
Same name was used for all instances of rtpsrc making debugging more complex

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4484>
2023-04-28 16:00:47 +00:00