Commit graph

1050 commits

Author SHA1 Message Date
Edward Hervey
18fbe14ac8 decodebin3: Refactor GST_EVENT_SELECT_STREAMS handling
* The same code is used for the event, regardless of whether it's coming from
via a pad or directly on the element
* The pending_select_streams list content was never used, switch it to a boolean

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7002>
2024-06-06 12:59:24 +01:00
Edward Hervey
dd01275e00 decodebin3: Don't forward select streams if we are handling it
Since the introduction of the "SELECTABLE" query, the usage of selection was
clarified. We don't need to forward the GST_EVENT_SELECT_STREAMS at this point.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7002>
2024-06-06 12:59:24 +01:00
Jakub Adam
c305fe7a35 glcolorconvert: update existing sync meta if outbuf has one
Instead of always adding a new one, which means the buffer could end up
with multiple sync meta instances.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6962>
2024-05-30 08:35:17 +00:00
Tim-Philipp Müller
03cfca1033 Back to development after 1.24.4 2024-05-29 13:51:27 +03:00
Tim-Philipp Müller
9137f539a0 Release 1.24.4 2024-05-29 13:44:50 +03:00
Sebastian Dröge
3d9fd9926c typefind: Fix handling of ID_ODD_SIZE in WavPack typefinder
Chunks are always starting on an even position and this flag only
specifies that the last byte of the chunk is not valid.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6944>
2024-05-28 17:47:22 +03:00
Yacine Bandou
1b191d1d8d streamsynchronizer: Fix deadlock when streams have been flushed before others start
To simplify the description, I'm assuming we only have two streams: video and audio.

For the video stream, we have the following events :
- STREAM_START => stream->wait set to true
- NEW_SEGMENT(1) => blocked waiting in gst_stream_synchronizer_wait
- FLUSH_START => unblocked
- FLUSH_STOP => stream->wait reset to false
- NEW_SEGMENT(2) => not waiting, since stream->wait is false

Then for the audio stream, we have the following events :
- STREAM_START => stream->wait set to true
- NEW_SEGMENT(2) => blocked waiting in gst_stream_synchronizer_wait for ever.

Note: The first NEW_SEGMENT event and the FLUSH_START, FLUSH_STOP events of the audio stream
are dropped before being received by the streamsynchronizer element, because the decodebin audio pad src
is not yet linked to the playsink audio pad sink.

To fix this deadlock, we don't reset stream->wait to false in the FLUSH_STOP event when it is not
waiting for the EOS of the other streams.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6887>
2024-05-23 17:51:02 +01:00
Joshua Breeden
d5f3b77e50 videotestsrc: add mutex around cache buffer to prevent race condition
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6889>
2024-05-21 14:48:14 +01:00
Seungha Yang
329ba08665 decodebin3: Fix caps and stream leaks
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6866>
2024-05-16 12:49:16 +01:00
Sebastian Dröge
8e3b2121bb audioconvert: Add test for 96 channel conversion
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6828>
2024-05-12 11:06:15 +01:00
Sebastian Dröge
d05a8516a7 audioconvert: Support converting >64 channels
There's nothing requiring <= 64 channels except for getting the reorder
map and creating a channel mixing matrix, but those won't be possible to
call anyway as channel positions can only express up to 64 channels.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6828>
2024-05-12 11:06:15 +01:00
Bill Nottingham
59dfc54b61 pbutils: fix visualization plugins
inbuf is persistent, GST_BUFFER_COPY_MEMORY's append behavior is
not what we want.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6814>
2024-05-07 18:52:00 +01:00
Shengqi Yu
f74bdaf4d5 glmixer: Add GL_SYNC_META option to bufferpool
when pipline is
glvideomixerelement->glcolorconvertelement->gldownloadelement and
glcolorconvertelement is not passthrough, the gl bufferpool between
glvideomixerelement and glcolorconvertelement will not add gl sync meta
during allocating buffer. This will cause that glcolorconvert's inbuf
has no sync meta to wait for.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6784>
2024-04-30 18:07:45 +01:00
Tim-Philipp Müller
204ba57e81 Back to development after 1.24.3
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6772>
2024-04-30 00:36:59 +01:00
Tim-Philipp Müller
da69285863 Release 1.24.3 2024-04-30 00:15:23 +01:00
Sebastian Dröge
e33578a3c2 exiftag: Prevent integer overflows and out of bounds reads when handling undefined tags
Fixes ZDI-CAN-23896
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3483

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6768>
2024-04-29 19:54:45 +01:00
Edward Hervey
7a0e52bb15 playbin3: Handle combiner update in case of errors
The assertion that was present before is a bit too harsh, since there is now
a (understandable) use-case where this could happen.

