platform/upstream/gstreamer.git
18 months agopad: Fix sticky event ordering for instant-rate-change
Jan Schmidt [Fri, 11 Nov 2022 11:57:38 +0000 (22:57 +1100)]
pad: Fix sticky event ordering for instant-rate-change

The event type for instant-rate-change events was poorly chosen,
leading to them being re-sent too late and even after EOS.

Add a mechanism in GstPad for the sticky event order to be
different to the value of the event type to fix that up.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3387>

18 months agoav1decoder: Clear highest_spatial_layer per sequence header
Seungha Yang [Thu, 17 Nov 2022 17:06:51 +0000 (02:06 +0900)]
av1decoder: Clear highest_spatial_layer per sequence header

Clear the value to default zero, indicating that no spatial scalability
layer is used.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3430>

18 months agoav1decoder: Don't error out by dropped OBU
Seungha Yang [Thu, 17 Nov 2022 16:59:55 +0000 (01:59 +0900)]
av1decoder: Don't error out by dropped OBU

OBU can be dropped if the current layer is not in selected operation
point

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3430>

18 months agoav1decoder: Fix wrong spatial layer validation
Seungha Yang [Thu, 17 Nov 2022 16:49:43 +0000 (01:49 +0900)]
av1decoder: Fix wrong spatial layer validation

Highest spatial id and temporal id is independent, and should not drop
temporal enhance layer by the previous condition. Note that
the decision for dropping OBU based on operation point is being
handled in gst_av1_parser_identify_one_obu() already.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1585
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3430>

18 months agoav1parser: Don't print warning for expected OBU drop
Seungha Yang [Thu, 17 Nov 2022 16:43:26 +0000 (01:43 +0900)]
av1parser: Don't print warning for expected OBU drop

Dropping an OBU which is not in selected operation point is an
expected condition.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3430>

18 months agoav1parser: Remove impossible condition
Seungha Yang [Thu, 17 Nov 2022 16:41:33 +0000 (01:41 +0900)]
av1parser: Remove impossible condition

unsigned integer cannot be negative

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3430>

18 months agofakesrc: avoid time overflow with datarate
Célestin Marot [Fri, 18 Nov 2022 15:57:16 +0000 (16:57 +0100)]
fakesrc: avoid time overflow with datarate

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3433>

18 months agowebrtcbin: Remove queue after rtpfunnel
Jan Schmidt [Sat, 19 Nov 2022 08:22:17 +0000 (19:22 +1100)]
webrtcbin: Remove queue after rtpfunnel

The original BUNDLE support commit placed a queue after the
rtpfunnel that combines streams, but I don't see a good reason for
it. It has default settings, so if network output is slow might
accidentally store up to 1 second of pending data, increasing
latency.

Remove it in favour of doing any necessary buffering before
webrtcbin. If it turns out that there is a reason for it to
exist, the limits should probably be configurable and small.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3437>

18 months agoexamples/sendrecv: Remove extra unref of webrtcbin
Jan Schmidt [Sat, 19 Nov 2022 08:50:38 +0000 (19:50 +1100)]
examples/sendrecv: Remove extra unref of webrtcbin

The code now constructs webrtcbin with a floating ref and then
gives it to the pipeline. The extra unref is one too many.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3436>

18 months agortpbasedepayload: Drop redundant reference timestamp buffer meta in RTP depayloaders
Matt Crane [Wed, 16 Nov 2022 16:47:54 +0000 (11:47 -0500)]
rtpbasedepayload: Drop redundant reference timestamp buffer meta in RTP depayloaders

Currently, when rtspsrc property add-reference-timestamp-metadata=true,
a downstream rtph264depay element will attach multiple copies of the
same GstReferenceTimestampMeta to the depayloaded media buffers. This
can have signficant performance impacts further downstream in a pipeline
like the following:

    rtspsrc add-reference-timestamp-metadata=true ! rtph264depay ! h264parse ! ... ! rtph264pay ! ...

For example, if there are 10 packet buffers for a frame of RTP H.264
video, each of those packet buffers will contain the same reference
timestamp meta. The rtph264depay element will then attach all 10
metadata to the depayloaded frame. And then later when we payload the
frame buffer again for proxying, we now have 10 more buffers each with
10 instance of the same metadata. Allocating/deallocating 100+ instances
of metadata @ 30fps for multiple streams has a pretty large performance
impact.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3431>

18 months agowebrtc: Improve GstWebRTCStatsType docstring
Jan Schmidt [Fri, 18 Nov 2022 17:42:56 +0000 (04:42 +1100)]
webrtc: Improve GstWebRTCStatsType docstring

Fix a typo of peer-connectiion -> peer-connection

