Commit graph

1680 commits

Author SHA1 Message Date
Seungha Yang
d5d17d804e nvencoder: Disable stream ordered allocation
Stream ordered allocation is not supported by encoder

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7427>
2024-09-11 17:15:14 +00:00
Seungha Yang
f72a775d03 cudaipcsink: Disable stream ordered allocation
Legacy CUDA IPC does not support default CUDA memory pool

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7427>
2024-09-11 17:15:14 +00:00
Michael Tretter
76d753f1c5 uvcsink: set cur_caps to upstream selected caps
If the UVC gadget announces multiple formats in the descriptors the uvcsink
doesn't select the actual format but let's the UVC hosts select the format.

If the GStreamer pipeline is started before a UVC host selected the format,
upstream decides on a format until the UVC host has decided. In this case, the
current format needs to be set based on the caps from the caps event to be able
to detect if the format selection by the UVC host requires a format change on
the GStreamer pipeline.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7473>
2024-09-09 18:57:35 +00:00
Michael Tretter
f82a716009 uvcsink: skip comparison with prev_caps if they are not set
The uvcsink may be put into the READY state to start listening for UVC requests.
Therefore, the UVC host may set a streaming format before the GStreamer pipeline
is started and the uvcsink received a caps event. In this case, prev_caps will
be NULL.

If the EVENT_CAPS has not been received, skip the check if the format needs to
be changed, since the sink will be started with the format selected by the UVC
host, anyway.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7473>
2024-09-09 18:57:35 +00:00
Seungha Yang
63dc54906b nvencoder: Prefer byte-stream format over packetized
Since old encoder implementation supported only byte-stream,
prefers byte-stream format for backward compatibility.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3787
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7457>
2024-09-06 01:10:14 +09:00
Michael Scherle
b1cda4439b va: restrict interpolation & scaling property to iHD driver
interpolation & scaling is supported for all hardware on
iHD driver. But not supported in mesa driver. see:

<https://github.com/intel/media-driver/issues/1843>
<https://gitlab.freedesktop.org/mesa/mesa/-/issues/11803>

improvment of:
<https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7301>

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7443>
2024-09-05 13:11:37 +00:00
Víctor Manuel Jáquez Leal
85341d6dad vajpegenc: set interlace-mode, colorspace and sampling in output caps
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6022>
2024-09-05 09:56:02 +00:00
He Junyan
4550671b6f va: Implement the vajpegenc plugin
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6022>
2024-09-05 09:56:02 +00:00
He Junyan
f7e434028d va: baseenc: Check the bitrate property before get its value
Not all the encoders have the bitrate property, such as the jpeg enc.
We need to check that property before getting its value, or the glib
will print warnings.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6022>
2024-09-05 09:56:02 +00:00
Seungha Yang
9363a0af42 dwrite: Allow unlimited number of in-flight d3d12 commands
... so that it can be controlled by global direct command queue.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7444>
2024-09-04 12:56:43 +00:00
Seungha Yang
d0505fba55 d3d12: Add async-depth property
Adding a property to control the number of in-flight GPU commands
(default is unlimited). Note that actual maximum number is defined
in d3d12device's direct command queue object which is 32 now,
thus total number of scheduled GPU commands cannot exceed 32.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7444>
2024-09-04 12:56:43 +00:00
Piotr Brzeziński
e9ab880e66 vtenc: Use new release_frame/drop_frame encoder API
Replaces usage of gst_video_codec_frame_unref everywhere.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7173>
2024-09-04 06:46:07 +00:00
Piotr Brzeziński
00eb9ad62e vtenc: Restart encoding session when certain errors are detected
Sometimes under certain loads, VT can error out with kVTVideoEncoderMalfunctionErr or kVTVideoEncoderNotAvailableNowErr.
These have been reported to happen more often than usual if CopyProperty/SetProperty() is used close to the encode call.
Both can be worked around by restarting the encoding session.

These errors can be returned either directly from VTCompressionSessionEncodeFrame() or later in the encoding callback.
This patch handles both scenarios the same way - a session restart is be attempted on the next encode_frame() call.

