Commit graph

119757 commits

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