Commit graph

120243 commits

Author SHA1 Message Date
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
Jordan Yelloz
317c70651f h265parse: Reject FD received before SPS
A previous fix, a275e1e029, is correct but was too
permissive since it treats all un-matched NAL units the same as AU delimiters
even though some other NAL unit types can be encountered in the processing loop.

The problem this can cause is that some hardware decoders experience bad
performance when handling FD units that precede the SPS.

This change restores the original behavior for FDs so that they're ignored until
the SPS is received and it preserves the codec conformance test gains that the
fix has achieved.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7166>
2024-08-02 13:51:43 +00:00
Nicolas Dufresne
7bd5c5073f glframebuffer: Improve error tracing
glCheckFrameStatus() can fail by returning 0, and otherwise return a
status. Fix the trace to make it clear when we get an unkown status
compare to having an error, in which case we also trace the error code.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7291>
2024-08-02 13:03:51 +00:00
Nicolas Dufresne
d321afcd1b qt6glwindow: Only use GL_READ_FRAMEBUFFER when we do blits
This fbo target is not always supported, and should only be used
along with the frame buffer blit extension.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7291>
2024-08-02 13:03:51 +00:00
Jan Schmidt
c1a1584dde splitmuxsrc: Don't create part reader elements initially
Only create the part reader elements internally the first time
the part is activated. Saves some startup time when preloading
a large number of fragments

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7053>
2024-08-02 15:30:12 +10:00
Jan Schmidt
8a1fab9594 splitmuxsrc: Drop lock when unpreparing parts
Parts may emit bus messages that want to take the splitmuxsrc
lock and prevent the downward state change. Avoid a deadlock
after a part sends an error message by taking a ref and
dropping the lock around the unprepare call

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7053>
2024-08-02 15:30:12 +10:00
Jan Schmidt
ec1c6c5b60 splitmuxsrc: Make sure to re-take lock
In the error path when activating a part fails, make
sure to re-take the splitmuxsrc lock before returning
to the caller.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7053>
2024-08-02 15:30:12 +10:00
Jan Schmidt
44005ab9fb splitmuxsink: Fix race in unit tests. Add fragment-id to messages
Publish fragment-id in the messages that splitmuxsink and splitmuxsrc
send, so when they are received out of order (due to async finalization,
for example), they can still be identified / ordered correctly.

Fix a race in the splitmuxsink unit test where messages might be
received out of order

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7053>
2024-08-02 15:30:12 +10:00
Jan Schmidt
356710f6fa splitmuxsrc: Document new properties and signals
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7053>
2024-08-02 15:30:12 +10:00
Jan Schmidt
64fd2b265f splitmuxsrc: Add num-lookahead property
Add a `num-lookahead` property that will 'prepare' a number of
fragments in advance of the playhead if they have been deactivated
or closed by a limited number of `num-open-fragments`. It can help
to avoid any play stalls reading the indexes or headers of the next
file from high-latency media or on resource limited machines.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7053>
2024-08-02 15:30:12 +10:00
Jan Schmidt
93c04e7473 splitmuxsrc: Rename some internal terminology
A part reader can be 'loaded' (prepared, but not currently outputting anything)
or 'playing' (actively being used to output data)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7053>
2024-08-02 15:30:12 +10:00
Jan Schmidt
3121eeeb08 splitmuxsrc: Allow adding fragments during playback
Trigger measurement / inclusion of new fragments into
the playback timeline if they are added after the
element is already running.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7053>
2024-08-02 15:30:12 +10:00
Jan Schmidt
ed03e8f8ab splitmuxsink: Add fragment offset and duration to message
Publish the playback offset for and duration into the
splitmuxsink-fragment-closed bus message as each fragment
finishes.

