Commit graph

1284 commits

Author SHA1 Message Date
Max Romanov
477d330dee appsrc: Decrease log level for item drop
Leaky appsrc feature was implemented similar to queue. Dropping item
is a normal case because it is configured so. Warning messages
is too severe for this event.

Level changed to DEBUG just like in queue.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8147>
2024-12-13 17:24:44 +00:00
Dean Zhang (张安迪)
58696d57f9 videodecoder: set decode only flag by decode only buffer
This is used for optimize frame drop issue. Some video streams such as av1
contains decode-only frames. These frames are handled by decoder but not show
by display, which will cause input frame count unmatch the output frame count.
After collecting more decoder only frame, it will cause error report "so many
frame droped". So attach the flag GST_BUFFER_FLAG_DECODE_ONLY with the input
buffer, the v4l2videodecoder can further handle the decode-only buffer in
output list.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8142>
2024-12-13 13:14:01 +00:00
Edward Hervey
2d92a2ee54 urisourcebin: Only rewrite stream-start event once
If the custom field is already present, we don't want to rewrite the event
again. Otherwise it would cause downstream into believing that a *new*
stream-start event has arrived ... which isn't the case.

Fixes #4097

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8132>
2024-12-13 09:42:01 +00:00
Guillaume Desmottes
a29591978b gl: raise WARNING instead of ERROR when no connector is connected
This is a valid and working use case when rendering on a headless
server.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8136>
2024-12-12 10:43:26 +01:00
Tim-Philipp Müller
7d793d8836 meson: unset GST_TRACERS for g-ir-scanner to avoid warnings
People might have GST_TRACERS=leaks set in their environment
by default, which will now trigger criticals during the build
when calling g-ir-scanner, because we unset GST_PLUGIN_SYSTEM_PATH
so that the scanner doesn't load any plugins.

Fixes #4093

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8121>
2024-12-10 23:07:06 +00:00
Edward Hervey
18d83192be uridecodebin3: Don't use decodebin3 static sink pad
Makes the code leaner, and fixes the issue which would happen when the
urisourcebin stream that was linked to the sink pad goes away (without any
replacement).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7949>
2024-12-10 08:47:43 +00:00
Edward Hervey
eb24c0eabc decodebin3: Make usage of static sink pad optional
There is no reason why we should mandate people to "at least" use the static
sink pad. This caused issues, like mandating that it should always have valid
content linked to it (problematic in case of upstream stream changes).

Instead we only use it if it's actually linked to, in which case it gets added
to the list of inputs.

This actually simplifies the code too.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7949>
2024-12-10 08:47:43 +00:00
Edward Hervey
93e432bccb urisourcebin: Fix issue re-using outputs
When checking whether a no-longer used output could be re-used for another slot,
we only want to do that for streams which are not still used.

Otherwise we end up potentially re-assigning a demuxer stream to a completely
different one

Furthermore, if we *are* re-using an output slot, indicate what the replacement
GstStream will be so slot matching can work properly (which can happen in the
case of demuxers which add/remove all pads even if only a single one changed)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7949>
2024-12-10 08:47:43 +00:00
Nicolas Dufresne
6b6fb4c8b8 build: gl: Properly add sub-package to gst_libraries
GstGLEGL/Wayland/X11/Viv was actually never written into any of the gir_targets,
as a side effect, their gir was never copied into girs/ and not used to generate
the documentation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8061>
2024-12-05 15:42:54 -05:00
Cheung Yik Pang
acc1309cdf video: fix AV12 format lacking the GST_VIDEO_FORMAT_FLAG_ALPHA flag
The GST_VIDEO_FORMAT_FLAG_ALPHA indicates whether a video format has an
alpha channel.  AV12 does have an alpha plane.  Switching from
MAKE_YUV_FORMAT to MAKE_YUVA_FORMAT to generate GST_VIDEO_FORMAT_AV12.

Fixes #4081

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8067>
2024-12-05 10:07:54 +00:00
Edward Hervey
abb11ad8b4 urisourcebin: Fix collection leak
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8080>
2024-12-05 09:22:00 +01:00
Guillaume Desmottes
082a8fcd5e h264parse: parse unregistered SEI without user data
We get loads of warnings when parsing videos from users:

gsth264parser.c:1115:gst_h264_parser_parse_user_data_unregistered: No more remaining payload data to store
gsth264parse.c:646:gst_h264_parse_process_sei:<h264parse0> failed to parse one or more SEI message

Those are raised because of unregistered SEI without user data.

The spec does not explicitly state that unregistered SEI needs to have
data and I suppose the UUID by itself can carry valuable information.
FFmpeg also parses and exposes such SEI so there is no reason for us no
too as well.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7931>
2024-12-04 13:56:13 +00:00
Sebastian Dröge
5093691ef2 vorbisdec: Set at most 64 channels to NONE position
Thanks to Antonio Morales for finding and reporting the issue.

