platform/upstream/gstreamer.git
6 years agomsdk: Add more tuning options
Sreerenj Balachandran [Thu, 15 Feb 2018 17:29:13 +0000 (17:29 +0000)]
msdk: Add more tuning options

Added tuning options for mb level bitrate control,
adaptive I-frame insertion, and adaptive B-frame insertion.

https://bugzilla.gnome.org/show_bug.cgi?id=791637

6 years agomsdk: h264_enc: Add slice size tuning option
Sreerenj Balachandran [Thu, 15 Feb 2018 16:31:56 +0000 (16:31 +0000)]
msdk: h264_enc: Add slice size tuning option

According to spec, it is a general property. But based on
testing it only works for h264 encoder.
Let's keep it as h264 specific for now.

https://bugzilla.gnome.org/show_bug.cgi?id=791637

6 years agomsdk: move enum definitions to separte file
Sreerenj Balachandran [Thu, 15 Feb 2018 15:59:08 +0000 (15:59 +0000)]
msdk: move enum definitions to separte file

Move enum value defintions which are (or in future) supported
by more than one codec into a common file.

https://bugzilla.gnome.org/show_bug.cgi?id=791637

6 years agomsdk: encoder: h264: Enable trellis quantization tuning
Sreerenj Balachandran [Thu, 15 Feb 2018 15:05:10 +0000 (15:05 +0000)]
msdk: encoder: h264: Enable trellis quantization tuning

Add a new property "trellis" to enable trellis quantization.
Keeping trellis as a flag value (which is boolean for gst x264 enc element)
since it is possible to enable/disable this seperately for
I,P and B frames through MediaSDK ext option headers.

The subclass implementations always need to inform base-encoder
if it requires the inclusion of Extend Header buffers (mfxExtCodingOption2
 and mfxExtCodingOption3).

https://bugzilla.gnome.org/show_bug.cgi?id=791637

6 years agomsdk: h264_enc: Add LookaheadDownsampling support
Sreerenj Balachandran [Thu, 15 Feb 2018 12:19:48 +0000 (12:19 +0000)]
msdk: h264_enc: Add LookaheadDownsampling support

This option controls down sampling in look ahead bitrate
control mode. According to spec it is only supported in AVC.

Fixme: Probably HEVC also have support for this in recent
MSDK versions. We could move the enumeration types to common
header usable for multiple codecs.

https://bugzilla.gnome.org/show_bug.cgi?id=791637

6 years agomsdk: encode: Add more rate control options
Sreerenj Balachandran [Wed, 14 Feb 2018 17:01:38 +0000 (17:01 +0000)]
msdk: encode: Add more rate control options

MediaSDK has support for a number of rate control algorithms.
Adding all possible options to the property rate-control.

Fixme1: In case of failure, currently we don't have a proper method
to show which rate-control has been failed. It could be better
to add some extensive validation on EncQuery output in case of error.
Unfortunately, not all ratecontrol methods are supported by every codecs
and we don't have the dynamic detection of supported ratecontrol methods yet.

https://bugzilla.gnome.org/show_bug.cgi?id=791637

6 years agomsdk: encode: Add property to set slice/partitioning
Sreerenj Balachandran [Wed, 14 Feb 2018 16:27:47 +0000 (16:27 +0000)]
msdk: encode: Add property to set slice/partitioning

Adding a new property num-slices to set the number of
slices/partitions per frame. Adding it as a general
property for all codecs (except jpeg).

https://bugzilla.gnome.org/show_bug.cgi?id=791637

6 years agomsdk: encoder: h265: generalize the behavior of "i-frames" property
Sreerenj Balachandran [Wed, 14 Feb 2018 14:29:57 +0000 (14:29 +0000)]
msdk: encoder: h265: generalize the behavior of "i-frames" property

We have the property "i-frames" to set the IDR interval in a
gop. Unfortunately MSDK HEVC encoder behaves bit differently
for IdrInterval field, IdrInteval == 1 indicate every
I-frame should be an IDR (which is IdrInterval == 0 for other codecs),
IdrInteval == 2 means every other I-frame is an IDR
(which is IdrInterval == 1 for other codecs) etc.
So we generalize the behaviour of property "i-frames" by
incrementing the value by one in each case (only for HEVC).

https://bugzilla.gnome.org/show_bug.cgi?id=791637

6 years agomsdk: encoder: register only the required properties
Sreerenj Balachandran [Wed, 14 Feb 2018 11:42:55 +0000 (11:42 +0000)]
msdk: encoder: register only the required properties

The base encoder common properties are not valid for
mjpeg encoder where there is no motion compensation or rate control.
Delaying the property installation on the base gobject
untill the subclass class_init get invoked.

https://bugzilla.gnome.org/show_bug.cgi?id=791637

6 years agomsdk: add missing files for dist target
Víctor Manuel Jáquez Leal [Sun, 18 Feb 2018 13:46:52 +0000 (14:46 +0100)]
msdk: add missing files for dist target

https://bugzilla.gnome.org/show_bug.cgi?id=793563

6 years agocolormanagement: Link to libgstbase for basetransform
Sebastian Dröge [Sun, 18 Feb 2018 10:01:07 +0000 (12:01 +0200)]
colormanagement: Link to libgstbase for basetransform

