Commit graph

6911 commits

Author SHA1 Message Date
Víctor Manuel Jáquez Leal
396a04417e codecparsers: add debug categories to bitwriters
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7667>
2024-10-17 12:55:05 +00:00
Víctor Manuel Jáquez Leal
b4b06cd6f0 tests: va: fix vapostproc test for DMABuf
Now it picks the first format in the template srcpad list and do
the convertion. Also the format size is reduced because not all
drives support 4K as DMABuf (radeonsi).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7654>
2024-10-17 11:52:25 +00:00
Mathieu Duponchelle
8be82ad9e5 audioconvert: fix setting of mix matrix at run time
There were two main issues:

The mix matrix was not protected with the object lock

The code was mistakenly assuming that after updating the mix matrix
a reconfigure event sent upstream would be enough to cause upstream to
send caps again, and the converter was only reconstructed in ->set_caps.

That was not actually enough, as if the new matrix didn't affect the
number of input / output channels there was no reason for upstream to do
anything after getting the unchanged caps.

The fix for this was to have ->transform also recreate the converter
when needed, with the added subtlety that depending on the mix matrix
the element could be set to passthrough. This means that when setting
the mix matrix the converter also had to be recreated immediately to
check if the element had to be switched back to non-passthrough.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7399>
2024-10-17 10:44:53 +00:00
Stéphane Cerveau
b736ac5bb4 scenechange: fix memory leak
A reference to the last buffer(oldbuf) was kept
leading to a memory leak on stop.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7666>
2024-10-15 08:59:36 +00:00
Andoni Morales Alastruey
d71dd64717 qtdemux: fix parsing of matrix with 180 rotation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7665>
2024-10-15 08:50:51 +01:00
Nirbheek Chauhan
119e624f73 meson: Explicitly use cpp_std=c++11 for dxva
dxva is built unconditionally on all platforms where introspection is
enabled, so let's fix the build on macOS so that introspection can be
enabled there: https://gitlab.freedesktop.org/nirbheek/cerbero/-/jobs/65009118

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7661>
2024-10-14 10:44:48 +01:00
Jordan Petridis
bd305ab52e tests/lc3: Allocate the same size for the buffer and the data
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7640>
2024-10-10 08:45:43 -04:00
Corentin Damman
d9ef7fddc6 macos: Fix race conditions
This commit fixes two issues:
- The event must be posted *after* calling stop, otherwise a race condition can occur and the app never stops
- isFinishedLaunching and applicationDidFinishLaunching are not always synchronized, causing sometimes
  a deadlock on the g_cond_wait never catching the g_cond_signal

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7608>
2024-10-03 15:21:05 +01:00
Nirbheek Chauhan
279fbb2ca2 Revert "meson: Fix invalid include flag in uninstalled gl pc file"
This reverts commit 9d719b9937.

The old pkg-config implementation errors out if a variable specified
in the pkgconfig file is not defined, so this actually broke
uninstalled pc files.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7606>
2024-10-03 12:05:42 +01:00
Théo Maillart
1d86761712 decodebin3: do not attempt to remove a null stream
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7605>
2024-10-03 09:42:03 +00:00
Théo Maillart
bb05e78349 decodebin3: protect internal reset with SELECTION_LOCK
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7605>
2024-10-03 09:42:03 +00:00
Théo Maillart
3b6f6073e4 decodebin3: remove output event probe on remove input stream
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7605>
2024-10-03 09:42:03 +00:00
Edward Hervey
94c393341c urisourcebin: Ensure all stream-start are handled
In order to ensure all initial events (stream-start, caps, ..) are present on
pads that we expose, those various sticky events are propagated (from parsebin
to multiqueue output, from multiqueue output to exposed pads).

The problem was that the "hack" in `urisourcebin` to inform downstream elements
that the stream is parsed data and a collection will be present was only done in
one place : a probe on the output of parsebin ... but the stream-start could
potentially have already been propagated to the output pads before that.

