1997 Commits

Author SHA1 Message Date
Seungha Yang
0f4bddc9a9 wasapi2: Add support for format negotiation
Enumerate supported formats during open so that src/sink can
report them via get_caps(). The format is then fixated and
initialized on acquire(), allowing users to select their
preferred format

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9586>
2025-08-22 22:10:28 +00:00
Seungha Yang
d9279a5145 wasapi2: Enumerate supported shared mode formats
... and report it via device provider property

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9586>
2025-08-22 22:10:28 +00:00
Seungha Yang
c97ed1e6f6 wasapi2: Workaround for S24_32LE format mismatch
Since Windows 24bit-in-32bit format is not supported
by GStreamer (Windows one is MSB-aligned), converts format
in ringbuffer using SSE2.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9586>
2025-08-22 22:10:28 +00:00
Seungha Yang
0d94713288 wasapi2: Demote S24_32LE in exclusive-mode format ordering
Some endpoints accept 24-bit in 32-bit PCM (S24_32LE) in exclusive mode
but playback at very low volume. Until the root cause is identified,
push S24_32LE to the end of the candidate list

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9586>
2025-08-22 22:10:27 +00:00
Seungha Yang
f2aabd6a71 wasapi2: Add support for exclusive mode device switching
Because of APO/OS mixer bypass in exclusive mode, we should
convert samples if new device has different format.
The conversion with additional buffering is implemented in this patch

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9586>
2025-08-22 22:10:26 +00:00
Seungha Yang
4257cd8546 wasapi2: Fix process loopback device init
Fix AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM flag usage

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9586>
2025-08-22 22:10:26 +00:00
Seungha Yang
18b5398960 wasapi2: Add support for exclusive mode
Add "exclusive" property and try exclusive mode streaming

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9586>
2025-08-22 22:10:25 +00:00
Seungha Yang
370499875c wasapi2: Probe exclusive mode formats
... and report it via device provider props

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9586>
2025-08-22 22:10:25 +00:00
Ian Napier
aee742223c decklinkvideosrc: fix decklinkvideosrc becomes unrecoverable if it fails to start streaming
See #2611

When transitioning to PLAYING we call IDeckLinkInput::StartStreams() (via GstDecklinkInput::start_streams). This can
fail for various reasons, including if the hardware device is already in use.

Previously, we logged StartStreams() failure as an element error but otherwise continued to successfully transition to
PLAYING. Now, if StartStreams() returns an error we fail the state change.

If StartStreams() fails then a subsequent call to StopStreams(), when transitioning PAUSED to READY, will also fail.

Previously, if StopStreams() failed then the state change also failed. Unfortunately this prevented the element from
later being disposed, which in turn meant the associated hardware resources was never freed. Consequently, if a
decklinkvideosrc failed to transition PAUSED to READY, then the associated hardware device could not subsequently be
used by any other decklinkvideosrc.

