Commit graph

6759 commits

Author SHA1 Message Date
Seungha Yang
e6c19a7922 d3d11converter: Fix runtime compiled shader code
Restore mistakenly deleted code in a previous MR
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6803

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7138>
2024-07-09 09:54:43 +00:00
Sebastian Dröge
b19a687437 typefind: Add typefinders for formats that were previously available via ffmpeg
Co-Authored-By: Matthew Waters <matthew@centricular.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7148>
2024-07-08 16:25:32 +00:00
Sebastian Dröge
4f0fc8a42c avvidenc: Make sure to pass always increasing PTS to the encoder
All MPEG1/2/4-based encoders at least are ignoring input frames if
backwards PTS or PTS that are equal to the previous one are passed in.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7148>
2024-07-08 16:25:32 +00:00
Sebastian Dröge
963e15f920 avviddec: Only use 2 ticks per frame if decoding interlaced video
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7148>
2024-07-08 16:25:32 +00:00
Sebastian Dröge
20485320e5 avvidenc: Set the DTS to 0 if it is negative, not the PTS
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7148>
2024-07-08 16:25:32 +00:00
Sebastian Dröge
fa49369c46 avvidenc: Only use 2 ticks per frame if encoding interlaced video
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3518

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7148>
2024-07-08 16:25:32 +00:00
Sebastian Dröge
fcbb1fa5f1 avmux: Reset input context to NULL after closing in the muxer
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7148>
2024-07-08 16:25:32 +00:00
Sebastian Dröge
d3935f0974 avdemux: Fix leak of demuxer input context in error cases
Also simplify context lifetime management a bit.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7148>
2024-07-08 16:25:32 +00:00
Sebastian Dröge
d871f34b39 libav: Update AVCodecContext lifetime to work properly with ffmpeg 7
avcodec_close() is deprecated and it's not supported anymore to re-open
a codec, so we only ever allocate the codec in set_format() now and
always free it after usage.

As part of this, also fix various memory leaks in related code paths.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7148>
2024-07-08 16:25:32 +00:00
Edward Hervey
bbf21060c2 avviddec: Rename variables and fuse function
* gst_ffmpegviddec_frame() is the only caller of gst_ffmpegviddec_video_frame()
  and has the same signature. Just move the checks into a single function and
  use that.
* Make it clear which frames are the input and output ones in
  gst_ffmpegviddec_video_frame() to make issues like the one fixed in the previous
  commit more obvious.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7148>
2024-07-08 16:25:32 +00:00
Sebastian Dröge
2cdaa79da6 libav: Fix signature of avprotocol write function for ffmpeg 7
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7148>
2024-07-08 16:25:31 +00:00
Sebastian Dröge
bd7b5b166d avdemux: Remove typefinder implementation
Direct access to AVInputFormat::read_probe() is not possible anymore
with ffmpeg 7.0, and the usefulness of this typefinder seems limited
anyway. An alternative implementation around av_probe_input_format3() or
similar would be possible but it would be going over all possible ffmpeg
probes at once.

Having a typefinder here means that basically every application will
load the gst-libav plugin when typefinding is necessary, which has
unnecessary performance impacts. If a typefinder from here was indeed
missing from typefindfunctions in gst-plugins-base then it would be
better to add it there directly.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7148>
2024-07-08 16:25:31 +00:00
Ruben Gonzalez
c5b4ad429d vkh265dec: Fix H.264 ref in logs
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7147>
2024-07-08 17:34:07 +02:00
Nirbheek Chauhan
a9fec8f638 meson: Fix invalid include flag in uninstalled gl pc file
${libdir}/gstreamer-1.0/include is only valid after installation, but
extra_cflags are added unconditionally, so we can't use that for
include flags.

Instead, let's add the include flag via variables, which are different
for installed and uninstalled pc files.

