Commit graph

7057 commits

Author SHA1 Message Date
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
He Junyan 20ebf6bbb9 vah264enc: 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
Stéphane Cerveau ddb9b9d9ca vkdecoder: change dstmask in decoder frame barrier
Use of VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT instead of
specific VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR

Fix for VUID-vkCmdPipelineBarrier2-srcStageMask-03849

pDependencyInfo->pImageMemoryBarriers[0].srcStageMask
(VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR) is not compatible with
the queue family properties
(VK_QUEUE_GRAPHICS_BIT|VK_QUEUE_COMPUTE_BIT|VK_QUEUE_TRANSFER_BIT|
VK_QUEUE_SPARSE_BINDING_BIT|VK_QUEUE_PROTECTED_BIT) of this
command buffer. The Vulkan spec states: The srcStageMask member
of any element of the pMemoryBarriers, pBufferMemoryBarriers, or
pImageMemoryBarriers members of pDependencyInfo must only
include pipeline stages valid for the queue family that was
used to create the command pool that commandBuffer was allocated
 from (
https://www.khronos.org/registry/vulkan/specs/1.3-extensions/
html/vkspec.html#VUID-vkCmdPipelineBarrier2-srcStageMask-03849)

The frame barrier should use a compatible srcStageMask for all
the queues.

Remove reset_pipeline_stage_mask as it is redundant

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6780>
2024-05-02 18:07:25 +00:00
Rafael Caricio 2bcbbe0d0a av1parse: No default will trigger warning at compile time
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6778>
2024-05-02 16:31:53 +00:00
Rafael Caricio 27041bf9e9 av1parse: Add max-level and max-tier to caps
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6778>
2024-05-02 16:31:53 +00:00
Rafael Caricio c9a79b7387 av1parse: Add level and tier to caps
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6778>
2024-05-02 16:31:53 +00:00
Loïc Le Page 9d703439f1 pitch: add validate tests
Add pitch tests with different forward and backward playback rates.
Those tests depend on the libSoundTouch version to validate the buffers
checksums. The actual version uses libSoundTouch 2.3.2, use the
`--force-fallback-for=soundtouch` meson option to build using the same
version.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6247>
2024-05-02 13:26:09 +02:00
Loïc Le Page b628f1bc8f pitch: add interactive test
Test pitch with different forward and backward playback rates.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6247>
2024-05-02 10:24:30 +02:00
Loïc Le Page 8f5325ed11 pitch: make it work with reverse playback
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6247>
2024-05-01 20:12:02 +00:00
Loïc Le Page 35165da586 pitch: fix multithread accesses
- fully protect accesses to the libsoundtouch API that is not
  thread-safe.
- fully protect accesses to GstPitch members that could be read by a
  downstream query thread while written by an upstream streaming thread
  or a user thread.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6247>
2024-05-01 20:12:02 +00:00
Loïc Le Page 9f5bb30d3a pitch: refactor some variables names
- use the `GST_PITCH_GET_PRIVATE` accessor when needed
- rename `out_seg_rate` to `output_rate` to use the same name as the parameter
- rename `seg_arate` to `segment_applied_rate` to improve readability
- apply gst-indent to gstpitch.hh/cc

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6247>
2024-05-01 20:12:01 +00:00
Loïc Le Page 7f4c0e6fb1 pitch: fix time ratio computation
When changing playing rate, the output segment was not correctly
calculated because the stream time ratio was computed using the previous
input segment rate instead of using the actual rate. This was producing
wrong results for the output segment start and end values.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6247>
2024-05-01 20:12:01 +00:00
Loïc Le Page d5734159d1 videorate: add validate tests
Add tests with different reverse playback speeds.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6247>
2024-05-01 20:12:01 +00:00
Seungha Yang e6b9a45bfe qsvh264dec,qsvh265dec: Fix nalu leaks
Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3514
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6781>
2024-05-01 10:38:05 +00:00
Sebastian Dröge ec42cedf63 encoding-profile: Fix nullability of (de)serialization functions
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6775>
2024-05-01 09:51:35 +00:00
Piotr Brzeziński bfb7cf7d0b vtdec: Fix PAUSED->READY deadlock when output loop is running
Makes sure the GST_PAD_STREAM_LOCK is not taken when pad is being deactivated.
The lack of this was causing deadlocks when stopping the pipeline right after producing first buffers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6783>
2024-05-01 08:59:37 +00:00
Stéphane Cerveau 10ce5a6857 vkh26xdec: Fix stop memory leak
The h26xdecoder 'stop' method was not called
as the vulkan h26x class rewires the video decoder
'stop' base method to its own one.

It was causing some memory leaks such as dangling parser
and dpb in h26xdecoder base class.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6782>
2024-04-30 18:51:10 +00:00
Edward Hervey dd3344fd2e ges-pipeline: Configure encodebin before linking
Modifying the `avoid-reencoding` property of `encodebin` could potentially cause
it to reconfigure itself, in which case the source pad will be removed and then
re-added.

Therefore set that property *before* attempting to link to that pad.

Fixes smart-render

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6757>
2024-04-30 15:47:41 +00:00
He Junyan 0c81d1a1e7 vabaseenc: delete the useless frame counter fields
They are used to calculate the PTS and DTS before, no usage now.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6773>
2024-04-30 07:51:13 +00:00
He Junyan 477fea97b4 vabaseenc: Do not set the min_pts
Because all the va encoders improved their PTS/DTS algorithm, now
it is impossible to generate minus DTS. So no underflow will happen
and we do not need to set a 1000 hour offset now.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6773>
2024-04-30 07:51:13 +00:00
Matthew Waters 184d94305c glcolorconvert: add support for planar yuv->planar yuv conversions
Currently only supported by keeping the same colorimetry and is only
a repacking operation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6596>
2024-04-30 05:58:55 +00:00
Matthew Waters 674e643428 glcolorconvert: use color matrices
Allows programatically supporting whatever new formats are added to
libgstvideo.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6596>
2024-04-30 05:58:55 +00:00
Mengkejiergeli Ba 9480197377 msdk: Add Y212 format to hevc encoder static raw caps
Note that static caps is used for the old MSDK dispatch.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6750>
2024-04-30 04:05:29 +00:00
Sebastian Dröge e68eccff10 exiftag: Prevent integer overflows and out of bounds reads when handling undefined tags
Fixes ZDI-CAN-23896
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3483

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6766>
2024-04-29 20:06:22 +00:00
Shengqi Yu a92167ea6e glmixer: Add GL_SYNC_META option to bufferpool
when pipline is
glvideomixerelement->glcolorconvertelement->gldownloadelement and
glcolorconvertelement is not passthrough, the gl bufferpool between
glvideomixerelement and glcolorconvertelement will not add gl sync meta
during allocating buffer. This will cause that glcolorconvert's inbuf
has no sync meta to wait for.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6756>
2024-04-29 19:15:39 +00:00
François Laignel 59e17fa931 rtp: add value annotation for GST_RTP_VALID_VALUE
... otherwise its value is not available to bindings.

See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1425#note_2384464

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6762>
2024-04-29 18:27:40 +00:00
Edward Hervey 9c10726ae1 gstvalue: Add a GstAllocationParams to String conversion
Avoids ending up with plenty of warnings when serializing GstStructure
containing GstAllocationParams

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6714>
2024-04-29 16:01:33 +00:00
He Junyan ae68d9dda5 vah265enc: Set the correct buffer flag for output
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6703>
2024-04-29 13:25:09 +00:00
He Junyan d06b12c6f1 vah264enc: Set the correct buffer flag for output
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6703>
2024-04-29 13:25:09 +00:00
Seungha Yang b66834787c vabaseenc: Fix frame leak on error path
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6703>
2024-04-29 13:25:09 +00:00
He Junyan c013b03a19 vah265enc: Do not touch the PTS of output frame
1. The PTS of all frames should not be changed.
2. Just update the DTS based on the PTS. For the frame which is not
   reordered, the DTS is equal to PTS. For frame which is reordered,
   the DTS is equal to previous DTS. For example:
   Input: F0[D0, P0] -- F1[D1, P1] -- F2[D2, P2] -- F3[D3, P3]
   Output: F0[I, D0, P0] -- F3[P, D0, P3] -- F1[B, D1, P1] -- F2[B, D2, P2]

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6703>
2024-04-29 13:25:08 +00:00
He Junyan 4d1a48c9e9 vah264enc: Do not touch the PTS of output frame
1. The PTS of all frames should not be changed.
2. Just update the DTS based on the PTS. For the frame which is not
   reordered, the DTS is equal to PTS. For frame which is reordered,
   the DTS is equal to previous DTS. For example:
   Input: F0[D0, P0] -- F1[D1, P1] -- F2[D2, P2] -- F3[D3, P3]
   Output: F0[I, D0, P0] -- F3[P, D0, P3] -- F1[B, D1, P1] -- F2[B, D2, P2]

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6703>
2024-04-29 13:25:08 +00:00
Tim-Philipp Müller eec64e372b rtph264depay: fix FU-B handling
Skip extra 16-bit DON in FU-B header.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/806

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6607>
2024-04-29 12:21:52 +00:00
Tim-Philipp Müller b1a45b527a rtph264depay: minor refactoring of FU handling code
Make code easier to follow, and prepare for next commit.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6607>
2024-04-29 12:21:52 +00:00
Edward Hervey 777c8a9b15 structure: Add a serialization for GArray in GstStructure
Instead of constantly spurting out warnings in the log files

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6691>
2024-04-29 11:05:44 +00:00
William Wedler 9ad6a9b942 fix: qmlglsink: video content resizes to new item size
Mark geometry dirty when the item rectangle changes in the
QtGLVideoItem::updatePaintNode method. This allows changes in the bounding
rectangle to be applied to the scene graph geometry node.

Fixes #3493

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6711>
2024-04-29 02:57:06 +00:00
William Wedler c02af39026 fix: qml6glsink: video content resizes to new item size
Mark geometry dirty when the item rectangle changes in the
QtGLVideoItem::updatePaintNode method. This allows changes in the bounding
rectangle to be applied to the scene graph geometry node.

Fixes #3493

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6711>
2024-04-29 02:57:06 +00:00
Seungha Yang cb20a371c2 d3d12decoder: Fix d3d12 resource copy
It was copying to self resource

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6753>
2024-04-28 15:31:19 +00:00
Seungha Yang 84f4068036 nvh265encoder: Fix crash with RGBx and BGRx
Both formats need to be handled in switch

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6752>
2024-04-28 23:34:37 +09:00
Seungha Yang 46131f0cb0 d3d12ipcclient: Fix deadlock when copying texture
Fixing deadlock in below case
* GC lock is taken by background thread, and the background thread calls
  gst_d3d12_ipc_client_release_imported_data() which takes ipc lock
* ipc lock is already taken in ipc thread and trying to pushing GC data
  via gst_d3d12_command_queue_set_notify()
* gst_d3d12_command_queue_set_notify() is trying to take GC lock
  but it's already taken by background thread

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6749>
2024-04-28 12:49:07 +00:00
Seungha Yang 19932cf178 d3d12ipcsink: Handle external fence
Waits external fence before sending frame to peer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6749>
2024-04-28 12:49:07 +00:00
Seungha Yang b7844ef307 d3d12decoder: Remove CPU-side waiting
Sets decoder command queue's fence to memory instead of waiting
from decoder's output thread. CPU-side waiting will happen
only if download is required.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6749>
2024-04-28 12:49:07 +00:00
Seungha Yang a05961ab7b d3d12screencapturesrc: Fix output to non-d3d12 element
Configures upload/download flags to memory after write

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6749>
2024-04-28 12:49:07 +00:00
Seungha Yang e29655e9ca d3d12screencapturesrc: Release and flush d3d11 objects before d3d12
Fixing device-removed error when closing pipeline

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6749>
2024-04-28 12:49:07 +00:00
Seungha Yang 3e08cdeebe d3d12memory: Do not wait external fence on map()
Only wait for external fence if upload or download is required.
Waiting for external fence in case of d3d12 mapping is caller's
responsibility

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6749>
2024-04-28 12:49:07 +00:00
Seungha Yang 2c203e0d40 d3d12encoder: Handle external fence explicitly
Waits for external fence if any

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6749>
2024-04-28 12:49:07 +00:00
Seungha Yang 2a14793ee1 d3d12converter: Add support for GPU-side external fence waiting
Ideally, GPU waiting should be scheduled just before executing command list.
But handling the case outside of converter is a bit complicated.
Under an assumption that constructed command list will be executed
immediately, schedules GPU-side waiting inside of conversion method
to simplify the flow.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6749>
2024-04-28 12:49:07 +00:00
Seungha Yang c95725bb79 d3d12memory: Use explicit type for GST_MAP_D3D12 define
C++ compiler will complain about different type between int and GstMapFlags

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6749>
2024-04-28 12:49:07 +00:00
Seungha Yang 87f43c25cc d3d12frame: Extract external fence from memory and wait helper function
Adding gst_d3d12_frame_fence_{gpu,cpu}_wait() methods

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6749>
2024-04-28 12:49:07 +00:00
Seungha Yang 478e49dd73 d3d12: Update copy_texture_region() method
Pass external fence value if any and allow passing fence
data so that dependent resources can be released
once copy is done

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6749>
2024-04-28 12:49:07 +00:00
Seungha Yang d8aa2eea83 d3d12commandqueue: Add execute_wait_and_command_lists() method
... so that GPU-side waiting and executing can be scheduled at once

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6749>
2024-04-28 12:49:07 +00:00
Seungha Yang ebb64dfd0d d3d12memory: Add get_external_fence() method
Required for caller to wait external fence without map() method

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6749>
2024-04-28 12:49:07 +00:00
Seungha Yang 00924d4820 d3d12bufferpool: Sync all memory objects on acquire_buffer()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6749>
2024-04-28 12:49:07 +00:00
He Junyan ae5361b7fa vabaseenc: No need to call _finish_subframe()
After vaav1enc is aligned to TU, there is no case that generates
multi output for one input.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6688>
2024-04-28 07:49:02 +00:00
He Junyan 8d0a1a0c56 vavp9enc: Set the correct buffer flag for output
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6688>
2024-04-28 07:49:02 +00:00
He Junyan 9bd73987f6 vaav1enc: Set the correct buffer flag for output
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6688>
2024-04-28 07:49:02 +00:00
He Junyan b8871c87a2 vaav1enc: Do not change the PTS/DTS of output frames
The AV1 encoder does not reorder the frames, so there is no need
to change the timestamp related meta data of output frames, just
inheriting it from the input frames.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6688>
2024-04-28 07:49:02 +00:00
He Junyan f68bc7f49a vaav1enc: Change the alignment of output to "tu"
The current output alignment is "frame", which may cause some issues
for PTS and DTS calculation. We now change the alignment to "tu",
and this is also the alignment mode for av1enc and svtav1enc.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6688>
2024-04-28 07:49:02 +00:00
Nirbheek Chauhan d7eeb62f38 meson: Fix Python library searching on Windows
Neither LIBDIR nor LIBPL are set with the native windows Python
(unlike MSYS2), so we need to use `prefix` which takes us to the
rootdir of the Python installation.

The name is also different: it's python312.dll, not python3.12.dll.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6734>
2024-04-27 01:30:21 +00:00
Nirbheek Chauhan 753aeccde7 meson: Fix Python library name fetching on Windows
`python.get_variable('FOO', [])` becomes `python.get_variable('FOO')`
due to how Meson treats empty arrays in arguments, which breaks the
fallback feature of get_variable().

So we need to actually check whether the variable exists before trying
to fetch it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6734>
2024-04-27 01:30:21 +00:00
Tim-Philipp Müller 7074849c5c exif: add debug category
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6741>
2024-04-27 00:19:30 +00:00
Xavier Claessens f0ef33d018 unixfd: Close file descriptors on error
After calling g_unix_fd_list_steal_fds() and before calling
gst_fd_allocator_alloc(), we are responsible for closing those fds.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6532>
2024-04-26 18:52:19 +00:00
Xavier Claessens 1f8accbc8d unixfdsink: Take segment into account when converting timestamps
Also rename `calculate_timestamp()` to `to_monotonic()` and
`from_monotonic()` which better describe what it does.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6532>
2024-04-26 18:52:19 +00:00
Xavier Claessens 7f47dba299 unixfd: Allow sending buffers with no memories
There is no reason to not allow it, and it is useful for simple unit
test.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6532>
2024-04-26 18:52:18 +00:00
Víctor Manuel Jáquez Leal 1f080391ed vulkan: replace gst_vulkan_queue_create_decoder() with gst_vulkan_decoder_new_from_queue()
The purpose of this refactor is to hide decoding code from public API.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6723>
2024-04-26 16:24:22 +00:00
Víctor Manuel Jáquez Leal 18c32272bd vulkan: conceal unused decoder symbols
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6723>
2024-04-26 16:24:22 +00:00
Víctor Manuel Jáquez Leal 668b395a38 vulkan: conceal decoder from public API
Since we don't want to expose video decoding API outside of GStreamer, the
header is removed from installation and both source files are renamed as
-private.

The header must remain in gst-libs because is referred by GstVulkanQueue,
which's the decoder factory.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6723>
2024-04-26 16:24:22 +00:00
Víctor Manuel Jáquez Leal 547e2899d1 vaallocator: disable derived all together for Mesa <23.3
First it derived mapping was disabled for P010 formats, but also there's an
issue with interlaced frames.

It would be possible to disable derived mapping only for interlaced (H.264
decoder and vadeinterlace) but it would spread the hacks along the code. It's
simpler and contained to disable derived completely for Mesa <23.3

Fixes: #3450
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6729>
2024-04-26 15:41:39 +00:00
Víctor Manuel Jáquez Leal 7eb08feeee va: videoformat: use video library to get DRM fourcc
Instead of duplicating the GStreamer format to DRM fourcc mapping, this patch
uses the GstVideo library helpers. This duplicates the big O of looking for,
since the two lists are traversed, but it's less error prone.

Partially reverts commit 547f3e8622.

Fixes: #3354
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6731>
2024-04-26 15:10:36 +02:00
Edward Hervey 8737b9ca84 playbin3: Handle combiner update in case of errors
The assertion that was present before is a bit too harsh, since there is now
a (understandable) use-case where this could happen.

In gapless use-case, with two files containing the same type (ex:audio). The
first one *does* expose a collection with an audio stream, but decoding
fails (for whatever reason).

That would cause us to have configured a audio combiner, which was never
used (i.e. not active).

Then the second file plays and we (wrongly) assume it should be activated
... whereas the combiner was indeed present.

Demote the assertion to a warning and properly handle it

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6737>
2024-04-26 11:31:32 +00:00
Tim Blechmann ff7b41ac86 soup: fix thread name
thread names should be below 16char, otherwise they won't be shown on
linux.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6736>
2024-04-26 09:45:49 +08:00
Hou Qi be7ba5ac51 wlwindow: free staged buffer when do gst_wl_window_finalize
If waylandsink received buffer rate is high which causes frame
drop, the cached staged buffer will be replaced when next buffer
needs to be rendered and be freed after redraw. But there is
chance to get memory leak if ended without redraw. So need to
free staged buffer when do gst_wl_window_finalize().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6670>
2024-04-25 23:55:42 +00:00
Seungha Yang 4ac46ce82b d3d12screencapturesrc: Performance improvement
Process captured frame using d3d11 instead of d3d12, and use shared
fence when copying processed d3d11 texture to d3d12 resource.
In this way, capture CPU thread does not need to wait for fence signal.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6733>
2024-04-25 22:51:01 +00:00
Xavier Claessens 364d0ff45d pad: gst_pad_set_offset is only reliable on source pads
Setting an offset on sink pads won't repush segment event which means
buffer running time won't be adjusted. Better warn about this than being
silently not working.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6464>
2024-04-25 13:49:03 +00:00
Nirbheek Chauhan e7598ed521 rsvg: Disable deprecations instead of porting to new librsvg API
`rsvg_handle_get_dimensions()` and `rsvg_handle_render_cairo()` are
deprecated, and the replacement librsvg functions as specified in the
migration guide are `rsvg_handle_get_intrinsic_size_in_pixels()` and
`rsvg_handle_render_document()`.

However, those are not drop-in replacements, and actually have
breaking semantics for our use-case:

1. `intrinsic_size_in_pixels()` requires SVGs to have width+height or
   the viewBox attribute, but `get_dimensions()` does not. It will
   calculate the geometry based on element extents recursively.
2. `render_cairo()` simply renders the SVG at its intrinsic size on
   the specified surface starting at the top-left, maintaining
   whatever transformations have been applied to the cairo surface,
   including distorted aspect ratio.
   However, `render_document()` does not do that, it is specifically
   for rendering at the specified aspect ratio inside the specified
   viewport, and if you specify a viewPort that does not match the
   aspect ratio of the SVG, librsvg will center it.

Matching the old behaviour with the new APIs is a lot of work for no
benefit. We'd be duplicating code that is already there in librsvg in
one case and undoing work that librsvg is doing in the other case.

The aspect ratio handling in this element is also kinda atrocious.
There is no option to scale the SVG while maintaining the aspect
ratio. Overall, element needs a rewrite.

Let's just disable deprecations. The API is not going anywhere.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6726>
2024-04-25 12:43:07 +00:00
Nirbheek Chauhan 49f9a1e224 Revert "rsvgdec: Fix uses of librsvg functions deprecated since 2.52"
This reverts commit b8db473955.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6726>
2024-04-25 12:43:07 +00:00
Víctor Manuel Jáquez Leal d2c8593b2e vkswapper: choose color space according with format
The swapper surfaces contains the color space for each supported format. Instead
of hard coding the color space, it returns the value associated with the
negotiated vulkan format.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6725>
2024-04-24 13:53:18 +00:00
Víctor Manuel Jáquez Leal f62574cb5f tests: vulkan: split decoder test and parameters
Thus they can be reused for the encoder test.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6721>
2024-04-24 12:54:12 +00:00
Edward Hervey 2aba1c86e9 videodecoder: Use a frame duration for QoS
We prefer to use the frame stop position for checking for QoS since we don't
want to drop a frame which is only partially late.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6689>
2024-04-24 09:19:22 +00:00
Elliot Chen a7d0b07406 gstplay: query seek information again in playing state for live stream
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6681>
2024-04-24 07:01:21 +00:00
Edward Hervey 9e4cb46bd4 validate/flvdemux: Stop spamming audio/video on test
Use the sinks specified by the runner

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6727>
2024-04-24 07:47:42 +02:00
Haihua Hu 560dc511f7 wlwindow: clear configure mutex and cond when finalize
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6722>
2024-04-24 01:02:15 +09:00
Edward Hervey 5d705ed923 ges/tools: Use new GstEncodingProfile function from pbutils
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6712>
2024-04-23 14:27:00 +00:00
Edward Hervey ad8c42ba06 encoding-profile: Make (de)serialization functions public
This is more convenient and cheaper than going through the `g_value_convert()`
hoops

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6712>
2024-04-23 14:27:00 +00:00
Edward Hervey b3c9f598aa bad/utils: Simplify get_file_extension
By using g_strrstr

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6715>
2024-04-23 12:08:19 +00:00
Edward Hervey 131679b9d0 mpegtsbase: Fix Program equality check
There was an issue with this equality check, which was to figure out what to do
with PCR pids (whether they were part of the streams present or not) and whether
we ignore PCR or not.

Turns out ... we already took care of that further up in the function.

The length check can be simplified by just checking whether the length of
the *original* PMT and the new PMT are identical. Since we don't store "magic"
PCR streams in those, we can just use them as-is.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6713>
2024-04-23 11:15:53 +00:00
Seungha Yang cecb0f2148 d3d12decoder: Lock DPB while building command
Since DPB resource can be modified in output thread, protect
it when building command list.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6709>
2024-04-23 10:08:19 +00:00
Seungha Yang 27c02a0b80 d3d12decoder: Hold reference pictures in fence data
Keep reference pictures alive during executing decoding commands

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6709>
2024-04-23 10:08:19 +00:00
Seungha Yang 0f5f170a40 d3d12vp9dec: Disallow resolution change to larger size on non-keyframe
Intel GPU seems to be crashing if the case happens.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6709>
2024-04-23 10:08:18 +00:00
Edward Hervey 376aaa828d decodebin3: Remove custom stream-start field if present
This field is added by urisourcebin so that we can avoid double-parsing. It's no
longer needed after.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6690>
2024-04-23 07:09:21 +00:00
Edward Hervey 049665ccaa urisourcebin2: Adaptive demuxers don't require another parsebin
By setting the same field on the GST_EVENT_STREAM_START decodebin3 will be able
to avoid plugging in an extra parsebin

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6690>
2024-04-23 07:09:21 +00:00
Edward Hervey 4e5a54612e adaptivedemux2: Answer GST_QUERY_CAPS
If we have a generic caps, we can answer the query.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6690>
2024-04-23 07:09:21 +00:00
Edward Hervey 6b43e4e19f adaptivedemux2: Refactor output slot creation
Set as much information as possible on the slot (including the associated
track) *before* the associated source pad is added to the element.

We need this so that incoming event/queries can be replied to if they are
received when adding the pad

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6690>
2024-04-23 07:09:21 +00:00
Johan Sternerup deddcbdc66 basesrc: protect segment_seqnum/pending with object lock
In a few places the object lock was not taken when writing to
segment_pending and segment_seqnum.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6671>
2024-04-22 18:13:46 +00:00
Johan Sternerup a3f8f036fe gstbasesrc: Do not hold LIVE_LOCK while sending events
An application that triggers a state transition from PLAYING to PAUSED
needs to acquire the LIVE_LOCK. Consequently the LIVE_LOCK must not be
taken while pushing anything on the pads because this operation might
get blocked by something that cannot be unblocked without the
application being able to proceed with the state transitions for other
elements in the pipeline. This commit extends the previous behaviour
where the live lock was released before pushing buffers (indirectly
through the unlock before subclass->create) to now also include
unlocking before pushing events.

The issue was discovered in a case for WebRTC where the application
tried to shut down a pipeline but an event originating from a video
source element (based on basesrc) was in the process of being pushed
down the pipeline when it got stuck on the STREAM_LOCK for the pad after
the rtpgccbwe element. This lock in turn was held by the rtcpgccbwe
element as it was in the process of pushing data down the pipeline but
was stuck on the blocking probes installed on dtlssrtpenc to prevent
data from flowing before dtls keys had been negotiated. What should have
happened here is that the blocking probes should be removed, but that
can only happen if the application may continue driving the state
transitions.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6671>
2024-04-22 18:13:46 +00:00
Seungha Yang 700c00eda3 d3d12decoder: Fix potential use after free
A DPB buffer held by codec picture object may not be writable
at the moment, then gst_buffer_make_writable() will unref passed buffer.

Specifically, the use after free or double free can happen if:
* Crop meta of buffer copy is required because of non-zero
  top-left crop position
* zero-copy is possible with crop meta
* A picture was duplicated, interlaced h264 stream for example

Interlaced h264 stream with non-zero top-left crop position
is not very common but it's possible configuration in theory.

Thus gst_buffer_make_writable() should be called with
GstVideoCodecFrame.output_buffer directly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6706>
2024-04-22 13:28:06 +00:00
Seungha Yang b9e51facdd d3d11decoder: Fix potential use after free
A DPB buffer held by codec picture object may not be writable
at the moment, then gst_buffer_make_writable() will unref passed buffer.

Specifically, the use after free or double free can happen if:
* Crop meta of buffer copy is required because of non-zero
  top-left crop position
* zero-copy is possible with crop meta
* A picture was duplicated, interlaced h264 stream for example

Interlaced h264 stream with non-zero top-left crop position
is not very common but it's possible configuration in theory.

Thus gst_buffer_make_writable() should be called with
GstVideoCodecFrame.output_buffer directly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6706>
2024-04-22 13:28:06 +00:00
Edward Hervey 6d228c420c tsdemux: Disable smart program update
The goal of this code was, for programs which were updates (i.e. adding/removing
streams but not completely changing) to allow dynamic addition/removal of
streams without completely removing everything.

But this wasn't 100% tested and there are a bunch of issues which make it fail
in plenty of ways.

For now disable that feature and force the legacy "add all pads again and then
remove old ones" behaviour to make it switch.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6651>
2024-04-22 11:56:30 +00:00
Loïc Le Page 9fd0f44492 gst-editing-services: add input channels reorder
- whitelist corresponding properties from audioconvert
- add input channels reorder validation test in gst-integration-testsuites/ges/scenarios

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5923>
2024-04-22 12:06:11 +02:00
Loïc Le Page 8fb96253be audioconvert: add possibility to reorder input channels
When audioconvert has unpositionned audio channels as input
it can now use reordering configurations to automatically
position those channels.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5923>
2024-04-22 12:06:11 +02:00
Seungha Yang 40f7d7f1f7 d3d11device: Add device-removed-reason property
In addition to device removed status monitoring in gst_d3d11_result()
method, if ID3D11Device4 interface is available,
an event handle will be used for device removed status update.
And "device-removed" signal is removed since applications can monitor
the device removed status via gobject notify

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6699>
2024-04-21 12:06:03 +00:00
Seungha Yang b12b04eeef d3d12utils: Fix documentation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6699>
2024-04-21 12:06:03 +00:00
Seungha Yang 6efeeb8300 d3d12device: Add device-removed-reason property
Adding new property in order to notify users of device removed status.
Once device removed status is detected, application should release
all ID3D12Device objects corresponding to the adapter, including
GstD3D12Device object. Otherwise D3D12CreateDevice() call for the
adapter will fail.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6699>
2024-04-21 12:06:03 +00:00
Seungha Yang b9feb47de5 mediafoundation: Fix infinite loop in device provider
Initialize source state with GST_MF_DEVICE_NOT_FOUND to terminate
loop immediately if no available capture device is available

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3492
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6704>
2024-04-21 19:21:54 +09:00
Alexander Slobodeniuk 926d5366b9 d3d11device: protect device_lock vs device_new
It seems that when D3D11CreateDevice collides in time
with other D3D11 calls, in particular the proccess of
creating a shader, it can corrupt the memory in the driver.
D3D11 spec doesn't seem to require any thread safety from
D3D11CreateDevice. Following MSDN, it is supposed to be called
in the beginning of the proccess, while GStreamer calls it with each
new pipeline.
Such crashes in the driver were frequently reproducing on the
Intel UHD 630 machine.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6686>
2024-04-20 11:22:41 +00:00
Alexander Slobodeniuk 8e0046a738 tests/d3d11: add concurrency test for gstd3d11device
We suspect that it's not thread safe to just create and
destroy the device from any thread, particularly because
of D3D11CreateDevice, that is not documented as thread-safe.
While D3D11CreateDevice is usually protected from outside
by the gst_d3d11_ensure_element_data, it still can cross
with the Release() method of another device.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6686>
2024-04-20 11:22:41 +00:00
Elliot Chen 13e17b9149 gstplay: query duration again if previous query failed
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6668>
2024-04-19 20:49:03 +00:00
Seungha Yang 5179cbccfa d3d12testsrc: Use shared 11on12 device
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6697>
2024-04-20 04:16:48 +09:00
Seungha Yang 045c9ac6b9 dwrite: Use shared 11on12 device
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6697>
2024-04-20 04:16:48 +09:00
Seungha Yang cd97275a19 d3d12device: Hold d3d11on12 device to be shared
d3d11on12 device seems to be occupying a bit of GPU memory
Hold the instance in GstD3D12Device so that it can be shared

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6697>
2024-04-20 04:16:41 +09:00
Seungha Yang 8e4fe98361 d3d12videosink: Handle mouse double click and modifier
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6693>
2024-04-19 16:11:30 +00:00
Elliot Chen 824c70d35a subparse: forward seek event first and return if succeeded
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4889>
2024-04-19 15:24:36 +00:00
Seungha Yang dabce9635d d3d12videosink: Disconnect window's signal on dispose
Same as the commit of 7b69d1758f
but for d3d12videosink.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6692>
2024-04-19 21:25:06 +09:00
Seungha Yang 6659bd6362 d3d12videosink: Handle external HWND's mouse/keyboard events
OS will not propagate the event to child HWND if it's handled by
the parent. Thus, navigation event should be handled by parent HWND's
event handler.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6692>
2024-04-19 21:24:52 +09:00
Edward Hervey a032c1e1bd ges-command-line-formatter: Handle transitions
Avoids getting a noisy g_warning

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6683>
2024-04-19 08:03:48 +00:00
Edward Hervey 37b60e5354 ges-timeline-tree: Fix debug statement
Was printing out garbage in the logs

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6683>
2024-04-19 08:03:48 +00:00
Sebastian Dröge d42ee6e48c vavp9enc: Preserve PTS and other frame metadata
See also https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4150

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6680>
2024-04-19 07:18:35 +00:00
Seungha Yang ba443e7a64 webview2: Handle double click and modifier
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6491>
2024-04-18 20:19:38 +00:00
Seungha Yang e0def6b355 d3d11videosink: Handle double click and modifier
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6491>
2024-04-18 20:19:38 +00:00
Seungha Yang e1910d2be1 navigation: Define mouse double click event
Windows and UI toolkits define mouse double click events

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6491>
2024-04-18 20:19:38 +00:00
Hou Qi 4dfdaf67db waylandsink: config buffer pool with query size when propose_allocation
If propose_allocation comes before set_caps, self->video_info
has not been extracted from caps and self->video_info.size is 0.
It causes buffer pool fail to set config . So need to use info
size got from query instead when propose_allocation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6666>
2024-04-18 18:34:30 +00:00
Sebastian Dröge 750d53d7e0 rsvgdec: Remove unused GObject::finalize implementation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6613>
2024-04-18 17:45:43 +00:00
L. E. Segovia b8db473955 rsvgdec: Fix uses of librsvg functions deprecated since 2.52
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6613>
2024-04-18 17:45:43 +00:00
Sebastian Dröge 5d876ff774 rsvgdec: Negotiate resolution with downstream and scale accordingly
Prefer the resolution given by the input but if downstream request a
specific resolution then scale to this without regards to the aspect
ratio.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1538

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6613>
2024-04-18 17:45:43 +00:00
Philipp Zabel 46a41667a3 v4l2bufferpool: Ensure freshly created buffers are not marked as queued
Otherwise, if we run in to the copy case, this can cause these
groups to stay around with queued flag set, but never actually
queued, until gst_v4l2_allocator_flush() is called, which then
erroneously frees the associated memories, causing the release
function to decrement the allocator refcount where it was never
incremented, resulting in early allocator disposal, and either
deadlock or use after free.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6552>
2024-04-18 16:42:43 +00:00
Edward Hervey f33ce4fe8b encodebin: Fix pad removal for encodebin vs encodebin2
Clarify the fact that `encodebasebin->src_pad` is set when using a static source
pad (`encodebin`) and when not set it's dynamically added source
pads (`encodebin2`).

Fixes usage of encodebin2 when profiles are updated

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6667>
2024-04-18 09:11:58 +00:00
Nicolas Dufresne e34f765a7e v4l2codecs: Don't unref allocation query caps
The caps obtained from parsing the allocation query is borrowed and
should not be unreffed. This fixes criticals assertion introduced in
1.24.1.

(gst-launch-1.0:242): GStreamer-CRITICAL **: 19:48:02.667:
    gst_mini_object_unref: assertion 'GST_MINI_OBJECT_REFCOUNT_VALUE (mini_object) > 0' failed

Fixes: 5189e8b956 ("v4l2codecs: decoders: Add DMA_DRM caps support")
Closes #3462

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6679>
2024-04-18 06:13:17 +00:00
Thibault Saunier a342d14ba9 ges: Add support for sources reverse playback
It introduces a `reverse` property at the `nlesource` level which will
basically reverse playback of the clip.

We guarantee that outside that clip, the data flow looks like it was
playing forward as we add an 'identity' element with `single-segment=true`.

This start making use of the newly introduced concept of
`CHILD_PROP_FLAG_SET_ON_ALL_INSTANCES` as it is natural that
doing `source_clip.set_child_property("reverse", True)` will make
the whole clip go reverse, meaning that all the GESSource children
properties will be set. To set an individual source "reverse" child
property as the desired effect.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/issues/24
Depends on: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/451

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/918>
2024-04-18 00:19:31 +00:00
Thibault Saunier 526f00b07f ges: test-clip: Fix setting children asset ids
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/918>
2024-04-18 00:19:31 +00:00
Thibault Saunier 388ad9e574 validate: Add an action to group containers
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/918>
2024-04-18 00:19:31 +00:00
Thibault Saunier 38d60c9f43 ges: Also track children props 'duplicates' in TimelineElement
We used to only track the first one but this was wrong, so we start
tracking all the children properties here, adapting the test which
was already thought for this to be implemented.

At the same time add some flags to determine how children properties
need to be handled adding a mode that means that all duplicated
children props will be set together when the user sets that particular
child property. This is going to be tested in a following commit.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/918>
2024-04-18 00:19:31 +00:00
Thibault Saunier 9b43892f6e ges: Add simple backward playback test
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/918>
2024-04-18 00:19:31 +00:00
Thibault Saunier 47029ca9de ges: tools: Fix printing validate action types
We were not taking into account some arguments could have been eaten

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/918>
2024-04-18 00:19:31 +00:00
Mengkejiergeli Ba 49dee23e65 msdk: Add main-422-12 profile to hevc
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6591>
2024-04-17 19:31:09 +00:00
Philippe Normand 83b1feb4f8 debug-viewer: Fix plugin loading machinery
The previous code was failing at least with Python 3.11 and Python 3.12.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6659>
2024-04-17 16:24:15 +00:00
Edward Hervey a2254a4968 ges-launcher: Fix for forcing container profiles
If the input profile doesn't have a container, it's fine since we are overriding
it. Just add the elementary stream to the target container profile

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6674>
2024-04-17 16:07:47 +02:00
Jan Schmidt 26acd70c74 dvbsubenc: fixed some memory leaks and a crash
Fix leaks of internal GstBuffers, and a crash if subtitle segments end
up empty.

Based on a patch by Jurijs Satcs <jurijs.satcs@veset.tv>

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6661>
2024-04-17 11:37:49 +00:00
Xavier Claessens 686f74e4a4 format: Allow GST_AUDIO/VIDEO_FORMAT_UNKNOWN in _to_string() function
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6630>
2024-04-17 01:19:58 +00:00
Alexander Slobodeniuk b46383bf5e d3d11converter: fix documentation for converter_new ()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6665>
2024-04-16 23:30:51 +02:00
Loïc Le Page cbc58c0483 gst-validate: add formatting for GstAudioMeta
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6461>
2024-04-16 15:33:42 +00:00
Qian Hu (胡骞) 8d003f00e9 v4l2: add multiplane y42b(yuv422m)
for some jpg file, mediatek v4l2 jpeg decoder
hardware produce multi plane YUV 4:2:2 data

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6617>
2024-04-16 09:03:47 +00:00
F. Duncanh ac40e6b592 ximagesink: initialize mask for XISelectEvents
Fixes #3470

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6631>
2024-04-16 00:13:43 -04:00
Hou Qi 105d232fde v4l2bufferpool: queue back the buffer flagged LAST but empty
Some decoder drivers need to wait enough capture buffers before
starting to decode. But the dequeued buffer flag LAST but empty
has no chance to queue back to driver, which makes decode hang
after seek. So need to queue back such kind of buffer to driver.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6579>
2024-04-15 18:07:17 +00:00
Philipp Zabel e1f5bacf8d v4l2: bufferpool: Drop writable check on output pool process
Output buffers don't have to be writable. Accepting read-only buffers
from the V4L2 buffer pool allows upstream elements to write directly
into the V4L2 buffers without triggering a CPU copy into a new buffer
from the same V4L2 buffer pool every time.

Tested with the vivid output device:

  GST_DEBUG=GST_PERFORMANCE:7 gst-launch-1.0 videotestsrc ! v4l2sink device=/dev/video5

With this change, gst_v4l2_buffer_pool_dqbuf() must be allowed to not
resize read-only memories of output buffers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6572>
2024-04-15 17:11:00 +00:00
Seungha Yang a7fe79c4de mediafoundation: Fix device enumeration
Do not stop device enumerate even if a device could not be opened.
Otherwise the other devices listed after the failed device will not be
reported by device provider

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3460
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6598>
2024-04-15 14:52:32 +00:00
Tim-Philipp Müller 60ac6d0883 tests: fix possible libscpp build failure in gst-plugins-bad
../subprojects/gst-plugins-bad/tests/check/libs/gstlibscpp.cc:41:
fatal error: gst/mpegts/gstmpegts-enumtypes.h: No such file or directory

Could only pass the needed deps to the libscpp test, but gets
messier to maintain, so let's at it for consistency.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6643>
2024-04-15 11:41:51 +00:00
Philippe Normand 97d4c56c8f tests: webrtcbin: Fix repaired-stream-id handling in simulcast test
The test was attempting to add the same stream-id extension twice, probably some
unfinished copy/paste.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6615>
2024-04-15 08:43:09 +00:00
Seungha Yang 15434ce51d dwrite: D3D12 integration
Adding d3d12 backend text renderer/blender by using d3d11on12 interop.
And subclassing renderer object per backend (i.e., d3d11, d3d12, and bitmap)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6620>
2024-04-14 09:55:41 +00:00
Seungha Yang f6ec4e6256 d3d12overlaycompositor: Add support for d3d12 memory
Don't allocate d3d12 texture if overlay is d3d12 memory already

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6620>
2024-04-14 09:55:41 +00:00
Seungha Yang 13d892d336 d3d12: Move gst_d3d12_buffer_copy_into method to library
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6620>
2024-04-14 09:55:41 +00:00
Seungha Yang b242f5d2ec d3d12converter: Port to GstD3D12Frame
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6620>
2024-04-14 09:55:41 +00:00
Seungha Yang cb670f8110 d3d12: Add GstD3D12Frame struct and helper method
Adding GstD3D12Frame struct with map, unmap, and copy methods.
This new struct is equivalent to GstVideoFrame but gst_d3d12_frame_map()
method will extract D3D12 specific resource handles from memory.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6620>
2024-04-14 09:55:41 +00:00
Seungha Yang 8b88fcd18b d3d12memory: Implement copy method
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6620>
2024-04-14 09:55:41 +00:00
Nirbheek Chauhan 073d8fc52a meson: Don't link to python for the gi overrides module
We only need to link to python directly for the plugin:

https://github.com/mesonbuild/meson/issues/7712#issuecomment-689357908

https://github.com/Homebrew/homebrew-core/pull/165176#issuecomment-2051835257

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6622>
2024-04-13 22:24:32 +00:00
Seungha Yang e597dcdf0d d3d12encoder: Fix buffer pool leak
Add missing buffer pool release

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6628>
2024-04-13 14:55:09 +00:00
Seungha Yang d00d8fff6b subprojects: webview2: Fix warning with meson 1.4.0
Meson 1.4.0 will warn if include dir is absolute path

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6618>
2024-04-13 14:47:29 +00:00
Philippe Normand 111cc8d796 vpxdec: Include vpx error details in errors and warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6626>
2024-04-13 10:57:43 +01:00
Philippe Normand bd83046193 vp9enc: Include vpx error details in errors and warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6626>
2024-04-13 10:56:29 +01:00
Philippe Normand 73ce4fd770 vpxenc: Rename GST_VPX_WARN to GST_VPX_ENC_WARN
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6626>
2024-04-13 10:55:55 +01:00
Seungha Yang d002acdd0c d3d11videosink: Fix rendering on keyed mutex enabled handle
As of the commit 69b2e1565c,
keyed mutex will be handled by the memory object.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3468
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6600>
2024-04-12 14:46:20 +00:00
Jordan Petridis c4e0d19f13 fdkaac: Mark the dependency include_type as 'system'
When using v2.0.2 of the subproject, it triggers werror for
unused functions that come from the fdkaac headers.

This avoids errors like the following when werror is set.

```
subprojects/fdk-aac-2.0.2/fdk-aac/FDK_audio.h:757:29: error: ‘FDKlibInfo_lookup’
defined but not used [-Werror=unused-function]
  757 | static FDK_AUDIO_INLINE INT FDKlibInfo_lookup(const LIB_INFO* info,
```

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6611>
2024-04-12 13:18:40 +03:00
Qian Hu (胡骞) cd95d02032 qtdemux: fix wrong full_range offset when parsing colr box
use colr_data[18] >> 7 to get full range information, instead
of colr_data[17] >> 7

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6616>
2024-04-12 16:59:33 +08:00
William Wedler 942415dce0 fix: qml6glsink: Notify that the returned QSGNode node has changes
Sets the QSGNode::DirtyMaterial bit when a new buffer is used for the material's texture

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3469
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6609>
2024-04-11 14:21:04 +00:00
Jochen Henneberg 687b3a2027 qt6: Let plugin documentation show up
* Added qml6 to plugin cache
* Added 'since' markers
* Moved plugin to plugins-good where it really is
* Fixed section comments

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6603>
2024-04-11 12:38:59 +00:00