Commit graph

742 commits

Author SHA1 Message Date
Ming Qian 551fe9c9b1 v4l2object: clear format lists if source change event is received
If decoder notify a source change event when the capture format is
changed, not the resolution changed.

then gst_v4l2_object_acquire_format will retuen false due to
unsupported format.

we need to clear the format lists in the source change flow,
and reenumerate format list

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5223>
2023-08-22 23:59:10 +01:00
Nicolas Dufresne 426bf399d4 v4l2: allocator: Don't close foreign dmabuf
Imported dmabuf are not being duped, so they should never be closed. Instead,
we ensure their live time by having strong reference on their original
buffer. This should fix potential flickering due to dmabuf being closed
too early.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5217>
2023-08-21 23:52:57 +01:00
Jan Alexander Steffens (heftig) d956a7e2d1 qt: Unbreak build with qt-egl enabled but viv_fb missing
Avoids an error message when the feature is explicitly enabled:

    ERROR: Feature qt-egl cannot be enabled: gstreamer-gl-viv_fb-1.0 is required

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5200>
2023-08-18 12:45:14 +00:00
Wang Chuan 19a0463903 gstadaptivedemux: fix memory leak
GstQuery leaks when using invalid url

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5156>
2023-08-12 15:17:46 +00:00
Nirbheek Chauhan 15a180189a meson: Fix searching of qt5/qt6 tools with qmake
If the pkg-config files are broken, we want to ensure that qmake is
used. This can easily happen on macOS with the official Qt binaries.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5149>
2023-08-04 16:40:21 +01:00
Alicia Boya García 654ca283a7 qtdemux: Fix premature EOS when some files are played in push mode
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2771

This EOS branch exists so that if a seek with a stop is made, qtdemux
stops accepting bytes from the sink after the entire requested playback
range is demuxed, as otherwise we could keep download content that is
not being used.

This patch fixes two flaws that were present in that EOS check:

1) A comparison was made between track time and movie time without conversion.
This made the check trigger early in files with edit lists. This patch fixes
this by converting the track PTS to movie PTS (stream time) for the check.

2) To avoid sending a EOS prematurely when the segment stop is within a GOP and
B-frames are present, the check for EOS should only be done for keyframes. I
gather this was already the intention with the existing code, but because it
used `stream->on_keyframe` instead of the local variable `keyframe` the old
code was checking if the *previous* frame was a keyframe.

It's interesting to note that these two flaws in the old code mask each other
in most cases: the track PTS will have reached the movie end PTS, but EOS would
only be sent if the previous frame was a keyframe. A simple case where they
wouldn't mask each other, reproducing the bug, is a sequence of 3 frame GOPs
with structure I-B-P.

The following validateflow tests have been added to future-proof the
fix:

 * validate.test.mp4.qtdemux_ibpibp_non_frag_pull.default
 * validate.test.mp4.qtdemux_ibpibp_non_frag_push.default

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5114>
2023-08-03 20:22:51 +00:00
Nicolas Dufresne 40311bf665 v4l2: Fix support for left and top padding
In the current implementation, we support for most pixel format left
and top padding by changing the offset in the video meta. Though, to
align driver bytesused to the offset, we recalculate the offset, which
removed the modification we did before.

Instead, save the plane size, and truncate the driver reported bytesused
to the expected size, which ensures that the offsets still match. This
should also fix issues were the buffer size ended up bigger then the
pool size due to driver introduced padding.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5132>
2023-08-01 19:54:57 +01:00
Guillaume Desmottes bbca6cc8c8 videoflip: fix concurrent access when modifying the tag list
We were checking if the tag list is writable, but it may actually be
shared through the same event (tee upstream or multiple consumers).

Fix a bug where multiple branches have a videoflip element checking the
taglist. The first one was changing the orientation back to rotate-0
which was resetting the other instances.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5099>
2023-07-25 17:32:50 +01:00
Xabier Rodriguez Calvar 1a3deef85f qtdemux: attach cbcs crypt info at the right moment
Before it was always added but that can cause issues when the stream begins
unencrypted.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5096>
2023-07-25 12:43:28 +01:00
Nirbheek Chauhan b4f137e2ba meson: Ensure that soup plugin is built on Windows
The libpsl subproject wasn't building successfully and CI didn't
notice because:

1. The plugin wasn't explicitly enabled
2. Even when the plugin is explicitly enabled, the dep is not required
   at build time when not building a static plugin

So fix all of these issues.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4890>
2023-07-24 16:36:56 +01:00
Tim-Philipp Müller 60120003c0 Back to development
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5082>
2023-07-20 16:57:47 +01:00
Tim-Philipp Müller bf6ce1d64a Release 1.22.5 2023-07-20 15:22:48 +01:00
Edward Hervey 3e541953f8 hlsdemux2: Don't set a referer when updating playlists
In the same way we don't for regular playlists in the base class.