In order to fix that, we make sure any pending sticky stream-start event is
updated before being propagated.

Fixes #3788

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7604>
2024-10-03 00:56:25 +00:00
Edward Hervey
7e438dfaa7 urisourcebin: Allow more cases for posting stream-collection
Previously urisourcebin only allows stream-collections messages from adaptive
demuxers or sources to be posted.

This commit also allows the case where they come from a single parsebin. We
still want to prevent it in the case where they are multiple parsebins, since
that would require some form of aggregation to show a single/unified collection.

In order to avoid a regression with uridecodebin3 behavior, we also implement
support for GST_QUERY_SELECTABLE, so that uridecodebin3 can figure out whether
it should let GST_MESSAGE_STREAM_COLLECTION flow upwards (because app/user could
react on it) or whether it drops it in order for decodebin3 to do the collection
aggregation and posting.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7603>
2024-10-02 23:04:42 +00:00
Edward Hervey
9eacd54847 decodebin3: Make update/posting of collection messages atomic
The presence (or not) of a collection on an input will determine whether events
will be throttled so that there are only forwarded when that input gets a valid
collection.

Therefore the input lock should be used.

In addition to that, we want to ensure that the application/user has a chance to
reliably (i.e. synchronously) specify what streams it is interested in by
sending a GST_EVENT_SELECT_STREAMS.

But we cannot allow anything to go forward until that message posting has come
back, otherwise we run in various races.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7602>
2024-10-02 23:06:07 +01:00
Elliot Chen
f805aa2d60 decodebin3: check and send selected stream message even if no decoder is selected
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7601>
2024-10-02 12:59:54 +01:00
Nicolas Dufresne
b17f22bc68 allocators: drmdump: Add NV15 supports
This is a packed version of P010, names NV14_10LE40 in GStreamer. This
format is used on all Rockchip SoC variants.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7596>
2024-10-01 17:32:31 +00:00
Nicolas Dufresne
a0da8c6b53 allocators: drmdumb: Fix bpp value for P010
P010 uses 16 bits per pixel, with least significant being padding. This
code worked with Intel display driver since they roundup that value, but
does not work with the generic DRM helpers which also support NV15,
which does not have any padding.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7596>
2024-10-01 17:32:31 +00:00
Jakub Adam
1250f6fc7e gldownload: use gst_gl_sync_meta_wait_cpu()
Simple gst_gl_sync_meta_wait() is not sufficient to ensure GL commands
are executed before dma-buf devices get to see the buffer.

This is the first step that should make the code behave correctly for
everybody, although there may be performance penalty. In the future we
should introduce a more general sync meta that would allow to move the
waiting from gldownload (the producer) to the sink elements (the
consumers).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7595>
2024-10-01 17:12:37 +01:00
Sebastian Dröge
6b18f02339 avviddec: Unlock video decoder stream lock temporarily while finishing frames
Temporarily release the video decoder stream lock so that other
threads can continue decoding (e.g. call get_frame()) while data
is being pushed downstream.

At this point it is locked twice, we release one, and then the base class
releases the last one just before pushing the data.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7584>
2024-09-29 15:47:32 +01:00
Sebastian Dröge
cf09100e36 qtdemux: Check fourcc of a second CEA608 atom instead of assuming it's cdt2
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7583>
2024-09-29 10:08:38 +01:00
Weijian Pan
451bdb901e avfdeviceprovider: Fix caps leak
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7577>
2024-09-26 13:52:39 +01:00
Hugues Fruchet
9edd02d4e1 kmsallocator: fix stride with planar formats
This fixes a regression introduced by the merge request
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3801

