platform/upstream/gstreamer.git
5 years agoUpdate LINGUAS
Piotr Drąg [Sun, 10 Mar 2019 19:28:24 +0000 (19:28 +0000)]
Update LINGUAS

5 years agoopenh264: fix build with gstreamer debug system disabled
Tim-Philipp Müller [Thu, 21 Mar 2019 11:14:37 +0000 (11:14 +0000)]
openh264: fix build with gstreamer debug system disabled

See https://gitlab.freedesktop.org/gstreamer/gst-ci/merge_requests/89

5 years agomeson: add -Wno-unused also to C++ args when gst debug system is disabled
Tim-Philipp Müller [Thu, 21 Mar 2019 11:13:38 +0000 (11:13 +0000)]
meson: add -Wno-unused also to C++ args when gst debug system is disabled

5 years agomxfdemux: Avoid possible NULL caps 'dereferencing'
Thibault Saunier [Thu, 21 Mar 2019 00:38:04 +0000 (21:38 -0300)]
mxfdemux: Avoid possible NULL caps 'dereferencing'

5 years agortmpsrc: fix buffer leak on read error or EOS
Ilya Smelykh [Wed, 20 Mar 2019 12:45:12 +0000 (19:45 +0700)]
rtmpsrc: fix buffer leak on read error or EOS

5 years agowpesrc: Register backend activity states
Philippe Normand [Thu, 31 Jan 2019 16:31:04 +0000 (16:31 +0000)]
wpesrc: Register backend activity states

5 years agowpesrc: Always log loaded URI
Philippe Normand [Thu, 31 Jan 2019 16:30:18 +0000 (16:30 +0000)]
wpesrc: Always log loaded URI

5 years agowpesrc: Implement webview background configuration support
Philippe Normand [Fri, 18 Jan 2019 13:28:45 +0000 (13:28 +0000)]
wpesrc: Implement webview background configuration support

5 years agosrtpdec: Lower severity of srtp_err_status_replay_fail
Jan Alexander Steffens (heftig) [Fri, 15 Mar 2019 10:19:03 +0000 (11:19 +0100)]
srtpdec: Lower severity of srtp_err_status_replay_fail

AFAIU this happens when encountering retransmissions. Don't print a
warning for these packets.

5 years agosrtpdec: Simplify code flow handling status_key_expired
Jan Alexander Steffens (heftig) [Fri, 15 Mar 2019 10:16:10 +0000 (11:16 +0100)]
srtpdec: Simplify code flow handling status_key_expired

Ensures a balanced UNLOCK -> LOCK.

5 years agosrtpdec: Simplify checking the unprotect error
Jan Alexander Steffens (heftig) [Fri, 15 Mar 2019 10:13:14 +0000 (11:13 +0100)]
srtpdec: Simplify checking the unprotect error

Introduce an err label to jump to. Avoid logging two warnings per
failure.

5 years agosrtpdec: Simplify locking in gst_srtp_dec_decode_buffer
Jan Alexander Steffens (heftig) [Fri, 15 Mar 2019 10:03:52 +0000 (11:03 +0100)]
srtpdec: Simplify locking in gst_srtp_dec_decode_buffer

Don't drop the lock on filter just to unmap the buffer (or log a
message).

5 years agonetsim: don't use G_INLINE_FUNC
Tim-Philipp Müller [Mon, 18 Mar 2019 15:12:37 +0000 (15:12 +0000)]
netsim: don't use G_INLINE_FUNC

It's deprecated. Just use 'inline'.

5 years agomssdemux: fix protection data double free
Xabier Rodriguez Calvar [Mon, 18 Mar 2019 14:23:07 +0000 (15:23 +0100)]
mssdemux: fix protection data double free

For not being duplicated here it was being freed when the manifest was
being destroyed and a second time when the buffer was being destroyed.

5 years agomsdk: relicense the plugin to LGPL
Haihao Xiang [Thu, 14 Mar 2019 08:37:13 +0000 (16:37 +0800)]
msdk: relicense the plugin to LGPL

