Commit graph

4388 commits

Author SHA1 Message Date
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
Jordan Petridis 8339384d3a jack: return TRUE during init when failing to dlopen
If we return FALSE, that means the plugin won't be tried again,
even if jack is available afterwards.

Followup to 689dbd1fbe

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4507>
2023-04-28 14:57:38 +00:00
Seungha Yang c98ad6f249 wasapi2: Allows process loopback capture on Windows 10
As per MS documentation[1], it requires Windows 10 Build 20348
but it seems to be supported by old versions too

[1] https://learn.microsoft.com/en-us/windows/win32/api/audioclientactivationparams/
ns-audioclientactivationparams-audioclient_process_loopback_params

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2524
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4505>
2023-04-28 14:11:16 +00:00
Sebastian Dröge 3044b0992f Revert "splitmuxsink: Avoid assertion when WAITING_GOP_COLLECT on reference context"
This reverts commit f29c19be58. If this is
called for the reference context then we would run into an infinite
loop, which is not really better than an assertion.

By fixing up DTS to never be ahead of the PTS in the previous commit
this situation should be impossible to hit now.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4498>
2023-04-28 11:00:19 +00:00
Sebastian Dröge de907c225b splitmuxsink: Catch invalid DTS to avoid running into problems later
DTS > PTS makes no sense, so we clamp DTS to the PTS. Also if there's a
PTS but no DTS, then assume that PTS=DTS to make sure we're not working
with a much older DTS.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4498>
2023-04-28 11:00:19 +00:00
Nirbheek Chauhan 479f0175b5 meson: Add feature options for optional va deps libdrm and gudev
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4428>
2023-04-28 15:22:31 +05:30
Nirbheek Chauhan 55ee0635d3 meson: Fix libdrm and vaapi configure checks
We do not need fallback: for libdrm checks because the wrap file
already has a [provide] section.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4428>
2023-04-28 15:21:10 +05:30
Víctor Manuel Jáquez Leal 3a09e700e6 vkswapper: missing image barrier after vkCmdClearColorImage
After clear color image command the swapper image needs to add a barrier before
copying the buffer to display on it. Otherwise a potential synchronization
problem might occur.

Fixes #2403

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4501>
2023-04-28 00:59:57 +00:00
Víctor Manuel Jáquez Leal f12e052e54 vulkan: use VK_QUEUE_FAMILY_IGNORED in barriers
Instead of using the valid queue family 0 (zero) if there aren't queue transfers
there's no need to specify a not validated queue family, but just
VK_QUEUE_FAMILY_IGNORED.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4501>
2023-04-28 00:59:57 +00:00
Seungha Yang 4ed3c46de7 cudamemory: Fix for semi planar YUV memory size decision
UV plan of the semi planar format requires only half of Y plane size

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4502>
2023-04-27 20:55:53 +00:00
Seungha Yang fafecf9cb3 sample: Add gst_clear_sample() method
Similar to other GstMiniObject clear helper methods like
gst_clear_buffer().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4473>
2023-04-28 04:38:30 +09:00
Seungha Yang b7083ad242 sample: Fix typo around gst_sample_copy() method
It's sample, not buffer

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4473>
2023-04-27 18:35:41 +00:00
Sebastian Dröge ef89bac181 rtspsrc: Fix handling of * control path
Regression introduced by 7f9d689572.
Thanks to Tristan Matthews for reporting this.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4497>
2023-04-27 13:47:56 +00:00
Edward Hervey 0db6149880 decodebin3: Handle streams without CAPS or TIME segment
decodebin3 will do its best to figure out whether a parsebin is required to
process the incoming stream.

The problem is that for push-based stream it could happen that the stream would
not provide any caps, resulting in nothing being linked internally.

Furthermore, there is the possibility that a stream *with* caps would not be
using a TIME segment, which is required for multiqueue to properly work.

In order to fix those two issues, we force the usage of parsebin on push-based
streams:
* When the pad is linked, if upstream can't provide any caps
* When we get a non-TIME segment