In gapless use-case, with two files containing the same type (ex:audio). The
first one *does* expose a collection with an audio stream, but decoding
fails (for whatever reason).

That would cause us to have configured a audio combiner, which was never
used (i.e. not active).

Then the second file plays and we (wrongly) assume it should be activated
... whereas the combiner was indeed present.

Demote the assertion to a warning and properly handle it

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6742>
2024-04-26 13:28:06 +00:00
Edward Hervey
b02f41441c decodebin3: Remove custom stream-start field if present
This field is added by urisourcebin so that we can avoid double-parsing. It's no
longer needed after.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6716>
2024-04-23 11:17:32 +01:00
Edward Hervey
ec2af45402 urisourcebin2: Adaptive demuxers don't require another parsebin
By setting the same field on the GST_EVENT_STREAM_START decodebin3 will be able
to avoid plugging in an extra parsebin

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6716>
2024-04-23 11:17:32 +01:00
F. Duncanh
cc6648e102 ximagesink: initialize mask for XISelectEvents
Fixes #3470

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6654>
2024-04-16 12:35:37 +00:00
Matthew Waters
ac2d95eb49 glcolorconvert: don't overread the end of an array
Reverse index iteration needs a - 1 for the initial value.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6605>
2024-04-10 18:39:37 +01:00
Matthew Waters
1c37913e32 glcolorconvert: remove unused swizzling using "rgba" chars
We use indices now instead.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6605>
2024-04-10 18:39:37 +01:00
Edward Hervey
6302931e70 parsebin: Ensure non-time subtitle streams get "parsed"
Since https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6153 ,
subtitle "decoders" (i.e. which decode to raw text) are no longer auto-plugged
by parsebin.

But if a given format does not have a parser at all, we would end up outputting
non-time/non-parsed outputs.

In order to mitigate the issue, until such parsers are available, we check if
the subtitle stream is in TIME format or not (i.e. whether it comes from a
parser or demuxer). If not, we attempt to plug in a subtitle "decoder".

Fixes #3463

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6597>
2024-04-10 09:59:58 +01:00
Tim-Philipp Müller
934af761fd Back to development after 1.24.2 2024-04-10 00:15:42 +01:00
Tim-Philipp Müller
2d82731515 Release 1.24.2 2024-04-09 21:48:55 +01:00
Sebastian Dröge
ef72daea70 typefind: Handle WavPack block sizes > 131072
These are valid nowadays.

Also handle ID_ODD_SIZE and ID_WVX_NEW_BITSTREAM. The parser already
handles the former but not the latter.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6541>
2024-04-04 17:33:48 +01:00
Sebastian Dröge
22315a435d pbutils: descriptions: Don't warn on MPEG-1 audio caps without layer field
While this is not ideal and won't give too accurate codec descriptions,
it is what tsdemux produces.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6538>
2024-04-04 12:45:54 +01:00
Matthew Waters
d556c02aa8 glcaopengllayer: NULL some fields when freed
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6524>
2024-04-03 10:28:08 +01:00
Matthew Waters
6f0ad951c3 glwindow/cocoa: keep a window reference across an async callback
Esnures that the window is alive when the callback is fired.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6524>
2024-04-03 10:28:08 +01:00
Matthew Waters
651ccd0175 glimagesink: avoid a possible critical on shutdown
It is possible that the close callback can be called after glimagesink
is changing state to NULL.  Protect against that by taking the glimagesink
lock and some NULL checking.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6524>
2024-04-03 10:28:08 +01:00
Matthew Waters
0bf962dbdf glimagesink: unref the potential last ref outside of the glimagesink lock
Avoids a deadlock between the state change removing the last ref and
the destructer calling the window's on_close handler and trying to
take the glimagesink lock.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6524>
2024-04-03 10:28:08 +01:00
Matthew Waters
e5b4f09172 glbufferpool: protect release_buffer from multiple concurrent access
If two different threads attempt to release buffers at the same time, then the
keep-alive-slightly-longer GQueue may become corrupted.  Guard against that with
some locking.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6524>
2024-04-03 10:28:08 +01:00
Matthew Waters
9cedabae5a gl/context/cocoa: ensure pixel format lives as long as the context
Under some circumstances, the CGLPixelFormatObj was being destroyed too
early which could lead to potential use-after-frees.

Fix by returning a reference when asked for the pixel format.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3154
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6524>
2024-04-03 10:28:08 +01:00
Xavier Claessens
e47f9e8f87 videorate: Reset last_ts when a new segment is received
This fix all buffers being droped when a new segment is received and
average-period property is set.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6522>
2024-04-03 00:33:15 +01:00
Chao Guo
25dc99f81f glcolorconvert: Ensure glcolorconvert does not miss supported RGB formats
Add RGB16 and other RGB formats to rgb_formats to ensure glcolorconvert
does not miss the RGB formats it supports