The extrapolated stride was computed but not used, resulting in the same
stride being applied to all planes.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7571>
2024-09-24 23:59:51 +00:00
Nicolas Dufresne
b0b4cf605a doc: good: Update documentation cache
video4linux2 plugin now maps RGB15 which his didn't before.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7563>
2024-09-24 20:19:12 +00:00
Nicolas Dufresne
68728dda4b v4l2object: Fix a gvalue leak on error
In case we failed enumerating the supported interlacing mode, we leaked the
gvalue.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7563>
2024-09-24 20:19:12 +00:00
Nicolas Dufresne
d064914a98 v4l2: dec/enc: Flag leaked caps
We never free class held template caps, so flag the one that wasn't already
flagged.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7563>
2024-09-24 20:19:12 +00:00
Nicolas Dufresne
1149750769 v4l2: object: Fix condition check to emit error
The check was reversed, so we could only emit a pipeline error
if there was no element associated with the object.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7563>
2024-09-24 20:19:12 +00:00
Nicolas Dufresne
625d1bf27f v4l2object: Always tell capture queue that we want to set the CSC
Not all drivers supports it, but in general we want to try and match the
negotiated caps, so lets always try to set the CSC.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7563>
2024-09-24 20:19:12 +00:00
Nicolas Dufresne
d66594b326 v4l2: object: Fix support for format:Interlaced in caps probe
This notably follow the way we order the template and keeps the
format:Interlaced caps at the end. This change also fixes
an early skip check, that would skip if a driver only supports
alternate interlacing for a specific format. It also fixes
a bug where only the last resolution of a discrete frame size
was allowed to use format:Interlaced. Finally, similar to template
caps code, simplify the caps for earch featurs, making the debug output
manageable and (marginally) improve negotiation speed.

This change will make it easier to introduce memory:DMABuf.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7563>
2024-09-24 20:19:12 +00:00
Nicolas Dufresne
44c74e8b3a v4l2: Move M2M template caps probe into v4l2object
This allow reusing the code that produces output and capture devices
templates. This fixes the lack of Interlaced caps feature for M2M
devices such as decoder, encoder or converters.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7563>
2024-09-24 20:19:12 +00:00
Nicolas Dufresne
5b19419969 v4l2: object: Remove over indentation
This is a style fix, no functional changes.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7563>
2024-09-24 20:19:12 +00:00
Nicolas Dufresne
b4811c7df6 v4l2: object: Map GST/V4L2 formats in a C array
This makes it easier to add new format in the future without
forgetting to update one of the numerous switch case. This
will also help mapping DRM formats.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7563>
2024-09-24 20:19:12 +00:00
Nicolas Dufresne
329ee7895d v4l2object: Expose convertion from v4l2 fourcc to GstVideoFormat
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7563>
2024-09-24 20:19:12 +00:00
Nicolas Dufresne
22942b683e v4l2object: Change dimensions format desc field to flag
The boolean naming wasn't obvious, and having this as a flag makes
the structure a little more compact.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7563>
2024-09-24 20:19:12 +00:00
Shengqi Yu
7a37b27c67 v4l2object: append non colorimetry structure to probed caps
If the stream has a special colorimetry that is not in the colorimetry
list, it will cause negotiation to fail. We should allow passing any
colorimetry, so add an extra structure without the colorimetry field.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7570>
2024-09-24 21:17:17 +02:00
Sebastian Dröge
c9d1a1d53c qtdemux: Skip zero-sized boxes instead of stopping to look at further boxes
A zero-sized box is not really a problem and can be skipped to look at any
possibly following ones.

BMD ATEM devices specifically write a zero-sized bmdc box in the sample
description, followed by the avcC box in case of h264. Previously the avcC box
would simply not be read at all and the file would be unplayable.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7565>
2024-09-24 13:23:36 +02:00
Arun Raghavan
bcf16055aa gstreamer: parse: Use child proxy for deferred property setting
We use that mechanism for the non-deferred path, and this makes sure we are
consistent for deferred set too.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7561>
2024-09-23 22:09:31 +00:00
Arun Raghavan
2368ae6d0b gstreamer: parse: Minor whitespace fixups
Mostly replacing some tabs with spaces.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7561>
2024-09-23 22:09:31 +00:00
Arun Raghavan
e68ff6724e gstreamer: parse: Make sure children are bins before recursing in
A deferred set of the form parentbin::childelement::pad works in the
non-deferred property setting path, but the deferred path assumes that all
non-root non-leaf children specify bins. We already have a bin check on the
root, so let's add one for other non-leaves to avoid a critical.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3806
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7561>
2024-09-23 22:09:31 +00:00
Nicolas Dufresne
e3265375ef qml6glsrc: Reduce capture delay
In qml6glsrc, we capture the application by copying the back buffer into
our own FBO. The afterRendering() signal is too soon as from the apitrace, the
application has been rendered into a QT internal buffer, to be used as a cache
for refresh.

