Commit graph

4940 commits

Author SHA1 Message Date
Sebastian Dröge 44ffb80a32 audio: Extend guards in functions to also cover negative/unknown out of bounds DSD formats
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4966>
2023-07-05 12:08:33 +00:00
Sebastian Dröge 6b47a37ed8 audio: Change value of GST_DSD_FORMAT_UNKNOWN to 0
GObject and calloc() etc are initializing memory to 0, so using 0 as the
unknown variant makes it more likely that mistakingly zero-initialized
memory does not end up with a wrong DSD format.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4966>
2023-07-05 12:08:33 +00:00
Sebastian Dröge 030bf5e560 audio: Make GST_DSD_FORMAT_UNKNOWN -1 instead of 0xffffffff
0xffffffff is mapped to 2**32 - 1 but GLib enums are signed ints so this
value is out of range and causes problems with bindings.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4966>
2023-07-05 12:08:33 +00:00
Guillaume Desmottes 1027180960 subtitleoverlay: fix mutex error if sink caps is not video
We were trying to unlock a mutex that was not locked.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4964>
2023-07-05 10:34:21 +00:00
Jordan Petridis 1ef13dda12 pngenc: Allocate a single GstMemory per frame
Previously, we would create a new GstMemory per write operation
and then append them to the GstBuffer. This would cause a reallocation
every 16 Memories which is an issue since the png encoder will usually
do write in a pattern of 4, 8 and 8k bytes repeating until the frame
is done.

Instead allocate a single GstMemory and keep writting it into it
with a manual index. Much like the jpegenc does.

Doing some basic testing With a testsrc snow pattern at 4k and 8k
the same pipeline would take ~3.30s to encode a 4k frame and ~23s
for an 8k. At 4k 0.70s/33% is taken by memory allocations, while at
8k its ~10.5s/45%.

With this patch, at 4k the pipeline takes ~2.40s and at 8k only 9.60s
making this 28% and 58% faster accordingly on my laptop, and
allocation runtime is dropped to subsecond times.

Here's the test pipeline used, increase num-buffers in image freeze
to gather more samples.

```
gst-launch-1.0 videotestsrc num-buffers=1 pattern=snow ! imagefreeze num-buffers=1 ! \
  video/x-raw,width=7680,height=4320 ! pngenc ! fakesink
```

Close #2717

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4944>
2023-07-05 08:41:14 +00:00
Seungha Yang 794cde703c rtspsrc: Fix crash when is-live=false
The pad's parent (i.e., rtspsrc) can be nullptr since we add pads
later.

Co-authored-by: Jan Schmidt <jan@centricular.com>

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2751
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4965>
2023-07-05 06:48:37 +00:00
Taruntej Kanakamalla 33bcbad782 lc3: add unit test
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4376>
2023-07-05 03:00:43 +00:00
Taruntej Kanakamalla 1865c87ec6 lc3: plugin for LC3 audio codec
lc3enc:
- encodes raw audio into lc3 format
- uses the default bitrate property and frame duration
from the caps to determine the byte count of
the encoded frames if it is not specified in
the downstream caps after negotiation
- uses the same byte count value for all the channels
- all the common session configuration parameters
are passed in the src caps

lc3dec:
- decodes an lc3 encoded audio
- sink caps should contain all the common session configuration
params
- uses frame_duration and frame_bytes (byte count) in the sink
caps as parameters along with sample rate and channel count
- byte count is same for all the channels

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4376>
2023-07-05 03:00:43 +00:00
Edward Hervey 711198a1a9 hlsdemux2: Ensure processed webvtt ends with empty new line
Parsers downstream will use empty new lines to detect where an entry
ends. Failure to have a newline would cause the entry to be either
discarded or (wrongly) concatenated with the next entry

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4963>
2023-07-04 10:57:01 +02:00
Edward Hervey f825b7aba3 uridecodebin3: Refuse sub uri in gapless mode
This is too problematic to handle properly right now.

See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2550 and
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2605

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4958>
2023-07-03 16:02:40 +02:00
Hou Qi dbdbf2d256 decodebin3: fix memory leak when remove candidate decoder
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4955>
2023-07-03 07:13:13 +00:00
Carlos Rafael Giani d5a9ca8ef6 gl: Separate viv direct texture checks from viv-fb winsys check
Vivante direct textures do not depend on the viv-fb windowing system.
Decouple these two to be able to use direct textures even when viv-fb
is not enabled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4950>
2023-07-03 05:25:13 +00:00
Philippe Normand d317379287 webrtcstats: Properly report IceCandidate type
strcmp returns a positive value if s1 is greater than s2, while we actually
needed to check equality here.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4952>
2023-07-03 03:51:53 +00:00
Jan Alexander Steffens (heftig) 565f9d18ae srt: Always format reject reason code
`srt_rejectreason_str` doesn't give us a unique string for every
possible reason. Peers can define their own reasons and SRT just gives
us the string `"Application-defined rejection reason"` for all of them.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4948>
2023-07-02 13:36:42 +00:00
Jan Schmidt 2e5908d33f appsrc: Release priv->lock before pushing segment
Don't hold the private appsrc lock while pushing out a segment
event, which may block indefinitely.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4951>
2023-06-30 16:05:57 +00:00
Jan Schmidt 0461103965 basesrc: Don't hold the object lock while pushing an event
Release the object lock before pushing a segment event.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4951>
2023-06-30 16:05:57 +00:00
Seungha Yang 1f18ceaf0f dwritesubtitlemux: Update object name
Add missing prefix `DWrite` so that this element can coexist with
subtitlemux proposed in
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4938

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4949>
2023-06-30 23:41:36 +09:00
Seungha Yang 8650c7a42a dwrite: Add support for non-d3d11/system memory
Attach meta if downstream supports it whatever the negotiated memory type is,
or just silently passthrough when meta is not supported

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4945>
2023-06-30 11:14:17 +00:00
Jonas Kvinge fa46905aea discoverer: Only call handle_current_async if still processing
When gst_element_set_state is called in _setup_locked and errors, the
callback is already processed before we reach handle_current_async, and
the timer is started even though it's finished processing, which results
in a NULL pointer crash later in async_timeout_cb.