Add a link to the w3c RTCStats type for a description
of what each statistics type is.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3434>

18 months agowebrtcbin: Fix a typo in debug log
Jan Schmidt [Fri, 18 Nov 2022 17:42:20 +0000 (04:42 +1100)]
webrtcbin: Fix a typo in debug log

transceiever -> transceiver

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3434>

18 months agoexamples/webrtc: Configure payload types
Jan Schmidt [Fri, 18 Nov 2022 17:37:00 +0000 (04:37 +1100)]
examples/webrtc: Configure payload types

MR 2398 broke the webrtc sendrecv example
by not configuring the payload types, so both audio and video streams
get sent on payload 96.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3434>

18 months agoqsv: Promote encoder rank to PRIMARY on Windows
Seungha Yang [Sat, 12 Nov 2022 18:07:54 +0000 (03:07 +0900)]
qsv: Promote encoder rank to PRIMARY on Windows

QSV is very well integrated with GstD3D11 infrastructure on Windows,
and this is the recommended H/W encoder element over the MediaFoundation
plugins on Intel GPU system.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3393>

18 months agovideo-frame: Avoid using tile width
Nicolas Dufresne [Wed, 16 Nov 2022 20:17:24 +0000 (15:17 -0500)]
video-frame: Avoid using tile width

The tile width in pixel is not always available. Notably for
8L128 10bit format, the tile is 8x128 bytes, and the pixel
format is fully packed. That means that the tile contains at
least 6 pixels per line, but it also hold some bits of the
pixel from the same line on the previous or next tile.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3424>

18 months agovideo: Add arbitrary tile dimensions support
Nicolas Dufresne [Tue, 15 Nov 2022 18:50:13 +0000 (13:50 -0500)]
video: Add arbitrary tile dimensions support

In current tile representation, only tiles with power of two
width and height in bytes are supported. This limitation
prevents adding more complex tiles formats.

In this patch, we deprecate tile_ws and tile_hs from GstVideoFormatInfo and
replace if with an array of GstVideoTileInfo. Each plane tiles are then
described with their pixels width/height, line stride and total size.
The helper gst_video_format_info_get_tile_sizes() that depends on the
deprecated API is also being removed. This can simply be removed as it wasn't
in any stable release yet.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3424>

18 months agogst: serialization of GLibDateTime
Colin Kinloch [Thu, 1 Sep 2022 17:57:58 +0000 (18:57 +0100)]
gst: serialization of GLibDateTime

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2980>

18 months agoaggregator: Implement force_live API
Mathieu Duponchelle [Fri, 18 Nov 2022 13:24:30 +0000 (14:24 +0100)]
aggregator: Implement force_live API

Setting force_live lets aggregator behave as if it had at least one of
its sinks connected to a live source, which should let us get rid of the
fake live test source hack that is probably present in dozens of
applications by now.

+ Expose API for subclasses to set and get force_live
+ Expose force-live properties in GstVideoAggregator and GstAudioAggregator
+ Adds a simple test

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3008>

18 months agosplitmuxsink: Avoid assertion when WAITING_GOP_COLLECT on reference context
Vivia Nikolaidou [Fri, 9 Sep 2022 10:13:32 +0000 (13:13 +0300)]
splitmuxsink: Avoid assertion when WAITING_GOP_COLLECT on reference context

I have seen a backtrace out in the wild where this happened. Maybe after
receiving EOS and stream-start on the reference context.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3005>

18 months agowebrtcbin: Add settings for HTTP proxy
Johan Sternerup [Mon, 31 Aug 2020 12:04:54 +0000 (14:04 +0200)]
webrtcbin: Add settings for HTTP proxy

Pass this to libnice which has a simple HTTP 1.0 proxy with basic
authentication only.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2867>

18 months agotsdemux: Add pad-name to warning for continuity mismatch
Vivia Nikolaidou [Wed, 20 Oct 2021 10:02:31 +0000 (13:02 +0300)]
tsdemux: Add pad-name to warning for continuity mismatch

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3141>

18 months agodecodebin2: Minor debug fix for decodepad
Edward Hervey [Thu, 17 Nov 2022 14:41:35 +0000 (15:41 +0100)]
decodebin2: Minor debug fix for decodepad

decodedad might have their name changed when exposing, causing a race when
trying to get their name without taking a lock. Just use GST_PTR_POINTER in
debug statements instead

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3428>

18 months agoimagesequencesrc: Don't leak caps
Edward Hervey [Mon, 14 Nov 2022 12:53:02 +0000 (13:53 +0100)]
imagesequencesrc: Don't leak caps

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3428>

18 months agoges-launcher: Don't leak string
Edward Hervey [Wed, 16 Nov 2022 15:20:15 +0000 (16:20 +0100)]
ges-launcher: Don't leak string

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3428>