6 years agogl: GL_LIBS does not exist anymore but X11_LIBS does and is needed
Sebastian Dröge [Sun, 18 Feb 2018 09:49:25 +0000 (11:49 +0200)]
gl: GL_LIBS does not exist anymore but X11_LIBS does and is needed

In case of X11 we have to call XInitThreads().

6 years agoconfigure: Add configure check for gmodule-no-export-2.0
Sebastian Dröge [Sun, 18 Feb 2018 09:37:18 +0000 (11:37 +0200)]
configure: Add configure check for gmodule-no-export-2.0

This is needed for all code using the g_module_*() API.

6 years agowebrtc: We need at least libnice 0.1.14
Sebastian Dröge [Fri, 16 Feb 2018 15:36:04 +0000 (17:36 +0200)]
webrtc: We need at least libnice 0.1.14

meson.build already required that, let's do the same for configure.ac

6 years agoBack to development
Tim-Philipp Müller [Thu, 15 Feb 2018 19:44:23 +0000 (19:44 +0000)]
Back to development

6 years agoRelease 1.13.1
Tim-Philipp Müller [Thu, 15 Feb 2018 17:13:06 +0000 (17:13 +0000)]
Release 1.13.1

6 years agoDist compositor crossfade example and pythons script for meson build
Tim-Philipp Müller [Thu, 15 Feb 2018 18:50:51 +0000 (18:50 +0000)]
Dist compositor crossfade example and pythons script for meson build

And add to autotools build so it gets disted.

6 years agoconfigure: fix build with --disable-external
Tim-Philipp Müller [Thu, 15 Feb 2018 15:07:26 +0000 (15:07 +0000)]
configure: fix build with --disable-external

6 years agopo: update translations
Tim-Philipp Müller [Thu, 15 Feb 2018 14:59:35 +0000 (14:59 +0000)]
po: update translations

6 years agodocs: update plugin docs
Tim-Philipp Müller [Thu, 15 Feb 2018 14:57:00 +0000 (14:57 +0000)]
docs: update plugin docs

6 years agodecklink: Fix array of devices usage
Edward Hervey [Wed, 14 Feb 2018 14:57:48 +0000 (15:57 +0100)]
decklink: Fix array of devices usage

We need to allocate actual Device structures since we are going
to be setting callbacks with address to that structure

https://bugzilla.gnome.org/show_bug.cgi?id=777239

6 years agoUpdate ORC fallback disted code
Edward Hervey [Wed, 14 Feb 2018 13:36:00 +0000 (14:36 +0100)]
Update ORC fallback disted code

6 years agoaom: Implement cpu-used in av1enc
Sean DuBois [Mon, 5 Feb 2018 08:52:55 +0000 (08:52 +0000)]
aom: Implement cpu-used in av1enc

https://bugzilla.gnome.org/show_bug.cgi?id=791674

6 years agopnm: Fixed segfault in pnmenc
Dimitrios Katsaros [Tue, 13 Feb 2018 10:16:29 +0000 (11:16 +0100)]
pnm: Fixed segfault in pnmenc

The pnmenc was not mapping the input buffers as video buffers. Because
of this, the video frame stride was not being set based on frame but
based on the caps, which make the assumption that the strides are a
power of 4. For input that is not a power of 4, this would lead to a
SIGSEGV.

https://bugzilla.gnome.org/show_bug.cgi?id=793419

6 years agobuild: check gudev dependency for msdk plugin
Sreerenj Balachandran [Wed, 14 Feb 2018 02:39:26 +0000 (17:39 -0900)]
build: check gudev dependency for msdk plugin

gudev is the dependecy for rendernode support in MediaSDK plugin.

https://bugzilla.gnome.org/show_bug.cgi?id=791599

6 years agomsdk: vc1_dec: Add Advanced profile (WVC1) support
Sreerenj Balachandran [Tue, 13 Feb 2018 23:41:52 +0000 (14:41 -0900)]
msdk: vc1_dec: Add Advanced profile (WVC1) support

Only supporting asf header-format having BDUs with startcode.
It might be possible to support other formats too, but haven't tested.

https://bugzilla.gnome.org/show_bug.cgi?id=792589

6 years agomsdk: dec: Add non-packetized stream handling support
Sreerenj Balachandran [Tue, 13 Feb 2018 23:41:20 +0000 (14:41 -0900)]
msdk: dec: Add non-packetized stream handling support

The gst-msdk decoders prefer packetized streams as input
and in this case we can avoid unnecessary input bitstream copy
to mfxBitstream. This works fine for codecs like h264 where
we only support byte-stream with au alignment. Other format
conversions should be done thorugh parsers. But this won't work
for codecs like vc1 where we don't have an autoplugged parser.
Even the parser is not capable to do format conversions.

Packetizing through base decoders parse() routine will bring a
lot of uncecessary of complexities and codecparser libraray dependency.
So we just use an interal gst_adaper to keep track of bitstream
which is not consumed by msdk durig AsynchronusDecoding.
This adapter will get used only if subclass implementations
set the "is_packetized" to FALSE for msdk base encoder.

https://bugzilla.gnome.org/show_bug.cgi?id=792589