Fixes GHSL-2024-115
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3869

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8035>
2024-12-03 14:30:41 +00:00
Sebastian Dröge
4c40f73b70 subparse: Check for NULL return of strchr() when parsing LRC subtitles
Thanks to Antonio Morales for finding and reporting the issue.

Fixes GHSL-2024-263
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3892

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8039>
2024-12-03 13:13:40 +00:00
Sebastian Dröge
403b10eba0 ssaparse: Don't use strstr() on strings that are potentially not NULL-terminated
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8036>
2024-12-03 12:03:49 +00:00
Sebastian Dröge
15bb318416 ssaparse: Search for closing brace after opening brace
Otherwise removing anything between the braces leads to out of bound writes if
there is a closing brace before the first opening brace.

Thanks to Antonio Morales for finding and reporting the issue.

Fixes GHSL-2024-228
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3870

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8036>
2024-12-03 12:03:49 +00:00
Sebastian Dröge
aa07d94c10 discoverer: Don't print channel layout for more than 64 channels
64+ channels are always unpositioned / unknown layout.

Thanks to Antonio Morales for finding and reporting the issue.

Fixes GHSL-2024-248
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3864

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8034>
2024-12-03 10:33:22 +00:00
Mathieu Duponchelle
e633ec6428 oggstream: review and fix per-format min_packet_size
This addresses all manually detected invalid reads in setup functions.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8038>
2024-12-03 08:59:25 +00:00
Mathieu Duponchelle
006047a23a vorbis_parse: check writes to GstOggStream.vorbis_mode_sizes
Thanks to Antonio Morales for finding and reporting the issue.

Fixes GHSL-2024-117 Fixes gstreamer#3875

Also perform out-of-bounds check for accesses to op->packet

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8038>
2024-12-03 08:59:25 +00:00
Sebastian Dröge
2838374d6e opusdec: Set at most 64 channels to NONE position
Thanks to Antonio Morales for finding and reporting the issue.

Fixes GHSL-2024-116
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3871

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8037>
2024-12-03 08:09:09 +00:00
Sebastian Dröge
537161868f id3v2: Don't try parsing extended header if not enough data is available
Thanks to Antonio Morales for finding and reporting the issue.

Fixes GHSL-2024-235
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3842

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8033>
2024-12-03 03:29:34 +00:00
Jakub Adam
2209d4382f gldownload: warn on fallback from DMABuf to system memory
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8013>
2024-12-02 20:25:37 +00:00
Xavier Claessens
fa57d776d8 videorate: convert next_ts to new segment instead of restarting from 0
When receiving a new segment we should not restart PTS from the new
segment' start. Instead convert current position into the new segment if
possible.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7977>
2024-12-02 15:45:20 +00:00
Xavier Claessens
bfc4812bbe audiorate: convert next_ts to new segment instead of restarting from 0
When receiving a new segment we should not restart PTS from the new
segment' start. Instead convert current position into the new segment if
possible.

Fixes: #4060
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7977>
2024-12-02 15:45:20 +00:00
Xavier Claessens
0d8bdaaf17 audiorate: Always push updated segment
Convert segment to TIME format immediately instead of waiting for
_chain() to be called. This fixes converted segment never being pushed
downstream.

Fix the convert function that was copying some fields in the wrong
direction. Add fast copy if segment is already in TIME format.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7977>
2024-12-02 15:45:20 +00:00
Philippe Normand
c683cdc914 rtp: Fix precision loss in gst_rtcp_ntp_to_unix()
Without this patch the UNIX timestamp resulting from the translation from NTP
would be off by one nano-second.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8010>
2024-12-02 10:24:01 +00:00
Sebastian Dröge
f7aac1cc07 rtsp: Fix off-by-one in month/day-of-the-week array
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8017>
2024-12-01 09:49:29 +00:00
Edward Hervey
acf1efbf8d gl: Add missing Since marker
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8001>
2024-11-29 08:44:30 +00:00
Philipp Zabel
c024c5e3bf gstgldmabufbufferpool: use gsteglimagecache
Store the imported GstEGLImage in a GstEGLImageCache. Since this passes
ownership to the cache, stop unreffing the images from the GstMemory.
Free the cache when the buffer pool is stopped.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6792>
2024-11-28 15:25:28 -05:00
Philipp Zabel
f18d6fcb40 glupload/egl: Extract EGL image cache and make it public
Extract the EGLImage cache from gstglupload.c, place it in a separate
source file gsteglimagecache.c, and make the API public, so it can be
reused by the gldownload element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6792>
2024-11-28 15:25:28 -05:00
Nicolas Dufresne
a18f1af1a4 gldownload: Implement importing RGBA with modifiers
For single plane RGBA based formats, implement support for modifiers.
This fixes issues where linear is actually configured in GL causing
visual artifacts.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6792>
2024-11-28 15:25:28 -05:00
Jakub Adam
b7970a4d95 gldownload: enumerate emulated video formats
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6792>
2024-11-28 15:25:28 -05:00
Jakub Adam
1ef9f6ab26 glcontext/egl: Fix use of uninitialized memory
At least some Mesa drivers (see llvmpipe_query_dmabuf_modifiers()) don't
initialize the provided external_only array, so some format/modifier
combinations could get incorrectly marked as only external.

