Commit graph

3531 commits

Author SHA1 Message Date
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
He Junyan
1745a82516 va: av1enc: Fix the reference number setting bug
The current way will let the total reference number surplus the
reference number set by the "ref-frames" property.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6379>
2024-04-02 03:54:52 +00:00
Seungha Yang
dce4067e83 meson: d3d11: Add support for MinGW DirectXMath package
Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3428
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6495>
2024-04-02 05:14:53 +09:00
Seungha Yang
bb268eafa1 webview2: Add support for d3d12 interop
Enable shared copy to D3D12 resource

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6499>
2024-04-02 03:43:59 +09:00
Seungha Yang
d00c26cdc8 d3d12screencapturesrc: Use gst_d3d12_memory_get_d3d11_texture()
... and use fence to wait for GPU sync

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6499>
2024-04-02 03:43:59 +09:00
Seungha Yang
ce34e63605 d3d12memory: Add support for d3d11 texture caching
Would be useful for various D3D11 interop use cases

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6499>
2024-04-02 03:43:59 +09:00
He Junyan
e023546162 va: encoder: Fix the unit of bitrate in debug log message
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6483>
2024-04-01 15:39:13 +00:00
He Junyan
9c3bd3950e va: vp9enc: Adjust the coded buffer size to avoid failure
Some extreme case such as "videotestsrc pattern=1" can generate pure
white noise videoes, for which encoder may generate too big output
for current coded buffer size. We now consider the qindex and bitrate
to avoid that.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6483>
2024-04-01 15:39:13 +00:00
He Junyan
2560f4c581 va: vp9enc: Fix the frame size not enough issue for super frame
The current code forgets to add the current last frame size into
the total super frame size.

Fixes: #3427
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6483>
2024-04-01 15:39:13 +00:00
Cheah, Vincent Beng Keat
249a086612 msdk: Fix mjpeg BGRx encode
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6401>
2024-04-01 11:23:24 +00:00
Seungha Yang
7d0e90b7bc d3d12: Move core part to gst-libs
Move buffer pool, converter, and device abstraction layer to
public library

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6494>
2024-04-01 10:37:50 +00:00
Seungha Yang
7829315305 d3d12memory: Define new D3D12 map flags
Define GST_MAP_READ_D3D12 and GST_MAP_READ_D3D12 flags

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6494>
2024-04-01 10:37:50 +00:00
Seungha Yang
abeccdd6bc d3d12: Make resource getter methods consistent
Returns COM pointer directly everywhere

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6494>
2024-04-01 10:37:49 +00:00
Seungha Yang
706d5402fa d3d12: Remove device11on12 wrapping layer
It was added to avoid symbol conflict between DirectX-header project
and Windows SDK, but symbol conflict does not happen

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6494>
2024-04-01 10:37:49 +00:00
Seungha Yang
927e249557 d3d12bufferpool: Use d3dx12.h format table
The format table in SDK header defines all required information
already.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6494>
2024-04-01 10:37:49 +00:00
Seungha Yang
0527f27204 d3d12: Add a helper method for device equality check
GstD3D12Device object itself is not singltons anymore but
underlying private struct is singltons.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6494>
2024-04-01 10:37:49 +00:00
Mengkejiergeli Ba
faddaa8ba5 msdkvpp: Set colorimetry for src caps
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6316>
2024-04-01 02:20:50 +00:00
Mengkejiergeli Ba
72bb59b37c msdkenc: Set VideoFullRange according to input colorimetry range
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6316>
2024-04-01 02:20:50 +00:00
Mart Raudsepp
3649f13bb3 meson: Don't confuse voaacenc plugin with bz2 one in meson variable names
No actual issue was observed from the previous naming duplicating bz2 one, so
just a correctness tweak.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6496>
2024-04-01 00:52:16 +03:00
Seungha Yang
f7bdf91ad7 webview2: Add support for javascript injection
Allow javascript injection for various custom use cases.
For example, scrollbars and scrolling can be disabled via

gst-launch-1.0 webview2src location=https://gstreamer.freedesktop.org \
    javascript="document.querySelector('body').style.overflow='hidden'" ! ...

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6487>
2024-03-30 16:44:28 +00:00
Seungha Yang
85d422f7c6 webview2: Use IContainerVisual for offscreen rendering
Capturing from hidden HWND fails sometimes for some reason.
Instead of rendering to hidden HWND, render webpage to container
visual and create WGC item from the container visual object.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6487>
2024-03-30 16:44:28 +00:00
Alexander Slobodeniuk
7b69d1758f d3d11videosink: disconnect signals before releasing the window
It might happen that the key event arrives when the d3d11videosink
is stopping. In case of GstD3D11WindowWin32 it can raise a
navigation event even when the sink is already freed, because the
window object's refcount may reach 0 in the window thread. In
other words sometimes the GstD3D11WindowWin32 lives few ms more
then the GstD3D11VideoSink, because it's freed asynchronously.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6476>
2024-03-30 16:02:12 +00:00
Ruben Gonzalez
941793c7e4 wpe: avoid crash with G_DEBUG=fatal_criticals and static build
No plugin filenames if static build.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6484>
2024-03-30 07:55:40 +00:00
Mengkejiergeli Ba
41c52f5739 msdk: Fix session close failure
In the case of multi-channels transcoding, a context with child
sesseion can be parent for others, so we need to check if the
msdkcontext has any child session in the list to avoid session
leaks. Otherwise, we will see the failure of closing a parent
session because one of its child's child session not released.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6259>
2024-03-29 04:20:47 +00:00
Seungha Yang
d0cfada15e meson: d3d11: Disable library build if DirectXMath header was not found
DirectXMath header library is a hard dependency

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6468>
2024-03-28 11:44:14 +00:00
Seungha Yang
4888a25bac webview2: Add Microsoft WebView2 based web browser source
Adding webview2src element

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4631>
2024-03-28 10:49:39 +00:00
He Junyan
a170fa4f46 va: {av1, vp9}enc: Use g_free() to free frames
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6466>
2024-03-28 16:29:50 +08:00
Nicolas Dufresne
cee05343f0 v4l2codecs: alphadecoder: Explicitly pass 64 bit integers as such through varargs
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6452>
2024-03-27 14:01:45 -04:00
Sebastian Dröge
276329dd5d alphadecodebin: Explicitly pass 64 bit integers as such through varargs
Maybe fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3422

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6452>
2024-03-27 17:05:33 +00:00
Piotr Brzeziński
82294fd665 vtdec: Fix caps criticals during negotiation
Calling gst_pad_peer_query_caps() without a filter can give us EMPTY caps, whereas all the code below
assumes that's not the case. Replacing query+intersect with a filtered query ensures we always get a subset
of the template caps back.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6429>
2024-03-27 09:04:28 +00:00
He Junyan
7ac9d26533 va: vp9enc: Correct the flags for registering properties
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6437>
2024-03-27 10:24:12 +08:00
He Junyan
fa50571d3b va: av1enc: Correct the flags for registering properties
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6437>
2024-03-27 10:21:08 +08:00
He Junyan
73c1c1fe7f va: {vp9, av1}enc: Do not use g_slice_new() to create frames
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6437>
2024-03-27 10:18:04 +08:00
He Junyan
fa6552b7c5 test: Fix several code style issues in vp9bitwriter test
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6437>
2024-03-27 10:17:51 +08:00
He Junyan
2688e28438 vp9bitwriter: Fix several hotdoc related format issues
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6437>
2024-03-27 10:17:45 +08:00
He Junyan
71eff7ce97 va: encoder: update the bitrate change correctly
We should update and notify the bitrate change at a common place,
no matter whether the bitrate is calculated or not.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6433>
2024-03-26 18:15:20 +00:00
He Junyan
56703704a5 va: av1enc: enable ICQ and QVBR modes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6433>
2024-03-26 18:15:20 +00:00
He Junyan
5c51abfa71 va: vp9enc: enable ICQ and QVBR modes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6433>
2024-03-26 18:15:20 +00:00
He Junyan
d90f718b1a va: h265enc: enable ICQ and QVBR modes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6433>
2024-03-26 18:15:20 +00:00
He Junyan
f45f52a786 va: h264enc: enable ICQ and QVBR modes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6433>
2024-03-26 18:15:20 +00:00
He Junyan
85bcea1776 va: encoder: Enable ICQ and QVBR mode in rate control map
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6433>
2024-03-26 18:15:20 +00:00
He Junyan
3f1ce4460a va: encoder: Set the quality_factor parameter in rate control
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6433>
2024-03-26 18:15:20 +00:00
Víctor Manuel Jáquez Leal
ababe13f1c jpegparse: avi1 tag can be progressive
AVI1 tag in APP0 is trivalue: 0 not interleaved, 1 odd, 2 even.

So if avi1 is zero then the frame is progressive.

Also, this patch adds a couple log messages.

Fixes: #3414
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6445>
2024-03-26 16:17:02 +00:00
Tim-Philipp Müller
46355e31d7 tests: add check to make sure -bad lib headers are C++ compiler clean
Only non-internal libs without external deps for now.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6440>
2024-03-26 14:21:34 +00:00
Matthew Waters
91e8331b52 ccconverter: fix cdp->cea608-raw field 1 60fps conversion
There was a potential busy loop occuring because when we were taking
data from the internal ccbuffer, we were not resetting which field had
written data.  This would mean that the next time data was retrieved
from ccbuffer, it was always from field 0 and never from field 1.

This only affects usage of cc_buffer_take_separated() which is only used
by cdp->raw cea608.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6423>
2024-03-26 02:23:08 +00:00
Seungha Yang
bbdfa00b7b d3d12: Add support for cross-compile
... and fix bunch of GCC reported warnings

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6435>
2024-03-25 11:41:25 +00:00
Seungha Yang
6c80d2f5f8 d3d12: Allow building without WGC support
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6435>
2024-03-25 11:41:25 +00:00
Seungha Yang
2649d2ae62 d3d12: Port to d3dshader library
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6434>
2024-03-25 00:02:12 +09:00
Seungha Yang
cab1f3e547 d3d11: Port to d3dshader library
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6434>
2024-03-24 22:28:14 +09:00
Seungha Yang
13c90b606a d3dshader: Add HLSL shader library
Adding a new library for HLSL compile and compiled bytecode caching.
This library will be used by d3d11 and d3d12 library/plugin, in order to
reuse single HLSL code and compiled HLSL bytecode.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6434>
2024-03-24 22:05:49 +09:00
Seungha Yang
93bb362016 d3d11: Update shader to be d3d12 compatible
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6434>
2024-03-24 20:33:26 +09:00
Seungha Yang
43da9b4249 d3d12: Update shader to be Shader Model 5.0 compatible
And use fxc HLSL compiler

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6434>
2024-03-24 17:15:22 +09:00
Ruben Gonzalez
778381fba6 ristsrc: Clean caps instead of unref
Fix issue unrefering null caps. Better solution than

```
  if (src->caps)
      gst_caps_unref (src->caps);
```

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6432>
2024-03-23 10:31:57 +01:00
Seungha Yang
0c148a96db d3d12: Add IPC elements
Adding d3d12ipcsink and d3d12ipcsrc elements, equivalent to D3D11 ones.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6428>
2024-03-22 23:09:12 +09:00
Seungha Yang
0006ad1f86 d3d12: Add buffer copy helper method
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6428>
2024-03-22 23:09:05 +09:00
Seungha Yang
c612af6d42 d3d12commandqueue: Always invoke notify asynchronously
Otherwise the callback thread is unpredictable

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6428>
2024-03-22 20:45:01 +09:00
Seungha Yang
18091f0115 d3d12memory: Update for API interop
Add support for destroy notify in case of wrapped memory, and
allow setting external fence for interop

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6428>
2024-03-22 20:01:16 +09:00
Seungha Yang
0d559bead9 d3d12: Make primary fence sharable
Create primary fence with D3D12_FENCE_FLAG_SHARED flag so that
the fence can be shared with other APIs or processes

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6428>
2024-03-22 18:57:26 +09:00
Piotr Brzeziński
982c73dfdd vtdec: Ignore output loop errors in drain() if we're flushing
In an early non-linked scenario, this was causing a ton of criticals about the queue array,
because the output callback would still fire for leftover frames that were still being processed by VT
at the time the output loop stopped. This makes sure they're flushed correctly as well.

