platform/upstream/gstreamer.git
5 years agomsdkvpp: allow UYVY in DMABuf mode in the sink pad
Haihao Xiang [Thu, 14 Feb 2019 06:48:12 +0000 (14:48 +0800)]
msdkvpp: allow UYVY in DMABuf mode in the sink pad

Tested with the pipeline below:

gst-launch-1.0 videotestsrc num-buffers=1 ! msdkvpp ! \
video/x-raw\(memory:DMABuf\),format=UYVY ! msdkvpp ! video/x-raw, \
format=YUY2 ! filesink location=a.yuv

5 years agomsdkvpp: allow UYVY in the src pad
Haihao Xiang [Thu, 14 Feb 2019 05:56:52 +0000 (13:56 +0800)]
msdkvpp: allow UYVY in the src pad

This make the pipeline below works:

gst-launch-1.0 videotestsrc num-buffers=1 ! msdkvpp ! \
video/x-raw,format=UYVY ! filesink location=a.yuv

Once https://github.com/intel/media-driver/pull/526 in the media-driver
is merged, the pipeline below also works:

gst-launch-1.0 videotestsrc num-buffers=1 ! msdkvpp ! \
video/x-raw\(memory:DMABuf\),format=UYVY ! filesink location=a.yuv

5 years agomsdk: map GST_VIDEO_FORMAT_UYVY to VA_FOURCC_UYVY
Haihao Xiang [Wed, 2 Jan 2019 11:48:34 +0000 (19:48 +0800)]
msdk: map GST_VIDEO_FORMAT_UYVY to VA_FOURCC_UYVY

5 years agomsdkvpp: allow BGRx in DMABuf mode in the src pad
Haihao Xiang [Thu, 14 Feb 2019 05:43:13 +0000 (13:43 +0800)]
msdkvpp: allow BGRx in DMABuf mode in the src pad

Tested with the pipeline below:

gst-launch-1.0 videotestsrc ! msdkvpp ! \
video/x-raw\(memory:DMABuf\),format=BGRx ! glimagesink

5 years agovcdsrc: Remove unusable VCD source
Bastien Nocera [Mon, 18 Feb 2019 14:15:44 +0000 (15:15 +0100)]
vcdsrc: Remove unusable VCD source

The VCD source was ported in 2014 (commit 89eb1e9), but the necessary
"cdxaparse" plugin, which is used to "Parse a .dat file (VCD) into
raw mpeg1" was never ported.

This means that the probable main user for the feature, totem, hasn't
actually been able to play back VCDs, since 2012, when it switched to
using GStreamer 1.0.

Note that even if cdxaparse was finally ported, a lot of work would
still be necessary before it is considered usable. Notably, it is
missing disc image support [1] and some VCDs just cannot be opened for
reading [2].

[1]: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/898
[2]: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/899

5 years agoclosedcaption: Use portable variadic macro syntax
Nirbheek Chauhan [Fri, 15 Feb 2019 17:21:21 +0000 (22:51 +0530)]
closedcaption: Use portable variadic macro syntax

args... is not understood by MSVC:

error C2010: '.': unexpected in macro parameter list

5 years agoclosedcaption: Port plugin to MSVC
Nirbheek Chauhan [Fri, 15 Feb 2019 17:22:30 +0000 (22:52 +0530)]
closedcaption: Port plugin to MSVC

pthread is not portable, so we can't use a pthread mutex use GMutex
instead.

5 years agowaylandsink: Don't create throwaway empty regions
Daniel Stone [Wed, 9 May 2018 12:16:15 +0000 (13:16 +0100)]
waylandsink: Don't create throwaway empty regions

Instead of creating a region, adding nothing to it, setting that as the
input region and destroying the region, you can instead just pass NULL
to wl_surface_set_input_region for the same effect.

Fixes #702

5 years agowebrtc: fix rtx + bundle
Matthew Waters [Fri, 15 Feb 2019 08:15:11 +0000 (19:15 +1100)]
webrtc: fix rtx + bundle

If bundle was used in combination with rtx, only the bundled transport
stream would have correctly configured rtx parameters.

Iterate over the payloads upfront in the bundled case to ensure the
correct payload mapping is set for the RTX elements.

5 years agodtls: Don't abort on non-fatal issues
Edward Hervey [Wed, 13 Feb 2019 16:24:50 +0000 (17:24 +0100)]
dtls: Don't abort on non-fatal issues

OpenSSL will take care of returning valid context if there are
only non-fatal issues. Don't abort in those cases and instead just
print out the issues

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

5 years agofdkaacenc: Fix draining with libfdk-aac v2.0.0
Jan Alexander Steffens (heftig) [Wed, 13 Feb 2019 15:09:45 +0000 (16:09 +0100)]
fdkaacenc: Fix draining with libfdk-aac v2.0.0

