platform/upstream/gstreamer.git
4 years agovulkan: move fullscreenquad object to library
Matthew Waters [Fri, 29 Nov 2019 02:45:42 +0000 (13:45 +1100)]
vulkan: move fullscreenquad object to library

It's useful and extensible enough to be used by us and other elements

4 years agovulkan: fix up some gir annotations
Matthew Waters [Fri, 29 Nov 2019 00:05:50 +0000 (11:05 +1100)]
vulkan: fix up some gir annotations

4 years agointerlace: Store unsigned integers in unsigned integer types
Sebastian Dröge [Tue, 3 Dec 2019 13:45:26 +0000 (15:45 +0200)]
interlace: Store unsigned integers in unsigned integer types

And add some assertions to guard against overflows and out of bounds
reads.

4 years agointerlace: Increment phase_index before checking if we're at the end of the phase
Sebastian Dröge [Tue, 3 Dec 2019 13:35:57 +0000 (15:35 +0200)]
interlace: Increment phase_index before checking if we're at the end of the phase

Incrementing it afterwards will always have to phase_index >= 1 and we
will never be at the beginning (0) of the phase again, and thus never
reset timestamp tracking accordingly.

This was broken in bea13ef43b719aad96e28766cd4d23652a891a20 in 2010, and
causes interlace to run into integer overflows after 2^31 frames or
about 5 hours at 29.97fps. Due to usage of wrong types for the integers
this then causes negative numbers to be used in calculations and all
calculations spectacularly fail, leading to all following buffers to
have the timestamp of the first buffer minus one nanosecond.

4 years agortmp2sink: Only apply @setDataFrame to onMetaData messages
Jan Alexander Steffens (heftig) [Wed, 27 Nov 2019 14:38:50 +0000 (15:38 +0100)]
rtmp2sink: Only apply @setDataFrame to onMetaData messages

Only the metadata needs to be made "sticky". Custom data messages should
be passed on unmodified.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/merge_requests/878

4 years agortmp2: Add gst_rtmp_message_is_metadata
Jan Alexander Steffens (heftig) [Wed, 27 Nov 2019 14:38:39 +0000 (15:38 +0100)]
rtmp2: Add gst_rtmp_message_is_metadata

https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/merge_requests/878

4 years agortmp2: Add gst_rtmp_connection_set_data_frame
Jan Alexander Steffens (heftig) [Wed, 27 Nov 2019 14:38:20 +0000 (15:38 +0100)]
rtmp2: Add gst_rtmp_connection_set_data_frame

https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/merge_requests/878

4 years agortmp2: Add single-value AMF0 parsing and serializing
Jan Alexander Steffens (heftig) [Wed, 27 Nov 2019 14:37:45 +0000 (15:37 +0100)]
rtmp2: Add single-value AMF0 parsing and serializing

https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/merge_requests/878

4 years agortmp2: Minor changes
Jan Alexander Steffens (heftig) [Wed, 27 Nov 2019 14:36:07 +0000 (15:36 +0100)]
rtmp2: Minor changes

- Remove an unneeded initialization to zero from AmfParser
- Add missing initialization to gst_amf_serialize_command_valist
- Add a g_return_if_fail to gst_rtmp_connection_request_window_size

https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/merge_requests/878

4 years agobuild: use -fvisibility=hidden for objc code
Matthew Waters [Tue, 3 Dec 2019 03:19:05 +0000 (14:19 +1100)]
build: use -fvisibility=hidden for objc code

4 years agovulkan: priviatise _invoke_on_main()
Matthew Waters [Tue, 3 Dec 2019 03:18:49 +0000 (14:18 +1100)]
vulkan: priviatise _invoke_on_main()

https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1132

4 years agodecklink: Add simple device provider for Decklink devices
Sebastian Dröge [Thu, 21 Nov 2019 14:59:29 +0000 (16:59 +0200)]
decklink: Add simple device provider for Decklink devices

4 years agoopenexr: Fix check for when to pass -std=c++98
Nirbheek Chauhan [Sun, 1 Dec 2019 11:34:05 +0000 (17:04 +0530)]
openexr: Fix check for when to pass -std=c++98

commit 6adfb120ab0e1bb0b3439ad725a362cfe4fbe733 added this flag to fix
builds with `-Werror`, and afterwards it was changed to use a version
check when newer versions of openexr moved over to C++11.