Some files licensed under LGPL were included, so relicense the plugin
from BSD to LPGL. In addition, this patch removes the README per the
discussion in https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/853

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

5 years agowebrtcbin: fix pt selection for FEC and RTX when BUNDLE
Mathieu Duponchelle [Fri, 15 Mar 2019 15:47:35 +0000 (16:47 +0100)]
webrtcbin: fix pt selection for FEC and RTX when BUNDLE

When we offer bundled media, payload types must be unique
across all bundled media, as they will be multiplexed in the
same session.

5 years agosrtp: Spell 'mechanisms' right
Andreas Frisch [Fri, 15 Mar 2019 09:46:56 +0000 (10:46 +0100)]
srtp: Spell 'mechanisms' right

5 years agocccombiner: improve behaviour on timeout
Mathieu Duponchelle [Wed, 13 Mar 2019 12:43:54 +0000 (13:43 +0100)]
cccombiner: improve behaviour on timeout

Prior to this, cccombiner stopped consuming video buffers when
data wasn't arriving on its caption pad. In a live situation,
when aggregator is timing out we should still output whatever
video buffers are present, even if no caption buffers can be
aggregated with them.

5 years agowebrtcbin: add get-transceiver signal
Mathieu Duponchelle [Tue, 12 Mar 2019 20:37:53 +0000 (21:37 +0100)]
webrtcbin: add get-transceiver signal

get-transceivers is not introspectable, and a method to get a
transceiver by index is convenient.

5 years agowebrtcbin: Filter transport stream stats by ssrc
Jan Alexander Steffens (heftig) [Thu, 7 Mar 2019 13:13:14 +0000 (14:13 +0100)]
webrtcbin: Filter transport stream stats by ssrc

Since the addition of BUNDLE support, the pads and the transceivers
share a single transport stream. When getting stats from the stream,
filter by the ssrc of the current pad to avoid merging the stats for
different pads.

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

5 years agowebrtcbin: Syntax cleanup
Jan Alexander Steffens (heftig) [Thu, 7 Mar 2019 13:12:47 +0000 (14:12 +0100)]
webrtcbin: Syntax cleanup

5 years agoclosedcaption: Fix build with Visual Studio
Nirbheek Chauhan [Mon, 11 Mar 2019 09:30:59 +0000 (15:00 +0530)]
closedcaption: Fix build with Visual Studio

../ext/closedcaption/io-sim.c(440): error C2065: 'M_PI': undeclared identifier
../ext/closedcaption/io-sim.c(442): error C2065: 'M_LN2': undeclared identifier

5 years agonvenc: Fix build when cuda is found but nvenc is disabled
Nirbheek Chauhan [Mon, 11 Mar 2019 09:15:14 +0000 (14:45 +0530)]
nvenc: Fix build when cuda is found but nvenc is disabled

tests\check\meson.build:21:5: ERROR:  Unknown variable "use_nvenc_gl".

Also do the same change in nvdec, just to be defensive about future
issues.

5 years agonvenc: More clean up on stop for encoder to be reusable
Seungha Yang [Fri, 8 Mar 2019 04:43:15 +0000 (13:43 +0900)]
nvenc: More clean up on stop for encoder to be reusable

Encoder will not configure internal pool again if input_state exist

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

5 years agonvenc: Ensure drain all frames on finish
Seungha Yang [Thu, 13 Dec 2018 13:03:36 +0000 (22:03 +0900)]
nvenc: Ensure drain all frames on finish

To drain all queued encoding items, encoder should gracefully
wait the encoding thread without stealing queued items.
Otherwise, some input frames can be dropped.

5 years agotests: Add nvenc unit test
Seungha Yang [Thu, 13 Dec 2018 13:19:30 +0000 (22:19 +0900)]
tests: Add nvenc unit test

