platform/upstream/gstreamer.git
4 years agovulkan: fix use of assert() with older meson versions
Tim-Philipp Müller [Thu, 28 May 2020 21:48:15 +0000 (22:48 +0100)]
vulkan: fix use of assert() with older meson versions

Follow-up to !1307

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1308>

4 years agovulkan: don't run tests or build lib if plugin isn't actually built
Tim-Philipp Müller [Thu, 28 May 2020 18:07:32 +0000 (19:07 +0100)]
vulkan: don't run tests or build lib if plugin isn't actually built

The unit tests only checked for vulkan_dep.found(), which can
be true if the libs are there but glslc was not found, in which
case the plugin wouldn't be built and the unit tests would fail
because of missing vulkan plugins.

Doesn't really make much sense to build the vulkan integration lib
either if we're not going to build the vulkan plugin, so just disable
both for now if glslc is not available.

Fixes #1301

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1307>

4 years agompegtsdemux: tests: Test that tsparse doesn't drop padding
Jan Alexander Steffens (heftig) [Wed, 27 May 2020 12:44:01 +0000 (14:44 +0200)]
mpegtsdemux: tests: Test that tsparse doesn't drop padding

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1300>

4 years agompegtsdemux: Deliver all packets to tsparse
Jan Alexander Steffens (heftig) [Tue, 26 May 2020 20:40:04 +0000 (22:40 +0200)]
mpegtsdemux: Deliver all packets to tsparse

34af8ed66a7c63048ce0bdf59bbe61011d7c6292 changed the code to use the
packetizer's packets instead of the incoming buffers, but mpegtsbase
didn't actually push all packets to the subclass. As a result, padding
(PID 0x1FFF) packets got lost.

Add a new boolean to toggle pushing unknown packets to mpegtsbase and
have mpegtsparse make use of it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1300>

4 years agomediafoundation: Fix undeclared identifier error on UWP build
Seungha Yang [Thu, 28 May 2020 11:46:02 +0000 (20:46 +0900)]
mediafoundation: Fix undeclared identifier error on UWP build

Some symbols are not available in case of UWP

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1306>

4 years agoavtp: Initialise strack structures to 0 in tests
Jan Schmidt [Thu, 28 May 2020 08:18:58 +0000 (18:18 +1000)]
avtp: Initialise strack structures to 0 in tests

Avoid valgrind warnings about accessing uninitialised memory
in the tests by initialisting structures to 0

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1305>

4 years agoavtp: Fix some leaks in the tests
Jan Schmidt [Thu, 28 May 2020 07:33:43 +0000 (17:33 +1000)]
avtp: Fix some leaks in the tests

Fix valgrind errors that area showing on the CI now
that AVTP elements are built.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1305>

4 years agowebrtc: handle an ice-lite remote offer
Matthew Waters [Mon, 25 May 2020 03:10:20 +0000 (13:10 +1000)]
webrtc: handle an ice-lite remote offer

When the remote peer offers an ice-lite SDP, we need to configure our
ICE negotiation to be in controlling mode as the peer will not be.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1304>

4 years agocodecparsers: fix typo in GstH265RegisteredUserData doc
Stéphane Cerveau [Fri, 8 May 2020 15:30:21 +0000 (17:30 +0200)]
codecparsers: fix typo in GstH265RegisteredUserData doc

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1303>

4 years agotests: fix meson test env setup to make sure we use the right gst-plugin-scanner
Tim-Philipp Müller [Wed, 27 May 2020 14:17:12 +0000 (15:17 +0100)]
tests: fix meson test env setup to make sure we use the right gst-plugin-scanner

If core is built as a subproject (e.g. as in gst-build), make sure to use
the gst-plugin-scanner from the built subproject. Without this, gstreamer
might accidentally use the gst-plugin-scanner from the install prefix if
that exists, which in turn might drag in gst library versions we didn't
mean to drag in. Those gst library versions might then be older than
what our current build needs, and might cause our newly-built plugins
to get blacklisted in the test registry because they rely on a symbol
that the wrongly-pulled in gst lib doesn't have.

This should fix running of unit tests in gst-build when invoking
meson test or ninja test from outside the devenv for the case where
there is an older or different-version gst-plugin-scanner installed
in the install prefix.

In case no gst-plugin-scanner is installed in the install prefix, this
will fix "GStreamer-WARNING: External plugin loader failed. This most
likely means that the plugin loader helper binary was not found or
could not be run. You might need to set the GST_PLUGIN_SCANNER
environment variable if your setup is unusual." warnings when running
the unit tests.

In the case where we find GStreamer core via pkg-config we use
a newly-added pkg-config var "pluginscannerdir" to get the right
directory. This has the benefit of working transparently for both
installed and uninstalled pkg-config files/setups.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1302>

