platform/upstream/gstreamer.git
22 months agovideoconvert,videoscale: Do conversion in videoconvert and scaling in videoscale
Seungha Yang [Fri, 5 Aug 2022 11:52:19 +0000 (20:52 +0900)]
videoconvert,videoscale: Do conversion in videoconvert and scaling in videoscale

Keep behaving the same as before videoconvertscale port

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

22 months agoRevert "videoconvertscale: Add properties to disable scaling/converting in videoconve...
Seungha Yang [Fri, 5 Aug 2022 11:16:00 +0000 (20:16 +0900)]
Revert "videoconvertscale: Add properties to disable scaling/converting in videoconvert/videoscale"

This reverts commit cd7a91cef1c6a2e24d440126b7f2ab543fb205c5.

Reverting properties, scaling in videoconvert and converting in
videoscale will be disabled by the other commit

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

22 months agomssdemux2: Use gsturi structure to form fragment urls
Hosang Lee [Thu, 11 Aug 2022 00:34:58 +0000 (09:34 +0900)]
mssdemux2: Use gsturi structure to form fragment urls

Utilize gsturi to form fragment url paths.
A token query may contain the string "manifest" and this would lead
to improper url creations.

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

22 months agometa: Set the parent refcount of the GstStructure correctly
Nirbheek Chauhan [Mon, 15 Aug 2022 14:37:09 +0000 (20:07 +0530)]
meta: Set the parent refcount of the GstStructure correctly

The parent refcount is of the *transformed* buffer, not the input
buffer.

Also update the docs to clarify that @transbuf is the transformed
buffer, and not the buffer on which a transformation is being
performed.

Due to this bug, modifying the structure of a meta that has been
copied to another buffer fails with:

gst_structure_set: assertion 'IS_MUTABLE (structure) || field == NULL' failed

Add a test for the same.

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

22 months agod3d11decoder: Do timer based DecoderBeginFrame retry
Seungha Yang [Sun, 14 Aug 2022 16:50:15 +0000 (01:50 +0900)]
d3d11decoder: Do timer based DecoderBeginFrame retry

... instead of retry count based one, because the precision of Sleep()
varies depending on system and application configuration.
Also, don't retry DecoderBeginFrame if decoder is doing flush.

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

22 months agocudaupload,cudadownload: Don't simplify caps in transform_caps
Seungha Yang [Sun, 14 Aug 2022 12:18:24 +0000 (21:18 +0900)]
cudaupload,cudadownload: Don't simplify caps in transform_caps

The simplified caps might not be a subset of filter caps
and basetransform will complain about it.

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

22 months agod3d11decoder: Do not use miniobject qdata
Seungha Yang [Sun, 14 Aug 2022 15:22:14 +0000 (00:22 +0900)]
d3d11decoder: Do not use miniobject qdata

The miniobject qdata uses global mutex.
Use ID3D11DeviceChild::{Set,Get}PrivateData methods instead.

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

22 months agossaparse: include required system headers for isspace() and sscanf() functions
Khem Raj [Sat, 13 Aug 2022 05:42:28 +0000 (22:42 -0700)]
ssaparse: include required system headers for isspace() and sscanf() functions

Newer compilers ( clang 15 ) have turned stricter and errors out instead
of warning on implicit function declations

Fixes
gstssaparse.c:297:12: error: call to undeclared library function 'isspace' with type 'int (int)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    while (isspace(*t))

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

22 months agodocs: Remove dxgiscreencapsrc from documentation
Seungha Yang [Fri, 12 Aug 2022 20:24:03 +0000 (05:24 +0900)]
docs: Remove dxgiscreencapsrc from documentation

The implementation was dropped in
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1750

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

22 months agoplayer: Don't leak wrapped video info
Sebastian Dröge [Sat, 13 Aug 2022 09:24:37 +0000 (12:24 +0300)]
player: Don't leak wrapped video info

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

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

22 months agoplay: Make ownership of video-sink clearer in combination with floating references
Sebastian Dröge [Sat, 13 Aug 2022 08:50:20 +0000 (11:50 +0300)]
play: Make ownership of video-sink clearer in combination with floating references

And correctly handle the case of VideoRenderer::create_video_sink() not
actually returning a floating reference, which might be tricky for some
bindings.

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

22 months agoplay: Fix object construction
Sebastian Dröge [Sat, 13 Aug 2022 08:49:08 +0000 (11:49 +0300)]
play: Fix object construction

Ideally new() functions should simply call g_object_new() and not much
else, so let's do that here and handle all the construction properly in
a GObject way.

Now a play object created via g_object_new() is actually usable.

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

22 months agoplayer: Fix object construction
Sebastian Dröge [Sat, 13 Aug 2022 08:39:59 +0000 (11:39 +0300)]
player: Fix object construction