However, some distros have backported patches to older openexr
versions which make it require C++11, which makes the version check
incorrect and causes an error because we passed `-Werror -std=c++98`.

Instead, directly check when usage of the header requires `-std=c++98`
with `-Werror` and override the `cpp_std` setting on the target.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1117

4 years agoavfvideosrc: Explicitly request device video permissions for macOS 10.14+
o0Ignition0o [Sat, 30 Nov 2019 13:08:06 +0000 (14:08 +0100)]
avfvideosrc: Explicitly request device video permissions for macOS 10.14+

Since macOS Mojave (10.14), video permissions have to be explicitly
granted by a user in order to open a video device such as a camera.
This commit adds a check for the current permission status, and tries
to request for permission if applicable.

4 years agovulkan: implement caching and reuse of a couple of vulkan resources
Matthew Waters [Tue, 26 Nov 2019 13:25:16 +0000 (00:25 +1100)]
vulkan: implement caching and reuse of a couple of vulkan resources

Includes a new GstVulkanHandlePool base class for pooling different
resources togther.  The descriptor cache object is ported to
GstVulkanHandlePool with the exact same functionality.

A new GstVulkanFenceCache is also implemented for caching fences
which is used internally by GstVulkanDevice for creating or reusing
fences.

The existing GstVulkanTrashFenceList object now caches trash objects.

4 years agovulkan/trash: remove free functions covered by GstVulkanHandle
Matthew Waters [Tue, 26 Nov 2019 07:29:14 +0000 (18:29 +1100)]
vulkan/trash: remove free functions covered by GstVulkanHandle

4 years agovulkancolorconvert: disable YUY2 conversion
Matthew Waters [Tue, 26 Nov 2019 07:27:04 +0000 (18:27 +1100)]
vulkancolorconvert: disable YUY2 conversion

It doesn't work and never seemed to

4 years agovulkan: split vkfullscreenrender into two
Matthew Waters [Tue, 26 Nov 2019 07:11:25 +0000 (18:11 +1100)]
vulkan: split vkfullscreenrender into two

Part 1 is a base class (vkvideofilter) that handles instance, device,
queue retrieval and holding that has been moved to the library
Part 2 is a fullscreenrenderquad that is still in the plugin that
performs all of the previous vulkan-specific functionality.

4 years agovulkan/upload: allocate from the correct pool
Matthew Waters [Tue, 26 Nov 2019 05:26:41 +0000 (16:26 +1100)]
vulkan/upload: allocate from the correct pool

Only relevant when upstream does not use our provided pool.

4 years agovulkan/handle: add some handle types
Matthew Waters [Tue, 26 Nov 2019 05:25:43 +0000 (16:25 +1100)]
vulkan/handle: add some handle types

4 years agovulkan/image: don't rely on weak-ref notifies for views
Matthew Waters [Mon, 18 Nov 2019 09:29:10 +0000 (20:29 +1100)]
vulkan/image: don't rely on weak-ref notifies for views

Weak refs don't quite work here correctly as there is always a race with
taking the lock between find_view() and remove_view().  If find_view()
returns a view that is going to removed by remove_view() then we have an
interesting situation.

In theory, the number and type of views for an image are relatively
constant and should not change one they've been set up which means that
it is actually practical to perform pool-like reference counting here
where the image holds a pool of different views that it can give out
as necessary.

4 years agovulkan: add a couple of missing fence unrefs
Matthew Waters [Mon, 18 Nov 2019 04:20:18 +0000 (15:20 +1100)]
vulkan: add a couple of missing fence unrefs

4 years agovulkan/colorconvert: zero out sampler create struct
Matthew Waters [Fri, 4 Oct 2019 06:05:05 +0000 (16:05 +1000)]
vulkan/colorconvert: zero out sampler create struct

4 years agowasapisrc: Correctly handle BUFFERFLAGS_SILENT
Nirbheek Chauhan [Tue, 26 Nov 2019 06:09:32 +0000 (11:39 +0530)]
wasapisrc: Correctly handle BUFFERFLAGS_SILENT

We need to ignore the data we get from WASAPI in this case and write
out silence (zeroes).

Initially reported at https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/808

4 years agowasapisrc: Try harder to avoid debug output in the hot loop
Nirbheek Chauhan [Mon, 25 Nov 2019 15:55:43 +0000 (21:25 +0530)]
wasapisrc: Try harder to avoid debug output in the hot loop

