platform/upstream/gstreamer.git
21 months agoaom: av1enc: Ensure that input pts is strictly increasing
Yatin Mann [Mon, 11 Jul 2022 03:57:41 +0000 (09:27 +0530)]
aom: av1enc: Ensure that input pts is strictly increasing

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

21 months agoaom: av1enc: Fix pts unit
Yatin Mann [Mon, 4 Jul 2022 14:25:59 +0000 (19:55 +0530)]
aom: av1enc: Fix pts unit

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

21 months agodfbvideosink: Fix compile error
ekwange [Mon, 2 Jan 2023 09:34:59 +0000 (18:34 +0900)]
dfbvideosink: Fix compile error

Fix some compile errors

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

21 months agowebrtc nice: Let libnice handle STUN/TURN DNS resolution
Olivier Crête [Mon, 2 Jan 2023 00:19:03 +0000 (19:19 -0500)]
webrtc nice: Let libnice handle STUN/TURN DNS resolution

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

21 months agowebrtc: Change requirement to libnice 0.1.20
Olivier Crête [Fri, 6 Jan 2023 20:07:42 +0000 (15:07 -0500)]
webrtc: Change requirement to libnice 0.1.20

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

22 months agortspclientsink: Add `publish-clock-mode` property
Sebastian Dröge [Fri, 16 Dec 2022 09:16:52 +0000 (11:16 +0200)]
rtspclientsink: Add `publish-clock-mode` property

This allows modifying the behaviour how/if the pipeline clock is
published according to RFC7273, similar to the same API on
`GstRTSPMedia`.

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

22 months agortspclientsink: Fix docs for various properties
Sebastian Dröge [Wed, 4 Jan 2023 11:46:15 +0000 (13:46 +0200)]
rtspclientsink: Fix docs for various properties

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

22 months agodocs: explicitly declare gir build dependencies
Mathieu Duponchelle [Wed, 4 Jan 2023 20:37:55 +0000 (21:37 +0100)]
docs: explicitly declare gir build dependencies

As the path to the gir file is passed to hotdoc.generate_doc() and
not the build target itself, meson doesn't know about the dependency.

In turn, as the CI doesn't build everything before building the
documentation target, some gir files might not exist, for instance
in the case of gst-rtsp-server, causing the output documentation to
be empty.

The error occurred silently because hotdoc accepts wildcards for
*-sources arguments, thus it won't warn about a missing gir file as
it is legitimate for glob matching to resolve to nothing.

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

22 months agotypefindfunctions: Add missing length check to XML typefinder
Sebastian Dröge [Fri, 6 Jan 2023 16:09:02 +0000 (18:09 +0200)]
typefindfunctions: Add missing length check to XML typefinder

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54811

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

22 months agotypefindfunctions: Reduce XML typefinder minimum data size from 64 to 32 bytes
Sebastian Dröge [Fri, 6 Jan 2023 12:37:31 +0000 (14:37 +0200)]
typefindfunctions: Reduce XML typefinder minimum data size from 64 to 32 bytes

64 bytes makes the typefinder fail on very small XML documents on which
it succeeded previously.

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

22 months agoopusdec: Try harder to negotiate the upstream channels/rate preferences
Sebastian Dröge [Thu, 5 Jan 2023 15:59:41 +0000 (17:59 +0200)]
opusdec: Try harder to negotiate the upstream channels/rate preferences

It might be possible to fulfill those but not with the first caps
structure. Instead of just fixating the first caps structure, check if
the preference can be fulfilled by any of the structures as the first
step.

Without this the following pipeline negotiates to mono after the
decoder because opusenc only has a single channel in its first caps
structure.

    gst-launch-1.0 audiotestsrc ! audio/x-raw,channels=2 ! opusenc \
        ! queue ! opusdec ! queue ! opusenc ! fakesink

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

22 months agoRevert "opusenc: Reverse channel order in template caps"
Sebastian Dröge [Thu, 5 Jan 2023 15:35:02 +0000 (17:35 +0200)]
Revert "opusenc: Reverse channel order in template caps"

This reverts commit cdf411e82d7e437e5de138492b6e75e5513686ee. It causes
pipelines to unnecessarily negotiate to 8 channels.

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

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

22 months agodvbbasebin: don't rely on g_key_file_get_(integer|uint64) return
Rodrigo Bernardes [Wed, 4 Jan 2023 21:55:08 +0000 (18:55 -0300)]
dvbbasebin: don't rely on g_key_file_get_(integer|uint64) return

instead check if an error was returned, and fail if any

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

22 months agohlsdemux: Consider starting stream time in presentation offset
Jan Schmidt [Sun, 7 Aug 2022 04:23:04 +0000 (14:23 +1000)]
hlsdemux: Consider starting stream time in presentation offset

When calculating the presentation offset for CMAF input in live
playback, subtract the stream_time of the fragment from the
calculated presentation offset, so that the first fragment
is played at running time zero.

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