These can be passed to splitmuxsrc via the 'add-fragment'
signal to avoid splitmuxsrc measuring all files on startup

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7053>
2024-08-02 15:30:05 +10:00
Jan Schmidt
b0df6ee408 splitmuxsink: Fix a race in fragment switching with async handling
Only do output/muxer operations at the output side of splitmuxsink
to avoid races if fragments are small, by moving the RUNNING_TIME
qdata setting.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7053>
2024-08-02 15:30:05 +10:00
Jan Schmidt
eca97e7940 splitmuxsink: Refactor command queue buffer
Make the command struct a bit clearer by giving it an explicit
enum cmd_type instead of just a boolean to differentiate a
finish-fragment command from a release-gop command

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7053>
2024-08-02 15:30:05 +10:00
Jan Schmidt
bfdaae81f4 splitmuxsrc: Default to only keeping 100 files open
Add a reasonably large default for the number of simulataneous
files to open, that won't affect users that split recordings into
a few large files, but will help prevent fd exhaustion for users
that make recordings with lots of small fragments

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7053>
2024-08-02 15:30:04 +10:00
Jan Schmidt
1294264ab9 splitmuxsrc: Keep streams aligned during adjustments
When calculating the timestamp offset to apply to
media streams in a fragment, ensure that all fragments
are offset "together" to preserve alignment in cases
where there might gaps in a recording at a fragment boundary.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7053>
2024-08-02 15:30:04 +10:00
Jan Schmidt
682db96a41 splitmuxsrc: Add add-fragment signal and examples
Add a signal that allows adding fragments with a specific offset
and duration directly to splitmuxsrc's list. By providing the
fragment's offset on the playback timeline and duration directly,
splitmuxsrc doesn't need to measure the fragment making for faster
startup times.

Add a bus message that's published when fragments are measured,
reporting the offset and duration, so they can be cached by an
application and used on future invocations.

Add examples for handling the bus message and using the 'add-fragment'
signal.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7053>
2024-08-02 15:30:04 +10:00
Jan Schmidt
1821b52dd5 splitmuxsrc: Add num-open-fragments property
Add a property to limit the number of parts splitmux will open
simultaneously. Modify the part handling to support deactivating
and reactivating the demuxing for each part.

The default is '0', to preserve the existing behaviour of opening
all parts at the beginning.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7053>
2024-08-02 15:30:04 +10:00
Jan Schmidt
eeb5a42b5d splitmuxsrc: Report minimum timestamp for each media stream
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7053>
2024-08-02 15:30:04 +10: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
Nicolas Dufresne
adcc6c8d38 xv: imagepool: Improve error logging
The shm creation function can return a GError, use this to improve the error
reporting.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7285>
2024-08-01 16:42:35 +00:00
Nicolas Dufresne
ab70aa60e2 xvimagesink: Fix crash in pool on error
The set_config() virtual function is not support to free the config. As a side
effect, when there is protocol error of some sort, we endup with a crash.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7285>
2024-08-01 16:42:35 +00:00
Nicolas Dufresne
5df658cfdd qt6: glwindow: Don't leak previously rendered buffer
If the consumer reads the buffers too slowily, simply unref the
previously rendered buffer instead of leaking it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7286>
2024-08-01 12:44:06 +00:00
Víctor Manuel Jáquez Leal
28e16f897e vkimagebufferpool: fix documentation grammar
Original-patch-by: Matthew Waters <matthew@centricular.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7288>
2024-08-01 10:09:34 +00:00
Carlos Bentzen
48ae40f477 webrtcbin: create and associate transceivers earlier in negotation
According to https://w3c.github.io/webrtc-pc/#set-the-session-description
(steps in 4.6.10.), we should be creating and associating transceivers when
setting session descriptions.

Before this commit, webrtcbin deviated from the spec:
1. Transceivers from sink pads where created when the sink pad was
   requested, but not associated after setting local description, only
   when signaling is STABLE.
2. Transceivers from remote offers were not created after applying the
   the remote description, only when the answer is created, and were then
   only associated once signaling is STABLE.

This commit makes webrtcbin follow the spec more closely with regards to
timing of transceivers creation and association.

A unit test is added, checking that the transceivers are created and
associated after every session description is set.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7156>
2024-08-01 07:38:46 +00:00
Víctor Manuel Jáquez Leal
ef9875640e vulkanupload: honor downstream pool allocation parameters
If a downstream buffer pool is offered, vulkanupload checks its allocation
parameters to honor them. Only adds to usage the TRANSFER bits, which are
required to upload buffers.