This is particularly bad for consuming GStreamer via CMake which barfs
on non-existent include paths.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7143>
2024-07-05 18:43:27 +01:00
Taruntej Kanakamalla
0ae0efb623 lc3: remove bitstream comparison in the tests
since the encoded output is changing based on version
it does not make sense to check the output bitstream with a fixed
bytearray since the version in the target might vary. So sticking
to checking the number of output buffers and encoded frame size
similar to the other tests

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7142>
2024-07-05 17:14:46 +01:00
Tim-Philipp Müller
0dfdbf49da subprojects: update liblc3 wrap to 1.1.1
See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6407#note_2472538

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7135>
2024-07-04 11:22:59 +01:00
Tim-Philipp Müller
764543d3a5 info: remove unused valgrind header include
Follow-up to commit a2cbf75523.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7129>
2024-07-03 12:22:18 +01:00
Tim-Philipp Müller
24de7cf1fe subparse: remove regex optimized flag explicitly
That way the other flags in jit_flags are not touched and
flags changes in future only need to be done in one place.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7129>
2024-07-03 12:22:18 +01:00
Tim-Philipp Müller
051b8b6dbb gst-plugins-base: put valgrind header availability define into config.h for subparse
Make the valgrind header avaibility accessible to any code in
gst-plugins-base, currently it was only signalled to unit tests.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7129>
2024-07-03 12:22:18 +01:00
Chris Spoelstra
63196c2ae7 srtsrc: fix case fallthrough of authentication param
Add missing breaks to two case statements.
Also adds a missing lock of srtobject->element when getting the value
of PROP_AUTHENTICATION.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7127>
2024-07-02 17:07:24 +01:00
Edward Hervey
bad0daeb8f subparse: Don't use jitted regex when used with valgrind
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7124>
2024-07-02 11:04:01 +00:00
Edward Hervey
869b122e6b gstreamer/gst-tester: Don't leak thread
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7123>
2024-07-02 10:10:45 +01:00
Edward Hervey
a8cf222cd0 gst-inspect: Fix leak of plugin/feature
Reordering changes the initial list head

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7123>
2024-07-02 10:10:45 +01:00
Edward Hervey
00903e36cb encoding-target: Chain up to parent class
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7123>
2024-07-02 10:10:45 +01:00
Edward Hervey
02607432e3 encoding-profile: Chain up to parent class finalize
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7123>
2024-07-02 10:10:45 +01:00
Shengqi Yu
c4fe9786ea v4l2object: use v4l2 reported width for padded_width when complex video formats
Stride means bytes per line, and padded_width means pixels. Here,
padded_width shoule be pix width reported by v4l2 instead of stride.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7122>
2024-07-01 20:44:02 +01:00
Edward Hervey
8435fb4805 nlecomposition: Don't leak atomic rc box
* gst_structure_get => increases ref
* query_ancestors_position: There are two refs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7120>
2024-07-01 14:31:23 +01:00
Edward Hervey
ef53d8c7b7 nlecomposition: Don't leak message
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7120>
2024-07-01 14:31:23 +01:00
Edward Hervey
2d38c289f6 ges-layer: Don't use invalid layers
There's a possibility that there are no layers at that priority

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7120>
2024-07-01 14:31:23 +01:00
Edward Hervey
1af999696e ges-discoverer-manager: Properly initialize/free GRecMutex
Fixes small leak of mutex internals

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7120>
2024-07-01 14:31:23 +01:00
Jordan Petridis
7057d7ce22 validate: Remove G_REGEX_OPTIMIZE usage
It's not needed and causes issues with valgrind (which doesn't support jit)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7113>
2024-06-28 17:31:14 +01:00
Guillaume Desmottes
83d736d6d9 rtmp2: guard against calling gst_amf_node_get_type() with NULL
gst_amf_node_get_type() raises a CRITICAL if called with a NULL node.
All callers were checking for this except those.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7110>
2024-06-28 10:25:37 +01:00
Jan Schmidt
5a25a00324 adaptivedemux: Fix handling closed caption streams
Fix a typo "CLOSED_CAPTION" -> "CLOSED-CAPTION" and
a broken if statement that always bailed out for
closed captions

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7105>
2024-06-26 15:58:20 +00:00
Jan Schmidt
48e2fb95e6 webrtcdsp: Enable multi_channel processing
Enable multi_channel processing in webrtc-audio-processing when the
input or output has multiple channels.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3220
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7104>
2024-06-26 16:13:04 +01:00
Piotr Brzeziński
67eae3cf31 vtenc: Fix redistribute latency spam
Just a quick fix to only report the maximum noticed delay (measured by frames inside the encoder) instead of changing
the reported latency every time the number there changes, which is way too often.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7098>
2024-06-25 09:49:56 +01:00
Seungha Yang
a593f2f71f d3d12converter: Make gamma remap work as intended
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7080>
2024-06-21 10:53:25 +01:00
Sebastian Dröge
95fdb4030f queue, queue2, multiqueue: Timestamps of gap events must be valid
This is checked in gst_event_new_gap() so doesn't have to be checked again here,
but simply can be asserted with a g_return_if_fail().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7075>
2024-06-20 19:32:14 +01:00
Sebastian Dröge
8e9b364d9b queue: queue2: multiqueue: Don't work with segment.position if buffers have no timestamps
If the first buffers have no timestamp then the sink position would be
initialized to 0. The source pad might output this buffer, which would then
initialize the source position to 0 too.