4 years agomediafoundation: Add support MP3 audio encoding
Seungha Yang [Thu, 21 May 2020 20:55:03 +0000 (05:55 +0900)]
mediafoundation: Add support MP3 audio encoding

Add MediaFoundation MP3 encoder

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1280>

4 years agomediafoundation: Add support for AAC encoding
Seungha Yang [Mon, 18 May 2020 09:12:38 +0000 (18:12 +0900)]
mediafoundation: Add support for AAC encoding

Add MediaFoundation AAC encoder element.

Before Windows 10, mono and stereo channels were supported audio channels
configuration by AAC encoder MFT. However, on Windows 10,
5.1 channels support was introduced.

To expose correct range of support format by this element
whatever the OS version is, this element will enumerate
all the supported format by the AAC encoder MFT
and then will configure sink/src templates while plugin init.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1280>

4 years agomfutils: Move IMediaType release function to common utility
Seungha Yang [Sat, 23 May 2020 15:46:38 +0000 (00:46 +0900)]
mfutils: Move IMediaType release function to common utility

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1280>

4 years agomediafoundation: Add util function to dump IMFAttributes values
Seungha Yang [Sun, 17 May 2020 15:41:14 +0000 (00:41 +0900)]
mediafoundation: Add util function to dump IMFAttributes values

It would be useful for debugging.

Reference: https://docs.microsoft.com/en-us/windows/win32/medfound/media-type-debugging-code
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1280>

4 years agod3d11window_win32: Create internal window on parent window's thread
Seungha Yang [Tue, 26 May 2020 18:50:57 +0000 (03:50 +0900)]
d3d11window_win32: Create internal window on parent window's thread

If parent and child windows are running on different thread,
there is always a chance to cause deadlock as DefWindowProc() call
from child window thread might be blocked until the message
is handled by parent's window procedure.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1299>

4 years agod3d11window: Add unprepare method to clear internal resource
Seungha Yang [Tue, 26 May 2020 16:52:59 +0000 (01:52 +0900)]
d3d11window: Add unprepare method to clear internal resource

GObject::dispose method can be called multiple times. As win32 d3d11window
has an internal thread and because GObject::dispose method could be called from the
thread, it might cause problems such as trying to join self-thread

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1299>

4 years agomfsourceobject: Remove useless null check for string
Seungha Yang [Mon, 25 May 2020 12:18:16 +0000 (21:18 +0900)]
mfsourceobject: Remove useless null check for string

We can pass null for the value of string type property.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1241>

4 years agomediafoundation: Use G_BEGIN_DECLS/G_END_DECLS pair everywhere
Seungha Yang [Mon, 25 May 2020 11:59:50 +0000 (20:59 +0900)]
mediafoundation: Use G_BEGIN_DECLS/G_END_DECLS pair everywhere

... instead of extern "c" {} block.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1241>

4 years agomediafoundation: Add support video capture on UWP app
Seungha Yang [Wed, 20 May 2020 14:23:08 +0000 (23:23 +0900)]
mediafoundation: Add support video capture on UWP app

New video capture implementation using WinRT Media APIs for UWP app.
Due to the strict permission policy of UWP, device enumeration and
open should be done via new WinRT APIs and to get permission from users,
it will invoke permission dialog on UI.
Strictly saying, this implementation is not a part of MediaFoundation
but structurally it's very similar to MediaFoundation API.
So we can avoid some code duplication by adding this implementation
into MediaFoundation plugin.

This implementation requires UniversalApiContract version >= 6.0
which is part of Windows 10 version 1803 (Redstone 4)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1241>

4 years agomfsourceobject: Move device name, path, and index to public struct
Seungha Yang [Wed, 20 May 2020 14:56:38 +0000 (23:56 +0900)]
mfsourceobject: Move device name, path, and index to public struct

... so that subclass can access each value and update them.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1241>

4 years agomediafoundation: Fix typo in source object impl.
Seungha Yang [Wed, 20 May 2020 13:59:19 +0000 (22:59 +0900)]
mediafoundation: Fix typo in source object impl.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1241>

4 years agoaudiobuffersplit: Unset DISCONT flag if not discontinuous
Sebastian Dröge [Mon, 25 May 2020 12:36:38 +0000 (15:36 +0300)]
audiobuffersplit: Unset DISCONT flag if not discontinuous

And also set/unset the RESYNC flag accordingly.

It can happen that the flag is preserved by GstAdapter from the input
buffer. For example if a big input buffer is split into many small ones,
each of the small ones would have the flag set.

All other buffer flags seem safe to keep here if they were set,
including the GAP flag.

Also ensure that the buffer is actually writable before changing any
flags or metadata on it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1298>

4 years agomftransform: Clear unused output IMediaSample
Seungha Yang [Mon, 25 May 2020 10:22:50 +0000 (19:22 +0900)]
mftransform: Clear unused output IMediaSample