Make sure we zerofill the array before passing it to
eglQueryDmaBufModifiersEXT().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6792>
2024-11-28 15:25:28 -05:00
Nicolas Dufresne
5b55930db8 gldmabufbufferpool: allow the dmabuf_pool configuration to change
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6792>
2024-11-28 15:25:27 -05:00
Jakub Adam
533d115659 downloadelement: support dma_drm caps in try_export_dmabuf
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6792>
2024-11-28 15:25:27 -05:00
Jakub Adam
188b626ffc gldownload: import DMABufs from downstream pool
* if downstream provides us with a pool that can allocate DMA buffers,
  gldownload wraps it into a GL buffer pool that uses
  glEGLImageTargetTexture2DOES() to import dmabuf into textures
* upstream GL elements can allocate from that pool
* gldownload unwraps DMA buffers from incoming GL buffers and passes
  them downstream

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6792>
2024-11-28 15:25:27 -05:00
Jakub Adam
270e186311 glcontext_egl: add method to check if format supports a modifier
Makes _check_modifier from glupload reusable.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6792>
2024-11-28 15:25:27 -05:00
Jakub Adam
d80477d769 glupload: make _dma_buf_transform_* functions public API
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6792>
2024-11-28 15:25:27 -05:00
Jakub Adam
57f36ed9d9 glupload: rename GstGLUploadDrmFormatFlags -> GstGLDrmFormatFlags
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6792>
2024-11-28 13:46:08 -05:00
Sebastian Dröge
05985247d1 streamsynchronizer: Only send GAP events out of source pads
If streamsynchronizer is waiting on the stream's sinkpad and srcpad at the same
time, it can happen that the GAP event is otherwise sent out of the sinkpad,
which is in the wrong direction.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7950>
2024-11-28 12:38:07 +00:00
Tim-Philipp Müller
13f2b7dd74 discoverer: fix build with older glib versions
Follow-up to !7969

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7988>
2024-11-28 11:40:38 +00:00
Sebastian Dröge
ccb40ca7d0 discoverer: Fix formatting of a debug log string
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7969>
2024-11-27 16:48:55 +00:00
Sebastian Dröge
27a2fa73bc discoverer: Move cache file tracking from GstDiscovererInfo into GstDiscoverer
It's only used temporarily during discovery and makes no sense as part of the
resulting info.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7969>
2024-11-27 16:48:55 +00:00
Sebastian Dröge
9e4c173c3c discoverer: Move stream counter from GstDiscovererInfo into GstDiscoverer
It's only used temporarily during discovery and makes no sense as part of the
resulting info.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7969>
2024-11-27 16:48:55 +00:00
Sebastian Dröge
dc3f2c6721 discoverer: Also copy missing element details when copying a GstDiscovererInfo
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7969>
2024-11-27 16:48:55 +00:00
Sebastian Dröge
d553448b95 discoverer: Make sure the missing elements details array is NULL-terminated in a thread-safe way
And also avoid a possible out-of-bounds read if the array contains no elements.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7969>
2024-11-27 16:48:55 +00:00
Tomáš Polomský
fa1ed5d210 appsink: fix timeout logic for gst_app_sink_try_pull_sample
In case of gst_app_sink_try_pull_object returns an object instead of a sample,
the whole process must be restarted with the reduced timeout, otherwise requested
timeout could be easily exceeded.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7962>
2024-11-27 11:09:47 +00:00
Edward Hervey
18b941dfd5 decodebin3: Unify collection switching checks
We only want to switch to a selection of an output collection if all streams are
present.

This was previously only done in one place (when triggering by new incoming
streams) but not when triggered by user/application.

Avoid this by moving the check to handle_stream_switch()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7941>
2024-11-25 08:03:38 +00:00
Andoni Morales Alastruey
7b408bae69 discoverer: fix segfault in race condition adding a new uri's
There is a race condition adding new uri's right after receiving
the `discovered` event. We must wait until we have cleaned-up
the last discovery to start processing the new one

Fix #3758

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7930>
2024-11-20 21:36:30 +00:00
Nirbheek Chauhan
c1a8ee9655 meson: Don't use libdrm_dep in cc.has_header()
It can't handle subproject dependencies. Pointed out in
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4033#note_2665974

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7927>
2024-11-20 17:47:01 +00:00