Ideally new() functions should simply call g_object_new() and not much
else, so let's do that here and handle all the construction properly in
a GObject way.

Now a player object created via g_object_new() is actually usable.

In addition, also fix the video-renderer property so that reading it
returns an object of the correct type.

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

22 months agoplayer: Release signal adapter on finalize
Sebastian Dröge [Sat, 13 Aug 2022 08:30:35 +0000 (11:30 +0300)]
player: Release signal adapter on finalize

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

22 months agomxfdemux: Always calculate BlockAlign of raw audio
Seungha Yang [Mon, 8 Aug 2022 14:37:11 +0000 (23:37 +0900)]
mxfdemux: Always calculate BlockAlign of raw audio

Workaround for nBlockAlign and nBitsPerSample mismatch. Always
use the formula described in the specification for BlockAlign value

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

22 months agortspsrc: Consider the actual control base URI also in case the connection URI contain...
Sebastian Dröge [Fri, 12 Aug 2022 10:20:01 +0000 (13:20 +0300)]
rtspsrc: Consider the actual control base URI also in case the connection URI contains a query string

That is, get rid of unnecessary and wrong special-casing.

This could always use gst_rtsp_url_get_request_uri_with_control() but as
we only have the control base URI as string it is easier to just call
gst_uri_join_strings().

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

22 months agortspurl: Use gst_uri_join_strings() in gst_rtsp_url_get_request_uri_with_control...
Sebastian Dröge [Fri, 12 Aug 2022 10:16:50 +0000 (13:16 +0300)]
rtspurl: Use gst_uri_join_strings() in gst_rtsp_url_get_request_uri_with_control() instead of a hand-crafted, wrong version

For example the query string of the base must not be taken over to the
request URL unless there is no control path, and control paths can be
absolute and must not be considered relative if they start with a /.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/971

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

22 months agortspurl: Use fail_unless_equals_string() in tests
Sebastian Dröge [Fri, 12 Aug 2022 10:15:46 +0000 (13:15 +0300)]
rtspurl: Use fail_unless_equals_string() in tests

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

22 months agomeson: d3d11: Fix build with GIR enabled
Seungha Yang [Fri, 12 Aug 2022 13:05:36 +0000 (22:05 +0900)]
meson: d3d11: Fix build with GIR enabled

... and remove unused list

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

22 months agoqtdemux: Add reference timestamp meta with UTC times based on the ONVIF Export File...
Sebastian Dröge [Thu, 11 Aug 2022 15:37:18 +0000 (18:37 +0300)]
qtdemux: Add reference timestamp meta with UTC times based on the ONVIF Export File Format CorrectStartTime box to outgoing buffers

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

22 months agogstplayer: Plug a memory leak
Matthias Clasen [Fri, 12 Aug 2022 15:24:41 +0000 (18:24 +0300)]
gstplayer: Plug a memory leak

This was showing up as a memory leak in GTK's
gstreamer media backend:

40 bytes in 1 blocks are definitely lost in loss record 18,487 of 40,868
   at 0x484586F: malloc (vg_replace_malloc.c:381)
   by 0x50D5278: g_malloc (gmem.c:125)
   by 0x50EDBA5: g_slice_alloc (gslice.c:1072)
   by 0x50EFBCC: g_slice_alloc0 (gslice.c:1098)
   by 0x51F2F45: g_type_create_instance (gtype.c:1911)
   by 0x51DAE37: g_object_new_internal (gobject.c:2011)
   by 0x51DC080: g_object_new_with_properties (gobject.c:2181)
   by 0x51DCB20: g_object_new (gobject.c:1821)
   by 0x9855F86: UnknownInlinedFun (gstplayer-wrapped-video-renderer.c:109)
   by 0x9855F86: gst_player_new (gstplayer.c:579)

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

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

22 months agohlsdemux2: Fix reference leak of variant stream
Jan Schmidt [Wed, 10 Aug 2022 19:17:05 +0000 (05:17 +1000)]
hlsdemux2: Fix reference leak of variant stream

When switching back to the previous variant stream
in gst_hls_demux_change_playlist(), fix a couple of
paths that would leak a reference to the previous
variant.

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

22 months agohlsdemux2: Don't leak the datetime in time map structs
Jan Schmidt [Wed, 10 Aug 2022 19:07:10 +0000 (05:07 +1000)]
hlsdemux2: Don't leak the datetime in time map structs

Add a function to clean up GstHLSTimeMap structs
and free the ref on the optional associated GDateTime

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

22 months agohlsdemux2: Fix typefind leak and invalid memory access
Jan Schmidt [Wed, 10 Aug 2022 19:03:10 +0000 (05:03 +1000)]
hlsdemux2: Fix typefind leak and invalid memory access