Also renames gst_vtdec_loop to gst_vtdec_output_loop for consistency with related functions.

wip

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6397>
2024-03-20 13:07:25 +00:00
Piotr Brzeziński
112951ce55 vtdec: Fix a deadlock during ProRes playback
Sometimes a call to negotiate (and thus drain) can happen from the output loop
(via finish_frame()), which will tell VT to output all internal frames, but that won't succeed
if we happen to decide to wait for the queue to empty (because the loop is waiting for draining to finish and
will not make space in the queue!). This commit adds an override for the queue size limit if we're draining/flushing.

This bug could happen for any formats, but was especially obvious for ProRes, which has dpb_size of 0.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6397>
2024-03-20 13:07:25 +00:00
Seungha Yang
17f92ab400 asio: Add support for MinGW build
Drop MSVC specific bits and remove unused dependency

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6404>
2024-03-20 10:53:16 +00:00
Seungha Yang
f0761a7358 asio: Drop external SDK header dependency
Build ASIO plugin using our tiny SDK header

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6404>
2024-03-20 10:53:16 +00:00
He Junyan
3b57825ca6 va: Implement the vavp9enc plugin
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3293>
2024-03-20 08:53:11 +00:00
He Junyan
802a0eb9df test: add vp9 bitwriter test case
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3293>
2024-03-20 08:53:11 +00:00
He Junyan
142448bbed vp9bitwriter: Add the VP9 bit writer helper functions
In this first version, we only implement the "show existing frame"
and super frame writting. Other frame header types writting can
be added when needed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3293>
2024-03-20 08:53:11 +00:00
Seungha Yang
b417c62940 d3d12device: Set debugging friendly object name
Build object name with DXGI adapter index

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6395>
2024-03-19 12:03:55 +00:00
Seungha Yang
6de5eab1e4 d3d12: Suppress expected leak reports
Such leaks are expected and intended ones

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6395>
2024-03-19 12:03:55 +00:00
Seungha Yang
a1c8fc6163 d3d12device: Keep device object permanently
Because ID3D12Device objects are singletons per adapter,
GstD3D12Device was following the API design, that is, keep track
of global GstD3D12Device objects and reuses it.
That means ID3D12Device object can be released at the time
when GstD3D12Device is destroyed.

But exetrnal APIs such as NVENC does not seem to be happy
with the released ID3D12Device, that could be a driver bug though.

Let's hold already opened ID3D12Device permanently without releasing
it for now.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6395>
2024-03-19 12:03:55 +00:00
Seungha Yang
17d6c7350c d3d12commandqueue: Add drain method
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6395>
2024-03-19 12:03:55 +00:00
Seungha Yang
393fb4733c d3d12: Use native device handle if possible
Various abstraction objects such as command queue/list/allocator
can be constructed without GstD3D12Device

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6395>
2024-03-19 12:03:55 +00:00
Seungha Yang
331522210f d3d12commandqueue: Allow empty command list
Just increase fence value and signal the queue in that case

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6395>
2024-03-19 12:03:54 +00:00
Seungha Yang
3e912a2214 examples: d3d11: Add inter-device synchronization example
Adding an example to demonstrate resource sharing between
D3D11 device and GPU synchronization

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6303>
2024-03-19 10:55:19 +00:00
Ruijing Dong
bc858976db va: enc : checking surface alignment attribute
Apply surface alignment attribute when availalbe,
also fix frame cropping issue for va h265 encoder.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6282>
2024-03-18 16:34:42 +00:00
L. E. Segovia
1f119b2035 soundtouch: Fix build failure with Apple Clang caused by missing cpp_std
Apple Clang sets C++98 by default. I'm applying C++14 to account for Meson's
lack of support/fallback for `cpp_std=c++11`.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6374>
2024-03-18 14:28:38 +00:00
Mark Nauwelaerts
324563b158 dvdspu: avoid null dereference
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6386>
2024-03-18 09:49:13 +00:00
Philippe Normand
76d1bd05b2 play: Fix a critical warning in error callback
`on_error()` can be called with a NULL details structure, so in that situation
the `gst_structure_copy()` would raise a critical warning. Create an empty
structure instead of attempting to copy a NULL one.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6385>
2024-03-17 11:18:37 +00:00
Seungha Yang
8acf844fed d3d12: Fix SDK debug layer activation
Debug layer must be enabled before creating device. Otherwise
already opened devices before the activation will be removed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6382>
2024-03-16 21:25:38 +09:00
Robert Mader
5189e8b956 v4l2codecs: decoders: Add DMA_DRM caps support
In order to simplify caps negotiations for clients and, notably, be more
compatible with va* decoders.
Crucially this allows clients to know ahead of time whether buffers will
actually be DMABufs.

Similar to GstVaBaseDec we only announce system memory caps if the peer
has ANY caps. Further more, and again like va decoders, we fail in
`decide_allocation()` if DMA_DRM caps are used without VideoMeta.
Apart from buggy peers this can happen e.g. when a peer with ANY caps
is used in combination with caps filters.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5890>
2024-03-14 17:32:13 +00:00
Robert Mader
513d0d8cbb v4l2codecs: decoders: Introduce and use set_output_state helper class
Allowing us to avoid some code duplication. This will become more
important with upcoming changes to caps generation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5890>
2024-03-14 17:32:13 +00:00
Robert Mader
a95acbcc11 v4l2codecs: decoder: Clean up select_src_format()
Most importantly rely on video info helpers instead of manual parsing
of caps, which will allow us to use additional helpers in the future.

While on it, tighen the check for supported formats - failing that
indicates a bug in caps negotiation - and make some style changes.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5890>
2024-03-14 17:32:13 +00:00
Robert Mader
73b69d8ca0 v4l2codecs: decoder: Generalize size enumeration caps
By reducing the generated caps to the minimal number of fields and
using intersections instead of merges. This will allow us to reuse the
result in the future.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5890>
2024-03-14 17:32:13 +00:00
Robert Mader
65896dab75 v4l2codecs: decoders: Use src template for negotiation filter
This ensures we don't create filter caps that are not supported by the
individual codec implementations, as well as that the resulting caps
have the required fields so they can be turned into a GstVideoFormat.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5890>
2024-03-14 17:32:13 +00:00
Seungha Yang
7aff9c8600 asio: Fix {input,output}-channels property handling
Fixing regression introduced by the commit 06dc931b52

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6370>
2024-03-14 21:01:40 +09:00
Seungha Yang
1d8138fd18 d3d11device: Fix adapter LUID comparison in wrapped device mode
Fix integer type mismatching

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3382
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6358>
2024-03-13 20:18:29 +00:00
Alexander Slobodeniuk
6a6a4bf1a4 d3d11device: raise 'device-removed' signal on DXGI_ERROR_DEVICE_REMOVED
When this error gets caught the GstD3D11Device object raises the new
"device-removed" signal. This allows to handle the error from outside:
stop the playback, re-create the player, replace the catched GstContext by
the new one.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6193>
2024-03-13 17:25:31 +00:00
Michiel Westerbeek
a4aa9e197e gstcudaconvertscale, gstvavpp, videoconvertscale: downgrade 'Can't keep DAR' to debug
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5730>
2024-03-13 16:06:56 +00:00
He Junyan
a953dc3b1a test: Correct the API return type of {h264,h265,av1}bitwriter
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6354>
2024-03-13 18:49:13 +08:00
Seungha Yang
94dfef68e1 d3d12device: Fix IDXGIFactory2 leak
factory passed to gst_d3d12_device_find_adapter() method is valid
handle already

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6340>
2024-03-12 22:06:01 +00:00
Sebastian Dröge
121e52886b videoparsers: Don't verbosely warn about CEA_708_PROCESS_EM_DATA_FLAG not being set
And the same for CEA_708_PROCESS_CC_DATA_FLAG. This is not really a
problem and was polluting logs with warnings for every single frame.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6336>
2024-03-12 21:26:18 +00:00
L. E. Segovia
71510860af meson: Require tinyalsa >= 1.1.0 when building its plugin
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6311>
2024-03-12 20:30:11 +00:00
L. E. Segovia
9c8549c31c tinyalsasink: Fix missing const and deprecations with tinyalsa v2
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6311>
2024-03-12 20:30:11 +00:00
Seungha Yang
c9aaf39279 cuda,d3d11,d3d12bufferpool: Disable preallocation
Do not chain up to parent's GstBufferPool::start() which will do
preallocation. We don't want it to be preallocated
since there are various cases where negotiated downstream buffer pool is
not used at all (e.g., zero-copy decoding, IPC elements).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6326>
2024-03-12 18:07:29 +00:00
Antonio Larrosa
7b8fa42f8a va{h264,h265,av1}enc: fix potential crash on devices without rate control
This fixes a crash in `gst_va_h264_enc_class_init` and `gst_va_h265_enc_class_init`
(and probably also in gst_va_av1_enc_class_init) when calling
`g_object_class_install_properties (object_class, n_props, properties);`

When rate_control_type is 0, the following code is executed in :

```
  } else {
    n_props--;
    properties[PROP_RATE_CONTROL] = NULL;
  }
```

n_props has initially a value of N_PROPERTIES but PROP_RATE_CONTROL
is not the last element in the array, so it's making
g_object_class_install_properties fail to iterate over the
properties array.

This applies the same fix to gstvah264enc.c, gstvah265enc.c and
gstvaav1enc.c.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6319>
2024-03-12 16:58:07 +00:00
Jurijs Satcs
6a9bf8592a mpegtsmux: allow to disable SCTE NULL by setting interval to 0
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6284>
2024-03-12 11:15:58 +00:00
Piotr Brzeziński
d3fba31da0 macos: Move atdec from applemedia (-bad) to osxaudio (-good)
osxaudio has a few helper methods potentially useful in atdec (or future atenc), like GStreamer -> CoreAudio
channel mapping. Doesn't make sense to duplicate them in applemedia, and atdec is the only audio-oriented
element there anyway.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6223>
2024-03-12 09:55:10 +00:00
Matthew Waters
a26b363d3e closedcaption: produce valid cea608 padding by default
Cea608 (valid) padding removal is available on the input side of ccconverter
or configurable on cccombiner.  cccombiner can now configure whether
valid or invalid cea608 padding is used and for valid padding, how long
after valid non-padding to keep sending valid padding.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6300>
2024-03-12 02:49:01 +00:00
He Junyan
861c1a44be va: av1enc: Init the output_frame_num when resetting gf group
Fixes: #3359
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6308>
2024-03-11 12:38:57 +00:00
Chris Spencer
1032d58187 vkmemory: invalidate non-coherent memory when mapping for read
Mapping non-coherent memory does not implicitly invalidate the host caches.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6310>
2024-03-11 01:55:44 +00:00
Chris Spencer
9412565221 vulkan/operation: use timeline semaphore fallback if sync2 not supported
gst_vulkan_operation_add_dependency_frame does not fall back to the
timeline semaphore implementation if VK_KHR_synchronization2 is compiled
in, but not supported by the driver.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6309>
2024-03-11 00:58:40 +00:00
Chris Spencer
7701e9ffeb vulkan/operation: add missing unlock
gst_vulkan_operation_add_dependency_frame does not release its lock if
support for VK_KHR_timeline_semaphore/VK_KHR_synchronization2 is compiled
in, but not supported by the driver.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6309>
2024-03-11 00:58:40 +00:00
Jordan Petridis
95bafc4934 rsvg: Add direct dependency on cairo
We include cairo.h in the element so we should also
declare it in meson.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6306>
2024-03-08 19:01:30 +02:00
François Laignel
7d5bb1ea7a webrtc: add all SSRC attributes getting CAPS for a PT
The transport stream only returned the CAPS for the first matching PT entry
from the `ptmap`. Other SSRC with the same PT where not included. For a stream
which bundled multiple audio streams for instance, only the first SSRC was
knowed to the SSRC demux and downstream elements.

