Commit graph

1323 commits

Author SHA1 Message Date
Sebastian Dröge
bbd3d6f4f6 qtdemux: Check fourcc of a second CEA608 atom instead of assuming it's cdt2
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7575>
2024-09-29 06:18:56 +00:00
Sebastian Dröge
b7b24573ce common: Use more efficient versions of GstCapsFeatures API where possible
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7432>
2024-09-26 19:26:18 +03:00
Sebastian Dröge
6233eb0ff3 common: Stop using GQuark-based GstStructure field name API
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7432>
2024-09-26 19:21:29 +03:00
Sebastian Dröge
0c1611d31d common: Stop using GQuark-based GstStructure name API
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7432>
2024-09-26 19:21:29 +03:00
Sebastian Dröge
d4bab55077 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/7564>
2024-09-24 11:21:19 +03:00
Nicolas Dufresne
66f1c9fd13 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/7540>
2024-09-23 16:50:43 -04:00
Nicolas Dufresne
09e23e325c 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/7540>
2024-09-23 19:58:52 +00:00
Nicolas Dufresne
a6959f3738 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/7540>
2024-09-23 19:58:52 +00:00
Nicolas Dufresne
d35f348af3 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/7540>
2024-09-23 19:58:52 +00:00
Nicolas Dufresne
86dddfa61c 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/7540>
2024-09-23 19:58:52 +00:00
Nicolas Dufresne
2fe83fa2de 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/7540>
2024-09-23 19:58:52 +00:00
Nicolas Dufresne
e97a954008 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/7540>
2024-09-23 19:58:52 +00:00
Nicolas Dufresne
7fb16f0b11 v4l2: object: Remove over indentation
This is a style fix, no functional changes.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7540>
2024-09-23 19:58:52 +00:00
Nicolas Dufresne
746977b6d3 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/7540>
2024-09-23 19:58:51 +00:00
Nicolas Dufresne
b7d4e576ea v4l2object: Expose convertion from v4l2 fourcc to GstVideoFormat
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7540>
2024-09-23 19:58:51 +00:00
Nicolas Dufresne
87398e1f8b 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/7540>
2024-09-23 19:58:51 +00:00
Nicolas Dufresne
03cf7f6445 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/7351>
2024-09-23 18:53:33 +00:00
Piotr Brzeziński
a6fa53b7b1 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/7526>
2024-09-19 16:46:20 +00:00
Piotr Brzeziński
363154d855 rtppassthroughpay: Add ability to regenerate RTP timestamps
Timestamps are untouched by default, but the new mode can now be enabled to replace RTP timestamps
with ones generated from the buffer PTS. Making it an enum in case different modes are needed in the future.
That allows for a rtpjitterbuffer to do proper drift compensation, so that the stream coming out of gst-rtsp-server
is not drifting compared to the pipeline clock and also not compared to the RTCP NTP times.

Most of the code is borrowed from rtpbasepayload, as it's exactly its behaviour which I wanted to bring here.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7526>
2024-09-19 16:46:20 +00:00
Sebastian Dröge
252378f1ae flvmux: Use gst_aggregator_update_segment() instead of randomly pushing a segment event
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7542>
2024-09-19 17:08:45 +03:00
Tim Blechmann
de2a8bd4ad v4l2: silence valgrind warning
Valgrind complains about uninitialized memory used in an ioctl

    Syscall param ioctl(VKI_V4L2_G_TUNER).reserved points to uninitialised byte(s)
       at 0x719294F: ioctl (ioctl.c:36)
       by 0x3126A817: gst_v4l2_fill_lists (v4l2_calls.c:185)
       by 0x3126A817: gst_v4l2_open (v4l2_calls.c:589)
       by 0x3123F1C2: gst_v4l2_device_provider_probe_device (gstv4l2deviceprovider.c:122)
       by 0x3123F648: gst_v4l2_device_provider_device_from_udev (gstv4l2deviceprovider.c:301)
       by 0x3123F998: provider_thread (gstv4l2deviceprovider.c:395)
       by 0x796FA50: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7200.4)
       by 0x710CAC2: start_thread (pthread_create.c:442)
       by 0x719DA03: clone (clone.S:100)
     Address 0x44008a34 is on thread 11's stack
     in frame #1, created by gst_v4l2_open (v4l2_calls.c:524)
     Uninitialised value was created by a stack allocation
       at 0x3126A024: gst_v4l2_open (v4l2_calls.c:524)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6144>
2024-09-18 23:25:18 +00:00
Tim Blechmann
95db9d64c0 v4l: fix thread name
Linux thread names are limited to 15 chars. providing long thread names
causes the thread name not to be applied at all

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6094>
2024-09-18 20:37:10 +00:00
Michael Tretter
fd165528d2 v4l2videoenc: demote per frame message to LOG
The "Handling frame" message with the frame number is printed on every buffer.
Therefore, it should have log level LOG instead of DEBUG.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7543>
2024-09-18 15:34:30 -04:00
Michael Tretter
5d310062e8 v4l2videoenc: remove unnecessary processing variable and dead code
"processing" is only set to FALSE and never set to TRUE. Therefore, the code
that depends on processing to be TRUE is never executed.