The whole `src_read()` function is a hot loop since the ringbuffer
thread is waiting on us, and printing to the console from inside it
can easily cause us to miss our deadline.

F.ex., if you had GST_DEBUG=3 and we accidentally missed a device
period, we'd trigger the "reported glitch" warning, which would cause
us to miss another device period, and so on. Let's reduce the log
level so that GST_DEBUG=3 is more usable, and only print buffer flag
info when it's actually relevant.

4 years agowasapisrc: Fix capturing from some buggy audio drivers
Nirbheek Chauhan [Mon, 25 Nov 2019 15:49:59 +0000 (21:19 +0530)]
wasapisrc: Fix capturing from some buggy audio drivers

Some audio drivers return varying amounts of data per ::GetBuffer
call, instead of following the device period that they've told us
about in `src_prepare()`.

Previously, we would just drop those extra buffers hoping that the
extra buffers were temporary (f.ex., a startup 'burst' of audio data).
However, it seems that some audio drivers, particularly on older
Windows versions (such as Windows 10 1703 and older) consistently
return varying amounts of data.

Use GstAdapter to smooth that out, and hope that the audio driver is
locally varying but globally periodic.

Initially reported in https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/808

4 years agowasapisrc: Clarify that nBlockAlign is actually bpf
Nirbheek Chauhan [Mon, 25 Nov 2019 15:46:05 +0000 (21:16 +0530)]
wasapisrc: Clarify that nBlockAlign is actually bpf

bpf = bytes per frame.

4 years agowasapisrc: Fix glitching and clock skew issues
Nirbheek Chauhan [Mon, 25 Nov 2019 15:30:14 +0000 (21:00 +0530)]
wasapisrc: Fix glitching and clock skew issues

We were miscalculating the device period, i.e. the number of frames
we'll get from WASAPI in each IAudioClient::GetBuffer call, due to
a calculation mistake (truncate instead of round).

For example, on my machine when the aux input is set to 44.1KHz, the
reported device period is 101587, which comes out to 447.998 frames
per ::GetBuffer call. In reality we will, of course, get 448 frames
per call, but we were truncating, so we expected 447 and were
discarding one frame every time. This led to glitching, and skew over
time.

Interestingly, I can only see this with 44.1Khz. 48Khz/96Khz are fine,
because the device period is a more 'even' number.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/806

4 years agoatscmux: Add missing break in switch
Edward Hervey [Wed, 27 Nov 2019 14:41:26 +0000 (15:41 +0100)]
atscmux: Add missing break in switch

CID: 1455515

4 years agomsdk: Fix mixed declarations warning
Seungha Yang [Wed, 27 Nov 2019 03:24:46 +0000 (12:24 +0900)]
msdk: Fix mixed declarations warning

msdk.c:194:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]

4 years agoh264parse: buffer mismatch in map/unmap
Aaron Boxer [Tue, 26 Nov 2019 18:05:38 +0000 (13:05 -0500)]
h264parse: buffer mismatch in map/unmap

4 years agomsdkdec: log an error if leaking surfaces in finalize
Julien Isorce [Tue, 19 Nov 2019 23:35:20 +0000 (15:35 -0800)]
msdkdec: log an error if leaking surfaces in finalize

The for loop in gst_msdkdec_handle_frame is error prone
about how it manages surfaces. Because sometimes it sets
the surface variable to NULL and sometimes it needs to free
it right away. So better to print an error if surfaces are
leaked to help with any change around the loop.

4 years agowaylandsink: Commit the parent after creating subsurface
Jeffy Chen [Mon, 25 Nov 2019 11:08:48 +0000 (19:08 +0800)]
waylandsink: Commit the parent after creating subsurface

We should commit the parent to activate new subsurface, this is
documented in the protocol.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
4 years agottmlparse: Collect buffers until detecting complete xml document
Seungha Yang [Fri, 20 Jul 2018 12:33:24 +0000 (21:33 +0900)]
ttmlparse: Collect buffers until detecting complete xml document

Given buffer could be fragmented and we might need to
collect buffers until end tag is detected. And/or, a buffer
can consist of multiple ttml documents.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/494

4 years agomsdk: query hardware when checking MFX availability
Aaron Boxer [Wed, 20 Nov 2019 19:19:02 +0000 (13:19 -0600)]
msdk: query hardware when checking MFX availability