When typefinding aggregates incoming data to a pending
typefind buffer and then succeeds in typefinding, it
leaks the aggregated buffer, and leaves the caller
accessing an unreffed buffer.

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

22 months agohlsdemux2: m3u8: Fix memory leaks on parsing
Jan Schmidt [Wed, 10 Aug 2022 19:36:15 +0000 (05:36 +1000)]
hlsdemux2: m3u8: Fix memory leaks on parsing

Fix memory leaks when parsing of an m3u8 file is
incomplete, with EXTINF or EXT-X-PROGRAM-DATE-TIME
directives, but no segment url.

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

22 months agohlsdemux2: m3u8: Fix memory leak
Jan Schmidt [Wed, 10 Aug 2022 14:59:50 +0000 (00:59 +1000)]
hlsdemux2: m3u8: Fix memory leak

Clear the GValue holding intermediate GstStructure field
data.

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

22 months agoadaptivedemux2: Fix uninitialised memory usage in debug
Jan Schmidt [Wed, 10 Aug 2022 15:01:07 +0000 (01:01 +1000)]
adaptivedemux2: Fix uninitialised memory usage in debug

Fix printing uninitialised memory by clearing the
GstAdaptiveDemuxClock structure when allocating.

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

22 months agortpst2022-1-fecenc: Drain column packets on EOS
Nirbheek Chauhan [Thu, 11 Aug 2022 20:50:40 +0000 (02:20 +0530)]
rtpst2022-1-fecenc: Drain column packets on EOS

Otherwise we won't send the protection packets for the last few
packets when a stream ends.

Also send EOS on the FEC src row pad immediately, and on the FEC src
column pad after draining is complete. This makes it so that the FEC
src pads on rtpbin behave the same way as the RTCP src pads on rtpbin
when EOS is received on the send_rtp_sink pad.

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

22 months agobasetextoverlay: Don't miscalculate text running times
Jan Schmidt [Wed, 27 Jul 2022 12:34:42 +0000 (22:34 +1000)]
basetextoverlay: Don't miscalculate text running times

When a new segment event arrives, it immediately updates
the current stored segment, which was used for calculating
the running time of the current text buffer for every
passing video frame. This means a segment that arrives
after the text buffer might get used to (mis)calculate
the running times subsequently.

Instead, calculate and store the right running time
using the current segment when storing the buffer. Later
the stored segment can get freely updated.

This fixes the case where pieces of video and text streams
are seamlessly concatenated and fed through the text overlay.
Previously, it could lead to the current text buffer suddenly
have a massive running time and blocking all further input.

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

22 months agod3d11window: fix DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING swap chain flag for full screen
Corentin Damman [Fri, 12 Aug 2022 09:32:45 +0000 (11:32 +0200)]
d3d11window: fix DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING swap chain flag for full screen

Fixes #1372 (regression introduced in 5eeec165)

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

22 months agoqtdemux: Don't use invalid values from failed trex parsing
Edward Hervey [Thu, 11 Aug 2022 06:48:08 +0000 (08:48 +0200)]
qtdemux: Don't use invalid values from failed trex parsing

If parsing the fragment default values (`trex` atom) failed, don't try to
compute a bogus sample_description_id value.

Fixes #1369

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

22 months agowpesrc: Switch URI handler to web+... protocols
Philippe Normand [Wed, 10 Aug 2022 10:12:37 +0000 (11:12 +0100)]
wpesrc: Switch URI handler to web+... protocols

The web://http:// URIs were not compliant with RFC 3986. Using web+http://
allows us to use the GstUri parser to pass down a valid URI to `wpevideosrc`.

Corresponding change for the CEF source element:
https://github.com/centricular/gstcefsrc/commit/8d499495dd79cc0bf9a38ae82b03e374d78f68ae

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

22 months agodocs: copy-paste fix
Krystian Wojtas [Tue, 9 Aug 2022 14:24:48 +0000 (16:24 +0200)]
docs: copy-paste fix

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

22 months agonvcodec: fix caps leaks in nvh264/h265encoder
Corentin Damman [Tue, 9 Aug 2022 10:24:53 +0000 (12:24 +0200)]
nvcodec: fix caps leaks in nvh264/h265encoder

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

22 months agogst: Protect initialization state with a recursive mutex.
Sebastian Dröge [Sat, 9 Jul 2022 14:04:07 +0000 (17:04 +0300)]
gst: Protect initialization state with a recursive mutex.

Otherwise a gst_init() call from a plugin would deadlock if the plugin
is loaded as part of registry updating.

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

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

22 months agoregistry: Remove dead code
Sebastian Dröge [Sat, 9 Jul 2022 14:02:26 +0000 (17:02 +0300)]
registry: Remove dead code

Initialization/updating of the registry can't possible fail and all code
paths always returned TRUE.

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

