Commit graph

1096 commits

Author SHA1 Message Date
Edward Hervey 39f62862d8 decodebin3: Ensure we get a collection for parsed inputs
When we are dealing with parsed inputs (i.e. using identity), we need to ensure
that we have a valid stream collection (and therefore DBCollection) before
anything flows dowsntream.

In those cases, we hold onto those events until we get such a collection.

Fixes #3356

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:17 +00:00
Edward Hervey daa022b9ee decodebin3: New mechanism for handling collection and selections
This commit separates collection and selections into a new separate structure:
DecodebinCollection.

This provides a much cleaner/saner way of dealing with collections being
updated, gapless playback, etc...

There is now a list of DecodebinCollection in flight, of which two are special:
* input_collection, the currently inputted/merged collection
* output_collection, the currently active collection on the output of multiqueue

Handling GST_EVENT_SELECT_STREAMS is split, by looking for the collection to
which it applies. And the requested streams are stored in it. IIF that
collection is output_collection we can do the switch, else it will be updated
when it becomes active.

Detecting which collection/selection is active is done by looking at the
GST_EVENT_STREAM_START on the output of the multiqueue.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:17 +00:00
Edward Hervey c4b625a3fe decodebin3: minor refactoring to identify selected stream
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:17 +00:00
Edward Hervey bfb64f7f44 decodebin3: Debug line cleanups
Use identifiable items in log lines instead of random pointers

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:17 +00:00
Edward Hervey 39f2d96105 decodebin: Remove unused includes
* config.h is not used, plugin/element is registered in another file
* play-enum.h is not used

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:17 +00:00
Edward Hervey 48cbb1c96f decodebin3: Remove un-needed variable
We don't do anything with the unknown streams. Detecting that a list of
requested streams don't apply to a given collection should be handled
before-hand

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:17 +00:00
Edward Hervey 3acb219b76 decodebin3: Remove un-needed variable
pending_select_streams was only set just before releasing/taking the selection
lock in a single place. That temporary lock release is not needed and therefore
the variable isn't needed either

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:17 +00:00
Edward Hervey 1ab0936196 decodebin3: Remove active_selection list
It's a duplicate of the list of slots which have an output. Use that instead.

Also when we fail to (re)configure an output, remove it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:17 +00:00
Edward Hervey ec468e9524 decodebin3: Cache slot stream_id and rename more variables
* Move the handling of GST_EVENT_STREAM_START on a slot to a separate function

* There was a lot of usage of `gst_stream_get_stream_id()` for the slot
active_stream. Cache that instead of constantly querying it.

* Rename the variables in `handle_stream_switch()` to be clearer

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:16 +00:00
Edward Hervey 49cd8213bf decodebin3: Refactor slot/output (re)configuration
* Re-use existing function where possible
* Only set/reset keyframe probe at unique places

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:16 +00:00
Edward Hervey faaedd2bb9 decodebin3: Refactor linking input to slot
The same sequence of calls was done when doing that

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:16 +00:00
Edward Hervey a96c761ed7 decodebin3: input_unblock_streams: Clarify variable
It's a list of pads, not slots

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:16 +00:00
Edward Hervey ceeea8afd6 decodebin3: Rename multiqueue related functions
To make clear on what they apply

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:16 +00:00
Edward Hervey fc96e29606 decodebin3: Refactor/rename slot/output
* Centralize associating an output to a slot in one function, including properly
  resetting those fields
* Rename functions to be more explicit
* Move code to "reset" an output stream into a dedicated function (will be used
later)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:16 +00:00
Edward Hervey 1185a560c2 decodebin3: Refactor removal of slot/output from streaming thread
The code was identical in several places

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:16 +00:00
Edward Hervey b825b3547c decodebin3: rename/clarify eos and draining usage around multiqueue
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:16 +00:00
Edward Hervey f7207c24ff decodebin3: Document/refactor DecodebinInput handling
* Rename the function names to be clearer, with prefixes
* Pass the input (or stream) directly where appropriate
* Document usage, inputs, ownership
* Rename variables for clarity where applicable
* Avoid double lock/unlock if callee can handle it directly

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:16 +00:00
Edward Hervey 8fd4502ebc decodebin3: Move gstdecodebin3-parse.c into gstdecodebin3.c
Makes it easier to work with LSP

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:16 +00:00
Edward Hervey aeea856f4e decodebin3: Refactor incoming collection handling
Simplify its usage by having it directly create the message if the collection
changed. This is what caller were always doing and avoids releasing selection
locks yet-another-time