22 months agowebrtc examples: Force regular non-MULTIOPUS
Olivier Crête [Tue, 3 Jan 2023 22:44:37 +0000 (17:44 -0500)]
webrtc examples: Force regular non-MULTIOPUS

Using MULTIOPUS breaks with most browsers

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

22 months agowebrtc-unidirectional: Avoid critical
Olivier Crête [Tue, 3 Jan 2023 22:12:12 +0000 (17:12 -0500)]
webrtc-unidirectional: Avoid critical

Don't unref the parameter passed to a signal, it's always owned by
the caller. Fixes a GLib critical.

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

22 months agoaudioenc/dec: Avoid adding temporary structure
Olivier Crête [Tue, 3 Jan 2023 23:53:41 +0000 (18:53 -0500)]
audioenc/dec: Avoid adding temporary structure

As a minor optimisation

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

22 months agoaudioenc/dec: Preserve downstream caps preference in get caps
Olivier Crête [Tue, 3 Jan 2023 23:52:05 +0000 (18:52 -0500)]
audioenc/dec: Preserve downstream caps preference in get caps

This should fix pipelines such as this one to work as expected
  ... ! opusenc ! capsfilter caps='audio/x-opus,
  channels=1; audio/x-opus, channels=2' ! ...

The expectation is that the encoder will propose the first structure
before the second one to the source.

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

22 months agoges: gst_bin_add() is `transfer floating` so wrappers around it are too
Sebastian Dröge [Wed, 4 Jan 2023 10:21:22 +0000 (12:21 +0200)]
ges: gst_bin_add() is `transfer floating` so wrappers around it are too

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

22 months agosrt: Avoid crash on unknown option
Olivier Crête [Tue, 3 Jan 2023 20:01:37 +0000 (15:01 -0500)]
srt: Avoid crash on unknown option

Use the correct field that is null instead of the struct value which
never is.

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

22 months agotypefindfunctions: Check for the SVG namespace URL in addition to `<svg` and the...
Sebastian Dröge [Fri, 23 Dec 2022 14:15:49 +0000 (16:15 +0200)]
typefindfunctions: Check for the SVG namespace URL in addition to `<svg` and the doctype

Finding the SVG namespace URL gives a clear indication that this is
actually an SVG file while the `<svg>` tag only gives a likely
indication as it's rather short.

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

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

22 months agoqroverlay: Add qrcode-case-sensitive property
Xavier Claessens [Fri, 30 Dec 2022 15:30:38 +0000 (10:30 -0500)]
qroverlay: Add qrcode-case-sensitive property

This allows to encode case sensitive strings, like wifi SSID/password.

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

22 months agoavvidenc: Set timebase in the ffmpeg context to nanoseconds and set framerate
Sebastian Dröge [Fri, 23 Dec 2022 16:01:03 +0000 (18:01 +0200)]
avvidenc: Set timebase in the ffmpeg context to nanoseconds and set framerate

As we now actually use the timestamps from ffmpeg for timestamping the
output we would lose a lot of accuracy if the framerate is used.

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

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

22 months agotypefindfunctions: Make XML typefinder more strict
Sebastian Dröge [Fri, 23 Dec 2022 15:25:06 +0000 (17:25 +0200)]
typefindfunctions: Make XML typefinder more strict

If a XMLDec is found, check also for its end. Similarly, check for the
end of the XML tag we're looking for and make sure that the following
characters are valid.

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

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

22 months agoh265decoder: Fix a memory leak because of slice header.
He Junyan [Tue, 3 Jan 2023 09:28:18 +0000 (17:28 +0800)]
h265decoder: Fix a memory leak because of slice header.

The gst_h265_slice_hdr_free() should free the slice header just
parsed, not the priv->current_slice. Or, the memory leak will
happen because we do not free the slices in priv->nalu list.

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

22 months agosubprojects: libffi: pin to meson-3.2.9999.4 tag
Tim-Philipp Müller [Sat, 31 Dec 2022 13:47:34 +0000 (13:47 +0000)]
subprojects: libffi: pin to meson-3.2.9999.4 tag

In case we want to change the 'meson' branch over
to the re-done meson port based on upstream libffi
in future.

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

22 months agomeson: Accept latest version of opencv 4.x
مهدي شينون (Mehdi Chinoune) [Fri, 30 Dec 2022 17:10:12 +0000 (17:10 +0000)]
meson: Accept latest version of opencv 4.x

We've been bumping along the maximum opencv 4.x version for years,
just accept all opencv versions till someone reports breakage.

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

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

22 months agourisourcebin: Fix parsebin handling
Edward Hervey [Fri, 30 Dec 2022 07:44:35 +0000 (08:44 +0100)]
urisourcebin: Fix parsebin handling

The goal of !3601 was to make sure we don't end up with non-streams-aware
adaptive demuxers. Since we know that parsebin is streams-aware, just remember
that and handle them that way.