Afterwards two buffers with a valid but huge timestamp might arrive before any
of them are output on the source pad. The first one would set the sink position
to a huge value, the second one would notice that the difference between the
huge value and 0 is certainly larger than max-size-time and consider the queue
as full.

Instead, simply don't update the times from buffers without timestamps and
assume whatever was set before is still valid, i.e. the buffer has the same
timestamp as the previous one.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7075>
2024-06-20 19:32:14 +01:00
Edward Hervey
6615af3f5f decodebin3: Fix keyframe drop probe handling
We were storing the probe id in a different structure (DecodebinOutputStream)
than the pad it is targetting (which is in MultiQueueSlot).

The problem is that when re-targetting outputs (to a different slot)... we would
end up having an invalid probe id, or not have a reference to an existing one.

Instead, store the probe id in the same structure as the pad it's targetting

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7074>
2024-06-20 15:15:54 +01:00
Edward Hervey
455ca1326b decodebin3: Fix detection of selection done
We should not assert if there are still some old streams that are waiting to be
deactivated.

Instead wait for them to be gone before posting the selection done message

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7074>
2024-06-20 15:15:54 +01:00
Tim-Philipp Müller
a58953cbf6 Back to development after 1.24.5 2024-06-20 13:02:19 +01:00
Tim-Philipp Müller
3c66f10e21 Release 1.24.5 2024-06-20 12:54:15 +01:00
Tim-Philipp Müller
f6af34d3be rtpdtmfsrc: minor logging clean-up
Only serialise event structure for debug logging purposes
if logging is actually enabled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7062>
2024-06-19 10:11:28 +01:00
Tim-Philipp Müller
02447fa0b2 rtpdtmfsrc: fix leak when shutting down mid-event
.. and update rtpdtmfdepay unit test to trigger
the potential leak more reliably (without the fix).

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7062>
2024-06-19 10:11:28 +01:00
Sebastian Dröge
460b883003 video-info: Don't crash in gst_video_info_is_equal() if one videoinfo is zero-initialized
Instead handle it like gst_audio_info_is_equal() and consider both different.
And also add a shortcut for the pointers to both infos being equal.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7059>
2024-06-18 20:11:13 +01:00
Edward Hervey
ef5fe0b33b tsdemux: Fix maximum PCR/DTS values
* PTS/DTS are stored as 33 bit
* PCR is 33bit multiplied by 300

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7058>
2024-06-18 19:03:31 +01:00
He Junyan
aa5092dabf av1parse: Do not return error when expectedFrameId mismatch
According to the SPEC:
  The frame id numbers (represented in display_frame_id, current_frame_id,
  and RefFrameId[ i ]) are not needed by the decoding process, but allow
  decoders to spot when frames have been missed and take an appropriate action.

So we should just print out warning and should not return error in parser when
mismatching. The decoder itself is already robust to handle the reference missing.

Fixes #3622

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7052>
2024-06-18 11:04:43 +01:00
Tim-Philipp Müller
fe2525f9d3 rtpdtmfdepay: add unit test for caps fixation issue with downstream audioconvert
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7048>
2024-06-18 01:22:26 +01:00
Tim-Philipp Müller
e47895dbd2 rtpdtmfdepay: fix caps negotiation with audioconvert
Specify "layout" field in src template to make sure it's
set and gets fixated properly if the downstream element
supports both interleaved and non-interleaved caps.

Fixes

  gst_pad_set_caps: assertion 'caps != NULL && gst_caps_is_fixed (caps)' failed

critical with e.g.

  gst-launch-1.0 rtpdtmfsrc ! rtpdtmfdepay ! audioconvert ! fakesink

