Commit graph

3618 commits

Author SHA1 Message Date
Seungha Yang
afb62e98c7 cuda: Enable x86 NVMM support again
It was broken since memory copy helper function was moved to gst-libs.
Also, adding "cuda-nvmm" and "cuda-nvmm-include-path" build options
to en/disable NVMM support in gstcuda library

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6978>
2024-06-06 12:16:50 +00:00
Seungha Yang
6fb0c7b928 examples: cuda: Add CUDA memory synchronization example
Add an example code for external CUDA context sharing and
gst_cuda_memory_sync()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6864>
2024-06-06 11:27:26 +00:00
Stéphane Cerveau
a17957a7c8 vulkan: remove remaining GST_VULKAN_HAVE_VIDEO_ENCODERS
Some define use have been forgotten in
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6992

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7001>
2024-06-06 10:32:51 +00:00
Sebastian Dröge
400c379c3d mxf: Use GDateTime instead of gmtime()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6872>
2024-06-06 08:33:51 +00:00
Stéphane Cerveau
df33ae2da6 gst-plugins-bad: tests: rename vkvideoencode tests
Rename vulkan encode tests to be able to use the namespace
libs_vkvideoencode*.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6992>
2024-06-05 17:50:27 +00:00
Stéphane Cerveau
21ee264d65 vulkan: remove GST_VULKAN_HAVE_VIDEO_ENCODERS
Use 2.3.275 as first supported SDK version

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6992>
2024-06-05 17:50:27 +00:00
Stéphane Cerveau
b9633cb766 vkqueue: remove useless decoder include
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6992>
2024-06-05 17:50:26 +00:00
Thibault Saunier
11f96ce4dd autoconvert: Fix race condition when creating sub elements
There was a case where the element would get destroyed while being
added to the hash table of elements

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6989>
2024-06-05 12:53:45 +00:00
Sebastian Dröge
cfb59df83e dtlssrtpenc: Don't crash if no pad name is provided when requesting a new pad
It is mandatory to provide a valid pad name for dtlssrtpenc.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6984>
2024-06-05 07:30:36 +00:00
Matthew Waters
013026b06a vulkan/videofilter: add getters for queue/device/instance
Allows bindings to not pke at structs for this information.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6987>
2024-06-03 00:06:18 +10:00
Matthew Waters
a7a70ca7b6 vulkan/fullscreenquad: add get_queue()
Allows bindings to not poke at the instance struct.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6987>
2024-06-03 00:06:18 +10:00
Matthew Waters
5e182c911c vulkan/fullscreenquad: mark set_info GstVideoInfo as const
It's not modified by the function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6987>
2024-06-03 00:06:18 +10:00
Matthew Waters
5b471311c5 vulkan: also support glslang as a shader compiler
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6980>
2024-06-01 12:41:49 +00:00
Matthew Waters
346df4cb3f vulkan: support not having glslc available for building vulkan plugin
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6980>
2024-06-01 12:41:49 +00:00
Stéphane Cerveau
7bbf5fd801 vkutils: do not forget to clear context in case of error
The context is leaking in case of a failing instance open.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6975>
2024-05-31 14:44:09 +00:00
Stéphane Cerveau
c3f3fd7351 vkerror: free the error string after usage
g_set_error already used the var string, can clear it now.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6975>
2024-05-31 14:44:09 +00:00
Seungha Yang
e9cefde479 d3d12memory: Fix staging buffer alignment
Not all GPUs can support arbitrary offset of
D3D12_PLACED_SUBRESOURCE_FOOTPRINT when copying GPU memory between
texture and buffer. Instead of calculating size/offset per plane,
calculate the entire size and offsets at once.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6967>
2024-05-30 10:40:44 +00:00
Nirbheek Chauhan
907aca399f msdk: Fix libdrm dependency detection and usage
drm_fourcc.h should be picked up via the pkgconfig include, not the
system includedir directly.

Also consolidate the libdrm usage in va and msdk.