If there is a referer specified by the app/user, the downloadhelper will set it
accordingly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5057>
2023-07-18 16:00:49 +02:00
Edward Hervey 46d5a64117 adaptivedemux2: Don't blindly set the main manifest URI as referer
There's no guarantee it will *actually* be the URI which refered to what we are
downloading. It could be a stream URI or anything else.

Instead of putting something wrong, put no (specific) referer as a better choice

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5057>
2023-07-18 16:00:49 +02:00
Bastien Nocera 1e7c085791 gtk: Fix critical caused by pointer movement when stream is getting ready
This check fixes a critical warning that can happen when a pointer motion
happens and the video doesn't have its width/height information available.

GStreamer-Video-CRITICAL **: gst_video_center_rect: assertion 'src->h != 0' failed

 #0  g_logv (log_domain=0x7ffff705e176 "GStreamer-Video", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=<optimized out>) at ../../../../Projects/jhbuild/glib/glib/gmessages.c:1422
 #1  0x00007ffff7e1a81d in g_log (log_domain=<optimized out>, log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7ffff7e77a9d "%s: assertion '%s' failed") at ../../../../Projects/jhbuild/glib/glib/gmessages.c:1460
 #2  0x00007ffff7e1b749 in g_return_if_fail_warning (log_domain=<optimized out>, pretty_function=<optimized out>, expression=<optimized out>) at ../../../../Projects/jhbuild/glib/glib/gmessages.c:2930
 #3  0x00007ffff701d90b in gst_video_sink_center_rect (src=..., dst=..., result=result@entry=0x7fffffffc6d0, scaling=scaling@entry=1) at ../../../../Projects/jhbuild/gstreamer/subprojects/gst-plugins-base/gst-libs/gst/video/gstvideosink.c:105
 #4  0x00007fffe5652dbb in _fit_stream_to_allocated_size (result=0x7fffffffc6d0, allocation=0x7fffffffc6c0, base_widget=0x9396f0) at ../../../../Projects/jhbuild/gstreamer/subprojects/gst-plugins-good/ext/gtk/gtkgstbasewidget.c:326
 #5  gtk_gst_base_widget_display_size_to_stream_size (base_widget=base_widget@entry=0x9396f0, x=1207.7109375, y=811.84765625, stream_x=stream_x@entry=0x7fffffffc720, stream_y=stream_y@entry=0x7fffffffc728) at ../../../../Projects/jhbuild/gstreamer/subprojects/gst-plugins-good/ext/gtk/gtkgstbasewidget.c:344
 #6  0x00007fffe5651a4b in gst_gtk_base_sink_navigation_send_event (navigation=0x5ff990, event=0x178a730) at ../../../../Projects/jhbuild/gstreamer/subprojects/gst-plugins-good/ext/gtk/gstgtkbasesink.c:340
 #7  0x00007fffe5652432 in gtk_gst_base_widget_motion_event (widget=<optimized out>, event=event@entry=0x1f14b60) at ../../../../Projects/jhbuild/gstreamer/subprojects/gst-plugins-good/ext/gtk/gtkgstbasewidget.c:404

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5051>
2023-07-18 07:36:41 +02:00
Michael Tretter 5b60ea9a8a v4l2videoenc: remove empty sink_query
The sink_query() function simply calls the sink_query() function of the parent
videoencoder class. Remove the override to simply directly call the parent's
function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5036>
2023-07-14 00:07:27 +02:00
Michael Tretter 2e5929abfc v4l2videoenc: replace custom QUERY_CAPS handling with getcaps callback
The videoencoder base class uses getcaps() to ask a subclass for the caps in its
sink_query_default() implementation.

Replace the custom handling of the QUERY_CAPS in the v4l2videoenc with an
implementation of getcaps() that returns the caps that are supported by the
v4l2videoenc to return these caps in the query.