Use afterFrameEnd() signal instead. This works with no delay on GLES. With GL
it seems to reduce from 2 to 1 frame delay (this may be platform specific). A
different recording technique would need to be used to completely remove this
delay.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7562>
2024-09-23 22:04:03 +02:00
Jan Alexander Steffens (heftig)
b2a2c4c840 ges: Fix name of GESFrameCompositionMeta API type
g-ir-scanner 1.82.0 failed with a fatal error due to the wrong
namespace.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3800
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7556>
2024-09-21 10:26:43 +02:00
Piotr Brzeziński
084950dd9e rtppassthroughpay: Fix reading clock-rate and payload type from caps
They were using wrong types - while uint is correct technically, for compatibility reasons caps have them as signed int.
Values are now correctly read + added simple guards just to be sure.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7552>
2024-09-19 20:13:08 +02:00
Tim-Philipp Müller
29b77fb2df Back to development after 1.24.8
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7549>
2024-09-19 12:12:53 +02:00
Tim-Philipp Müller
c396e7da4c Release 1.24.8 2024-09-19 12:01:21 +02:00
Benjamin Gaignard
a7b4214358 v4l2codecs: h265: Minimize memory allocation
Be smarter when allocating sink and source memory pools to reduce the
memory footprint. Use gst_v4l2_decoder_get_render_delay() to know the
need number of buffers for downstream element.

Handle errors in case of memory allocation failures.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7546>
2024-09-19 08:07:28 +00:00
Nicolas Dufresne
81934a7fb4 v4l2: encoder: Add dynamic framerate support
This is not trully supported in V4L2, but we can emulate this similar to
what other elements do. In this patch we ensure that 0/1 is supported by
encoders (caps query),and uses a default of 30fps whenever we need to
set a framerate into the driver.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7545>
2024-09-19 00:29:23 +01:00
Sebastian Dröge
2c145b18b7 mpegtsmux: Fix refcounting issue when selecting the best pad
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7539>
2024-09-17 16:34:32 +01:00
Peter Kjellerstedt
686790d8ca meta: Add missing include of gststructure.h
This avoids the following error when only including gstmeta.h:

  /usr/include/gstreamer-1.0/gst/gstmeta.h:146:3: error: unknown type
  name 'GstStructure'
    146 |   GstStructure *structure;
        |   ^~~~~~~~~~~~

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7525>
2024-09-16 08:31:49 +01:00
Edward Hervey
ca33e15de9 encodebin: Fix pad removal for encodebin vs encodebin2
Clarify the fact that `encodebasebin->src_pad` is set when using a static source
pad (`encodebin`) and when not set it's dynamically added source
pads (`encodebin2`).

Fixes usage of encodebin2 when profiles are updated

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7523>
2024-09-15 19:55:23 +01:00
Sebastian Dröge
924a279f33 matroskamux: Include end padding in the block duration for Opus streams
It has to be included in the block duration but in GStreamer we're not
including it in the buffer duration, so it has to be added again here.

Not including it in the block duration can lead to fatal errors when playing
back with Firefox if there are more padding samples than actual samples, e.g.