msdk plugin is not used for sofware encode/decode as there are better
solutions available. Also, with MFX_IMPL_AUTO_ANY, if software decode
is not supported, the plugin will still load, but will then fail when trying to
run the (autoplugged) pipeline. With MFX_IMPL_HARDWARE_ANY,
the plugin fails and a better software decoder is auto-plugged.

4 years agomsdk: query platform when opening session
Aaron Boxer [Wed, 20 Nov 2019 19:09:34 +0000 (13:09 -0600)]
msdk: query platform when opening session

4 years agonvenc: Fix crash when nvenc was reused then freed without encoding
Seungha Yang [Thu, 14 Nov 2019 10:00:51 +0000 (19:00 +0900)]
nvenc: Fix crash when nvenc was reused then freed without encoding

GstNvBaseEnc::n_bufs was set from the previous encoding session
but it wasn't cleared after stop. That might result to invalid memory
access at the next start (no encoded data) and then stop sequence.
Instead of defining a variable for array length, use GArray::len
directly to avoid such confusion.

4 years agonvenc: Remove unused code path
Seungha Yang [Thu, 14 Nov 2019 09:57:14 +0000 (18:57 +0900)]
nvenc: Remove unused code path

refilling queue would not happen

4 years agowebrtcdatachannels: Don't leak strings
Edward Hervey [Thu, 21 Nov 2019 15:38:35 +0000 (16:38 +0100)]
webrtcdatachannels: Don't leak strings

They would leak in error cases

CID: 1455480

4 years agowebrtcbin: Fix memory leak
Edward Hervey [Thu, 21 Nov 2019 15:24:38 +0000 (16:24 +0100)]
webrtcbin: Fix memory leak

The structure is not used after this block

CID: 1455481

4 years agoadaptivedemux: fix 'utc now' gdatetime creation
Thiago Santos [Wed, 20 Nov 2019 03:29:26 +0000 (19:29 -0800)]
adaptivedemux: fix 'utc now' gdatetime creation

It broke after removal of usage of GTimeVal that was deprecated,
it requires seconds in this unix-based creation instead of microseconds.

The downside here is that it will create an extra object just to be
discarded in order to add the microsecond part to it.

It would end up segfaulting as it would return a NULL value

4 years agosrtobject: allow passing SRT Stream ID in stream URI
Jakub Adam [Mon, 18 Nov 2019 15:15:21 +0000 (16:15 +0100)]
srtobject: allow passing SRT Stream ID in stream URI

Based on Stream ID, the application can accept or reject the connection,
select the desired data stream, or set an appropriate passphrase for the
connection. Example usage:

  srt://127.0.0.1:1234?streamid=mystream

4 years agocurl: Require libcurl 7.55.0
Linus Svensson [Wed, 20 Nov 2019 10:34:15 +0000 (11:34 +0100)]
curl: Require libcurl 7.55.0

CURLINFO_CONTENT_LENGTH_DOWNLOAD_T is available from libcurl version
7.55.0.

4 years agomsdkdec: fix surface leak in msdkdec_handle_frame
Julien Isorce [Mon, 18 Nov 2019 22:26:31 +0000 (14:26 -0800)]
msdkdec: fix surface leak in msdkdec_handle_frame

Can be reproduced with:
  videotestsrc ! x264enc key-int-max=$N ! \
  h264parse ! msdkh264dec ! fakesink sync=1

It happens with any gop size but the smaller is the distance N
between key frames, the quicker it is leaking.

Fixes #1023

4 years agodash: Fix typo in meson.build
Xavier Claessens [Mon, 18 Nov 2019 20:54:42 +0000 (15:54 -0500)]
dash: Fix typo in meson.build

4 years agoavtpcvfdepay: Don't hide gst_pad_push return
Ederson de Souza [Fri, 1 Nov 2019 22:58:47 +0000 (15:58 -0700)]
avtpcvfdepay: Don't hide gst_pad_push return

avtpcvfdepay was effectively hiding any return from gst_pad_push, so no
errors or GST_FLOW_EOS would be propagated upstream.

Tests also added.

4 years agoavtpcvfpay: Do not hide or modify gst_pad_push errors
Ederson de Souza [Fri, 1 Nov 2019 22:39:25 +0000 (15:39 -0700)]
avtpcvfpay: Do not hide or modify gst_pad_push errors

Current code would change any non-ok return from gst_pad_push to
GST_FLOW_ERROR, thus hiding meaningful returns such as GST_FLOW_EOS.