22 months agogst: Don't fail gst_init() if updating the registry fails
Sebastian Dröge [Sat, 9 Jul 2022 13:50:54 +0000 (16:50 +0300)]
gst: Don't fail gst_init() if updating the registry fails

Everything is already marked as initialized at that point and by failing
no tracers would be loaded or plugin feature rank overrides would be
applied.

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

22 months agovideoflip: Add support for 10/12bit planar formats
Piotr Brzeziński [Tue, 9 Aug 2022 07:42:23 +0000 (09:42 +0200)]
videoflip: Add support for 10/12bit planar formats

Implements support for I420, I422 and Y444 in 10/12 bit LE/BE variants.
I422 is handled separately from the rest, as it needs to consider
the endianness of the current format during most transforms.

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

22 months agovah264enc: Set codec frame sync point if IDR
Víctor Manuel Jáquez Leal [Tue, 9 Aug 2022 10:29:34 +0000 (12:29 +0200)]
vah264enc: Set codec frame sync point if IDR

This flag is used by GstVideoEncoder base class for certain configurations.

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

22 months agovah264enc: Packed headers can be zero.
Víctor Manuel Jáquez Leal [Tue, 9 Aug 2022 10:28:43 +0000 (12:28 +0200)]
vah264enc: Packed headers can be zero.

A driver can report back no packed header support (VA_ENC_PACKED_HEADER_NONE).
This patch removes that false verification.

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

22 months agoopusenc: improve inband-fec property documentation
Tim-Philipp Müller [Tue, 9 Aug 2022 17:06:41 +0000 (18:06 +0100)]
opusenc: improve inband-fec property documentation

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

22 months agoalpha: fix stride issue when out buffer has padding on right
Haihua Hu [Thu, 4 Aug 2022 10:09:52 +0000 (18:09 +0800)]
alpha: fix stride issue when out buffer has padding on right

if outbuf has padding on right, need jump to next line use stride,
otherwise downstream element will show a wrong picture when use the
same stride

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

22 months agod3d11: Use WIN32 API directly for locking with RAII pattern
Seungha Yang [Sun, 7 Aug 2022 14:24:04 +0000 (23:24 +0900)]
d3d11: Use WIN32 API directly for locking with RAII pattern

Such abstraction is unnecessary for this library/plugin.
Use WIN32 API directly instead of GLib wrappers.

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

22 months agod3d11memory: Remove unnecessary locking
Seungha Yang [Sun, 7 Aug 2022 13:41:07 +0000 (22:41 +0900)]
d3d11memory: Remove unnecessary locking

* memory map/unmap is already protected by d3d11 device lock.
  Don't need to take another memory lock.
* Use WIN32 critical section and slim reader/writer lock APIs
  directly instead of GLib wrappers.

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

22 months agovah264enc: Fix caps for mesa gallium.
Víctor Manuel Jáquez Leal [Fri, 5 Aug 2022 15:20:05 +0000 (17:20 +0200)]
vah264enc: Fix caps for mesa gallium.

Radeon mesa gallium driver has a bug which adds P010_10LE sink caps
format. This patch removes formats which arent 420 chroma.

gst_caps_set_format_array() wasn't used because the fix traverse
several structures with potential different formats.

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

22 months agovah264dec: Complete profiles in decoder.
Víctor Manuel Jáquez Leal [Fri, 5 Aug 2022 13:54:39 +0000 (15:54 +0200)]
vah264dec: Complete profiles in decoder.

Instead of specifying all the H.264 "supported" profiles in the global
hash table (used either by decoders and encoders), just complete them
in the decoder only, since the encoder doesn't support them.

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

22 months agohlsdemux2: Requeue header buffer when restarting fragment
Jan Schmidt [Mon, 8 Aug 2022 14:12:58 +0000 (00:12 +1000)]
hlsdemux2: Requeue header buffer when restarting fragment

When returning GST_ADAPTIVE_DEMUX_FLOW_RESTART_FRAGMENT
for the first segment data, we might need to requeue the
header.

This was leading to occasional prerolling stalls on
HLS live streams with renditions.

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

22 months agohlsdemux2: Fix buffer leak when resynching
Jan Schmidt [Sun, 7 Aug 2022 10:56:49 +0000 (20:56 +1000)]
hlsdemux2: Fix buffer leak when resynching

Unref the buffer in gst_hls_demux_handle_buffer() when
returning GST_ADAPTIVE_DEMUX_FLOW_LOST_SYNC

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

22 months agodmabuf: Always skip modifier if it's linear
Olivier Crête [Wed, 15 Jun 2022 21:38:47 +0000 (17:38 -0400)]
dmabuf: Always skip modifier if it's linear

Accepting both NV12 and NV12:0x0000000000000000 will make the
intersection code too painful to write.

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