Remove the dead code.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7543>
2024-09-18 15:34:24 -04:00
Nicolas Dufresne
ee925c506c 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/7352>
2024-09-18 13:20:42 -04:00
Sebastian Dröge
762a281b0c 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/7502>
2024-09-13 20:38:51 +00:00
Sebastian Dröge
396ef0cbcf 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/7459>
2024-09-13 19:52:52 +00:00
Sebastian Dröge
256a941d3a 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/7499>
2024-09-13 14:47:23 +00:00
Wim Taymans
1b5a093b96 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/7474>
2024-09-10 06:20:06 +00:00
Randy Li (ayaka)
6f5bbd0276 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/7479>
2024-09-09 20:20:07 +00:00
Hou Qi
b1fd616514 v4l2videoenc: unref buffer pool after usage properly
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7435>
2024-09-09 12:46:18 +00:00
Thibault Saunier
3506f5fb07 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/7426>
2024-09-04 10:37:37 +00:00
Matthew Waters
4802ad8eb6 rtpfunnel: also fallback to pad default handling for unknown ssrcs
If two (or more) rtpfunnel elements are cascaded, then only one will
realistically have information on the particular ssrc that is in use for a
particular input stream.  As such, any key unit requests may never reach the
corresponding encoder.

This has been discovered by combining simulcast and BUNDLE with webrtcbin.
simulcast uses one rtpfunnel, and BUNDLE uses another rtpfunnel.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7405>
2024-09-04 08:15:38 +00:00
Tim-Philipp Müller
ec6763b122 gst-plugins-good: use g_sort_array() instead of deprecated g_qsort_with_data()
Fixes compiler warnings with the latest GLib versions.

See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4127

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7384>
2024-09-02 22:31:34 +00:00
Matthew Waters
6218b153fd tests/examples/qmlglveray.py: fix formatting for commit lint
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7244>
2024-09-02 11:19:34 +00:00
Matthew Waters
be1841904b tests/examples/qmloverlay.py: add license and copyright headers
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7244>
2024-09-02 11:19:33 +00:00
Matthew Waters
493b657ff8 tests/examples/qml-multisink: add license and copyright headers
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7244>
2024-09-02 11:19:33 +00:00
Matthew Waters
73624fa5c9 tests/examples/qmlglsrc: add copytright and licenses headers
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7244>
2024-09-02 11:19:33 +00:00
Matthew Waters
9c99dfc34d tests/examples/qmlglsink/overlay: add copyright and licenses headers
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7244>
2024-09-02 11:19:33 +00:00
Matthew Waters
55648d9b8d tests/examples/qml6: Add license and copyright information
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7244>
2024-09-02 11:19:33 +00:00
Edward Hervey
2385a2e68d qt6: Remove unused field
```
In file included from ../subprojects/gst-plugins-good/ext/qt6/gstqsg6material.cc:31:
../subprojects/gst-plugins-good/ext/qt6/gstqsg6material.h:69:17: error: private
field 'mem_' is not used [-Werror,-Wunused-private-field]
   69 |     GstMemory * mem_;
      |                 ^
```

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7414>
2024-08-27 13:38:37 +02:00
Edward Hervey
864faa34cd qt6: Rename symbols to avoid conflict in static builds
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7414>
2024-08-27 13:37:41 +02:00
Jan Schmidt
3c7f9c0fab qmlglsink: Add support for external-oes textures
Support was added to qml6glsink in MR !7319

Backport similar support to the Qt5 element so it
can also support direct DMABuf import from hardware
decoders.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7393>
2024-08-21 17:03:21 +01:00
Qian Hu (胡骞)
ddd00a9e1d 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/7212>
2024-08-16 11:51:57 +00:00
Jan Schmidt
eb5b064145 splitmuxsink: Update tracked running time before first fragment-opened
Before sending the first fragment-opened message on the bus, update
the output_fragment_info structure so that the sent message correctly
reports the initial running time.

Fixes #3725

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7361>
2024-08-15 09:14:52 +00:00
Nicolas Dufresne
3f2ed552fb 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/7321>
2024-08-13 02:24:00 +00:00
Nicolas Dufresne
c9df0a5799 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/7290>
2024-08-13 01:45:18 +00:00
Mathieu Duponchelle
bc39c0f54b rtspsrc: expose property for forcing usage of non-compliant URLs
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7133>
2024-08-12 20:10:45 +00:00
Nirbheek Chauhan
c11eaf56f5 meson: Use required: kwarg in osxaudio to fix FIXME
This wasn't used because this feature didn't exist years ago when this
build file was written.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7340>
2024-08-12 23:46:02 +05:30
Nirbheek Chauhan
daaeb57eca osxaudio: Fix build on iOS
These device-provider functions are only valid on macOS.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7340>
2024-08-12 23:46:02 +05:30