Not that the layout really matters in our case since we always
output mono anyway, but non-interleaved requires adding AudioMeta,
so this is the easiest fix.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7048>
2024-06-18 01:22:26 +01:00
Piotr Brzeziński
691ee34729 vtdec: Use GST_VIDEO_DECODER_ERROR instead of aborting when frame has an ERROR flag
This was already being used in handle_frame() for errors that happen when queueing a frame for decoding,
let's do the same when a frame is flagged with an error in the output callback.
From quick testing, this makes seeking more reliable (previously, it would sometimes cause a decoding error
and shut the whole decoder down due to GST_FLOW_ERROR).

Also manually sets the max error count to actually stop processing if too many errors occur.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7044>
2024-06-17 14:53:08 +01:00
Piotr Brzeziński
a0b35d86f9 vtdec: Handle some errors without stopping the decoder
ReferenceMissingErr is not critical and the simplest solution is to just ignore it. The frame has
the FrameDropped flag set when it occurs, so we can just drop it as usual.
BadDataErr is also not immediately critical, but in its case let's set the ERROR flag,
so the output loop can use GST_VIDEO_DECODER_ERROR to count and error out if it happens too many times.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7044>
2024-06-17 14:53:08 +01:00
Sebastian Dröge
a9beac80da av1dec: Don't treat decoding errors as fatal and print more error details
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7041>
2024-06-17 11:03:51 +01:00
Zach van Rijn
af8a090201 pcapparse: Avoid unaligned memory access
Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3602
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7037>
2024-06-14 18:55:20 +01:00
Mathieu Duponchelle
2015d56a41 rtspsrc: fix invalid seqnum assertions
Upon fatal errors the loop function will first post an error message
then push out an EOS event.

An application may react immediately to the error message by setting the
state of the pipeline to NULL, meaning by the time we push out the EOS
event PAUSED_TO_READY may have reset the seek seqnum to -1.

While this is harmless, the assertion when setting an invalid seqnum
isn't tidy, fix this by simply not resetting to INVALID as it serves no
practical purpose and the next READY_TO_PAUSED will select a new seqnum
anyway.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7034>
2024-06-14 11:02:12 +00:00
Mathieu Duponchelle
bb726c7eef codectimestamper: never set DTS to NONE
If we want to avoid the DTS going backward, then we can set DTS to
last_dts as a last resort.

Log a warning in this case

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7033>
2024-06-14 10:45:02 +01:00
Jakub Vaněk
f4852a2d8b v4l2src: Interpret V4L2 report of sync loss as video signal loss
Certain V4L2 drivers can report that a video receiver is seeing
some signal, but that it is unable to synchronize to it. IOW: the driver
can sometimes report V4L2_IN_ST_NO_SYNC and not report V4L2_IN_ST_NO_SIGNAL.

In particular, I've seen the tc358743 (HDMI-to-CSI2 converter) driver
sometimes report this when deployed to a fleet of embedded Raspberry Pis.
The relevant kernel code is in [1]. The video output is not practically
usable when V4L2_IN_ST_NO_SYNC is reported (only visually corrupted frames,
sometimes with random "snow", are received). I assume that this happens when
either the HDMI cable is poorly plugged in or damaged or when a CSI2 FFC
cable is used and is damaged.

The change in this commit is useful for detecting this working-but-not-really
condition in application code. Applications already listening for the "Signal lost"
message will gain the ability to handle this condition.

There seem to be more V4L2 error flags like this, see [2]. However, I do not
have practical experience with them and adding only V4L2_IN_ST_NO_SYNC seems
like a safer option.

[1]: https://github.com/raspberrypi/linux/blob/be8498ee21aa/drivers/media/i2c/tc358743.c#L1534
[2]: https://www.kernel.org/doc/html/v6.6/userspace-api/media/v4l/vidioc-enuminput.html

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7027>
2024-06-13 09:30:51 +00:00
Khem Raj
3e319081f5 uvcgadget: Use g_path_get_basename instead of libc basename
Musl does not implement GNU basename and have fixed a bug where the
prototype was leaked into string.h [1], which resullts in compile errors
with GCC-14 and Clang-17+

| sys/uvcgadget/configfs.c:262:21: error: call to undeclared function 'basename'
ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
|   262 |     const char *v = basename (globbuf.gl_pathv[i]);
|       |                     ^

Use glib function instead makes it portable across musl and glibc on
linux