Fixes issues with some scenarios where parsebin might add pads *before* the
collection is posted on the bus

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

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

22 months agouridecodebin3: Fix handling of "expected" pads
Edward Hervey [Thu, 29 Dec 2022 15:02:38 +0000 (16:02 +0100)]
uridecodebin3: Fix handling of "expected" pads

The number of expected pads was:
* Defaulting to 1
* Or being overriden by GST_MESSAGE_STREAMS_SELECTED

This fails if upstream isn't a selectable source and has multiple streams, and
would therefore cause failures with multi-stream gapless playback

Fixes #1672

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

22 months agouridecodebin3: Avoid repeatedly calling the blocking probe
Edward Hervey [Thu, 29 Dec 2022 15:01:07 +0000 (16:01 +0100)]
uridecodebin3: Avoid repeatedly calling the blocking probe

When skipping an event, we want to unref it and say we handled it. This avoids
being repeatedly called for the same (sticky) events.

The events will be properly propagated once the pad is linked.

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

22 months agouridecodebin3: Handle multiple pending pad block probes
Edward Hervey [Thu, 29 Dec 2022 14:58:24 +0000 (15:58 +0100)]
uridecodebin3: Handle multiple pending pad block probes

It is quite possible to have the blocking probe called from different streaming
threads when all expected pads are present.

* Notify all waiters by using g_cond_broadcast instead of g_cond_signal
* Properly remove the probe after waiting

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

22 months agoevent: Fix gst_event_parse_stream_collection annotation
Philippe Normand [Thu, 29 Dec 2022 18:16:31 +0000 (18:16 +0000)]
event: Fix gst_event_parse_stream_collection annotation

The output parameter ownership is passed to the caller.

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

22 months agomeson: Add an option to select the method for finding Qt
Nirbheek Chauhan [Thu, 22 Dec 2022 15:53:39 +0000 (21:23 +0530)]
meson: Add an option to select the method for finding Qt

This is needed by Cerbero, since we want to force the use of qmake to
find Qt on non-Linux platforms.

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

22 months agogl: Mark `gst_gl_context_new_wrapped()` return value as `nullable`
Sebastian Dröge [Thu, 29 Dec 2022 09:02:10 +0000 (11:02 +0200)]
gl: Mark `gst_gl_context_new_wrapped()` return value as `nullable`

If a GL context is requested for which no API support is compiled in
then `NULL` is returned.

Also remove a useless `NULL` check: `g_object_new()` can't possibly
return `NULL`, ever.

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

22 months agoplugins-base/tests/check/meson.build: add omitted Wayland dependence
F. Duncanh [Sun, 25 Dec 2022 04:41:52 +0000 (23:41 -0500)]
plugins-base/tests/check/meson.build: add omitted Wayland dependence

SUSE places Wayland include files in /usr/include/wayland, and needs
a Cflag added to wayland_client_deps by pkg-config, which is added to
gl_winsys_deps: add this as a dependency in gstgl_dep to fix issue.

Fixes #1607

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

22 months agomeson: Add gstreamer-gl-1.0 pkgconfig vars to internal dependency
Nirbheek Chauhan [Wed, 28 Dec 2022 22:22:42 +0000 (03:52 +0530)]
meson: Add gstreamer-gl-1.0 pkgconfig vars to internal dependency

So we can fetch gl_winsys, gl_platforms, etc directly using
gst_gl_dep.get_variable() when building gstreamer as a subproject, or
when building gst-plugins-rs's gtk4 plugin.

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

22 months agotests: gstelement: Fix test_add_pad_while_paused flakiness
Philippe Normand [Wed, 28 Dec 2022 17:42:31 +0000 (17:42 +0000)]
tests: gstelement: Fix test_add_pad_while_paused flakiness

`gst_element_remove_pad()` doesn't automatically deactivate the pad, it has to
be done explicitly beforehand, otherwise the pad task might be left dangling,
exposed to undefined behaviour.

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

22 months agovalidate: Place regex flags at the start of the regex
Jan Schmidt [Mon, 26 Dec 2022 13:24:36 +0000 (00:24 +1100)]
validate: Place regex flags at the start of the regex

In Python 3.11 it is an error to have regex flags in the middle
of an expression, so make sure they appear at the start.

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

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

22 months agogtkbasesink: Fix widget leak
Seungha Yang [Mon, 26 Dec 2022 14:00:18 +0000 (23:00 +0900)]
gtkbasesink: Fix widget leak

gst_gtk_base_sink_get_widget() will increase refcount and it should
be released after use

Fixing regression introduced by the commit
941c0e81ddf5c0ad6a9fac59b1d6bf7723025434

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

22 months agogstelement: fix deadlock in gst_element_add_pad() when >=PAUSED
Alicia Boya García [Sat, 4 May 2019 01:54:44 +0000 (03:54 +0200)]
gstelement: fix deadlock in gst_element_add_pad() when >=PAUSED

