Commit graph

1247 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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
Nicolas Dufresne
65f1c70430 qt6glwindow: Only use GL_READ_FRAMEBUFFER when we do blits
This fbo target is not always supported, and should only be used
along with the frame buffer blit extension.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7295>
2024-08-02 14:57:32 +01:00
Nicolas Dufresne
be7ff82614 qt6: glwindow: Don't leak previously rendered buffer
If the consumer reads the buffers too slowily, simply unref the
previously rendered buffer instead of leaking it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7289>
2024-08-01 14:46:36 +01:00
Hou Qi
dd22125b1e v4l2: Fix colorimetry mismatch for encoded format with RGB color-matrix
video-info supports encoded format to have RGB color-matrix, while
v4l2object just leave the v4l2 matrix to default when mapping
GST_VIDEO_COLOR_MATRIX_RGB. It causes gst matrix changed to be
GST_VIDEO_COLOR_MATRIX_BT601 when mapping v4l2 colorimetry.

So add support for encoded format with RGB color-matrix in v4l2object.
Note that for M2M encoders, we should in theory assume that that we can
transfer this value from OUTPUT to CAPTURE queues, though its only true
if the drivers does not do CSC. For now, we don't support any RGB
codecs, but leaving a note for the future.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7284>
2024-07-31 11:14:12 +01:00
Nicolas Dufresne
654901612b v4l2object: SRGB colorspace is documented limited-range
Split JPEG and SRGB so that we can follow the specified difference. The
SRGB definition in V4L2 does not follow the standard, and is document
so. This is also why JPEG colorspace exists.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7284>
2024-07-31 11:14:12 +01:00
Nicolas Dufresne
37d64f651e v4l2object: Fix size of plane_size array calculation
Due to missing parenthesys, only the first element of the array was
being cleared. As it is a staticly sized array in the object, this
code could also be simplified.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7284>
2024-07-31 11:14:12 +01:00
Nicolas Dufresne
8c881e833c v4l2object: Fix translation of quantization
The V4L2_MAP_QUANTIZATION macro has been fixed to something a lot saner,
fix our replica accordingly. The new macro now simply set the quantization
to full range is the pixel formats is RGB based, or if the JPEG
colorspace is used.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7284>
2024-07-31 11:14:12 +01:00
Tim-Philipp Müller
ad0cc551e1 Back to development after 1.24.6 2024-07-29 16:48:02 +01:00
Tim-Philipp Müller
8d175ea255 Release 1.24.6 2024-07-29 16:41:37 +01:00
Piotr Brzeziński
2aa610605e macos: Listen for audio devices being added/removed
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7258>
2024-07-29 14:05:49 +00:00
Matthew Waters
d705966861 qml/glsink: also support GLES2 needing shader 'precision' directives
Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3616
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7125>
2024-07-24 10:05:23 +00:00
Loïc Yhuel
1305d597c7 meson: fix SIZEOF_OFF_T when cross-compiling with Meson >= 1.3.0
https://mesonbuild.com/Release-notes-for-1-3-0.html#clarify-of-implicitlyincluded-headers-in-clike-compiler-checks

With only stddef.h, off_t is not defined, so when cross-compiling SIZEOF_OFF_T is -1.
We now use sys/types.h which should define off_t.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7218>
2024-07-23 16:32:10 +01:00
Shengqi Yu
c4fe9786ea v4l2object: use v4l2 reported width for padded_width when complex video formats
Stride means bytes per line, and padded_width means pixels. Here,
padded_width shoule be pix width reported by v4l2 instead of stride.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7122>
2024-07-01 20:44:02 +01:00
Jan Schmidt
5a25a00324 adaptivedemux: Fix handling closed caption streams
Fix a typo "CLOSED_CAPTION" -> "CLOSED-CAPTION" and
a broken if statement that always bailed out for
closed captions

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7105>
2024-06-26 15:58:20 +00:00
Tim-Philipp Müller
a58953cbf6 Back to development after 1.24.5 2024-06-20 13:02:19 +01:00
Tim-Philipp Müller
3c66f10e21 Release 1.24.5 2024-06-20 12:54:15 +01:00
Tim-Philipp Müller
f6af34d3be rtpdtmfsrc: minor logging clean-up
Only serialise event structure for debug logging purposes
if logging is actually enabled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7062>
2024-06-19 10:11:28 +01:00
Tim-Philipp Müller
02447fa0b2 rtpdtmfsrc: fix leak when shutting down mid-event
.. and update rtpdtmfdepay unit test to trigger
the potential leak more reliably (without the fix).

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7062>
2024-06-19 10:11:28 +01:00