This release requires all buffer descriptor pointers to be valid, even
when we provide zero input buffers.

5 years agotsdemux: Skew correction should use the upstream DTS
Jan Schmidt [Tue, 12 Feb 2019 13:54:50 +0000 (00:54 +1100)]
tsdemux: Skew correction should use the upstream DTS

The MPEG-TS packetiser should use the upstream DTS for
skew correction when running in that mode, as the DTS
carries the upstream arrival time. The PTS (if it's
set at all) is less useful, and can be invalid.

5 years agoccconverter: Don't output empty buffers
Sebastian Dröge [Tue, 12 Feb 2019 12:31:13 +0000 (14:31 +0200)]
ccconverter: Don't output empty buffers

5 years agodecklinkvideosink: Use S334_EIA_608 instead of S334_EIA_708 for CEA608 output
Sebastian Dröge [Tue, 12 Feb 2019 12:30:49 +0000 (14:30 +0200)]
decklinkvideosink: Use S334_EIA_608 instead of S334_EIA_708 for CEA608 output

5 years agodecklinkvideosink: S334 1A CEA608 closed captions have the first bit set for the...
Sebastian Dröge [Tue, 12 Feb 2019 12:30:13 +0000 (14:30 +0200)]
decklinkvideosink: S334 1A CEA608 closed captions have the first bit set for the first field

And not for the second field. The logic was inverted here.

5 years agomsdkdec: set decode_only for output only
Haihao Xiang [Mon, 11 Feb 2019 05:53:19 +0000 (13:53 +0800)]
msdkdec: set decode_only for output only

MSDK may return MFX_ERR_MORE_DATA but without output surface

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

5 years agomsdk: verify the driver name
Haihao Xiang [Tue, 12 Feb 2019 02:53:55 +0000 (10:53 +0800)]
msdk: verify the driver name

We need to make sure the Intel graphics card is used in a dual GPU
system.

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

5 years agosrt: re-enable passphrase
Justin Kim [Fri, 25 Jan 2019 07:25:10 +0000 (16:25 +0900)]
srt: re-enable passphrase

With refactoring, supporting passphrase was removed accidently.
This commit re-enables srt encryption and validates 'passphrase'
by checking the return value of 'srt_setsockopt'.

fix: #694

5 years agoopenh264dec: Fix build with msvc
Seungha Yang [Mon, 11 Feb 2019 12:21:52 +0000 (21:21 +0900)]
openh264dec: Fix build with msvc

Fix following build error
../subprojects/gst-plugins-bad/ext/openh264/gstopenh264dec.cpp(76): error C2121:

Note that msvc usually complains #if inside macro

5 years agoAdd device provider for AVFoundation capture devices.
Josh Matthews [Sun, 27 Jan 2019 03:09:59 +0000 (22:09 -0500)]
Add device provider for AVFoundation capture devices.

5 years agomisc: Fix warnings on Cerbero MinGW
Nirbheek Chauhan [Tue, 5 Feb 2019 18:23:17 +0000 (23:53 +0530)]
misc: Fix warnings on Cerbero MinGW

gstladspa.c:360:5: error: zero-length ms_printf format string [-Werror=format-zero-length]

vad_private.c:108:3: error: this decimal constant is unsigned only in ISO C90 [-Werror]

gstdecklinkvideosink.cpp:478:32: error: comparison between 'BMDTimecodeFormat {aka enum _BMDTimecodeFormat}' and 'enum GstDecklinkTimecodeFormat' [-Werror=enum-compare]

win/DeckLinkAPI_i.c:72:8: error: extra tokens at end of #endif directive [-Werror]

win/DeckLinkAPIDispatch.cpp:35:10: error: unused variable 'res' [-Werror=unused-variable]

gstwasapiutil.c:733:3: error: format '%x' expects argument of type 'unsigned int', but argument 8 has type 'DWORD' [-Werror=format]
gstwasapiutil.c:733:3: error: format '%x' expects argument of type 'unsigned int', but argument 9 has type 'guint64' [-Werror=format]

kshelpers.c:446:3: error: missing braces around initializer [-Werror=missing-braces]
kshelpers.c:446:3: error: (near initialization for 'known_property_sets[0].guid.Data4') [-Werror=missing-braces]

5 years agomsdkdec: Release occupied surface for MFX_ERR_MORE_DATA
Haihao Xiang [Sat, 2 Feb 2019 05:26:32 +0000 (13:26 +0800)]
msdkdec: Release occupied surface for MFX_ERR_MORE_DATA

An output surface is returned but without sync point when when
MFXVideoDECODE_DecodeFrameAsync () returns MFX_ERR_MORE_DATA, this
surface should be released too, otherwise the surface is occupied
and it is easy to exhaust all pre-allocated mfx surfaces.