To fix this, we check that it's still processing before calling
handle_current_async.

Fixes #1683

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4936>
2023-06-30 08:52:38 +03:00
Thibault Saunier c5304751ab uridecodebin: Handle non dynamic sources with several source pads
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4881>
2023-06-30 01:00:34 +00:00
Thibault Saunier 2b3757402b ges: Add support for gessrc as subtimeline element
Until now we have always had `gesdemux` as subtimeline elements,
the behavior when subtimelines are sources is different so we need
to support that.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4882>
2023-06-29 19:24:37 +00:00
Thibault Saunier a5d5dd2ab4 ges: basebin: Handle removed tracks
Cleaning up the pads and elements linked to that track.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4882>
2023-06-29 19:24:37 +00:00
Thibault Saunier a8b3e6122f gessrc: Remember the URI set by user
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4882>
2023-06-29 19:24:37 +00:00
Thibault Saunier 50393a809d gessrc: Remove timeline from self when disposing
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4882>
2023-06-29 19:24:37 +00:00
Arnaud Rebillout 56e636b60c examples: gtk: Add example to illustrate usage of accept-certificate with souphttpsrc
The aim of this example is to show how to make use of the accept-certificate
signal from a GTK GUI, and prompt user in case of invalid certificate.

There are two subtleties to be aware of:

1. the signal is emitted from the GStreamer streaming thread, therefore the
   caller can't modify the GUI straight away, instead they must do it from the
   main thread (eg. by using g_idle_add())

2. in case of a redirection, then a TLS failure, the caller won't know
   about the redirection. Actually, it's possible to be notified of the
   redirection by watching "message:element" and inspecting http-headers,
   but even in that case, the signal will be received *after* the signal
   "accept-certificate" (even though the redirection happened *before*).

This second point is tricky. It's not uncommon to have servers that redirect
http requests to https. So errors of the type "HTTP -> HTTPS -> TLS error"
happen, and if the caller doesn't care about redirection, they might prompt
users with a message such as "TLS error for URL http://...", which wouldn't make
much sense.

This example shows how to handle that right, by connecting to the signal
"message:element", inspecting the http-headers, and in case of redirection,
updating the TLS error dialog to indicate that the request was redirected.

Here are a few examples of streams that exhibit TLS failure (at the time of
this commit, of course):
* https://radiolive.sanjavier.es:8443/stream: unknown-ca
* https://am981.ddns.net:9005/stream.ogg: unknown-ca
* http://stream.diazol.hu:7092/zene.mp3: redir then bad-identity
* https://streaming.fabrik.fm/izwi/echocast/audio/index.m3u8: unknown-ca
  (this one is a HLS stream)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4925>
2023-06-29 16:27:31 +00:00
Arnaud Rebillout c4cf06c017 souphttpsrc: forward accept-certificate signal from libsoup-3
With libsoup 2.x, it was possible to know when there was a TLS failure, as
libsoup provided the "special http status code" SOUP_STATUS_SSL_FAILED.

However these special codes were dropped with libsoup 3.x: now libsoup emits
the accept-certificate signal when there's a TLS failure.

This commit adds a signal "accept-certificate" to SoupHttpSrc, which is in fact
just about forwarding the signal from SoupMessage (which is, itself, forwarded
from GTlsConnection). Note that, in case of libsoup 2.x, the signal is never
emitted.

Fixes: #2379
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4925>
2023-06-29 16:27:31 +00:00
James Oliver 87c177567d rtspclientsink: add RTSP address pool for unicast UDP
Adds an address pool for rtspclientsink in order to allow the
"port-range" property to restrict the ports available for the RTSP
streams rather than always using the ephemeral port-range.

If a value is not provided to the "port-range" property, rtspclientsink
will select random ports from the ephemeral port-range as before.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4828>
2023-06-29 11:33:58 +00:00
Peter Stensson 33fb3bfd60 rtpvp9pay: Only mark first outgoing packet as non delta-unit
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4937>
2023-06-29 09:48:41 +00:00
Peter Stensson af43648bdf rtpvp8pay: Only mark first outgoing packet as non delta-unit
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4937>
2023-06-29 09:48:41 +00:00
Peter Stensson fa4200a605 rtph264pay: Add unit tests verifying delta-unit flag
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4937>
2023-06-29 09:48:41 +00:00
Peter Stensson b40b4ffb81 rtph265pay: Only mark first NAL as non delta-unit
When the input buffer contained multiple NAL's the second one would keep
the non delta-unit flag for a key frame.

