Commit graph

4821 commits

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