Now, we log an element error if StopStreams() fails but otherwise consider the state change to have succeeded. This
means that the element can be disposed and the associated hardware resource released.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9578>
2025-08-20 11:38:03 +00:00
Seungha Yang
7a48a0036f wasapi2: Warm up capture audio client on open
If the endpoint is idle, the first IAudioClient::Start() call
may take a long time to return. Start/stop the capture client
on open to reduce latency of subsequent Start() calls.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9553>
2025-08-14 12:38:41 +00:00
Seungha Yang
cb7dcff69e wasapi2sink: Do not push too large preroll buffer to endpoint
To avoid startup glitches, a silent buffer is pushed to
render endpoint, but pushing too large silent buffer will
introduce unnecessary latency. Limit it to a single period worth data.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9553>
2025-08-14 12:38:41 +00:00
Seungha Yang
42758aac2c wasapi2: Tone down activation fail log
If there's no endpoint available, that failure is expected error

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9521>
2025-08-11 12:29:52 +00:00
Seungha Yang
e0146536ab wasapi2: Pass correct data flow value to GetDefaultAudioEndpoint()
Respect requested data flow value

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9521>
2025-08-11 12:29:51 +00:00
Seungha Yang
1cba38145f wasapi2: Fix default render device probing
Fixing typo

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9517>
2025-08-08 18:39:51 +00:00
Nirbheek Chauhan
e8e12db5f4 debug: Category init should happen in class_init when possible
plugin_init() will not get called if element/feature registration
happens manually, such as when using linking only specific plugin
features with gstreamer-full. That is possible when plugins contain
static features.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9496>
2025-08-08 11:38:50 +05:30
Seungha Yang
6af0ea60c1 wasapi2: Always fallback to MMDevice if default device is unavailable
Automatic stream routing supported virtual device may not be
available for some reason, but can try default MMdevice

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9468>
2025-08-05 13:40:29 +00:00
Seungha Yang
2769f8ff44 wasapi2: Always probe default audio endpoint info
Regardless of GetActivateResult() return code, fill default
device information to device provider props

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9468>
2025-08-05 13:40:29 +00:00
Seungha Yang
fedced4017 wasapi2: Handle GetActivateResult failure
Even if GetActivateResult() succeeded, activation result can fail.
Checks output HRESULT code as well

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9468>
2025-08-05 13:40:29 +00:00
Seungha Yang
7651662fc9 wasapi2deviceprovider: Log device update details
... and add wasapi2deviceprovider debug category

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9468>
2025-08-05 13:40:29 +00:00
Seungha Yang
7d6d49a888 wasapi2enumerator: Retry on IMMDevice::Activate failure
Since the sequence of IMMDeviceEnumerator::EnumAudioEndpoints()
followed by IMMDevice::Activate() is not atomic, Activate() may fail
if the enumerated device becomes invalidated before probing.
In such cases, retry device probing

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9468>
2025-08-05 13:40:29 +00:00
Seungha Yang
df95f95206 wasapi2enumerator: Avoid racy device probing
IMMDeviceEnumerator may fire a series of callbacks even for a single
device plug/unplug event. To avoid redundant probing, start device
enumeration only after no further callbacks are received for 100ms.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9468>
2025-08-05 13:40:29 +00:00
Seungha Yang
e515b1aee8 wasapi2enumerator: Log IMMNotificationClient callback details
... and add wasapi2enumerator debug category

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9468>
2025-08-05 13:40:28 +00:00
Víctor Manuel Jáquez Leal
f170eff6bb vaXXXenc: fix potential race condition
VA encoders, at reconfiguration, have to check if the rate-control was changed
by the user, but since user parameters setting are in another thread, the
comparison was racy.

This patch locks the object to compare the current rate-control with the one set
by the user.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9480>
2025-08-01 15:20:56 +00:00
Jonathan Lui
c81c19bfdc vaav1enc: Enable intrablock copy and palette mode
This allow screen content coding (SCC) optimization feature.

Co-authored-by: Victor Jaquez <vjaquez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8560>
2025-08-01 13:42:37 +00:00
Seungha Yang
0c378091a0 d3d12screencapturedevice: Avoid false device removal on monitor reconfiguration
Post device-changed instead of device-removed/device-added when
only HMONITOR or display position changed without actual device change.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9472>
2025-08-01 12:51:46 +00:00
Marc-André Lureau
78f0f61523 meson: d3d12: Add support for MinGW DirectXMath package
This is a similar issue that was found for d3d11:
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6495

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9464>
2025-07-31 15:09:34 +00:00
Amotz Terem
489e908a92 nvcodec: Add emit-frame-stats signal
Add emit-frame-stats property to optionally emit frame stats on each frame

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9429>
2025-07-30 14:13:46 +00:00
Nirbheek Chauhan
87ed0c0e33 windows: Disable all audio device providers except wasapi2
We have too many device providers outputting duplicate device entries,
and it's not clear to people what they should be using. Let's only
keep wasapi2 around since it is PRIMARY + 1.

After the device switching work done on WASAPI2, there is no reason to
use directsound anymore.

https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9326

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9438>
2025-07-30 00:21:18 +00:00
Philippe Normand
009192bde4 vavp9dec: Always chain to parent class negotiate vmethod
When the base videodecoder class re-attempts a negotiation after flush, the
vabasedec `need_negotiation` flag isn't necessarily set to TRUE, because in that
situation the input state hasn't changed.

By always chaining up we are sure that buffer pool negotiation will always be
attempted.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9457>
2025-07-29 21:34:59 +01:00
Philippe Normand
eab8abad8c vajpegdec: Always chain to parent class negotiate vmethod
When the base videodecoder class re-attempts a negotiation after flush, the
vabasedec `need_negotiation` flag isn't necessarily set to TRUE, because in that
situation the input state hasn't changed.

By always chaining up we are sure that buffer pool negotiation will always be
attempted.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9457>
2025-07-29 21:34:59 +01:00
Philippe Normand
8317dd5ef3 vaav1dec: Always chain to parent class negotiate vmethod
When the base videodecoder class re-attempts a negotiation after flush, the
vabasedec `need_negotiation` flag isn't necessarily set to TRUE, because in that
situation the input state hasn't changed.