6 years agomsdk: Add VC1 decoder (simple and main profiles)
Sreerenj Balachandran [Tue, 13 Feb 2018 23:40:54 +0000 (14:40 -0900)]
msdk: Add VC1 decoder (simple and main profiles)

Adding Simple and Main profiles decode support.

Currently msdkvc1dec is not capable to handle the codec_data,
only instream headers are supported. Also msdk vc1 decoder
expecting instream with Sequence header as per SMPTE 421M Annex L.

Most of the decdoebin/playbin pipeline won't work with the above
constraints
because vc1parse is still not an autoplug element.

Only way to make mskdvc1dec work is by connecting a vc1parse
as an upstream element.

https://bugzilla.gnome.org/show_bug.cgi?id=792589

6 years agomsdk : Add RenderNode support
Sreerenj Balachandran [Tue, 13 Feb 2018 23:40:22 +0000 (14:40 -0900)]
msdk : Add RenderNode support

Use drm render node as the first choice of device node file.
Fall backs to use drm primary (/dev/dri/card[0-9])
if there is no render node available

Basic logic is inherited from gstreamer-vaapi, but using
gudev API rather than libudev directly.

Added gudev library as dependency for msdk.

https://bugzilla.gnome.org/show_bug.cgi?id=791599

6 years agomsdk: Avoid build failures on Windows until d3d allocator is implemented
Hyunjun Ko [Tue, 13 Feb 2018 22:54:03 +0000 (13:54 -0900)]
msdk: Avoid build failures on Windows until d3d allocator is implemented

https://bugzilla.gnome.org/show_bug.cgi?id=790752

6 years agomsdkdec: use video memory if there's another MSDK context in a pipeline
Hyunjun Ko [Tue, 13 Feb 2018 22:53:02 +0000 (13:53 -0900)]
msdkdec: use video memory if there's another MSDK context in a pipeline

1\ If downstream's pool is MSDK bufferpool,
2\ If there's shared GstMsdkContext in the pipeline,

a decoder decides to use video memory.

This policy should be improved to handle more cases.

https://bugzilla.gnome.org/show_bug.cgi?id=790752

6 years agomsdk: add async depth from each msdk element to GstMsdkContext to be shared
Hyunjun Ko [Tue, 13 Feb 2018 22:52:14 +0000 (13:52 -0900)]
msdk: add async depth from each msdk element to GstMsdkContext to be shared

In case that pipeline is like ".. ! decoder ! encoder ! ..." with using
video memory,
decoder needs to know the async depth of the following msdk element so
that it could
allocate the correct number of video memory.

Otherwise, decoder's memory is exhausted while processing.

https://bugzilla.gnome.org/show_bug.cgi?id=790752

6 years agomsdkdec/enc: query GstContext to share GstMsdkContext
Hyunjun Ko [Tue, 13 Feb 2018 22:51:18 +0000 (13:51 -0900)]
msdkdec/enc: query GstContext to share GstMsdkContext

How to share/create GstMsdkcontext is the following:

- Search GstMsdkContext if there's in the pipeline.
  - If found, check if it's decoder, encoder or vpp by job type.
    - If it's same job type, it creates another instance of
GstMsdkContext
     with joined-session.
    - Otherwise just use the shared GstMsdkContext.
  - If not found, just creates new instance of GstMsdkContext.

https://bugzilla.gnome.org/show_bug.cgi?id=790752

6 years agomsdk: context: add job type to figure out if joining session is necessary
Hyunjun Ko [Tue, 13 Feb 2018 22:50:48 +0000 (13:50 -0900)]
msdk: context: add job type to figure out if joining session is necessary

According to the driver's instruction, if there are two or more encoders
or decoders in a process, the session should be joined by
MFXJoinSession.

To achieve this successfully by GstContext, this patch adds job type
specified if it's encoder, decoder or vpp.

If a msdk element gets to know if joining session is needed by the
shared context,
it should create another instance of GstContext with joined session,
which
is not shared.

https://bugzilla.gnome.org/show_bug.cgi?id=790752

6 years agomsdk: adds util functions to handle GstContext
Hyunjun Ko [Tue, 13 Feb 2018 22:50:08 +0000 (13:50 -0900)]
msdk: adds util functions to handle GstContext

To share GstMsdkContext with each msdk element,
it will be using GstContext.

Most common code is from gstreamer-vaapi.

https://bugzilla.gnome.org/show_bug.cgi?id=790752

6 years agomsdkdec: use bufferpool
Hyunjun Ko [Tue, 13 Feb 2018 22:49:28 +0000 (13:49 -0900)]
msdkdec: use bufferpool

1\ In decide_allocation, it makes its own msdk bufferpool.
  - If downstream supports video meta, it just replace it with the msdk
bufferpool.
  - If not, it uses the msdk bufferpool as a side pool, which will be
decoded into.
    and will copy it to downstream's bufferpool.

2\ Decide if using video memory or system memory.
  - This is not completed in this patch.
  - It might be decided in update_src_caps.
  - But tested for both system memory and video memory cases.

https://bugzilla.gnome.org/show_bug.cgi?id=790752

6 years agomsdkenc: use bufferpool
Hyunjun Ko [Tue, 13 Feb 2018 22:48:32 +0000 (13:48 -0900)]
msdkenc: use bufferpool