22 months agod3d11: Don't find global default allocator
Seungha Yang [Fri, 5 Aug 2022 13:34:06 +0000 (22:34 +0900)]
d3d11: Don't find global default allocator

We were using global default allocator already. Pass null
allocator object to *_alloc() methods then the method will
use default allocator.

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

22 months agod3d11memory: Allow null GstD3D11Allocator to alloc methods
Seungha Yang [Fri, 5 Aug 2022 13:23:52 +0000 (22:23 +0900)]
d3d11memory: Allow null GstD3D11Allocator to alloc methods

Similar to gst_allocator_alloc(), use default GstD3D11Allocator
when caller passes null allocator object

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

22 months agod3d11: Use std::call_once()
Seungha Yang [Fri, 5 Aug 2022 15:03:43 +0000 (00:03 +0900)]
d3d11: Use std::call_once()

g_once_init_enter() always takes global mutex for non-GCC build.
Use C++ once call implementation

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

22 months agoadaptivedemux2: Fix a small race on shutdown
Jan Schmidt [Thu, 4 Aug 2022 13:54:27 +0000 (23:54 +1000)]
adaptivedemux2: Fix a small race on shutdown

Make sure gst_adaptive_demux_loop_cancel_call()
never tries to operate on an invalidated main context. Make
sure to clear the main context pointer while holding the lock,
and to check it in gst_adaptive_demux_loop_cancel_call()

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

22 months agod3d11device: Use WIN32 critical section API directly
Seungha Yang [Fri, 5 Aug 2022 19:57:49 +0000 (04:57 +0900)]
d3d11device: Use WIN32 critical section API directly

GLib's GRecMutex will allocate another heap memory for CRITICAL_SECTION
struct and g_rec_mutex_lock/g_rec_mutex_unlock use WIN32 APIs actually.
We don't need such intermediate function calls and redundant heap allocation.
Just call WIN32 APIs directly.

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

22 months agovah264enc: Lock properties read/write.
Víctor Manuel Jáquez Leal [Wed, 3 Aug 2022 15:52:25 +0000 (17:52 +0200)]
vah264enc: Lock properties read/write.

This is a first step for changing properties at runtime.

And add missing bitrate upate and notification.

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

22 months agovah264enc: Use guint32 for rc_ctrl as it's for rc_ctrl_mode.
Víctor Manuel Jáquez Leal [Thu, 4 Aug 2022 11:02:00 +0000 (13:02 +0200)]
vah264enc: Use guint32 for rc_ctrl as it's for rc_ctrl_mode.

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

22 months agovah264enc: Split aud property and its usage.
Víctor Manuel Jáquez Leal [Thu, 4 Aug 2022 10:57:11 +0000 (12:57 +0200)]
vah264enc: Split aud property and its usage.

Just as other property variables, it's split for ease it usage,
particularly after adding access locks.

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

22 months agova: baseenc: Untabbify and format.
Víctor Manuel Jáquez Leal [Thu, 4 Aug 2022 10:00:58 +0000 (12:00 +0200)]
va: baseenc: Untabbify and format.

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

22 months agoadaptivedemux2-stream: Silence a compiler warning
Jan Schmidt [Thu, 21 Jul 2022 17:32:39 +0000 (03:32 +1000)]
adaptivedemux2-stream: Silence a compiler warning

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

22 months agoadaptivedemux2: Move internal FLOW_SWITCH return value.
Jan Schmidt [Wed, 27 Jul 2022 18:17:26 +0000 (04:17 +1000)]
adaptivedemux2: Move internal FLOW_SWITCH return value.

Move the internal-only FLOW_SWITCH custom return value
to GST_FLOW_CUSTOM_SUCCESS+2 to avoid collision with
GST_ADAPTIVE_DEMUX_FLOW_LOST_SYNC

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

22 months agoadaptivedemux2: Modify custom sync loss flow return
Edward Hervey [Wed, 20 Jul 2022 08:57:41 +0000 (10:57 +0200)]
adaptivedemux2: Modify custom sync loss flow return

Make it a custom sucess and not an error

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

22 months agohlsdemux2: Always check DSN if required
Edward Hervey [Tue, 12 Jul 2022 08:44:51 +0000 (10:44 +0200)]
hlsdemux2: Always check DSN if required

We don't want to consider the candidate as being before the playlist if the DSN
don't match

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

22 months agoadaptivedemux2/hlsdemux2: Handle loss of sync when dowloading.
Edward Hervey [Mon, 11 Jul 2022 08:31:42 +0000 (10:31 +0200)]
adaptivedemux2/hlsdemux2: Handle loss of sync when dowloading.

Media playlist updates and fragment downloads happen in an interleaved
fashion. When a media playlist update fails *while* a segment is being
downloaded, this means we lost synchronization.

Properly propagate and handle this

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