By always chaining up we are sure that buffer pool negotiation will always be
attempted.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9457>
2025-07-29 21:34:59 +01:00
Philippe Normand
92931e2907 vabasedec: Instrument negotiate function with debug statements
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9457>
2025-07-29 21:34:59 +01:00
Philippe Normand
a28a040913 vabasedec: Always chain to parent class negotiate vmethod
When the base videodecoder class re-attempts a negotiation after flush, the
vabasedec `need_negotiation` flag isn't necessarily set to TRUE, because in that
situation the input state hasn't changed.

By always chaining up we are sure that buffer pool negotiation will always be
attempted.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9457>
2025-07-29 20:31:21 +01:00
Philippe Normand
914beb9756 vah264dec: Spelling fix in warning debug statement
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9457>
2025-07-29 20:31:21 +01:00
Seungha Yang
461e3946d4 d3d12: Add support for dewarping fisheye images
Add d3d12fisheyedewarp element that performs fisheye image dewarping
using D3D12. A UV remap LUT texture is generated via a compute shader,
and the actual remapping is performed in a pixel shader using this LUT

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9441>
2025-07-27 01:22:28 +09:00
Víctor Manuel Jáquez Leal
4a986e611b vaXXXenc: calculate latency with corrected framerate
Fixes: #4558
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9437>
2025-07-25 09:56:50 +00:00
Seungha Yang
0d2157e801 wasapi2: Add continue-on-error property
If enabled, wasapi2src/sink will post a warning message instead of an error,
when device failures occur, such as open failure, I/O error,
or device removal.
The element will continue to produce/consume audio buffers and behave as if
a capture/render device were active, allowing pipeline to keep running even when
no audio endpoint is available

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9326>
2025-07-24 17:04:53 +00:00
Seungha Yang
37637d9611 wasapi2: Use 48kHz default sample rate
That's most common default value

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9326>
2025-07-24 17:04:53 +00:00
Seungha Yang
fc861119ed wasapi2deviceprovider: Probe device form factor and enumerator name
Adding form factor and enumerator information to device property struct

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9326>
2025-07-24 17:04:53 +00:00
Seungha Yang
9dbc7a491e wasapi2: Add support for dynamic device switch
Ringbuffer implementation is re-written to support "device" property
change in playing state

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9326>
2025-07-24 17:04:53 +00:00
Seungha Yang
5325ec41e4 nvencoder: Always allow interlaced stream
... even if hardware does not support interlaced encoding at bitstream level.
Although interlacing information is not written in the bitstream,
that information can be signalled via container, thus allow interlaced
stream.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9328>
2025-07-22 15:49:04 +00:00
Seungha Yang
4f932ee081 d3d12swapchainsink: Add last-rendered-sample action signal
Add a new action signal to allow applications to capture
the most recently rendered frame directly from the swapchain
back buffer.

Unlike the existing "last-sample" property, which exposes
the raw input sample before any sink-side processing, this
signal captures the final displayed image after any internal
image processing (e.g., UV remap, color balance, overlay) has been
applied.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9423>
2025-07-22 12:02:15 +00:00
Seungha Yang
0d1cd40097 d3d12swapchainsink: Update uv-remap signal to support background color
Allow per viewport background color setting

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9393>
2025-07-17 12:55:11 +00:00
Seungha Yang
fc73216671 d3d12swapchainsink: Fix force-aspect-ratio change in playing state
Set output updated flag so that viewport can be calculated again

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9392>
2025-07-14 17:07:35 +00:00
Piotr Brzeziński
c43d3900bf vtenc: Fix negotiation failure with profile=main-422-10
Previous version passed just enough data to the parser to detect
main/main-10, but main-422-10 is one of the range extensions profiles.
Those need a few more bits to be accurately detected, and since those
were just uinitialized memory previously, we'd incorrectly end up with
main or main-10 when the encoder was in fact giving us 4:2:2 10bit
output.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9348>
2025-07-10 08:04:45 +00:00
Doug Nazar
50a6f31902 decklink: Fix a memory leak
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9151>
2025-07-08 09:05:29 +00:00
Seungha Yang
feedb9a769 hipmemorycopy: Use stream associated with buffer
... instead of global device stream. memory object might hold
different stream.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9281>
2025-07-07 14:39:54 +00:00
Seungha Yang
c1f023baaf hipconverter: Avoid unnecessary sync
If input and output buffers are running on the same stream,
record event instead of sync

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9281>
2025-07-07 14:39:54 +00:00
Seungha Yang
7d259c4224 hipmemory: Allow lazy sync
Store recorded hip event and wait for sync later if needed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9281>
2025-07-07 14:39:54 +00:00
Seungha Yang
e9d96fd4e7 hip: Add GstHipEvent object
hip event handle wrapper object

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9281>
2025-07-07 14:39:54 +00:00