Commit graph

2859 commits

Author SHA1 Message Date
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