18 months agoges-demux: Don't leak string
Edward Hervey [Wed, 16 Nov 2022 15:19:52 +0000 (16:19 +0100)]
ges-demux: Don't leak string

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3428>

18 months agoges-xml-formatter: Plug some leaks
Edward Hervey [Wed, 16 Nov 2022 15:19:05 +0000 (16:19 +0100)]
ges-xml-formatter: Plug some leaks

* Don't leak the mainloop
* Don't leak temporary strings
* Don't leak id when searching in hash table

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3428>

18 months agoges-project: Don't leak string
Edward Hervey [Wed, 16 Nov 2022 15:18:19 +0000 (16:18 +0100)]
ges-project: Don't leak string

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3428>

18 months agoges-structure-parser: Don't leak failed strings
Edward Hervey [Wed, 16 Nov 2022 11:45:27 +0000 (12:45 +0100)]
ges-structure-parser: Don't leak failed strings

We pass the ownership of current_string to the list of wrong strings, it will be
cleared then.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3428>

18 months agoges-launch: Don't leak help string
Edward Hervey [Wed, 16 Nov 2022 11:44:56 +0000 (12:44 +0100)]
ges-launch: Don't leak help string

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3428>

18 months agovalidate: cleanup the use of GST_VALIDATE_API on Windows
Stéphane Cerveau [Thu, 17 Nov 2022 16:09:51 +0000 (16:09 +0000)]
validate:  cleanup the use of GST_VALIDATE_API on Windows

Export or import properly the method from GST_VALIDATE_API
with a proper config.h

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3429>

18 months agoci: bump image tags so subprojects get updated
Tim-Philipp Müller [Fri, 18 Nov 2022 00:59:55 +0000 (00:59 +0000)]
ci: bump image tags so subprojects get updated

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3432>

18 months agosubprojects: switch libsoup to a file wrap
Tim-Philipp Müller [Fri, 18 Nov 2022 00:56:25 +0000 (00:56 +0000)]
subprojects: switch libsoup to a file wrap

With fallback_url.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3432>

18 months agosubprojects: update glib-networking to 2.74.0 and switch to file wrap
Tim-Philipp Müller [Fri, 18 Nov 2022 00:51:48 +0000 (00:51 +0000)]
subprojects: update glib-networking to 2.74.0 and switch to file wrap

Also has a fallback_url for the tarball.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3432>

18 months agosubprojects: update glib to 2.74.1
Tim-Philipp Müller [Fri, 18 Nov 2022 00:50:56 +0000 (00:50 +0000)]
subprojects: update glib to 2.74.1

With fallback_url for tarball now too.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3432>

18 months agohlsdemux2: Expose EXT-X-PROGRAM-DATE-TIME as tags.
Enrique Ocaña González [Tue, 3 May 2022 16:36:54 +0000 (18:36 +0200)]
hlsdemux2: Expose EXT-X-PROGRAM-DATE-TIME as tags.

This allows an application to use timestamps associated
with fragments.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1417>

18 months agohlsdemux: Expose EXT-X-PROGRAM-DATE-TIME as tags.
Enrique Ocaña González [Mon, 2 May 2022 17:13:41 +0000 (19:13 +0200)]
hlsdemux: Expose EXT-X-PROGRAM-DATE-TIME as tags.

This allows an application to use timestamps associated
with fragments.

Patch by: Thomas Bluemel <tbluemel@control4.com>

See: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/195
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1417>

18 months agoqtmux: use trun with multiple entries in more cases
Matthew Waters [Thu, 17 Nov 2022 09:59:35 +0000 (20:59 +1100)]
qtmux: use trun with multiple entries in more cases

The only case where we definitely need to write a new trun is when the
data_offset value does not match the end of the list of entries.
Needing multiple trun atoms is required when interleaving multiple
streams together.

All other cases can be covered by adding more entries to the existing
trun atom.

Fixes playback of fragemented mp4 in ffplay and chrome.

Using e.g. mp4mux fragment-duration=1000 fragment-mode=dash-or-mss
and
mp4mux fragment-duration=1000 fragment-mode=first-moov-then-finalise

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3426>

18 months agolibs: context: use queried value for attrib
Boyuan Zhang [Wed, 2 Nov 2022 21:23:04 +0000 (17:23 -0400)]
libs: context: use queried value for attrib

Attribute's value should use returned value from get_attribute for
VAConfigAttribRTFormat, since VAProfileHEVCMain10, in AMD Mesa Gallium,
can process either VA_RT_FORMAT_420 and VA_RT_FORMAT_420_10, which isn't
considered in gstreamer-vaapi design, where encoder's src pads will
expose only 4:2:0 color formats but no 4:2:0 10bit. So, this is a workaround
for this issue while new vah265enc is released.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3397>