Example pipeline (input_vp8.webm contains lots of frame with show_frame
set to 0):

gst-launch-1.0 filesrc location=input_vp8.webm ! matroskademux !
msdkvp8dec ! msdkvpp ! fakesink

0:00:05.995959693 19866 0x563f30f14590 ERROR                default
gstmsdkvideomemory.c:77:gst_msdk_video_allocator_get_surface: failed to
get surface available
ERROR: from element
/GstPipeline:pipeline0/GstMatroskaDemux:matroskademux0: Internal data
stream error.

5 years agoopencv cameraundistort: use G_GNUC_UNUSED for better portability
Nicola Murino [Sat, 2 Feb 2019 15:54:23 +0000 (16:54 +0100)]
opencv cameraundistort: use G_GNUC_UNUSED for better portability

5 years agoopencv: remove deprecated headers
Nicola Murino [Mon, 17 Dec 2018 22:32:26 +0000 (23:32 +0100)]
opencv: remove deprecated headers

are not needed anymore

5 years agoopencv: port to c++
Nicola Murino [Sat, 1 Dec 2018 21:48:53 +0000 (22:48 +0100)]
opencv: port to c++

5 years agomsdkdec: explain the the extra ref of input buffer
Víctor Manuel Jáquez Leal [Sat, 2 Feb 2019 16:51:35 +0000 (17:51 +0100)]
msdkdec: explain the the extra ref of input buffer

5 years agomsdkdec: avoid releasing the input buffer when it is still in use
Haihao Xiang [Fri, 11 Jan 2019 08:18:11 +0000 (16:18 +0800)]
msdkdec: avoid releasing the input buffer when it is still in use

The input buffer is released in gst_msdkdec_finish_task () when decoding
some special clips however this buffer is still in use, so ref the input
buffer before gst_msdkdec_finish_task () and unref it at the end of
gst_msdkdec_handle_frame ().

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

5 years agomeson: orc-test is not required
Nirbheek Chauhan [Thu, 31 Jan 2019 09:54:06 +0000 (15:24 +0530)]
meson: orc-test is not required

This is especially never available on iOS.

5 years agomsdkvp9dec: output P010_10LE buffer if possible
Haihao Xiang [Wed, 16 Jan 2019 07:15:13 +0000 (15:15 +0800)]
msdkvp9dec: output P010_10LE buffer if possible

5 years agomsdkvp9dec: use separate src caps
Haihao Xiang [Wed, 16 Jan 2019 06:52:35 +0000 (14:52 +0800)]
msdkvp9dec: use separate src caps

We will add more formats in the src caps of msdkvp9dec, so let
msdkvp9dec uses separate src caps. Note it doesn't change any
capability

5 years agotestbin: Do not take FlowCombiner into account when flushing
Thibault Saunier [Thu, 31 Jan 2019 01:16:39 +0000 (22:16 -0300)]
testbin: Do not take FlowCombiner into account when flushing

The way FlowCombiner combines the FLUSH doesn't work in the case
we have several "sinkpads" since any flush return FLUSH. But in the
case we have a seek where on one branch flush is done, we should
just say OK otherwise we might return FLUSHING to a src that has already
been seeked and is ready to process new buffers

5 years agotestbin: Forward seek to all sources
Thibault Saunier [Wed, 30 Jan 2019 21:36:51 +0000 (18:36 -0300)]
testbin: Forward seek to all sources

5 years agod3dhelpers.c: fix typo in debug output
Aaron Boxer [Wed, 30 Jan 2019 16:11:47 +0000 (11:11 -0500)]
d3dhelpers.c: fix typo in debug output

5 years agomeson: Add support orc fallback
Seungha Yang [Wed, 30 Jan 2019 10:54:33 +0000 (19:54 +0900)]
meson: Add support orc fallback

Allow fallback to orc subproject if any, and add missing orc version check.
Additionally 'dependencies' keyword is removed from find_library,
because it's invalid keyword for find_library.

5 years agoopenh264: Conditionally support the main and high profiles
Jan Schmidt [Mon, 27 Feb 2017 11:41:47 +0000 (22:41 +1100)]
openh264: Conditionally support the main and high profiles

openh264 added main/high profile support upstream after the 1.8.0
release, so detect a version higher than that and support main/high
stream input

5 years agoopenh264: Use DecodeFrameNoDelay() API instead of DecodeFrame2
Jan Schmidt [Thu, 3 Jan 2019 15:53:33 +0000 (02:53 +1100)]
openh264: Use DecodeFrameNoDelay() API instead of DecodeFrame2

Replace legacy usage of DecodeFrame2 API in favour of the
recommended DecodeFrameNoDelay()

This fixes problems with DecodeFrame2() not (currently) returning
all frames in main/high streams with B-frames, and reduces latency -
previously openh264 would not return a decoded frame until the next
call to DecodeFrame2(). DecodeFrameNoDelay() returns them immediately.