The delta-unit flag will now be set per NAL when preparing the buffer
list to payload.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4937>
2023-06-29 09:48:41 +00:00
Seungha Yang 1c4de219e4 dwrite: Add dwritesubtitleoverlay element
Adding new subtitle overlay element. It's a bin which is wrapping
two internal elements dwritesubtitlemux and dwritetextoverlay.

* dwritesubtitlemux: A new internal element to aggregate subtitle
buffers and to attach the aggregated subtitle buffers on
video buffer as meta.
* dwritetextoverlay: Extracts/renders the subtitle meta and
discard the meta after rendering.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4934>
2023-06-28 20:15:31 +00:00
Seungha Yang a1ca42ad66 dwritebaseoverlay: Fix color-font property get/set
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4934>
2023-06-28 20:15:31 +00:00
Seungha Yang 0091166a38 dwrite: Add dwritesubtitlemux element
dwrite plugin internal use and will be removed once it's added to -base

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4934>
2023-06-28 20:15:31 +00:00
Seungha Yang fce6edd0f1 dwrite: Add GstDWriteSubtitleMeta
dwrite plugin internal use and will be removed once it's added to -base

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4934>
2023-06-28 20:15:30 +00:00
Mathieu Duponchelle 7445b73e76 rtpsession: expose timeout-inactive-sources property
In some situations it is not desirable to time out when no data is
received any longer, users can opt in to this behavior via a new
property.

The property is also exposed on rtpbin and sdpdemux

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4880>
2023-06-28 18:45:25 +00:00
Nicolas Dufresne 170dcd58db v4l2: Fix support for left and top padding
In the current implementation, we support for most pixel format left
and top padding by changing the offset in the video meta. Though, to
align driver bytesused to the offset, we recalculate the offset, which
removed the modification we did before.

Instead, save the plane size, and truncate the driver reported bytesused
to the expected size, which ensures that the offsets still match. This
should also fix issues were the buffer size ended up bigger then the
pool size due to driver introduced padding.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4920>
2023-06-28 01:56:05 +00:00
Seungha Yang b18bd5ec2b d3d11bufferpool: Fix heavy CPU usage in case of fixed-size pool
There's no reason to release GstMemory manually at all.
If we do release GstMemory, corresponding GstBuffer will be
discarded by GstBufferPool baseclass because the size is changed
to zero.