18 months agovabaseenc: Reduce logging noise if finish_frame fails.
Víctor Manuel Jáquez Leal [Wed, 16 Nov 2022 18:39:47 +0000 (19:39 +0100)]
vabaseenc: Reduce logging noise if finish_frame fails.

Fixes: #1579
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3423>

18 months agogst-docs: Fix broken tables in Cerbero docs
Piotr Brzeziński [Wed, 16 Nov 2022 21:38:43 +0000 (22:38 +0100)]
gst-docs: Fix broken tables in Cerbero docs

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3425>

18 months agoamfcodec: Promote encoder rank to PRIMARY
Seungha Yang [Sat, 12 Nov 2022 18:28:23 +0000 (03:28 +0900)]
amfcodec: Promote encoder rank to PRIMARY

This H/W encoder implementation is the recommended element
on AMD system over the MediaFoundation one.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3394>

18 months agourisourcebin: Remove un-needed define
Edward Hervey [Mon, 14 Nov 2022 13:18:30 +0000 (14:18 +0100)]
urisourcebin: Remove un-needed define

This code hasn't use GValueArray in ages

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agourisourcebin: Use a non-buffering multiqueue for non-streamable URI
Edward Hervey [Mon, 14 Nov 2022 13:17:25 +0000 (14:17 +0100)]
urisourcebin: Use a non-buffering multiqueue for non-streamable URI

Even though buffering is not required, we need to ensure we are dealing with the
interleave (if any) before pushing the elementary streams further downstream.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agourisourcebin: Minor doc fix
Edward Hervey [Thu, 10 Nov 2022 09:27:48 +0000 (10:27 +0100)]
urisourcebin: Minor doc fix

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agouridecodebin3: Don't leak EOS event
Jan Schmidt [Fri, 30 Sep 2022 18:38:53 +0000 (04:38 +1000)]
uridecodebin3: Don't leak EOS event

Make sure to unref the EOS event in all code paths
when returning GST_PAD_PROBE_HANDLED

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agoplaybin3: Move gapless to uridecodebin3
Edward Hervey [Thu, 21 Jul 2022 14:43:47 +0000 (16:43 +0200)]
playbin3: Move gapless to uridecodebin3

This was the intention from the start, just took me a few years *cough* to
actually implement it properly.

Gapless is handled by re-using as much as possible the same decoders and sinks
if present, and only pre-rolling switching at the sources level (with buffering
if/when needed).

In order to enable "gapless" playback, the "next" uri should be set at any time
between the moment the `about-to-finish` signal is emitted and the moment the
current play item is done. Previously this could only be done with the signal
emission.

This new implementation also allows "Instantaneous URI switching". This allows a
much faster way of switching playback entries while re-using as many elements as
possible. To enable this set `instant-uri` property to TRUE, the default being
FALSE.

API: instant-uri properties
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agoplaybin3: Remove unused code
Edward Hervey [Thu, 10 Nov 2022 06:16:11 +0000 (07:16 +0100)]
playbin3: Remove unused code

This was never used, and if ever it's needed at some point for reference it's
available in gstplaybin.c

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agodecodebin3: Clear input collection when linked again
Edward Hervey [Mon, 14 Nov 2022 08:54:24 +0000 (09:54 +0100)]
decodebin3: Clear input collection when linked again

The previous collection no longer applies to this input

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agodecodebin3: Improve collection merging
Edward Hervey [Mon, 14 Nov 2022 08:37:28 +0000 (09:37 +0100)]
decodebin3: Improve collection merging

If the collections are the same, don't merge them

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agodecodebin3: doc cleanup
Edward Hervey [Thu, 10 Nov 2022 05:58:50 +0000 (06:58 +0100)]
decodebin3: doc cleanup

Remove old/invalid FIXME and cleanup some logs

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agodecodebin3: Remove unused variable
Edward Hervey [Thu, 10 Nov 2022 05:54:21 +0000 (06:54 +0100)]
decodebin3: Remove unused variable

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agomultiqueue: Protect reconfiguration with a lock
Jan Schmidt [Tue, 27 Sep 2022 17:08:39 +0000 (03:08 +1000)]
multiqueue: Protect reconfiguration with a lock

Add a lock to prevent overlapping of request and release
pads, to close a race where multiqueue might try and
add a slot with an id that hasn't quite finished being
removed yet by another thread.

Fix for https://gitlab.freedesktop.org/bilboed/gstreamer/-/issues/5
and https://gitlab.freedesktop.org/bilboed/gstreamer/-/issues/11

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agomultiqueue: Handle gapless input
Edward Hervey [Thu, 21 Jul 2022 13:26:14 +0000 (15:26 +0200)]
multiqueue: Handle gapless input

