Commit graph

116436 commits

Author SHA1 Message Date
Sebastian Dröge
518ecba8f9 subparse: Look for the closing > of a tag after the opening <
Previously when fixing up subrip markip, we were looking from the start
of the remaining buffer instead. Due to how skipping over closing tags
works, the remaining buffer will still contain the closing `>` of the
previous tag so if a unexpected closing tag is found after another
closing tag, we would potentially do an out of bounds memmove().

Fixes ZDI-CAN-20968
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2662

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4898>
2023-06-20 09:23:07 +00:00
Sebastian Dröge
7bcd791fab tags: Don't allow image tags with G_MAXUINT32 length
This will cause an integer overflow a little bit further down because we
allocate a bit more memory to allow for a NUL-terminator.

The caller should've avoided passing that much data in already as it's
not going to be a valid image and there's likely not even that much data
available.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4897>
2023-06-20 09:16:37 +01: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
Andoni Morales Alastruey
6c238ee44b vtenc: remove duplicated framerate and size variables
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4888>
2023-06-19 11:17:36 +01:00
Andoni Morales Alastruey
01d999342f vtenc: apply DTS offset to ensure DTS <= PTS
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4888>
2023-06-19 11:17:36 +01:00
Nicolas Dufresne
49106eab5d h265parse: Don't override upstream framerate
The framerate should only be replaced (and corrected for alternating field)
when it is parsed from the bitstream. Otherwise, the upstream framerate
from caps should be trusted and assumed correct.

Related to gst-plugins-bad!2020

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4352>
2023-06-16 08:18:49 +00:00
Nicolas Dufresne
77cda4b6b8 h265parse: Rename parsed_framerate to framerate_from_caps
That meaning of parsed_framerate is ambigious, it is set whenever the
framerate has been parsed from caps, which can be confused with being
parsed from the bitstream. Rename this as framerate_from_caps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4352>
2023-06-16 08:18:49 +00:00
Mengkejiergeli Ba
43e4f3a727 h265parse: Fix to check returned value
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4352>
2023-06-16 08:18:49 +00:00
Nicolas Dufresne
8dc62faae1 medias: Bump the medias commit
See !4259

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4352>
2023-06-16 08:18:49 +00:00
Michael Olbrich
0fe375dc84 sdpdemux: ensure that only one srcpad is created per stream
If two senders use the same multicast IP and port then new_session_pad()
may try to add a srcpad to the same stream twice.

stream->srcpad is updated but gst_element_add_pad() fails the second
time. As a result stream->srcpad points to a deleted object and
access in gst_sdp_demux_stream_free() fails with a segfault.

Just ignore the second pad. Nothing useful can be done with it anyway.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4873>
2023-06-16 01:53:12 +00:00
Marek Vasut
94f2a9cb2b kmssink: Add ST STM32 LTDC auto-detection
Add STM32 LTDC controller into list of auto-detected modules.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4872>
2023-06-16 00:54:40 +00:00
Marek Vasut
b52ab27a74 kmssink: Add NXP i.MX8M Plus LCDIFv3 auto-detection
Add i.MX8M Plus LCDIFv3 controller into list of auto-detected modules.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4872>
2023-06-16 00:54:40 +00:00
Víctor Manuel Jáquez Leal
1baabfdfea vaapidecodebin: don't load vaapipostproc if not available
And remove the code for missing element since that element is part of the same
plugin, and if not available is because the driver doesn't provide it.

Fixes: #2580
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4871>
2023-06-16 00:35:38 +00:00
He Junyan
a848621480 va: h265enc: map the mbbrc to correct enum value in get_property()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4870>
2023-06-15 23:36:35 +00:00
He Junyan
a610c0c316 va: h264enc: map the mbbrc to correct enum value in get_property()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4870>
2023-06-15 23:36:35 +00: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
François Laignel
3eb78e5280 srtpdec: fix Got data flow before segment event
A race condition can occur in `srtpdec` during the READY -> NULL transition:
an RTCP buffer can make its way to `gst_srtp_dec_chain` while the element is
partially stopped, resulting in the following critical warning:

> Got data flow before segment event

The problematic sequence is the following:

1. An RTCP buffer is being handled by the chain function for the
   `rtcp_sinkpad`. Since, this is the first buffer, we try pushing the sticky
   events to `rtcp_srcpad`.
2. At the same moment, the element is being transitioned from PAUSED to READY.
3. While checking and pushing the sticky events for `rtcp_srcpad`, we reach the
   Segment event. For this, we try to get it from the "otherpad", in this case
   `rtp_srcpad`. In the problematic case, `rtp_srcpad` has already been
   deactivated so its sticky events have been cleared. We won't be pushing any
   Segment event to `rtcp_srcpad`.
4. We return to the chain function for `rtcp_sinkpad` and try pushing the
   buffer to `rtcp_srcpad` for which deactivation hasn't started yet, hence the
   "Got data flow before segment event".

This commit:

- Adds a boolean return value to `gst_srtp_dec_push_early_events`: in case the
  Segment event can't be retrieved, `gst_srtp_dec_chain` can return  an error
  instead of calling `gst_pad_push`.
- Replaces the obsolete `gst_pad_set_caps` with `gst_pad_push_event`. The
  additional preconditions checked by previous function are guaranteed here
  since we push a fixed Caps which was built in the same function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4860>