This getcaps() implementation also calls the provided proxy_getcaps(), which
sends a caps query to downstream. This fixes the v4l2videoenc element to respect
limits of downstream elements in a sink query.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5036>
2023-07-14 00:07:27 +02:00
Carlos Rafael Giani ca868332f1 gl: Take into account viv-fb vs. viv_fb naming in meson scripts
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4959>
2023-07-12 22:45:04 +10:00
Matthew Waters 661dcdaf30 gl: provide a pkg-config/gir file for the viv-fb backend
Required to be able to generate coherent bindings for window system
specific APIs due to limitations in gobject-introspection.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4959>
2023-07-12 22:45:04 +10:00
Seungha Yang b8e7012882 qt6: Set sampler filtering method
QQuickItem::smooth property doesn't seem to be propagated to
newly created QSGSimpleTextureNode automatically.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2793
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5016>
2023-07-11 22:26:24 +00:00
David Craven ca48193cd6 matroska: demux: Strip signal byte from encrypted blocks
Removes the signal byte when the frame is unencrypted to
be consistent with when the frame is encrypted.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5014>
2023-07-11 13:53:02 +00:00
Nicolas Dufresne e4206bbae8 v4l2: videodec: Don't wait for src_ch if active
If the capture pool is already active, like when handling gaps at the
start of a stream, do not setup the decoder to wait for src_ch event.
Otherwise the decoder will endup waiting for that at the wrong moment
and exit the decoding thread unexpectedly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4996>
2023-07-09 17:50:30 +01:00
Nicolas Dufresne 62ada196db v4l2: videodec: Move pool setup inside negotiate()
Move all the pool configuration inside the negotiate() virtual function.
This allow settting up a pool with default format whenever the base
class wants to start without input data, like gaps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4996>
2023-07-09 17:50:29 +01:00
Hou Qi e35e1a01b2 v4l2videodec: correctly register v4l2mpeg2dec
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4992>
2023-07-07 16:32:59 +01:00
Guillaume Desmottes 4c77bc2161 videoflip: fix critical when tag list is not writable
Fix this pipeline where the tag list is not writable:

gst-launch-1.0 videotestsrc ! taginject tags="image-orientation=rotate-90" ! videoflip video-direction=auto \
  ! autovideosink

GStreamer-CRITICAL **: 12:34:36.310: gst_tag_list_add: assertion 'gst_tag_list_is_writable (list)' failed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4990>
2023-07-07 14:59:33 +01:00
Michael Olbrich 841902889b v4l2src: handle resolution change when buffers are copied
When buffers are copied then GST_V4L2_FLOW_RESOLUTION_CHANGE is returned by
gst_v4l2_buffer_pool_process() so do renegotiation here as well.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4985>
2023-07-06 19:41:27 +01:00
Seungha Yang 4bd7992d14 rtspsrc: Fix crash when is-live=false
The pad's parent (i.e., rtspsrc) can be nullptr since we add pads
later.

Co-authored-by: Jan Schmidt <jan@centricular.com>

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2751
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4971>
2023-07-05 09:17:14 +00:00
Edward Hervey 084efebb2a hlsdemux2: Ensure processed webvtt ends with empty new line
Parsers downstream will use empty new lines to detect where an entry
ends. Failure to have a newline would cause the entry to be either
discarded or (wrongly) concatenated with the next entry

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4970>
2023-07-05 09:17:58 +01:00
Edward Hervey bf0446ad73 matroska-demux: Properly handle early time-based segments
Refusing an incoming segment in < GST_MATROSKA_READ_STATE_DATA should only be
done if the incoming segment is not in GST_FORMAT_TIME.

In GST_FORMAT_TIME, we are just storing the values and returning, so we can
invert the order of the checks.

Fixes proper segment propagation in matroska/webm DASH use-cases

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4922>
2023-06-23 08:55:47 +02:00
Edward Hervey 8e4bfd896b adaptivedemux2: Handle early SEEKING query
No pads are present yet, but we can still answer the query

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4922>
2023-06-23 08:55:46 +02:00
Edward Hervey 3cbfe5a481 adaptivedemux2: Fix non-accurate seeking
If no accurate positioning was required, default to snap to the previous segment
for improved responsiveness

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4922>
2023-06-23 08:54:21 +02:00
Edward Hervey 38beda2b8e adaptivedemux2: Handle return in seek handling
Various code path were repeating the same logic, and risk forgetting a lock
release.

Unify all of them

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4922>
2023-06-23 08:54:20 +02:00
Edward Hervey a2272dc6ac adaptivedemux2: Move API lock usage
It is not needed so early

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4922>
2023-06-23 08:51:07 +02:00
Edward Hervey f1e2202b23 adaptivedemux2: Handle early key-unit seek
Is a seek is done on stream-collection post, there are no selected streams
yet. Therefore none would be chosen to adjust the key-unit seek.

If no streams are selected, fallback to a default stream (i.e. one which has
track(s) with GST_STREAM_FLAG_SELECT).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4922>
2023-06-23 08:51:05 +02:00
Edward Hervey 12b689f6b5 adaptivedemux2: Fix early seeking
When seeking is handled by the collection posting thread, there is a possibility
that some leftover data will be pushed by the stream thread.

Properly detect and reject those early segments (and buffers) by comparing it to
the main segment seqnum

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4922>
2023-06-23 08:42:03 +02:00
Guillaume Desmottes 2dc0e1ac87 videoflip: update orientation tag in auto mode
The frames are flipped according to the tag orientation so it's no longer accurate.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4796>
2023-06-22 14:06:33 +02:00
François Laignel 107c456c0d qtdemux: opus: set entry as sampled
... otherwise streams with constant size samples defined with a single
`sample_size` for all samples in the `stsz` box fall in the category
`chunks_are_samples` in `qtdemux_stbl_init`, overriding the actual
sample count.