When dealing with gapless input (i.e. streams with changing group-id in
GST_EVENT_STREAM_START), we need to take into account the elapsed
running-time (if applicable) in order to properly calculate levels and output
time. Without doing this all incoming data from future groups would be
considered as being "late" and would be consumed immediately.

This does **NOT** modify the actual segment and buffer times, and is only used
internally.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agodecodebin3: Allow re-using inputs
Edward Hervey [Thu, 10 Nov 2022 08:13:35 +0000 (09:13 +0100)]
decodebin3: Allow re-using inputs

DecodebinInput (and their backing parsebin or identity) are no longer released
when the corresponding sinkpad is unlinked, but when it's released.

The parsebin element will be resetted:
* If incoming caps are incompatible (was the case before)
* Or when unlinking and it was previously pull-based

This opens the way to use decodebin3 with changing inputs (i.e. gapless)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agouridecodebin3: use urisourcebin parse-streams property
Edward Hervey [Wed, 9 Nov 2022 15:51:51 +0000 (16:51 +0100)]
uridecodebin3: use urisourcebin parse-streams property

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agourisourcebin: Improve buffering handling
Edward Hervey [Wed, 9 Nov 2022 15:44:18 +0000 (16:44 +0100)]
urisourcebin: Improve buffering handling

Introduce the option to have the streams be parsed with `parsebin` for
compatible sources (i.e. which are eligible for buffering in the same way as
before this commit).

By parsing the inputs directly, this allows more accurate buffering control:
* Instead of relying on potential bitrate information coming from somewhere
* and *without* being linked downstream

If `parse-streams` is activated and the stream is eligible for buffering, then a
`multiqueue` will be used on the output of `parsebin` in order to handle the
buffering.

API: `parse-streams`
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agoparsebin: avoid bogus processing
Edward Hervey [Wed, 9 Nov 2022 09:33:22 +0000 (10:33 +0100)]
parsebin: avoid bogus processing

If a parsebin pad is already exposed, don't try to rename it or cause extra
processing which isn't needed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agodecodebin3: Avoid parsebin usage if not needed
Edward Hervey [Wed, 9 Nov 2022 09:26:41 +0000 (10:26 +0100)]
decodebin3: Avoid parsebin usage if not needed

If the incoming streams are already parsed, there is no need to add yet-another
parsebin to process it *IF* that stream is compatible with a decoder or the
decodebin3 output caps.

This only applies if all the following conditions are met:
* The incoming stream can *NOT* do pull-based scheduling
* The incoming stream provides a `GstStream` and `GstStreamCollection`
* The caps are compatible with either the decodebin3 output caps or a decoder
  input

If all those conditions are met, a identity element is used instead of a
parsebin element and the same code paths are taken.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agodecodebin3: DecodebinInputStream: Hold a ref to srcpad
Edward Hervey [Wed, 9 Nov 2022 09:18:25 +0000 (10:18 +0100)]
decodebin3: DecodebinInputStream: Hold a ref to srcpad

And move the locking outside of the input stream creation function

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agourisourcebin: Bring high-watermark level in sync with legacy values
Edward Hervey [Mon, 7 Nov 2022 09:01:57 +0000 (10:01 +0100)]
urisourcebin: Bring high-watermark level in sync with legacy values

It was always 60%. For some reason this crept in during the initial urisourcebin
refactoring.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agodecodebin3: Don't leak collection when releasing inputs
Edward Hervey [Mon, 7 Nov 2022 08:49:02 +0000 (09:49 +0100)]
decodebin3: Don't leak collection when releasing inputs

And refactor the function slightly for clarity

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agodecodebin3: Protect input freeing with the input lock
Edward Hervey [Sat, 5 Nov 2022 08:20:03 +0000 (09:20 +0100)]
decodebin3: Protect input freeing with the input lock

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agodecodebin3: Refactor parsebin output handling
Edward Hervey [Sat, 5 Nov 2022 08:16:41 +0000 (09:16 +0100)]
decodebin3: Refactor parsebin output handling

* Instead of creating temporary `PendingPad` structures, always create a
  DecodebinInputStream for every pad of parsebin
* Remove never used `pending_stream` field from DecodebinInputStream
* When unblocking a given DecodebinInput (i.e. wrapping a parsebin), also make
  sure that other parsebins from the same GstStreamCollection are unblocked
  since they come from the same source

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agodecodebin3: Store GstStreamCollection from upstream
Edward Hervey [Sat, 5 Nov 2022 08:19:29 +0000 (09:19 +0100)]
decodebin3: Store GstStreamCollection from upstream

