Commit graph

2298 commits

Author SHA1 Message Date
Sebastian Dröge 7ed446dca9 dvdspu: Make sure enough data is allocated for the available data
If the size read from the stream is smaller than the currently available
data then the size is bogus and the data should simply be discarded.

Fixes ZDI-CAN-20994
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2660

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4896>
2023-06-20 15:36:03 +00:00
Andoni Morales Alastruey fc6e6fb547 vtenc: remove duplicated framerate and size variables
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4282>
2023-06-19 08:37:55 +00:00
Andoni Morales Alastruey 23812bbc92 vtenc: apply DTS offset to ensure DTS <= PTS
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4282>
2023-06-19 08:37:54 +00:00
Seungha Yang 93db77ea3a dwrite: Protect ID2D1Factory API with lock
ID2D1Factory::CreateDxgiSurfaceRenderTarget is not thread-safe

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4886>
2023-06-18 19:58:45 +00:00
Seungha Yang 8325623051 d3d11decoder: Reduce DPB size
Now all codec baseclasses can inform subclasses of correct max DPB size,
and exception handling (e.g., emergency bumping in h.264) has been
improved as well. Smaller number of additional DPB frame allocation
seems to be safe.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4878>
2023-06-18 18:21:03 +00:00
Seungha Yang de749fa356 cuda: Introduce GST_CUDA_CRITICAL_ERRORS env to abort on critical error
Adding GST_CUDA_CRITICAL_ERRORS env variable so that program can be
terminated on unrecoverable error.

Example)
GST_CUDA_CRITICAL_ERRORS=2,700 gst-launch-1.0 ...

In this example, CUDA_ERROR_OUT_OF_MEMORY(2) and
CUDA_ERROR_ILLEGAL_ADDRESS(700) are registered as critical error
and program will be aborted on those errors

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4729>
2023-06-18 16:44:43 +00:00
Seungha Yang 58b166453d cuda: Move cuda debug helper function to .cpp
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4729>
2023-06-18 16:44:43 +00:00
Seungha Yang c40f6dac57 d3d11overlaycompositor: Fix resource leak
Fixing regression since 94eadc9810

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4885>
2023-06-19 00:13:00 +09:00
Seungha Yang 3153e7f46d amfav1enc: Workaround driver bug with bt601 color matrix
If bt601 is specified, driver generates sequence header with identity
color matrix

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4370>
2023-06-16 10:10:33 +00:00
Daniel Almeida ec188eb82e v4l2codecs: Add AV1 decoder
This patch adds AV1 stateless v4l2 decode support using the
new v4l2 request API to communicate with hardware accelerators.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1011>
2023-06-16 01:30:40 +00:00
Benjamin Gaignard 465d146864 codecparser: AV1: fix reference frame ordering
In AV1 specifications earliest_order_hint is initialized at
beginning of the process and not before each frame ordering.

FFMPEG parser does the same.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1011>
2023-06-16 01:30:40 +00:00
Michael Olbrich 3f24a38c8e sdpdemux: ensure that only one srcpad is created per stream
If two senders use the same multicast IP and port then new_session_pad()
may try to add a srcpad to the same stream twice.

stream->srcpad is updated but gst_element_add_pad() fails the second
time. As a result stream->srcpad points to a deleted object and
access in gst_sdp_demux_stream_free() fails with a segfault.