gst_element_add_pad() is supposed to activate the pad if the element
state is >= PAUSED and the pad is not already active.

Unfortunately, before this patch, the activation was performed while the
element lock was still taken, which ended causing a deadlock in
gst_pad_start_task() as it attempted to post `stream-status` message in
the element, which also requires the element lock.

Elements could work around this bug by activating the pad manually
before adding it to the element.

This patch fixes the problem by performing pad activation only after the
element lock has been released.

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

22 months agortspsrc: Fix string leak
Seungha Yang [Tue, 27 Dec 2022 14:33:31 +0000 (23:33 +0900)]
rtspsrc: Fix string leak

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

22 months agortptimerqueue: Fix memory leak
Seungha Yang [Tue, 27 Dec 2022 14:26:48 +0000 (23:26 +0900)]
rtptimerqueue: Fix memory leak

Should chain up to parent's finalize

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

22 months agovajpegdec: Set maybe-leaked flag on template caps
Seungha Yang [Mon, 26 Dec 2022 11:53:53 +0000 (20:53 +0900)]
vajpegdec: Set maybe-leaked flag on template caps

The fixup function could return new caps object

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

22 months agovalidate-launcher: update testsuites checks for fixed bug
Tim-Philipp Müller [Tue, 27 Dec 2022 16:14:06 +0000 (17:14 +0100)]
validate-launcher: update testsuites checks for fixed bug

Should make CI functional again.

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

22 months agomultiqueue: Fix potential deadlock with parallel release_pad calls
Mart Raudsepp [Wed, 14 Dec 2022 21:30:54 +0000 (23:30 +0200)]
multiqueue: Fix potential deadlock with parallel release_pad calls

Commit d3a66f9851ea introduced a potential deadlock with two parallel release_pad
calls, where one could release the main multiqueue lock (qlock) while still
holding the reconf_lock and then calling other routines which in some conditions
may try to acquire qlock again. The second release_pad could already acquire the
qlock and then start waiting on reconf_lock, which may never be possible because
because the first one isn't releasing it until it can acquire qlock.

Fix it by holding reconf_lock for the whole durationg of qlock, making this
particular deadlock impossible.

Fixes #1642

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

22 months agowebrtcbin: Support for setting kind attribute on RTCRtpStreamStats
Philippe Normand [Thu, 22 Dec 2022 21:29:39 +0000 (21:29 +0000)]
webrtcbin: Support for setting kind attribute on RTCRtpStreamStats

The attribute maps the `kind` property of the associated transceiver.

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

22 months agoci: mark valgrind ges job as allowed to fail
Tim-Philipp Müller [Thu, 22 Dec 2022 15:51:46 +0000 (15:51 +0000)]
ci: mark valgrind ges job as allowed to fail

It's extremely flaky, especially with idle runners, and
it's not limited to just a single test.

Mark as allowed to fail until someone starts caring about it.

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

22 months agoREADME: Several updates to sync with status quo
Nirbheek Chauhan [Sun, 18 Dec 2022 16:39:50 +0000 (22:09 +0530)]
README: Several updates to sync with status quo

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

22 months agod3d11memory: Fix typo in vfunc name
Seungha Yang [Thu, 22 Dec 2022 16:00:57 +0000 (01:00 +0900)]
d3d11memory: Fix typo in vfunc name

s/set_actvie/set_active/g

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

22 months agonvcudaenc: Don't use default CUDA stream
Seungha Yang [Mon, 19 Dec 2022 10:53:28 +0000 (19:53 +0900)]
nvcudaenc: Don't use default CUDA stream

Set non-default CUDA stream via NvEncSetIOCudaStreams() if possible,
so that NVENC's internal kernel function can run on the given CUDA
stream instead of default CUDA stream

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

22 months agoqtmux: Fix buffer leak in fragment_buffers
Patricia Muscalu [Thu, 22 Dec 2022 10:16:26 +0000 (11:16 +0100)]
qtmux: Fix buffer leak in fragment_buffers

When pushing buffers from one of the sink pads fail,
make sure that all buffers added to fragment_buffers on other pads
are freed as well.

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

22 months agoqtmux: For video with N/1001 framerates use N as timescale instead of centiframes
Mathieu Duponchelle [Mon, 19 Sep 2022 19:11:39 +0000 (21:11 +0200)]
qtmux: For video with N/1001 framerates use N as timescale instead of centiframes

This is recommended by various specifications for such framerates, while
for integer framerates we continue using centiframes to allow for some
more accuracy.

Using N means that no rounding error accumulates, eventually leading to
outputting a packet with a different duration.

Some tools such as MediaInfo determine that a stream is variable
framerate if any packet has a different duration than the others, and
there is no reason I can see for not using the full 4 bytes of
resolution that the mp4 timescale offers.

Example problematic pipeline:

```
videotestsrc num-buffers=5001 ! video/x-raw,framerate=60000/1001,width=320,height=240 ! \
videoconvert ! x264enc bitrate=80000 speed-preset=1 tune=zerolatency ! h264parse ! \
video/x-h264,profile=high-10 ! mp4mux ! filesink location="result2.mp4"
```

This results in a media file that MediaInfo detects as variable
framerate because the 5000th packet has duration 99 instead of 100.

With this patch, the timescale is 60000 and all packets have duration
1001.

Related issue for context: https://bugzilla.gnome.org/show_bug.cgi?id=769041

Co-authored-by: Sebastian Dröge <sebastian@centricular.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3049>

22 months agoamfcodec: add support of AMF AV1 encoder
Evgeny Pavlov [Wed, 14 Dec 2022 09:35:53 +0000 (10:35 +0100)]
amfcodec: add support of AMF AV1 encoder

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

22 months agocudabasetransform: Update CUDA stream on context update
Seungha Yang [Wed, 21 Dec 2022 15:22:46 +0000 (00:22 +0900)]
cudabasetransform: Update CUDA stream on context update

CUDA stream must be associated with updated CUDA context

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

22 months agova: Delay the VAProcPipelineCaps query after context created.
He Junyan [Wed, 21 Dec 2022 06:36:31 +0000 (14:36 +0800)]
va: Delay the VAProcPipelineCaps query after context created.

The VAAPI vaQueryVideoProcPipelineCaps() requires the context as the
parameter. So far, we always pass VA_INVALID_ID and it can succeed.
But the API does not say that and in theory, a valid context is required.
Now the new platform really needs a valid context and so we have to
delay that query until the context is created.

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

22 months agoqmlglsrc: Handle HiDPI scaling
Jan Schmidt [Tue, 20 Dec 2022 15:37:58 +0000 (02:37 +1100)]
qmlglsrc: Handle HiDPI scaling

When calculating the capture framebuffer size, include
any device scaling applied to the rendered framebuffer

Fixes only capturing part of the window when there is
a global scale factor.

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

22 months agoqmlglsrc: Unmap buffer before adding sync meta
Jan Schmidt [Tue, 20 Dec 2022 15:32:41 +0000 (02:32 +1100)]
qmlglsrc: Unmap buffer before adding sync meta

Adding a sync meta to a GstBuffer requires that it
be writable. Mapping the buffer with the video frame API
holds an extra ref on the buffer, so unmap before
trying to modify it.

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

22 months agoqmlglsrc: Stop when basesrc calls unlock()
Jan Schmidt [Tue, 20 Dec 2022 15:31:05 +0000 (02:31 +1100)]
qmlglsrc: Stop when basesrc calls unlock()

Instead of stopping capture when the state changes,
handle other cases of basesrc stopping capture by - such
as handling an EOS event - by implementing an unlock()
method

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

22 months agofdsrc,fdsink: Set binary mode on FD
Hiero32 [Mon, 19 Dec 2022 18:54:46 +0000 (03:54 +0900)]
fdsrc,fdsink: Set binary mode on FD

Default mode of STD handles on Windows is text mode, and OS will
insert CRLF sequence by default.

Co-authored-by: Seungha Yang <seungha@centricular.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3070>

22 months agocoreelements: Use G_OS_WIN32 macro
Hiero32 [Mon, 19 Dec 2022 18:51:45 +0000 (03:51 +0900)]
coreelements: Use G_OS_WIN32 macro

* HAVE_WIN32 is not defined elsewhere
* Enables fdsrc/fdsink for MinGW build as well

Co-authored-by: Seungha Yang <seungha@centricular.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3070>

22 months agonvdecoder: Use own CUDA stream in GL output path
Seungha Yang [Tue, 20 Dec 2022 15:20:17 +0000 (00:20 +0900)]
nvdecoder: Use own CUDA stream in GL output path

Use the same CUDA stream passed to CuvidMapVideoFrame()

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

22 months agoFix API visibility macros
Xavier Claessens [Tue, 13 Dec 2022 13:58:43 +0000 (08:58 -0500)]
Fix API visibility macros

This copies the logic from GLib discussed there:
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2936

Beside being simpler, it also fix all public symbols being annotated
with dllexport when doing a static build, as discovered there:
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3540#note_1678335

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

22 months agoavviddec: Disable AV1 decoder
Sebastian Dröge [Tue, 20 Dec 2022 12:10:01 +0000 (14:10 +0200)]
avviddec: Disable AV1 decoder

We have various elements for AV1 decoding, the ffmpeg one only works if
hardware support is available and seems to require special signalling.

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

22 months agoexamples: webrtc: Add handling of the LATENCY messages to the Rust examples
Sebastian Dröge [Tue, 20 Dec 2022 11:10:27 +0000 (13:10 +0200)]
examples: webrtc: Add handling of the LATENCY messages to the Rust examples