1\ Proposes msdk bufferpool to upstream.
  - If upstream has accepted the proposed msdk bufferpool,
    encoder can get msdk surface from the buffer directly.
  - If not, encoder get msdk surface its own msdk bufferpool
    and copy from upstream's frame to the surface.

2\ Replace arrays of surfaces with msdk bufferpool.

3\ In case of using VPP, there should be another msdk bufferpool
   with NV12 info so that it could convert first and encode.

Calls gst_msdk_set_frame_allocator and uses video memory only on linux.
and uses system memory on Windows until d3d allocator is implemented.

https://bugzilla.gnome.org/show_bug.cgi?id=790752

6 years agomsdk: supports bufferpool
Hyunjun Ko [Tue, 13 Feb 2018 22:44:08 +0000 (13:44 -0900)]
msdk: supports bufferpool

Implements 2 memory allocators:
1\ GstMsdkSystemAllocator: This will allocate system memory.
2\ GstMsdkVideoAllocator: This will allocate device memory depending
on the platform. (eg. VASurface)

Currently GstMsdkBufferPool uses video allocator currently by default
only on linux. On Windows, we should use system memory until d3d
allocator
is implemented.

https://bugzilla.gnome.org/show_bug.cgi?id=790752

6 years agomsdk: adds frame allocator using libva
Hyunjun Ko [Tue, 13 Feb 2018 21:43:42 +0000 (12:43 -0900)]
msdk: adds frame allocator using libva

Implements msdk frame allocator which is required from the driver.
Also makes these functions global so that GstMsdkAllocator could use
the allocated video memory later and couple with GstMsdkMemory.

GstMsdkContext keeps allocation information such as mfxFrameAllocRequest
and mfxFrameAllocResponse after allocation.

https://bugzilla.gnome.org/show_bug.cgi?id=790752

6 years agomsdkdec: fix typo
Hyunjun Ko [Tue, 13 Feb 2018 21:43:00 +0000 (12:43 -0900)]
msdkdec: fix typo

https://bugzilla.gnome.org/show_bug.cgi?id=790752

6 years agomsdk: implements GstMsdkContext.
Hyunjun Ko [Tue, 13 Feb 2018 21:41:28 +0000 (12:41 -0900)]
msdk: implements GstMsdkContext.

Makes GstMsdkContext to be a descendant of GstObject so that
we could track the life-cycle of the session of the driver.

Also replaces MsdkContext with this one.
Keeps msdk_d3d.c alive for the future.

https://bugzilla.gnome.org/show_bug.cgi?id=790752

6 years agomsdk: libva: adds utility function between mfx and libva
Hyunjun Ko [Tue, 13 Feb 2018 21:39:44 +0000 (12:39 -0900)]
msdk: libva: adds utility function between mfx and libva

https://bugzilla.gnome.org/show_bug.cgi?id=790752

6 years agomsdk: adds new utility functions for conversion from gstreamer to libmfx
Hyunjun Ko [Tue, 13 Feb 2018 21:37:47 +0000 (12:37 -0900)]
msdk: adds new utility functions for conversion from gstreamer to libmfx

https://bugzilla.gnome.org/show_bug.cgi?id=790752

6 years agomsdk: move and rename the function msdk_video_alignment
Hyunjun Ko [Tue, 13 Feb 2018 21:36:46 +0000 (12:36 -0900)]
msdk: move and rename the function msdk_video_alignment

Move the msdk_video_alignment function from decoder
to msdk.c and rename so that others could call this function
without duplicated declaration.

https://bugzilla.gnome.org/show_bug.cgi?id=790752

6 years agoaudioaggregator: remove, moved to -base
Tim-Philipp Müller [Tue, 13 Feb 2018 14:11:49 +0000 (14:11 +0000)]
audioaggregator: remove, moved to -base

https://bugzilla.gnome.org/show_bug.cgi?id=791218

6 years agoaudiomixer: remove, moved to -base
Tim-Philipp Müller [Tue, 13 Feb 2018 00:28:36 +0000 (00:28 +0000)]
audiomixer: remove, moved to -base

https://bugzilla.gnome.org/show_bug.cgi?id=791218

6 years agoproxy: remove unneeded object private structs
Tim-Philipp Müller [Mon, 12 Feb 2018 19:30:01 +0000 (19:30 +0000)]
proxy: remove unneeded object private structs

Plugin headers are not installed.

Also mark internal funcs as internal.

6 years agoqt: remove plugin, moved to -good
Tim-Philipp Müller [Mon, 12 Feb 2018 18:48:32 +0000 (18:48 +0000)]
qt: remove plugin, moved to -good

https://bugzilla.gnome.org/show_bug.cgi?id=754094

6 years agoconfigure: remove two more unneeded gtk conditionals
Tim-Philipp Müller [Mon, 12 Feb 2018 15:44:00 +0000 (15:44 +0000)]
configure: remove two more unneeded gtk conditionals

6 years agogtk: remove, plugin has moved to -good
Tim-Philipp Müller [Thu, 8 Feb 2018 19:11:21 +0000 (19:11 +0000)]
gtk: remove, plugin has moved to -good