If MFT doesn't produce encoded output, need to free allocated
output sample and buffer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1297>

4 years agotsdemux: Handle old streams claiming to be HDMV with Opus
Jan Schmidt [Sun, 24 May 2020 15:49:00 +0000 (01:49 +1000)]
tsdemux: Handle old streams claiming to be HDMV with Opus

GStreamer 1.16 and earlier produced streams with HDMV registration id
but with Opus audio streams on the stream ID that AC-4 now uses. Make
sure those still play back by special casing the check for AC-4 in HDMV

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1296>

4 years agosrt: Don't leak the connection_poll_id on close()
Jan Schmidt [Sat, 23 May 2020 20:22:07 +0000 (06:22 +1000)]
srt: Don't leak the connection_poll_id on close()

Attempting to reach an inactive SRT peer in caller mode
was leaking an fd every few seconds in the gst_srt_object_close()/open()
loop.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1293>

4 years agomfvideoenc: Fix huge memory leak
Seungha Yang [Sun, 24 May 2020 10:12:28 +0000 (19:12 +0900)]
mfvideoenc: Fix huge memory leak

Subclass must unref passed GstVideoCodecFrame on GstVideoEncoder::handle_frame()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1294>

4 years agopitch: Remove useless restriction on number of channel
Thibault Saunier [Tue, 19 May 2020 14:47:25 +0000 (10:47 -0400)]
pitch: Remove useless restriction on number of channel

It handles any number of channels just fine

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1292>

4 years agoh264decoder: Disallow multiple slice group as we don't support FMO
Seungha Yang [Fri, 22 May 2020 17:33:24 +0000 (02:33 +0900)]
h264decoder: Disallow multiple slice group as we don't support FMO

Even though it might be supported by accelerator, baseclass is not
ready to support it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1291>

4 years agonvh264sldec: Fix wrong scaling list matrix scan order
Seungha Yang [Fri, 22 May 2020 15:57:23 +0000 (00:57 +0900)]
nvh264sldec: Fix wrong scaling list matrix scan order

Quatization matrix of NVDEC should be raster scan order but
h264parser stores it in zig-zag scan order. We need to convert
the matrix.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1290>

4 years agoasfmux: consistent sscanf args usage
Andrey Sazonov [Thu, 21 May 2020 11:20:39 +0000 (11:20 +0000)]
asfmux: consistent sscanf args usage

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1286>

4 years agov4l2codecs: h264: Add missing break
Nicolas Dufresne [Wed, 20 May 2020 11:35:28 +0000 (07:35 -0400)]
v4l2codecs: h264: Add missing break

There was a missing break for the 4:4:4 case which would break the sizeimage
calculation. We don't currently have hardware that supports 4:4:4, so this
code wasn't tested. This was detected by Coverity.

CID 1463592 1463591

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1283>

4 years agoplanaraudioadapter: fix possible NULL ptr dereference
Andrey Sazonov [Thu, 21 May 2020 14:28:38 +0000 (14:28 +0000)]
planaraudioadapter: fix possible NULL ptr dereference

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1288>

4 years agosdpdemux: fix klocwork issues
Andrey Sazonov [Thu, 21 May 2020 11:24:51 +0000 (11:24 +0000)]
sdpdemux: fix klocwork issues

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1287>

4 years agoamc/videodec: only retrieve the stride/slice-height for raw output
Matthew Waters [Tue, 19 May 2020 04:58:35 +0000 (14:58 +1000)]
amc/videodec: only retrieve the stride/slice-height for raw output

When outputting to a surface, these values may not exist.

As found on a Google Pixel 3.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1284>

4 years agomeson: add libopenjp2 fallback for openjpeg
Stéphane Cerveau [Thu, 14 May 2020 15:13:00 +0000 (17:13 +0200)]
meson: add libopenjp2 fallback for openjpeg

As a wrap is now available in gst-build, the fallback
can be used.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1270>

4 years agoavtp: Add libavtp fallback dependence
Ederson de Souza [Wed, 13 May 2020 22:02:41 +0000 (15:02 -0700)]
avtp: Add libavtp fallback dependence

So that libavtp can be found if added as subproject on gst-build.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1271>

4 years agomediafoundation: Add device provider implementation
Seungha Yang [Fri, 1 May 2020 06:58:09 +0000 (15:58 +0900)]
mediafoundation: Add device provider implementation

Only static device probing is supported for now

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1236>

4 years agomfsourceobject: Store selected device path, name and index
Seungha Yang [Fri, 1 May 2020 06:12:43 +0000 (15:12 +0900)]
mfsourceobject: Store selected device path, name and index

Update path, name and index with selected device so that checked by
get_property() after constructed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1236>

4 years agortmp2src: Answer scheduling query
Edward Hervey [Wed, 20 May 2020 08:54:21 +0000 (10:54 +0200)]
rtmp2src: Answer scheduling query