Without this the configured latency on the pipeline will be wrong.

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

22 months agoexamples: webrtc: Update dependencies
Sebastian Dröge [Tue, 20 Dec 2022 11:06:43 +0000 (13:06 +0200)]
examples: webrtc: Update dependencies

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

22 months agoexamples: webrtc: Remove the bus watch at the end
Sebastian Dröge [Tue, 20 Dec 2022 11:03:44 +0000 (13:03 +0200)]
examples: webrtc: Remove the bus watch at the end

Otherwise a file descriptor will be leaked.

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

22 months agoexamples: webrtc: Add handling of the LATENCY messages to the C examples
Sebastian Dröge [Tue, 20 Dec 2022 11:03:15 +0000 (13:03 +0200)]
examples: webrtc: Add handling of the LATENCY messages to the C examples

Without this the configured latency on the pipeline will be wrong.

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

22 months agoexamples: webrtc: Add bus handling to the Android and C sendrecv examples
Sebastian Dröge [Tue, 20 Dec 2022 11:02:08 +0000 (13:02 +0200)]
examples: webrtc: Add bus handling to the Android and C sendrecv examples

Without a bus, messages will just pile up and errors are not handled at
all. Also without handling the LATENCY messages the latency configured
on the pipeline will be wrong.

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

22 months agonvdec: Don't use default CUDA stream
Seungha Yang [Mon, 19 Dec 2022 09:41:46 +0000 (18:41 +0900)]
nvdec: Don't use default CUDA stream

NVDEC launches CUDA kernel function (ConvertNV12BLtoNV12 or so)
when CuvidMapVideoFrame() is called. Which seems to be
NVDEC's internal post-processing kernel function, maybe
to convert tiled YUV to linear YUV format or something similar.

A problem if we don't pass CUDA stream to the CuvidMapVideoFrame()
call is that the NVDEC's internel kernel function will use default CUDA stream.
Then lots of the other CUDA API calls will be blocked/serialized.

To avoid the unnecessary blocking, we should pass our own
CUDA stream object to the CuvidMapVideoFrame() call

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

22 months agourisourcebin: Modify check for streams-aware adaptive demuxers
Edward Hervey [Mon, 19 Dec 2022 10:49:32 +0000 (11:49 +0100)]
urisourcebin: Modify check for streams-aware adaptive demuxers

Using the "GstBin" flags to check if an adaptive demuxer is streams-aware isn't
a good idea since it prevents using elements which aren't bins.

Instead we see if a collection was posted by the demuxer by the time a pad is
added.

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

22 months agovideoconvertscale: fix valid_tags NULL-terminated array of strings
Philipp Zabel [Mon, 19 Dec 2022 14:22:15 +0000 (15:22 +0100)]
videoconvertscale: fix valid_tags NULL-terminated array of strings

The valid_tags array of strings must be NULL-terminated,
as it is passed to the g_strv_contains() function.

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

22 months agouridecodebin3: fix typo in doc
Guillaume Desmottes [Mon, 19 Dec 2022 13:24:06 +0000 (14:24 +0100)]
uridecodebin3: fix typo in doc

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

22 months agodocs: Update iPhoneOS deployment target to 11.0
Nirbheek Chauhan [Sat, 10 Dec 2022 15:46:41 +0000 (21:16 +0530)]
docs: Update iPhoneOS deployment target to 11.0

https://gitlab.freedesktop.org/nirbheek/cerbero/-/jobs/33292703

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

22 months agomeson: Update lame to -7 which contains the def file fix
Nirbheek Chauhan [Sun, 18 Dec 2022 20:13:08 +0000 (01:43 +0530)]
meson: Update lame to -7 which contains the def file fix

Continuation from https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3579

See: https://github.com/mesonbuild/wrapdb/pull/835
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3598>

22 months agompegts: Always clear packetizer on DISCONT push mode
Edward Hervey [Fri, 16 Dec 2022 14:03:12 +0000 (15:03 +0100)]
mpegts: Always clear packetizer on DISCONT push mode

If a discontinuity is detected in push mode, we need to clear the cached section
observations since they might have potentially changed.

This was only done properly when operating with TIME segments (dvb, udp,
adaptive demuxers, ...) but not with BYTE segments (such as with custom app/fd
sources).

We still don't want to flush out the PCR observations, since this might be
needed for seeking in push-based BYTE sources.

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

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

22 months agosubprojects: lame: Back to lame_3.100-5
Seungha Yang [Thu, 15 Dec 2022 20:25:54 +0000 (05:25 +0900)]
subprojects: lame: Back to lame_3.100-5

Partial revert of the commit of fc22bb8794e8b19e4fa54135f0ac69c861cafad6
It causes DLL loading failure on Windows. Reverting it for now until
it's fixed in upstream wrapdb

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