This commit adds all the `ssrc-` attributes from the matching PT entries.

The RTP jitter buffer can now find the CNAME corresponding its SSRC even if it
was not the first to be registered for a particular PT.

The RTP PT demux removes `ssrc-*` attributes cooresponding to other SSRCs
before pushing SSRC specific CAPS to downstream elements.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6119>
2024-03-08 10:28:15 +00:00
François Laignel
aeaef7a7f0 webrtcbin: RFC5576 - early CNAME support
See RFC5576: have CNAME available to the rtpjitterbuffer before the the first
RTCP SR is received, for rapid synchronization. Similar to what was done for
RTSP (last 2 commits) of [MR 2132].

[RFC5576]: https://www.rfc-editor.org/rfc/rfc5576
[MR 2132]: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2132

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6119>
2024-03-08 10:28:15 +00:00
Seungha Yang
4db7eb0290 d3d12screencapturesrc: Add support for WGC API
Adding support for window and monitor capturing by using
Windows Graphics Capture API.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6256>
2024-03-08 01:05:24 +09:00
Seungha Yang
63ef405131 d3d12memory: Implement NT handle caching and custom user data support
Same as the d3d11 memory implementation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6256>
2024-03-08 01:03:28 +09:00
Mathieu Duponchelle
0631a59803 rtponviftimestamp: make sure to set E and T bits on last buffer of lists
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5173>
2024-03-07 14:02:33 +00:00
Jan Schmidt
8356bd04a8 rtponviftimestamp: Use gst_segment_to_stream_time_full()
In the situation where playback starts from a keyframe before
the target playback segment, then the first buffers will be
outside the configured segment and gst_segment_to_stream_time()
will return GST_CLOCK_TIME_NONE unconditionally.

If drop-out-of-segment is false, the RTP buffers will not be
dropped, but will be sent witout ONVIF extension timestamps
and given GST_CLOCK_TIME_NONE timestamps on the receiver.

Instead, use gst_segment_to_stream_time_full() to extrapolate
stream time outside the segment so that such buffers still
get assigned their correct timestamps on the receiver.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6248>
2024-03-06 17:50:53 +00:00
Jan Schmidt
4b107b60e7 dvbsubenc: Fix bottom field size calculation
Don't accidentally include the stuffing byte (if present)
into the bottom field size. It should only be included in the
total segment length.

Fixes problems with FFmpeg not rendering the subtitles
with a stuffing byte, giving a "Invalid object location!" error.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6250>
2024-03-06 16:47:38 +00:00
Sebastian Dröge
df00962cb8 ajasink: Make logging between ajasrc and ajasink more consistent
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6208>
2024-03-06 11:09:58 +00:00
Sebastian Dröge
396aa55958 ajasrc: Improve clock handling
Provide a clock from the source that is a monotonic system clock with
the rate corrected based on the measured and ideal capture rate of the
frames.

If this clock is selected as pipeline clock, then provide perfect
timestamps to downstream.

Otherwise, if the pipeline clock is the monotonic system clock, use the
internal clock for converting back to the monotonic system clock.

Otherwise, use the monotonic system clock time calculated in the above
case and convert that to the pipeline clock.

In all cases this will give a smoother time than the previous code,
which simply took the difference between the driver provided capture
time and the current real-time clock time, and applied that to the
current pipeline clock time.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6208>
2024-03-06 11:09:58 +00:00
Sebastian Dröge
86e3009448 ajasrc: Move frame drop detection after the frame transfer
Otherwise there's a small window between querying the state and doing
the transfer in which a frame could be dropped, and we would then output
the frame right after the dropped one as if it was the dropped frame.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6208>
2024-03-06 11:09:58 +00:00
Sebastian Dröge
170bf0cc8e ajasrc: Improve debug output related to frame transfers
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6208>
2024-03-06 11:09:58 +00:00
He Junyan
a5a1944db4 MSDK: Set the job type when create context from external handle
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6221>
2024-03-06 05:22:23 +00:00
He Junyan
1a78d61b9f vah265enc: Set backward_num to 1 in low delay mode
In low delay B mode, the P frame is converted as B frame with forward
references. For example, One P frame may refers to P-1, P-2 and P-3 in
list0 and refers to P-3, P-2 and P-1 in list1.
So the num in list0 and list1 does not reflect the forward_num and
backward_num. The vaapi does not provide ref num for forward or backward
so far. In this case, we just consider the backward_num to be 1 conservatively.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6249>
2024-03-05 23:39:43 +00:00
He Junyan
b9c28920e0 vah265enc: Improve B pyramid mode in HEVC
If the reference frame number is bigger than 2, we can enable the
pyramid B mode. We do not need to assign a reference frame to each
pyramid level.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6249>
2024-03-05 23:39:43 +00:00
He Junyan
196de61035 vah265enc: Expand log2_max_pic_order_cnt if needed
In b_pyramid mode, B frames can be ref and prevPicOrderCntLsb can
be the B frame POC which is smaller than the P frame. This can cause
POC diff bigger than MaxPicOrderCntLsb/2 and generate wrong POC value.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6249>
2024-03-05 23:39:43 +00:00
Tim-Philipp Müller
756064b9c3 Back to development
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6261>
2024-03-05 12:58:57 +00:00
Tim-Philipp Müller
b125253cad Release 1.24.0 2024-03-04 23:59:25 +00:00
Mathieu Duponchelle
f1e2c7918e analytics: whitespace matters for gtk-doc syntax
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6253>
2024-03-04 17:33:00 +00:00
Olivier Crête
caac280466 analytics: Add documentation to hotdoc build
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6253>
2024-03-04 17:33:00 +00:00
Olivier Crête
7a14b48dad analytics: Add missing documentation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6253>
2024-03-04 17:33:00 +00:00
Olivier Crête
0aecef9b63 analytics: Fix various typos in the documentation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6253>
2024-03-04 09:59:12 -05:00
Seungha Yang
d0713e029c d3d11memory, d3d12memory: Fix outstanding memory count tracing
Gets being released memory back to queue even if allocator is flushing
in order to count the number of outstanding memory objects.
Also, clear queue if there's no outstanding memory object and
allocator is flushing

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6240>
2024-02-29 11:57:50 +00:00
Seungha Yang
27d5e269cc tests: d3d11: Add buffer pool test
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6240>
2024-02-29 11:57:50 +00:00
Seungha Yang
f77f3e83ed cudamemory: Fix outstanding memory count tracing
Gets being released memory back to queue even if allocator is flushing
in order to count the number of outstanding memory objects.
And fixing double count increment

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6240>
2024-02-29 11:57:50 +00:00
Seungha Yang
05aae3dd02 tests: cuda: Add buffer pool test
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6240>
2024-02-29 11:57:50 +00:00
Damian Hobson-Garcia
dd8ef3ec1b waylandsink: Move buffer commits to the display thread
Syncrhonizing buffer commits to the streaming thread can lead to
dropped frames when frame callbacks are not processed before the
next frame is ready for rendering.  Depending on the drift between
the wayland compositor and buffer source timings, this can lead to
periods of significant frame drop, especially when the media frame
rate is close to the display frame rate.

Cache buffers in the streaming thread and peform commits on the
display thread to eliminate the buffer commit racing.

The implementation is the same for both waylandsink and gtkwaylandsink,
so move it to the common wayland library under gst-lib.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6133>
2024-02-27 17:20:42 +00:00
Damian Hobson-Garcia
612ee3b591 wayland: Add API to ref/unref current GstBuffer inside a GstWlBuffer
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6133>
2024-02-27 17:20:42 +00:00
Damian Hobson-Garcia
1b3bb334eb wayland: Add synchronized requests to WlDisplay
Add synchonized versions of wl_display_sync() and wl_callback_destroy()
that will ensure that to callbacks can be managed in a thread safe way
on the display queue even when they are dispatched from a separate
thread.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6133>
2024-02-27 17:20:42 +00:00
Edward Hervey
a3980f4838 docs: Use Discourse and Matrix as prefered communication channels
Part of: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6220
2024-02-27 09:35:47 +01:00
Alexander Slobodeniuk
f92c27a49e d3d11window_win32: fix crash on RC unprepare() vs window_proc()
Unprepare method posts WM_GST_D3D11_DESTROY_INTERNAL_WINDOW
command to the window queue, and from that moment considers
internal_hwnd to be released, and so it sets it to null.
The problem is that it's possible that right at that moment
the window thread might be already processing some other
command, or just another command might be already in the queue.
On practice we met a crash when WM_PAINT got processed in between
(unprepare already finished and WM_GST_D3D11_DESTROY_INTERNAL_WINDOW
was not handled yet)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6187>
2024-02-26 23:17:05 +00:00
Tim-Philipp Müller
d474de8ff0 Release 1.23.90 2024-02-23 18:20:11 +00:00
He Junyan
a734f95790 vabasedec: Fix a possible NULL pointer dereference
The format in _get_preferred_format_and_caps_features() may be NULL.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6206>
2024-02-23 16:55:50 +00:00
Víctor Manuel Jáquez Leal
95436d1eb4 vabasedec: disable derived images for i965 driver
Since it has a very poor performance at reading derived images, which is the
most common use case for decoders.

Partially fixes: #3325

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6202>
2024-02-23 14:20:14 +00:00
Víctor Manuel Jáquez Leal
9567f8f444 vapostproc: optimization for va memory to system memory only
When the conversion is only caps feature from memory:VAMemory to system memory,
it's possible to optimize by doing a pseudo pass-through since the va-backed
buffers are the same for system memory buffers.

This change will also mitigates #2940

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6174>
2024-02-23 12:40:38 +00:00
Seungha Yang
06dc931b52 asiosink: Fix channel selection
Fixing copy paste mistake

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3321
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6170>
2024-02-23 11:21:08 +00:00
Víctor Manuel Jáquez Leal
cc7726ea39 vabase: fail decide allocation if dmabuf without videometa
If the allocation query received from downstream doesn't handle GstVideoMeta but
it requests memory:DMABuf caps feature, it's incomplete, so we rather reject the
negotiation.

Both in base decoder, base transform and compositor.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6155>
2024-02-23 09:52:50 +00:00
naglis
476a34cfdb gstplay: Fix typos in documentation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6177>
2024-02-23 00:35:58 +00:00
Seungha Yang
5d62f408f2 nvcodec: Add plugin status message
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6167>
2024-02-22 23:30:29 +00:00
Seungha Yang
fa477a4a25 amfcodec: Add plugin status message
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6167>
2024-02-22 23:30:29 +00:00
Víctor Manuel Jáquez Leal
301e281777 vabasedec: refactor format and capsfeature selection
This is a simplification of the venerable
gst_va_base_dec_get_preferred_format_and_caps_features() function, which
predates since gstreamer-vaapi. It's used to select the format and the
capsfeature to use when setting the output state. It was complex and hard to
follow. This refactor simplifies a lot the algorithm.

The first thing to remove _downstream_has_video_meta() since, most of the time
it will be called before the caps negotiation, and allocation queries make sense
only after caps negotiation. It might work during renegotiation but, in that
case, caps feature change is uncommon. Better a simple and common approach.

Also, for performance, instead of dealing with caps features as strings, GQuarks
are used.

The refactor works like this:

1. If peer pad returns any caps, the returned caps feature is system memory and
   looks for a proper format in the allowed caps.

2. The allowed caps are traversed at most 3 times: one per each valid caps
   feature. First VAMemory, later DMABuf, and last system memory. The first to
   match in allowed caps is picked, and the first format matching with the
   chroma is picked too.

Notice that, right now, using playbin videoconvert never return any.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6154>
2024-02-22 20:59:13 +00:00
Edward Hervey
34a1245905 subparsers: Give proper category to subtitle "decoders"
Some subtitle "decoders" had a wrong category of "Parser", which `parsebin`
relies on to identify elements which do not *decode* streams but *parse* them.