22 months agohlsdemux2: Fix initial playlist setup.
Edward Hervey [Fri, 8 Jul 2022 08:48:05 +0000 (10:48 +0200)]
hlsdemux2: Fix initial playlist setup.

There is now only a single case where we setup the initial playlist to 0, which
is for the very first variant stream.

Rendition streams will have the initial playlist "synchronized" against the
variant stream media playlist.

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

22 months agohlsdemux2: Handle loss of synchronization in live
Edward Hervey [Fri, 8 Jul 2022 08:44:51 +0000 (10:44 +0200)]
hlsdemux2: Handle loss of synchronization in live

Loss of synchronization happens when the updated media playlist has no
relationship to the previous ones. This could happen because of network issues,
server issues, etc...

When this happens, we take no chance and "reset" ourselves so that we can "seek
back to live" against the new updated playlists.

Since this happens at the "media playlist update" level, make sure the custom
flow return is propagated up.

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

22 months agoadaptivedemux2: Handle synchronously to lost sync
Edward Hervey [Fri, 8 Jul 2022 08:40:33 +0000 (10:40 +0200)]
adaptivedemux2: Handle synchronously to lost sync

We are already in the main scheduler thread, therefore we can do the "seek back
to live" directly. This also avoids other pending actions to take place.

Also handle the loss of sync when doing manifest updates.

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

22 months agohlsdemux2: Prune time maps when possible
Edward Hervey [Wed, 6 Jul 2022 09:44:57 +0000 (11:44 +0200)]
hlsdemux2: Prune time maps when possible

Add a new method to prune unused time mappings (i.e. which aren't used by any
current media playlist).

Do that when doing flushing seeks. Could be used in other places later too.

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

22 months agohlsdemux2: Allow DSN mismatches when re-syncing playlists
Edward Hervey [Mon, 13 Jun 2022 13:26:22 +0000 (15:26 +0200)]
hlsdemux2: Allow DSN mismatches when re-syncing playlists

Some providers provide completely incompatible DSN across bitrates/renditions,
but do keep MSN consistent.

If we fail to synchronize playlist with DSN, retry without the DSN taken into
account.

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

22 months agoadaptivedemux2: Fixes for period switching in the output loop
Jan Schmidt [Mon, 11 Jul 2022 15:58:30 +0000 (01:58 +1000)]
adaptivedemux2: Fixes for period switching in the output loop

Close some race conditions in switching to the next period,
by ensuring the tracks are completely drained first and by
not outputting EOS events to the output source pad
if there is another period pending.

Fixes Manifest_MultiPeriod_1080p.mpd some more.

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

22 months agoadaptivedemux2: stream: Set period has_next_period flag before EOS
Jan Schmidt [Mon, 11 Jul 2022 15:55:54 +0000 (01:55 +1000)]
adaptivedemux2: stream: Set period has_next_period flag before EOS

Before sending EOS, update the period's has_next_period
flag and/or create the next period. This closes a race
where the output loop might receive the EOS event
and either push it downstream (causing premature EOS),
or receive it and try and switch to the next period
before that period is completely set up.

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

22 months agoadaptivedemux2: period: Rename 'closed' flag to 'has_next_period'
Jan Schmidt [Mon, 11 Jul 2022 15:24:31 +0000 (01:24 +1000)]
adaptivedemux2: period: Rename 'closed' flag to 'has_next_period'

The flag is used to tell the output loop that a
next period is present, since the output loop
can't call the gst_adaptive_demux_has_next_period()
method.

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

22 months agoadaptivedemux2: Recheck for a pending track on drain
Jan Schmidt [Thu, 30 Jun 2022 16:07:05 +0000 (02:07 +1000)]
adaptivedemux2: Recheck for a pending track on drain

When a track is completely drained and EOS, but
there's a pending track on the slot loop again
to switch to that track.

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

22 months agoadaptivedemux2: Check stream selected instead of state
Jan Schmidt [Thu, 30 Jun 2022 16:05:36 +0000 (02:05 +1000)]
adaptivedemux2: Check stream selected instead of state

When combining stream flows, ignore streams that
are not selected, instead of checking whether
the stream state has changed yet.

Fixes another issue with dashdemux2 where it fails to
change to the next period when playing content with
several video, audio and text streams, as with
Manifest_MultiPeriod_1080p.mpd when seeking to 730
just before the end of the first period.

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

22 months agotracers: leaks: delay type name lookup
Tim-Philipp Müller [Wed, 3 Aug 2022 11:32:24 +0000 (12:32 +0100)]
tracers: leaks: delay type name lookup

Micro optimisation: Store the quark of the type name when tracking
objects and only do the quark to string conversion (hashtable lookup)
later when we actually need the string.

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

22 months agotracers: leaks: fix potentially invalid memory access when trying to detect object...
Corentin Damman [Wed, 3 Aug 2022 11:10:02 +0000 (12:10 +0100)]
tracers: leaks: fix potentially invalid memory access when trying to detect object type