If upstream provides stream collection, use/store them as soon as possible

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agourisourcebin: Move adaptive demuxer handling into ChildSrcPadInfo
Edward Hervey [Tue, 1 Nov 2022 09:30:19 +0000 (10:30 +0100)]
urisourcebin: Move adaptive demuxer handling into ChildSrcPadInfo

It's part of that chain of elements

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agourisourcebin: Only remove components in PAUSED->READY
Edward Hervey [Tue, 1 Nov 2022 08:53:36 +0000 (09:53 +0100)]
urisourcebin: Only remove components in PAUSED->READY

With the refactoring, we are guaranteed the components are only created in PAUSED

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agourisourcebin: Refactor ChildSrcPadInfo and OutputSlot usage
Edward Hervey [Tue, 1 Nov 2022 08:49:39 +0000 (09:49 +0100)]
urisourcebin: Refactor ChildSrcPadInfo and OutputSlot usage

Make an explicit topology/tree of structures:
* ChildSrcPadInfo is created for each source element source pad
* ChildSrcPadInfo contains the chain of optional elements specific to that
  pad (ex: typefind)
* A ChildSrcPadInfo links to one or more OutputSlot, which contain what is
  specific to the output (i.e. optional buffering and ghostpad)
* No longer use GObject {set|get}_data() functions to store those structures and
  instead make them explicit
* Pass those structures around explicitely in each function/callback

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agourisourcebin: Remove duplicate call
Edward Hervey [Mon, 31 Oct 2022 05:13:31 +0000 (06:13 +0100)]
urisourcebin: Remove duplicate call

We ensure sources are removed in PAUSED->READY->NULL. No need to call it when
creating the source.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agourisourcebin: Remove pending pad handling
Edward Hervey [Thu, 27 Oct 2022 12:30:30 +0000 (14:30 +0200)]
urisourcebin: Remove pending pad handling

This was needed to support the legacy handling of changing streams (add new
pads, send EOS and remove old pads).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agourisourcebin: Only expose pads once activation has completed
Edward Hervey [Thu, 27 Oct 2022 09:47:56 +0000 (11:47 +0200)]
urisourcebin: Only expose pads once activation has completed

The following problem could happen:
* Thread 1 : urisourcebin gets activated from READY->PAUSED
* Thread 2 : some element causes a pad to be added to urisourcebin , which gets
linked downstream, which decides to activate upstream to pull-based.
  * That requires "activating" the pads from PUSH to NONE, and then from NONE to PULL
* Thread 1 : the base class state change handlers checks if all pads are
activated

The issue is that since going form PUSH to PULL requires going through NONE,
there is a window during which:
* Thread 1 : The pad was set to NONE (before being set to PULL)
* Thread 2 : The base class activates that pad (to PUSH)
* Thread 1 : The attempt to "activate" to PULL fails (silently or not)

This is very racy, so in order to avoid that, we make sure that we only add pads
once the transition from READY->PAUSED in the parent classes is done.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agourisourcebin: Only allow streams-aware adaptive demuxer
Edward Hervey [Wed, 26 Oct 2022 05:04:52 +0000 (07:04 +0200)]
urisourcebin: Only allow streams-aware adaptive demuxer

We no longer want to deal with elements that use the old-style of stream
switching and instead expose/remove streams as they appear/disappear

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agourisourcebin: Simplify initial information collection
Edward Hervey [Tue, 25 Oct 2022 15:13:21 +0000 (17:13 +0200)]
urisourcebin: Simplify initial information collection

When iterating existing pads of a source, directly handle them:
* Raw pads are handled directly
* Pads without caps are connected to a typefind
* Other pads are handled via `handle_new_pad()`

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agourisourcebin: Use iterator function where applicable
Edward Hervey [Tue, 25 Oct 2022 09:15:05 +0000 (11:15 +0200)]
urisourcebin: Use iterator function where applicable

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agourisourcebin: Document and rename fields
Edward Hervey [Tue, 25 Oct 2022 09:13:49 +0000 (11:13 +0200)]
urisourcebin: Document and rename fields

Removes ambiguity when reading the code

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agourisourcebin: Remove unused lock/list
Edward Hervey [Tue, 25 Oct 2022 09:05:45 +0000 (11:05 +0200)]
urisourcebin: Remove unused lock/list

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agourisourcebin: Check for live source when generating element
Edward Hervey [Tue, 25 Oct 2022 08:46:40 +0000 (10:46 +0200)]
urisourcebin: Check for live source when generating element

Instead of at a later stage

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agourisourcebin: Streamline demuxer removal
Edward Hervey [Wed, 19 Oct 2022 10:28:41 +0000 (12:28 +0200)]
urisourcebin: Streamline demuxer removal