Tests also added.

4 years agoavtpcvfdepay: Tone down some log messages
Ederson de Souza [Wed, 30 Oct 2019 22:24:40 +0000 (15:24 -0700)]
avtpcvfdepay: Tone down some log messages

Most of avtpcvfdepay messages are currently logged as warnings, which can
make some scenarios - such as receiving two AVTP streams on the same
pipeline - too verbose.

This patch tones those message down to INFO or DEBUG level - more in
sync with avtpaafdepay logging.

4 years agortpmanagerbad: allow setting multicast-iface
Marc Leeman [Mon, 18 Nov 2019 14:42:35 +0000 (15:42 +0100)]
rtpmanagerbad: allow setting multicast-iface

Allowing the UDP elements to bind on an interface is needed in more
complex networks where there are mutiple networks interfaces without
default gateway

4 years agotimecodestamper: Create LTC sink pad with the correct name according to the template
Sebastian Dröge [Tue, 19 Nov 2019 10:18:39 +0000 (12:18 +0200)]
timecodestamper: Create LTC sink pad with the correct name according to the template

Should be "ltc_sink" and not just "ltc"

4 years agovideoparsers: Disable gst_base_parse_set_infer_ts
Vivia Nikolaidou [Fri, 11 Oct 2019 13:19:26 +0000 (16:19 +0300)]
videoparsers: Disable gst_base_parse_set_infer_ts

From the documentation of gst_base_parse_set_infer_ts, it should be
disabled for non-audio data. Currently just disabling for all video
parsers that have reordered data: h264, h265, mpeg, mpeg4, vc1. Was
already disabled in h263.

4 years agoandroidmedia: Add new effects and scene modes to Camera parameters
Andrew Branson [Mon, 18 Nov 2019 22:38:49 +0000 (23:38 +0100)]
androidmedia: Add new effects and scene modes to Camera parameters

4 years agophotography: Add additional settings relevant to Android
Andrew Branson [Thu, 10 Oct 2019 16:18:26 +0000 (18:18 +0200)]
photography: Add additional settings relevant to Android

Exposure mode property, extra colour tone values (aqua, emboss, sketch, neon), extra scene modes (backlight, flowers, AR, HDR).
Missing vmethods for exposure mode, analog gain, lens focus, colour temperature, min & max exposure time

Contribs by Mohammed Sameer <msameer@foolab.org>, Adam Pigg <adam@piggz.co.uk>

4 years agotsmux: Fix copying of buffer region
Kyrylo Polezhaiev [Thu, 5 Sep 2019 01:16:28 +0000 (03:16 +0200)]
tsmux: Fix copying of buffer region

4 years agod3dvideosink: use sink dimensions when calculating overlay scaling
Aaron Boxer [Fri, 15 Nov 2019 19:12:48 +0000 (13:12 -0600)]
d3dvideosink: use sink dimensions when calculating overlay scaling

4 years agod3dvideosink: use explicit system memory feature in overlay composition caps
Aaron Boxer [Fri, 15 Nov 2019 03:06:09 +0000 (22:06 -0500)]
d3dvideosink: use explicit system memory feature in overlay composition caps

4 years agomsdk: Fixes for meson include directory setup
Jochen Henneberg [Tue, 5 Nov 2019 12:46:59 +0000 (13:46 +0100)]
msdk: Fixes for meson include directory setup

In case of pkg-config we need to create the include directories object
from the path using include_directories(). For INTELMEDIASDKROOT or
MFX_HOME we need to add the alternate include path ./include/mfx as
Intel MediaSDK now puts the headers there.

4 years agortpmanagerbad: name the element children
Marc Leeman [Mon, 23 Sep 2019 08:30:40 +0000 (10:30 +0200)]
rtpmanagerbad: name the element children

As discussed with RIST, it is best to name the children of the elements
since these are now created at the element initialisation.

4 years agocurlhttpsrc: add support for range GET
Alex Ashley [Fri, 24 May 2019 16:33:33 +0000 (17:33 +0100)]
curlhttpsrc: add support for range GET

To allow curlhttpsrc to support DASH streams that use the on-demand
profile, it needs to support HTTP Range GETs. In GStreamer, the RANGE
is specified by issuing a GST_FORMAT_BYTES seek to set the start and
end of the range. curlhttpsrc needs to implement seek and set the
appropriate curl options to make it add the Range header to the
request.