5 years agoopenh264dec: Hook up openh264 messages to GStreamer logging
Jan Schmidt [Wed, 30 Jan 2019 03:46:37 +0000 (14:46 +1100)]
openh264dec: Hook up openh264 messages to GStreamer logging

Use the OpenH264 callback to pass Openh264 internal warning/error
messages through the GStreamer logging framework

5 years agoopenh264dec: Handle B frame decoding
Jan Schmidt [Wed, 5 Apr 2017 05:36:06 +0000 (15:36 +1000)]
openh264dec: Handle B frame decoding

Support out-of-order decoding in OpenH264 by tracking
our internal frame reference in the OpenH264 timestamp
field.

Drain any pending frames at EOS.

5 years agoAdd OpenH264 version check macro
Jan Schmidt [Wed, 30 Jan 2019 03:38:20 +0000 (14:38 +1100)]
Add OpenH264 version check macro

5 years agoopenh264dec: Fix up EOS handling
Jan Schmidt [Fri, 24 Mar 2017 16:37:35 +0000 (03:37 +1100)]
openh264dec: Fix up EOS handling

If the last frame(s) produce errors, then we need to drop them
or else we spin forever failing to decode a frame and thinking
it'll get better if we wait for more data that's never coming.

5 years agomeson: Fix building of the nvdec plugin on Windows
Nirbheek Chauhan [Sat, 19 Jan 2019 19:53:39 +0000 (01:23 +0530)]
meson: Fix building of the nvdec plugin on Windows

Have to use the Nvidia Video Codec SDK when building with a newer CUDA
toolkit.

5 years agoavfvideosrc: add device-name property
VaL Doroshchuk [Tue, 22 Jan 2019 12:52:55 +0000 (13:52 +0100)]
avfvideosrc: add device-name property

This property is readonly and should show the name of selected capture device.

5 years agofdkaacdec: Fix build for fdkaac < 0.1.4
Yeongjin Jeong [Mon, 21 Jan 2019 16:54:24 +0000 (01:54 +0900)]
fdkaacdec: Fix build for fdkaac < 0.1.4

The fdkaac decoder supports 6.1 / 7.1 channels with downmixer
since v0.1.4. Old versions can use AAC_PCM_OUTPUT_CHANNELS
instead of AAC_PCM_MAX_OUTPUT_CHANNELS.

Fixes #873

5 years agomsdkdec: set the mfx picture structure to MFX_PICSTRUCT_PROGRESSIVE if it is unknown
Haihao Xiang [Mon, 21 Jan 2019 04:25:36 +0000 (12:25 +0800)]
msdkdec: set the mfx picture structure to MFX_PICSTRUCT_PROGRESSIVE if it is unknown

The picture structure in the output parameters from
MFXVideoDECODE_Query is set to MFX_PICSTRUCT_UNKNOWN for some codecs, so
the structure of the corresponding mfx surfaces created for decoding are
unknown. The pipeline will be broken when these surfaces are used as the
input for msdkvpp.

Example pipeline:

gst-launch-1.0 filesrc location=input_vp8.webm ! matroskademux !
msdkvp8dec ! msdkvpp ! fakesink

Error message:

0:00:00.031568911 14259 0x55b79dc684a0 ERROR                msdkvpp
gstmsdkvpp.c:728:gst_msdkvpp_transform:<msdkvpp0> MSDK Failed to do VPP
ERROR: from element
/GstPipeline:pipeline0/GstMatroskaDemux:matroskademux0: Internal data
stream error.

This is a workaround for the above issue

5 years agompegpsmux: add stream-format and alignment to H.264 caps
Nicola Murino [Thu, 24 Jan 2019 21:51:39 +0000 (22:51 +0100)]
mpegpsmux: add stream-format and alignment to H.264 caps

5 years agomsdkh265enc: enable low power mode
Haihao Xiang [Wed, 16 Jan 2019 02:44:21 +0000 (10:44 +0800)]
msdkh265enc: enable low power mode

Low power mode is disabled by default, set the value of low-power to
true to enable this mode.

5 years agompegdemux: add support for H.265
Nicola Murino [Thu, 24 Jan 2019 09:32:46 +0000 (10:32 +0100)]
mpegdemux: add support for H.265

5 years agompegdemux: add stream format to H.264 caps
Nicola Murino [Thu, 24 Jan 2019 09:32:14 +0000 (10:32 +0100)]
mpegdemux: add stream format to H.264 caps

5 years agomsdk: bufferpool: refactor memory type decision
Víctor Manuel Jáquez Leal [Mon, 21 Jan 2019 17:18:46 +0000 (18:18 +0100)]
msdk: bufferpool: refactor memory type decision