5 years agonvenc: Fix GValue leaks
Yeongjin Jeong [Tue, 5 Mar 2019 09:55:16 +0000 (18:55 +0900)]
nvenc: Fix GValue leaks

GValue should be freed with g_value_unset()

5 years agoassrender: fix some leaks
Tim-Philipp Müller [Fri, 8 Mar 2019 23:49:49 +0000 (23:49 +0000)]
assrender: fix some leaks

g_slist_remove_*() removes the list node without freeing it.

5 years agovulkan: fix some leaks
Tim-Philipp Müller [Thu, 7 Mar 2019 19:26:56 +0000 (19:26 +0000)]
vulkan: fix some leaks

Fix vk_instance leak when state change fails like in
generic/states unit test.

5 years agoteletextdec: fix some string leaks
Tim-Philipp Müller [Thu, 7 Mar 2019 18:20:40 +0000 (18:20 +0000)]
teletextdec: fix some string leaks

5 years agosrt: fix uri and string leaks
Tim-Philipp Müller [Thu, 7 Mar 2019 00:02:13 +0000 (00:02 +0000)]
srt: fix uri and string leaks

And simplify property getter to avoid unnecessary copy.

5 years agoclosedcaption: cea708decoder: fix some memory leaks
Tim-Philipp Müller [Wed, 6 Mar 2019 23:45:27 +0000 (23:45 +0000)]
closedcaption: cea708decoder: fix some memory leaks

5 years agoclosedcaption: fix leak in line21 decoder
Tim-Philipp Müller [Wed, 6 Mar 2019 18:32:38 +0000 (18:32 +0000)]
closedcaption: fix leak in line21 decoder

Destroy old decoder instance when shutting down the
element, and also in case the input format changes.

Fix harness/pipeline leak in unit test.

5 years agotests: fix bus leak in hls_demux testSeek unit test
Tim-Philipp Müller [Wed, 6 Mar 2019 21:32:50 +0000 (21:32 +0000)]
tests: fix bus leak in hls_demux testSeek unit test

We add the signal watch in testSeekPreTestCallback so
remove it in testSeekPostTestCallback and not deep inside
some if clause in some other callback somewhere.

5 years ago.gitignore more things
Tim-Philipp Müller [Wed, 6 Mar 2019 18:35:46 +0000 (18:35 +0000)]
.gitignore more things

5 years agonvdec/nvenc: Add CUDA Toolkit 10.1 support
Seungha Yang [Thu, 7 Mar 2019 12:21:18 +0000 (21:21 +0900)]
nvdec/nvenc: Add CUDA Toolkit 10.1 support

Update to support the latest CUDA Toolkit version 10.1

5 years agofluidsynth: Avoid Wincompatible-pointer-types with 2.0.4
Jan Alexander Steffens (heftig) [Thu, 7 Mar 2019 09:15:16 +0000 (10:15 +0100)]
fluidsynth: Avoid Wincompatible-pointer-types with 2.0.4

In 2.0.4, the message parameter has "const char*" type. Add a cast to
avoid a warning with older fluidsynth.

5 years agoline21: fix tests build with autotools
Mathieu Duponchelle [Wed, 6 Mar 2019 14:17:24 +0000 (15:17 +0100)]
line21: fix tests build with autotools

5 years agoline21dec: general cleanup
Mathieu Duponchelle [Wed, 6 Mar 2019 10:23:32 +0000 (11:23 +0100)]
line21dec: general cleanup

This ports over the review comments made on line21enc in !217

5 years agoclosedcaption: add line21 encoder
Mathieu Duponchelle [Fri, 22 Feb 2019 23:23:01 +0000 (00:23 +0100)]
closedcaption: add line21 encoder

This element acts as a counterpart of line21encoder.

Also adds a simple test validating each element using the
other.

5 years agoCheck in vbi encoder
Mathieu Duponchelle [Thu, 21 Feb 2019 18:05:03 +0000 (19:05 +0100)]
Check in vbi encoder