This would cause such subtitle decoders to be plugged in within parsebin,
preventing the original stream to be properly used by (more efficient)
downstream decoders or subtitle renderers.

Fixes #1757

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6153>
2024-02-22 14:39:54 +00:00
Mengkejiergeli Ba
fc38459e50 msdk: Fix possible memory leaks
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6161>
2024-02-22 11:53:06 +00:00
Seungha Yang
911d840288 wasapi: Fix alloc/free function mismatch
... and fix leak in wasapi device provider

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3326
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6169>
2024-02-21 21:03:32 +00:00
Seungha Yang
06b9864dae wasapi2: Fix task memory leak
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6169>
2024-02-21 21:03:32 +00:00
ekwange
0cbb396ab9 mse: Add logging init for mediasource sample map
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6033>
2024-02-21 18:11:25 +00:00
Kamal Mostafa
ce45e63dcc tests: cudafilter: actually check for cudascale
Actually check for availability of 'cudascale' instead of accidentally
checking for 'cudadownload' twice.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3327
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6158>
2024-02-21 10:16:02 +00:00
Stéphane Cerveau
977a59a3fb test: vkimagebufferpool: fix queue leak
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6143>
2024-02-21 04:50:47 +00:00
Tim-Philipp Müller
9b84d6398a qsv: use new plugin status message API
Minimal example.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3832>
2024-02-21 00:58:19 +00:00
Seungha Yang
354af30d9f wasapi2: Respect ringbuffer buffer/latency time
Decide buffer size based on configured buffer/latency time
if low-latency is disabled, so that ringbuffer can buffer more
than minimum required size.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2870
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6141>
2024-02-20 11:37:09 +00:00
Edward Hervey
62b9049d20 mpegst: Fix ownership of return value
This inherits from the same rule as gst_buffer_add_meta

```
gst-mpegtspesmetadatameta.h:98: Warning: GstMpegts:
gst_buffer_add_mpegts_pes_metadata_meta: return value: Invalid non-constant
return of bare structure or union; register as boxed type or (skip)
```

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6146>
2024-02-20 11:33:33 +02:00
Guillaume Desmottes
b4752ef792 docs: initialize values when GST_PLUGIN_API_FLAG_IGNORE_ENUM_MEMBERS is set
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5491>
2024-02-19 07:50:15 +00:00
Seungha Yang
93f0135798 wasapi2: Fix choppy rendering
This reverts questionable commit 009bc15f33
which looks completely wrong.

The GstWasapi2RingBuffer:buffer_size variable is used to
calculate available buffer size we can write
(i.e., available size = buffer_size - padding_size).
But the commit makes the size to be exactly same as buffer period.
Then, it can confuse this element as if the endpoint buffer is full on
I/O event callback (if padding size is equal to buffer period)
but it's not true.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2870
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6132>
2024-02-19 04:39:25 +00:00
Robert Mader
6b024b50ab v4l2codecs: h264: Fix a memory leak on renegotiation
We only use this anchor when streaming, in which case output_state is
set and needs to get unreffed.
This is in line with how it is handled for all other codecs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6127>
2024-02-15 22:37:11 +01:00
Tim-Philipp Müller
88412ef100 Back to development
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6126>
2024-02-15 16:38:53 +00:00
Tim-Philipp Müller
88751d4110 Release 1.23.2 2024-02-15 15:37:17 +00:00
Tim-Philipp Müller
28b64bc28a Revert "audiobuffersplit: Update out_segment even without discont"
This reverts commit c0dc65d40a.
2024-02-15 15:37:11 +00:00
Jan Alexander Steffens (heftig)
9426eaae6a videoparseutils: Don't double-attach AFD, Bar or unregistered data
We already did this for captions. We also need to do it for the other
meta types to ensure our parsers are idempotent and don't attach
duplicates.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5450>
2024-02-15 13:32:30 +00:00
Jan Alexander Steffens (heftig)
92017b983e videoparseutils: Store multiple user data unregistered messages
A frame can have multiple unregistered messages attached. We need to
store them all.

For: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3008
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5450>
2024-02-15 13:32:30 +00:00
Jan Alexander Steffens (heftig)
75f61cba80 videoparsers: Clear user_data_unregistered explicitly in _reset_frame
This fits better with the model used by the parser elements. It also
properly resets the data when the parser is reset.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5450>
2024-02-15 13:32:30 +00:00
Jan Alexander Steffens (heftig)
3577fdec51 videoparsers: Clear user data explicitly in _reset_frame
This fits better with the model used by the parser elements. It also
properly resets the data when the parser is reset.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5450>
2024-02-15 13:32:30 +00:00
Jan Alexander Steffens (heftig)
b3c03cec8d videoparseutils: Minor improvements to _parse_afd
- Add the missing field parameter and put the output parameter at the
  end.
- Use a switch to verify valid values instead of hard-to-follow range
  checks.
- Don't consider bad values a programming error, just a regular failure.
- Set all data fields at the end so we can pass a pointer to an
  uninitialized structure without GCC complaining.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5450>
2024-02-15 13:32:30 +00:00
Jan Alexander Steffens (heftig)
5c0cad5f02 videoparseutils: Minor improvements to _parse_bar
Use the enum type for the argument and loudly complain when not passing
a place to output.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5450>
2024-02-15 13:32:30 +00:00
Jan Alexander Steffens (heftig)
c0dc65d40a audiobuffersplit: Update out_segment even without discont
We need to forward the segments we get even if we don't see a discont
buffer, or discont was suppressed by gapless mode.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5450>
2024-02-15 13:32:29 +00:00
Xavier Claessens
d86a6715e1 aja: Replace global semaphore with per-device flock()
The global semaphore was never closed/unlinked, causing permission
denied issue if the device is later used by another user. Properly
removing the semaphore when stopping the pipeline would still leave it
open in case of a crash.

With a GStreamer specific name, it was also not preventing other apps to access
the device concurrently.

Finally, if the system has multiple cards, the lock should be per card
and not global (to be confirmed).

Fixes: #3283.

Sponsored-by: Netflix Inc.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6117>
2024-02-15 09:30:20 +00:00
Edward Hervey
d26194db0e libgstplay: Use playbin3 by default
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6120>
2024-02-15 09:00:45 +01:00
Seungha Yang
d98c922995 h265decoder: Fix DPB size calculation
MaxDpbSize specified in A.4.2 tells upper bound of decoded picture
buffer size but does not tell actual required size.
Use max_dec_pic_buffering value as a dpb size. Some backends
such as DXVA and NVDEC might require pre-allocated DPB buffer
and unnecessary large DPB size will result in waste of GPU memory.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6101>
2024-02-14 15:05:59 +00:00
Mathieu Duponchelle
91317aacaf webrtcbin, rtpbin: check before setting properties on jitterbuffer
In rtpbin we already systematically check for all property names
except latency, correct that.

In webrtcbin we need to check before trying to use the do-retransmission
property.

This is useful for the case where an element like identity gets passed
to rtpbin's request-jitterbuffer property, when the application wants
to use webrtcbin in an SFU situation, with no reordering and no added
latency

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6112>
2024-02-14 08:52:50 +00:00
Tim-Philipp Müller
6cfe6299d2 gst-plugins-bad: update translations
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6113>
2024-02-14 04:43:00 +00:00
Daniel Morin
b2098849dc h264parse: correct NAL mode backlog processing
- Only process what is left in backlog when AU was completed, draining or next
  nal is AUD.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6093>
2024-02-13 13:58:13 +00:00
Seungha Yang
cfa8386dd0 nvdecoder: Enable zero-copy only if explicitly enabled
Keep pre-1.24 behavior unless user specifies the number of
output surface size. We are calculating output surface size
conservatively, and it can result in over allocation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6102>
2024-02-13 12:37:07 +00:00
Seungha Yang
59358e439d nvh265dec: Don't convert unknown video format to string
gst_video_format_to_string() method does not allow unknown format

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6102>
2024-02-13 12:37:06 +00:00
Philippe Normand
080320609c dashdemux: Basic support for container-specific-track-id tag
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6041>
2024-02-12 10:37:29 +00:00
Seungha Yang
693dbc9667 d3d12screencapturesrc: Fix choppy display
According to recommendation from MS, IDXGIOutputDuplication::ReleaseFrame()
needs to be called just before IDXGIOutputDuplication::AcquireNextFrame()
for performance reasons, so that driver can accumulate dirty rects
and update texture at once. But it seems to cause choppy output.
Do release acquired frame immediately once processing done,
like d3d11 implementation does.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6092>
2024-02-11 13:13:18 +00:00
Víctor Manuel Jáquez Leal
b485417d03 vulkanh265dec: add H.265 decoder
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6089>
2024-02-10 17:17:24 +00:00
Víctor Manuel Jáquez Leal
4268268a79 tests: vkvideodecode: add H.265 decoding test
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6089>
2024-02-10 17:17:24 +00:00
Víctor Manuel Jáquez Leal
8a4a619c32 tests: vkvideodecode: choose the queue's codec
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6089>
2024-02-10 17:17:24 +00:00
Víctor Manuel Jáquez Leal
d581690f61 tests: vkvideodecode: h264 prefix to global variables
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6089>
2024-02-10 17:17:24 +00:00
Víctor Manuel Jáquez Leal
a853cc419f tests: vkvideodecode: refactor functions for later reuse
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6089>
2024-02-10 17:17:24 +00:00
Víctor Manuel Jáquez Leal
50791d66e1 vulkanh264dec: don't remove graphics queue if it's the same as decoder
Since graphics queue is used for the context transference. So lets' keep it with
its own reference.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6089>
2024-02-10 17:17:23 +00:00
Víctor Manuel Jáquez Leal
5d27f09740 vulkanh264dec: small cleanups
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6089>
2024-02-10 17:17:23 +00:00
Víctor Manuel Jáquez Leal
2011dec249 vulkan/decoder: fix documentation generation
GstVulkanDecoderParameters is an union, not a struct, and that isn't handled by
hotdoc.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6089>
2024-02-10 17:17:23 +00:00
Víctor Manuel Jáquez Leal
f0c5a853a6 vulkan/decoder: don't initialize function table once
Since it has to be associated with the device and it gets destroyed when the
decoder is freed.

Now it's created when the decoder starts and it's flagged.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6089>
2024-02-10 17:17:23 +00:00
Seungha Yang
36c4ef361b d3d12: Add VP8 decoder
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6088>
2024-02-10 21:23:51 +09:00
Seungha Yang
e2eff3e4a3 d3d12decoder: Fix bitstream buffer usage
Resource state of a buffer in upload heap should stay in
generic-read although it's effectively in common state. Some drivers
complains about the wrong state.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6088>
2024-02-10 21:23:28 +09:00
Seungha Yang
b3a29b61c5 dxvavp8decoder: Fix reference frame setting
Fixing typo

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6088>
2024-02-10 21:18:44 +09:00
Tim-Philipp Müller
9fe9e60012 aja: suppress compiler warnings for aja ntv2 subproject
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6087>
2024-02-10 10:10:06 +00:00
Seungha Yang
c5e241932c amfcodec: Update plugin cache
Adding AV1 encoder documentation (added in 1.22) with various
new properties

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6084>
2024-02-10 01:18:27 +00:00
Jonas K Danielsson
87ab5adf7e meson: srt: make sure srt_dep is defined
Without this we will get errors when we try to build with srt disabled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6082>
2024-02-09 17:45:29 +00:00
Xavier Claessens
561f8b71ee structure: Allow STRICT flag only in _serialize_full()
The STRICT flag makes _serialize() nullable which is an API break for
bindings. Forbid it and add _serialize_full() that accepts it and is
properly annotated.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5829>
2024-02-09 15:45:33 +00:00
Sebastian Dröge
2c8f232d79 sdpdemux: Add SDP message (aka session) attributes to the caps too
They apply to all medias, and if overridden by the specific media then
they would also be overridden just below in the created caps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6079>
2024-02-09 14:54:29 +00:00
Seungha Yang
b4ee86d1e7 ksdeviceprovider: Fix crash while probing device caps
Ignore unexpected media type reported by driver, instead of abort

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6081>
2024-02-09 14:09:07 +00:00
Edward Hervey
a1cbe351ec musepack: Prefer using FFmpeg musepack decoder/demuxer
* Bump the rank of the musepack v7/v8 FFmpeg demuxers to SECONDARY
* Bump the rank of the musepack v7/v8 FFmpeg audio decoders to SECONDARY
* Demote the rank of the musepackdec element to MARGINAL

