Commit graph

6920 commits

Author SHA1 Message Date
He Junyan ea0dce26e0 kmssink: Do not close the DRM prime handle twice
The prime_fds for multi planes may be the same. For example, on Intel's
platform, the NV12 surface may have the same FD for the plane0 and the
plane1. Then, the DRM_IOCTL_GEM_CLOSE will close the same handle twice
and get an "Invalid argument 22" error the second time.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6914>
2024-05-23 15:45:24 -04:00
Víctor Manuel Jáquez Leal e913b4870a vkformat: try UNORM format first and decouple them from colorimetry
From the spec (chapter 34, v1.3.283):

````
UNORM: the components are unsigned normalized values in the range [0, 1]

SRGB: the R, G and B components are unsigned normalized value that represent
      values using sRGB nonlinear encoding, while the A component (if one
      exists) is a regular unsigned normalized value
```

The difference is the storage encoding, the first one is aimed for image
transfers, while the second is for shaders, mostly in the swapchain stage in the
pipeline, and it's done automatically if needed [1].

As far as I have checked, other frameworks (FFmpeg, GTK+), when import or export
images from/to Vulkan, use exclusively UNORM formats, while SRGB formats are
ignored.

My conclusion is that Vulkan formats are related on how bits are stored in
memory rather their transfer functions (colorimetry).

This patch does two interrelated changes:

1. It swaps certain color format maps to try first, in both
gst_vulkan_format_from_video_info() and gst_vulkan_format_from_video_info_2(),
the UNORM formats, when comparing its usage, and later check for SRGB.

2. It removes the code that check for colorimetry in
gst_vulkan_format_from_video_info_2(), since it not storage related.

1. https://community.khronos.org/t/noob-difference-between-unorm-and-srgb/106132/7

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6797>
2024-05-23 17:41:30 +00:00
Seungha Yang 417e784463 Revert "tests/d3d11: add concurrency test for gstd3d11device"
This reverts commit 8e0046a738.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6904>
2024-05-23 15:16:02 +00:00
Seungha Yang f47a198977 Revert "d3d11device: protect device_lock vs device_new"
This reverts commit 926d5366b9.

AcquireSRWLockExclusive seems to be acquiring lock in exclusive mode
when the same lock is combined with write lock access.
Reverting the commit because of this is unexpected behavior
and unavoidable OS bug.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6904>
2024-05-23 15:16:02 +00:00
Daniel Stone 2f2279abf4 wayland: Use wl_display_create_queue_with_name
Wayland 1.23 and above allow us to attach names to an event queue, which
are printed out when debugging. Do this to make the logs easier to read.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6900>
2024-05-23 13:38:01 +00:00
Seungha Yang e813ea8367 cudamemory: Fix offset of subsampled planar formats
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6903>
2024-05-23 11:47:16 +00:00
Sebastian Dröge fece9235a2 av1enc: Add timebase property to allow configuring a specific timebase
This mirrors the same property in vp8enc / vp9enc.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6891>
2024-05-23 09:15:34 +00:00
Sebastian Dröge fbc968d06c av1enc: Use 1/90000 as timebase and don't use the framerate at all
This mirrors the behaviour in vp8enc / vp9enc and is generally more
useful than using any framerate from the caps as it provides some degree
of accuracy if the stream doesn't have timestamps perfectly according to
the framerate.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6891>
2024-05-23 09:15:34 +00:00
Sebastian Dröge f82a512387 av1enc: Fix last timestamp tracking so it actually works
This behaves exactly the same as in vp8enc / vp9enc now.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6891>
2024-05-23 09:15:34 +00:00
Sebastian Dröge cd606696a6 gtk: Fail initialization of the sink if GTK4 is already initialized in the same process
Initializing GTK3 and GTK4 in the same process does not work and is not
supported.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6892>
2024-05-23 08:15:44 +00:00
Sebastian Dröge 1a8e7aa92d bufferlist: get() is not actually nullable in its return value
Passing an out of bounds index is the only way to get a NULL buffer but
this causes an assertion so is not to be considered for the
annotations.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6884>
2024-05-23 06:34:59 +00:00
Matthew Waters 0f8b599ded glcolorconvert: handle rectangle textures for v210/UYVY/YUY2
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6795>
2024-05-23 04:42:07 +00:00
Matthew Waters 4c27a2d5eb glcolorconvert: add support for v210->UYVY/YUY2 (and reverse)
Also support YUY2/UYVY->YUY2/UYVY conversion

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6795>
2024-05-23 04:42:06 +00:00
Matthew Waters f6d3aca076 glcolorconvert: add support for UYVY/YUY2->planar yuv (and reverse)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6795>
2024-05-23 04:42:06 +00:00
Matthew Waters 8dac641889 glcolorconvert: add support for v210->planar YUV (and reverse)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6795>
2024-05-23 04:42:06 +00:00
Matthew Waters 96939db249 glcolorconvert: add support for converting to/from v210
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6795>
2024-05-23 04:42:06 +00:00
Matthew Waters b0b185112d glmemory: use the GL stride calculation also for downloading into sysmem
Allows writing into sysmem with arbitrary strides.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6795>
2024-05-23 04:42:06 +00:00
Piotr Brzeziński 477beab403 osxaudio: Avoid using private APIs on iOS
Turns out AudioConvertHostTimeToNanos and AudioGetCurrentHostTime are macOS-only APIs, which prevents apps using
GStreamer on iOS from being accepted into App Store.

This commit replaces those functions with a manual version of what they do - mach_absolute_time() for the current time,
and data from mach_timebase_info() at the beginning to convert host timestamps to nanoseconds.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6789>
2024-05-22 08:58:24 +00:00
Elliot Chen 2dd4a7c6df autovideoconvert: fix double unref
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6865>
2024-05-22 06:56:39 +00:00
Fotis Xenakis 2f03afd8ba docs: basic-tutorial-5: Don't unref floating reference
The `videosink` refernce in main() is a floating one, so it should not
be unref'ed (the playbin practically takes ownership of it).

This prevents a "gst_object_unref: assertion '((GObject *)
object)->ref_count > 0' failed" at runtime.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6883>
2024-05-21 23:40:42 +02:00
Fotis Xenakis 85fa81c7c8 docs: basic-tutotial-1: Don't crash on error
Using g_error() crashes the application, producing a coredump e.g. when
the user closes the video window, which can be confusing (especially on
the very first tutorial).

Let's change this to log the error message without crashing, using
g_printerr(), like subsequent tutorials.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6883>
2024-05-21 23:40:42 +02:00
Jordan Petridis b7357fd316 tests/check: Avoid using "bool" for the variable name
Glib 2.82 will be aliasing [1] TRUE and FALSE to the C99
definitions, which means it will be including stdbool.h

As such, having variables named "bool" causes issues
since it conflicts with the symbol defined in stdbool.h

[1] https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4001

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6893>
2024-05-21 19:15:36 +00:00
Joshua Breeden bf97b2fe56 videotestsrc: add mutex around cache buffer to prevent race condition
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6849>
2024-05-21 12:14:59 +00:00
Diego Nieto 453a6f1800 rtsp-server: Remove unused define in backchannel test
The caps match with the ones used in test-onvif-backchannel,
but they are actually not used here.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6885>
2024-05-21 13:25:44 +02:00
Yacine Bandou 03febb5048 streamsynchronizer: Fix deadlock when streams have been flushed before others start
To simplify the description, I'm assuming we only have two streams: video and audio.

For the video stream, we have the following events :
- STREAM_START => stream->wait set to true
- NEW_SEGMENT(1) => blocked waiting in gst_stream_synchronizer_wait
- FLUSH_START => unblocked
- FLUSH_STOP => stream->wait reset to false
- NEW_SEGMENT(2) => not waiting, since stream->wait is false

Then for the audio stream, we have the following events :
- STREAM_START => stream->wait set to true
- NEW_SEGMENT(2) => blocked waiting in gst_stream_synchronizer_wait for ever.

Note: The first NEW_SEGMENT event and the FLUSH_START, FLUSH_STOP events of the audio stream
are dropped before being received by the streamsynchronizer element, because the decodebin audio pad src
is not yet linked to the playsink audio pad sink.

To fix this deadlock, we don't reset stream->wait to false in the FLUSH_STOP event when it is not
waiting for the EOS of the other streams.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6763>
2024-05-20 20:31:11 +00:00
Sebastian Dröge 0f342da7f6 subparse: Don't unref seek event twice if forwarding it directly failed
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6882>
2024-05-20 16:16:06 +00:00
Jan Schmidt 64133b40a7 rtpmp4gdepay: Set duration on outgoing buffers
If we have constant duration buffers, set the duration on
outgoing buffers, like rtpmp4adepay does. This fixes
problems with (for example) muxers like mp4mux not writing
the duration of the final sample into the index.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6878>
2024-05-20 15:24:32 +00:00
Sebastian Dröge b8a8eacdb2 examples: gst-play: Fix signature of the error callback
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6880>
2024-05-20 17:32:27 +03:00
Seungha Yang e56d3d3e07 filesrc: Don't abort on _get_osfhandle()
_get_osfhandle() expects valid fd and CRT will abort program
if given paramerter is invalid. The fd can be invalidated
in various way, file was deleted by other process after
we open a file. To avoid it, our own exception
handler must be installed so that _get_osfhandle() can return
INVALID_HANDLE_VALUE if fd is invalid.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6877>
2024-05-20 08:32:43 +00:00
Olivier Crête 87ec3bd399 ssdobjectdetector: Add size threshold to drop too big detections
There is a known "failure" mode where the SSD detector finds an object
which is the whole frame. So skip objects which are "too big" to avoid
this.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6810>
2024-05-17 23:35:29 +00:00
Thibault Saunier 5be3f255b0 encoding-profile: Add a way to specify a factory-name when specifying caps
In some cases you want to ensure that a specific element factory is used
while requiring some specific caps but this was not possible. You can
now do `qtmux:video/x-prores,variant=standard|factory-name=avenc_prores_ks`
to ensure that the `avenc_prores_ks` factory is used to produce the
'standard' variant of prores video stream.

This also enhances a bit the documentation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6875>
2024-05-17 22:46:52 +00:00
Hyunwoo f4fdae1ce0 gst-python: Fix README.md
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6876>
2024-05-17 14:12:08 +00:00
Edward Hervey afc1eadfdc streamsynchronizer: Split up event handler code
No changes to behaviour, just split up the big parts into dedicated function for
readability

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6825>
2024-05-17 13:13:41 +00:00
He Junyan a3a3264f02 vah26{4,5}enc: No need to assert i>=0 in frame_setup_from_gop()
The value is an uint here and never be negative.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6868>
2024-05-17 14:42:20 +08:00
Víctor Manuel Jáquez Leal 0233a2a7cf vah26xenc: factorize the encoder frame setup
A simple removal of duplicated code.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6854>
2024-05-17 02:41:18 +00:00
Brad Reitmeyer a564440020 nvcodec: Accept progressive-high profiles for h264
Videos using progressive-high used to work on 1.16 before the parser added progressive-high. It looks like partial
support was added to nvcodec in https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1634
but accidentally ommited gstnvh264dec

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6862>
2024-05-16 16:05:52 -05:00
Víctor Manuel Jáquez Leal 51c2030efd examples: va: add option for enabling alive stream
This is useful to test va encoding for live streams which should enable output
delay.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4359>
2024-05-16 14:54:40 +02:00
He Junyan 7a03813ee9 vabaseenc: Set the correct min_buffers for propose_allocation()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4359>
2024-05-16 14:54:40 +02:00
He Junyan 941d0c417f va: av1enc: Set preferred_output_delay value to increase performance
Also calculate the correct latency.
In live mode, preferred_output_delay is disabled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4359>
2024-05-16 14:54:40 +02:00
He Junyan ba2b053444 va: vp9enc: Set preferred_output_delay value to increase performance
Also calculate the correct latency.
In live mode, preferred_output_delay is disabled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4359>
2024-05-16 14:54:40 +02:00
He Junyan 47db542689 va: h265enc: Set preferred_output_delay value to increase performance
Also calculate the correct latency.
In live mode, preferred_output_delay is disabled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4359>
2024-05-16 14:54:40 +02:00
He Junyan fe25ed22e1 va: h264enc: Set preferred_output_delay value to increase performance
Also calculate the correct latency.
In live mode, preferred_output_delay is disabled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4359>
2024-05-16 14:54:40 +02:00
He Junyan a73474827b va: baseenc: Add is_live field to check the live stream
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4359>
2024-05-16 14:54:39 +02:00
He Junyan 556a254e59 va: baseenc: Add a preferred_output_delay field for GPU parallel processing
The encoder can specify the a preferred_output_delay value to get better throughput
performance. The higher delay may get better HW performance, but it may increases
the encoder and pipeline latency.
When the output queue length is smaller than preferred_output_delay, the encoder
will not block to waiting for the encoding output. It will continue to prepare and
send more commands to GPU, which may improve the encoder throughput performance.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4359>
2024-05-16 14:54:39 +02:00
He Junyan 0694c4a1c3 va: encoder: Do not continue when push_buffer gets error
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4359>
2024-05-16 14:54:39 +02:00
He Junyan 9e2f0ea8dc va: libs: Use va_check_surface_has_status() to implement va_check_surface()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4359>
2024-05-16 14:54:39 +02:00
He Junyan 2ec51dab7d va: libs: Add va_check_surface_has_status() helper function
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4359>
2024-05-16 14:54:39 +02:00
He Junyan 933a155b1a va: encoder: Use GstVaEncFrame as the base object for all Enc Frame
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4359>
2024-05-16 14:54:39 +02:00
Guillaume Desmottes 210487b50a wavparse: reset when receiving STREAM_START
We need to reset the internal state to be able to parse a new stream.
When doing so keep seek event and do not destroy the adapter.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6840>
2024-05-16 11:35:02 +00:00
Seungha Yang b01305f60c decodebin3: Fix caps and stream leaks
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6858>
2024-05-16 10:46:33 +00:00
Sebastian Dröge 0a2e0a4f64 buffer: Use C11 atomics if available for 64 bit atomic operations
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6740>
2024-05-16 06:52:58 +00:00
Sebastian Dröge 8ea355e52c audioringbuffer: Avoid overflows of segment done counter
This counter is incremented once for every segment, meaning it would
e.g. overflow after 24 days when using 1ms segments. Once that happens,
completely wrong positions are reported and invalid memory is handed out
for writing/reading the next segments.

As the affected variables are unfortunately part of the public API of
the struct, a second set of variables is added together with accessor
functions and both variables are kept in sync for backwards
compatibility.

All existing users of the two variables are moved to the new ones but
external code might still run into the overflow.

This also slightly breaks API as external code updating the variables
will have no effect anymore but the only known user of this is
pulsesink.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6740>
2024-05-16 06:52:58 +00:00
Sebastian Dröge f8246327ef mpegtsmux: Allow pads to have no caps until they receive their first buffer
If the muxer times out because of the latency deadline it can happen
that some pads have no caps yet. In that case skip creation of streams
for these pads and create updated section tables once the first buffer
arrives later.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6823>
2024-05-15 18:31:43 +00:00
Sebastian Dröge 4f33bc8932 mpegtsmux: Correctly time out and mux anyway in live pipelines
This makes sure that for sparse streams (KLV, DVB subtitles, ...) the
muxer does not wait until the next buffer is available for them but
times out on the latency deadline and outputs data.

For non-live pipelines it will still be necessary for upstream to
correctly produce gap events for sparse streams.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6823>
2024-05-15 18:31:43 +00:00
Seungha Yang 15c24abf5d nvcodec: Add AV1 encoder
Adding CUDA mode "nvav1enc", D3D11 mode "nvd3d11av1enc" and auto GPU
mode "nvautogpuav1enc" elements

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6754>
2024-05-15 14:35:52 +00:00
Seungha Yang da019bf137 nvcodec: Rename nvcuda{h264,h265}enc to nv{h264,h265}enc
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6754>
2024-05-15 14:35:52 +00:00
Seungha Yang b74422dcbc nvcodec: Remove old nvenc implementation
Stop shipping deprecated implementation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6754>
2024-05-15 14:35:52 +00:00
Seungha Yang 0ffbe20d31 nvcodec: Bump minimum supported SDK version to 10.0
New preset (i.e., P1 ~ P7) requires SDK 10.0 or newer

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6754>
2024-05-15 14:35:52 +00:00
Seungha Yang 60637b96c8 nvcodec: Update SDK header to 12.0.16
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6754>
2024-05-15 14:35:52 +00:00
Seungha Yang ff6d6e1b3c nvencoder: Enhance lagacy encoding profile mapping
Updated based on the NVENC Preset Migration Guide

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6754>
2024-05-15 14:35:52 +00:00
Seungha Yang cfd92819d9 nvencoder: Update property names and default value
... to be the same as old NVENC elements

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6754>
2024-05-15 14:35:51 +00:00
Edward Hervey aab2f59d02 avviddec: Rename variables and fuse function
* gst_ffmpegviddec_frame() is the only caller of gst_ffmpegviddec_video_frame()
  and has the same signature. Just move the checks into a single function and
  use that.
* Make it clear which frames are the input and output ones in
  gst_ffmpegviddec_video_frame() to make issues like the one fixed in the previous
  commit more obvious.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6851>
2024-05-15 13:20:54 +00:00
He Junyan f858179d01 vah265enc: Let FORCE_KEYFRAME be IDR frame rather than just I frame
The FORCE_KEYFRAME frame which has GST_VIDEO_CODEC_FRAME_FLAG_FORCE_KEYFRAME
bit set should be the sync point. So we should let it be an IDR frame to begin
a new GOP, rather than just promote it to an I frame.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6619>
2024-05-15 09:55:49 +00:00
He Junyan ea015bea61 vah264enc: Let FORCE_KEYFRAME be IDR frame rather than just I frame
The FORCE_KEYFRAME frame which has GST_VIDEO_CODEC_FRAME_FLAG_FORCE_KEYFRAME
bit set should be the sync point. So we should let it be an IDR frame to begin
a new GOP, rather than just promote it to an I frame.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6619>
2024-05-15 09:55:49 +00:00
He Junyan c6957d7a36 examples: vaenc-dynamic: support force key frame setting
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6619>
2024-05-15 09:55:49 +00:00
Alexander Slobodeniuk 0e3e688bed systemclock: fix usage of __STDC_NO_ATOMICS__
__STDC_NO_ATOMICS doesn't seem to exist. In fact the only compiler
I've found that sets any of those is msvc, but it sets
__STDC_NO_ATOMICS__, not __STDC_NO_ATOMICS.

__STDC_NO_ATOMICS__ is the one documented by C11 standard.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6848>
2024-05-14 23:38:31 +02:00
Edward Hervey 64cac1ed99 avvidec: Fix dropping wrong "ghost" frames
This fixes the code regarding dropping "ghost frames", that is to say input
frames which ended up not producing any decoded frame.

The iteration itself makes sense.. but it was stopping at the "input" frame and
not the decoded frame we just got back.

When dealing with I-frame codecs, ffmpeg will decode frames in separate frames,
so there is no guarantee that they are decoding in order.

Fixes playback issues with such codecs

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6842>
2024-05-14 13:52:52 +02:00
He Junyan fc3f5a2f09 vaenc: Allow to set the max-qp and min-qp for QVBR and ICQ modes
In fact, these setting can work well.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6841>
2024-05-14 11:16:14 +08:00
He Junyan 7211e3fffd vah26{4,5}enc: Set the qp_p and qp_b to qp_i value in ICQ and QVBR
Set the P and B frame qp to I frame value to avoid generating delta
QP between different frame types. For ICQ and QVBR modes, we can
only set the qpi value, so the qpp and qpb values should be set to
the same value as the qpi.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6841>
2024-05-14 10:31:05 +08:00
Seungha Yang 9d23c26027 d3d12decoder: Fix SDK debug layer warning
Address below message reported by SDK debug layer.

ID3D12Device::CheckFeatureSupport: Unsupported Decode Profile Specified.
Use ID3D12VideoDevice::CheckFeatureSupport with D3D12_FEATURE_VIDEO_DECODE_PROFILES
to retrieve a list of supported profiles

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6839>
2024-05-13 19:42:52 +00:00
He Junyan 07dceabdfc vavp9enc: Do not use base class video info to calculate coded size
We should use our in_info which is an adjusted value to calculate
that coded size.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6826>
2024-05-13 13:59:51 +00:00
Mark Nauwelaerts 869b6f2968 dvdspu: use multiple minimal sized PGS overlay rectangles
... rather than possibly 1 large at full video size

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6413>
2024-05-13 08:37:51 +00:00
Seungha Yang 99b1f5ddd2 nvencoder: Fix maximum QP value setting
Fixing typo

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6827>
2024-05-12 09:38:29 +00:00
Sebastian Dröge 63d58fcebf audioconvert: Add test for 96 channel conversion
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6819>
2024-05-12 07:06:32 +00:00
Sebastian Dröge a4514c5458 level: Don't post a message on EOS without a valid audio info
If EOS is received before caps, e.g. because of an error, then rate and
number of channels would be 0 and some divisions by zero would happen.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6819>
2024-05-12 07:06:32 +00:00
Sebastian Dröge 399b147d90 audioconvert: Support converting >64 channels
There's nothing requiring <= 64 channels except for getting the reorder
map and creating a channel mixing matrix, but those won't be possible to
call anyway as channel positions can only express up to 64 channels.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6819>
2024-05-12 07:06:32 +00:00
Sebastian Dröge d68ac0db57 aja: Update to AJA NTV2 17.0.1
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3289

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6808>
2024-05-11 15:54:54 +00:00
Robert Mader f982b94cd9 v4l2codecs: decoder: Reorder caps to prefer DMA_DRM ones
Certain V4L2 fourccs don't (yet) have DRM counter parts, in which case
we can't create DMA_DRM caps for them. This is usually the case for
specific tilings, which are represented as modifiers for DMA formats.

While using these tilings is generally preferable - because of e.g.
lower memory usage - it can result in additional conversion steps when
interacting with DMA based APIs such as GL, Vulkan or KMS. In such cases
using a DMA compatible format usually ends up being the better option.

Before the addition of DMA_DRM caps, this was what playbin3 ended up
requesting in various cases - e.g. prefering NV12 over NV12_4L4 - but
the addition of DMA_DRM caps seems to confuse the selection logic.

As a simple and quite robust solution, assume that peers supporting
DMA_DRM caps always prefer these and reorder the caps accordingly.

In the future we plan to have a translation layer for cases where
there is a matching fourcc+modifier pair for a V4L2 fourcc, ensuring
optimal results.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6645>
2024-05-09 16:37:07 +00:00
Sebastian Dröge e049013db7 play: Mention that gst_play_new() also initialized GStreamer
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6801>
2024-05-09 09:56:39 +00:00
Sebastian Dröge fcd7807de8 play: Initialize debug category and error quark in class_init
Doing it in gst_play_new() means that bindings that directly call
g_object_new() with the GType wouldn't end up initializing both.
This affects at least the Python and GJS bindings.

gst_init() is nonetheless only called from gst_play_new() once because
calling it from class_init would likely lead to problems as that's
called from somewhere in the middle of GObject.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6801>
2024-05-09 09:56:39 +00:00
Emil Pettersson 19bc0da824 vtdec: Fix deadlock when negotiating format change
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6811>
2024-05-08 06:33:10 +00:00
Matthew Waters da35ed6916 cccombiner: add support for timing out captions without EOS
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6335>
2024-05-08 14:28:39 +10:00
Piotr Brzeziński a9378c048e audiovisualizer: Add simple pipeline unit test
Creates pipelines with each of our visualizer elements and runs them with 20 buffers from audiotestsrc.
Added after a completely broken (segfaulting) synaescope went unnoticed for a while.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6800>
2024-05-07 14:48:47 +00:00
Bill Nottingham 5d7d3c6c0f pbutils: fix visualization plugins
inbuf is persistent, GST_BUFFER_COPY_MEMORY's append behavior is
not what we want.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6800>
2024-05-07 14:48:47 +00:00
Tim-Philipp Müller 06cd4e2457 unixfd: disable flaky test_unixfd_segment for now
It's a problem with the test, and a proper fix might
require new API, so just disable it for now.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6813>
2024-05-07 13:39:29 +01:00
Sebastian Dröge 9e58fa49f1 info: Use GstVecDeque for the ringbuffer logger instead of GQueue
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6779>
2024-05-06 18:25:42 +00:00
Sebastian Dröge 0ef396359c gst: Move GstQueueArray as GstVecDeque to core
And change lengths and indices from guint to gsize for a more correct type.

Also deprecate GstQueueArray and implement it in terms of GstVecDeque.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6779>
2024-05-06 18:25:42 +00:00
Matthew Waters c9af1d486a webrtc: request-aux-sender, only sink floating refs
Don't add an extra ref if non-floating as that ref will never be
unreffed.

gst_bin_add() is transfer floating (alias to transfer none).

Fixes a leak when a non-floating ref was provided as a return value in
the request-aux-sender signal.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6807>
2024-05-06 14:21:38 +00:00
Rafael Caricio 6fd1900d54 pbutils: AV1 mime codec
Add basic AV1 mime codec param generation based on the spec at https://aomediacodec.github.io/av1-isobmff/#codecsparam

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6696>
2024-05-06 12:43:27 +00:00
Sebastian Dröge efba52fcba qtdemux: Use G_GUINT64_CONSTANT when creating test caps
Otherwise this fails on 32 bit platforms.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6804>
2024-05-06 06:18:35 +00:00
Philippe Normand 1c87cda56d glcolorconvert: Fix caps negotiation with upstream DMABuf
The uninitialized texture target was leading to a NULL texture-target string
added to the output caps.

Fixes #3519

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6805>
2024-05-05 17:48:32 +01:00
Thibault Saunier 41f8276c2b glvideomixer: Handle pads which have no caps set on mouse events
And directly use the pad vinfo instead of getting current caps

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6265>
2024-05-05 12:37:05 +00:00
Seungha Yang 9acf4fc139 d3dshader: Fix gamma and primaries conversion pixel shader
Fixing regression introduced by the commit of f52ecb9607

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6802>
2024-05-04 19:57:33 +09:00
Stéphane Cerveau 73c64e8182 tests: add vulkan H.265 encode
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6676>
2024-05-03 19:40:17 +00:00
Stéphane Cerveau 5320514076 tests: add Vulkan H.264 encode
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6676>
2024-05-03 19:40:16 +00:00
Víctor Manuel Jáquez Leal 1b1593568f vkencoder: add gstvkencoder helper object
Add a gstvkencoder class to support Vulkan encoder such as H26X
formats.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6676>
2024-05-03 19:40:16 +00:00
Seungha Yang 66c1383051 d3d11: Add support for Y216 and Y416 formats
We were mapping Y212 and Y412 formats to DXGI_FORMAT_{Y216,Y416}.
Reuse already implemented shaders for the new formats

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6745>
2024-05-03 17:02:35 +00:00
Seungha Yang c8d01d7d1a video: Add Y216 and Y416 formats
The same memory layout as Y212 and Y412 formats, respectively

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6745>
2024-05-03 17:02:34 +00:00
He Junyan ae989e8cee vah265enc: Fix a memory leak when destroying the object
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6791>
2024-05-03 15:58:48 +00:00
He Junyan f340429681 vah265enc: Use a FIFO queue to generate DTS
The base parse will infer the DTS by itself, so we need to make DTS
offset before PTS in order to avoid DTS bigger than PTS. We now use
a FIFO queue to store all PTS and assign it to DTS by an offset.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6791>
2024-05-03 15:58:48 +00:00