And since remove_source also removes the dmeuxer, we no longer need to call it
in addition

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agourisourcebin: Clarify function name and arguments
Edward Hervey [Wed, 19 Oct 2022 09:03:03 +0000 (11:03 +0200)]
urisourcebin: Clarify function name and arguments

* The "need_queue" variable is only used in one place, move it there
* Clarify the fact the function also exposes raw_pads

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agourisourcebin: Error out if a source doesn't expose pads
Edward Hervey [Wed, 19 Oct 2022 09:00:09 +0000 (11:00 +0200)]
urisourcebin: Error out if a source doesn't expose pads

Looks like this fell through the cracks. If a source element doesn't have
dynamic pads and doesn't provide any source pad ... we should properly error
out.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agotsdemux: Push GST_EVENT_STREAM_COLLECTION
Edward Hervey [Wed, 2 Nov 2022 13:45:51 +0000 (14:45 +0100)]
tsdemux: Push GST_EVENT_STREAM_COLLECTION

Demuxers that are not streams-aware will have that handled by parsebin. This
created a difference in results downstream between streams-aware and
non-streams-aware demuxers

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agoadaptivedemux2: Notify that we are streams-aware
Edward Hervey [Wed, 26 Oct 2022 05:04:32 +0000 (07:04 +0200)]
adaptivedemux2: Notify that we are streams-aware

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>

18 months agov4l2codecs: Allow output caps to be updated
Nicolas Dufresne [Mon, 14 Nov 2022 20:53:00 +0000 (15:53 -0500)]
v4l2codecs: Allow output caps to be updated

This change allow output caps to be updated even though we stay in
streaming state. This is needed so that any upstream updated to fields
like framerate, hdr data, etc. can result in a downstream caps event
being pushed.

Previously, any of these changes was being ignored and the downstream
caps would not reflect it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3328>

18 months agonvdecoder: Handle input caps change
Seungha Yang [Sat, 5 Nov 2022 12:06:39 +0000 (21:06 +0900)]
nvdecoder: Handle input caps change

Update output caps if it's notified by baseclass

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3328>

18 months agonvdecoder: Don't hold decoder output state
Seungha Yang [Sat, 5 Nov 2022 12:00:43 +0000 (21:00 +0900)]
nvdecoder: Don't hold decoder output state

It's not referenced by this implementation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3328>

18 months agoexamples: Add test code to verify decoder caps update
Seungha Yang [Sat, 5 Nov 2022 11:16:21 +0000 (20:16 +0900)]
examples: Add test code to verify decoder caps update

Sample command lines
* Configures pipeline with video encoder
decoder-caps-update \
  --encoder="video/x-raw,format=NV12 ! qsvh264enc" \
  --decoder=d3d11h264dec \
  --videosink=d3d11videosink

* Playing exisiting file
decoder-caps-update \
  --location=test_file.mp4 \
  --decoder=d3d11h264dec \
  --videosink=d3d11videosink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3328>

18 months agod3d11decoder: Handle input caps change
Seungha Yang [Fri, 4 Nov 2022 17:47:54 +0000 (02:47 +0900)]
d3d11decoder: Handle input caps change

Update output caps if it's notified by baseclass

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3328>

18 months agocodecs: Keep track of non-decoding-essential input state change
Seungha Yang [Fri, 4 Nov 2022 16:07:02 +0000 (01:07 +0900)]
codecs: Keep track of non-decoding-essential input state change

In theory, input caps can be updated anytime at non-keyframe or
sequence boundary, such as HDR10 metadata, framerate, aspect-ratio
or so. Those information update might not trigger ::new_sequence()
or subclass may ignore the changes.

By this commit, input state change will be tracked by baseclass
and subclass will be able to know the non-decoding-essential
update by checking the codec specific picture struct
on ::output_picture()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3328>

18 months agoRevert "mpegtspacketizer: memcmp potentially seen_before data"
Edward Hervey [Wed, 16 Nov 2022 08:42:08 +0000 (09:42 +0100)]
Revert "mpegtspacketizer: memcmp potentially seen_before data"

This reverts commit fcad4cc646a23e4e621ec5e8485958ab78d98090.

This was wrong is so many ways.

* The memcmp was badly used (it should use == 0 to check the data is identical,
  and not != 0)
* There was no boundary checks on the present stream section_data when passing
  it to memcmp.
* The return value should have been TRUE (i.e. we have done all checks, none of
  them failed, therefore the section has been seen before)
* stream->section_data would *always* be NULL if the section had already been
  processed

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3421>