This is for two reasons:
* The musepack library is no longer maintained, whereas the FFmpeg
  implementation can/will receive fixes
* The `musepackdec` implementation was a all-in-one "parsing and decoding" blob
  which doesn't play nicely with decodebin3 and others

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6074>
2024-02-09 12:15:14 +00:00
Seungha Yang
d2d2ac43e8 ccconverter: Send gap event if generated output is empty
Sends a gap event if nothing to output for a given input buffer.
For example, an input buffer might not contain any caption data
for downstream requested field, then we need to inform downstream
of the case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6073>
2024-02-09 11:03:21 +00:00
Guillaume Desmottes
550a21ccbe avdtpsink: post error message when failing to start
Subclasses are supposed to report errors messages if their start
implementation failed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1678>
2024-02-09 10:09:13 +00:00
Marvin Schmidt
da6b28d90b wpe: Rename WPEView to GstWPEThreadedView
WebKit commit b12e7ed2ad3a ("[WPE] Upstream the new WPE platform API
https://bugs.webkit.org/show_bug.cgi?id=265286")[1] added a `WPEView` typedef
which clashes with our `WPEView` class.

Rename the `WPEView` class to `GstWPEThreadedView` to avoid the collision.
Also prefix the `WPEContextThread` class with `Gst` and rename the
source files to reflect the new class name and use lowercase while at it
for consistency

[1] b12e7ed2ad

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6065>
2024-02-08 20:06:08 +00:00
Carlos Rafael Giani
cea5d19665 switchbin: Rework gst_switch_bin_get_allowed_caps() to limit path lock
Previously, the path lock was held even while issuing caps queries to
other elements. This can lead to deadlocks in more complex pipelines.
Avoid this by reworking gst_switch_bin_get_allowed_caps() to acquire
references to switchbin paths and then releasing the path lock.
Subsequent operations in that function then act on the acquired
references, thus eliminating the need for holding the path lock for
the entirety of that function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4632>
2024-02-08 18:33:29 +00:00
Carlos Rafael Giani
cfe484d983 switchbin: Always respond to caps query with all allowed caps
The caps query specifies _all_ caps that the element can handle, not just
caps from the current path element. If for example a switchbin has two
paths, with one having an element that handles video/x-h264, and another
path whose element handles video/x-raw, and the second path is the
current path, then the existing code would report only video/x-raw as
supported. Fix this by report all allowed caps, even if there is a
current path defined.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4632>
2024-02-08 18:33:29 +00:00
Carlos Rafael Giani
c994f27f34 switchbin: Update and improve documentation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4632>
2024-02-08 18:33:29 +00:00
Carlos Rafael Giani
fcc3420929 switchbin: Forward filter caps to internal caps queries
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4632>
2024-02-08 18:33:29 +00:00
Carlos Rafael Giani
d0b9f9fc27 switchbin: Rework allowed-caps computation to allow for passthrough paths
The rationale is that a passthrough path (= one with no element) behaves
as if the switchbin's sink- and srcpad were one. In particular, internal
caps queries (needed for computing the allowed caps) then go to the peers
instead to path elements. Rework gst_switch_bin_get_allowed_caps () for
a clear handling of NULL path elements and for proper dataflow passthrough
and caps & accept-caps query handling.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4632>
2024-02-08 18:33:29 +00:00
Carlos Rafael Giani
0f279cdb86 switchbin: Improve filter caps application
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4632>
2024-02-08 18:33:29 +00:00
Carlos Rafael Giani
9429a69f1c switchbin: Remove leftover drop probe code bits
The drop probe was present in early switchbin versions to implement paths
that drop dataflow. However, this feature turned out to be too problematic
and thus was removed. Some bits remained though. This commit removes those
bits and clarifies that in the current switchbin version, a NULL path
element instead means passthrough.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4632>
2024-02-08 18:33:29 +00:00
Sebastian Dröge
3ca5a2554f ajasink: Add HANC/VANC ancillary data from GstAncillaryMeta
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5488>
2024-02-08 15:28:39 +00:00
Sebastian Dröge
efa7e70d16 ajasrc: Add GstAncillaryMeta for any HANC/VANC ancillary data that is captured
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5488>
2024-02-08 15:28:39 +00:00
Daniel Morin
afa41ec3bc analyticsoverlay: fix gst-launch exemple
- Adapt example to new onnx elements.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6062>
2024-02-07 22:39:57 +00:00
Seungha Yang
d444fe3fdc nvcodec: Update plugin cache
Updating plugin cache for IPC elements, JPEG encoder, and newly added
properties. Also removing Gst*SLDec which does not exist anymore
but renamed to Gst*Dec.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6070>
2024-02-07 22:06:39 +00:00
Sebastian Dröge
77a09c1781 analytics: Allow getting a related meta with ANY type
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6068>
2024-02-07 14:07:52 +00:00
Jan Schmidt
6f652ec8a1 tsdemux: Detect reaching the end of configured segment
If the current segment has a configured stop point, detect
when when pad timestamps proceed past that point and mark
them as EOS. Otherwise, tsdemux continues streaming
the whole input downstream (unless something downstream detects
and returns EOS for us)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6023>
2024-02-07 07:36:02 +00:00
Jan Schmidt
61aefda664 tsdemux: Support segment seeking
Add support for segment seeks and posting segment-done for
seamless non-flushing looping

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6023>
2024-02-07 07:36:02 +00:00
Nirbheek Chauhan
f6f448bb80 meson: Fix several warnings in the build
Deprecations, incorrect options, etc.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6058>
2024-02-06 23:57:17 +00:00
Tim-Philipp Müller
2111d6f015 Back to development
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6066>
2024-02-06 18:29:31 +00:00
Tim-Philipp Müller
9255e397f0 Release 1.23.1 2024-02-06 16:43:27 +00:00
Tim-Philipp Müller
f1940077a2 codecparsers: av1bitwriter: fix Since marker
... and add them to the symbol index to make hotdoc happy
2024-02-06 16:37:13 +00:00
Tim-Philipp Müller
6651bb3ed8 codecparsers: document new GstH265Level and GstH264Level enums
... and add them to the symbol index to make hotdoc happy.
2024-02-06 16:37:13 +00:00
Tim-Philipp Müller
b9b249be48 va: fix g-i annotation
This parameter annotation is unknown :[allow-null-none] None
2024-02-06 16:37:12 +00:00
Nirbheek Chauhan
4822c9a1e2 y4mdec: Fix some debug log categories
Fatal errors should be logged as ERROR, extremely spammy messages
should be logged with TRACE

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5997>
2024-02-06 12:42:54 +00:00
Nirbheek Chauhan
56b16e5232 y4mdec: Parse extended headers written out by FFmpeg
References:
https://wiki.multimedia.cx/index.php/YUV4MPEG2
https://github.com/FFmpeg/FFmpeg/blob/eee3b7e2/libavformat/yuv4mpegenc.c#L74-L166

The primary purpose is to add high bit-depth y4m support, which is
commonly used for testing codecs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5997>
2024-02-06 12:42:54 +00:00
Nirbheek Chauhan
968ebd26ab y4mdec: Simplify header parsing
Use string parsing instead of pointer arithmetic, which makes the code
easier to understand and less error-prone. This has no functional
changes, and is preparation for the next commit, which extends the
header parsing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5997>
2024-02-06 12:42:54 +00:00
sergey radionov
ebc51e3253 nice: resolve result should go to nice helper thread
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5921>
2024-02-06 09:12:13 +00:00
Daniel Morin
8afc305fe2 onnx: fix, update tensor producer and consumers
- Propagate GstTensor.type becoming to GstTensor.data_type to tensor producer
  (onnx) and consumer (TensorDecoder)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6061>
2024-02-05 22:27:59 -05:00
Olivier Crête
7271410391 analyticsoverlay: Don't error out on lack on dependency in auto mode
If the option is set to auto, it shouldn't fail if the dependency is missing.

Fixes #3266

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6060>
2024-02-05 14:59:06 -05:00
Sebastian Dröge
ddd9dcc559 ajasink: Remove workaround for NTV SDK bug that is fixed since a while
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6056>
2024-02-05 16:24:13 +00:00
Víctor Manuel Jáquez Leal
4949c6d153 vkh264dec: GST_USE_UNSTABLE_API for plugin compilation
The code to include H264 decoder base class header wrongly disabled the unstable
API  message. This patch fixes it by setting it as a compilation define of the
plugin.¡

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6055>
2024-02-05 14:25:38 +01:00
Víctor Manuel Jáquez Leal
2c660ee8f5 vkupload: remove unused parameter fetching
It's not required to create a vulkan buffer to fetch its size since all this
handled by internally by the allocator and it was never needed, so it looks like
dead code. Let's delete it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6028>
2024-02-05 10:38:54 +00:00
sergey radionov
39f2afbd45 webrtcbin: it's better to have thread default main context
on thread bound to that main context.
fixes #3271

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6053>
2024-02-05 00:56:47 +00:00
Seungha Yang
35e5178f0e d3d12: Fix potential self thread join
Fence data could hold GstD3D12Device directly or indirectly.
Then if it's holding last refcount, the device object will
be released from the device object's internal thread,
and will try join self thread.
Delegates it to other global background thread to avoid
self thread joining.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6042>
2024-02-05 01:37:32 +09:00
Seungha Yang
1c0f224f05 d3d12memory: Remove unused method
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6042>
2024-02-03 23:22:58 +09:00
Olivier Crête
3325a10f57 onnx: Port SSD detector to C
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6001>
2024-02-02 18:47:52 -05:00
Olivier Crête
5e1291fd86 onnx: Only read labels file one and use GIO
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6001>
2024-02-02 18:43:22 -05:00
Olivier Crête
13de5160be onnx: Add more tensor data types
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6001>
2024-02-02 18:43:21 -05:00
Olivier Crête
e3d8168a5a onnx: Remove unecessary gst_tensor_meta_get_all_from_buffer
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6001>
2024-02-02 18:43:21 -05:00
Olivier Crête
2034f776bb onnx: Merge tensor into tensor meta file
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6001>
2024-02-02 18:43:21 -05:00
Loïc Le Page
eb416d5077 webpenc: add animation properties
- animation background color
- number of animation loops

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5994>
2024-02-02 17:23:08 +00:00
Loïc Le Page
05bd35f625 webpenc: don't allow changing resolution in animation mode
- fails on image resolution changes in animation mode
- fails with a log message on invalid color spaces

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5994>
2024-02-02 17:23:08 +00:00
Loïc Le Page
9fe504c423 webpenc: fix naming and libwebp API calls
- uniformize parameters naming
- call symetric init and clear functions systematically from libwebp API

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5994>
2024-02-02 17:23:08 +00:00
Mathieu Duponchelle
a6409525ef webpenc: add support for animated WebP
The libwebp API doesn't match very well with the GstVideoEncoder
API, as it only delivers an unframed bitstream once all pictures
have been processed, which means we can only push a single buffer
manually on our srcpad on finish().

Supporting animated webp is still valuable, and the feature is
behind an opt-in property.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5994>
2024-02-02 17:23:08 +00:00
Olivier Crête
351f823704 analytics: Always return a string from mtd_type_get_name()
It makes it easier to use in printf() style strings without worrying
about getting a NULL.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6035>
2024-02-02 15:49:56 +00:00
Jonas K Danielsson
7c4e6442db srt: Add basic check test of srt[src|sink]
Add some basic tests for the srtsrc and the srtsink and set us up for
more advanced tests down the road.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5440>
2024-02-02 15:08:02 +00:00
Jonas K Danielsson
e7ae5f0995 srt: Add more fields to application/x-srt-statistics
In order to see how many packets where retransmitted and how many was
dropped we add some new fields.

Please see https://github.com/Haivision/srt/blob/master/docs/API/statistics.md

For details about the new fields.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5322>
2024-02-02 13:57:26 +00:00
Heiko Becker
567a2a7f67 neon: Allow building against neon 0.33.x
From its NEWS file:

"API and ABI backwards-compatible with 0.27.x and later"

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6036>
2024-02-02 00:22:39 +01:00
Philippe Normand
1b01415c3b srtpenc: Fix potential leak
When attempting to process a buffer after the rtcp session was closed the output
buffer memory would remain referenced.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6029>
2024-01-31 18:46:59 +00:00
Daniel Morin
95464c8977 analyticsoverlay: add object-detection overlay
- Overlay analytics-meta-od attached to video buffer

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5768>
2024-01-31 16:15:06 +00:00
Daniel Morin
8122f623f6 analytics: Change indexes type from i32 -> gsize
- gst_analytics_cls_mtd_get_length() return a gsize, this type dicated index
  type for gst_analytics_cls_mtd_get_quark() and
  gst_analytics_cls_mtd_get_level().
- Minor cleanup/improvement on index validation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6018>
2024-01-31 15:22:43 +00:00
Daniel Morin
f1d2147ba8 analytics: add test for OD confidence level retrieval
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6017>
2024-01-31 14:40:56 +00:00
Daniel Morin
42227d7de3 analytics: add api on OD to retrieve bbox confidence
- Add a specific api to retrieve bbox confidence level without having to
  retrieve it's location.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6017>
2024-01-31 14:40:56 +00:00
Seungha Yang
6dc902a962 nvcodec: Add JPEG encoder
Adding nvJPEG library based JPEG encoder element

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6021>
2024-01-31 12:51:28 +00:00
Seungha Yang
fc4b136ac8 nvcodec: Move runtime compiler check to plugin init function
Required information for other elements

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6021>
2024-01-31 12:51:28 +00:00
Thibault Saunier
5d4bf4c6a5 bad: Update plugins cache
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/899>
2024-01-31 11:00:24 +00:00
Thibault Saunier
4dcea207d9 auto: Reuse subbins instead of recreating them over and over
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/899>
2024-01-31 11:00:24 +00:00
Thibault Saunier
79612de803 autoconvert: Force raw memory when using videoconvertscale
videoconvertscale advertises `ANY` feature, but it supports it only
in passthrough. Our goal with autoconvert is to ensure that  conversion
is possible with the elements that are being plugged so we avoid
plugging `videoconvertscale` if the memory type is not system memory.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/899>
2024-01-31 11:00:24 +00:00
Thibault Saunier
9821c0ae96 autovideoconvert: Use cudaconvert for formats not allowed by glcolorconverts
There are some pixel formats supported by `cudaconvert` but not `glcolorconvert`
so prefer using `cudaconvert` for those cases rather than using
`videoconvertscale` and system memory

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/899>
2024-01-31 11:00:24 +00:00
Thibault Saunier
9908d11dab auto: Add an 'autovideoflip' element
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/899>
2024-01-31 11:00:24 +00:00
Thibault Saunier
aa7c49ded8 autoconvert: Accept new caps when they are exactly equal to previous ones
That basically was overlooked as the code was clearly intending to do that

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/899>
2024-01-31 11:00:24 +00:00
Thibault Saunier
e41e31f2ae auto: Add a gstautodeinterlace element
Which can do colorspace conversion if necessary.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/899>
2024-01-31 11:00:24 +00:00
Thibault Saunier
b0fdbcec64 autovideoconvert: Handle passing bin description instead of factories
This way we can build our own well know bins for conversion keeping the
code simple.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/899>
2024-01-31 11:00:24 +00:00
Thibault Saunier
292d8453d3 autoconvert: Factor out a new GstBaseAutoConvert class
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/899>
2024-01-31 11:00:23 +00:00
Thibault Saunier
f817afb865 auto: Expose colorspace and scaler elements for well know elements
And require Scaler in the class of elements to be plugged by
autovideoconvert

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/899>
2024-01-31 11:00:23 +00:00
Thibault Saunier
e153c558c7 autoconvert: Handle reconfiguring on the srcpad
Only upstream renegotiation was properly handled, we needed to answer
that when downstream forces a renegotiation we take into account the
new downstream restrictions.

And add tests for it

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/899>
2024-01-31 11:00:23 +00:00
Thibault Saunier
69db5b77d1 autoconvert: Remove unused elements from the bin
Instead of letting all the elements that were added into the bin,
add them only when strictly needed and removed them when we stop using
them.

With previous refactoring we are keeping them in our own hashmap in
amy case so we can keep reusing the same elements as before.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/899>
2024-01-31 11:00:23 +00:00
Thibault Saunier
8266f534a7 autovideoconvert: Ignore elements with rank == NONE
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/899>
2024-01-31 11:00:23 +00:00
Thibault Saunier
a0a9e9e3cf autoconvert: Fix the way we compare element types
We used to conside elements that were subclassses of another
element type as being the same (for example with videoconvertscale,
bother videoconvert and videoscale are subclasses of videoconvertscale
and that code was lost)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/899>
2024-01-31 11:00:23 +00:00
Thibault Saunier
17029974e0 autoconvert: Stop using qdata and unsafe weak refs
We are still using internal pads that are not added to the bin
but we now have a subclass and avoid qdata and weak refs as
they are not MT safe.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/899>
2024-01-31 11:00:23 +00:00
Thibault Saunier
4cfe898f9b autovideoconvert: Make it a subclass of GstAutoConvert
Instead of a wrapper, making it much simpler.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/899>
2024-01-31 11:00:23 +00:00
Thibault Saunier
8be2ae303a autoconvert: Add a 'factory-names' property
Making the element more gst-launch friendly.

This also stop trying to handle usage of ->factories atomic and instead
use the object lock to handle them.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/899>
2024-01-31 11:00:23 +00:00
Thibault Saunier
1409826232 autoconvert: Remove not thread safe use of ->current_subelement
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/899>
2024-01-31 11:00:22 +00:00
Thibault Saunier
7fae06604e autoconvert: Stop using generic element name
It makes it harder to debug for no real benefice in the case

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/899>
2024-01-31 11:00:21 +00:00
Mengkejiergeli Ba
bf7f4eef20 msdk: Use gst_video_info_dma_drm_to_video_info to extract video info
Note that we need mappings for all drm_fourcc, otherwise we will get
GST_VIDEO_FORMAT_UNKNOWN for some formats...

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5991>
2024-01-31 06:24:13 +00:00
He Junyan
637d253e9f va: baseenc: Fix the wrong parameter order to call va_map_buffer()
The current gst_va_base_enc_copy_output_data() uses wrong parameter
order to call va_map_buffer().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6020>
2024-01-30 15:50:23 +00:00
Seungha Yang
51162acc31 cuda: Report device open error
Call gst_cuda_result() with CUDA_ERROR_NO_DEVICE error code if
we could not open device, so that application can catch the error

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6006>
2024-01-30 14:30:41 +00:00
Seungha Yang
cd6d62ddf0 cuda: Use cuStreamDestroy_v2 API
Sync up with CUDA 11.x/12.0 header

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6006>
2024-01-30 14:30:41 +00:00
Seungha Yang
07ba225183 cudaipc: Add support for custom meta forwarding
Forward custom meta to peer ipcsrc elements

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6006>
2024-01-30 14:30:41 +00:00
Víctor Manuel Jáquez Leal
c760c72f7a vkformat: fetch correctly feature flags2
Feature flags2 are fetch through VkFormatProperties3KHR and needs more guards
checking.

Moved out all the feature flags fetching to another function for clarity.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6014>
2024-01-30 12:57:41 +00:00
Víctor Manuel Jáquez Leal
c24b47ecee vkformat: use VK_KHR_get_physical_device_properties2 to guard
and VK_KHR_format_feature_flags2 rather than a meaningless version handling.

Also the patch brings back the usage of features2 for video extensions, use KHR
version to support the guarded symbols.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6014>
2024-01-30 12:57:41 +00:00
Víctor Manuel Jáquez Leal
394aaa6a59 vulkan: early return if gst_buffer_pool_set_config() fails
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6013>
2024-01-30 11:58:04 +00:00
He Junyan
b4eb97101f va: Implement the vaav1enc plugin
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3015>
2024-01-30 08:24:26 +00:00
He Junyan
f4779f1fab va: baseenc: Extend the create_output_buffer() to accept prefix data
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3015>
2024-01-30 08:24:25 +00:00
He Junyan
726cc895d8 va: encoder: Add copy_output_data() helper function
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3015>
2024-01-30 08:24:25 +00:00
He Junyan
39144f612e va: encoder: extend prepare_output() virtual function
The output of VP9 and AV1 encoder is a little different from the H264
and H265 encoder, it may contain repeat frames and so the output frame
number may be more than the input. We need to call finish_subframe()
when some frame will be repeated later. So we need to extend the
current prepare_output() virtual function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3015>
2024-01-30 08:24:25 +00:00
He Junyan
a278137f7e tests: Add the av1 bit code writer test case
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3015>
2024-01-30 08:24:25 +00:00
He Junyan
040042113e codecparsers: Implement the AV1 bit code writer
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3015>
2024-01-30 08:24:25 +00:00
He Junyan
e1d96d0669 codecparsers: av1: add ref_global_motion_params in frame header
In order to ease the AV1 bit writer to write the global_motion_params
when primary_ref_frame is enabled, we need to add this field to set
the global_motion_params of the reference frame.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3015>
2024-01-30 08:24:25 +00:00
He Junyan
14a5d936f8 codecparsers: av1: add expected_frame_id in frame header
We need it to ease the bit code writing of AV1 frame header.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3015>
2024-01-30 08:24:25 +00:00
Daniel Morin
73dedf9a51 h264parse: Remove un-needed check on SPS state
Fixes #3254
- Having SEI before SPS is not an issue anymore with AU boundary detection
based on backlog.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6004>
2024-01-30 01:22:32 +00:00
Robert Mader
9ee58825cc vaallocator: Allow non-linear modifiers for dummy mem_maps
A client may map dmabufs without the intention to either read or write
to the memory. One example is clients wanting to use the
`gst_video_frame_map()` helper function.

Thus, in order to make buffers from `GstVaDmabufAllocator` conveniently
usable, ignore the modifier check if the client specified neither
`GST_MAP_READ` nor `GST_MAP_WRITE`.

Also skip the `va_sync_surface()` call in that case, as it's likely only
needed for CPU reads/writes.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5965>
2024-01-29 17:10:50 +00:00
Nicolas Dufresne
0b38cb2320 vulkan: Fix clang compiler warning
clang does not like the array index assignment without the `=` sign in
it. This is a gnu extension I believe, and adding the sign is proper.
This fixes the following two warnings:

```
../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideo-private.c:32:40:
warning: use of GNU 'missing =' extension in designator [-Wgnu-designator]
  [GST_VK_VIDEO_EXTENSION_DECODE_H264] {
                                       ^
                                       =
../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideo-private.c:36:40:
warning: use of GNU 'missing =' extension in designator [-Wgnu-designator]
  [GST_VK_VIDEO_EXTENSION_DECODE_H265] {
                                       ^
                                       =
```

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5996>
2024-01-26 16:42:30 +00:00
Seungha Yang
1a7c85a261 qsvh264enc: Always specify field order
qsv runtime will report error when encoding interlaced stream
if session was initialized with unknown field order
but tff/bff is specified in per frame encoding parameter.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5835>
2024-01-25 14:25:16 +00:00
Jan Schmidt
ef71c1319a webrtcbin: Improve SDP intersection for Opus
Remove optional sprop-stereo and sprop-maxcapture fields from Opus
remote offer caps before intersecting with local codec preferences.

According to https://datatracker.ietf.org/doc/html/rfc7587#section-7.1
those fields are sender-only informative, and don't affect
interoperability.

Fixes cases where the webrtc media will end up receive-only if the
local side wants to send stereo but the remote is sending mono, or
vice versa.

There may be other fields in other codecs, so the implementation
anticipates needing to add further fields and codecs in the future.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5993>
2024-01-25 13:37:21 +00:00
Seungha Yang
3855646f1d d3d12: Add MPEG-2 decoder
Most of code additions are just gluing already implemented
GstDxva and GstD3D12Decoder interfaces

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5979>
2024-01-25 11:45:23 +00:00
Jan Schmidt
5e4e57ddb3 timecodestamper: Improve error handling and don't crash
Post a bus message explaining that input buffers must
have timestamps and return GST_FLOW_ERROR, instead of
a confusing NOT-NEGOTIATED

Also remove an errant buffer unref in the error handling
that would lead to crashes after.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5935>
2024-01-25 01:38:08 +00:00
Jan Schmidt
e3fe89aba8 timecodestamper: Don't do finalizing in dispose
Add a finalize method and release locks and things in there, instead
of in the dispose method. Dispose may be called multiple times,
at any time, and should just safely release references to other
memory that might reference it back.

In this case, timecodestamper would later crash in the element
dispose method trying to take the freed mutex from
gst_timecodestamper_release_pad().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5935>
2024-01-25 01:38:08 +00:00
Ruben Gonzalez
5e3fafd025 SA: Remove extra check since libva min version is 1.12
The libva version was updated to 1.12 in PR 4781 [1]
[1] https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4781

NOTE: I also sort va_sources
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5978>
2024-01-25 00:45:55 +00:00
Philippe Normand
9a5ca61f87 vp9parse: Fix critical warning during caps negotiation
`gst_pad_get_allowed_caps()` returns a non-writable caps, so we need to make it
writable, otherwise the `gst_caps_remove_structure()` call below might trigger a
critical warning.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5975>
2024-01-25 00:01:14 +00:00
Seungha Yang
3991801d4a d3d12av1dec: Fix object type name on multi-gpu system
Fixing typo

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5964>
2024-01-24 22:35:17 +00:00
Stéphane Cerveau
dd6fca1d02 vulkan video: add GST_VK_VIDEO_EXTENSIONS enum
To avoid using mysterious value, use an enum to
show the valid value in _vk_codec_extensions

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5922>
2024-01-24 17:00:47 +00:00
Matthew Waters
f50b43c83b vulkan/format: also get features in the fallback case
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5576>
2024-01-24 13:54:41 +00:00
Matthew Waters
634fc913a6 vulkan/format: don't assign an uneeded boolean
We don't actually need the basics_primary/secondary boolean.  The
returned format is decided by the requested usage with fallbacks as
necessary.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5576>
2024-01-24 13:54:41 +00:00
Matthew Waters
420548a6c6 vulkan/format: there is no current need to use the 64-bit feature flags
All of our feature flags are currently covered by the first
VkFormatFeatureFlag enum so far.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5576>
2024-01-24 13:54:41 +00:00
Matthew Waters
080b25cbfe vulkan/format: correct fallback features in from_video_info_2
The features were not actually used and were written into a boolean
value.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5576>
2024-01-24 13:54:41 +00:00
Seungha Yang
f368d63ecd av1parser: Fix potential stack overflow during tile list parsing
The tile_count_minus_1 must be less than or equal to 511 as specified
in spec "6.11.1 General tile list OBU semantics"

Fixes #3214 / CVE-2024-0444 / ZDI-CAN-22873

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5970>
2024-01-24 12:29:12 +00:00
Daniel Stone
da9d4225b1 wayland: Actually use wayland-protocols version dep
Closes: #3242
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5962>
2024-01-23 13:11:23 +00:00
Daniel Stone
3a37778f69 gstwayland: Support wp_single_pixel_buffer_v1
This protocol does what it says on the box, avoiding the need for a 1x1
wl_shm buffer.

A wayland-projects wrap has been added for users who do not have v1.26
available.

This commit was partly authored by Robert Mader.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2662>
2024-01-22 16:51:36 -05:00
Seungha Yang
4fb284346e d3d12h264enc: Fix profile support check
Add missing CheckFeatureSupport() call, and remove unused field

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5952>
2024-01-22 20:10:24 +09:00
Seungha Yang
f44d5d18f3 d3d12: Pass target rectangle to ClearRenderTargetView()
Some drivers seem to be crashing if ClearRenderTargetView() is called
for P010/P016 texture's second subresource (UV plane) without
specified target rectangle.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5952>
2024-01-22 19:40:08 +09:00
Seungha Yang
4e1bf149d0 d3d12: Add H.264 video encoder
Adding video encoder element

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5808>
2024-01-19 12:47:35 +00:00
Mengkejiergeli Ba
b8cb0d1d7f msdkdec: Fix leaks
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5930>
2024-01-18 08:43:48 +00:00
Piotr Brzeziński
3f67e70f39 vtenc: Fix PAUSED->READY deadlock when output loop is running
Explicitly calls gst_vtenc_pause_output_loop when going PAUSED->READY to make sure GST_PAD_STREAM_LOCK is not taken.

Before this change, a deadlock would occur if pipeline got stopped right after one output buffer was generated by vtenc.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5933>
2024-01-18 07:37:58 +00:00
Seungha Yang
e353fe8fcc h264decoder: Handle malformed avc/avc3 packets
Packetized stream format should not contain start-code prefix
in bitstream and each [nal-length-byte, nal-byte] unit should consist of
single nal unit. But there are malformed streams in the world.
Use newly added gst_h264_parser_identify_and_split_nalu_avc()
method to identify each nal unit.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3219
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5772>
2024-01-17 14:57:57 +00:00
Seungha Yang
c737799900 h264parser: Add gst_h264_parser_identify_and_split_nalu_avc() method
Equivalent to _split_nalu_hevc() method in h265parser. This method
will scan start-code prefix and split into individual NAL units
if start-code prefix is detected

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5772>
2024-01-17 14:57:57 +00:00
Mengkejiergeli Ba
a6ab4fa98b msdkdec: Let msdk base decoder maintain the output_state
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5929>
2024-01-17 10:04:03 +08:00
Chris Spencer
2388932767 vkmemory: don't map memory more than once
vkMapMemory may not be called on a memory object that is already
host-mapped. If the gstreamer memory object is mapped more than once then
reuse the existing Vulkan mapping.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5917>
2024-01-16 17:44:48 +01:00
Mengkejiergeli Ba
2c61fd92e2 msdkvpp: Fix dma caps negotiation
Modify the fix_output_format in vpp to directly generate caps with
negotiated src caps, and we have the correct dma caps negotiation in
fix_output_format function. And thus, we can remove the redundant
negotiation of using function pad_accept_memory in vpp.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5845>
2024-01-16 14:04:05 +08:00
Seungha Yang
495390f63a h264parse: Fix AU collection
If remaining NALUs are expected to be drained in the current
process_frame() loop, do not adjust offsets. Otherwise NALU data
will point to random byte position and it would be broken data.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5911>
2024-01-15 21:53:11 +00:00
Seungha Yang
0cceb6f68f d3d12memory: Don't use persistent staging buffer map
Persistent map is not recommended in case of readback

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5919>
2024-01-14 13:10:56 +00:00
Seungha Yang
077470913d d3d12decoder: Use D3D12_HEAP_FLAG_CREATE_NOT_ZEROED flag
Since the first access to a texture is always write, zero initialization
is unnecessary

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5919>
2024-01-14 13:10:56 +00:00
Olivier Crête
b1ac114ca5 onnxinference: Return caps based on model preference when possible
This should enable zero-copy when the model has the right type

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5885>
2024-01-13 22:29:41 +00:00
Olivier Crête
83c2d30438 onnx: Use the element pointer for debug message
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5885>
2024-01-13 22:29:41 +00:00
Olivier Crête
54b361c554 onnx: Extract data type from the model itself
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5885>
2024-01-13 22:29:41 +00:00
Chris Spencer
865227b750 vkimagebufferpool: allow specifying initial image layout
The pool currently defaults to performing a layout transition to
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, with some special exceptions for
video usages. This may not be a legal transition depending on the usage.
Provide an API to explicitly control the initial image layout.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5881>
2024-01-13 05:54:00 +00:00
Scott Moreau
f0d15f335d gst-launch: accept option to set program name
The option --prog-name="PROGRAM-NAME" can be passed to set the program name.
The program name is used by gtk and gstreamer to set the class or app-id.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5263>
2024-01-12 17:11:11 +00:00
Víctor Manuel Jáquez Leal
05d239f631 jpegparse: bump to primary rank
Also updates medias modules for CI.

Fixes: #1775
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3983>
2024-01-12 11:04:07 +01:00
Ratchanan Srirattanamet
facb000afe androidmedia: add NDK implementation of Android MediaCodec
This reduces the amount of Java <-> native calls, which should reduce
overhead a bit. It also paves a way to share the code between Android
and a libhybris-based backend (where GNU/Linux system uses Android
driver) in the future.

Bug: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1242
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4115>
2024-01-11 19:00:13 +00:00
Ratchanan Srirattanamet
a50ce9c6b0 androidmedia: allow multiple implementations of codec and format
When implementing NDK media support, it would be useful to also have JNI
implementation in the same binary as NDK media compatibility is lower.
As such, implement a rudimentary vtable system for gstamc-codec and
gstamc-format, and allow choosing the implementation at static_init()
time.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4115>
2024-01-11 19:00:13 +00:00
Ratchanan Srirattanamet
d0ffcb46df androidmedia: call all static_init() functions from single entry point
This allows the implementations to do custom logic behind the hood. For
example, when NDK implementation is added, the entrypoint can chooses to
statically initialize the NDK implementations or the JNI one.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4115>
2024-01-11 19:00:13 +00:00
Stéphane Cerveau
f337d37d6d codecparsers: add slice type name for h265
Add a method to convert the slice type to a descriptive
name.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5908>
2024-01-11 13:17:43 +01:00
Stéphane Cerveau
9c250179c6 codecparsers: add helper methods for h264
Add two helper methods to convert profile
and slice types

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5908>
2024-01-11 13:17:43 +01:00
Mengkejiergeli Ba
0d04660c5d msdk: Fix memory leaks
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5819>
2024-01-11 14:52:45 +08:00
Olivier Crête
745197d386 analytics: Implement scale meta transform for Object detection meta
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5863>
2024-01-10 18:35:17 -05:00
Olivier Crête
5d3035553c analytics: Replace type quark with opaque struct pointer
This way, we can add function pointers in there for things like
transformations.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5863>
2024-01-10 18:34:53 -05:00
Olivier Crête
91815710dd analyticsmeta: Make the GstAnalyticsRelatableMtdData struct private
Only ask the subclass about how much space they need, this way we can keep
the allocation details more private.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5863>
2024-01-10 18:19:38 -05:00
Stéphane Cerveau
476c7efcb7 vulkan: decoder: create union for profile usage
As a profile can include a VkVideoDecodeUsageInfoKHR
or VkVideoEncodeUsageInfoKHR, use union to separate the both.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5701>
2024-01-10 17:15:12 +00:00
Víctor Manuel Jáquez Leal
7f14bfe8b8 va: basedec: fix return type
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5903>
2024-01-10 12:48:16 +01:00
Mengkejiergeli Ba
14c5d3ee91 msdk: Modify the caps order when register plugins
With this patch, the caps is registered in the order of memory features
as: VAMemory, DMABuf then raw caps in linux path, and D3D11Memory then
raw caps in windows path. It helps to prioritize the video memory for all
msdk elements when doing negotiation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5898>
2024-01-10 01:14:21 +00:00
Mengkejiergeli Ba
7d62166098 msdk: Remove useless function for vp8dec and vc1dec in windows path
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5898>
2024-01-10 01:14:21 +00:00
Robert Mader
a64f2bf628 v4l2codecs: Always chain up to parent decide_allocation function for all codecs
Apply the changes to the codecs previously left out, fixing playback
issues seen with VP9.

See: 70ff80a873 ("v4l2codecs: Always chain up to parent decide_allocation function")
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5896>
2024-01-09 17:29:52 +00:00
Robert Mader
75b7e5fcb3 v4l2codecs/av1decoder: Allow output caps to be updated
To bring AV1 in line - needed for the next commit.

See: d3c5fc815e ("v4l2codecs: Allow output caps to be updated")
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5896>
2024-01-09 17:29:52 +00:00
Stéphane Cerveau
97ebaa0bc1 gstutils: add gst_util_ceil_log2
Move ceil_log2 from nalutils.* to gstutils.*

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5888>
2024-01-09 15:34:10 +00:00
Seungha Yang
a242b93f33 d3d12decoder: Release decoder and heap on stop
Sometimes driver crash happens if ID3D12VideoDevice got closed first,
and then ID3D12VideoDecoderHeap/ID3D12VideoDecoder are released.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5895>
2024-01-09 13:52:44 +00:00
Seungha Yang
6ffed9b3dc d3d12videosink: Fix crash on set_buffer()
set_buffer() can be called with null buffer

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5895>
2024-01-09 13:52:44 +00:00
Seungha Yang
7f2b4b6b09 d3d12: Fix warnings reported by debug layer
Fixing below debug layer report
ID3D12Device::CreateCommittedResource: Ignoring InitialState D3D12_RESOURCE_STATE_COPY_DEST.
Buffers are effectively created in state D3D12_RESOURCE_STATE_COMMON.

Buffer resource will be automatically promoted to D3D12_RESOURCE_STATE_COPY_DEST
at the very first COPY operation time.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5895>
2024-01-09 13:52:44 +00:00
Seungha Yang
e1ecd1de2f d3d12: Simplify fence data setup
Adding COM and GstMiniObject specific methods to skip passing
free function pointer

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5895>
2024-01-09 13:52:44 +00:00
Seungha Yang
2c3f3c0cb6 d3d12device: Print live objects on finalize()
The report from debug layer can help tracing resource leak

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5895>
2024-01-09 13:52:44 +00:00
Seungha Yang
0077c4beb0 d3d12decoder: Set buffer flag on output buffer
... and remove unnecessary condition check

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5891>
2024-01-07 13:38:44 +00:00
Seungha Yang
02563605e8 d3d12videosink: Add gamma, primaries and sampling filter properties
Add properties to control conversion methods

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5891>
2024-01-07 13:38:44 +00:00
Seungha Yang
368d8b9252 d3d12videosink: Add support for 3D transformation
Add x, y, and z axis rotation with scaling support

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5891>
2024-01-07 13:38:44 +00:00
Seungha Yang
72237d2563 d3d12videosink: Add support for MSAA
Adding "msaa" property to support MSAA rendering

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5891>
2024-01-07 13:38:44 +00:00
Seungha Yang
de331217aa d3d12videosink: Add support for fullscreen mode
Adding "fullscreen-on-alt-enter" and "fullscreen" properties so that
use can control fullscreen mode switch

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5891>
2024-01-07 13:38:44 +00:00
Seungha Yang
24d515f57d d3d11screencapturesrc: Hide symbols
Fix potential linking error in case of static build

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5883>
2024-01-05 21:27:35 +09:00
Seungha Yang
ae3ed20f41 d3d12: Add screen capture element
Since DXGI desktop duplication API does not work with Direct3D12 device,
this element will use Direct3D11 device to acquire frame.
Then other rendering operations (e.g., texture copy, render pipeline) will
happen using Direct3D12 API

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5883>
2024-01-05 21:27:35 +09:00
Olivier Crête
6482514737 onnxinference: Fix leak of the output tensors
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5884>
2024-01-04 19:11:20 +00:00
Olivier Crête
06d477a89d onnx: Fix leak in ssdobjectdetector decoder
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5884>
2024-01-04 19:11:20 +00:00
Mengkejiergeli Ba
5d488c444e msdkvpp: Remove passthrough condition in propose_allocation
According to basetransform func: gst_base_transform_do_bufferpool,
it is the upstream to decide if it needs a bufferpool from vpp, so
we don't need passthrough condition in subclass propose_allocation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5879>
2024-01-04 04:35:40 +00:00
Daniel Morin
90a3b63eed h264parse: use AUD to detect first VCL NAL
- Fix skipsize on _update_backlog failure.
- Add robustness to AU completion detection by using AUD when present. If we've
received a AUD we overwrite the first VCL NAL detection when the result was
negative. VCL following AUD is the first VCL of next AU.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5862>
2024-01-03 20:43:34 +00:00
Sebastian Dröge
3cd00da0bc h2652json: Fix mix-up of different enum types
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5873>
2024-01-03 09:03:30 +00:00
Seungha Yang
1b86c9d370 d3d12decoder: Try zero-copy in case of reverse playback too
In case of tier 1 decoder, always use reference-only picture to avoid
fixed-size pool limitation and output decoded picture without
copy even for negative rate. Also do not use copy queue for GPU to GPU
copy. Copy queue is specialized for upload/download and may occupy
PCIE bandwidth. Use direct queue as recommended by vendors.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5877>
2024-01-03 02:08:53 +09:00
Seungha Yang
1fb44b8160 d3d12decoder: Fix crash on flush
On flush event, baseclass will discard all pictures from DPB
but there can be still in-flight commands not finished yet.
Use our command queue, allocator and fence data helper objects
to keep resource available during command execution.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5877>
2024-01-03 01:36:42 +09:00
Seungha Yang
d3b3a1c00a d3d12: Add {set,get}_user_data() methods to command allocator
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5877>
2024-01-03 01:19:39 +09:00
Seungha Yang
9d5277e70e d3d12decoder: Fix barrier usage
Common state promotion and decay does not seem to be applied to
decoder commands. Use barriers explicitly

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5877>
2024-01-03 01:17:32 +09:00
Edward Hervey
583fadc051 dvdspu: Support all video caps for "ANY" feature
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5827>
2024-01-02 14:13:04 +00:00
Arnaud Vrac
705ab7e35a dvdspu: handle frame size event from upstream
An IDX file or codec_data normally contains the original frame size of
the video. Allow upstream to provide this information by sending a
custom event, which will allow scaling the overlay correctly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5827>
2024-01-02 14:13:04 +00:00
Arnaud Vrac
559c4b8429 dvdspu: cache overlay composition
This avoids rendering the overlay buffer for each video frame.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5827>
2024-01-02 14:13:04 +00:00
Arnaud Vrac
5919bfec5e dvdspu: negotiate overlay composition meta with downstream
This allows attaching the overlay composition as a meta on the video
buffer instead of blending with the video.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5827>
2024-01-02 14:13:04 +00:00
Arnaud Vrac
85081cbef7 dvdspu: render to ARGB overlay instead of AYUV
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5827>
2024-01-02 14:13:03 +00:00
Arnaud Vrac
b0ce390d50 dvdspu: render to AYUV overlay
Instead of only supporting writing SPU data directly to YUV frames,
render the SPU data to an intermediate AYUV overlay buffer. The overlay
data is then blended to the video frame.

For the PGS format, the overlay buffer size is set to the size of the
Composition Window, and its position in the overlay composition is set
to the window position. The objects to render are now cropped when the
cropping flag is set.

For the Vobsub format, the overlay buffer size is set to the size of the
Display Area.

Once rendered, the overlay composition rectangle is now moved and scaled
to fit the video output size, to avoid clipping.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5827>
2024-01-02 14:13:03 +00:00
Seungha Yang
087e39564d d3d12videosink: Fix buffer leak
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5875>
2024-01-02 13:02:47 +00:00
Seungha Yang
b0ef890726 d3d12device: Store adapter index
... and remove unused fence object

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5875>
2024-01-02 13:02:47 +00:00
Seungha Yang
0577d1c9de d3d12: Reduce shader visible descriptor size
Shader visible descriptors occupy GPU resource and there are hardware
limits. Thus, in order to minimize the amount of shader visible heaps,
only non shader visible descriptor heap (staging) will be held by d3d12memory.
Then converter will copy the staging descriptor to shader visible
descriptor heap per draw.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5875>
2024-01-02 13:02:47 +00:00
Seungha Yang
0ce6e752e4 d3d12: Use CREATE_NOT_ZEROED heap flag if possible
Zero initialization would have overhead and it's not required
most cases except for textures. Use CREATE_NOT_ZEROED flag
in case of buffer resource or if a texture will be rendered without any
prior read operation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5875>
2024-01-02 13:02:47 +00:00
Seungha Yang
a1ba38cd64 d3d12: Add compositor element
Adding d3d12compositor element. d3d12compositor will build GPU commands
asynchronously and each command is serialized at final render stage.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5875>
2024-01-02 13:02:47 +00:00
Seungha Yang
996346f8d3 d3d12converter: Don't map output buffer with write flag
Conversion will happen when constructed command list is executed,
not by converter element. Thus this object should not map output buffer
with write flag which will result in error if multiple threads
are building commands for the same output target frame.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5875>
2024-01-02 13:02:47 +00:00
Seungha Yang
bffbf0d951 d3d12converter: Add support for texture upload
If buffer is not a d3d12 memory or allocated by other device,
upload to internal d3d12 memory

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5875>
2024-01-02 13:02:47 +00:00
Seungha Yang
f4fe17d8d2 d3d12converter: Add support for blending
Create new PSO if blend state update is required

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5875>
2024-01-02 13:02:47 +00:00
Seungha Yang
7c701058ed d3d12: Add testsrc element
Adding testsrc element with d2d interop support via d3d11on12

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5875>
2024-01-02 13:02:46 +00:00
Seungha Yang
abe1f5044d cuda: Prefer CUBIN over PTX
System installed NVRTC library might be newer version than
driver, then generate PTX can be incompatible with the driver.
Instead of the intermediate code PTX, use actual assembly code
directly.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3108
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5639>
2024-01-02 10:10:09 +00:00
Seungha Yang
7d210af46c docs: Update Windows plugins cache
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5870>
2023-12-29 14:39:00 +00:00
Seungha Yang
2f091e7118 d3d12: Add video sink element
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5870>
2023-12-29 14:39:00 +00:00
Seungha Yang
660f2d7d27 d3d12: Add convert element
Implement converter object with convert element

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5870>
2023-12-29 14:39:00 +00:00
Seungha Yang
4198bd6932 d3d12: Add helper object for fence operation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5870>
2023-12-29 14:39:00 +00:00
Seungha Yang
eeb57061d2 d3d12: Enable plugin only for Windows8 or newer
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5870>
2023-12-29 14:39:00 +00:00
Seungha Yang
3e49d6a75f d3d12: Define more formats
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5870>
2023-12-29 14:39:00 +00:00
Seungha Yang
48cfca413d d3d12: Add header containing core features
... and include the single header instead of listing many ones

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5870>
2023-12-29 14:39:00 +00:00
Seungha Yang
41d8a12649 d3d12: Remove unused methods
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5870>
2023-12-29 14:39:00 +00:00
Seungha Yang
5ce2a7f64f d3d12bufferpool: Don't pre-allocate memory for size calculation
Unlike d3d11, we can know CPU accessible memory layout without
allocation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5870>
2023-12-29 14:39:00 +00:00
Seungha Yang
d316356bf2 d3d12memory: Add alloc_wrapped() method
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5870>
2023-12-29 14:39:00 +00:00
Seungha Yang
3308a976bd d3d12: Add upload element
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5870>
2023-12-29 14:39:00 +00:00
Seungha Yang
e4f794cbdd d3d12bufferpool: Wait fence before reusing buffer
Buffer can be released without waiting fence for previous commands

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5870>
2023-12-29 14:39:00 +00:00
Seungha Yang
1c5bba4b6b d3d12decoder: Remove ID3D12Device4 interface requirement
Old OS may not support the interface. And allow 11_0 feature level
hardware.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5870>
2023-12-29 14:38:59 +00:00
Seungha Yang
4e5d4a45a3 d3d12decoder: Reduce the number of resource barriers
Single barrier per texture is sufficient in case of array-of-textures.
Avoid unnecessary decay barriers

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5870>
2023-12-29 14:38:59 +00:00