The is_gst_mini_object_check would sometimes detect a proper GObject
as a mini object, and then bad things happen.

We know whether a pointer is a proper GObject or a MiniObject here
though, so just pass that information to the right code paths and
avoid the heuristics altogether.

Eliminates all remaining uses of object_is_gst_mini_object().

Fixes #1334

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

22 months agotracers: leaks: fix potentially invalid memory access when trying to detect object...
Tim-Philipp Müller [Wed, 3 Aug 2022 11:10:02 +0000 (12:10 +0100)]
tracers: leaks: fix potentially invalid memory access when trying to detect object type

The is_gst_mini_object_check would sometimes detect a proper GObject
as a mini object, and then bad things happen.

We know whether a pointer is a proper GObject or a MiniObject here
though, so just pass that information to the right code paths and
avoid the heuristics altogether.

There are probably more cases where the check should be eliminated.

Fixes #1334, maybe

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

23 months agogstalsaplugin: return the result of the element registration
Jordan Petridis [Thu, 30 Jun 2022 13:14:27 +0000 (16:14 +0300)]
gstalsaplugin: return the result of the element registration

Previously there were branches that would return FALSE, however
it looks like we forgot to return the new result variable.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/900

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

23 months agod3d11compositor: Add gamma-mode and primaries-mode properties
Seungha Yang [Tue, 2 Aug 2022 18:29:20 +0000 (03:29 +0900)]
d3d11compositor: Add gamma-mode and primaries-mode properties

Allows controlling gamma remap and/or chromatic adaptation behavior.

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

23 months agod3d11videosink: Add gamma-mode and primaries-mode properties
Seungha Yang [Tue, 2 Aug 2022 16:47:46 +0000 (01:47 +0900)]
d3d11videosink: Add gamma-mode and primaries-mode properties

Allows controlling gamma remap and/or chromatic adaptation behavior.

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

23 months agod3d11convert: Add gamma-mode and primaries-mode properties
Seungha Yang [Tue, 2 Aug 2022 16:19:41 +0000 (01:19 +0900)]
d3d11convert: Add gamma-mode and primaries-mode properties

Allows controlling gamma remap and/or chromatic adaptation behavior.

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

23 months agod3d11converter: Add options for gamma and primaries conversion
Seungha Yang [Tue, 2 Aug 2022 15:26:33 +0000 (00:26 +0900)]
d3d11converter: Add options for gamma and primaries conversion

Gamma remap and/or primaries conversion requires additional
processing which might be something user want to avoid, performance
reason for example

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

23 months agowaylandsink: Logging code style updates
Robert Mader [Mon, 1 Aug 2022 11:04:47 +0000 (13:04 +0200)]
waylandsink: Logging code style updates

For better readability of debug messages and to keep similar code
in sync with `GstGtkWaylandsink`.

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

23 months agowaylandsink: Rename occurrences of GstWaylandSink to 'self'
Robert Mader [Thu, 30 Jun 2022 09:48:45 +0000 (11:48 +0200)]
waylandsink: Rename occurrences of GstWaylandSink to 'self'

Rename all occurrences to `self`, making it consintent with `GstWl*`
and `GstGtkWaylandsink`.

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

23 months agoges: Update outdated comment
Seungha Yang [Mon, 1 Aug 2022 21:54:38 +0000 (06:54 +0900)]
ges: Update outdated comment

d3d11compositor is a videoaggregator subclass and no more wrapper bin
since the MR
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2631

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

23 months agovapostproc: Check for colorimetry changes.
Víctor Manuel Jáquez Leal [Tue, 19 Jul 2022 13:10:00 +0000 (15:10 +0200)]
vapostproc: Check for colorimetry changes.

It uses what's merged in
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2765

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

23 months agogtkwaylandsink test: Add navigationtest to example
Olivier Crête [Mon, 11 Apr 2022 20:35:45 +0000 (15:35 -0500)]
gtkwaylandsink test: Add navigationtest to example

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

23 months agoAdd new gtkwaylandsink element
George Kiagiadakis [Wed, 8 Dec 2021 08:30:21 +0000 (10:30 +0200)]
Add new gtkwaylandsink element

This is based on gtksink, but similar to waylandsink uses Wayland APIs
directly instead of rendering with Gtk/Cairo primitives.

Note that the long term plan is to move this into the existing extension
in `-good`, which requires the Wayland library to move the as well.

For this reason several files like `gstgtkutils.*` and `gtkgstbasewidget.*`
are straight copies and should be kept in sync.

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

23 months agosmartencoder: fix detection of avc1
Mathieu Duponchelle [Sat, 22 Jan 2022 01:35:36 +0000 (02:35 +0100)]
smartencoder: fix detection of avc1