4 years agotsdemux: Always issue a DTS even when it's equal to PTS
Vivia Nikolaidou [Fri, 11 Oct 2019 14:25:04 +0000 (17:25 +0300)]
tsdemux: Always issue a DTS even when it's equal to PTS

Currently tsdemux timestamps only the PTS, and only issues the DTS if
it's different. In that case, parsers tend to estimate the next DTS
based on the previous DTS and the duration, which can accumulate
rounding errors.

4 years agovulkan/queue: be sure to take a lock around command submission
Matthew Waters [Wed, 13 Nov 2019 23:00:35 +0000 (10:00 +1100)]
vulkan/queue: be sure to take a lock around command submission

This ensures that only one thread is submitting commands at a time as
required by the Vulkan specification.

4 years agovulkan/render: fix indent command comment typo
Matthew Waters [Wed, 13 Nov 2019 22:56:49 +0000 (09:56 +1100)]
vulkan/render: fix indent command comment typo

4 years agod3d11window: Fix subclass procedure recursion
Seungha Yang [Wed, 13 Nov 2019 11:17:48 +0000 (20:17 +0900)]
d3d11window: Fix subclass procedure recursion

subclass window precedure should be cleared if it's no more used.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1115

4 years agovulkan: NULL check destruction of vulkan resources
Matthew Waters [Wed, 13 Nov 2019 01:14:02 +0000 (12:14 +1100)]
vulkan: NULL check destruction of vulkan resources

If the element fails to start up, any number of vulkan resources could
have not been created.

4 years agovulkan: make new trash objects ref the fence
Matthew Waters [Wed, 13 Nov 2019 01:07:45 +0000 (12:07 +1100)]
vulkan: make new trash objects ref the fence

Avoids gst_vulkan_fence_ref at each call site of the trash object
creation

4 years agovulkan/wayland: advertise the current surface size
Matthew Waters [Wed, 13 Nov 2019 01:05:52 +0000 (12:05 +1100)]
vulkan/wayland: advertise the current surface size

Avoids vkswapper from creating a 0x0 output VkSurface and failing

4 years agoswitchbin: Free path objects on finalize
Jan Schmidt [Tue, 12 Nov 2019 11:06:45 +0000 (22:06 +1100)]
switchbin: Free path objects on finalize

Clean up path objects nicely when shutting down,
first by dropping pointers to elements during dispose,
and then by making sure to drop the ref to the path object
when finalizing the switch bin.

Fixes valgrind checks in the unit test.

4 years agoswitchbin: Add a basic unit-test
Jan Schmidt [Mon, 2 Jul 2018 14:30:12 +0000 (00:30 +1000)]
switchbin: Add a basic unit-test

Test the basic function of a switchbin - that it correctly
selects between 2 processing paths based on caps

4 years agoswitchbin: Add current-path property
Jan Schmidt [Mon, 2 Jul 2018 14:25:51 +0000 (00:25 +1000)]
switchbin: Add current-path property

Returns the index of the currently selected processing
path, or MAX-UINT if none

4 years agoswitchbin: Add docs
Jan Schmidt [Mon, 4 Nov 2019 14:40:10 +0000 (01:40 +1100)]
switchbin: Add docs

Add documentation clauses and enrol switchbin to generate
plugin docs

4 years agoswitchbin: Initial checkin
Jan Schmidt [Mon, 4 Nov 2019 14:40:04 +0000 (01:40 +1100)]
switchbin: Initial checkin

Add code from Stream Unlimited implementing a bin
which switches between different internal decoding/processing
chains based on input caps

4 years agod3d11videosink: only destroy loop if external_win_id is false
Aaron Boxer [Wed, 13 Nov 2019 01:54:46 +0000 (19:54 -0600)]
d3d11videosink: only destroy loop if external_win_id is false

Loop was created with this condition, so it should also be
destroyed under the same condition

4 years agomeson: Fix plugin symbol export for C++ sources/plugins
Jan Schmidt [Fri, 6 Sep 2019 09:13:46 +0000 (19:13 +1000)]
meson: Fix plugin symbol export for C++ sources/plugins

The symbol visibility=hidden flag was only being applied to C
compilation, so plugins implemented in C++ would leak extra symbols
than the 2 _get_desc() and _register().

That also showed that the gst-libs opencv C++ lib was not marking
symbols for export correctly because the BUILDING_GST_OPENCV define
wasn't in the C++ args, so fix that too.