The memory type was used as bitwise enum, but the enum was not
defined in that way.

Nonetheless, most of the usage of the memory type was as mutually
exclusive options, rather than option composition.

This patch refactor how the memory type is defined, so it is kept
the mutual exclusion among options.

5 years agomsdk: fix some comments typos
Víctor Manuel Jáquez Leal [Mon, 21 Jan 2019 11:46:32 +0000 (12:46 +0100)]
msdk: fix some comments typos

5 years agomsdk: decoder: fatal failure if negotiations fails
Víctor Manuel Jáquez Leal [Mon, 21 Jan 2019 15:43:11 +0000 (16:43 +0100)]
msdk: decoder: fatal failure if negotiations fails

Otherwise it crashes when no parser is used placed upstream, v.gr.

gst-launch-1.0 filesrc location=file.264 ! msdkh264dec ! fakesink

5 years agomsdk: decoder: comment to explain array reset
Víctor Manuel Jáquez Leal [Mon, 21 Jan 2019 15:11:59 +0000 (16:11 +0100)]
msdk: decoder: comment to explain array reset

5 years agomsdk: decoder: fix an usage-after-free pointer bug
Víctor Manuel Jáquez Leal [Mon, 21 Jan 2019 14:53:23 +0000 (15:53 +0100)]
msdk: decoder: fix an usage-after-free pointer bug

5 years agowebrtc: expose ice-transport-policy property
Mathieu Duponchelle [Thu, 17 Jan 2019 14:06:06 +0000 (15:06 +0100)]
webrtc: expose ice-transport-policy property

This is the equivalent of iceTransportPolicy in the RTCConfiguration
dictionary.

Only two values are implemented:

* all: default behaviour
* relay: only gather relay candidates

The third member of the iceTransportPolicy enum, "public", is
obsolete.

5 years agosrt: Accepts URIs without host to go into listener mode
Olivier Crête [Tue, 22 Jan 2019 19:34:23 +0000 (14:34 -0500)]
srt: Accepts URIs without host to go into listener mode

Just setting a URI without a hostname should directly go into listener mode.

5 years agosrt: Fix GClosure usage
Olivier Crête [Tue, 22 Jan 2019 19:33:32 +0000 (14:33 -0500)]
srt: Fix GClosure usage

One needs to set a marshaller as well as use the object setter when
setting objects.

5 years agomeson: detect opengl api from -base .pc files correctly
Tim-Philipp Müller [Tue, 22 Jan 2019 12:52:25 +0000 (12:52 +0000)]
meson: detect opengl api from -base .pc files correctly

There was a mismatch between the .pc files generated by
autotools and by meson that would lead to meson not detecting
that opengl api is available even though it is. This could
lead to build failures when building -bad with meson against
a -base that was built with autotools. The mismatch has now
been rectified but we will still check the old one for backwards
compatibility.

5 years agomeson: remove some cruft
Tim-Philipp Müller [Tue, 22 Jan 2019 12:41:00 +0000 (12:41 +0000)]
meson: remove some cruft

5 years agowpesrc: Plug WPE's exportable leak
Philippe Normand [Fri, 18 Jan 2019 13:28:26 +0000 (13:28 +0000)]
wpesrc: Plug WPE's exportable leak

5 years agowpe: Add autotools build support
Philippe Normand [Mon, 21 Jan 2019 10:57:57 +0000 (10:57 +0000)]
wpe: Add autotools build support

5 years agosrt: Use default host and port if uri doesn't provide
Justin Kim [Tue, 22 Jan 2019 04:02:30 +0000 (13:02 +0900)]
srt: Use default host and port if uri doesn't provide

5 years agosrt: Enable logs for srtobject
Justin Kim [Tue, 22 Jan 2019 03:44:07 +0000 (12:44 +0900)]
srt: Enable logs for srtobject

5 years agosrt: Fix property names
Justin Kim [Tue, 22 Jan 2019 03:42:47 +0000 (12:42 +0900)]
srt: Fix property names

Property name and its enum should match.

5 years agosrt: Fix a regression crash
Justin Kim [Tue, 22 Jan 2019 02:35:03 +0000 (11:35 +0900)]
srt: Fix a regression crash

Even in case that srt is working as a caller mode, uri can have no
hostname or ip address.

fix: #874

5 years agomsdkvpp: add P010_10LE to sink and src caps
Haihao Xiang [Tue, 15 Jan 2019 05:59:05 +0000 (13:59 +0800)]
msdkvpp: add P010_10LE to sink and src caps

example pipelines:

gst-launch-1.0 videotestsrc num-buffers=100 ! \
video/x-raw,format=P010_10LE,width=352,height=288 ! msdkvpp ! \
video/x-raw,format=NV12! fakesink