> D/MediaDemuxer WebMDemuxer[7f6a0808b900] ::GetNextPacket: Padding frames larger
> than packet size, flagging the packet for error (padding: {13500000,1000000000},
> duration: {6000,1000000}, already processed: false)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7517>
2024-09-13 23:58:37 +00:00
Sebastian Dröge
7c7ac2d84f mpegtsmux: Wait for data on all pads before deciding on a best pad unless timing out
This makes sure that if upstream has different latencies that we're still
outputting buffers with increasining timestamps across the different streams
unless buffers are arriving after the latency deadline.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7516>
2024-09-13 22:57:12 +00:00
Sebastian Dröge
ca23c3c762 video: Don't overshoot QoS earliest time by a factor of 2
By setting the earliest time to timestamp + 2 * diff there would be a difference
of 1 * diff between the current clock time and the earliest time the element
would let through in the future. If e.g. a frame is arriving 30s late at the
sink, then not just all frames up to that point would be dropped but also 30s of
frames after the current clock time.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7518>
2024-09-13 23:04:43 +01:00
Sebastian Dröge
b8a316275c splitmuxsink: Override LATENCY query to pretend to downstream that we're not live
splitmuxsink can't possibly know how much latency it will introduce as it always
keeps one GOP around before outputting something. This breaks the latency
configuration of the pipeline and we're better off just pretending that
everything downstream of the sinkpads is not live.

Especially muxers that are based on aggregator and time out on the latency
deadline can easily misbehave otherwise as the deadline will be exceeded usually.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7515>
2024-09-13 19:14:52 +01:00
Sebastian Dröge
4d2ce9949a aggregator: Immediately return NONE from simple_get_next_time() on non-TIME segments
Otherwise this gives critical warnings.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7514>
2024-09-13 12:40:44 +01:00
Arun Raghavan
78635ce0cd pad: Check data NULL-ness when probes are stopped
We were correctly handling this for buffers, but not events and queries.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7506>
2024-09-12 10:05:36 +01:00
Carlos Bentzen
eea3df38fc meson: gst-play: link to libm
gst-play.c depends on libm due to using `round`.
Passing by, correct identation of `gst_tools` definition.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7501>
2024-09-11 10:33:09 +01:00
Nicolas Dufresne
4c3e5435d1 wayland: Set a debug category for the shm allocator
None was set, which meant the debug was associated with default.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7494>
2024-09-10 23:48:44 +01:00
Nicolas Dufresne
1d629a1d69 wayland: Fix ABI break in WL context type name
While transforming the internals of waylandsink into a library, the
context type name was accidentally changed, causing an ABI break. Change
it back to its original (as used by the libgstgl), and add support for
the misnamed version as a backward compatibility measure.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7494>
2024-09-10 23:48:44 +01:00
Thibault Saunier
31475f790a validate: pad-monitor: Fix remaining pad functions data handling
That case was missed in a571753089

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7491>
2024-09-10 17:37:25 +00:00
Nirbheek Chauhan
6e36389139 meson: Update openjpeg wrap to 2.5.2, fixes a warning
The version was incorrectly encoded in the opj_config.h header with
the earlier version, which caused a compilation warning.

```
../subprojects/gst-plugins-bad/ext/openjpeg/gstopenjpegenc.c:943:5: warning: ‘bpp’ is deprecated:
Use prec instead [-Wdeprecated-declarations]
  943 |     comps[i].bpp = GST_VIDEO_FRAME_COMP_DEPTH (frame, i);
      |     ^~~~~
```

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7490>
2024-09-10 18:02:27 +01:00
Wim Taymans
40ee85f6b7 jackaudiosrc: actually use the queried ports from JACK
When no ports are given, gst_jack_get_ports() is called to get all the
(physical) output ports but then the result is ignored, triggering the
"No physical output ports found..." error.

Instead, move the queried ports to the variable we're going to use
later.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7488>
2024-09-10 12:34:13 +01:00
Randy Li (ayaka)
a7157a8091 v4l2bufferpool: actually queue back the empty buffer flagged LAST
The buffer would fail at gst_v4l2_is_buffer_valid() before,
since it has a reference on it, it is not writable.