6 years agointeraudio: Make sure both PTS and DTS values are defined
Carlos Rafael Giani [Thu, 7 Dec 2017 14:52:39 +0000 (15:52 +0100)]
interaudio: Make sure both PTS and DTS values are defined

The inter plugin originated in 0.10, which had only one timestamp. As a
result, during the port to 1.0, the DTS were left undefined. This can cause
subtle bugs with basesrc, which can end up incorrectly picking DTS over PTS
and producing output buffers with incorrect timestamps.

https://bugzilla.gnome.org/show_bug.cgi?id=791347

6 years agowasapisrc: Re-align device period if necessary
Nirbheek Chauhan [Thu, 8 Feb 2018 20:35:23 +0000 (02:05 +0530)]
wasapisrc: Re-align device period if necessary

Same changes as done for wasapisink in cbe2fc40a. Turns out this is
sometimes also needed for capture. Reported by Mathieu_Du.

Also improve logging in that case for easier debugging.

6 years agomeson: make version numbers ints and fix int/string comparison
Tim-Philipp Müller [Thu, 8 Feb 2018 19:09:45 +0000 (19:09 +0000)]
meson: make version numbers ints and fix int/string comparison

WARNING: Trying to compare values of different types (str, int).
The result of this is undefined and will become a hard error
in a future Meson release.

6 years agoRevert "gdpdepay: don't use allocator if it has custom alloc"
Víctor Manuel Jáquez Leal [Mon, 5 Feb 2018 17:03:31 +0000 (18:03 +0100)]
Revert "gdpdepay: don't use allocator if it has custom alloc"

This reverts commit f6cb16ab8cecfe683473b173732ad040e858abd5.

6 years agoproxy: Fix plugin definition
Nirbheek Chauhan [Thu, 8 Feb 2018 09:49:12 +0000 (15:19 +0530)]
proxy: Fix plugin definition

I'm not sure how this was missed in review...

6 years agoproxy: Remove dead code from Makefile.am
Nirbheek Chauhan [Thu, 8 Feb 2018 09:15:28 +0000 (14:45 +0530)]
proxy: Remove dead code from Makefile.am

There is no gstproxytest.c

6 years agomeson: Fix wasapi build on Windows
Nirbheek Chauhan [Thu, 8 Feb 2018 09:11:05 +0000 (14:41 +0530)]
meson: Fix wasapi build on Windows

Was missing device prober and avrt (on msvc)

6 years agowasapi: Unprepare when src/sink_prepare fails
Nirbheek Chauhan [Thu, 8 Feb 2018 08:57:43 +0000 (14:27 +0530)]
wasapi: Unprepare when src/sink_prepare fails

unprepare() is not called automatically on failure.

https://bugzilla.gnome.org/show_bug.cgi?id=793289

6 years agowasapisink: Re-align device period if necessary
Nirbheek Chauhan [Wed, 7 Feb 2018 21:41:10 +0000 (03:11 +0530)]
wasapisink: Re-align device period if necessary

Sometimes the minimum period advertised by a card results in an
unaligned buffer size error during initialization in exclusive mode.
In that case, we can fetch the actual buffer size in frames and
calculate the period from that.

We can't do this pre-emptively because we can't call GetBufferSize
till Initialize has been called at least once.

https://bugzilla.gnome.org/show_bug.cgi?id=793289

6 years agowasapisink: pre-load the buffer with silence
Nirbheek Chauhan [Wed, 7 Feb 2018 21:39:26 +0000 (03:09 +0530)]
wasapisink: pre-load the buffer with silence

This reduces the chances of startup glitches, and also reduces the
chances that we'll get garbled output due to driver bugs.

Recommended by the WASAPI documentation.

https://bugzilla.gnome.org/show_bug.cgi?id=793289

6 years agowasapi: Try to use latency-time and buffer-time
Nirbheek Chauhan [Tue, 6 Feb 2018 23:18:58 +0000 (04:48 +0530)]
wasapi: Try to use latency-time and buffer-time

So far, we have been completely discarding the values of latency-time
and buffer-time and trying to always open the device in the lowest
latency mode possible. However, sometimes this is a bad idea:

1. When we want to save power/CPU and don't want low latency
2. When the lowest latency setting causes glitches
3. Other audio-driver bugs

Now we will try to follow the user-set values of latency-time and
buffer-time in shared mode, and only latency-time in exclusive mode (we
have no control over the hardware buffer size, and there is no use in
setting GstAudioRingBuffer size to something larger).

The elements will still try to open the devices in the lowest latency
mode possible if you set the "low-latency" property to "true".

https://bugzilla.gnome.org/show_bug.cgi?id=793289

6 years agowasapi: Cover more HRESULT error messages
Nirbheek Chauhan [Tue, 6 Feb 2018 18:26:41 +0000 (23:56 +0530)]
wasapi: Cover more HRESULT error messages

This requires using allocated strings, but it's the best option. For
instance, a call could fail because CoInitialize() wasn't called, or
because some other thing in the stack failed.

https://bugzilla.gnome.org/show_bug.cgi?id=793289

6 years agowasapi: Increase thread priority to reduce glitches
Nirbheek Chauhan [Tue, 6 Feb 2018 18:15:02 +0000 (23:45 +0530)]
wasapi: Increase thread priority to reduce glitches