Also, fail if the buffer pool cannot be configured with the current parameters.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7219>
2024-07-31 12:15:43 +00:00
Víctor Manuel Jáquez Leal
baac191d13 vkimagebufferpool: expose config_get_allocation_params()
Also enhanced the documentation and added a config parameter check for
gst_vulkan_image_buffer_pool_config_set_allocation_params()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7219>
2024-07-31 12:15:43 +00:00
Shengqi Yu
7576d14762 v4l2object: append non colorimetry structure to probed caps
If the stream has a special colorimetry that is not in the colorimetry
list, it will cause negotiation to fail. We should allow passing any
colorimetry, so add an extra structure without the colorimetry field.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7029>
2024-07-31 09:28:18 +00:00
Hou Qi
5dffbd492c v4l2: Fix colorimetry mismatch for encoded format with RGB color-matrix
video-info supports encoded format to have RGB color-matrix, while
v4l2object just leave the v4l2 matrix to default when mapping
GST_VIDEO_COLOR_MATRIX_RGB. It causes gst matrix changed to be
GST_VIDEO_COLOR_MATRIX_BT601 when mapping v4l2 colorimetry.

So add support for encoded format with RGB color-matrix in v4l2object.
Note that for M2M encoders, we should in theory assume that that we can
transfer this value from OUTPUT to CAPTURE queues, though its only true
if the drivers does not do CSC. For now, we don't support any RGB
codecs, but leaving a note for the future.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3952>
2024-07-30 20:26:06 +00:00
Nicolas Dufresne
1ddb8797b5 v4l2object: SRGB colorspace is documented limited-range
Split JPEG and SRGB so that we can follow the specified difference. The
SRGB definition in V4L2 does not follow the standard, and is document
so. This is also why JPEG colorspace exists.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3952>
2024-07-30 20:26:06 +00:00
Nicolas Dufresne
20eb14b85b v4l2object: Fix size of plane_size array calculation
Due to missing parenthesys, only the first element of the array was
being cleared. As it is a staticly sized array in the object, this
code could also be simplified.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3952>
2024-07-30 20:26:06 +00:00
Nicolas Dufresne
152df21644 v4l2object: Fix translation of quantization
The V4L2_MAP_QUANTIZATION macro has been fixed to something a lot saner,
fix our replica accordingly. The new macro now simply set the quantization
to full range is the pixel formats is RGB based, or if the JPEG
colorspace is used.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3952>
2024-07-30 20:26:06 +00:00
Guillaume Desmottes
beb1cef3d4 rsvgoverlay: add debug category
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7246>
2024-07-30 17:51:51 +00:00
David Rosca
6fe5d9013d vaapi: Fix sps_max_dec_pic_buffering_minus1 value in h265 decoder
Fixes decoding SLPPLP_A_VIDYO_2 sample.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7242>
2024-07-30 17:31:07 +00:00
Daniel Morin
4ff98d66bb onnx: fix formating
Code alignement was not alway consistent

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7205>
2024-07-30 16:50:15 +00:00
Víctor Manuel Jáquez Leal
43edff4e29 vaapi: tests: fix uninitialized variable compiler warning
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7279>
2024-07-30 15:06:25 +00:00
Edward Hervey
b7828d237b nlecomposition: Don't leak QoS events
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7276>
2024-07-30 14:22:54 +00:00
Edward Hervey
a38e244794 vulkan: Add missing since markers
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7277>
2024-07-30 13:46:42 +00:00
Edward Hervey
30c2f67e49 bad: Add missing plugin since
These predate current stable release. Was never spotted since they weren't built
on the CI

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7277>
2024-07-30 13:46:42 +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
Edward Hervey
c623f2db21 validate: reporter: Don't pollute logs
There was a stray g_printerr introduced by 2a4b9c8dc1

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7275>
2024-07-30 11:39:02 +02:00
Jan Schmidt
0faec707a0 adaptivedemux: Fail cleanly if parsebin is not installed
Detect a failure to construct a parsebin and error out
cleanly instead of trying to operate on a null pointer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6969>
2024-07-30 00:06:50 +00:00