Just like for rtmpsrc, we must inform downstream that we are a
sequential (i.e. don't do random access efficiently) and
bandwith-limited (i.e. might need buffering downstream) element

Fixes buffering issues with playbin3

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1282>

4 years agov4l2slh264dec: Request large enough bitstream buffer
Nicolas Dufresne [Wed, 6 May 2020 16:27:56 +0000 (12:27 -0400)]
v4l2slh264dec: Request large enough bitstream buffer

The Cedrus driver would otherwise choose 1KB buffer, which is too small.
This follows what some drivers do, which is simply to use the size a
packed raw image would have. Specifications do not really guaranty any minimum
compression ratio.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1268>

4 years agov4l2slh264dec: Add slice based decoder support
Nicolas Dufresne [Tue, 5 May 2020 21:55:19 +0000 (17:55 -0400)]
v4l2slh264dec: Add slice based decoder support

This adds support for slice based decoder like the Allwinner/Cedrus driver. In
order to keep things efficient, we hold the sink buffer until we reach the end
of the picture. Note that as we don't know which one is last, we lazy queue the
slices. This effectively introduces one slice latency.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1268>

4 years agov4l2codecdec: Fix error handling
Nicolas Dufresne [Thu, 30 Apr 2020 19:17:05 +0000 (15:17 -0400)]
v4l2codecdec: Fix error handling

If none of the format the HW produce is supported, the fiter will be NULL,
which would lead to assertion when trying to release it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1268>

4 years agov4l2decoder: Add legacy non-multiplanar support
Nicolas Dufresne [Thu, 30 Apr 2020 18:18:47 +0000 (14:18 -0400)]
v4l2decoder: Add legacy non-multiplanar support

The Cedrus driver uses the lagacy buffer type (non-mplane). This automatically
detect and use the right v4l2_buf_type. This also affect code using
v4l2_buffer and v4l2_format structures.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1268>

4 years agov4l2codecs: Update kernel headers
Nicolas Dufresne [Tue, 5 May 2020 21:50:22 +0000 (17:50 -0400)]
v4l2codecs: Update kernel headers

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1268>

4 years agod3d11convert: Fix fallback texture setup when resolution is not even number
Seungha Yang [Sat, 16 May 2020 12:52:59 +0000 (21:52 +0900)]
d3d11convert: Fix fallback texture setup when resolution is not even number

When texture format is semi-planar, resolution should be even number,
and add missing P016 format handling

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1275>

4 years agod3d11convert: Fix fallback texture copy
Seungha Yang [Sat, 16 May 2020 12:45:02 +0000 (21:45 +0900)]
d3d11convert: Fix fallback texture copy

Fix texture copy when input texture has non-zero subresource index

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1275>

4 years agod3d11: Add support for video rescale and rename element to d3d11convert
Seungha Yang [Sat, 16 May 2020 11:45:23 +0000 (20:45 +0900)]
d3d11: Add support for video rescale and rename element to d3d11convert

GstD3D11ColorConverter implementation is able to rescale video as well.
By doing colorspace conversion and rescale at once, we can save
one cycle of shader pipeline which will can save GPU resource.

Since this element can support color space conversion and rescale,
it's renamed as d3d11convert

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1275>

4 years agod3d11: Move scoring util method for colorspace conversion to colorconvert element
Seungha Yang [Sat, 16 May 2020 11:12:33 +0000 (20:12 +0900)]
d3d11: Move scoring util method for colorspace conversion to colorconvert element

It's used only by colorconvert element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1275>

4 years agocodecs: h264decoder: chain finalize vmethod
Víctor Manuel Jáquez Leal [Sat, 16 May 2020 09:14:58 +0000 (11:14 +0200)]
codecs: h264decoder: chain finalize vmethod

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1238>

4 years agocodecparsers: h264: Only set relevant default weight values
Nicolas Dufresne [Wed, 13 May 2020 21:23:12 +0000 (17:23 -0400)]
codecparsers: h264: Only set relevant default weight values

This is minor optimization to avoid setting values we don't need. It also
makes debugging easier since only relevant values a non-zero now.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1238>

4 years agocodecparsers: h264: Fix default ref list size
Nicolas Dufresne [Wed, 13 May 2020 19:32:44 +0000 (15:32 -0400)]
codecparsers: h264: Fix default ref list size

The default in PPS was not applied properly. The default does not apply for
I-Slice and l1 default only applies for B-Slice.  This fixes the slice values
for num_ref_idx_l0_active_minus1 and num_ref_idx_l1_active_minus1.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1238>

4 years agocodecs: h264decoder: Use calculated values for max_pic_num/frame_num
Nicolas Dufresne [Tue, 12 May 2020 16:23:15 +0000 (12:23 -0400)]
codecs: h264decoder: Use calculated values for max_pic_num/frame_num

The parser pre-calculate these already, just use them.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1238>

4 years agocodecs: h264decoder: ref pic lists as decode_slice parameters
Víctor Manuel Jáquez Leal [Sun, 3 May 2020 15:30:34 +0000 (17:30 +0200)]
codecs: h264decoder: ref pic lists as decode_slice parameters

Pass reference picture lists to decode_slice() vmethods

Change gstv4l2codech264dec and gstnvh264dec accordingly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1238>

4 years agocodecs: h264decoder: handle reference picture lists
Víctor Manuel Jáquez Leal [Mon, 27 Apr 2020 14:53:45 +0000 (16:53 +0200)]
codecs: h264decoder: handle reference picture lists

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1238>

4 years agocodecs: h264decoder: Port from GList to GArray
Nicolas Dufresne [Fri, 15 May 2020 18:56:27 +0000 (14:56 -0400)]
codecs: h264decoder: Port from GList to GArray

Using glist requires a lot of small allocation at runtime and also
it comes with a slow sort algorithm. As we play with that for very
frame and slices, use GArray instead. Note that we cache some arrays
in the instance as there is no support for stack allocated arrays
in GArray.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1238>

4 years agocodecs: h264decoder: Make get_long_ref_by_pic_num() transfer none
Nicolas Dufresne [Fri, 8 May 2020 21:56:48 +0000 (17:56 -0400)]
codecs: h264decoder: Make get_long_ref_by_pic_num() transfer none

We don't use the extra reference, so let's just avoid the extra
ref/unref.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1238>

4 years agocodecs: h264decoder: Make get_short_ref_by_pic_num() transfer none
Nicolas Dufresne [Wed, 6 May 2020 16:23:34 +0000 (12:23 -0400)]
codecs: h264decoder: Make get_short_ref_by_pic_num() transfer none

We don't use the extra reference, so let's just avoid the extra
ref/unref.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1238>

4 years agotests: fix nalutils file name
Stéphane Cerveau [Tue, 19 May 2020 13:39:50 +0000 (15:39 +0200)]
tests: fix nalutils file name

The filename was too long causing issues with ccache

Fix https://gitlab.freedesktop.org/gstreamer/gst-build/-/issues/97

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1281>

4 years agompegtsdemux: tests: Add simple tests for tsparse and tsdemux
Jan Alexander Steffens (heftig) [Mon, 18 May 2020 12:19:04 +0000 (14:19 +0200)]
mpegtsdemux: tests: Add simple tests for tsparse and tsdemux

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1274>

4 years agompegtsdemux: Close a buffer leak and simplify input_done
Jan Alexander Steffens (heftig) [Fri, 15 May 2020 15:05:59 +0000 (17:05 +0200)]
mpegtsdemux: Close a buffer leak and simplify input_done

tsparse leaked input buffers quite badly:

    GST_TRACERS=leaks GST_DEBUG=GST_TRACER:9 gst-launch-1.0 audiotestsrc num-buffers=3 ! avenc_aac ! mpegtsmux ! tsparse ! fakesink

The input_done vfunc was passed the input buffer, which it had to
consume. For this reason, the base class takes a reference on the buffer
if and only if input_done is not NULL.

Before 34af8ed66a7c63048ce0bdf59bbe61011d7c6292, input_done was used in
tsparse to pass on the input buffer on the "src" pad. That commit
changed the code to packetize for that pad as well and removed the use
of input_done.

Afterwards, 0d2e9085236ed94622c327f73489e558cc95d05f set input_done
again in order to handle automatic alignment of the output buffers to
the input buffers. However, it ignored the provided buffer and did not
even unref it, causing a leak.

Since no code makes use of the buffer provided with input_done, just
remove the argument in order to simplify things a bit.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1274>

4 years agogstcurlhttpsink: Set 'Expect: 100-continue'-header
Mats Lindestam [Sun, 17 May 2020 08:27:03 +0000 (10:27 +0200)]
gstcurlhttpsink: Set 'Expect: 100-continue'-header

In the upgrade of libcurl from 7.64.1 to 7.69.1 the
EXPECT_100_THRESHOLD has been increased from 1 Kb to 1 Mb
(see https://curl.haxx.se/mail/lib-2020-01/0050.html).
This caused the gstcurlhttpsink to not being able to rewind
and resend in the case, e.g. response '401 Unauthorized'.
Now the 'Expect: 100-continue'-header is explicitly set in
the gstcurlhttpsink.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1276>

4 years agoopensles: Remove hard-coded buffer-/latency-time values
Arun Raghavan [Wed, 29 Apr 2020 20:43:06 +0000 (16:43 -0400)]
opensles: Remove hard-coded buffer-/latency-time values

These were originally required in early Android versions, but are no
longer needed.

4 years agomediafoundation: Refactor GstMFSourceObject implementation
Seungha Yang [Thu, 14 May 2020 11:47:06 +0000 (20:47 +0900)]
mediafoundation: Refactor GstMFSourceObject implementation

* Move CoInitializeEx/CoUninitialize pair into thread function in order to
  ensure MTA COM thread
* Move common code to baseclass

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1269>

4 years agomediafoundation: Remove COM thread constraints from GstMFTransform object
Seungha Yang [Thu, 14 May 2020 11:17:33 +0000 (20:17 +0900)]
mediafoundation: Remove COM thread constraints from GstMFTransform object

Move CoInitializeEx/CoUninitialize pair into our dedicated thread so that
we can ensure COM thread is MTA. This will remove thread constraints
around plugin init.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1269>

4 years agoamcvideodec: fix sync meta copying not taking a reference
Matthew Waters [Fri, 15 May 2020 03:52:06 +0000 (13:52 +1000)]
amcvideodec: fix sync meta copying not taking a reference

Fixup for
9b9e39be248389370e80b429da5a528418733483: amc: Fix crash when a sync_meta survives its sink
https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/603

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1272>

4 years agosrtobject: add streamid property
J. Kim [Mon, 13 Apr 2020 09:09:55 +0000 (18:09 +0900)]
srtobject: add streamid property

The stream id starts with '#!::' according to SRT Access Control[1],
but GstURI requires URI encoded string.This commit introduces additional
property to set the id by normal string.

[1] https://github.com/Haivision/srt/blob/master/docs/AccessControl.md

4 years agomeson: Pass native: false to add_languages()
Nirbheek Chauhan [Mon, 11 May 2020 23:30:36 +0000 (05:00 +0530)]
meson: Pass native: false to add_languages()

This is needed for cross-compiling without a build machine compiler
available. The option was added in 0.54, but we only need this in
Cerbero and it doesn't affect older versions so it should be ok.
Will only cause a spurious warning.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1266>

4 years agompegtsmux: detect and ignore gap buffers
Alex Hoenig [Tue, 12 May 2020 14:55:45 +0000 (10:55 -0400)]
mpegtsmux: detect and ignore gap buffers

Fixes #1291.  Without this, when a stream has gaps and then resumes, the next buffer PTS that is written to the TS is given the PTS of the first gap.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1263>

4 years agoccconverter: check fraction multiply for overflow
Matthew Waters [Tue, 12 May 2020 06:05:01 +0000 (16:05 +1000)]
ccconverter: check fraction multiply for overflow

It should not happen and if it does, something went very wrong earlier

CID 1463350

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1262>

4 years agoccconverter: tighten up a couple of NULL checks
Matthew Waters [Tue, 12 May 2020 06:01:42 +0000 (16:01 +1000)]
ccconverter: tighten up a couple of NULL checks

CID 1463347
CID 1463346
CID 1463345

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1262>

4 years agoccconverter: fix unintialized read of mapped output info in error case
Matthew Waters [Tue, 12 May 2020 06:00:58 +0000 (16:00 +1000)]
ccconverter: fix unintialized read of mapped output info in error case

We only need to gst_buffer_unmap() if we have gst_buffer_map()ed.  In
most cases we can shorten the lenght of time we need to map the output
buffer.  Fix similar occurences elsewhere.

CID 1463349

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1262>

4 years agoccconverter: fix uninitialized read in error case
Matthew Waters [Tue, 12 May 2020 05:24:32 +0000 (15:24 +1000)]
ccconverter: fix uninitialized read in error case

CID 1463351

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1262>

4 years agov4l2codecs: Fix compilation error on FreeBSD
Ting-Wei Lan [Sun, 10 May 2020 09:38:11 +0000 (17:38 +0800)]
v4l2codecs: Fix compilation error on FreeBSD

This commit does the following things to fix compilation on FreeBSD:

1. Add required typedefs to linux/types-compat.h.
2. Remove unnecessary include linux/ioctl.h and replace linux/types.h
   with linux/types-compat.h. Both files do not exist on FreeBSD.
3. Check the header including makedev macro. FreeBSD does not have
   sys/sysmacros.h, and including it unconditionally causes error.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1259>

4 years agoccconverter: implement discont handling
Matthew Waters [Mon, 11 May 2020 07:14:09 +0000 (17:14 +1000)]
ccconverter: implement discont handling

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1116>

4 years agoccconverter: use a better padding byte sequence for writing cdp
Matthew Waters [Thu, 7 May 2020 13:59:30 +0000 (23:59 +1000)]
ccconverter: use a better padding byte sequence for writing cdp

0xf8 can be interpreted as cea608 data at the beginning of a cdp packet
as the cc_valid bit is not checked when cc_valid in (0b00 or 0b01).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1116>

4 years agoccconverter: split temporary storage into 3
Matthew Waters [Thu, 19 Mar 2020 06:42:13 +0000 (17:42 +1100)]
ccconverter: split temporary storage into 3

Instead of storing the raw cc_data, store the 2 cea608 fields individually
as well as the ccp data.

Simply copying the input cc_data to the output cc_data violates a number of
requirements in the cea708 specification.  The most prominent being, that
cea608 triples must be placed at the beginning of each cdp.

We also need to comply with the framerate-dpendent limits for both the
cea608 and the ccp data which may involve splitting or merging some
cea608 data but not ccp data or vice versa.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1116>

4 years agoccconvert: compact input cc_data where possible
Matthew Waters [Tue, 17 Mar 2020 06:23:44 +0000 (17:23 +1100)]
ccconvert: compact input cc_data where possible

Skip over padding cc_data triples.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1116>

4 years agoccconverter: implement support for CDP framerate conversions
Matthew Waters [Thu, 12 Mar 2020 23:54:02 +0000 (10:54 +1100)]
ccconverter: implement support for CDP framerate conversions

- Any format involving CDP is supported.
- Time codes (if present) are scaled as well.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1116>

4 years agotests/ccconverter: test the time codes are successfully passed through
Matthew Waters [Thu, 12 Mar 2020 05:08:54 +0000 (16:08 +1100)]
tests/ccconverter: test the time codes are successfully passed through

Where time codes are not stored in the caption data themselves

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1116>

4 years agoccconverter: introduce define for max cdp packet length
Matthew Waters [Thu, 12 Mar 2020 04:06:46 +0000 (15:06 +1100)]
ccconverter: introduce define for max cdp packet length

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1116>

4 years agoccconverter: don't rely on external state in *_internal()
Matthew Waters [Thu, 12 Mar 2020 04:01:02 +0000 (15:01 +1100)]
ccconverter: don't rely on external state in *_internal()

This allows using the _internal() variants for simply converting some
caption data without relying on any external state.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1116>

4 years agoccconverter: cc_count limits are per framerate
Matthew Waters [Thu, 12 Mar 2020 03:06:49 +0000 (14:06 +1100)]
ccconverter: cc_count limits are per framerate

Enforce this and add a test for cdp input being too large.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1116>

4 years agoccconverter: refactor cdp id, fps, max_cc_count into a table
Matthew Waters [Thu, 12 Mar 2020 01:54:41 +0000 (12:54 +1100)]
ccconverter: refactor cdp id, fps, max_cc_count into a table

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1116>

4 years agoccconverter: pivot to implementing generate_output
Matthew Waters [Wed, 11 Mar 2020 22:55:40 +0000 (09:55 +1100)]
ccconverter: pivot to implementing generate_output

Will make a n-n buffer element much easier to implement.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1116>

4 years agovulkan: Drop use of VK_RESULT_BEGIN_RANGE
Jan Alexander Steffens (heftig) [Sat, 9 May 2020 17:59:46 +0000 (19:59 +0200)]
vulkan: Drop use of VK_RESULT_BEGIN_RANGE

This was removed in Vulkan 1.2.140.

> Shortly after 2020-04-24, we will be removing the automatically
> generated `VK_*_BEGIN_RANGE`, `VK_*_END_RANGE`, and `VK_*_RANGE_SIZE`
> tokens from the Vulkan headers. These tokens are currently defined for
> some enumerated types, but are explicitly not part of the Vulkan API.
> They existed only to support some Vulkan implementation internals,
> which no longer require them. We will be accepting comments on this
> topic in [#1230], but we strongly suggest any external projects using
> these tokens immediately migrate away from them.

[#1230]: https://github.com/KhronosGroup/Vulkan-Docs/issues/1230

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1255>

4 years agoaudiobuffersplit: Perform discont tracking on running time
Sebastian Dröge [Fri, 8 May 2020 19:36:01 +0000 (22:36 +0300)]
audiobuffersplit: Perform discont tracking on running time

Otherwise we would have to drain on every segment event. Like this we
can handle segment events that don't cause a discontinuity in running
time to be handled without draining.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1254>

4 years agoaudiobuffersplit: Keep incoming and outgoing segments separate
Sebastian Dröge [Fri, 8 May 2020 18:36:44 +0000 (21:36 +0300)]
audiobuffersplit: Keep incoming and outgoing segments separate

We might have to drain already queued input based on the old segment
before forwarding the new segment event. The new segment is only
forwarded after a discont as otherwise we might cause unnecessary
timestamp jumps as we output buffers timestamped based on sample counts.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1254>

4 years agowebrtc: move filtering properties to webrtcice
Chris Ayoup [Thu, 30 Apr 2020 16:01:13 +0000 (16:01 +0000)]
webrtc: move filtering properties to webrtcice

We want webrtcbin to only expose properties that are defined in JSEP, so
these additional properties should be moved out.  In order to access
them, the webrtcice instance is exposed from webrtcbin.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1223>

4 years agowebrtc: allow setting local IP addresses
Chris Ayoup [Fri, 17 Apr 2020 18:00:59 +0000 (18:00 +0000)]
webrtc: allow setting local IP addresses

If a local IP address is specified, ICE gathering can be much faster
in environments where there are multiple IP addreses but only some are
usable (for example, if you are running docker on the machine).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1223>

4 years agowebrtc: Allow toggling TCP and UDP candidates
Chris Ayoup [Thu, 16 Apr 2020 22:37:35 +0000 (22:37 +0000)]
webrtc: Allow toggling TCP and UDP candidates

Add some properties to allow TCP and UDP candidates to be toggled.  This
is useful in cases where someone is using this element in an environment
where it is known in advance whether a given transport will work or not
and will prevent wasting time generating and checking candidate pairs
that will not succeed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1223>

4 years agomsdkvpp: clear the parameters after closing the session
Haihao Xiang [Thu, 2 Apr 2020 02:44:31 +0000 (10:44 +0800)]
msdkvpp: clear the parameters after closing the session

Otherwise the stale values are used for the new process.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1159>

4 years agospanplc: Don't segfault when retrieving the stats property without a spanplc context
Sebastian Dröge [Sun, 10 May 2020 08:23:02 +0000 (11:23 +0300)]
spanplc: Don't segfault when retrieving the stats property without a spanplc context

For example when trying to get the property value in NULL state.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1258>

4 years agoonviftimestamp: Add missing `break` in set_property()
Sebastian Dröge [Sun, 10 May 2020 08:16:44 +0000 (11:16 +0300)]
onviftimestamp: Add missing `break` in set_property()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1257>

4 years agotest: h265parse: Test parsing buffer the ends with half a NAL header
Nicolas Dufresne [Thu, 7 May 2020 18:05:16 +0000 (14:05 -0400)]
test: h265parse: Test parsing buffer the ends with half a NAL header

This test cover the case where we are parsing, but our current buffers ends
with half the NAL header (which is 2 bytes in HEVC). Previously we would
throw an error message on the bus.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1251>

4 years agoh265parse: Ensure parsing ends on start-code + full header
Nicolas Dufresne [Thu, 7 May 2020 17:59:33 +0000 (13:59 -0400)]
h265parse: Ensure parsing ends on start-code + full header

The parser is used all over the place assuming that after calling
gst_h265_parser_identify_nalu(), the start-code found is can also be
identified. In H264 this works, because scan_for_start_code rely on
gst_byte_reader_masked_scan_uint32() that ensures that 1 byte passed the 3
bytes start code is found. But for HEVC, we need two bytes to identify the
following NAL.

This patch will return NO_NAL_END, even if a start code is found in the case
there was not enough bytes. This solution was chosen to maintain backward
compatibility, and reduce complexicity.

Fixes #1287

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1251>

4 years agotest: h264/h265: Add test for four bytes start code initial skip
Nicolas Dufresne [Thu, 7 May 2020 15:09:23 +0000 (11:09 -0400)]
test: h264/h265: Add test for four bytes start code initial skip

This test detects if the parser have skipped too much and dropped meaninful
NALs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1251>

4 years agotest: h264/h265: Constify all test buffers
Nicolas Dufresne [Thu, 7 May 2020 16:02:40 +0000 (12:02 -0400)]
test: h264/h265: Constify all test buffers

This ensure that no test modify other tests data.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1251>

4 years agoh264/h265parse: Fix initial skip
Nicolas Dufresne [Thu, 7 May 2020 15:06:45 +0000 (11:06 -0400)]
h264/h265parse: Fix initial skip

Account for start codes possibly be 4 bytes. For HEVC, also take into
account that we might be missing only one of the two identification
bytes.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1251>

4 years agoh265parse: Ensure correct timestamps
Nicolas Dufresne [Thu, 7 May 2020 12:29:28 +0000 (08:29 -0400)]
h265parse: Ensure correct timestamps

If the input has a miss-placed filler zero byte (e.g. a filler without a 4
bytes start code on the next NAL), we would endup using the same timestamp
twice. Ask the base class to read the timestamp from the buffer were the NAL
actually starts.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1251>

4 years agoh264parser: Removed impossible error case
Nicolas Dufresne [Thu, 7 May 2020 11:43:30 +0000 (07:43 -0400)]
h264parser: Removed impossible error case

Same as done for H264, this error was trying to catch the case where we had
a start code without any bytes afterward. This will never happen since the
start code scanner only returns a match if there is one byte after start
code (pattern 0x00000100 / mask 0xffffff00). In H264, once byte is sufficient
to identify the NALU.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1251>