22 months agogst-integration-testsuites: Update cenc_audio_esds_property_overrides expected output...
Sebastian Dröge [Sat, 17 Dec 2022 17:30:51 +0000 (19:30 +0200)]
gst-integration-testsuites: Update cenc_audio_esds_property_overrides expected output file

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

22 months agoqtdemux: Always use `tfdt` if available in BYTE segments
Sebastian Dröge [Fri, 16 Dec 2022 15:27:33 +0000 (17:27 +0200)]
qtdemux: Always use `tfdt` if available in BYTE segments

This reverts the decision from
  https://bugzilla.gnome.org/show_bug.cgi?id=754230
where it was decided that we rather play safe and only use the `tfdt` if
it is "significantly different" to the sum of sample durations.

As the specification says

    If the time expressed in the track fragment decode time (‘tfdt’) box
    exceeds the sum of the durations of the samples in the preceding
    movie and movie fragments, then the duration of the last sample
    preceding this track fragment is extended such that the sum now
    equals the time given in this box.

we have to use the `tfdt` in general to allow for it to signal gaps in
the stream.

A muxer producing fragments might not yet know the full duration of the
last sample of a previous fragment if the next fragment starts with a
gap, and knowing the actual start of the next fragment would potentially
require to violate latency requirements.

Additionally, the existence of `tfdt` allows to avoid accumulating
rounding errors from summing up the durations.

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

22 months agobasesrc: respect FIXED_CAPS flag in caps query implementation
Mathieu Duponchelle [Sat, 17 Dec 2022 00:36:49 +0000 (00:36 +0000)]
basesrc: respect FIXED_CAPS flag in caps query implementation

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

22 months agod3d11videosink: Fixing focus lost on desktop layout change
Seungha Yang [Sat, 17 Dec 2022 11:04:01 +0000 (20:04 +0900)]
d3d11videosink: Fixing focus lost on desktop layout change

Watch all message on the window thread, instead of internal window only.
Otherwise, some global window messages, such as desktop layout change,
wouldn't be handled by our window.

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

22 months agomeson: Add a patch that fixes pangocairo usage in gst-plugins-rs
Nirbheek Chauhan [Sat, 17 Dec 2022 02:05:48 +0000 (07:35 +0530)]
meson: Add a patch that fixes pangocairo usage in gst-plugins-rs

Also remove an unused patch.

https://gitlab.gnome.org/GNOME/pango/-/merge_requests/665

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

22 months agomacos-bison-binary: Remove warning when running on arm64
Nirbheek Chauhan [Fri, 16 Dec 2022 22:15:23 +0000 (03:45 +0530)]
macos-bison-binary: Remove warning when running on arm64

The x86_64 bison works fine out of the box.

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

22 months agoavfvideosrc: Report latency when doing screen capture
Nirbheek Chauhan [Fri, 16 Dec 2022 19:31:00 +0000 (01:01 +0530)]
avfvideosrc: Report latency when doing screen capture

There is no `device` when doing screen capture, but there is always an
`input`, so use that to decide when we can reply to a latency query.
Without this, the latency query just fails.

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

22 months agovaav1dec: Remove double caps unref.
Victor Manuel Jaquez Leal [Fri, 16 Dec 2022 17:15:04 +0000 (18:15 +0100)]
vaav1dec: Remove double caps unref.

There was a duplicated caps unref raising a warning.

Also it reorgs the sorrounding code for simplicity.

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

22 months agod3d11videosink: Move potentially time-consuming operations to ::prepare()
Seungha Yang [Thu, 15 Dec 2022 17:52:08 +0000 (02:52 +0900)]
d3d11videosink: Move potentially time-consuming operations to ::prepare()

Move following tasks to ::prepare() from ::show_frame()
* CPU -> GPU upload
* GstD3D11Window object setup, including input caps change handling

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

22 months agod3d11videosink: Call ShowWindow() from window thread
Seungha Yang [Fri, 16 Dec 2022 12:42:50 +0000 (21:42 +0900)]
d3d11videosink: Call ShowWindow() from window thread

... when rendering on external HWND. ShowWindow() will cause
synchronous message passing to window thread and then can be blocked.
At the same time, window thread can wait for GStreamer thread.
Instead of the synchronous call, queue the task to window message
and performs from the window thread.

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

22 months agoChange GstSdp.sdp_message_parse_buffer to GstSdp.SDPMessage.new_from_text in examples
Seungmin Kim [Mon, 28 Nov 2022 14:54:27 +0000 (14:54 +0000)]
Change GstSdp.sdp_message_parse_buffer to GstSdp.SDPMessage.new_from_text in examples

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

22 months agotests: Cast drop-messages-interval type properly
A. Wilcox [Fri, 16 Dec 2022 07:00:46 +0000 (01:00 -0600)]
tests: Cast drop-messages-interval type properly

The rtpjitterbuffer test drop_messages_interval uses a GstClockTime for
the message drop interval.  This property is defined as a guint.  On
systems with 64-bit time_t but 32-bit uint, this can cause the
g_object_set function to fail to read the arguments properly.

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