gst-launch-1.0 videotestsrc num-buffers=100 ! \
video/x-raw,format=NV12,width=352,height=288 ! msdkvpp ! \
video/x-raw,format=P010_10LE ! fakesink

5 years agomsdkh265dec: support P010_10LE in DMABuf mode
Haihao Xiang [Tue, 15 Jan 2019 06:30:34 +0000 (14:30 +0800)]
msdkh265dec: support P010_10LE in DMABuf mode

5 years agowasapi: Fixed corner-cases in mapping of channel mask
Jacek Tomaszewski [Wed, 12 Dec 2018 12:14:13 +0000 (13:14 +0100)]
wasapi: Fixed corner-cases in mapping of channel mask

'channel-mask' field should not be put in caps if channel mask is 0x0

Mapping WASAPI channel mask to GST equivalent was going only over
first nChannels elements of wasapi_to_gst_pos array, translating, for
example, WASAPI's 0x63f to GST's 0x3f instead of 0xc3f.

When 'channel-mask' is specified as NULL, it signifies that there's
need to do downmix or upmix and it makes caps negotiation with
audioconvert element impossible. Just omit it.

Signed-off-by: Nirbheek Chauhan <nirbheek@centricular.com>
5 years agomeson: Fix automagic build of msdk plugin
Nirbheek Chauhan [Sat, 19 Jan 2019 18:23:56 +0000 (23:53 +0530)]
meson: Fix automagic build of msdk plugin

When building the msdk plugin even if libmfx is found, unless the
plugin is explicitly enabled we should not error out if msdk
dependencies are not found.

Also give an error message when we don't build the plugin on Windows
because we're not building with MSVC.

5 years agobuild: Don't forget to add windows files to EXTRA_DIST
Nirbheek Chauhan [Fri, 18 Jan 2019 07:40:31 +0000 (13:10 +0530)]
build: Don't forget to add windows files to EXTRA_DIST

5 years agoremovesilence: Add $(LIBM) to libraries
Sebastian Dröge [Thu, 17 Jan 2019 15:14:31 +0000 (17:14 +0200)]
removesilence: Add $(LIBM) to libraries

/usr/bin/ld: .libs/libgstremovesilence_la-vad_private.o: in function `vad_set_threshold':
./gst/removesilence/vad_private.c:108: undefined reference to `pow'
/usr/bin/ld: .libs/libgstremovesilence_la-vad_private.o: in function `vad_get_threshold_as_db':
./gst/removesilence/vad_private.c:114: undefined reference to `log10'

5 years agoRelease 1.15.1
Tim-Philipp Müller [Thu, 17 Jan 2019 02:16:53 +0000 (02:16 +0000)]
Release 1.15.1

5 years agoUpdate docs
Tim-Philipp Müller [Thu, 17 Jan 2019 02:16:52 +0000 (02:16 +0000)]
Update docs

5 years agoUpdate translations
Tim-Philipp Müller [Thu, 17 Jan 2019 02:16:38 +0000 (02:16 +0000)]
Update translations

5 years agosrt: dist enums header
Tim-Philipp Müller [Wed, 16 Jan 2019 13:48:28 +0000 (13:48 +0000)]
srt: dist enums header

5 years agomeson: enable tests for orc code
Tim-Philipp Müller [Wed, 16 Jan 2019 01:03:40 +0000 (01:03 +0000)]
meson: enable tests for orc code

5 years agowasapi: Fix infinite loop when the device disappears
Nirbheek Chauhan [Mon, 14 Jan 2019 20:33:23 +0000 (02:03 +0530)]
wasapi: Fix infinite loop when the device disappears

When the audio device goes away during playback or capture, we were
going into an infinite loop of AUDCLNT_E_DEVICE_INVALIDATED. Return -1
and post an error message so the ringbuffer thread exits with an error.

5 years agosrt: Fix autotools build
Jan Alexander Steffens (heftig) [Mon, 14 Jan 2019 13:29:07 +0000 (14:29 +0100)]
srt: Fix autotools build

0a350c610dab54dcdf55b45a0293fff048d24bb3 broke the build by only
building enum types with meson. It also removed gstsrt.c from the list
of sources, causing the plugin to fail to load.

squash! srt: Fix autotools build

5 years agosrt: Fix GCC function type error
Jan Alexander Steffens (heftig) [Mon, 14 Jan 2019 13:37:23 +0000 (14:37 +0100)]
srt: Fix GCC function type error

gstsrtobject.c: In function ‘gst_srt_object_close’:
gstsrtobject.c:1036:7: error: function called through a non-compatible type [-Werror]
       (GDestroyNotify) g_closure_unref);
/usr/include/glib-2.0/glib/gmem.h:121:8: note: in definition of macro ‘g_clear_pointer’
       (destroy) (_ptr);                                                        \
        ^~~~~~~