Fixes: 105d232fde ("v4l2bufferpool: queue back the buffer flagged LAST but empty")
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7485>
2024-09-10 10:06:25 +00:00
Hou Qi
cb9a54169b v4l2videoenc: unref buffer pool after usage properly
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7478>
2024-09-10 09:07:46 +00:00
Michael Tretter
f8a9890ddf uvcsink: set cur_caps to upstream selected caps
If the UVC gadget announces multiple formats in the descriptors the uvcsink
doesn't select the actual format but let's the UVC hosts select the format.

If the GStreamer pipeline is started before a UVC host selected the format,
upstream decides on a format until the UVC host has decided. In this case, the
current format needs to be set based on the caps from the caps event to be able
to detect if the format selection by the UVC host requires a format change on
the GStreamer pipeline.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7484>
2024-09-09 23:58:04 +01:00
Michael Tretter
56bfb9a7b4 uvcsink: skip comparison with prev_caps if they are not set
The uvcsink may be put into the READY state to start listening for UVC requests.
Therefore, the UVC host may set a streaming format before the GStreamer pipeline
is started and the uvcsink received a caps event. In this case, prev_caps will
be NULL.

If the EVENT_CAPS has not been received, skip the check if the format needs to
be changed, since the sink will be started with the format selected by the UVC
host, anyway.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7484>
2024-09-09 23:58:04 +01:00
Piotr Brzeziński
1a28d541a4 vtenc: Restart encoding session when certain errors are detected
Sometimes under certain loads, VT can error out with kVTVideoEncoderMalfunctionErr or kVTVideoEncoderNotAvailableNowErr.
These have been reported to happen more often than usual if CopyProperty/SetProperty() is used close to the encode call.
Both can be worked around by restarting the encoding session.

These errors can be returned either directly from VTCompressionSessionEncodeFrame() or later in the encoding callback.
This patch handles both scenarios the same way - a session restart is be attempted on the next encode_frame() call.