22 months agod3d11videosink: Fix deadlock when parent window is busy
Seungha Yang [Wed, 14 Dec 2022 16:15:10 +0000 (01:15 +0900)]
d3d11videosink: Fix deadlock when parent window is busy

Deadlock sequence:
* From a streaming thread, d3d11videosink sends synchronous message
  to the parent window, so that internal (child) window can be
  constructed on the parent window's thread
* App thread (parent window thread) is waiting for pipeline's
  state change (to GST_STATE_NULL) but streaming thread is
  blocked and waiting for app thread

To avoid the deadlock, GstD3D11WindowWin32 should send message
to the parent window asynchronously.

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

22 months agobase:navigation: Cleanup navigation key modifiers enum
Thibault Saunier [Tue, 13 Dec 2022 11:23:56 +0000 (12:23 +0100)]
base:navigation: Cleanup navigation key modifiers enum

We were exposing the 'ALT' modifier as if we were guaranteeing its
accuracy but truth is we were only exposing configuration dependent
values.

Make the API simpler for now, the same way as Gtk3 was exposing it, and
when we have time to guarantee more values by making them take backends
configuration into account, we will expose those values in a accurate
way.

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

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

22 months agoglupload: add CAN_ACCEPT_RAW to all dma-buf uploaders
Matthew Waters [Wed, 30 Nov 2022 04:04:09 +0000 (04:04 +0000)]
glupload: add CAN_ACCEPT_RAW to all dma-buf uploaders

Fixes cases where a dma-buf would be uploaded using direct-dma-buf
into an external-oes texture (using video/x-raw caps) and then
attempting to reconfigure the same source.

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

22 months agogst: handle combinations in gst_stream_type_get_name()
Hosang Lee [Wed, 27 Jul 2022 15:43:42 +0000 (00:43 +0900)]
gst: handle combinations in gst_stream_type_get_name()

This should handle the majority of the valid stream cases.
The element setting the stream type may set each type separately.

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

22 months agoglvideomixer: override sink pad template
Guillaume Desmottes [Fri, 3 Jun 2022 09:40:35 +0000 (11:40 +0200)]
glvideomixer: override sink pad template

Allow us to pass the GType of its pad and so
improve the documentation when inspecting glvideomixer.

Fix #1253

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

22 months agoqtdemux: Clear protection events when we get new ones
Xabier Rodriguez Calvar [Fri, 9 Dec 2022 10:35:25 +0000 (11:35 +0100)]
qtdemux: Clear protection events when we get new ones

If we keep the old events they can be end up being passed to the app, that could
discard the protection information because it has been seen before.

Drive by improvement: use g_queue_clear_full instead of foreach+clear for
protection events.

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

22 months agowebrtc: implement support for msid values
Matthew Waters [Tue, 18 Oct 2022 01:17:04 +0000 (12:17 +1100)]
webrtc: implement support for msid values

Local msid values are taken from sink pad property, or fallback to the
previously used cname.

The remote msid values are exposed on the relevant src pads.

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

22 months agomacos: Add wrapper API to run a NSApplication in the main thread
Piotr Brzeziński [Tue, 13 Dec 2022 17:42:11 +0000 (18:42 +0100)]
macos: Add wrapper API to run a NSApplication in the main thread

On macOS, a Cocoa event loop is needed in the main thread to ensure
things like opening a GL window work correctly. In the past, this was
patched into glib via Cerbero, but that prevented us from updating it.
This workaround simply runs an NSApplication and then calls the
main function on a secondary thread, allowing GStreamer to correctly
display windows and/or system permission prompts, for example.

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

22 months agosystemclock: Use `futex_time64` syscall if available (32-bit systems) and use correct...
Sebastian Dröge [Mon, 12 Dec 2022 09:34:51 +0000 (11:34 +0200)]
systemclock: Use `futex_time64` syscall if available (32-bit systems) and use correct `struct timespec` definition

See also https://gitlab.gnome.org/GNOME/glib/-/issues/2634

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

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

22 months agogst_init: Removed wrong warning in docstring
sezanzeb [Sat, 15 Aug 2020 12:53:13 +0000 (12:53 +0000)]
gst_init: Removed wrong warning in docstring

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

22 months agoh264parser: Update doc for GST_H264_FRMAE_PACKING_TOP_BOTTOM
Seungha Yang [Mon, 12 Dec 2022 19:31:24 +0000 (04:31 +0900)]
h264parser: Update doc for GST_H264_FRMAE_PACKING_TOP_BOTTOM

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

22 months agoh264parser: typo fix in enum value
Brad Hards [Sun, 7 Nov 2021 00:18:15 +0000 (11:18 +1100)]
h264parser: typo fix in enum value

Old value is marked deprecated, new enum with same entry is added. Should be binary compatible.

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