All this allows it to be picked up consistently (via the subproject,
for example).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6932>
2024-05-29 15:49:45 +00:00
Nirbheek Chauhan
e3f086c648 meson: Don't use fallback: kwarg for libva deps
This will cause a fallback even when the `va` option is `auto`, not
giving the user a chance to provide the dependency via the system, and
likely building this feature unnecessarily.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6932>
2024-05-29 15:49:45 +00:00
Nirbheek Chauhan
deaa0aef79 va: Fix libdrm include
The libdrm/ prefix should not be used, it will be provided by the
pkgconfig file. Also HAVE_LIBDRM is necessary.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6932>
2024-05-29 15:49:45 +00:00
Víctor Manuel Jáquez Leal
236d6714ec msdkcaps: fix ill-format string
This patch fixes this critical warning when registering MSDK:

_dma_fmt_to_dma_drm_fmts: assertion 'fmt != GST_VIDEO_FORMAT_UNKNOWN' failed

It was because the HEVC string with possible output formats has an extra space
that could not be parsed correctly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6853>
2024-05-29 13:08:55 +00:00
Seungha Yang
96cf3d7063 d3d12encoder: Do not print error log for not-supported feature
gst_d3d12_result() will print message with ERROR level if failed.
Use FAILED/SUCCEEDED macros instead, since not-supported feature
is not a critical error

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6955>
2024-05-29 10:45:13 +00:00
Seungha Yang
ec11bb8253 d3d12memory: Allow null allocator in alloc()
Update code as documented

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6940>
2024-05-29 09:45:26 +00:00
Nicolas Dufresne
79312357a6 av1parse: Properly transfer TU timestamp
When transforming from unknown alignment to frame or obu, the TU timestamp
was not properly transferred. Fix this by saving the TU DTS as the first
DTS seen within the the TU data, and the PTS as the last PTS seen in that
TU data. Finally, reset the TU timestamp after each TU have completed.

Fixes #1496

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6895>
2024-05-28 23:59:36 +00:00
Nicolas Dufresne
5b1bc0f19f av1parse: Only place a marker on the last frame of a TU
Markers are meant to indicate the buffer that ends a frame, which imply
something can be displayed. The dependent decode only frames should not
have markers. This should also fix last subframe detection.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6895>
2024-05-28 23:59:36 +00:00
Seungha Yang
a4dfca3ae4 webview2: Add user-data-folder property
Adding a propery to specify location of WebView2's user data folder
location.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6921>
2024-05-28 16:56:09 +00:00
Seungha Yang
c1b1c849f2 d3d12: Add support for Device Removed Extended Data (DRED)
Enable DRED if "d3d12dred > GST_LEVEL_ERROR", and print
DRED debug information on device removed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6718>
2024-05-28 15:09:21 +00:00
Piotr Brzeziński
4612a6795a vtenc: Enable HEVC with alpha encoding
Adds a separate vtenc_h265a element (with a _hw variant as usual) for the HEVCWithAlpha codec type.
Decided to go with a separate element to not break existing uses of the normal HEVC encoder.
The preserve_alpha property is still only used for ProRes, no need for it here because we explicitly say we want alpha
when using the new element.

For now, the HEVCWithAlpha has an issue where it does not throttle the amount of input frames queued internally.
I added a quick workaround where encode_frame() will block until enqueue_frame() callback notifies it that some space
has been freed up in the internal queue. The limit was set to 5, which should be enough I guess? Hopefully this is not
too prone to race conditions.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6664>
2024-05-28 10:53:25 +00:00
Piotr Brzeziński
2aa1f465e2 vtenc: Add missing vtenc_h265 docs
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6664>
2024-05-28 10:53:25 +00:00
Elliot Chen
7b547e044c autovideoconvert: should not forward the allocation query if no element is selected
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6927>
2024-05-27 22:46:31 +00:00
Philippe Normand
299a000917 webrtcbin: Allow session level setup attribute in SDP
An SDP answer can declare its setup attribute at the session level or at the
media level. Until this patch we were validating only the latter case and an
assert was raised in the former case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6930>
2024-05-27 14:21:15 +00:00
Víctor Manuel Jáquez Leal
ecf852d529 vulkanh264dec: code style fix
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6901>
2024-05-24 17:40:04 +00:00
Víctor Manuel Jáquez Leal
4a88137b2f vulkanh265dec: fix reference set
`StdVideoDecodeH265PictureInfo.flags.IsReference` refers to section 3.132 ITU-T
H.265 specification:

reference picture: A picture that is a short-term reference picture or a
long-term reference picture.

