Commit graph

732 commits

Author SHA1 Message Date
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
Hou Qi 81a2f2d779 v4l2videodec: treat MPEG 1 format as MPEG 2
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4787>
2023-06-06 20:56:40 +02:00
Nirbheek Chauhan f813a2813e meson: Support building qml6glsink on win32
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4762>
2023-06-06 16:43:13 +05:30
Nirbheek Chauhan 515fd66289 meson: Add more qt options and eliminate all automagic
The qt5 and qt6 plugins will now correctly error out if you enable the
option, and you can also now explicitly ensure that wayland, x11,
eglfs support is actually functional by enabling the options. It was
too easy to build non-functional support for these.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4776>
2023-06-06 13:38:23 +05:30
Nirbheek Chauhan 8a0ccb6d3f meson: Add build_rpath for qt5 plugin on macOS
Without this, the plugin cannot be loaded in a devenv because the
RPATH is not added to the plugin dylib. This RPATH will be stripped on
install, which is what we want.

When deploying apps, people are supposed to use `macdeployqt` to
create an AppBundle that bundles Qt for you and sets the RPATHs
correctly to point to that bundled Qt.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4776>
2023-06-06 13:38:19 +05:30
Piotr Brzeziński f44a18ee97 pngdec: Fix 16bit RGB images display
Due to the alpha value being inserted with _BEFORE, we were ending up
with ARGB instead of RGBA, thus displaying completely wrong colours.
According to libpng's manual, "to add an opaque alpha channel, use filler=0xff
or 0xffff and PNG_FILLER_AFTER which will generate RGBA pixels".

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4759>
2023-06-02 10:51:17 +01:00
Matthew Waters 08b4a943ff qt/glrenderer: don't attempt to use QWindow from non-Qt main thread
Use QObject::deleteLater() to schedule deletion in the main thread.

Remove the moveToThread of the QWindow.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4744>
2023-05-31 11:20:04 +01:00
Michael Olbrich 9f169ffaf9 flvmux: use the correct timestamp to calculate wait times
Since c0bf793c05 ("flvmux: Set PTS based on
running time") the timestamp of the output buffer is already in running
time. So using that for 'srcpad->segment.position' does not work correctly
because gst_aggregator_simple_get_next_time() will convert it again with
gst_segment_to_running_time().
This means that the timestamp returned by
gst_aggregator_simple_get_next_time() may be incorrect. For example, if
flvmux is added to a already runinng pipeline then the timestamp is too
small and gst_aggregator_wait_and_check() returns immediately. As a result,
buffers may be muxed in the wrong order.

To fix this, use the PTS of the incoming buffer instead of the outgoing
buffer. Also add the duration as get_next_time() is supposed to return the
timestamp of the next buffer, not the current one.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4734>
2023-05-30 00:52:01 +01:00
Michael Olbrich c83f24b038 jpegdec: be stricter when detecting interlaced video
There are broken(?) mjpeg videos that are incorrectly detected as
interlaced. This happens because 'info.height > height' (e.g. 1088 > 1080).

In the interlaced case info.height is approximately 'height * 2' but not
exactly because height is a multiple of DCTSIZE. Make the check more
restrictive but take the rounding effect into account.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4717>
2023-05-26 01:04:02 +01:00
Michael Olbrich b4330c730b jpegdec: decode the correct number of lines for interlaced frames
For interlaced jpeg, gst_jpeg_dec_decode_direct() is called twice, once for each
field. In this case, stride[n] is plane_stride[n] * 2 to ensure that only every
other line is written. So the loop must stop at height / num_fields.

If the frame is really interlaced then continuing beyound this, is not harmful,
because jpeg_read_raw_data() will do nothing and return 0, so am info message is
printed.

However, if the frame is not actually interlaced, just misdetected as interlaced
then there is still data available from the second half of the frame. Now
line[0][j] is set to the scratch buffer. If the scratch buffer is not allocated
(because the height is a multiple of v_samp[0] * DCTSIZE) then the result is a
segfault due to a null-pointer dereference.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4717>
2023-05-26 01:04:02 +01:00
YURI FEDOSEEV c8416a3b5c v4l2videoenc: support force keyframe event in v4l2 encoder
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4702>
2023-05-24 22:37:18 +00:00