While avc1 is the FourCC, avc is the name used in caps

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

23 months agodecodebin2: don't reverse stream topology order
Mathieu Duponchelle [Sat, 22 Jan 2022 01:29:54 +0000 (02:29 +0100)]
decodebin2: don't reverse stream topology order

This can be important for instance when a container holds multiple
tracks with the same media type, with no indication (eg tags) of
which track is the default one.

In that case, players usually pick the first track by default.

This is especially useful when using smart editing with GES, as
it will result in the same ordering as the input file that was
used as a template.

For reference, this yields the same order as ffprobe.

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

23 months agoges: preserve discovery order
Mathieu Duponchelle [Sat, 22 Jan 2022 01:24:23 +0000 (02:24 +0100)]
ges: preserve discovery order

The previous code was storing container children in reverse
addition order, this was mitigated by the fact that track elements
were also stored in reverse order, thus restoring the original
order, but it seems more consistent to preserve order throughout,
the extra cost of append operations is negligible.

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

23 months agogstsmartencoder: don't make calculations for invalid DTS
Mathieu Duponchelle [Fri, 21 Jan 2022 00:02:52 +0000 (01:02 +0100)]
gstsmartencoder: don't make calculations for invalid DTS

Instead, as the current code relies on having a valid DTS (for lining
up passed through and re-encoded segments), simply compute a DTS
from the PTS if the DTS was invalid.

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

23 months agoencoding-profile: don't order profiles by stream ID ..
Mathieu Duponchelle [Thu, 20 Jan 2022 23:57:16 +0000 (00:57 +0100)]
encoding-profile: don't order profiles by stream ID ..

when creating a profile from a discoverer info.

There is no justification for the existing code, and talking with
Thibault he cannot remember why the sort was in place.

On the other hand, this allows GES users to not have to implement
a callback for the select-tracks-for-object callback when using
it to trim a single clip, which the output profile was built from:
track elements will be placed in the appropriate track by default,
that is the one that will be connected to the matching profile.

For multi-clip timelines, the situation doesn't change, users will
still have to implement a callback and do the leg work of placing
track elements (if any) in a matching track (if any).

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

23 months agoencoding-profile: ignore more output caps fields
Mathieu Duponchelle [Thu, 20 Jan 2022 23:49:33 +0000 (00:49 +0100)]
encoding-profile: ignore more output caps fields

chroma-format, bit-depth-chroma, bit-depth-luma are all informative
fields set by the H265 and H265 parser upon receiving an SPS.

They shouldn't be constrained downstream of the parser, instead
if a user wants those to ultimately match certain values they
should do so by constraining a profile.

In this case however, we also always remove the profile constraint
in order to let encoders pick a suitable one as a function of the
raw input video format and their own capabilities.

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

23 months agod3d11videosink: Translate mouse position
Seungha Yang [Mon, 1 Aug 2022 20:06:24 +0000 (05:06 +0900)]
d3d11videosink: Translate mouse position

Converts mouse cursor position represented in display coordinates to
stream coordinates.

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

23 months agod3d11videosink: Early terminate mouse/keyboard event handling
Seungha Yang [Mon, 1 Aug 2022 19:16:31 +0000 (04:16 +0900)]
d3d11videosink: Early terminate mouse/keyboard event handling

... and add missing null check (plus coding style fix)

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

23 months agoparsebin: Avoid crash with unknown streams
Edward Hervey [Mon, 1 Aug 2022 15:25:56 +0000 (17:25 +0200)]
parsebin: Avoid crash with unknown streams

With the new addition of handling unknown sream types we *could* end up with a
chain which doesn't have a current_pad (it's an intermediary one)

Fixes #1287

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

23 months agoaggregator: fix reversed active/flushing arguments in debug log output
Rafael Sobral [Thu, 28 Jul 2022 19:44:20 +0000 (19:44 +0000)]
aggregator: fix reversed active/flushing arguments in debug log output

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

23 months agowebrtc: nice: WeakRef access fixes
Philippe Normand [Sat, 30 Jul 2022 16:28:41 +0000 (17:28 +0100)]
webrtc: nice: WeakRef access fixes

The GstWebRTCNiceStream::ice property getter already hands-off a full reference,
so there is no need to call g_weak_ref_get() in call sites.

Fixes #1350

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

23 months agowebrtc: ice: Fix GstWebRTCICE parent class
Philippe Normand [Sat, 30 Jul 2022 16:19:42 +0000 (17:19 +0100)]
webrtc: ice: Fix GstWebRTCICE parent class

It is a GstObject, not a GObject.

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

23 months agodtls: Properly name encoder/decoder logging categories
Philippe Normand [Sat, 30 Jul 2022 16:43:38 +0000 (17:43 +0100)]
dtls: Properly name encoder/decoder logging categories

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