5 years agowaylandsink: Implement XDG-shell stable support
Niels De Graef [Fri, 1 Mar 2019 08:56:24 +0000 (09:56 +0100)]
waylandsink: Implement XDG-shell stable support

[wl_shell] is officially [deprecated], so provide support for the
XDG-shell protocol should be provided by all desktop-like compositors.
(In case they don't, we can of course fall back to wl_shell).

Note that the [XML spec] is provided by the `wayland-protocols`
git repository, which is provided by the Wayland project.

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

[wl_shell]: https://people.freedesktop.org/~whot/wayland-doxygen/wayland/Client/group__iface__wl__shell.html
[deprecated]: https://github.com/wayland-project/wayland/commit/698dde195837f3d0844b2725ba4ea8ce9ee7518c
[XML spec]: https://github.com/wayland-project/wayland-protocols/blob/master/stable/xdg-shell/xdg-shell.xml

5 years agowaylandsink: prefix wl_shell-specific variables with wl_
Niels De Graef [Fri, 1 Mar 2019 09:17:23 +0000 (10:17 +0100)]
waylandsink: prefix wl_shell-specific variables with wl_

5 years agodecklink: document duplex and keyer behaviour
Peter Körner [Sun, 3 Mar 2019 18:34:11 +0000 (19:34 +0100)]
decklink: document duplex and keyer behaviour

5 years agodecklink: implement duplex-mode property
Peter Körner [Sun, 3 Mar 2019 18:34:06 +0000 (19:34 +0100)]
decklink: implement duplex-mode property

5 years agoBack to development
Tim-Philipp Müller [Mon, 4 Mar 2019 09:11:55 +0000 (09:11 +0000)]
Back to development

5 years agobuild: Don't forget to dist applemedia/avfdeviceprovider.h
Nirbheek Chauhan [Fri, 1 Mar 2019 16:17:14 +0000 (21:47 +0530)]
build: Don't forget to dist applemedia/avfdeviceprovider.h

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

5 years agomskd: Don't use MFX_FOURCC_RGB565 if it's undefined
Seungha Yang [Thu, 28 Feb 2019 12:37:49 +0000 (21:37 +0900)]
mskd: Don't use MFX_FOURCC_RGB565 if it's undefined

../subprojects/gst-plugins-bad/sys/msdk/msdk.c(61): error C2065: 'MFX_FOURCC_RGB565'

The minimum required version for the format seems to MFX_VERSION >= 1028

5 years agocccombiner: implement update_src_caps
Mathieu Duponchelle [Thu, 28 Feb 2019 16:24:56 +0000 (17:24 +0100)]
cccombiner: implement update_src_caps

It is necessary to implement this vmethod, as when the src pad
is marked as reconfigure, the base class will reset to src caps,
and the default update_src_caps simply queries the caps allowed
downstream without taking into account the caps set by
gst_aggregator_set_src_caps.

5 years agomsdkdec: fix for small resolution
Haihao Xiang [Thu, 28 Feb 2019 04:00:56 +0000 (12:00 +0800)]
msdkdec: fix for small resolution

5 years agomsdkdec: fix for resolution change
Haihao Xiang [Wed, 27 Feb 2019 00:07:29 +0000 (08:07 +0800)]
msdkdec: fix for resolution change

Returning MFX_ERR_INCOMPATIBLE_VIDEO_PARAM from
MFXVideoDECODE_DecodeFrameAsync means the allocated mfx surface is not
suitable for the current frame, we need a new mfx surface and try
MFXVideoDECODE_DecodeFrameAsync again.

5 years agomeson: don't build icles when tests are disabled
Tim-Philipp Müller [Thu, 28 Feb 2019 11:02:42 +0000 (11:02 +0000)]
meson: don't build icles when tests are disabled

They are manual tests, so let them be controlled
via the tests option not the examples option, for
consistency with -good.

5 years agohlssink2: Add property for disabling sending of force-keyunit events
Sebastian Dröge [Mon, 25 Feb 2019 13:23:34 +0000 (15:23 +0200)]
hlssink2: Add property for disabling sending of force-keyunit events

5 years agompegtsmux: restore stream creation order
Mathieu Duponchelle [Wed, 27 Feb 2019 17:47:09 +0000 (18:47 +0100)]
mpegtsmux: restore stream creation order

In 7c767f3fcd5a7b40d205bb4d588dad6c6275c729 , stream creation was
refactored to occur before potential program creation. This created
issues with pipelines such as:

gst-launch-1.0 videotestsrc ! video/x-raw, format=I420, width=640, height=640, framerate=25/1 ! \
x264enc ! hlssink2 target-duration=1

eg.: gst_buffer_copy_into: assertion 'bufsize >= offset + size' failed

As this reordering was actually not needed for the purpose of allowing
to specify a PCR stream, this reverts the reordering part of the
initial commit.

5 years agomsdkdec: force the alignment of width/height to 16 for vp8/vp9
Haihao Xiang [Fri, 22 Feb 2019 08:20:16 +0000 (16:20 +0800)]
msdkdec: force the alignment of width/height to 16 for vp8/vp9

MSDK library requires 16 alignment for vp8/vp9, otherwise a pipeline
for vp8/vp9 decoding might fail.

example pipeline:
gst-launch-1.0 filesrc location=vp8_1280x720.webm ! matroskademux ! \
msdkvp8dec ! fakesink

0:00:00.150565444 10657 0x55c8484036d0 ERROR                msdkdec
gstmsdkdec.c:1056:gst_msdkdec_handle_frame:<msdkvp8dec0>
DecodeFrameAsync failed (invalid video parameters)

5 years agomsdkvpp: add RGB16 format in the sink pad
Haihao Xiang [Mon, 25 Feb 2019 04:43:19 +0000 (12:43 +0800)]
msdkvpp: add RGB16 format in the sink pad

Note: MSDK doesn't support RGB16 output, hence don't add RGB16 format in
the src pad

5 years agomsdk: set some parameters in mfxFrameData for a RGB16 frame
Haihao Xiang [Mon, 25 Feb 2019 04:18:05 +0000 (12:18 +0800)]
msdk: set some parameters in mfxFrameData for a RGB16 frame

5 years agomsdk: map MFX_FOURCC_RGB565 to VA_FOURCC_RGB565
Haihao Xiang [Mon, 25 Feb 2019 05:24:46 +0000 (13:24 +0800)]
msdk: map MFX_FOURCC_RGB565 to VA_FOURCC_RGB565

5 years agomsdk: map GST_VIDEO_FORMAT_RGB16 to VA_FOURCC_RGB565
Haihao Xiang [Mon, 25 Feb 2019 04:29:25 +0000 (12:29 +0800)]
msdk: map GST_VIDEO_FORMAT_RGB16 to VA_FOURCC_RGB565

5 years agomsdk: map GST_VIDEO_FORMAT_RGB16 to MFX_FOURCC_RGB565
Haihao Xiang [Mon, 25 Feb 2019 05:23:49 +0000 (13:23 +0800)]
msdk: map GST_VIDEO_FORMAT_RGB16 to MFX_FOURCC_RGB565

5 years agoRelease 1.15.2
Tim-Philipp Müller [Tue, 26 Feb 2019 11:53:22 +0000 (11:53 +0000)]
Release 1.15.2

5 years agoUpdate docs
Tim-Philipp Müller [Tue, 26 Feb 2019 11:53:22 +0000 (11:53 +0000)]
Update docs

5 years agoUpdate translations
Tim-Philipp Müller [Tue, 26 Feb 2019 11:53:18 +0000 (11:53 +0000)]
Update translations

5 years agomsdkdec: release the occupied surface for MFX_WRN_DEVICE_BUSY
Haihao Xiang [Mon, 11 Feb 2019 08:49:32 +0000 (16:49 +0800)]
msdkdec: release the occupied surface for MFX_WRN_DEVICE_BUSY

When MFXVideoDECODE_DecodeFrameAsync () returns MFX_WRN_DEVICE_BUSY with
an output surface, a new input surface is required when retrying
MFXVideoDECODE_DecodeFrameAsync ().

This fixes the out-of-surface issue mentioned in
https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/890

5 years agomsdk: don't destroy an image twice
Haihao Xiang [Fri, 18 Jan 2019 07:14:59 +0000 (15:14 +0800)]
msdk: don't destroy an image twice

This gets rid of annoying message in the log, e.g. run the pipeline
below:

gst-launch-1.0 videotestsrc num-buffers=100 ! \
video/x-raw,format=NV12,width=352,height=288 ! msdkh264enc ! filesink \
location=test.h264

[LIBVA]:CRITICAL - DdiMedia_DestroyImage:4357: Invalid image

5 years agomsdk: move the comment to the correct place
Haihao Xiang [Thu, 17 Jan 2019 08:05:05 +0000 (16:05 +0800)]
msdk: move the comment to the correct place

5 years agosrtobject: check for null local address to avoid SIGSEV
Aaron Boxer [Wed, 20 Feb 2019 17:52:08 +0000 (12:52 -0500)]
srtobject: check for null local address to avoid SIGSEV

5 years agoccconverter: fix typo in framerate
Mathieu Duponchelle [Thu, 21 Feb 2019 22:51:39 +0000 (23:51 +0100)]
ccconverter: fix typo in framerate

5 years agoaudiobuffersplit: Added max-silence-time property
Vivia Nikolaidou [Thu, 21 Feb 2019 15:16:37 +0000 (15:16 +0000)]
audiobuffersplit: Added max-silence-time property

5 years agompegtsmux: allow specifying the PID of the PCR stream
Mathieu Duponchelle [Wed, 20 Feb 2019 10:26:01 +0000 (11:26 +0100)]
mpegtsmux: allow specifying the PID of the PCR stream

The structure passed through the prog-map can now contain a
PCR_<prog_id>=sink_<PID> key-value pair.

5 years agodecklink: add Hardware tag to element metadata
Tim-Philipp Müller [Thu, 14 Feb 2019 10:58:00 +0000 (10:58 +0000)]
decklink: add Hardware tag to element metadata

5 years agowasapi: add Hardware tag to element metadata
Tim-Philipp Müller [Thu, 14 Feb 2019 10:54:25 +0000 (10:54 +0000)]
wasapi: add Hardware tag to element metadata

5 years agowinks: add Hardware tag to element metadata
Tim-Philipp Müller [Thu, 14 Feb 2019 10:44:00 +0000 (10:44 +0000)]
winks: add Hardware tag to element metadata

5 years agoandroidmedia: add Hardware tag to element metadata
Tim-Philipp Müller [Thu, 14 Feb 2019 09:49:46 +0000 (09:49 +0000)]
androidmedia: add Hardware tag to element metadata

5 years agoapplemedia: add Hardware tag to element metadata
Tim-Philipp Müller [Thu, 14 Feb 2019 09:49:03 +0000 (09:49 +0000)]
applemedia: add Hardware tag to element metadata

5 years agomsdk: add Hardware tag to element metadata
Tim-Philipp Müller [Thu, 14 Feb 2019 09:47:29 +0000 (09:47 +0000)]
msdk: add Hardware tag to element metadata

5 years agonvenc, nvdec: add Hardware tag to element metadata
Tim-Philipp Müller [Thu, 14 Feb 2019 09:43:54 +0000 (09:43 +0000)]
nvenc, nvdec: add Hardware tag to element metadata

5 years agocurlhttpsrc: set BUFFER_OFFSET when creating GstBuffer
Alex Ashley [Tue, 5 Feb 2019 17:10:03 +0000 (17:10 +0000)]
curlhttpsrc: set BUFFER_OFFSET when creating GstBuffer

To make curlhttpsrc behave more like souphttpsrc, set the
BUFFER_OFFSET in its output buffers to match the segment
start. This means that in a HTTP RANGE request, the BUFFER_OFFSET
will match the value in the RANGE request.

5 years agocurlhttpsrc: export same HTTP error status as souphttpsrc
Alex Ashley [Tue, 5 Feb 2019 17:06:50 +0000 (17:06 +0000)]
curlhttpsrc: export same HTTP error status as souphttpsrc

To make it closer to a drop-in replacement for souphttpsrc,
expose the same gst_error_message_with_details as souphttpsrc,
so that applications can received the HTTP status code and reason
when an error occurs.

5 years agocurlhttpsrc: fix various leaks and thread safety issues
Alex Ashley [Tue, 5 Feb 2019 16:34:40 +0000 (16:34 +0000)]
curlhttpsrc: fix various leaks and thread safety issues

curlhttpsrc uses a single thread running the
gst_curl_http_src_curl_multi_loop() function to handle receiving
data and messages from libcurl. Each instance of curlhttpsrc adds
an entry into a queue in GstCurlHttpSrcMultiTaskContext and waits
for the multi_loop to perform the HTTP request.

Valgrind has shown up race conditions and memory leaks:
1. gst_curl_http_src_change_state() does not wait for the multi_loop
   to complete before going to the NULL state, which means that
   an instance of GstCurlHttpSrc can be released while
   gst_curl_http_src_curl_multi_loop() still has a reference to it.
2. if multiple elements try to be removed from the queue at once,
   only the last one is deleted.
3. source->caps is leaked
4. curl multi_handle is leaked
5. leak of curl_handle if URI not set
6. leak of http_headers when reusing element
7. null pointer dereference in negotiate caps
8. double-free of the default user-agent string
9. leak of multi_task_context.task

This commit changes the logic so that each element has a connection
status, which is used by the multi_loop to decide when to remove an
element from its queue. An instance of curlhttpsrc will not enter
the NULL state until its reference has been removed from the queue.

When shutting down the curl multi loop, the memory allocated from the
call to curl_multi_init() is now released.

When gstadaptivedemux uses a URI source element, it will re-use
it for multiple requests, moving it between READY and PLAYING
between each request. curlhttpsrc was leaking the http_headers
structure in this use case.

The gst_curl_http_src_negotiate_caps() function extracts the
"response-headers" field from the http_headers, but did not check
that this field might be NULL.

If the user-agent property is set, the global user-agent string
was freed. This caused a double-free error if the user-agent is
ever set a second time during the execution of the process.

There are situations within curlhttpsrc where the code needs
both the global multi_task_context mutex and the per-element
buffer_mutex. To avoid deadlocks, it is vital that the order in
which these are requested is always the same. This commit modifies
the locking order to always be in the order:
 1. multi_task_context.task_rec_mutex
 2. buffer_mutex

Fixes #876

5 years agotests: curlhttpsrc: add unit tests
Alex Ashley [Tue, 5 Feb 2019 16:23:01 +0000 (16:23 +0000)]
tests: curlhttpsrc: add unit tests

Based upon the souphttpsrc tests, add unit tests for the curlhttpsrc
element. The souphttpsrc tests are able to use an HTTP server that
is provided as part of the soup library. This does not exist in the
curl library, therefore these tests provide a very simple HTTP server
using the GIO library.

These curlhttpsrc tests contain one new test that does not come from
the souphttpsrc tests. The test_multiple_http_requests test tries to
reproduce the way in which GstAdaptiveDemux makes use of URI source
elements. GstAdaptiveDemux creates a bin with the httpsrc element
and a queue element and sets the locked state of that bin to TRUE,
so that it does not follow the state transitions of its parent. It
then moves this bin to the PLAYING state to start each download and
back to READY when the download completes.

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