Just ignore the second pad. Nothing useful can be done with it anyway.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4603>
2023-06-15 23:35:30 +00:00
Seungha Yang 5b6ecf359e va: Fix Windows build
DRM_FORMAT_MOD_LINEAR and DRM_FORMAT_MOD_INVALID are not defined
on Windows

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4864>
2023-06-15 21:14:29 +00:00
James Cowgill 70ff80a873 v4l2codecs: Always chain up to parent decide_allocation function
The `gst_video_decoder_negotiate_pool` function expects the
`decide_allocation` function to always provide a pool and will fail to
negotiate if the pool is missing. If we return immediately (even if we
don't need to do anything special) negotiation will fail if the
downstream element does not propose a pool.

Fix by chaining up to the default `decide_allocation` function which
adds a fallback pool if one was not already proposed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4630>
2023-06-15 17:02:28 +00:00
Nicolas Dufresne 42c12c9c73 doc: Update plugin cache
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3447>
2023-06-15 10:41:26 -04:00
Nicolas Dufresne 0f5d10f617 v4l2codecs: Enable Verisilicon 10bit 4:2:0 support
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3447>
2023-06-15 14:32:32 +00:00
Nicolas Dufresne aea74db1a2 v4l2: Sync headers to current media_stage
commit d78b9d6671decdaedb539635b1d0a34f8f5934f8

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3447>
2023-06-15 14:32:32 +00:00
Seungha Yang ba6800ce23 dwrite: Add DirectWrite text rendering plugin
Adding DirectWrite text rendering elements
* dwriteclockoverlay: Equivalent to clockoverlay
* dwritetimeoverlay: Equivalent to timeoverlay
* dwritetextoverlay: Similar to textoverlay but subtitle is not
  supported

Newly added elements support system memory and d3d11 memory

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4826>
2023-06-15 12:53:02 +00:00
Seungha Yang 01edbf6c6b d3d11overlaycompositor: Add support for d3d11 memory
If overlay buffer is d3d11 memory, use it directly

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4826>
2023-06-15 12:53:02 +00:00
Aaron Boxer a72ca72a27 mpegtsmux: add stream-number property on GstBaseTsMuxPad
This new property allows setting of PES stream number for AAC audio
and AVC video streams.

The stream number is subject to the following constraints:

1. it must be between 0 and 15 for video
2. it must be between 0 and 31 for audio

Currently the PES stream number is hard-coded to zero for these
stream types.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4822>
2023-06-15 10:34:25 +00:00
Marek Vasut 4c92d4096e bayer2rgb: Support video/x-bayer 10/12/14/16 bit depths
Add support for 10/12/14/16 bit depths . This consists of multiple parts.
First is the parsing of caps, which pulls out the bitness and endianness
from the video/x-bayer format.

Second, gst_bayer2rgb_split_and_upsample_horiz() is split into two similar
functions, one for 8bit bayer handling and another for 16bit bayer handling.
The content is basically identical, except one uses 8bpp and the other 16bpp
inputs and outputs, and they each use different ORC code to match. The 16bpp
variant also handles endian swapping. There is now a wrapper called
gst_bayer2rgb_split_and_upsample_horiz() which selects the correct function
based on bpp from the parser.

Third, gst_bayer2rgb_process() is extended to handle both 8bit and 16bit
bayer data. Yet again there are matching ORC functions to handle the 16bit
data. This time however the 16bit handling of data is slightly special. The
ORC is not able to emit opcodes for 'x2 mergelq', so the trick here is to
store the BG and GR longs into separate 'dtmp' temporary buffer, and then
do one more ORC post-processing step, compensate for the less-than-16bpp
bitness using left shift, and reorder them into the destination frame
using 'mergelq' .

Example usage:
```
$ gst-launch-1.0 videotestsrc ! \
    video/x-bayer,width=512,height=512,format=bggr16le ! \
    bayer2rgb ! \
    video/x-raw,format=RGBA64_LE ! \
    videoconvert ! \
    autovideosink
```

Example usage:
```
$ gst-launch-1.0 videotestsrc ! \
    video/x-raw,width=512,height=512,format=ARGB ! \
    rgb2bayer ! \
    video/x-bayer,format=bggr12le ! \
    bayer2rgb ! \
    video/x-raw,format=RGBA64_LE ! \
    videoconvert ! \
    autovideosink
```

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4686>
2023-06-15 08:26:12 +00:00
Marek Vasut 9d1a750117 bayer2rgb: Add comments explaining gst_bayer2rgb_process()
Add comments regarding which LINE()s point to which data in the
temporary buffer and a large comment explaining how the buffer
is processed. This will hopefully be useful to someone, as the
code is not obvious. No functional change.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4686>
2023-06-15 08:26:12 +00:00
Marek Vasut 920851945f bayer2rgb: Add comment on bayer_orc_horiz_upsample
Explain how the bayer_orc_horiz_upsample function works and
what it does with the pixels, as this may not be obvious.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4686>
2023-06-15 08:26:12 +00:00
Marek Vasut 4efe11a705 bayer2rgb: Pass filter pointer into gst_bayer2rgb_split_and_upsample_horiz()
Instead of passing a single element of GstBayer2RGB structure into the
gst_bayer2rgb_split_and_upsample_horiz(), pass the entire pointer and
let the funciton pick out whatever it needs out of the structure. This
is a preparatory patch. No functional change.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4686>
2023-06-15 08:26:12 +00:00
Marek Vasut fbd02b3e2a bayer2rgb: Pass all parameters to LINE() macro
Pass all three parameters used by the LINE() macro to the LINE() macro
and unroll the code for readability. Add more comments regarding which
of these LINE()s point to which data in the temporary buffer to make
the code less confusing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4686>
2023-06-15 08:26:12 +00:00
Marek Vasut 8bec6828f4 bayer2rgb: Fold src_stride into gst_bayer2rgb_process()
The source stride parameter can be easily obtained from GstBayer2RGB
structure, do it within gst_bayer2rgb_process() and drop the parameter.
No functional change.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4686>
2023-06-15 08:26:12 +00:00
Marek Vasut ddcb45ffc0 bayer2rgb: Inline the j=0 value
The j variable is used as an iterator further down in this code, but
here it can be just inlined in the macro parameters to make the code
easier to read. This is done in preparation for further changes. No
functional change.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4686>
2023-06-15 08:26:12 +00:00
Marek Vasut 484e31c1d9 bayer2rgb: Disable in-place transform
The bayer2rgb process implemented doesn't support in-place tranform.
This element doesn't implement a "transform_ip" vmethod of
GstBaseTransform it will revert to using the "tranform" vmethod.
It's misleading to set it to TRUE, here. Change this to FALSE.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4686>
2023-06-15 08:26:12 +00:00
Marek Vasut 0763fb107d rgb2bayer: Support video/x-bayer 10/12/14/16 bit depths
Add support for conversion to 10/12/14/16 bit bayer pattern.
The implementation is rather simplistic, just take the ARGB
input, generate 16-bit data out of it instead of 8-bit, shift
them as required by the output bitness, and apply endian swap.

Example usage:
```
$ gst-launch-1.0 videotestsrc num-buffers=1 ! \
    video/x-raw,width=512,height=512,format=ARGB ! \
    rgb2bayer ! \
    video/x-bayer,format=bggr12le ! \
    filesink location=/tmp/bayer12.raw
```

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4686>
2023-06-15 08:26:12 +00:00
Seungha Yang 110ec5d4b2 d3dvideosink: Fix navigation event leak
Fixing regression introduced in 6c2f6c3bd4

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4863>
2023-06-15 05:09:46 +00:00
Seungha Yang 94eadc9810 d3d11videosink: Fixing unexpected overlay composition meta drops
A buffer can hold multiple GstVideoOverlayCompositionMeta objects.
Should scan all metas on a buffer and render all overlay rectangles
if any.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4862>
2023-06-15 00:35:09 +00:00
Marek Vasut f18e30cf3b kmssink: Add ST STM32 LTDC auto-detection
Add STM32 LTDC controller into list of auto-detected modules.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4858>
2023-06-14 22:35:27 +00:00
Marek Vasut b8b53cafcf kmssink: Add NXP i.MX8M Plus LCDIFv3 auto-detection
Add i.MX8M Plus LCDIFv3 controller into list of auto-detected modules.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4858>
2023-06-14 22:35:27 +00:00
Arun Raghavan e1139e740a webrtcdsp: Deal with echo probe info not being available
Even if we don't yet know what the echo probe format is, we want to be able to
provide silence for the reverse path, so that when the probe becomes available,
there is no ambiguity around what time period the new set of samples are for.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4849>
2023-06-14 20:08:52 +00:00
Nirbheek Chauhan fade0748d1 webrtcdsp: Map probe buffers with probe info, not dsp info
The probe's info may not precisely match the dsp's info. For instance,
the number of channels or their layout might be different.

```
GStreamer-Audio-CRITICAL **: 16:21:32.899: the GstAudioInfo argument is not equal to the GstAudioMeta's attached info
```

This broke in d5755744c3.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4849>
2023-06-14 20:08:52 +00:00
Seungha Yang 842805d7c6 av1decoder: Fix DPB size signalling
Take current frame into account for the DPB size signalling

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4845>
2023-06-14 15:16:04 +00:00
Seungha Yang 77b9e1351a mpeg2decoder: Fix DPB size signalling
Take current frame into account for the DPB size signalling

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4845>
2023-06-14 15:16:04 +00:00
Seungha Yang 965e566156 vp9decoder: Fix DPB size signalling
Take current frame into account for the DPB size signalling

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4845>
2023-06-14 15:16:04 +00:00
Seungha Yang 7d2beab9b1 vp8decoder: Fix DPB size signalling
Take current frame into account for the DPB size signalling

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4845>
2023-06-14 15:16:04 +00:00
François Laignel 32fbad8d39 srtpdec: fix Got data flow before segment event
A race condition can occur in `srtpdec` during the READY -> NULL transition:
an RTCP buffer can make its way to `gst_srtp_dec_chain` while the element is
partially stopped, resulting in the following critical warning:

> Got data flow before segment event

The problematic sequence is the following:

1. An RTCP buffer is being handled by the chain function for the
   `rtcp_sinkpad`. Since, this is the first buffer, we try pushing the sticky
   events to `rtcp_srcpad`.
2. At the same moment, the element is being transitioned from PAUSED to READY.
3. While checking and pushing the sticky events for `rtcp_srcpad`, we reach the
   Segment event. For this, we try to get it from the "otherpad", in this case
   `rtp_srcpad`. In the problematic case, `rtp_srcpad` has already been
   deactivated so its sticky events have been cleared. We won't be pushing any
   Segment event to `rtcp_srcpad`.
4. We return to the chain function for `rtcp_sinkpad` and try pushing the
   buffer to `rtcp_srcpad` for which deactivation hasn't started yet, hence the
   "Got data flow before segment event".

This commit:

- Adds a boolean return value to `gst_srtp_dec_push_early_events`: in case the
  Segment event can't be retrieved, `gst_srtp_dec_chain` can return  an error
  instead of calling `gst_pad_push`.
- Replaces the obsolete `gst_pad_set_caps` with `gst_pad_push_event`. The
  additional preconditions checked by previous function are guaranteed here
  since we push a fixed Caps which was built in the same function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4844>
2023-06-14 11:59:33 +00:00
François Laignel 96450f4c59 srtpdec: fix assertion 'parent->numsinkpads <= 1' failed
A race condition can occur in `srtpdec` during the READY -> NULL transition:
an RTCP buffer can make its way to `gst_srtp_dec_chain` while the element is
partially stopped, resulting in the following critical warning:

> assertion 'parent->numsinkpads <= 1' failed

This can occur when the first RTCP buffer is received during the READY -> NULL
transition. If deactivation of the `rtp_srcpad` has already reached
`post_activate`, the sticky events are removed from this Pad. In this case,
`gst_srtp_dec_push_early_events` branches to the generation of a stream id
using `gst_pad_create_stream_id`. This function ensures that the element
doesn't own more than 1 sink pad. Since `srtpdec` owns two of them, the
assertion fails.

This commit uses `gst_element_decorate_stream_id` which doesn't perform this
check. The preconditions is not necessary in this particular context since the
stream id for the RTP / RTCP pads are derived from the same id.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4844>
2023-06-14 11:59:33 +00:00
Seungha Yang a88d90b777 d3d11: Log device removed reason
... and live objects. It could be useful hint for GPU debugging

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4170>
2023-06-14 06:23:12 +00:00
Tim-Philipp Müller a9c5e5e239 asfmux: fix potentially unaligned write on 32-bit ARM
Fixes #2665

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4842>
2023-06-14 04:59:05 +00:00
Víctor Manuel Jáquez Leal 06a2b2c7d9 va: dmabuf allocator to use GstVideoInfoDmaDrm
Change the internal GstVideoInfo structure in the GstVaDmabufAllocator to
GstVideoInfoDmaDrm in order to keep track of the exported DRM format by the
driver, and thus removing the DRMModifier quark attached as qdata in the
GstMemory. Though, the exposed API isn't updated yet; that has to go in a
second iteration.

Also this patch clean up some code (remove an unused buffer size assignation)
and fix some typos in documentation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4821>
2023-06-14 01:08:37 +00:00
He Junyan b59b77a02f va: Add helper functions to convert GstVideoInfoDmaDrm into va video info
The VA has its internal video format mapping(because different drivers may
have different interpretation for the same format), so we should convert the
info in GstVideoInfoDmaDrm into the according video info based on that mapping.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4821>
2023-06-14 01:08:37 +00:00
He Junyan c72960b427 va: Replace the tabs into spaces in gstvacaps.h
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4821>
2023-06-14 01:08:37 +00:00
He Junyan e00e64116a va: Add a helper function to detect the surface modifier
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4821>
2023-06-14 01:08:37 +00:00
He Junyan a01f2f0206 va: Lower the message level for va_export_surface_to_dmabuf()
Some surface formats such as GST_VIDEO_FORMAT_Y42B and GST_VIDEO_FORMAT_RGB
can be created but can not be exported as DMA buffer. You can not say that
this is a driver bug because the driver may never want to share this kind of
surface out of libva.
And this function will be used to detect modifiers later, so the error message
will be annoying.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4821>
2023-06-14 01:08:37 +00:00
He Junyan 7166fd3863 va: Extend the va_create_surfaces() function to accept modifiers
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4821>
2023-06-14 01:08:37 +00:00
He Junyan 994ab957c1 va: Add a helper function to convert video drm info to video info
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4821>
2023-06-14 01:08:36 +00:00
He Junyan 547f3e8622 va: Map drm fourcc into va fourcc in video format
The fourcc defined in va.h and drm_fourcc.h sometimes is not identical.
For example, the I420 format is defined as "I420" in va.h but defined
as "YU12" in drm_fourcc.h.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4821>
2023-06-14 01:08:36 +00:00
Nicolas Dufresne 4402a8044f fakesinks: Fix recursive notify loop
The proxy callback for the notify::last-message was emiting the signal
again on the child, which caused an infinit loop. We could swap the child
and the user data to signal to the bin instead, but it was found that proxying
this signal was not very useful. Typical use case it to set silent=0 and use
deep-notify feature. Proxying that signal just duplicate that output which
isn't very useful.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4766>
2023-06-13 23:33:08 +00:00
Nicolas Dufresne 5f2a664415 v4l2codecs: h265: Set num_delta_pocs_of_ref_rps_idx
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4413>
2023-06-13 14:34:45 +00:00
Nicolas Dufresne 6a7835e106 v4l2codecs: Extend the API with num_delta_pocs_of_ref_rps_idx
This value is an alternative to short_term_ref_pic_set_size and can be used
to parse the RPS portion of a slice header, instead of skipping over it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4413>
2023-06-13 14:34:45 +00:00
Seungha Yang e422a991f3 h265decoder: Calculate DPB size based on level
As specified in "A.4 Tiers and levels", calculate DPB size based
on level in order to avoid over preallocated DPB

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4840>
2023-06-13 02:57:06 +00:00
Jan Alexander Steffens (heftig) 6e9d67bbc1 mpegtsmux: Use terminological ISO 639-2 language codes
These are preferred in most circumstances.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2649
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4795>
2023-06-12 08:51:10 +00:00
Seungha Yang ebd5ff73be d3d11convert: Add support for premultiplied alpha conversion
Adding "src-alpha-mode" and "dest-alpha-mode" properties
to support alpha mode conversion

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4825>
2023-06-10 18:12:58 +00:00
Seungha Yang 80878a6ea4 d3d11testsrc: Add "alpha" and "alpha-mode" properties
Adding global alpha and alpha mode options

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4825>
2023-06-10 18:12:58 +00:00
Seungha Yang cb28a16007 d3d11overlaycompositor: Handle premultiplied alpha in pixel shader
Do premultiplied -> straight alpha conversion using GPU

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4825>
2023-06-10 18:12:58 +00:00
Seungha Yang 15735a4ef3 d3d11converter: Add support for premultiplied alpha
Adding "src-alpha-mode" and "dest-alpha-mode" properties
and performs premultiplied alpha conversion if needed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4825>
2023-06-10 18:12:58 +00:00
Seungha Yang 1aa9e74aaf cudadownload: Always download CUDA memory if it's bound to decoder
Decoder bounded CUDA memory is allocated by driver and the pool size
is fixed. Since we don't know how many buffers would be held by
downstream non-CUDA element, we should download such CUDA memory
and release it back to decoder.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4810>
2023-06-08 22:27:06 +00:00
Víctor Manuel Jáquez Leal 8dff9d5ad0 doc: use gir file if dependency is not available
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4781>
2023-06-08 08:50:05 +00:00
Víctor Manuel Jáquez Leal 94250e8c31 msdk: remove libva check before 1.12
Since gstmsdk depends on gstva library it also bumps the required version.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4781>
2023-06-08 08:50:05 +00:00
Víctor Manuel Jáquez Leal 53860147c6 va: bump libva version to 1.12
Remove all checks in gstva for all version lower than 1.12

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4781>
2023-06-08 08:50:04 +00:00
Seungha Yang 8a4642cad7 win32ipc: Use gst_util_get_timestamp()
Instead of duplicating the same code

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4794>
2023-06-08 01:02:45 +00:00
Seungha Yang 3c5684e085 d3d11: Use gst_util_get_timestamp()
instead of duplicating the same code

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4794>
2023-06-08 01:02:45 +00:00
Vivia Nikolaidou 0e62bb2ba6 basetsmux: Fix language crash when ts_pad->stream is NULL
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4785>
2023-06-07 16:58:38 +00:00
Vivia Nikolaidou 0a331402d6 tsdemux: Detect language from ac3 descriptor
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4709>
2023-06-07 13:04:03 +00:00
Seungha Yang 4d6a2dea89 d3d11ipcsrc: Stop asynchronously in case of io-mode=import
In case of import mode, d3d11ipcsrc does not know when outputted
memories will be released.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4774>
2023-06-06 17:54:44 +00:00
Seungha Yang ef1853aa8d d3d11ipc: Use unnamed shareable handle
Exchanging HANDLE would have smaller overhead than string

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4774>
2023-06-06 17:54:44 +00:00
Seungha Yang 1e5343f0c6 d3d11memory: Add support for resource sharing via NT handle
Adding gst_d3d11_memory_get_nt_handle() method so that GstD3D11Memory
can hold shareable NT handle and for easy reuse of it

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4774>
2023-06-06 17:54:44 +00:00
Seungha Yang aada49c6a6 d3d11ipcsink: Don't clear prepared sample on render
render() can be called multiple times for the same prepared sample

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4774>
2023-06-06 17:54:44 +00:00
Sebastian Dröge f1e7ac13cd decklink: Implement Windows string conversion with common API between MinGW and MSVC
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4738>
2023-06-06 06:21:46 +00:00
Sebastian Dröge ab582a3b7d decklink: Add some newlines in long defines
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4738>
2023-06-06 06:21:46 +00:00
Maksym Khomenko 72e7ae724f decklink: Calculate string size before malloc
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4738>
2023-06-06 06:21:46 +00:00
Sebastian Dröge ab946cd41e decklink: Use the macOS version of the SDK on macOS and not the Linux one
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4738>
2023-06-06 06:21:46 +00:00
Sebastian Dröge a2850bcb88 decklink: Free SDK strings after usage on Linux
While they're const char* they still need to be freed like on Windows
and macOS and would be leaked otherwise.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4738>
2023-06-06 06:21:46 +00:00
Sebastian Dröge 59ca9ef342 decklink: Correctly handle SDK strings on macOS
They're CFStringRef* and not plain NUL-terminated char* C strings.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4738>
2023-06-06 06:21:46 +00:00
Aaron Boxer e624e7c695 onnxobjectdetector: gracefully handle Ort exceptions rather than dumping core
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4765>
2023-06-05 17:47:58 +00:00
Víctor Manuel Jáquez Leal e074cb55f7 va: remove unused parameters in internal function
gst_va_buffer_surface_new() don't use neither format, width nor height.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4768>
2023-06-04 19:16:53 +02:00
Matthew Waters c3af29db1e build/android: remove all references to gnustl
Not needed anymore with NDK R25.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4747>
2023-06-03 23:21:34 +00:00
Seungha Yang e4c43db5d5 d3d11basefilter: Forward video related metas if needed
The same as in GstVideoFilter

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4751>
2023-06-02 00:33:52 +00:00
Michael Grzeschik ea2764aa69 uvcsink: add probe handling for live pipelines
Currently the uvcsink is only capable to run in an application
that is handling the state transitions of the pipeline properly
by checking on streaming event from the uvcsink.

This code is improving the element by adding an fakesink to
consume possible videostream flow in case the pipeline state
is not changing on hosts streamoff.

This is helpfull when using local gst-launch pipelines where
the streaming event is not monitored to change the pipelines
state.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1304>
2023-06-01 19:19:05 +00:00
Michael Grzeschik 5d82deb2c5 uvcsink: add new bin element around v4l2sink
This patch adds an element to stream video data to an uvc video gadget.
The element handles the uvc events STREAMON, STREAMOFF, SETUP and DATA.
to start, stop and configure the video buffer flow by the use of pad
probes. It works with linux kernels of versions higher than v6.1.

The element makes use of the v4l2sink proxy property v4l2sink::device
to locate the corresponding device to parse the configfs for additional
data.

The code in uvc.c is basically derived from /lib/uvc.c in
https://git.ideasonboard.org/uvc-gadget.git.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1304>
2023-06-01 19:19:05 +00:00
Michael Grzeschik 6ef14df09b uvcsink: configfs.{c,h}: add helper function to parse by videodev
- add helper function video_find_config_name
- add helper function configfs_parse_uvc_videodev

With these helper functions it is possible to parse the
configfs entry corresponding to the used videodev.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1304>
2023-06-01 19:19:05 +00:00
Michael Grzeschik 079fc8216c uvcsink: configfs.c: use G_N_ELEMENTS instead of ARRAY_SIZE
We don't have ARRAY_SIZE in glib.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1304>
2023-06-01 19:19:05 +00:00
Michael Grzeschik fd3a6ce642 uvcsink: configfs.c: fix globing in uvc_video_device
The gadget in the sysfs can be postfixed with an index.
Fix the globbing by adding a wildcard after /gadget*/.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1304>
2023-06-01 19:19:05 +00:00
Michael Grzeschik 38aa1fc414 uvcsink: configfs.c: refactor location of GUID formats
- move GUID handling to beginning

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1304>
2023-06-01 19:19:05 +00:00
Michael Grzeschik da61d8f96d uvcsink: configfs.{c,h}: add parsing of more fields from format
- add parsing of dwMaxVideoFrameBufferSize

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1304>
2023-06-01 19:19:05 +00:00
Michael Grzeschik e50dcac517 uvcsink: configfs.c: fix code for local usage
- use local header file and remove unused reference to tools.h

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1304>
2023-06-01 19:19:05 +00:00
Michael Grzeschik 42c53f971c uvcsink: add configfs.{c,h} from https://git.ideasonboard.org/uvc-gadget.git
- imported both files and run gst-indent on them

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1304>
2023-06-01 19:19:04 +00:00
Vivia Nikolaidou 395e0c3925 tsmux: Resend PMT whenever the language changes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4711>
2023-06-01 17:05:11 +00:00
Víctor Manuel Jáquez Leal 06d793033d vulkan/format: use basic features (v1) as fallback
if vkGetPhysicalDeviceFormatProperties2 isn't available.

This approach assumes that, for basic features flags symbols,
VkFormatFeatureFlagBits and VkFormatFeatureFlagBits2 are binary equivalent.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4746>
2023-06-01 13:58:47 +00:00
Matthew Waters 0a74a967e3 vulkan/format: don't rely on vulkan header version for function availability
e.g. android will have update vulkan.h headers but old platforms will
not contain the function and will result in a link error.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4746>
2023-06-01 13:58:47 +00:00
Arun Raghavan d5755744c3 webrtcdsp: Update code for webrtc-audio-processing-1
Updated API usage appropriately, and now we have a versioned package to
track breaking vs. non-breaking updates.

Deprecates a number of properties (and we have to plug in our own values
for related enums which are now gone):

  * echo-suprression-level
  * experimental-agc
  * extended-filter
  * delay-agnostic
  * voice-detection-frame-size-ms
  * voice-detection-likelihood

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2943>
2023-06-01 09:34:37 +00:00
Mathieu Duponchelle 211928ca41 webrtc/nice: put usage of OPTION_CONSENT_FRESHNESS behind check
See https://gitlab.freedesktop.org/libnice/libnice/-/merge_requests/257

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4750>
2023-06-01 00:42:28 +00:00
Thibault Saunier 4a4d7821a5 cudabasetransform: Handle video related meta as appropriate
This implements the same logic as GstVideoFilter

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4731>
2023-05-31 20:09:42 +00:00
Thibault Saunier 8d3f90eb8d cuda: memory: Enhance debug when CU_GL_DEVICE_LIST_ALL fails
Ensuring error from cuda is logged

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4731>
2023-05-31 20:09:42 +00:00
Colin Kinloch 82c449ce00 waylandsink: Emit "map" signal boarder surface is ready
This allows gtkwaylandsink to queue a draw of its gtk widget at the
correct time, avoiding a race.

Signed-off-by: Colin Kinloch <colin.kinloch@collabora.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4722>
2023-05-31 18:57:56 +00:00
Stéphane Cerveau 5873747a59 tools: add bad/ges/omx tools to gst_tools
In static mode, these tools must be built
after the gstreamer-full library to use
the symbol gst_init_static_plugins.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4128>
2023-05-31 15:17:11 +00:00
Stéphane Cerveau dd17beb681 gstreamer-full: add full static support
Allow a project to use gstreamer-full as a static library
and link to create a binary without dependencies.

Introduce the option 'gst-full-target-type' to
select the build type, dynamic(default) or static.

In gstreamer-full/static build configuration gstreamer (gst.c)
needs the symbol gst_init_static_plugins which is defined
in gstreamer-full.
All the tests and examples are linking with gstreamer but the
symbol gst_init_static_plugins is only defined in the gstreamer-full
library. gstreamer-full can not be built first as it needs to know what plugins
will be built.

One option would be to build all the examples and tests after
gstreamer-full as the tools.

Disable tools build in subprojects too as it will be built at the end of
build process.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4128>
2023-05-31 15:17:11 +00:00
Jan Alexander Steffens (heftig) 4008b872bb fdkaacdec: Support up to 5 rear channels
The `switch (n_rear)` supports up to 5 rear channels, but our channel
set only had space for 3. Size the set properly to fix this.

This didn't actually cause any memory unsafety as `PUSH_CHAN` would stop
incrementing `n_rear` if the channel set is already full.

Thanks to @alatiera for noticing this.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4712>
2023-05-30 14:18:08 +02:00
Mengkejiergeli Ba a15a16c99b msdkenc: Add a property to insert pic timing SEI for avc and hevc
User can decide whether to insert pic timing sei with pic_struct
syntax via oneVPL API mfxExtCodingOption.PicTimingSEI.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4673>
2023-05-29 02:11:20 +00:00
Jordan Petridis 6032f51162 openjpegenc: do not set bpp field on opj_image_cmptparm_t
It's deprecated in favor of the .prec field which we already set.

https://github.com/uclouvain/openjpeg/pull/1383/

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4715>
2023-05-26 20:24:27 +00:00
Víctor Manuel Jáquez Leal 8b75e5fb57 vkvideoutils: fix code-style
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4716>
2023-05-26 10:08:27 +02:00
Víctor Manuel Jáquez Leal b982fae9c7 tests: check if vulkan h264 decoding is supported
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4716>
2023-05-26 10:08:27 +02:00
Víctor Manuel Jáquez Leal 365454790a vkphysicaldevice: fetch queue family query result support
And merged in a single structure the queue family operations report.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4716>
2023-05-26 10:08:27 +02:00
Víctor Manuel Jáquez Leal e2a40c58bf vkimagebufferpool: chain the correct structure
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4716>
2023-05-26 09:45:07 +02:00
Víctor Manuel Jáquez Leal e9414b9582 vkvideoutils: fix bug for chroma string comparison
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4716>
2023-05-26 09:45:07 +02:00
Seungha Yang 8e1677bd6a d3d11videosink: Fix error on pause and play
The show_frame() can be called without prepare() call on paused to
playing state change. Thus the prepared buffer should not be cleared
on show_frame()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4700>
2023-05-25 13:24:43 +00:00
Vivia Nikolaidou 1781b26ad2 tsmux.h: Remove TSMUX_MAX_ES_INFO_LENGTH dead code
Also TsMux.es_info_buf which was also not used anywhere

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4681>
2023-05-23 14:00:11 +00:00
Vivia Nikolaidou 9e84b737cb tsmux: Separate DVB and ATSC AC3 descriptors
The previous code was ATSC-specific. Separated it into gstatscmux.c and
added the DVB-specific one from ETSI EN 300 468 V1.11.1 (2010-04)

https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.11.01_60/en_300468v011101p.pdf

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4681>
2023-05-23 14:00:11 +00:00
Vivia Nikolaidou 866d5d87c4 tsmux: Refactor AC3 descriptor to use GstByteWriter
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4681>
2023-05-23 14:00:11 +00:00
Vivia Nikolaidou 637e263504 tsmux: Parse bitrate from tags into the stream
Instead of parsing a hardcoded zero and always writing the highest
limit.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4681>
2023-05-23 14:00:11 +00:00
Vivia Nikolaidou 7a98a4214b tsmux: Fix 0x81 descriptor for AC3 streams
According to ATSCA/52:2018

https://prdatsc.wpenginepowered.com/wp-content/uploads/2021/04/A52-2018.pdf

Used wireshark as ground truth for detection/parsing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4681>
2023-05-23 14:00:11 +00:00
Ruben Gonzalez 059965fe53 doc: Fix newline char between authors
Found running `gst-inspect-1.0 -a |& grep -v ":" | grep @`

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4682>
2023-05-20 05:48:23 +00:00
Seungha Yang f435d192e1 d3d11videosink: Don't use CS_OWNDC style
It's completely unnecessary since we never use
the device context (e.g., BeginPaint() or GetDC() never called).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4684>
2023-05-20 03:16:47 +00:00
Shengqi Yu b092c3f580 h264parse: adjust some logs printing level in h264parse
adjust log level from GST_ERROR to GST_WARNING when h264 caps have
codec_data but no avc format or have no codec data or stream-format.
Because theses are not real errors, it is easy to mislead if print error
logs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4675>
2023-05-20 02:07:36 +00:00
Thibault Saunier 6dff93acf6 testsrcbin: Remove spurious caps unref
Caps are cleared at the end of the function

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4668>
2023-05-19 22:00:39 +00:00
Ma, Mingyang a2e83a019a msdkdec: Fix decoding cases with resolution change (VP9)
The resolution of VP9 video can be changed without keyframe.
The change detected by MSDK/VPL should be negotiated with downstream.
Only the situation can be fixed here if the changed resolution is less than or equal to the initial surface resolution.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4450>
2023-05-19 05:51:36 +00:00
Víctor Manuel Jáquez Leal 8670a023f1 vkimagebufferpool: prepare new allocated buffers
This means change initial memory undefined layout and access to the ones
required for their usage.

This is only used if VK_KHR_SYNCHRONIZATION_2_EXTENSION_NAME is available.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4351>
2023-05-19 04:26:30 +00:00
Víctor Manuel Jáquez Leal 7c9d88d586 vkdownload: input memories may not match output memories
Split the iterations, one for images and another for buffers, while first
barrier on images, and later in buffers after copy.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4351>
2023-05-19 04:26:30 +00:00
Víctor Manuel Jáquez Leal e177080bec vulkan: number of memories in buffer rather than number of planes
New vulkan formats don't match the number of planes with the number of memories
attached to the buffer. This patch changes the pattern of using planes for
traverse the memories with the number of attached memories.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4351>
2023-05-19 04:26:29 +00:00
Víctor Manuel Jáquez Leal 565fe3291e vkutils: add gst_vulkan_get_or_create_image_view_with_info()
It's a generalization of the original gst_vulkan_get_or_create_image_view().

The reason for passing the whole VkImageViewCreateInfo structure rather than
just the missing fields, is because VkImageSubresourceRange and
VkComponentMapping can be different and those are most of VkImageViewCreateInfo.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4351>
2023-05-19 04:26:29 +00:00
Víctor Manuel Jáquez Leal bb29b4dfec vkdevice: enable device optional extensions
Enable before-hand what the user might use.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4351>
2023-05-19 04:26:29 +00:00
Víctor Manuel Jáquez Leal 00189bf8f3 tests: vkimagebufferpool and format mapping
This test will create a pool for VkImageMemory for decoding and others usages.

And a test for the new Vulkan format mapping.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4351>
2023-05-19 04:26:29 +00:00
Víctor Manuel Jáquez Leal d7bbcffe14 vkformat: add VK_FORMAT_G8_B8R8_2PLANE_420_UNORM
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4351>
2023-05-19 04:26:29 +00:00
Víctor Manuel Jáquez Leal b1321f78d3 vkswapper: use gst_vulkan_format_to_video_format()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4351>
2023-05-19 04:26:29 +00:00
Víctor Manuel Jáquez Leal d84926b60f vkformat: add gst_vulkan_format_to_video_format()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4351>
2023-05-19 04:26:29 +00:00
Víctor Manuel Jáquez Leal ce7256e0d3 vulkan: use gst_vulkan_format_get_aspect()
In order to use it, without depending in a previous calling of
_create_info_from_args(), VkFormat as input parameter to
gst_vulkan_image_memory_init() was added.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4351>
2023-05-19 04:26:29 +00:00
Víctor Manuel Jáquez Leal b8e908131d vkformat: add gst_vulkan_format_get_aspect()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4351>
2023-05-19 04:26:29 +00:00
Víctor Manuel Jáquez Leal 26d00ba0cc vkimagebufferpool: fail if image cannot be allocated
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4351>
2023-05-19 04:26:29 +00:00
Víctor Manuel Jáquez Leal d91c17264c vkimagebufferpool: gst_vulkan_image_buffer_pool_config_set_decode_caps()
This is going to be used when the pool is used by a video decoder for
VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR, since the frame allocation needs the
VkVideoProfileInfoKHR, and for that here GstCaps is used to wire it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4351>
2023-05-19 04:26:29 +00:00
Víctor Manuel Jáquez Leal 07271fc648 vkvideoutils: add gst_vulkan_video_profile_{to/from}_caps()
Add this new source file with utils for video profile mapping with GstCaps.
These method is used to pass this information along GStreamer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4351>
2023-05-19 04:26:29 +00:00
Víctor Manuel Jáquez Leal c7c5dedd7f vkimagebufferpool: use gst_vulkan_image_memory_alloc_with_image_info()
As the pool will be only used for images with usage
VK_IMAGE_LAYOUT_VIDEO_DECODE_DST_KHR only one layer has to be allocated.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4351>
2023-05-19 04:26:29 +00:00
Víctor Manuel Jáquez Leal 83e73a2f59 vulkan: find memory type index with requirements
The specification says:

VUID-vkAllocateMemory-pAllocateInfo-01713

must pAllocateInfo->allocationSize be less than or equal to
VkPhysicalDeviceMemoryProperties::memoryHeaps[memindex].size where memindex =
VkPhysicalDeviceMemoryProperties::memoryTypes[pAllocateInfo->memoryTypeIndex].heapIndex
as returned by vkGetPhysicalDeviceMemoryProperties for the VkPhysicalDevice that
device was created from.

Though this can be catch by the validation layer, the requested frame size
depends on the use case so it's better to check this restriction by our code.

This patch also makes use of this new function to find memory type index,
 and removes the unused function to find memory type index, which, as GstVulkan is
considered unstable, we can do it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4351>
2023-05-19 04:26:29 +00:00
Víctor Manuel Jáquez Leal 4dd0fd6797 vkimagebufferpool: use gst_vulkan_format_from_video_info_2()
To get the number of images and its Vulkan formats for the GStreamer format.
Also it gets the basic image usage by default if it's not defined. It fails if the
video format is not supported.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4351>
2023-05-19 04:26:29 +00:00
Víctor Manuel Jáquez Leal 35dbd9f92c vkformat: add gst_vulkan_format_from_video_info_2()
The purpose of this function is to get more info about the mapped Vulkan format
from the GStreamer format, since they can be multiple Vulkan formats for one
GStreamer format.

Also a Vulkan format may have certain usage and aspects that must be verified.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4351>
2023-05-19 04:26:29 +00:00
Víctor Manuel Jáquez Leal 14dd6aac16 vkformat: move gst_vulkan_format_from_video_info()
Moved gst_vulkan_format_from_video_info() from gstvkimagememory to gstvkformat
in order to centralize the video format operations in a single source file.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4351>
2023-05-19 04:26:29 +00:00
Víctor Manuel Jáquez Leal b1c166b53c vkimagebufferpool: pass usage and memory properties
Pass, in config structure, usage and memory properties, assigning proper
defaults if they aren't set. This parameters are used in image memory
allocation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4351>
2023-05-19 04:26:29 +00:00
Víctor Manuel Jáquez Leal 7b62c26139 vkdevice: add gst_vulkan_device_queue_family_indices()
This method will return a GArray with all the queue family indices created by
the device when it's opened. This array will be used by VkImageCreateInfo to
allocate a new Vulkan image.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4351>
2023-05-19 04:26:29 +00:00
Víctor Manuel Jáquez Leal ea2bd1882f vkdevice: add programming parameters verification
To `gst_vulkan_device_foreach_queue()`.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4351>
2023-05-19 04:26:29 +00:00
Víctor Manuel Jáquez Leal 1e2ff519c6 vkbuffermemory: add gst_vulkan_buffer_memory_alloc_with_buffer_info()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4351>
2023-05-19 04:26:29 +00:00
Víctor Manuel Jáquez Leal 64ba7fb2eb vkimagememory: gst_vulkan_image_memory_alloc_with_image_info()
This new method instead of passing a bunch of variables which will fill
`VkImageCreateInfo`, the method accepts this whole structure, so the caller can
customize it as much as they want.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4351>
2023-05-19 04:26:29 +00:00
Víctor Manuel Jáquez Leal 5f5249cf73 vkimagememory: look up for Vulkan format using a static table
Replace the switch structure with explicit and extendable static table.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4351>
2023-05-19 04:26:29 +00:00
Víctor Manuel Jáquez Leal 1458c31031 vkdevice: enable multiple queues per device
Originally the opened device only created one queue of one family queue, to say
graphics one. This approach felt short when other queue family is required not
shared with the graphics queue family, for example video decoding.

This new approach proposes to create those queues with supported families. For
now, only video decoding and encoder are created, if they are available.

In order to hold multiple queues opened, an array of VkDeviceQueueCreateInfo is
held along the live the device object, because it's used to traverse or get the
opened queues.

The algorithm to choose which queues create (or open) is to look for the queue
with more family bits, which also supports the one we are requesting, thus
minimizing the number of global queues of a certain family to create.
Nonetheless, the number of queues to open per family is set to be all of them,
widening the possibility of parallelism.

Also, this commit do a cosmetic refactor the assigning the physical device
nearer where it's used.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4351>
2023-05-19 04:26:29 +00:00
Víctor Manuel Jáquez Leal 25140499fc vkdevice: enable features from physical device
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4351>
2023-05-19 04:26:29 +00:00
Víctor Manuel Jáquez Leal 9e807b58a0 vkphysicaldevice: add gst_vulkan_physical_device_get_features()
gst_vulkan_physical_device_get_features() is a private function to access to the
available features in the device.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4351>
2023-05-19 04:26:28 +00:00
Víctor Manuel Jáquez Leal 83160fb47c vkphysicaldevice: fetch queue family video codec operations
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4351>
2023-05-19 04:26:28 +00:00
Víctor Manuel Jáquez Leal dde60fab37 vkdebug: add video queue flags strings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4351>
2023-05-19 04:26:28 +00:00