gstsrtobject.c:1038:7: error: function called through a non-compatible type [-Werror]
       (GDestroyNotify) g_closure_unref);
/usr/include/glib-2.0/glib/gmem.h:121:8: note: in definition of macro ‘g_clear_pointer’
       (destroy) (_ptr);                                                        \
        ^~~~~~~

Arch Linux
gcc 8.2.1 20181127
glib 2.58.2

5 years agomsdk: set the right BRCParamMultiplier
Haihao Xiang [Thu, 10 Jan 2019 06:28:52 +0000 (14:28 +0800)]
msdk: set the right BRCParamMultiplier

BRCParamMultiplier in mfxInfoMFX is a parameter which specifies a
multiplier for bitrate control parameters [1], it impacts TargetKbps,
MaxKbps, BufferSizeInKB and InitialDelayInKB.

[1]: https://software.intel.com/en-us/node/628473

5 years agomsdk: set the upper bound of max-vbv-bitrate to 2048000 kbps
Haihao Xiang [Thu, 10 Jan 2019 07:02:16 +0000 (15:02 +0800)]
msdk: set the upper bound of max-vbv-bitrate to 2048000 kbps

The upper bound of bitrate is also 2048000 kbps which should be large
enough in practice.

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

5 years agomeson: Fix building of MSDK plugin on Windows
Nirbheek Chauhan [Thu, 10 Jan 2019 10:04:51 +0000 (15:34 +0530)]
meson: Fix building of MSDK plugin on Windows

Variable name was typoed in 604c8d5232eba961ca34c9e98de8d5454cd5ab5f

5 years agosrt: Integrate server and client element into one
Justin Kim [Wed, 7 Nov 2018 05:47:44 +0000 (14:47 +0900)]
srt: Integrate server and client element into one

We have srt{client,server}{src,sink} elements in accordance to the
norm of the connection oriented protocols. However, SRT connection
mode can be changed by uri parameters so it requires an integrated
element to handle the parameters.

fix: #740

5 years agomsdk: needn't call MFXJoinSession after MFXCloneSession
Haihao Xiang [Wed, 9 Jan 2019 07:03:19 +0000 (15:03 +0800)]
msdk: needn't call MFXJoinSession after MFXCloneSession

According to the MSDK documation[1], MFXCloneSession is a light-weight
equivalent of MFXJoinSession after MFXInit, so MFXJoinSession call isn't
needed in the msdk plugin, otherwise the cloned session is joined to the
parent session twice, and we will get a MFX error when closing the
parent session

example pipeline:

gst-launch-1.0 videotestsrc num-buffers=100 ! \
video/x-raw,format=NV12,width=352,height=288 ! msdkh264enc ! msdkh264dec ! \
msdkh264enc ! fakesink

Error message:

0:00:00.211948518 21733 0x5586ee741c60 ERROR                   msdk
msdk.c:148:msdk_close_session: Close failed (undefined behavior)

[1]: https://software.intel.com/en-us/node/628429#MFXCloneSession

5 years agomsdk: check whether mfx function call fails
Haihao Xiang [Wed, 9 Jan 2019 04:19:50 +0000 (12:19 +0800)]
msdk: check whether mfx function call fails

And log the failures for debugging

5 years agomsdkenc: return NULL instead of FALSE
Haihao Xiang [Wed, 9 Jan 2019 01:49:16 +0000 (09:49 +0800)]
msdkenc: return NULL instead of FALSE

The returned type is a pointer

5 years agomsdk: release resources if failing to create the buffer pool
Haihao Xiang [Wed, 9 Jan 2019 00:58:00 +0000 (08:58 +0800)]
msdk: release resources if failing to create the buffer pool

Needn't check the pointers against NULL because the pointers are
non-NULL

5 years agomsdk: meson: compile vp9dec if available
Víctor Manuel Jáquez Leal [Tue, 8 Jan 2019 12:33:44 +0000 (13:33 +0100)]
msdk: meson: compile vp9dec if available

based on the patches provided by Haihao Xiang <haihao.xiang@intel.com>

5 years agomsdk: add mfx in include path
Víctor Manuel Jáquez Leal [Tue, 8 Jan 2019 12:36:09 +0000 (13:36 +0100)]
msdk: add mfx in include path

Thus removing the preprocessor's directives to included if found.

5 years agomsdk: meson: use libmfx pkg-config if available
Víctor Manuel Jáquez Leal [Tue, 8 Jan 2019 12:30:29 +0000 (13:30 +0100)]
msdk: meson: use libmfx pkg-config if available

Refactoring to bail out early if MediaSDK is not found.

based on the patches provided by Haihao Xiang <haihao.xiang@intel.com>

5 years agomsdk: add in configure more directories to search for libraries
Víctor Manuel Jáquez Leal [Tue, 8 Jan 2019 12:18:13 +0000 (13:18 +0100)]
msdk: add in configure more directories to search for libraries