This is particularly important when running in exclusive mode because
any delays will immediately cause glitching.

The MinGW version in Cerbero is too old, so we can only enable this when
building with MSVC or when people build GStreamer for MSYS2 or other
MinGW-based distributions.

To force-enable this code when building with MinGW, build with
CFLAGS="-DGST_FORCE_WIN_AVRT -lavrt".

https://bugzilla.gnome.org/show_bug.cgi?id=793289

6 years agowasapi: Allow opening devices in exclusive mode
Nirbheek Chauhan [Tue, 6 Feb 2018 18:10:49 +0000 (23:40 +0530)]
wasapi: Allow opening devices in exclusive mode

This provides much lower latency compared to opening in shared mode,
but it also means that the device cannot be opened by any other
application. The advantage is that the achievable latency is much
lower.

In shared mode, WASAPI's engine period is 10ms, and so that is the
lowest latency achievable.

In exclusive mode, the limit is the device period itself, which in my
testing with USB DACs, on-board PCI sound-cards, and HDMI cards is
between 2ms and 3.33ms.

We set our audioringbuffer limits to match the device, so the
achievable sink latency is 6-9ms. Further improvements can be made if
needed.

https://bugzilla.gnome.org/show_bug.cgi?id=793289

6 years agowasapi: Rename struct element for device name
Nirbheek Chauhan [Tue, 6 Feb 2018 18:07:19 +0000 (23:37 +0530)]
wasapi: Rename struct element for device name

We will use ->device for storing a pointer to the IMMDevice structure
which is needed for fetching the caps supported by devices in
exclusive mode.

https://bugzilla.gnome.org/show_bug.cgi?id=793289

6 years agowasapi: Fix indentation issues missed by the commit hook
Nirbheek Chauhan [Thu, 8 Feb 2018 06:02:32 +0000 (11:32 +0530)]
wasapi: Fix indentation issues missed by the commit hook

These were missed because the relevant commits were made on Windows
where `indent` wasn't installed.

6 years agovulkanupload: actually loop over possible uploaders
Matthew Waters [Thu, 8 Feb 2018 05:55:43 +0000 (16:55 +1100)]
vulkanupload: actually loop over possible uploaders

Fix some funky control that wasn't working

CID #1417219

6 years agowebrtc: Fix ffeb09e4 conditional
Matthew Waters [Thu, 8 Feb 2018 04:48:49 +0000 (15:48 +1100)]
webrtc: Fix ffeb09e4 conditional

Fixes ffeb09e4abe73d3b9e8909996816f0288e307e22

if (sscanf(...)) {  // != 0
  error;
}

Is not correct where != 0 indicates some kind of success.

Check instead that the correct number of elements were slurped.

6 years agowebrtc: change dead code to an assert
Matthew Waters [Thu, 8 Feb 2018 04:47:33 +0000 (15:47 +1100)]
webrtc: change dead code to an assert

CID #1429140

6 years agodtls: add meson definition for recently added test
Matthew Waters [Thu, 8 Feb 2018 04:29:13 +0000 (15:29 +1100)]
dtls: add meson definition for recently added test

6 years agowebrtc: bail on invalid rtpbin names
Matthew Waters [Thu, 8 Feb 2018 04:25:22 +0000 (15:25 +1100)]
webrtc: bail on invalid rtpbin names

If we fail parsing rtpbin pad names, someone has screwed up so critical
and return.

CID #1429142

6 years agoAdd new 'proxy' element to stream data between pipelines
Nirbheek Chauhan [Wed, 3 Feb 2016 18:38:57 +0000 (00:08 +0530)]
Add new 'proxy' element to stream data between pipelines

This keep-it-simple plugin is useful when you want to pipe arbitrary
data to a different pipeline within the same process. Some advantages
over appsink/appsrc, the inter elements, etc:

* Ease of use. Buffers, events, and caps are transmitted as-is without
  copying or serialization.
* Enables zerocopy (especially DMABUF) transparently without any
  special-casing.
* Enables usage with sinks or elements that are unreliable and may
  throw errors and need re-initialization, such as a network sink, a
  USB device sink (v4l2), etc.
* Transmits arbitrary data, not just audio/video/subs
* Can easily implement 1 producer pipeline -> N dynamic consumer
  pipelines within a single process when combined with the `tee`
  element.

All queries, events, buffers, and buffer lists are proxied. State
changes, clocks, and base times for the two pipelines are independent
since the upstream and downstreams continue to be different pipelines.

https://bugzilla.gnome.org/show_bug.cgi?id=788200

6 years agoqt: don't #include platform specific gstglcontext_*.h headers
Matthew Waters [Wed, 7 Feb 2018 09:15:00 +0000 (20:15 +1100)]
qt: don't #include platform specific gstglcontext_*.h headers

They aren't public headers

6 years agoopencv: fix OPENCV_PATH_NAME when using meson
Guillaume Desmottes [Tue, 6 Feb 2018 10:36:27 +0000 (11:36 +0100)]
opencv: fix OPENCV_PATH_NAME when using meson

Meson was checking for $prefix/OpenCV but was then defining
OPENCV_PATH_NAME with 'OpenCv' rather than 'OpenCV'.

https://bugzilla.gnome.org/show_bug.cgi?id=793212