`FOURCC_soun` would set this automatically for `compression_id == 0xfffe`,
however `compression_id` is read from the Audio Sample Entry box at an offset
marked as "pre-defined" in some version of the spec and set to 0 both by
GStreamer and FFmpeg for opus streams.

Considering the stream `sampled` flag is set explicitely by other fourcc
variants, doing so for opus seems consistent.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4908>
2023-06-20 20:35:49 +01:00
Tim-Philipp Müller adafbe4fad Back to development
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4907>
2023-06-20 19:10:38 +01:00
Tim-Philipp Müller 064711d8b3 Release 1.22.4 2023-06-20 17:42:25 +01:00
Jonas Kvinge b3a319d3f1 adaptivedemux2: Allow data dash+xml manifest for uri
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4853>
2023-06-20 14:07:07 +00:00
Sebastian Dröge bdc8021c73 flacparse: Avoid integer overflow in available data check for image tags
If the image length as stored in the file is some bogus integer then
adding it to the current byte readers position can overflow and wrongly
have the check for enough available data succeed.

This then later can cause NULL pointer dereferences or out of bounds
reads/writes when actually reading the image data.

Fixes ZDI-CAN-20775
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2661

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4897>
2023-06-20 09:16:37 +01:00
François Laignel 670ce68f06 qtdemux: parse Opus and dOps as qtdemux nodes and add size checks
This allows checking the nodes conformity and dumping parsed values.

Note: Audio Sample Entry version parsing and offset handling is handled as part
of `FOURCC_soun` common processing and in `qtdemux_parse_node`.

Also, only read `stream_count` and `coupled_count` when
`channel_mapping_family` != 0. See:

https://opus-codec.org/docs/opus_in_isobmff.html#4.3.2

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4891>
2023-06-19 16:09:48 +01:00
François Laignel 8d2dc95567 qtdemux: fix byte order for opus extension and version field type
The "Encapsulation of Opus in ISO Base Media File Format" [1] specifications,
§ 4.3.2 Opus Specific Box, indicates that data must be stored as big-endian.

[1] https://opus-codec.org/docs/opus_in_isobmff.html#4.3.2

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4891>
2023-06-19 16:09:48 +01:00
François Laignel 9e27d36edc qtmux: fix byte order for opus extension
The "Encapsulation of Opus in ISO Base Media File Format" [1] specifications,
§ 4.3.2 Opus Specific Box, indicates that data must be stored as big-endian.

In `build_opus_extension`, `gst_byte_writer_put*_le ()` variants were used,
causing audio streams conversion to Opus in mp4 to offset samples due to the
PreSkip field incorrect value (29ms early in our test cases).

[1] https://opus-codec.org/docs/opus_in_isobmff.html#4.3.2

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4891>
2023-06-19 16:09:48 +01:00
Jan Alexander Steffens (heftig) 21cccd0e00 isomp4: Fix (E)AC-3 channel count handling
The muxer used a fixed value of 2 channels because the TR 102 366 spec
says they're to be ignored. However, the demuxer still trusted them,
resulting in bad caps.

Make the muxer fill in the correct channel count anyway (FFmpeg already
does) and make the demuxer ignore the value.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4773>
2023-06-15 15:23:22 +00:00
Daniel Morin 97ca841601 v4l2src: fix support for bayer format
- Define a new function that identify if the v4l2object is raw based
on pixel format
- Only consider setting delta flag on buffer if the video is not raw.

Sponsored by Living Optics Ltd.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4867>
2023-06-15 09:42:24 +00:00
Tim-Philipp Müller 20c109faf5 tests: rtpbin_buffer_list: fix possible unaligned read on 32-bit ARM
Fixes #2666

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4855>
2023-06-14 09:12:15 +01:00
ekwange cccf28fec1 v4l2: Change to query only up to V4L2_CID_PRIVATE_BASE+V4L2_CID_MAX_CTRLS
Fix to prevent infinite querying.
There are devices that exceed V4L2_CID_PRIVATE_BASE+V4L2_CID_MAX_CTRLS
but do not return EINVAL.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4851>
2023-06-13 20:02:18 +01:00
Jochen Henneberg 33e789e067 rtspsrc: Cleanup code for next pending command
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4799>
2023-06-08 07:22:59 +02:00
Jochen Henneberg 89ece711dd rtspsrc: Do not try send dropped get/set parameter
If the set_get_param_q has been emptied we have to reset the cached
pending command to CMD_LOOP as we will not have the request parameters
anymore.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4799>
2023-06-08 07:22:59 +02:00