5 years agomsdk: don't reset the external frame allocator
Haihao Xiang [Sat, 29 Dec 2018 05:56:49 +0000 (13:56 +0800)]
msdk: don't reset the external frame allocator

In gst-msdk, a mfx session may be shared between different gst
elements, each element tries to set the frame allocator. However, per
the MSDK documation[1], the behavior is undefined if reset the frame
allocator while the previous allocator is in use. Fortunately all
elements use the same frame allocator, so we can avoid to call
MFXVideoCORE_SetFrameAllocator again.

[1]: https://software.intel.com/en-us/node/628430#MFXVideoCORE3

5 years agomsdkvpp: don't use NV12 as default output in normal mode
Haihao Xiang [Thu, 27 Dec 2018 08:50:54 +0000 (16:50 +0800)]
msdkvpp: don't use NV12 as default output in normal mode

If so, BGRA is the preferred output format hence BGRA will be selected
as input format by default, e.g. in the pipleline below, BGRA instead of
NV12 is selected without renegotiation, so we can avoid the NV12 issue
(see commit 3f2314a) by default.

gst-launch-1.0 videotestsrc ! msdkvpp ! glimagesink

5 years agomsdkvpp: close the current VPP session if this session has been initialized
Haihao Xiang [Fri, 14 Dec 2018 02:18:25 +0000 (10:18 +0800)]
msdkvpp: close the current VPP session if this session has been initialized

Otherwise MFXVideoVPP_Init will fail because it is called twice without
a close.

Example pipeline:

gst-launch-1.0 videotestsrc ! msdkvpp ! glimagesink

Sometimes glimagesink emits GST_EVENT_RECONFIGURE event which results
in that MFXVideoVPP_Init is called twice, then get the negotiation
failure below:

0:00:00.093715518 21218 0x558ef56231e0 ERROR                msdkvpp
gstmsdkvpp.c:995:gst_msdkvpp_initialize:<msdkvpp0> Init failed
(undefined behavior)
WARNING: from element /GstPipeline:pipeline0/GstMsdkVPP:msdkvpp0: not
negotiated

After applying this commit, the pipeline above may run without
negotiation failure, however NV12 layout in dmabuf mode is selected in
renegotiation, the display image is corrupted due to the NV12 issue which
was mentioned in commit 3f2314a. Some other fixes are needed to avoid
renegotiation by default

5 years agomsdkvpp: don't update pads' info if nothing have changed
Haihao Xiang [Wed, 19 Dec 2018 02:44:50 +0000 (10:44 +0800)]
msdkvpp: don't update pads' info if nothing have changed

5 years agomsdkenc: break out of flush frames loop on error
U. Artie Eoff [Fri, 4 Jan 2019 19:57:52 +0000 (11:57 -0800)]
msdkenc: break out of flush frames loop on error

In general, we should assume any unhandled error is
non-recoverable.

In the flush frames loop, some error states can cause us
to never increment the task and therefore we get stuck
in an infinite loop and generate GST_ELEMENT_ERROR
over and over again.  This eventually consumes all
system memory and triggers OOM.  Thus, assume the worst
and break out of the loop upon the first "unhandled" error.

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

5 years agowasapi: Fix double call to Start when resetting the element
Nirbheek Chauhan [Fri, 4 Jan 2019 13:06:43 +0000 (18:36 +0530)]
wasapi: Fix double call to Start when resetting the element

When either the source or sink goes from PLAYING -> NULL -> PLAYING,
we call _reset() which sets client_needs_restart, and then we call
prepare() which calls IAudioClient_Start(), so we don't need to call
it again in src_read() or sink_write(). Unlike when we're just going
PLAYING -> PAUSED -> PLAYING.

5 years agowasapisink: Don't call CoUninitialize() twice in unprepare()
Sebastian Dröge [Thu, 3 Jan 2019 13:49:26 +0000 (15:49 +0200)]
wasapisink: Don't call CoUninitialize() twice in unprepare()

It has to be symmetric with CoInitialize(), otherwise everything else
will fail.

5 years agodecklinkvideosink: Don't forget to unref clock after usage
Sebastian Dröge [Wed, 2 Jan 2019 15:18:58 +0000 (17:18 +0200)]
decklinkvideosink: Don't forget to unref clock after usage

And don't unref a clock that is potentially NULL.

5 years agowebrtc: include stdlib.h for atoi()
Tim-Philipp Müller [Mon, 31 Dec 2018 12:09:42 +0000 (12:09 +0000)]
webrtc: include stdlib.h for atoi()

Fixes #857

5 years agotests: Enable more tests on Windows
Seungha Yang [Sun, 30 Dec 2018 13:31:39 +0000 (22:31 +0900)]
tests: Enable more tests on Windows