4 years agortmp2: Fix NULL check in gst_rtmp_meta_transform
Jan Alexander Steffens (heftig) [Tue, 12 Nov 2019 11:04:48 +0000 (12:04 +0100)]
rtmp2: Fix NULL check in gst_rtmp_meta_transform

Coverity rightly complains that checking a pointer for NULL after
dereferencing it is pointless.

Remove the check, and to be safe, assert that gst_buffer_add_meta
returns non-NULL.

CID 1455485

4 years agortmp2: Check for missing GstRtmpMeta
Jan Alexander Steffens (heftig) [Tue, 12 Nov 2019 10:46:21 +0000 (11:46 +0100)]
rtmp2: Check for missing GstRtmpMeta

The message buffers are created using `gst_rtmp_message_new` and thus
always contain a GstRtmpMeta. Add checks to appease Coverity's static
analysis.

CID 1455596
CID 1455384

4 years agortmp2sink: Add a check that meta isn't NULL before accessing
Vivia Nikolaidou [Tue, 12 Nov 2019 10:31:48 +0000 (12:31 +0200)]
rtmp2sink: Add a check that meta isn't NULL before accessing

It really can't be NULL, this is just to convince coverity

CID 1455553

4 years agokmssink: Do not drain if imported buffer are from KMS
Nicolas Dufresne [Fri, 8 Nov 2019 23:00:46 +0000 (18:00 -0500)]
kmssink: Do not drain if imported buffer are from KMS

This adds a check to avoid draining when the imported buffers are in
fact own by kmssink. This happens since we export our kms buffer as
DMABuf. They are not really imported back as we pre-fill the cache,
but uses the same format as if they were external. This fixes
performance issues seen with videocrop2-test (found in -good).

4 years agokmssink: Avoid drain on caps changes
Nicolas Dufresne [Fri, 8 Nov 2019 22:57:58 +0000 (17:57 -0500)]
kmssink: Avoid drain on caps changes

Draining systematically on caps changes was a hack. Instead, properly
save the render information used to render last_render, and use that
information to drain. This fixes performance issues met with video crop
meta and per frame caps changes.

4 years agokmssink: Ensure we have an allocator before importing
Nicolas Dufresne [Fri, 8 Nov 2019 22:48:40 +0000 (17:48 -0500)]
kmssink: Ensure we have an allocator before importing

This fixes cases where the kms allocator API was called with a null
pointer.

4 years agovc1parse: Avoid division by zero assertion
Nicolas Dufresne [Sat, 13 Jul 2019 00:39:45 +0000 (20:39 -0400)]
vc1parse: Avoid division by zero assertion

A framerate of 0/1 is valid, but we cannot calculate the frame duration
in this context. Simply protect against this case.

Related to #660

4 years agovc1parser: Relax ASF Binding Byte validation
Nicolas Dufresne [Sun, 18 Feb 2018 00:38:22 +0000 (19:38 -0500)]
vc1parser: Relax ASF Binding Byte validation

According to the spec, the least significant bit is reserved and should
always we set to 1. Though, some wrong file has been found. Considering
how low important this reserved bit is, relax the validation.

Related to #660

4 years agovc1parser : fix a miswrite
Fuwei Tang [Mon, 11 Nov 2019 01:36:48 +0000 (09:36 +0800)]
vc1parser : fix a miswrite

4 years agovkhandle: expose a printf format specifier for a vulkan handle
Matthew Waters [Sun, 10 Nov 2019 23:50:58 +0000 (10:50 +1100)]
vkhandle: expose a printf format specifier for a vulkan handle

4 years agovkdescriptor: set the GError on the 'too many allocations' case
Matthew Waters [Sun, 10 Nov 2019 23:33:23 +0000 (10:33 +1100)]
vkdescriptor: set the GError on the 'too many allocations' case

4 years agovkswapper: add inherit support
Matthew Waters [Thu, 17 Oct 2019 12:25:14 +0000 (23:25 +1100)]
vkswapper: add inherit support

Used on android

4 years agovkswapper: output specific values when swapchain flags fail
Matthew Waters [Thu, 17 Oct 2019 11:27:44 +0000 (22:27 +1100)]
vkswapper: output specific values when swapchain flags fail

4 years agovulkan: add android WSI integration
Matthew Waters [Wed, 16 Oct 2019 06:17:51 +0000 (17:17 +1100)]
vulkan: add android WSI integration