6 years agoaom: Drop pointless cast from av1enc
Sean DuBois [Mon, 5 Feb 2018 08:53:20 +0000 (08:53 +0000)]
aom: Drop pointless cast from av1enc

https://bugzilla.gnome.org/show_bug.cgi?id=791674

6 years agoaom: Fix all definite leaks in av1enc
Sean DuBois [Fri, 2 Feb 2018 06:56:17 +0000 (06:56 +0000)]
aom: Fix all definite leaks in av1enc

Track if the encoder has been inited, and cleanup if needed. Also unref
input_state if has been set

https://bugzilla.gnome.org/show_bug.cgi?id=791674

6 years agoaom: Consistent naming between av1dec and av1enc
Sean DuBois [Fri, 2 Feb 2018 05:43:20 +0000 (05:43 +0000)]
aom: Consistent naming between av1dec and av1enc

https://bugzilla.gnome.org/show_bug.cgi?id=791674

6 years agoaom: Implement flush for av1dec
Sean DuBois [Wed, 31 Jan 2018 07:34:32 +0000 (07:34 +0000)]
aom: Implement flush for av1dec

https://bugzilla.gnome.org/show_bug.cgi?id=791674

6 years agoautotools: use -fno-strict-aliasing where supported
Tim-Philipp Müller [Sun, 4 Feb 2018 11:18:06 +0000 (12:18 +0100)]
autotools: use -fno-strict-aliasing where supported

https://bugzilla.gnome.org/show_bug.cgi?id=769183

6 years agotests: add a test for the dtls{enc,dec} elements
Matthew Waters [Mon, 5 Feb 2018 06:00:15 +0000 (17:00 +1100)]
tests: add a test for the dtls{enc,dec} elements

6 years agodtls: drop upstream segment and stream-start events
Matthew Waters [Mon, 5 Feb 2018 05:57:52 +0000 (16:57 +1100)]
dtls: drop upstream segment and stream-start events

Fixes tests with GstHarness

We will push our own from the srcpad task.

6 years agodtls: don't leak the system clock
Matthew Waters [Mon, 5 Feb 2018 06:41:25 +0000 (17:41 +1100)]
dtls: don't leak the system clock

Obtain and release it as needed.

6 years agodtlsenc: fix typo in is-client property description
Matthew Waters [Mon, 5 Feb 2018 05:16:31 +0000 (16:16 +1100)]
dtlsenc: fix typo in is-client property description

6 years agoadaptivedemux: reject segment seeks
Mathieu Duponchelle [Fri, 7 Jul 2017 15:32:33 +0000 (17:32 +0200)]
adaptivedemux: reject segment seeks

While #782140 can stay open for actually handling these,
the fact is currently adaptivedemux does not handle segment
seeks, and as such should not accept them.

https://bugzilla.gnome.org/show_bug.cgi?id=784655

6 years agowebrtcbin: an element that handles the transport aspects of webrtc connections
Matthew Waters [Tue, 31 Jan 2017 09:56:59 +0000 (20:56 +1100)]
webrtcbin: an element that handles the transport aspects of webrtc connections

SDP's are generated and consumed according to the W3C PeerConnection API
available from https://www.w3.org/TR/webrtc/

The SDP is either created initially from the connected
sink pads/attached transceivers as in the case of generating an offer or
intersected with the connected sink pads/attached transceivers as in
the case for creating an answer.  In both cases, the rtp payloaded streams
sent by the peer are exposed as separate src pads.

The implementation supports trickle ICE, RTCP muxing, reduced size RTCP.

With contributions from:
Nirbheek Chauhan <nirbheek@centricular.com>
Mathieu Duponchelle <mathieu@centricular.com>
Edward Hervey <edward@centricular.com>

https://bugzilla.gnome.org/show_bug.cgi?id=792523

6 years agodtls: remove reliance on a default GMainContext/Loop
Matthew Waters [Tue, 16 Jan 2018 09:53:15 +0000 (20:53 +1100)]
dtls: remove reliance on a default GMainContext/Loop

By removing the indirection to the main loop completely when receiving
the peer certificate. For reference, the on-decoder-key signal does not
have a redirection.

6 years agonetsim: fix format errors for different platforms
Omar Akkila [Wed, 31 Jan 2018 18:21:58 +0000 (13:21 -0500)]
netsim: fix format errors for different platforms

https://bugzilla.gnome.org/show_bug.cgi?id=793073

6 years agoconfigure: fix opengl api conditional
Tim-Philipp Müller [Wed, 31 Jan 2018 16:10:24 +0000 (16:10 +0000)]
configure: fix opengl api conditional

Fixes build of openglmixers plugin due to mismatch between
build system conditional USE_OPENGL and define in gstglconfig.h

6 years agoconfigure: fix OpenGL API detection
Tim-Philipp Müller [Wed, 31 Jan 2018 13:03:28 +0000 (13:03 +0000)]
configure: fix OpenGL API detection

And don't build gl mosaic element unconditionally.

6 years agoautotools: fix build if OpenGL support is not available
Tim-Philipp Müller [Wed, 31 Jan 2018 13:02:07 +0000 (13:02 +0000)]
autotools: fix build if OpenGL support is not available

https://bugzilla.gnome.org/show_bug.cgi?id=793039