Also use it in more places to avoid code repetition

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:16 +00:00
Edward Hervey 17e385a6ff decodebin3: Rename variable for clarity
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:16 +00:00
Edward Hervey c0c62388a3 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/6774>
2024-05-28 08:31:16 +00:00
Edward Hervey dadaa33749 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/6774>
2024-05-28 08:31:15 +00:00
Guillaume Desmottes 0b17b17a8a basetextoverlay: use GST_DEBUG_OBJECT instead of GST_DEBUG
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6918>
2024-05-27 08:36:17 +02:00
Hou Qi d1c81cbd79 glcolorconvert: traverse all structures in caps when transform_caps
This is used to avoid negotiation failure between glcolorconvert
and downstream element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6908>
2024-05-24 14:49:41 +09:00
Matthew Waters 0f8b599ded glcolorconvert: handle rectangle textures for v210/UYVY/YUY2
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6795>
2024-05-23 04:42:07 +00:00
Matthew Waters 4c27a2d5eb glcolorconvert: add support for v210->UYVY/YUY2 (and reverse)
Also support YUY2/UYVY->YUY2/UYVY conversion

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6795>
2024-05-23 04:42:06 +00:00
Matthew Waters f6d3aca076 glcolorconvert: add support for UYVY/YUY2->planar yuv (and reverse)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6795>
2024-05-23 04:42:06 +00:00
Matthew Waters 8dac641889 glcolorconvert: add support for v210->planar YUV (and reverse)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6795>
2024-05-23 04:42:06 +00:00
Matthew Waters 96939db249 glcolorconvert: add support for converting to/from v210
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6795>
2024-05-23 04:42:06 +00:00
Matthew Waters b0b185112d glmemory: use the GL stride calculation also for downloading into sysmem
Allows writing into sysmem with arbitrary strides.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6795>
2024-05-23 04:42:06 +00:00
Joshua Breeden bf97b2fe56 videotestsrc: add mutex around cache buffer to prevent race condition
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6849>
2024-05-21 12:14:59 +00:00
Yacine Bandou 03febb5048 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/6763>
2024-05-20 20:31:11 +00:00
Sebastian Dröge 0f342da7f6 subparse: Don't unref seek event twice if forwarding it directly failed
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6882>
2024-05-20 16:16:06 +00:00
Thibault Saunier 5be3f255b0 encoding-profile: Add a way to specify a factory-name when specifying caps
In some cases you want to ensure that a specific element factory is used
while requiring some specific caps but this was not possible. You can
now do `qtmux:video/x-prores,variant=standard|factory-name=avenc_prores_ks`
to ensure that the `avenc_prores_ks` factory is used to produce the
'standard' variant of prores video stream.

This also enhances a bit the documentation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6875>
2024-05-17 22:46:52 +00:00
Edward Hervey afc1eadfdc streamsynchronizer: Split up event handler code
No changes to behaviour, just split up the big parts into dedicated function for
readability

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6825>
2024-05-17 13:13:41 +00:00
Seungha Yang b01305f60c decodebin3: Fix caps and stream leaks
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6858>
2024-05-16 10:46:33 +00:00
Sebastian Dröge 8ea355e52c audioringbuffer: Avoid overflows of segment done counter
This counter is incremented once for every segment, meaning it would
e.g. overflow after 24 days when using 1ms segments. Once that happens,
completely wrong positions are reported and invalid memory is handed out
for writing/reading the next segments.

As the affected variables are unfortunately part of the public API of
the struct, a second set of variables is added together with accessor
functions and both variables are kept in sync for backwards
compatibility.

All existing users of the two variables are moved to the new ones but
external code might still run into the overflow.

This also slightly breaks API as external code updating the variables
will have no effect anymore but the only known user of this is
pulsesink.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6740>
2024-05-16 06:52:58 +00:00
Sebastian Dröge 63d58fcebf audioconvert: Add test for 96 channel conversion
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6819>
2024-05-12 07:06:32 +00:00
Sebastian Dröge 399b147d90 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/6819>
2024-05-12 07:06:32 +00:00
Bill Nottingham 5d7d3c6c0f 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/6800>
2024-05-07 14:48:47 +00:00
Sebastian Dröge 0ef396359c gst: Move GstQueueArray as GstVecDeque to core
And change lengths and indices from guint to gsize for a more correct type.

Also deprecate GstQueueArray and implement it in terms of GstVecDeque.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6779>
2024-05-06 18:25:42 +00:00
Rafael Caricio 6fd1900d54 pbutils: AV1 mime codec
Add basic AV1 mime codec param generation based on the spec at https://aomediacodec.github.io/av1-isobmff/#codecsparam

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6696>
2024-05-06 12:43:27 +00:00
Philippe Normand 1c87cda56d glcolorconvert: Fix caps negotiation with upstream DMABuf
The uninitialized texture target was leading to a NULL texture-target string
added to the output caps.

Fixes #3519

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6805>
2024-05-05 17:48:32 +01:00
Thibault Saunier 41f8276c2b glvideomixer: Handle pads which have no caps set on mouse events
And directly use the pad vinfo instead of getting current caps

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6265>
2024-05-05 12:37:05 +00:00
Seungha Yang c8d01d7d1a video: Add Y216 and Y416 formats
The same memory layout as Y212 and Y412 formats, respectively

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6745>
2024-05-03 17:02:34 +00:00
Loïc Le Page d5734159d1 videorate: add validate tests
Add tests with different reverse playback speeds.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6247>
2024-05-01 20:12:01 +00:00
Sebastian Dröge ec42cedf63 encoding-profile: Fix nullability of (de)serialization functions
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6775>
2024-05-01 09:51:35 +00:00
Matthew Waters 184d94305c glcolorconvert: add support for planar yuv->planar yuv conversions
Currently only supported by keeping the same colorimetry and is only
a repacking operation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6596>
2024-04-30 05:58:55 +00:00
Matthew Waters 674e643428 glcolorconvert: use color matrices
Allows programatically supporting whatever new formats are added to
libgstvideo.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6596>
2024-04-30 05:58:55 +00:00
Sebastian Dröge e68eccff10 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/6766>
2024-04-29 20:06:22 +00:00