Signed-off-by: Chao Guo <chao.guo@nxp.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6517>
2024-04-02 19:30:00 +01:00
Hou Qi
1dc3fe831c encodebin: Add the parser before timestamper to tosync list
Also need to sync the state of the parser before timestamper with
parent.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6486>
2024-03-29 19:45:23 +00:00
Tim-Philipp Müller
175d116f94 Back to development 2024-03-22 01:38:06 +01:00
Tim-Philipp Müller
0d0a1d9d16 Release 1.24.1 2024-03-21 21:47:53 +01:00
Edward Hervey
f8d8c6795d uridecodebin3: Don't hold lock when posting messages or signals
There's a very good chance that the receiver might react on those synchronously
and call back into uridecodebin3 (ex: for setting the next URI).

Make sure we release the lock if we need to do that.

Fixes #3400

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6403>
2024-03-19 12:02:27 +01:00
Edward Hervey
c8f42ab3af uridecodebin3: Handle potential double redirection errors
Some elements (like qtdemux) might post a redirection error message twice. We
only want to handle it once.

Fixes #3390

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6394>
2024-03-18 15:52:08 +01:00
Tim-Philipp Müller
93255efece Revert "audiobasesink: Don't wait on gap events"
This reverts commit 8e923a8e2d.

This caused regressions, see #3303.

Without this commit, osxaudiosrc ! osxaudiosink won't work
right, but since that hasn't really been a huge problem
for years it's probably best to revert this until a proper
solution can be figured out.



(cherry picked from commit f04f86f3ee)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6384>
2024-03-17 03:18:54 +00:00
Edward Hervey
80cd85d03d decodebin3: Post error messages if there are no streams to output
This could happen because:
* No streams were selected
* Or we end up with no stream selected

Also post a warning message if we are missing plugins but there are other
streams to output

Fixes #3360

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6377>
2024-03-15 00:12:28 +00:00
Edward Hervey
2d875b5ed2 decodebin3: Remove failing stream from active selection also
It gets added in get_output_slot()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6377>
2024-03-15 00:12:28 +00:00
Thomas Klausner
8ca53a1a67 shmallocator: fix build on Illumos
Closes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3370

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6362>
2024-03-13 20:09:44 +00:00
Piotr Brzeziński
07e1f13e2c audiovisualizer: Don't wrap temporary memory in buffers
Avoids potentially ending up with the buffermemory pointing to already-freed or reused addresses.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6339>
2024-03-13 12:36:28 +00:00
Piotr Brzeziński
eff6167d2d audioencoder: Avoid wrapping temporarily mapped memory with a GstBuffer and passing that to subclass
Memory from gst_adapter_map() could live shorter than the GstMemory that the GstBuffer wraps around it, which in lucky
cases 'just' caused a re-use of the same memory for multiple (potentially still in use!) input buffers, but could easily
end up pointing to an already-freed memory.

Manifested when an AudioToolbox encoder kept getting silence inserted in seemingly random circumstances, turned out
to be the memory being re-used by GStreamer at the same time that the AT API was processing it...

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6339>
2024-03-13 12:36:28 +00:00
Nicolas Dufresne
8c850dba9e glupload: Do not propose allocators with sysmem
None of the GL allocators actually offer a generic alloc() implementation. As a
side effect, they cannot be offered as they don't work with generic video
buffer pool.

Our specialized buffer pool can be dropped by tee or alphacombine as sharing the
same buffer pool over two branch is not supported by the pool API.

Fixes #3372

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6350>
2024-03-13 03:10:20 +00:00
Edward Hervey
48e0c6218d playbin3: Remove un-needed URI NULL check
This will mimic the playbin2 behaviour, which sets the "next" entry to be
NULL.

The biggest impact this has is that when going back to READY the current play
entry will be discarded (instead of being kept around for when you go back to
PAUSED/PLAYING).

Fixes #3371

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6338>
2024-03-12 14:16:34 +00:00
Edward Hervey
d89da0f5c4 decodebin3: Handle race switching on pending streams
find_slot_for_stream_id() will return a slot which has the request stream-id as
active_stream *or* pending_stream (i.e. the slot on which that stream is
currently being outputted or will be outputted).

When figuring out which slot to use (if any) we want to consider stream-id
which *will* appear on a given slot which isn't outputting anything yet the same
way as if we didn't find a slot yet.

Fixes races when doing intensive state changes

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6332>
2024-03-11 20:20:19 +00:00
Edward Hervey
31feb293c7 decodebin3: Clear select streams seqnum when resetting
At this point there's definitely no pending select streams

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6332>
2024-03-11 20:20:19 +00:00