Fixes #2521

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4492>
2023-04-27 12:50:21 +00:00
Stéphane Cerveau 61416bc532 pbutils: add video/x-ivf to descriptions
Add missing description for video/x-ivf spotted
with gst-discoverer-1.0

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4248>
2023-04-27 06:45:27 +00:00
Stéphane Cerveau f0d61ac8b0 libav: set the frame rate values in ffmpeg stream context
To avoid a default value to be used in mux.c+304, give the
frame rate detected from the caps.

Fix IVF header.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4248>
2023-04-27 06:45:26 +00:00
Stéphane Cerveau 6f21ef9d3a libav: add av1 to gst_ffmpeg_caps_to_codecid
Restrict the stream-format to obu-stream
and the alignment to "tu" and "frame" as "obu"
is not properly supported by libav.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4248>
2023-04-27 06:45:26 +00:00
Daniel Moberg 4c1de25e9d webrtc: do not tear down data channel before data is flushed
Current implementation can in some cases detect
that all data is sent but in reality it is not,
leading to a push to an unlinked pad.
This is a race between the probe used to track data sent and a
call to close.

This patch sends an EOS before starting the close procedure
and then waits for the EOS event to come through to the
src pad before commencing with tear down.
This ensures that any queued data before EOS is flushed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4462>
2023-04-27 00:40:18 +00:00
Matthew Waters 262be30b6f ccutils: generate valid padding in field 1 when needing to generate field 2
Fixes CC in Field 2 but not in Field 1 errors.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4490>
2023-04-26 20:43:13 +00:00
Seungha Yang 4710f45e65 d3d11videosink: Fix for ignored initial render rectangle
Application can set target render rect before internal HWND
configuration

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2518
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4480>
2023-04-26 19:39:09 +00:00
Sebastian Szczepaniak 277a9f0cef qtdemux: Add support for cenc sample grouping
Co-authored-by: Xabier Rodriguez Calvar <calvaris@igalia.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3551>
2023-04-26 18:51:56 +00:00
Guillaume Desmottes 0d254f59b8 core: pad: fully log event being pushed
It's useful when debugging to check the details of the event being sent,
like the segment for example.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4493>
2023-04-26 18:00:14 +00:00
Mathieu Duponchelle 781a228d3a docs: update hotdoc theme to 0.15
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4488>
2023-04-26 13:50:42 +02:00
Mathieu Duponchelle 3868771191 docs-index: de-hardcode toned row color
Instead use a bootstrap panel and let styling occur based on that,
making the index page work well with the dark theme.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4488>
2023-04-26 13:50:21 +02:00
Thibault Saunier 9dda8050f2 validate: Add a way to avoid checking property value after setting it
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4485>
2023-04-26 00:03:06 +00:00
Hou Qi aed4d31e67 decodebin3: fix segment fault when print decoder log
Segment fault happens when cannot find decoder but try to print
decoder name. Need to check the decoder.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4461>
2023-04-25 21:42:15 +08:00
Stéphane Cerveau 40bd8468af bad: disable dtls test if openssl is not present
On MacOS with homebrew, the openssl library is not
properly detected with pkg-config.
So disable the test compilation if openssl
is not properly detected along with libcrypto.

libcrypto is detected but it uses the system one
which leads to the error:

your binary is not an allowed client of /usr/lib/libcrypto.dylib for
architecture x86_64

See more details from Apple:

https://developer.apple.com/forums/thread/124782

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4481>
2023-04-25 10:01:57 +00:00
Yinhang Liu 35177b81b3 msdk: Fix segfault for OneVPL dispatcher + legacy MSDK runtime path
From the spec, the OneVPL dispatcher should be able to work with
legacy MSDK runtime:
https://www.intel.com/content/www/us/en/docs/onevpl/upgrade-from-msdk/2023-1/onevpl-hardware-support-details.html

Currently supported capabilities:
  OneVPL dispatcher + OneVPL runtime: dynamic capability
  MSDK dispatcher + MSDK runtime: static capability
  MSDK dispatcher + OneVPL runtime: static capability
  OneVPL dispatcher + legacy MSDK runtime: static capability

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4466>
2023-04-25 08:09:29 +00:00
Yinhang Liu e97b5ad355 msdk: Add NumFilters check for VPP description
When NumFilters is equal to 0, the function should return
immediately.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4466>
2023-04-25 08:09:29 +00:00