4 years agovulkan: Fix build on ios
Nirbheek Chauhan [Sun, 10 Nov 2019 13:01:49 +0000 (18:31 +0530)]
vulkan: Fix build on ios

These little bits were missed during the refactor in
https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/merge_requests/821

4 years agoamc: Change plugin name if it's built for Magic Leap
Xavier Claessens [Thu, 24 Oct 2019 19:27:42 +0000 (15:27 -0400)]
amc: Change plugin name if it's built for Magic Leap

4 years agoamc: Add MLSDK implementation
Xavier Claessens [Mon, 19 Nov 2018 18:40:35 +0000 (13:40 -0500)]
amc: Add MLSDK implementation

4 years agovulkan: Fix build on Windows
Seungha Yang [Fri, 8 Nov 2019 14:42:08 +0000 (23:42 +0900)]
vulkan: Fix build on Windows

gstvkwindow_win32.c(166): error C2065: 'msg_source': undeclared identifier

4 years agohlsdemux: Don't use deprecated SSL methods
Edward Hervey [Wed, 6 Nov 2019 14:07:44 +0000 (15:07 +0100)]
hlsdemux: Don't use deprecated SSL methods

And instead use the fixed-size variants (which aren't deprecated)

4 years agobad: Avoid using deprecated API
Edward Hervey [Wed, 6 Nov 2019 13:36:11 +0000 (14:36 +0100)]
bad: Avoid using deprecated API

GTimeval is deprecated

4 years agomsdk: remove msdkvp8enc
Haihao Xiang [Thu, 7 Nov 2019 10:45:55 +0000 (18:45 +0800)]
msdk: remove msdkvp8enc

MediaSDK doesn't support vp8 encode which is not going to be
implemented [1], so remove msdkvp8enc from this plugin

[1]: https://github.com/Intel-Media-SDK/MediaSDK/issues/947

4 years agovulkan: remove the private struct from the public struct
Matthew Waters [Wed, 6 Nov 2019 15:41:10 +0000 (02:41 +1100)]
vulkan: remove the private struct from the public struct

Remove any references to CamelTypePrivate from the public CamelType
struct.  They can be accessed as needed using
camel_type_get_instance_private().

4 years agovulkan: implement proper descriptor set handling
Matthew Waters [Wed, 6 Nov 2019 11:19:42 +0000 (22:19 +1100)]
vulkan: implement proper descriptor set handling

The major functionality gain this provides is proper reference counting
for a descriptor set.  Overall this allows us to create descriptor sets
when they are needed (or reused from a cache) without violating any of
vulkan's object synchronisation requirements.

As there are a fixed number of sets available in a pool, the number of
descriptors in elements is currently hardcoded to 32.  This can be extended
in a future change to create pools on the fly if that limit is ever overrun.

4 years agovulkan/fence: add always-signalled fence type
Matthew Waters [Tue, 5 Nov 2019 22:34:36 +0000 (09:34 +1100)]
vulkan/fence: add always-signalled fence type

Allows a cleaner control flow when there is no fence available for use
with the trash list.  An always signalled fence type will always return
TRUE for gst_vulkan_fence_is_signalled.

4 years agovulkan: add handle type for arbitrary vulkan handles
Matthew Waters [Tue, 5 Nov 2019 22:29:51 +0000 (09:29 +1100)]
vulkan: add handle type for arbitrary vulkan handles

Serve two purposes:
1. refcounting of vulkan handles with associated destruction.  When
   combined with the trash list, the user can ensure destruction at
   the correct time according to the vulkan rules.
2. avoids polluting our API with 32-bit vs 64-bit integer/pointers
   differences as exposed through the vulkan API.  on 32-bit, vulkan
   non-dispatchable handles are 64-bit integers and on 64-bit, they
   are pointers.

4 years agovulkanviewconvert: fix typo of output image view name
Matthew Waters [Wed, 6 Nov 2019 11:09:02 +0000 (22:09 +1100)]
vulkanviewconvert: fix typo of output image view name

4 years agovulkan: fix non-dispatchable handles on 32-bit platforms
Matthew Waters [Wed, 16 Oct 2019 06:47:33 +0000 (17:47 +1100)]
vulkan: fix non-dispatchable handles on 32-bit platforms

non-dispatchable handles are 64-bit integers on 32-bit platforms