If the error is returned immediately by the encode call, it's possible that some correct frames will still be given to
the output callback, but for simplicity (+ because I wasn't able to verify this scenario) let's just discard those.

In addition, this commit also simplifies the beach/drop logic in enqueue_buffer.

Related bug reports in other projects:
http://www.openradar.me/45889262
https://github.com/aws/amazon-chime-sdk-ios/issues/170#issuecomment-741908622

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7449>
2024-09-09 13:40:00 +00:00
Edward Hervey
8d7cb4a5d1 gstplay: Name the different bus
Makes it clearer when reading logs which one is which

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7471>
2024-09-09 09:09:16 +00:00
Thibault Saunier
d01cc28c07 validate: pad-monitor: Fix pad function data properly
Until now we were overriding pad functions forgetting about the function
data (that are set using the _full variant of the functions setters), meaning
that the data was lost and any user of that feature would get empty data when
the wrapped function were called.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7470>
2024-09-09 00:39:48 +01:00
Thibault Saunier
f7faf5e8e5 osxaudio: Avoid dangling pointer on shutdown
When tearing down the elements we were still referring to the ringbuffer unique_id
as our property while it was already freed, leading to potential segfaults when
accessing the property.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7451>
2024-09-08 13:08:17 +00:00
Chao Guo
01ab04a0b4 glimagesink: resize viewport when video size changed in caps
When re-negotiation happends and caps is changed, resize the
viewport to the corresponding video size in changed caps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7450>
2024-09-08 12:06:32 +00:00
Hou Qi
7256cd1ce7 gstplay: check whether stream is seekable before seeking when state change
If state is changing from playing to paused, and rate is reset to 1
which causes seek position is valid, current code will do seek for
streams that are not seekable. So need to check whether stream is
seekable before seeking.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7448>
2024-09-08 11:28:30 +00:00
Thibault Saunier
051064d8f5 ges: discoverer-manager: Fix race leading to assertion when stopping
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3757

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7467>
2024-09-07 23:27:12 +01:00
Sebastian Dröge
f068b20eb4 ges-structured-interface: Fix memory leak of invalid fields GList
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7440>
2024-09-02 19:24:54 +01:00
Philippe Normand
5cfa9dc0e0 webrtcbin: Prevent crash when attempting to set answer on invalid SDP
If the pending remote description has an invalid BUNDLE group _parse_bundle()
triggers early return from _create_answer_task(), before ret has been
initialized, so it needs to be checked before attempting to call
gst_sdp_message_copy().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7436>
2024-09-02 17:22:28 +01:00
Sebastian Dröge
49e14405cb clock: Fix calculation for number of bits needed to store a 64 bit value
It was using log2(n) but what actually is needed is log2(n) + 1. Also add a
fast-path that uses __builtin_clzll() on gcc/clang.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7431>
2024-08-30 15:07:49 +01:00
Sebastian Dröge
ff538e4adf clock: Fix unchecked overflows in linear regression code
The initial calculation for the precision shift was wrong and would allow for
overflows during the calculations which were not detected and lead to wrong
results.

Also add a test for a case where overflows where previously not detected and
caused a completely wrong result.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7431>
2024-08-30 15:07:49 +01:00
Francis Quiers
411e7958fc voamrwbenc: fix list of bitrates
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7418>
2024-08-27 15:50:42 +01:00
Edward Hervey
2bd45e8fd2 decodebin3: Fix collection identity check
Collections can be auto-generated from upstream and yet have exactly the same
streams in it.

Therefore do a more in-depth check for equality.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7402>
2024-08-22 11:23:12 +01:00
Jan Schmidt
e3f07e1d68 gstplayer: Check GstPlayerSignalDispatcher type
Before trying to retrieve a GMainContext from a provided
GstPlayerSignalDispatcher, check that it is actually
GstPlayerGMainContextSignalDispatcher. If not, use the
default GMainContext for dispatching signals via the adapter

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7398>
2024-08-21 23:47:46 +00:00
Guillaume Desmottes
03f66c8513 wpe: fix gst-launch example
wpesrc does not have num-buffers property but wpevideosrc does.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7397>
2024-08-21 14:29:55 +01:00
Tim-Philipp Müller
29b51fb13d Back to development after 1.24.7 2024-08-21 12:33:28 +01:00
Tim-Philipp Müller
0f1e984e41 Release 1.24.7 2024-08-21 12:25:15 +01:00
Sebastian Dröge
9ea9c4ec77 avdemux: Never return 0 from read function
Instead return AVERROR_EOF. The read function must never ever return 0 according
to the documentation, and in practice this leads to infinite loops.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7391>
2024-08-21 09:57:38 +01:00
Guillaume Desmottes
fba7c87cd7 wpe: initialize threading.ready before reading it
Fixes Valgrind warning.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7385>
2024-08-20 11:38:37 +01:00
Víctor Manuel Jáquez Leal
85fee9738e va: don't use GST_ELEMENT_WARNING in set_context() vmethod
Since bins can set the context of their children elements, the set_context()
vmethod shouldn't call bus messages post methods, since it locks the parent
object, the bin, which might be already locked, leading to a deadlock.

Fixes: #3706
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7379>
2024-08-19 15:09:50 +01:00
Edward Hervey
bfcd23db61 urisourcebin: Actually drop EOS on old-school pad switch
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7376>
2024-08-19 10:40:07 +01:00
Edward Hervey
97461dc47d urisourcebin: Don't hold lock when emitting about-to-finish
This could trigger actions that re-enter this element

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7373>
2024-08-17 10:17:06 +01:00
Qian Hu (胡骞)
4d37b7ae50 v4l2object: handle unsupported hlg colorimetry gracefully
This patch addresses the issue where GStreamer would throw an error when
attempting to use bt2100-hlg colorimetry with V4L2, which is not
supported by the current V4L2 kernel. When bt2100-hlg colorimetry is set
from caps, the check for transfer (GST_VIDEO_TRANSFER_ARIB_STD_B67) is
bypassed.

The main improvement is to avoid checking the transfer value in
gst_v4l2_video_colorimetry_matches when it is
GST_VIDEO_TRANSFER_ARIB_STD_B67. This is because the transfer value in
the cinfo parameter comes from gst_v4l2_object_get_colorspace, which
converts the transfer to another value, causing a mismatch.

Since the kernel does not support GST_VIDEO_TRANSFER_ARIB_STD_B67,
gst_v4l2_object_get_colorspace cannot map it correctly from V4L2 to
GStreamer. Therefore, we ignore this check to prevent errors.

changes:
- Added a condition in gst_v4l2_video_colorimetry_matches to bypass the
  transfer check when the transfer is GST_VIDEO_TRANSFER_ARIB_STD_B67.
- Ensured that the pipeline does not throw errors due to unsupported
  bt2100-hlg colorimetry in V4L2.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7369>
2024-08-16 14:43:08 +01:00
Sebastian Dröge
dd11178f81 avdemux: Fix deadlock when serialized events are received from upstream while opening
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3657

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7367>
2024-08-16 11:57:36 +01:00
Víctor Manuel Jáquez Leal
68913e0a56 pbutils: descriptions: use subsampling factor to get YUV subsampling
The algorithm used to determine the YUV subsampling string uses width and height
subsampling factor, not the raw subsampling. Otherwise all 4:2:0 YUV frames will
be detected as 4:4:4

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7359>
2024-08-15 01:06:48 +00:00
Qian Hu (胡骞)
86c6a43a7c h26xparse: bypass check for length_size_minus_one
fix playback fail, when some file with length_size_minus_one == 2

According to the spec 2 cannot be a valid value, so that stream has a
bad config record. but breaking the decoding because of that, perhaps is too much.
and ffmpeg seem not check this

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7358>
2024-08-14 14:54:35 +01:00
Víctor Manuel Jáquez Leal
85b4fbf40b msdk: replace strcmp with g_strcmp0
Because strcmp doesn't handle NULL.

Fixes: #3721
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7349>
2024-08-13 18:13:56 +01:00
Mathieu Duponchelle
6500fc7666 rtspsrc: expose property for forcing usage of non-compliant URLs
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7346>
2024-08-13 11:16:11 +00:00
Nicolas Dufresne
c29f2e8632 qt6glwindow: Fallback to GL_RGB on CopyTexImage2D error
With GLES 2.0 we are forced to use CopyTextImage2D which requires
passing an internal format. With QT6 eglfs, we need to pass GL_RGB
instead, probably because of how the texture has been created. As its
hard to guess, simply fallback to GL_RGB on failure. This fixes usage
or qml6glsrc with eglfs backend, without loosing support for
semi-transparent window on other platforms.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7345>
2024-08-13 10:03:47 +00:00
Nicolas Dufresne
a5be59f9c0 qmlgl6src: Fix crash when use-default-fbo is false
When that property is set to its default qmlgl6src element simply crash
as it will call gst_video_frame_unmap() twice.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7344>
2024-08-13 09:27:34 +00:00
Jan Schmidt
a86803ae3a core: Log pad name, not just the pointer
Change a debug statement that was just logging a pad pointer where
it could log the pad name more usefully.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7336>
2024-08-12 10:54:45 +01:00
Sebastian Dröge
c4af350105 validate: Copy action structure before retrieving strings from it
The returned strings are only valid for as long as the structure is valid.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7334>
2024-08-09 12:11:38 +01:00
Sebastian Dröge
b8d7cdbd1f validate: Fix copying of action name
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7334>
2024-08-09 12:11:38 +01:00
Tim-Philipp Müller
364d88045d aom: av1enc: restrict allowed input width and height
Restrict allowed input resolution to something sensible
in light of libaom CVE-2024-5171.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7328>
2024-08-08 16:17:10 +01:00
Jan Schmidt
a592bf28b0 webrtc: Add missing G_BEGIN/END_DECLS in header
Fix using webrtc.h from C++ by adding the GLib begin/end
decls markers around the header contents in webrtc_fwd.h

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7313>
2024-08-06 14:51:51 +01:00