6 years agogdpdepay: don't use allocator if it has custom alloc
Víctor Manuel Jáquez Leal [Mon, 29 Jan 2018 11:53:51 +0000 (12:53 +0100)]
gdpdepay: don't use allocator if it has custom alloc

gdpdepay element uses the decide_allocation to fetch the downstream
allocator. Nonetheless it is possible that allocate uses a custom
alloc function, which is not usable by gdpdepay, crashing later the
application when the allocater buffer is NULL.

This patch checks for the allocator flags and reset it if the
allocator has a custom alloc function.

https://bugzilla.gnome.org/show_bug.cgi?id=789476

6 years agogdpdepay: don't allocation query if caps aren't fixed
Víctor Manuel Jáquez Leal [Mon, 29 Jan 2018 11:50:36 +0000 (12:50 +0100)]
gdpdepay: don't allocation query if caps aren't fixed

When querying downstream for allocation, and the source caps hasn't
set its caps, using ANY by default, it raises a critical message in
console:

CRITICAL **: gst_video_info_from_caps: assertion 'gst_caps_is_fixed (caps)' failed

This patch bails out decide_allocation() if the caps aren't fixed.

https://bugzilla.gnome.org/show_bug.cgi?id=789476

6 years agowasapi: Correctly set ringbuffer segsize/segtotal
Nirbheek Chauhan [Tue, 30 Jan 2018 22:21:47 +0000 (03:51 +0530)]
wasapi: Correctly set ringbuffer segsize/segtotal

This will set the actual-latency-time and actual-buffer-time of the sink
and source.

We completely ignore the latency-time/buffer-time values set
on the element because WASAPI is happiest when it is reading/writing at
the default period. Improving this will likely require the use of the
IAudioClient3 interfaces which are not available in MinGW yet.

https://bugzilla.gnome.org/show_bug.cgi?id=792897

6 years agowasapi: Implement a device provider for probing
Nirbheek Chauhan [Wed, 24 Jan 2018 19:21:22 +0000 (00:51 +0530)]
wasapi: Implement a device provider for probing

Currently only does probing and does not handle messages from
endpoints/devices. In the future we want to do proper monitoring which
is well-supported in WASAPI.

https://bugzilla.gnome.org/show_bug.cgi?id=792897

6 years agowasapi: Implement support for >2 channels
Nirbheek Chauhan [Wed, 24 Jan 2018 02:50:38 +0000 (08:20 +0530)]
wasapi: Implement support for >2 channels

We need to parse the WAVEFORMATEXTENSIBLE structure, figure out what
positions the channels have (if they are positional), and reorder them
as necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=792897

6 years agomeson: use -fno-strict-aliasing where supported
Tim-Philipp Müller [Tue, 30 Jan 2018 20:35:07 +0000 (20:35 +0000)]
meson: use -fno-strict-aliasing where supported

https://bugzilla.gnome.org/show_bug.cgi?id=769183

6 years agocodecparser: vp8: Fix range decoder init
Sreerenj Balachandran [Tue, 30 Jan 2018 20:34:58 +0000 (11:34 -0900)]
codecparser: vp8: Fix range decoder init

According to the vp8 spec, the first partition (size can be derived from
the frame header) should have all compressed header information and we
implemented gst codecparser based on that. But it doesn't seem to be the
case with some of the streams (#792773) and libvpx
works fine because it uses the whole frame size (not the first partition
size) to initialize the bool decoder.

https://bugzilla.gnome.org/show_bug.cgi?id=792773

6 years agokmssink: Make render rectangle property controllable
Nicolas Dufresne [Mon, 22 Jan 2018 21:21:27 +0000 (16:21 -0500)]
kmssink: Make render rectangle property controllable

https://bugzilla.gnome.org/show_bug.cgi?id=792798

6 years agoglvideomixer: fix vertex_buffer leak
Vincent Penquerc'h [Mon, 3 Oct 2016 12:11:07 +0000 (13:11 +0100)]
glvideomixer: fix vertex_buffer leak

We call the base class first as this will remove the pad from
the aggregator, thus stopping misc callbacks from being called,
one of which (process_textures) will recreate the vertex_buffer
if it is destroyed

https://bugzilla.gnome.org/show_bug.cgi?id=760873

6 years agosrtp: Support libsrtp2
Jan Alexander Steffens (heftig) [Fri, 26 Jan 2018 15:25:33 +0000 (16:25 +0100)]
srtp: Support libsrtp2

For libsrtp 1, add defines that translate the new namespaced identifiers
to the old unnamespaced ones. Also move the code for setting and getting
a stream's ROC into two compat functions that match libsrtp2's API.

It seems that libsrtp2 properly supports changing the ROC without having
to touch the sequence numbers afterwards, given that srtp_set_stream_roc
sets a pending_roc field, so the entire roc_changed dance should not be
needed anymore. The compat functions for libsrtp 1 just contain our
preexisting hacks, however, so it's still needed there.

libsrtp2 has no means of discovering the streams in the session, so to
create the stats structure we need to iterate over our own set of SSRCs.
For this we also need to re-add the previously removed ssrcs_set to the
encoder.

https://bugzilla.gnome.org/show_bug.cgi?id=776901