[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7a

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7028>
2024-06-13 01:18:29 +01:00
Sebastian Dröge
9a26c25211 av1enc: Handle force-keyunit events properly by requesting keyframes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7022>
2024-06-12 12:56:49 +01:00
Edward Hervey
2b79de8fc1 uridecodebin3: Don't hold PLAY_ITEMS lock when activating them
Once the item is configured it can be activated without holding that lock

Fixes #3610

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7020>
2024-06-11 19:19:38 +01:00
Edward Hervey
c1ec23a75e decodebin3: Always ensure we end up with parsebin or identity
This fixes a regression introduced by 6c4f52ea20

There are cases where the input stream will be push-based, time-segment and not
have a collection nor caps. This means the event-based checks are not sufficient
to decide when/where to plug in a identity or parsebin to process the input.

For those corner cases we setup a buffer probe to ensure we always end up with
at least a parsebin

Fixes #3609

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7018>
2024-06-11 17:20:57 +01:00
Seungha Yang
9380f313c3 d3d12videosink: Disconnect window signal handler on dispose as intended
Fixing typo

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7014>
2024-06-11 10:14:33 +01:00
Edward Hervey
d2fc7232e6 decodebin3: Avoid usage of parsebin even more
When dealing with push-based inputs, we are now delaying the creation of
parsebin/identity until we get all pre-buffer events.

We therefore can simplify the handling of new pads being linked and only have to
check if upstream can handle pull-based or not.

Avoids creating parsebin for parsed upstream data altogether

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6995>
2024-06-06 13:07:14 +00:00
Edward Hervey
175a3d17ba 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/7002>
2024-06-06 12:59:25 +01:00
Edward Hervey
230d0bf978 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/7002>
2024-06-06 12:59:25 +01:00
Edward Hervey
abb2a46787 decodebin3: minor refactoring to identify selected stream
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7002>
2024-06-06 12:59:25 +01:00
Edward Hervey
3dbb9fbb39 decodebin3: Debug line cleanups
Use identifiable items in log lines instead of random pointers

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7002>
2024-06-06 12:59:25 +01:00
Edward Hervey
3014faaa2e 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/7002>
2024-06-06 12:59:25 +01:00
Edward Hervey
ccef8e18fd 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/7002>
2024-06-06 12:59:25 +01:00
Edward Hervey
b6e94cb779 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/7002>
2024-06-06 12:59:25 +01:00
Edward Hervey
33ee6c7d03 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/7002>
2024-06-06 12:59:25 +01:00
Edward Hervey
6d5d41b677 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/7002>
2024-06-06 12:59:25 +01:00
Edward Hervey
1fe3898904 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/7002>
2024-06-06 12:59:25 +01:00
Edward Hervey
bf24f813d5 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/7002>
2024-06-06 12:59:25 +01:00
Edward Hervey
400b93e957 decodebin3: input_unblock_streams: Clarify variable
It's a list of pads, not slots

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7002>
2024-06-06 12:59:25 +01:00
Edward Hervey
e18006f6da decodebin3: Rename multiqueue related functions
To make clear on what they apply

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7002>
2024-06-06 12:59:25 +01:00
Edward Hervey
d6e2de985a 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/7002>
2024-06-06 12:59:25 +01:00
Edward Hervey
13407a11d6 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/7002>
2024-06-06 12:59:25 +01:00
Edward Hervey
b6263febe0 decodebin3: rename/clarify eos and draining usage around multiqueue
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7002>
2024-06-06 12:59:25 +01:00
Edward Hervey
8794918607 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/7002>
2024-06-06 12:59:25 +01:00
Edward Hervey
a166cc6aea 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/7002>
2024-06-06 12:59:25 +01:00
Edward Hervey
f168005e28 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/7002>
2024-06-06 12:59:24 +01:00
Edward Hervey
12427d4119 decodebin3: Rename variable for clarity
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7002>
2024-06-06 12:59:24 +01:00
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
Edward Hervey
38bae910ad gstpromise: Don't use g_return_* for internal checks
If assertion/checks are disabled bad things will happen and the function won't
return as expected

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6998>
2024-06-06 09:07:54 +00:00
Corentin Damman
d81f7579fa gstqsg6material: fix RGB format support
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6997>
2024-06-05 23:53:01 +01:00
Sebastian Dröge
300a8141e8 dtlssrtpenc: Don't crash if no pad name is provided when requesting a new pad
It is mandatory to provide a valid pad name for dtlssrtpenc.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6994>
2024-06-05 10:10:03 +01:00
Sebastian Dröge
cd4d040672 rtspsrc: Only update from the Content-Base header in the initial OPTION / DESCRIBE response
Some servers send a new content base in the SETUP response, which is
just the non-aggregate control URL of the individual streams.

See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3563

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6982>
2024-06-01 16:15:53 +03:00
Sebastian Dröge
d263a8d2fe rtspsrc: Handle the case of * as session-wide control URL from the SDP
Just like the comment above says this is supposed to indicate that the
same URL should be used as for the connection so far. If encountering
this case simply do nothing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6982>
2024-06-01 16:15:53 +03:00
Sebastian Dröge
6f984939c4 rtspsrc: Also handle rtsps:// and similar URLs as absolute in other places
Previously a direct comparison with `rtsp://` was performed, which
didn't catch cases like `rtsps://`.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6982>
2024-06-01 16:15:53 +03:00
Sebastian Dröge
dfc03b9a2e rtspsrc: Don't try the SETUP workaround for broken servers with absolute control URIs
Previously only control URIs that started with "rtsp://" were ignored
but it makes more sense to ignore all absolute URIs.

gst_uri_is_valid() conveniently checks for exactly that.

See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3563

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6982>
2024-06-01 16:15:53 +03:00
Martin Nordholts
03b6efcaf5 gst_debug: Add missing gst_debug_log_id_literal() dummy with gst_debug=false
E.g. gst_debug_log_literal() already has a dummy variant.
gst_debug_log_id_literal() is simply missing, which can
cause link errors for project using gstreamer with
gst_debug=false.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6979>
2024-06-01 11:52:32 +03:00
Samuel Thibault
8447c1d386 ptp-helper: Add GNU/Hurd support
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6974>
2024-05-31 11:16:12 +03:00
Seungha Yang
5118e657b6 d3d12memory: Fix staging buffer alignment
Not all GPUs can support arbitrary offset of
D3D12_PLACED_SUBRESOURCE_FOOTPRINT when copying GPU memory between
texture and buffer. Instead of calculating size/offset per plane,
calculate the entire size and offsets at once.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6973>
2024-05-30 16:47:35 +03: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
Edward Hervey
48f63a9c64 hlsdemux2: Minor refactoring of starting segment check
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6961>
2024-05-30 07:59:25 +00:00
Edward Hervey
421832e506 hlsdemux2: Be more tolerant when matching segments with PDT
Some servers might not provide 100% matching PDT when doing updates, or accross
variants. This would cause the code matching segments using PDT to fail if the
segment PDT was 1 microsecond (or whatever small value) before the candidate
segment. And would pick the (wrong) following segment as the matching one.

In order to be more tolerant when matching, we instead check whether the
candidate segment is within the first segment of the segment we are trying to
match.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6961>
2024-05-30 07:59:25 +00:00
Edward Hervey
e7ab454cf5 hlsdemux2: Fix failure to find a replacement segment on resync
If we end up with a segment with an internal time that varies from the supposed
one, this could be for two reasons:
* We guess-timated the wrong segment to go to when advancing or switching
  variants. In that case we try to find the actual segment to go to (just before
  this change).
* There was a complete playlist change (for whatever reason) and we can't find a
  replacement. In that case we want to carry on playback from this position but
  need to remember that we moved (by setting the stream to DISCONT, and
  resetting the new mapping).

Fixes playback on several broken stream

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6961>
2024-05-30 07:59:25 +00:00
Edward Hervey
12e8874f88 hlsdemux2: Refactor update of GstHLSTimeMap values
This was also missing transferring the PDT if present

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6961>
2024-05-30 07:59:25 +00:00
Edward Hervey
e9214e9afc hlsdemux2: Fix parsing of EXT-X-DISCONTINUITY-SEQUENCE:0
Since the default value of `m3u8->discont_sequence` (before parsing of the
playlist data) was 0 .. we would never properly detect the presence of that
field if it was present with a value of 0.

This would later on cause havoc in playlist synchronization where we would
assume it didn't have a discontinuity sequence specified (whereas it did, and it
was 0).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6961>
2024-05-30 07:59:25 +00:00