`GstH265Picture.ref` doesn't reflect this, but we need to query the NAL type of
the processed slice.

This patch fixes the validation layer error
`VUID-vkCmdBeginVideoCodingKHR-slotIndex-07239` while using the NVIDIA driver.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6901>
2024-05-24 17:40:04 +00:00
Seungha Yang
84aecab150 d3d12videosink: Add overlay signal to support d3d12/d3d11/d2d overlay
Conceptually identical to the present signal of d3d11videosink.
This signal will be emitted with current render target
(i.e., swapchain backbuffer) and command queue. Signal handler
can record GPU commands for an overlay image or to blend
an image to the render target.

In addition to d3d12 resources, videosink will send
d3d11 and d2d resources depending on "overlay-mode"
property, so that signal handler can render by using
preferred/required DirectX API.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6838>
2024-05-24 15:55:17 +00:00
Seungha Yang
4d779d7de8 d3d12videosink: Use device's main direct queue
The idea of using separate command queue per videosink was that
swapchain is bound to a command queue and we need to flush the
command queue when window size is changed. But the separate
queue does not seem to improve performance a lot.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6838>
2024-05-24 15:55:17 +00:00
Sebastian Dröge
c051982c0f dtlsconnection: Fix overflow in timeout calculation on systems with 32 bit time_t
If a timeout of more than 4295s was scheduled, the calculation would
overflow and a too short timeout would be used instead.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6870>
2024-05-24 11:43:19 +00:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Tim-Philipp Müller
9ec99ac6f2 analyticsmeta: fix g-ir-scanner warnings
Fix

 gstanalyticsmeta.c:134: Warning: GstAnalytics: "@instance"
                         parameter unexpected at this location

warning (caused by the extraneous empty line in the doc chunk)
and align function arguments with documentation and header file
(handle -> instance).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6585>
2024-04-10 00:46:42 +00:00
Seungha Yang
ff754dca79 ccconverter: Fix caps leak and remove unnecessary code
The removed code does the exactly same thing as the below code
except for leaking caps

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6548>
2024-04-09 18:26:18 +00:00
Seungha Yang
0cc206e939 qsvdecoder: Release too old frames
Release too old frames manually.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3163
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6583>
2024-04-09 16:49:47 +00:00
Seungha Yang
448a461a40 d3d12converter: Simplify root signature build
D3DX12SerializeVersionedRootSignature() helper method will translate
RS 1.1 into 1.0 version if needed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6557>
2024-04-08 13:24:20 +00:00
Daniel Morin
0c8e4d4a2c h264parser: maintain API changes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6540>
2024-04-07 15:25:23 +00:00
Daniel Morin
71659f2545 Revert "h264parse: test - AU align with SEI between frame slices"
This reverts commit 533f814fd9.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6540>
2024-04-07 15:25:23 +00:00
Daniel Morin
e57f561a8e Revert "h264parse: Improved AU boundary detection"
This reverts commit 49f200cb54.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6540>
2024-04-07 15:25:23 +00:00
Daniel Morin
694c6e77b1 Revert "h264parse: Remove dead code"
This reverts commit 141cd38715.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6540>
2024-04-07 15:25:22 +00:00
Daniel Morin
ac3272db40 Revert "h264parse: Fix AU collection"
This reverts commit 495390f63a.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6540>
2024-04-07 15:25:22 +00:00
Daniel Morin
64c2c8d542 Revert "h264parse: Remove un-needed check on SPS state"
This reverts commit 73dedf9a51.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6540>
2024-04-07 15:25:22 +00:00
Daniel Morin
6ff1973b5b Revert "h264parse: use AUD to detect first VCL NAL"
This reverts commit 90a3b63eed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6540>
2024-04-07 15:25:22 +00:00
Daniel Morin
0bc5d97321 Revert "h264parse: correct NAL mode backlog processing"
This reverts commit b2098849dc.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6540>
2024-04-07 15:25:22 +00:00
Edward Hervey
eedfb5e6d7 videoparsers: Demote CC warning message
Another warning message which isn't fatal and therefore should just be a DEBUG
line.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6550>
2024-04-06 06:11:03 +02:00
Seungha Yang
f59c43c50f d3d12device: Fix typo in object name
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6549>
2024-04-06 01:14:56 +09:00
Mathieu Duponchelle
4b93581c15 ajasrc: always post details about detected format
.. instead of only when there is a mismatch.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6438>
2024-04-04 18:23:31 +00:00
Robert Mader
0a26a92b2b jpegparse: turn some bus warnings into object ones
For some cameras `gst_jpeg_parse_app0()` fails on a invalid segment.
While this is likely a driver or firmware bug that should be addressed
accordingly, it's not fatal and likely does not deserve a bus message on
every frame, flooding journals.