Actual cause of heavy CPU usage in case of fixed-size pool
(i.e., decoder output buffer pool) and if we remove GstMemory from
GstBuffer is that GstBufferPool baseclass is doing busy wait in acquire_buffer()
for some reason. That needs to be investigated though, discarding
and re-alloc every GstBuffer is not ideal already.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4935>
2023-06-27 23:25:09 +00:00
Seungha Yang 9aa1d683a2 d3d11poolallocator: Initialize flush flag with TRUE
If it's not active state, it should return flushing from acquire
method

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4935>
2023-06-27 23:25:09 +00:00
Seungha Yang 43ee082189 dwritebaseoverlay: Forward downstream wanted min buffer size
Upstream element might want to know the min buffer size,
d3d11 decoders for example.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4929>
2023-06-27 13:23:07 +00:00
Seungha Yang 8838a670e0 dwrite: Remove unused values
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4929>
2023-06-27 13:23:07 +00:00
Seungha Yang 6cb41569e6 dwrite: Add support for closed caption overlay
Adding closed caption rendering feature to dwritetextoverlay
element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4929>
2023-06-27 13:23:07 +00:00
Seungha Yang 713f74f4f9 dwrite: Import libcaption source code
Import the code from gst-plugins-rs
(origin is https://github.com/szatmary/libcaption)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4929>
2023-06-27 13:23:07 +00:00
Seungha Yang 37c7c92c03 dwritetimeoverlay: Fix member variable initialization
Use GstBaseTransform::start() instead

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4929>
2023-06-27 13:23:07 +00:00
Alicia Boya García 8c628fa325 validate tests: include debugutilsbad to be able to use testsrcbin
Fixes test: validate.uridecodebin.expose_raw_pad_caps

testsrcbin (currently part of debugutilsbad) is an useful element for
validate tests.

validate.uridecodebin.expose_raw_pad_caps makes use of it.
Unfortunately, because validate tests with GStreamer only run with
whitelisted plugins and `debugutilsbad` wasn't in the whitelist, the
test was failing and being auto-skipped.

This patch adds debugutilsbad to the whitelists used by validate tests
in subprojects with a validate/meson.build.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4931>
2023-06-27 10:13:19 +00:00
Thibault Saunier e7f13ede0f videoconvertscale: Remove the restriction on ANY memory
Our pad templates already expose ANY feature and the code supports that
case even if only for the passthrough, we should not disable that feature.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4733>
2023-06-27 08:17:33 +00:00
Matthieu Volat d228b8d96f oss: add a GstDeviceProvider plugin
Based on Alsa's GstDeviceProvider structure, relies on sndstat
file for OSS device enumeration but uses already existing utils
to query caps and names.

Reviewed and thanks to @slomo

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4879>
2023-06-27 09:34:33 +03:00
Víctor Manuel Jáquez Leal e5d524b338 caps: Fix documentation
Fix gst_caps_filter_and_map_in_place() documentation, aiming to
gst_caps_maps_in_place() to express their difference.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4933>
2023-06-26 19:56:55 +02:00
He Junyan a10e05000d video-info-dma: add gst_video_info_dma_drm_to_video_info()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4883>
2023-06-26 16:18:24 +00:00
He Junyan 6accb7a1f5 va: Only change video format in gst_va_video_info_from_dma_info()
The current way of using gst_video_info_set_format() will change all
fields of the GstVideoInfo. We only need to change its format, stride
and offset fields.

In order to keep the consistency with th common drm API, we rename the
gst_va_video_info_from_dma_info() into gst_va_dma_drm_info_to_video_info().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4883>
2023-06-26 16:18:23 +00:00
Alicia Boya García e92dea5ce6 validate: Fix warning when importing GstPbutils
PyGObject triggers warnings when importing modules without an explicit
version request.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4932>
2023-06-26 12:34:56 +00:00
Stéphane Cerveau 53e48ce14d va: use GstH264Level enum in _va_h264_level_limits
The 1B value has been changed to 9 instead of 11 in the list
of level limits.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4737>
2023-06-26 10:47:36 +00:00
Stéphane Cerveau 2974c18a5c codecparsers: keep naming consistency in GST_H264_LEVEL
GST_H264_LEVEL_2 should be used instead of GST_H264_LEVEL_2_0

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4737>
2023-06-26 10:47:36 +00:00
Elliot Chen c1a284a221 dashdemux2: fix some mpeg-ts issue with no audio output
For dashdemux2, one stream will create one track.
Maybe there are multiple tracks in one stream such as
some mpeg-ts streams, need add the function to check
and create the other tracks if needed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4706>
2023-06-26 10:52:08 +08:00
Haihua Hu fb2b64ea7f dashsink: add property to set suggested presentation delay of MPD
add property suggested-presentation-delay to configure MPD info

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4687>
2023-06-25 15:40:18 +00:00
He Junyan 83e307ac96 va: basedec: Select the best format of the whole caps
The current way only selects the best video format from the first
structure of the caps. The caps like:

  video/x-raw(memory:VAMemory),drm-format=(string)NV12;  \
  video/x-raw(memory:VAMemory),format=(string){ NV12, Y210 }

Will just choose NV12 as the result, even the bitstream is 10 bits.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4928>
2023-06-25 10:55:23 +00:00
Mengkejiergeli Ba b9ecd4e618 msdkenc: Apply update functions when setting property
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4865>
2023-06-25 02:03:28 +00:00
Mengkejiergeli Ba 1308b2f6e5 msdkenc: Add help functions to check and update property
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4865>
2023-06-25 02:03:28 +00:00
Alicia Boya García 64b4257509 ges-timeline-element: Fix refcount bug in "timeline" and "parent" properties
ges-timeline-element property getter handler was using
g_value_take_object() with internal pointers of the element as
arguments, instead of g_value_set_object().

g_value_take_object() moves the ownership of the reference; hence,
when reading "timeline" the reference ownership of timeline is moved
away from the ges-timeline-element and into the GValue.

Since GValues are temporaries that are often discarded quickly after,
this can easily lead to a double free. This was causing
gst-editing-services / pythontests to crash when running
TestTrackElements.test_ungroup_regroup() because of an innocent read of
`clip2.props.timeline` around the end of the test.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4924>
2023-06-23 23:00:45 +00:00
Carlos Rafael Giani fd25e24217 alsa: Add support for DSD audio
Code is partially based on the DSD of Robert Tiemann <rtie@gmx.de>:
https://gitlab.freedesktop.org/rtiemann/gstreamer/-/tree/dsd

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3901>
2023-06-23 01:27:04 +00:00
Carlos Rafael Giani 34238e251d libav: Integrate FFmpeg's DSD support with GstDsd caps
Code is partially based on the DSD of Robert Tiemann <rtie@gmx.de>:
https://gitlab.freedesktop.org/rtiemann/gstreamer/-/tree/dsd

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3901>
2023-06-23 01:27:04 +00:00
Carlos Rafael Giani 8febc4102a audiosink: Add support for DSD data
Code is partially based on the DSD of Robert Tiemann <rtie@gmx.de>:
https://gitlab.freedesktop.org/rtiemann/gstreamer/-/tree/dsd

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3901>
2023-06-23 01:27:04 +00:00
Carlos Rafael Giani b65eab915a audioringbuffer: Add support for DSD data
Code is partially based on the DSD of Robert Tiemann <rtie@gmx.de>:
https://gitlab.freedesktop.org/rtiemann/gstreamer/-/tree/dsd

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3901>
2023-06-23 01:27:03 +00:00
Carlos Rafael Giani 4cce9a77c9 audioringbuffer: Introduce accessor macros
This follows the design ideas behind GstVideoInfo to provide an API
capable of hiding any underlying ABI compatibility mechanisms.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3901>
2023-06-23 01:27:03 +00:00
Carlos Rafael Giani 8c5a8f4466 dsd: Add code for DSD audio support
Related to:

https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/972

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3901>
2023-06-23 01:27:03 +00:00
Alicia Boya García 82ffdfb13c task: Log task states as string
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4913>
2023-06-22 23:24:58 +00:00
Alicia Boya García bcf95cc087 tests: nle: Call ges_init() only inside test cases
Some NLE tests were calling ges_init() from the test suite
initialization function. This was causing them to deadlock when running
with glib 2.76.3.

ges_init() causes a GThreadPool to be initialized. Even if GES at this
point doesn't request any thread to be created, since glib 2.63.4+
(see 8aeca4fa64)
the first time a GThreadPool is initialized a "pool-spawner" thread is
created, which is later used by g_thread_pool_push().

The default behavior of the GStreamer check tests is to fork for every
test case. This is not safe if any thread has been created at this
point. In this particular case, GThreadPool preserves the state that
says a "pool-spawner" thread has been created, and will have access to
its mutex and condition variable, but their queues will have different
contents as the memory has been forked. In consequence, calls to
g_thread_pool_push() will deadlock.

The deadlock will not occur if running the tests with CK_FORK=no.

This patch modifies the affected tests to only call ges_init() from
inside the test cases, fixing the deadlock.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4915>
2023-06-22 18:04:24 +00:00
Alicia Boya García 98fbbe7a53 tests: nle: Set sync=FALSE on sinks
A significant portion of the NLE test suite was often timing out due to
the tests taking way longer than necessary because the sinks were
synchronizing to the clock, which is the default behavior for
fakevideosink and fakeaudiosink.

Notable was the case of nleoperation.c:test_pyramid_operations, that ran
through a 10 second stream twice. As the default timeout is 20 seconds,
this made the test flaky.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4914>
2023-06-22 16:34:49 +00:00
Edward Hervey 8081c22a73 streamcollection: Use upstream-id as name
It is more coherent, in the same vein as  08dc5d29

Fixes #2640

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4911>
2023-06-22 14:06:04 +02:00
Stéphane Cerveau 92c13ea3b5 libxml2: update to 2.10.3-4
The previous version was failing to configure due to
```
"Dependencies must be external dependencies"
```
on zlib

Fixd by https://github.com/mesonbuild/wrapdb/pull/865/files

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4892>
2023-06-22 08:38:22 +00:00
Stéphane Cerveau 52217fef6a wrap: add libpsl patch to fix win build
These patches are necessary for Windows build since
0.21.2

See
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4890

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4892>
2023-06-22 08:38:22 +00:00
Edward Hervey 2f95cbd551 matroska-demux: Properly handle early time-based segments
Refusing an incoming segment in < GST_MATROSKA_READ_STATE_DATA should only be
done if the incoming segment is not in GST_FORMAT_TIME.

In GST_FORMAT_TIME, we are just storing the values and returning, so we can
invert the order of the checks.

Fixes proper segment propagation in matroska/webm DASH use-cases

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3914>
2023-06-22 06:56:33 +00:00
Edward Hervey 4b5352570a adaptivedemux2: Handle early SEEKING query
No pads are present yet, but we can still answer the query

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3914>
2023-06-22 06:56:33 +00:00
Edward Hervey 597b684cd6 adaptivedemux2: Fix non-accurate seeking
If no accurate positioning was required, default to snap to the previous segment
for improved responsiveness

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3914>
2023-06-22 06:56:33 +00:00
Edward Hervey adc07d77d5 adaptivedemux2: Handle return in seek handling
Various code path were repeating the same logic, and risk forgetting a lock
release.

Unify all of them

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3914>
2023-06-22 06:56:33 +00:00
Edward Hervey 630eb61273 adaptivedemux2: Move API lock usage
It is not needed so early

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3914>
2023-06-22 06:56:33 +00:00
Edward Hervey 2c9aef64c0 adaptivedemux2: Handle early key-unit seek
Is a seek is done on stream-collection post, there are no selected streams
yet. Therefore none would be chosen to adjust the key-unit seek.

If no streams are selected, fallback to a default stream (i.e. one which has
track(s) with GST_STREAM_FLAG_SELECT).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3914>
2023-06-22 06:56:33 +00:00
Edward Hervey 39c8b060f4 adaptivedemux2: Fix early seeking
When seeking is handled by the collection posting thread, there is a possibility
that some leftover data will be pushed by the stream thread.

Properly detect and reject those early segments (and buffers) by comparing it to
the main segment seqnum

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3914>
2023-06-22 06:56:33 +00:00
Stéphane Cerveau c98f5c2bf4 vkvideoutils: fix memory leak in structure's string
Retrieve a const char* from structure for "chromat-format" and
avoid extra mem copy.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4904>
2023-06-22 04:42:58 +00:00
Stéphane Cerveau 981db9d1d3 tests: fix mem leak in vkimagebufferpool
caps should be freed after usage.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4904>
2023-06-22 04:42:58 +00:00
Stéphane Cerveau fc0ee45fb5 vkdevice: fix beta extensions symbol
Missing 's' to VK_ENABLE_BETA_EXTENSIONS

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4904>
2023-06-22 04:42:58 +00:00
Stéphane Cerveau c1149d60c1 vkphysicaldevice: fix leak with queue_family_query_props
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4904>
2023-06-22 04:42:58 +00:00
Stéphane Cerveau 6920166af4 vulkan: fix C2099 error with VS2019
As VK_FORMAT_FEATURE_2_xxx are defined as static const variable, the
vscoce C compiler prevents the initialization of the  vk_usage_map
structure with error "C2099: initializer is not a constant".

Init the structure separately.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4904>
2023-06-22 04:42:58 +00:00
He Junyan 759857c203 va: basetransform: Copy the interested meta data for importing
The current way of using parent's copy_metadata() virtual function will
selectively filter out some meta such as crop meta. That virtual function
should be used when copying input buffer's meta data into output buffer,
not suitable when importing the input buffer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4887>
2023-06-21 21:12:23 +00:00
He Junyan ff2a75a2dd va: basetransform: Check the crop meta when importing
When the input buffer has crop meta, and we need to do copy, we
should consider the uncropped video size and copy the full size
of video memory.
The video meta in this case should contain the full uncropped
resolution info. We can use it to create full size va buffers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4887>
2023-06-21 21:12:23 +00:00
He Junyan 703ab45334 va: basetransform: Only need va pool for internal usage
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4887>
2023-06-21 21:12:23 +00:00
Seungha Yang 7b4e1fd602 qt6d3d11: Add Direct3D11 Qt6 QML sink
Adding Direct3D11 backend Qt6 QML videosink element, qml6d3d11sink.
Implementation details are similar to the qt6 plugin in -good
but there are a few notable differences.

* qml6d3d11sink accepts all GstD3D11 supported video formats (e.g., NV12).
* Scene graph (owned by qml6d3d11sink) will hold dedicated and sharable
  RGBA texture which belongs to Qt6's Direct3D11 device, instead of sharing
  GStreamer's own texture with Qt6.
* All rendering operations will be done by using GStreamer's Direct3D11 device.
  Specifically, upstream texture will be copied (in case of RGBA)
  or converted to the above mentioned Qt6's sharable texture.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3707>
2023-06-21 15:32:17 +00:00
Víctor Manuel Jáquez Leal 9825cd8951 vapostproc: evaluate op_flags validations as boolean
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4910>
2023-06-21 13:19:46 +02:00
Seungha Yang eb87bbc1ba gst: Don't use DllMain in case of static build
That might cause duplicated symbol linking error if app has its own
DllMain

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4905>
2023-06-20 19:14:49 +00:00
François Laignel 1d00f726a0 qtdemux: opus: set entry as sampled
... otherwise streams with constant size samples defined with a single
`sample_size` for all samples in the `stsz` box fall in the category
`chunks_are_samples` in `qtdemux_stbl_init`, overriding the actual
sample count.

`FOURCC_soun` would set this automatically for `compression_id == 0xfffe`,
however `compression_id` is read from the Audio Sample Entry box at an offset
marked as "pre-defined" in some version of the spec and set to 0 both by
GStreamer and FFmpeg for opus streams.

Considering the stream `sampled` flag is set explicitely by other fourcc
variants, doing so for opus seems consistent.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4903>
2023-06-20 17:15:22 +00:00
Sebastian Dröge 0dabf0eb00 dvdspu: Avoid integer overflow when checking if enough data is available
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4896>
2023-06-20 15:36:03 +00:00
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
Sebastian Dröge 3144f63302 tags: Don't allow image tags with G_MAXUINT32 length
This will cause an integer overflow a little bit further down because we
allocate a bit more memory to allow for a NUL-terminator.

The caller should've avoided passing that much data in already as it's
not going to be a valid image and there's likely not even that much data
available.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4894>
2023-06-20 10:02:19 +00:00
Sebastian Dröge dbbfc917fe flacparse: Avoid integer overflow in available data check for image tags
If the image length as stored in the file is some bogus integer then
adding it to the current byte readers position can overflow and wrongly
have the check for enough available data succeed.

This then later can cause NULL pointer dereferences or out of bounds
reads/writes when actually reading the image data.

Fixes ZDI-CAN-20775
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2661

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4894>
2023-06-20 10:02:19 +00:00
Sebastian Dröge 069065adc4 subparse: Skip after the end of a valid closing tag instead of only skipping <
This is a small optimization and avoids restarting the next parsing
iteration on already accepted data.

On its own it would also fix ZDI-CAN-20968 (see previous commit) but the
previous commit independently is also a valid fix for it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4895>
2023-06-20 09:06:44 +01:00
Sebastian Dröge 97c6d7495e subparse: Look for the closing > of a tag after the opening <
Previously when fixing up subrip markip, we were looking from the start
of the remaining buffer instead. Due to how skipping over closing tags
works, the remaining buffer will still contain the closing `>` of the
previous tag so if a unexpected closing tag is found after another
closing tag, we would potentially do an out of bounds memmove().

Fixes ZDI-CAN-20968
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2662

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4895>
2023-06-20 09:06:38 +01:00
François Laignel fa30504ec2 qtdemux: parse Opus and dOps as qtdemux nodes and add size checks
This allows checking the nodes conformity and dumping parsed values.

Note: Audio Sample Entry version parsing and offset handling is handled as part
of `FOURCC_soun` common processing and in `qtdemux_parse_node`.

Also, only read `stream_count` and `coupled_count` when
`channel_mapping_family` != 0. See:

https://opus-codec.org/docs/opus_in_isobmff.html#4.3.2

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4875>
2023-06-19 14:31:55 +00:00
François Laignel 439717ab65 qtdemux: fix byte order for opus extension and version field type
The "Encapsulation of Opus in ISO Base Media File Format" [1] specifications,
§ 4.3.2 Opus Specific Box, indicates that data must be stored as big-endian.

[1] https://opus-codec.org/docs/opus_in_isobmff.html#4.3.2

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4875>
2023-06-19 14:31:55 +00:00
François Laignel f3496ea3bf qtmux: fix byte order for opus extension
The "Encapsulation of Opus in ISO Base Media File Format" [1] specifications,
§ 4.3.2 Opus Specific Box, indicates that data must be stored as big-endian.

In `build_opus_extension`, `gst_byte_writer_put*_le ()` variants were used,
causing audio streams conversion to Opus in mp4 to offset samples due to the
PreSkip field incorrect value (29ms early in our test cases).

[1] https://opus-codec.org/docs/opus_in_isobmff.html#4.3.2

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4875>
2023-06-19 14:31:55 +00:00
He Junyan 0b981a216c gl: Add a print function to dump all EGL image drm format
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4877>
2023-06-19 12:58:02 +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
Stéphane Cerveau 709529eabd wrap: update libpsl to 0.21.2
On macos, the build is failing with 0.21.1,
a patch has been landed to fix the issue, see

https://github.com/rockdaboot/libpsl/pull/166

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4876>
2023-06-16 09:08:00 +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 17f297bac2 subprojects: libva: Pin to 2.19.0.pre1 (1c58941)
Bump libva version for Windows

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4864>
2023-06-15 21:14:29 +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
Daniel Morin 6f43bdce49 v4l2src: adding support for bayer 10,12,14,16
- Adding bayer 10,12,14,16 bits components with 16 bits storage. These
  changes only adds capabilities. Capability format string is a complete
  description of the frame and pixels layout. Only mapping LE bayer
  formats as v4l2 only define LE bayer formats.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4852>
2023-06-15 18:41:42 +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 c17e648fcf video: Add NV12_10LE32_4L4 tiled format
This 10bit format is identical to NV12_4L4, but uses NV12_10LE40 format
internally. In show, the tiles is made af 4 rows of 5 bytes, which contains
4 fully packed 10bit values.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3447>
2023-06-15 14:32:32 +00:00
Nicolas Dufresne b832a20d35 video: Fix tile info UV width
The width in pixel should consider a UV pair as 1 pixel, fix the metadata
accordingly.

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
Marek Vasut 5ad834ce28 videotestsrc: Support video/x-bayer 10/12/14/16 bit depths
Add support for generation of 10/12/14/16 bit bayer test 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 ! \
    video/x-bayer,width=512,height=512,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 e569b8ba1e videotestsrc: Simplify ARGB to Bayer conversion
Simplify the conversion to bayer pattern as suggested by Nicolas Dufresne.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4686>
2023-06-15 08:26:12 +00:00
Marek Vasut d0efb05f52 videotestsrc: Move video/x-bayer caps parsing in one place
Move all the video/x-bayer caps parsing into one place,
gst_video_test_src_parse_caps(), no functional change.

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
Daniel Morin 6ece5f3b90 v4l2src: fix support for bayer format
- Define a new function that identify if the v4l2object is raw based
on pixel format
- Only consider setting delta flag on buffer if the video is not raw.

Sponsored by Living Optics Ltd.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4848>
2023-06-14 18:32:45 +00:00
Seungha Yang 513d897d6e aggregator: Resume srcpad task on stream-start only when running
Race condition without this patch:
- srcpad task is being stopped in gst_aggregator_stop_srcpad_task()
- at that moment, in pre-queue event handler, gst_pad_get_task_state()
  returned GST_TASK_PAUSED
- then in srcpad task got stopped in gst_aggregator_stop_srcpad_task()
- finally srcpad task got resumed in pre-queue event handler

To address it, checks "running" flag in pre-queue event handler.
Both pre-queue stream-start event handler and "running" flag
are protected by SRC_LOCK already.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4847>
2023-06-14 16:57:35 +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
Mark Hymers 1ae8af4909 matroska: Add support for more pixel formats
- Add support for GRAY16_LE (using ffmpeg fourcc mapping)
- Update documentation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4824>
2023-06-14 13:40:58 +00:00
Daniel Morin 00178cbd89 matroska: Add new pixels format support
- Add support for GRAY10_BE32
- Add support for RGBA64_LE and BGRA64_LE

Sponsored by Living Optics

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4824>
2023-06-14 13:40:57 +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
Elliot Chen 308a9f9466 typefindhelper: avoid printing error log
some plugins such as wavparse may need find if type of media
contained in the given data and will print error log if there
is no matching factory.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4814>
2023-06-14 10:25:53 +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
Tim-Philipp Müller 2abdfb9657 tests: rtpbin_buffer_list: fix possible unaligned read on 32-bit ARM
Fixes #2666

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
Jochen Henneberg df41d11a7d netclientclock: Handle time server reset correctly
If the time server is restarted with a time in the past the net client
clock will not report the new time anymore as this would mean that the
clock moves back in time which it does not do.

Now the clock will be kept alive but marked as corrupted and will not
be re-used from the cache.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4802>
2023-06-13 22:11:55 +00:00
Edward Hervey ebf7966a26 avvidec: Fix more deprecated symbol
We only used these fields for debugging anyway

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4635>
2023-06-13 20:12:11 +00:00
Edward Hervey 447ee0b566 avvidec: Fix usage of deprecated field
Since ffmpeg 6.0 frame_num is used instead of frame_number

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4635>
2023-06-13 20:12:11 +00:00
Tim-Philipp Müller f3c126d07c matroska-demux: fix accumulated base offset in segment seeks
When doing a segment seek, the base offset in the new segment
would be increased by segment.position which is basically the
timestamp of the last packet. This does not include the duration
of the last packet though, so might be slightly shorter than the
actual duration of the clip or the requested segment.

Increase the base offset by the segment duration instead when
accumulating segments, which is more correct as it doesn't cut
off the last frame and makes the effective loop segment duration
consistent with the actual duration returned from a duration
query.

In case a segment stop was specified it's also possible that
some data was sent beyond the stop that's necessary for decoding
so the base offset increment should be based on that then and
not on the timestamp of the last buffer pushed out.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4604>
2023-06-13 18:19:48 +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
ekwange e7cfc1f5bd v4l2: Change to query only up to V4L2_CID_PRIVATE_BASE+V4L2_CID_MAX_CTRLS
Fix to prevent infinite querying.
There are devices that exceed V4L2_CID_PRIVATE_BASE+V4L2_CID_MAX_CTRLS
but do not return EINVAL.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4790>
2023-06-13 13:04:37 +00:00
Jonas Kvinge 513dd2c219 adaptivedemux2: Allow data dash+xml manifest for uri
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4811>
2023-06-13 11:32:23 +00:00
Haihua Hu 5716ee3513 glfilter: add parent meta to output buffer for input buffer
glfilter will unref input buffer after _transform() call immidiately,
but gpu may still reading input buffer for rendering because gl
api is executed async. Need hold reference for input buffer by
adding parent meta to output buffer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4801>
2023-06-13 07:53:49 +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
Xavier Claessens b687e19e10 opus: Fix crash when getting unexpected channel position
gst_opus_channel_names is a static array with only 13 items.
GstAudioChannelPosition have bigger values than that.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4798>
2023-06-12 20:00:52 +00:00
Guillaume Desmottes 767ee35265 tracerutils: allow casting parameters types
It was impossible to have an u32 parameter such as
'max-buffer-size=(uint)5' because the parentheses were not properly
parsed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3981>
2023-06-12 12:27:57 +00:00
Xabier Rodriguez Calvar 4769a2ab97 playbin2: improve transference doc of get-*-pad actions
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2081>
2023-06-12 10:26:26 +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
Ruben Gonzalez 51877ee373 doc: Add %p and %r patters for GST_DEBUG_FILE
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4166>
2023-06-11 17:31:32 +00:00
Philippe Normand ea9b837b07 video: convertframe: Add a debug category
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4629>
2023-06-11 15:45:02 +00:00
Philippe Normand b115756338 video: convertframe: Fix annotation of gst_video_convert_sample()
The returned sample is pulled from appsink which transfers its ownership.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4629>
2023-06-11 15:45:02 +00:00
Philippe Normand a0ac1cccbf appsink: Adjust annotations of pull- signals
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4629>
2023-06-11 15:45:02 +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
William Manley 04bcff4dce basetextoverlay: Fix typo in "text-y" property description
Looks like a copy and paste error.

Co-authored-by: Fabian Orccon <cfoch.fabian@gmail.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4823>
2023-06-10 16:52:29 +00:00
Nicolas Dufresne 343c42ca84 flagset: Fail parsing on overflowing hex strings
This adds code to detect when the hex form of the string we are to
parse exceeds the number of bytes that would form a 32bit flag. This will
avoid treating as flagset anything above then the expected 32 bits and also
stop treading DRM format with modifiers as flagset (like
drm-format=AB24:0x0100000000000002).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4775>
2023-06-09 22:26:39 +00:00
Kevin Song 55926f0271 appsink: unref gstbuffer in prev sample early
Appsink will unref prev sample in dispose function. Which is later
when V4L2 video decoder link with appsink as V4L2 video decoder
will close V4L2 device fd during GST_STATE_CHANGE_READY_TO_NULL.
If the video buffer return to V4L2 video decoder after the decoder
closed V4L2 device fd, V4L2 can't release the video frame buffer
which allocated with MMAP mode as application can't call
VIDIOC_REQBUFS 0 to release the video frame buffer by V4L2 driver.
The memory of the video frame will leak.
Unref the gstbuffer in stop() function, so V4L2 video decoder
can received all video frame buffers and release it before close
V4L2 device fd.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4818>
2023-06-09 13:13:17 +00:00
Seungha Yang e953f38789 tests: compositor: Add tests for data flow after EOS scenario
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4783>
2023-06-09 19:58:38 +09:00
Seungha Yang f78e7b1bef aggregator: Restart srcpad task on stream-start
Re-start srcpad task on stream-start in addition to flush event
so that subclass can process data when new pad is added
after EOS or an input stream is started again with stream-start event

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4783>
2023-06-09 19:58:38 +09: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
Seungha Yang cf60babf87 filesink: Fix buffered mode writing
Fixing miscalculated buffer index when a buffer holds multiple
memories and it's not aligned to the vector size 16

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4809>
2023-06-09 03:22:30 +09:00
Sebastian Dröge c9d9af2fee ptp: Set port-reuse socket options before binding the socket
Otherwise it only works if GStreamer is binding the first socket on this
port.

Unfortunately this requires duplicating a bit more of Rust std because
`UdpSocket` can only be created already bound without allowing to set
any options between socket creation and binding.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4807>
2023-06-08 13:43:33 +00:00
Víctor Manuel Jáquez Leal 5e455e21cf vaapidecodebin: don't load vaapipostproc if not available
And remove the code for missing element since that element is part of the same
plugin, and if not available is because the driver doesn't provide it.

Fixes: #2580
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4678>
2023-06-08 12:50:41 +00:00
Sebastian Dröge 2ef261557d ptp: Correctly parse clock ID from the commandline parameters in the helper
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2652

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4806>
2023-06-08 10:53:32 +00:00
Víctor Manuel Jáquez Leal d955623afd vaapiav1dec: fix type conversion warning
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 182b8ca2ff meson: Add a wrap file for libva
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 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