2023-06-15 12:04:39 +00:00
François Laignel
9103fc3493 srtpdec: backport for fix assertion 'parent->numsinkpads <= 1' failed
Commit 96450f4c uses the new function `gst_element_decorate_stream_id` which
was introduced by 39633967 in 1.23.

This commit backports 96450f4c with a simplified version of
`gst_element_decorate_stream_id_internal` as a private srtpdec function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4860>
2023-06-15 12:04:39 +00:00
Seungha Yang
68dfea6349 d3dvideosink: Fix navigation event leak
Fixing regression introduced in 6c2f6c3bd4

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4868>
2023-06-15 10:39:32 +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
5e73738a35 subprojects: bump orc to 0.4.34
Has important fixes for Windows and macOS.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4866>
2023-06-15 10:14:55 +01:00
Elliot Chen
b9f3ce1f3d typefindhelper: avoid printing error log
some plugins such as wavparse may need find if type of media
contained in the given data and will print error log if there
is no matching factory.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4859>
2023-06-14 14:45:35 +01:00
Tim-Philipp Müller
61bef370e0 asfmux: fix potentially unaligned write on 32-bit ARM
Fixes #2665

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4855>
2023-06-14 09:12:15 +01: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
Haihua Hu
4ab685c2a3 glfilter: add parent meta to output buffer for input buffer
glfilter will unref input buffer after _transform() call immidiately,
but gpu may still reading input buffer for rendering because gl
api is executed async. Need hold reference for input buffer by
adding parent meta to output buffer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4846>
2023-06-13 12:34:57 +01:00
Xavier Claessens
b226b62ae3 opus: Fix crash when getting unexpected channel position
gst_opus_channel_names is a static array with only 13 items.
GstAudioChannelPosition have bigger values than that.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4843>
2023-06-13 09:23:59 +01:00
Sebastian Dröge
06586fd92f ptp: Correctly parse clock ID from the commandline parameters in the helper
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2652

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4813>
2023-06-12 11:29:25 +00:00
William Manley
da06637e4e basetextoverlay: Fix typo in "text-y" property description
Looks like a copy and paste error.

Co-authored-by: Fabian Orccon <cfoch.fabian@gmail.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4827>
2023-06-10 23:48:39 +01:00
Kevin Song
e8f9bd1649 appsink: unref gstbuffer in prev sample early
Appsink will unref prev sample in dispose function. Which is later
when V4L2 video decoder link with appsink as V4L2 video decoder
will close V4L2 device fd during GST_STATE_CHANGE_READY_TO_NULL.
If the video buffer return to V4L2 video decoder after the decoder
closed V4L2 device fd, V4L2 can't release the video frame buffer
which allocated with MMAP mode as application can't call
VIDIOC_REQBUFS 0 to release the video frame buffer by V4L2 driver.
The memory of the video frame will leak.
Unref the gstbuffer in stop() function, so V4L2 video decoder
can received all video frame buffers and release it before close
V4L2 device fd.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4820>
2023-06-09 15:58:49 +01:00
Seungha Yang
cdc502f524 filesink: Fix buffered mode writing
Fixing miscalculated buffer index when a buffer holds multiple
memories and it's not aligned to the vector size 16

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4817>
2023-06-09 13:45:16 +01:00
Matthew Waters
2f2eef88cb gldownload: handle passthrough without a critical
With passthrough mode, gldownload/glbasefilter may not ever retrieve a
relevant GstGLContext as it doesn't actually query the surrounding
elements.  Guard against that.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4800>
2023-06-08 19:46:56 +00: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
Seungha Yang
21b18cc905 tests: basesink: Add STREAM-START after EOS test
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4797>
2023-06-07 18:08:33 +00:00
Seungha Yang
93264a5aa8 basesink: Clear EOS flag on STREAM-START event
EOS -> STREAM-START -> new data flow is valid scenario

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4797>
2023-06-07 18:08:33 +00:00
Sebastian Dröge
dd9e34b5e0 decklink: Implement Windows string conversion with common API between MinGW and MSVC
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4786>
2023-06-07 05:46:12 +00:00
Sebastian Dröge
04460bff0d decklink: Add some newlines in long defines
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4786>
2023-06-07 05:46:12 +00:00
Maksym Khomenko
06587a61a1 decklink: Calculate string size before malloc
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4786>
2023-06-07 05:46:12 +00:00
Sebastian Dröge
6ee351a1ac decklink: Use the macOS version of the SDK on macOS and not the Linux one
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4786>
2023-06-07 05:46:12 +00:00
Sebastian Dröge
13104117fa decklink: Free SDK strings after usage on Linux
While they're const char* they still need to be freed like on Windows
and macOS and would be leaked otherwise.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4786>
2023-06-07 05:46:12 +00:00
Sebastian Dröge
52e3d54bde decklink: Correctly handle SDK strings on macOS
They're CFStringRef* and not plain NUL-terminated char* C strings.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4786>
2023-06-07 05:46:12 +00: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
Nirbheek Chauhan
364a3001e2 docs: Use backticks to escape * in markdown
Otherwise it's interpreted as emphasis.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4763>
2023-06-02 23:42:41 +00:00