Turn down the volume of the warnings by turning them into object
warnings. If we conclude that in some cases we'd still want bus
warnings, they can be done more fine-grained in the
`gst_jpeg_parse_appX()` functions.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6490>
2024-04-04 11:35:07 +00:00
Víctor Manuel Jáquez Leal
fc0ef6ede6 vkh265dec: add missing VPS parameter
and fix coded size

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6400>
2024-04-03 16:46:14 +00:00
Víctor Manuel Jáquez Leal
a6608d72e6 vkh26xdec: implement close() vmethod
Since a validation layer error is signaled at EOS because it's required to wait
for the last frame to be processed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6400>
2024-04-03 16:46:14 +00:00
Víctor Manuel Jáquez Leal
316ca23cab vkh26xdec: remove unused variables
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6400>
2024-04-03 16:46:14 +00:00
Víctor Manuel Jáquez Leal
3dd5e0d46f vkh265dec: fix resource info structure when layered DPB
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6400>
2024-04-03 16:46:14 +00:00
Víctor Manuel Jáquez Leal
d18d6a70ac examples: vaenc-dynamic: support target percentage change in QVBR
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6465>
2024-04-03 13:51:31 +02:00
Víctor Manuel Jáquez Leal
a9d839b8a3 examples: vaenc-dynamic: ignore bitrate change with ICQ too
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6465>
2024-04-03 13:51:31 +02:00
Víctor Manuel Jáquez Leal
4b5e930bc8 va: encoders: don't assert at target percentage when QVBR
Instead of asserting, just get the max value between the current value and 10,
which is the minimum required by QVBR.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6465>
2024-04-03 13:51:31 +02:00
Víctor Manuel Jáquez Leal
cd14db923e examples: vaenc-dynamic: add vp9, av1 and low power tests
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6465>
2024-04-03 13:51:31 +02:00
Chris Spencer
c6a3b2ab85 vkbufferpool: correct usage flags type
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6514>
2024-04-03 09:36:44 +00:00
Víctor Manuel Jáquez Leal
3b4b979ec4 msdk: sink context reference
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6398>
2024-04-03 08:48:25 +00:00
Víctor Manuel Jáquez Leal
c83b69d146 gtk: sink reference of internal wayland pool
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6398>
2024-04-03 08:48:25 +00:00
Víctor Manuel Jáquez Leal
e53c3ab5db wayland: sink reference to internal pool
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6398>
2024-04-03 08:48:25 +00:00
Víctor Manuel Jáquez Leal
c080e7041d dash: sink references of all MDP objects
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6398>
2024-04-03 08:48:25 +00:00
Víctor Manuel Jáquez Leal
0d48ede4a9 va: sink reference at instantiation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6398>
2024-04-03 08:48:25 +00:00
Víctor Manuel Jáquez Leal
b18483a563 vulkan: sink references at instantiation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6398>
2024-04-03 08:48:25 +00:00
eri
0f1a3b6847 play: Update video_snapshot to support playbin3
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6516>
2024-04-03 07:46:23 +00:00
Seungha Yang
b9ebe979ee qsvencoder: Handle d3d12 context
GstD3D12Device objetct's internal resources are singletons per adapter
already though, the object itself is not a singleton.
Due to the singleton design (unlike other APIs such as d3d11),
d3d12 device context sharing is not a strict requirement
for zero-copy, but handles context ones to make things less noisy.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6513>
2024-04-03 02:05:25 +00:00
Seungha Yang
ad6670ba81 d3d12decoder: Always output sharable texture
Because shared heap's additional costs is not significant,
use D3D12_HEAP_FLAG_SHARED for resource can be shared over process
boundary. And enables render target for d3d11 interop in the process.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6513>
2024-04-03 02:05:25 +00:00
Guillaume Desmottes
ed54734825 examples: set perfect-timestamp=true on opusenc
Fix audio streaming on Chrome, see https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1524

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6512>
2024-04-02 22:08:31 +00:00
He Junyan
cbdc22d697 va: av1enc: Change the set_property to make it atomic
The inside encoder may be set in other threads, so we should make
its accessing atomic.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6471>
2024-04-02 19:01:22 +00:00
He Junyan
db74da3f6f va: vp9enc: Change the set_property to make it atomic
The inside encoder may be set in other threads, so we should make
its accessing atomic.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6471>
2024-04-02 19:01:22 +00:00
Víctor Manuel Jáquez Leal
8bede7937c va{vp9,av1}enc: reconfigure when properties change
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6471>
2024-04-02 19:01:22 +00:00
He Junyan
d179fca13f va: h265enc: Change the set_property to make it atomic
The inside encoder may be set in other threads, so we should make
its accessing atomic.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6471>
2024-04-02 19:01:22 +00:00
He Junyan
33bc8d75ad va: h265enc: set the reconf flag when cpb_size updated
This feature can be changed dynamically in playing state, so we
need to set reconf flag to trigger reconfig.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6471>
2024-04-02 19:01:22 +00:00
He Junyan
045449e190 va: h264enc: Change the set_property to make it atomic
The inside encoder may be set in other threads, so we should make
its accessing atomic.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6471>
2024-04-02 19:01:22 +00:00
He Junyan
812e7efb90 va: h264enc: set the reconf flag when cpb_size updated
This feature can be changed dynamically in playing state, so we
need to set reconf flag to trigger reconfig.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6471>
2024-04-02 19:01:22 +00:00
Seungha Yang
4ede9fef07 dwrite: Fix crash on device update
Selected blend mode should not be cleared on device update

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6508>
2024-04-02 17:36:28 +00:00
Seungha Yang
106187cc59 nvencoder: Add support for RGB formats
Adding RGBA, RGBx, BGRA, BGRx, VUYA and RGB10A2_LE format support for performance.
However, these formats are not still recommended if upstream can support
native YUV formats (e.g., NV12, P010) since NVENC does not expose
conversion related optiones. Note that VUYA format is 4:4:4 YUV format
already but NVENC runtime will convert it to 4:2:0 format internally

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6417>
2024-04-02 13:07:29 +00:00
Seungha Yang
e6f496a240 cuda: Add support for VUYA format
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6417>
2024-04-02 13:07:29 +00:00
Seungha Yang
707ac69f5f qsv: Add support for d3d12 interop in encoder
Since QSV API does not support D3D12, try to import d3d12 resource
into d3d11 texture. Note that resource sharing requires
D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_2 for NV12 texure sharing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6501>
2024-04-02 11:54:39 +00:00
He Junyan
78f1299ce4 va: av1enc: Avoid reopen encoder or renegotiate
If parameters remain similar enough to avoid either encoder reopening
or downstream renegotiation, avoid it.

This is going to be useful for dynamic parameters setting.

To check if the stream parameters changed, so the internal encoder has
to be closed and opened again, are required two steps:

1. If input caps, format, profile, chroma or rate control mode have changed.
2. If any of the calculated variables and element properties have changed.

Later on, only if the output caps also changed, the pipeline
is renegotiated.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6441>
2024-04-02 09:06:07 +00:00
He Junyan
075937dc19 va: vp9enc: Avoid reopen encoder or renegotiate
If parameters remain similar enough to avoid either encoder reopening
or downstream renegotiation, avoid it.

This is going to be useful for dynamic parameters setting.

To check if the stream parameters changed, so the internal encoder has
to be closed and opened again, are required two steps:

1. If input caps, format, profile, chroma or rate control mode have changed.
2. If any of the calculated variables and element properties have changed.

Later on, only if the output caps also changed, the pipeline
is renegotiated.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6441>
2024-04-02 09:06:07 +00:00
He Junyan
40629b84ee va: av1enc: Improve the LAST reference assignment
The last frame which has the smallest diff should be consider as
the first choice rather than the golden frame. Especially when only
one reference available, this way can improve the BD rate about 5
percentage.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6379>
2024-04-02 03:54:52 +00:00