18 months agompegts: Check is program is identical before updating
Edward Hervey [Wed, 16 Nov 2022 08:29:59 +0000 (09:29 +0100)]
mpegts: Check is program is identical before updating

There is no need to update the program if it's identical :)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3421>

18 months agortspsrc: Fix regression when using hostname in the location property
Nirbheek Chauhan [Wed, 16 Nov 2022 08:03:39 +0000 (13:33 +0530)]
rtspsrc: Fix regression when using hostname in the location property

When the address can't be parsed as an IP address, it should just be
treated as a hostname and used as-is.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3420>

18 months agoavviddec: Report a latency even without upstream framerate
Edward Hervey [Fri, 11 Nov 2022 08:06:55 +0000 (09:06 +0100)]
avviddec: Report a latency even without upstream framerate

There are cases where upstream will not provide a framerate, or it won't be
fixed. But if there is latency introduced by the decoder we do want to report
it.

Therefore use the framerate stored in the actual decoder, which will have a
default.

Fixes hangs when playing back such streams with decodebin3 (where the multiqueue
will not have been informed of that downstream latency and not grow accordingly)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3391>

18 months agov4l2videodec: Fixes three H.264/HEVC ITU conformance tests
F. Duncanh [Mon, 14 Nov 2022 00:19:41 +0000 (19:19 -0500)]
v4l2videodec: Fixes three H.264/HEVC ITU conformance tests

Postpone the cleanup of any consecutive sequence of lost frames
which starts at frame 0, until frame 100 is dequeued from driver.

This allows fluster tests JVT/CVWP2_TOSHIBA_E, JVC/CVWP3_TOSHIBA_E
and HEVC/POC_A_Bossen_3 that sends out-of-order frames to successfully
complete  (e.g., test of Amphion vpu driver).

Fixes #1569

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3398>

18 months agortpjitterbuffer: Add test for rescheduling timers to negative times
Sebastian Dröge [Tue, 15 Nov 2022 15:26:18 +0000 (17:26 +0200)]
rtpjitterbuffer: Add test for rescheduling timers to negative times

This tests the changes introduced by 4d3b8d1129d8b863e4156cd0334e93257b9d0cc4
for issue #571.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3416>

18 months agortpjitterbuffer: Reschedule timers when updating their offset
Sebastian Dröge [Wed, 7 Sep 2022 08:07:40 +0000 (11:07 +0300)]
rtpjitterbuffer: Reschedule timers when updating their offset

As EXPECTED timers are skipped the order of the timers relative to each
other can change if there are EXPECTED timers and rescheduling needs to
happen.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3416>

18 months agowavparse: Do not run all typefinders for all output
Sanchayan Maity [Tue, 15 Nov 2022 15:52:17 +0000 (21:22 +0530)]
wavparse: Do not run all typefinders for all output

In order to figure out if the "raw" audio contained within the wav
container is actually DTS, wavparse calls the typefinder helper
except that means it runs all typefinders.

Since it only cares about checking for DTS, we should only run the
audio/x-dts typefinder (if present). Commit 858e516 did not really
fix things.

Use the new type helper with the caps to fix this.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3417>

18 months agotypefindhelper: Fix docs/annotations for the new functions
Sebastian Dröge [Tue, 15 Nov 2022 17:14:14 +0000 (19:14 +0200)]
typefindhelper: Fix docs/annotations for the new functions

Follow-up for https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3296

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3418>

18 months agortspsrc: Consistently set seqnums on events
Sebastian Dröge [Mon, 14 Nov 2022 19:19:12 +0000 (21:19 +0200)]
rtspsrc: Consistently set seqnums on events

Set udpsrc seqnums on all events sent to the udpsrc's, and before
forwarding events out of rtspsrc set the latest seek seqnum on them if
any.

Also produce a consistent seqnum in rtspsrc from the very beginning.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3409>

18 months agortspsrc: Make segment event writable before overriding the seqnum and use the proper...
Sebastian Dröge [Mon, 14 Nov 2022 17:14:27 +0000 (19:14 +0200)]
rtspsrc: Make segment event writable before overriding the seqnum and use the proper API to do so

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3409>

18 months agortspsrc: Intercept and handle events when using no manager too
Sebastian Dröge [Mon, 14 Nov 2022 17:10:05 +0000 (19:10 +0200)]
rtspsrc: Intercept and handle events when using no manager too

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3409>

18 months agortspsrc: Don't blindly copy over sticky events from manager pad to external source pad
Sebastian Dröge [Mon, 14 Nov 2022 17:08:54 +0000 (19:08 +0200)]
rtspsrc: Don't blindly copy over sticky events from manager pad to external source pad

This would get around the code that modifies some events when they go
through the ghost pad's proxypad. Instead go via the event function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3409>