If the error is returned immediately by the encode call, it's possible that some correct frames will still be given to
the output callback, but for simplicity (+ because I wasn't able to verify this scenario) let's just discard those.

In addition, this commit also simplifies the beach/drop logic in enqueue_buffer.

Related bug reports in other projects:
http://www.openradar.me/45889262
https://github.com/aws/amazon-chime-sdk-ios/issues/170#issuecomment-741908622

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7173>
2024-09-04 06:46:07 +00:00
Tim-Philipp Müller
59d56bcb3f gst-plugins-bad: use g_sort_array() instead of deprecated g_qsort_with_data()
Fixes compiler warnings with the latest GLib versions.

See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4127

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7384>
2024-09-02 22:31:34 +00:00
Michael Scherle
671281d860 va: add interpolation method for scaling
For description of interpolation methods, see:
<https://intel.github.io/libva/structVAProcPipelineParameterBuffer.html#abb95e119ed7f841f71b2afbec2104784>

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7301>
2024-08-20 08:36:03 +00:00
Víctor Manuel Jáquez Leal
d301324652 va: don't use GST_ELEMENT_WARNING in set_context() vmethod
Since bins can set the context of their children elements, the set_context()
vmethod shouldn't call bus messages post methods, since it locks the parent
object, the bin, which might be already locked, leading to a deadlock.

Fixes: #3706
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7378>
2024-08-19 14:34:28 +02:00
Seungha Yang
4bb3854772 d3d12: Add d3d12swapchainsink element
Adding a new videosink element for Windows composition API based
applications. Unlike d3d12videosink, this element will create only
DXGI swapchain by using IDXGIFactory2::CreateSwapChainForComposition()
without actual window handle, so that video scene can be composed
via Windows native composition API, such as DirectComposition.
Note that this videosink does not support GstVideoOverlay interface
because of the design.

The swapchain created by this element can be used with
* DirectComposition's IDCompositionVisual in Win32 app
* WinRT and WinUI3's UI.Composition in Win32/UWP app
* UWP and WinUI3 XAML's SwapChainPanel

See also examples in this commit which show usage of the videosink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7287>
2024-08-19 11:07:17 +09:00
Víctor Manuel Jáquez Leal
2caaf252b0 vah264enc: fix typo
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7337>
2024-08-16 19:52:06 +02:00
Víctor Manuel Jáquez Leal
af075a225e va: replace %d for %u format for system_frame_number guint32 variable
And also fixed the format for other less frequently printed variables.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7337>
2024-08-16 19:52:06 +02:00
Víctor Manuel Jáquez Leal
17fc4374b2 vah264enc: update b_pryamid property if it changes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7337>
2024-08-16 19:52:06 +02:00
Víctor Manuel Jáquez Leal
a5651f8b44 vah26xenc: use gst_h26x_slice_type_to_string()
Rather than custom function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7337>
2024-08-16 19:51:39 +02:00
He Junyan
a924e6c8bc va: deinterlace: Do not use the backward reference
num_backward_references > 0 means we need to cache several frames
after the current frame. But the basetransform class does not
provide any _drain() kind function, so we do not have the chance
to push out our cached frames when EOS or set caps event comes.
Rather than losing the last several frames, we should just give up
the backward reference here.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7348>
2024-08-15 15:26:07 +00:00
He Junyan
11a0b40b6e va: deinterlace: Push the forgotten leading frames if forward reference > 0
The current code forgets to push the first several frames if the forward
reference > 0. They are just cached in history array and will never be
deinterlaced and pushed.
For the first several frames, even the forward reference frames are not
enough, we still need to deinterlace them as normal and push them after that.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7348>
2024-08-15 15:26:07 +00:00
Víctor Manuel Jáquez Leal
a275694939 msdk: replace strcmp with g_strcmp0
Because strcmp doesn't handle NULL.

Fixes: #3721
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7347>
2024-08-13 11:10:07 +02:00
Benjamin Gräf
2638d8135d decklink: Add support for all modes of Quad HDMI recorder
By extending the GstDecklinkModeEnum with the additional modes supported by the Quad HDMI recorder,
we avoid using mode = 0 in case any of these resolutions is returned by the card.

Fixes#3713

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7302>
2024-08-09 11:29:59 +00:00
Matthew Waters
c541cbef92 decklink: fix win32 build error
This was not caught by the CI in the MR.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7307>
2024-08-06 10:04:40 +10:00
Matthew Waters
0699dd510d decklink: add support for HDR output and input
Supports PQ and HLG static metadata.

Support for HDR is queried from the device and selectively enabled when
supported.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7214>
2024-08-05 16:38:22 +00:00
He Junyan
f3d14d33a8 vah264enc: Fix intra only stream bug
When we set "ref-frames=0" to generate an intra only stream, the current
encoder just generates an assert and exit with error.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6577>
2024-08-03 10:18:40 +00:00
He Junyan
d177eb1a67 vah264enc: Improve B pyramid mode in H264
If the reference frame number is bigger than 2, we can enable the
pyramid B mode. We do not need to assign a reference frame to each
pyramid level.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6577>
2024-08-03 10:18:40 +00:00
He Junyan
2c833bd40e va: h264enc: Make the level table aligned
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6577>
2024-08-03 10:18:40 +00:00
Seungha Yang
c95873bbd5 d3d12screencapturesrc: Always release acquired frame
AcquireNextFrame() call should be paired with ReleaseFrame().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7293>
2024-08-02 15:36:14 +00:00
Seungha Yang
9b6a3170ae d3d12screencapturesrc: Do not recreate d3d11 device on capture error
Already opened d3d11 device including shader pipeline can be reused

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7293>
2024-08-02 15:36:14 +00:00
Seungha Yang
f5cd00fbd2 d3d12screencapturesrc: Fix deadlock on error
Don't try to wait for non-signalled fence

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7293>
2024-08-02 15:36:14 +00:00
Michael Scherle
f77189a7bf msdkvpp: add interpolation method
For description of interpolation modes, see:
<https://intel.github.io/libvpl/latest/API_ref/VPL_enums.html#interpolationmode>.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7278>
2024-08-02 14:39:47 +00:00
Matthew Waters
8dac91537d cuda/nvcodec: Add support for importing and producing embedded NVMM memory
As produced on the Nvidia Jetson series of devices.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7274>
2024-08-02 01:59:07 +00:00
Nirbheek Chauhan
fa25dd4de5 vtenc: Do not set the CRF/Quality parameter with ProRes
It's not supported with ProRes, setting the property will fail.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7232>
2024-07-30 12:42:17 +00:00
Nirbheek Chauhan
cbadb0b4ae vtenc: Log warnings when setting a property fails
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7232>
2024-07-30 12:42:17 +00:00
Nirbheek Chauhan
f8711239e4 vtenc: Add max-frame-delay property
This controls the number of frames allowed in the compression window.
Not all encoders and implementations support it; I've only managed to
successfully use it with ProRes.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7232>
2024-07-30 12:42:17 +00:00
Nirbheek Chauhan
30d2b8895a vtenc: Support emulating CBR mode with data rate limits
CBR is only supported on Apple Silicon, and this "emulation" works
surprisingly well. We set the window size to a single frame, and don't
set ABR at all.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7232>
2024-07-30 12:42:17 +00:00
Nirbheek Chauhan
d327105228 vtenc: Add new property for setting data rate limits
This proxies kVTCompressionPropertyKey_DataRateLimits, except it
only supports a single limit for now.
https://developer.apple.com/documentation/videotoolbox/kvtcompressionpropertykey_dataratelimits

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7232>
2024-07-30 12:42:17 +00:00
Nirbheek Chauhan
4207b4e281 vtenc: Add support for constant bitrate encoding
Only supported on macOS 13.0+ and iOS 16.0+ on Apple Silicon.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7232>
2024-07-30 12:42:17 +00:00
Nirbheek Chauhan
2e39aefe22 vtenc: Eliminate some needless complex code
We do not need a helper that takes a lock to fetch the values of these
properties. There is no race being prevented.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7232>
2024-07-30 12:42:17 +00:00
Nirbheek Chauhan
3621b82c63 vtenc: Fix setting of quality property
gst_vtenc_set_quality() will never actually set the VT compression
property, because it tries to set it on self->session which is not
initialized at this point.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7232>
2024-07-30 12:42:17 +00:00
Seungha Yang
080a838fca qsv: Fix critical warnings
Fixing warnings
GStreamer-CRITICAL **: 01:21:25.862: gst_value_set_int_range_step:
assertion 'start < end' failed

Although when QSV runtime reports a codec is supported, resolution query
fails sometimes, espeically VP9 encoder case on Windows.
Don't try to register an element if resolution query returned an error

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7250>
2024-07-27 19:33:52 +00:00
Seungha Yang
1c8c5ed457 dwrite: Prefer d3d12 resource allocated with shared heap
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7243>
2024-07-27 03:39:22 +09:00
Seungha Yang
88efaa35a8 d3d12download: Do not overwrite fence of non-writable memory
A fence configured in GstD3D12Memory should be used only for
write access to be completed. And because d3d12 -> d3d11 copy path
is read access to d3d12 resource, we should not set fence to
memory. Otherwise another read access to the d3d12 resource
will wait for d3d11 device context's copy operation although
simultaneous read access is allowed.

Use background thread to keep d3d12 resource and wait for d3d11 device's
copy operation instead.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7243>
2024-07-27 03:23:22 +09:00
Seungha Yang
800961cf28 d3d12decoder: Add support for d3d11 output again
Although d3d12download supports d3d12 to d3d11 texture copy,
this feature might be useful if an application is not ready to d3d12
support and it expects output type of decodebin(3) is d3d11.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7208>
2024-07-22 23:17:25 +09:00
Seungha Yang
8c2bbd8760 meson: d3d12: Use configuration file
Move defines to config header

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7208>
2024-07-22 23:02:48 +09:00
Mengkejiergeli Ba
84cb1ef895 msdk: Add new driver name "xe"
Intel has released a new graphic driver named "xe" for
newer Gen12/Xe graphics (i.e. from Lunar Lake).
This patch add "xe" name when getting device in gst-msdk plugins.
See xe driver public in
https://github.com/torvalds/linux/tree/master/drivers/gpu/drm/xe

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7178>
2024-07-22 12:51:47 +00:00
Matthew Waters
58db0e6ed8 decklinkvideosink: schedule frames before they need to be displayed
This removes most occurances of 'late' frame notifications produced by
decklink.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7107>
2024-07-19 01:28:16 +00:00