platform/upstream/gstreamer.git
5 years agompegtspacketizer: Fix off-by-one error
Edward Hervey [Thu, 26 Sep 2019 15:13:30 +0000 (17:13 +0200)]
mpegtspacketizer: Fix off-by-one error

This went un-noticed for 6 years :( The issue is that for short
sections (without subtables and CRC), we would always fail when
checking whether we had enough data or not and then default to the
long section checking.

Use the long section checking would then cause interesting side-effects
for short sections (such as believing they were already seen and therefore
would be dropped/ignored).

5 years agomsdkdec: use decoder base class packetized flag
Víctor Manuel Jáquez Leal [Mon, 28 Oct 2019 12:28:28 +0000 (13:28 +0100)]
msdkdec: use decoder base class packetized flag

Instead of using a proxy of `is_packetized` flag this patch
replaces it with the accessor to that flag in decoder base class,
avoiding probable mismatches.

5 years agomsdkdec: add parse callback for non-packetized input
Haihao Xiang [Fri, 27 Sep 2019 02:50:18 +0000 (10:50 +0800)]
msdkdec: add parse callback for non-packetized input

commit 55c0d720 added the capability to handle non-packetized bitstream,
and there is a loop to handle multiple frames in a non-packetized buffer
in gst_msdkdec_handle_frame. However it is possible that a
non-packetized buffer still contains valid data but there is no long any
pending unfinished frame. Currently gst_video_decoder_decode_frame is
invoked to send a new frame with new input data, the situaltion is
repeated till an EOS is received. An application has to exit when
receiving an EOS, however there is still valid data in a
non-packetezied input buffer, hence some frames are dropped.

This fix adds a parse callback for non-packeteized input, a new frame
will be sent to the subclass as soon as the input buffer has valid data

This fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/665

5 years agoccextractor: Remove unused set/get_property() functions
Sebastian Dröge [Mon, 28 Oct 2019 09:25:15 +0000 (11:25 +0200)]
ccextractor: Remove unused set/get_property() functions

5 years agoccextractor: Always forward all sticky events to the caption pad
Sebastian Dröge [Mon, 28 Oct 2019 09:22:06 +0000 (11:22 +0200)]
ccextractor: Always forward all sticky events to the caption pad

And only update the caps and stream-start event accordingly. This
ensures that we'll always forward sticky events that arrive after the
caption pad was created, and especially updates to existing sticky
events like the segment event.

Also create a proper stream id based on the upstream stream id for the
stream-start event, and make sure that all the sticky events we know are
already on the caption pad at the time it is added to the element.

5 years agovulkanimage: move fence creation earlier
Matthew Waters [Sun, 27 Oct 2019 15:27:04 +0000 (02:27 +1100)]
vulkanimage: move fence creation earlier

Fixes a critical:

GStreamer-CRITICAL **: 02:26:34.698: gst_mini_object_ref: assertion 'mini_object != NULL' failed

5 years agovulkan: change to clamp to edge rather than clamp to border
Matthew Waters [Sun, 27 Oct 2019 15:18:18 +0000 (02:18 +1100)]
vulkan: change to clamp to edge rather than clamp to border

clamp-to-border will return the border color which is typically black,
white or transparent.  When linear filtering the edge pixels will
typeically be combined with the border color which is not typically what
we want.  Especially when color converting, this removes a green box
around the edge when converting YUV->RGB.

5 years agomsdkh265enc: Add support for tiled encoding
Haihao Xiang [Thu, 24 Oct 2019 07:26:33 +0000 (15:26 +0800)]
msdkh265enc: Add support for tiled encoding

Add num-tile-rows and num-tile-cols properties to set the number of rows
and columns

5 years agosrtpenc: also insert ssrc(s) from rtp buffers
Julien Isorce [Thu, 24 Oct 2019 23:42:23 +0000 (16:42 -0700)]
srtpenc: also insert ssrc(s) from rtp buffers

This fixes a regression from commit "srtp: Support libsrtp2"
e9aa11720071f8a1d22b336395e66dd8cbca0c00 where an internal
set of ssrc(s) was added because the libsrtp v2 keeps its
internal streams as private. But the change prevented that
ssrc(s) that not in the caps from being added to the stats.
This patch ensures that all ssrc(s) are inserted to this set
instead of only inserting those from the caps.

5 years agomsdk: support P010_10LE in DMABuf mode for VP9/HEVC encoding
Haihao Xiang [Fri, 18 Oct 2019 04:26:26 +0000 (12:26 +0800)]
msdk: support P010_10LE in DMABuf mode for VP9/HEVC encoding

5 years agoandroidmedia: Make sure that the first member of GstAmcSurfaceTextureJNI is correct
Cheng-Chang Wu [Thu, 24 Oct 2019 11:10:30 +0000 (19:10 +0800)]
androidmedia: Make sure that the first member of GstAmcSurfaceTextureJNI is correct

It's a subclass of GstAmcSurfaceTexture so should have that as first
struct member or otherwise it won't work.

Fixes #1105

5 years agoandroidmedia: Call JNI method with the actual Java object instead of our wrapper...
Cheng-Chang Wu [Thu, 24 Oct 2019 11:14:58 +0000 (19:14 +0800)]
androidmedia: Call JNI method with the actual Java object instead of our wrapper struct

Fixes #1105

5 years agoopencv: Don't error when unable to detect OpenCV data dir
Jan Alexander Steffens (heftig) [Thu, 24 Oct 2019 13:40:25 +0000 (15:40 +0200)]
opencv: Don't error when unable to detect OpenCV data dir

Instead, mark OpenCV as not found. We error out later if OpenCV was
explicitly enabled.

5 years agomsdkvpp: add support Y410 and Y210 formats
Haihao Xiang [Fri, 11 Oct 2019 15:54:55 +0000 (23:54 +0800)]
msdkvpp: add support Y410 and Y210 formats

And clean up some macros

5 years agomsdkvpp: allow cropping via properties
U. Artie Eoff [Wed, 16 Oct 2019 18:59:32 +0000 (11:59 -0700)]
msdkvpp: allow cropping via properties

Add crop-left, crop-right, crop-top and crop-bottom
properties to msdkvpp and apply to input surface at
vpp transform run-time.

Implements #1097

5 years agowpe: Get rid of un-necessary frameComplete dispatchs
Philippe Normand [Tue, 22 Oct 2019 17:33:18 +0000 (18:33 +0100)]
wpe: Get rid of un-necessary frameComplete dispatchs

frameComplete() should be called only if there's a new commited frame.

5 years agowpe: Run frameComplete outside of images mutex scope
Philippe Normand [Sat, 19 Oct 2019 11:48:55 +0000 (12:48 +0100)]
wpe: Run frameComplete outside of images mutex scope

If the mutex is locked while running frameComplete there is a potential deadlock
bound to happen when we get a new exported images from the backend.

Fixes #1101

5 years agotimecodestamper: Add properties to time out cached upstream/LTC timecodes after a...
Sebastian Dröge [Wed, 23 Oct 2019 13:47:43 +0000 (16:47 +0300)]
timecodestamper: Add properties to time out cached upstream/LTC timecodes after a while

By default we never time them out and simply continue couting up with
each frame forever.

5 years agotimecodestamper: Add new auto-resync boolean property
Sebastian Dröge [Wed, 23 Oct 2019 12:03:09 +0000 (15:03 +0300)]
timecodestamper: Add new auto-resync boolean property

This allows selecting whether we continue updating our last known
upstream timecode whenever a new one arrives or instead only keep the
last known one and from there on count up.

5 years agotimecodestamper: Add last-known-or-zero mode
Sebastian Dröge [Wed, 23 Oct 2019 11:31:16 +0000 (14:31 +0300)]
timecodestamper: Add last-known-or-zero mode

This uses the last known upstream timecode (counted up per frame), or
otherwise zero if none was known.

The normal last-known timestamp uses the internal timecode as fallback
if no upstream timecode was ever known.

5 years agotimecodestamper: Don't initialize upstream timecode with zero if none was seen
Sebastian Dröge [Wed, 23 Oct 2019 11:29:06 +0000 (14:29 +0300)]
timecodestamper: Don't initialize upstream timecode with zero if none was seen

Instead keep it unset and use the internal timecode wherever needed as
fallback.

5 years agotimecodestamper: Update set-tc property documentation with latest version of reality
Sebastian Dröge [Wed, 23 Oct 2019 11:28:24 +0000 (14:28 +0300)]
timecodestamper: Update set-tc property documentation with latest version of reality

5 years agopnmdec: Return early on ::finish() if we have no actual data to parse
Sebastian Dröge [Tue, 22 Oct 2019 06:30:34 +0000 (09:30 +0300)]
pnmdec: Return early on ::finish() if we have no actual data to parse

Otherwise we'd be working with a NULL buffer and cause various critical
warnings along the way.

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

5 years agolv2: fix build without the debug system
Jordan Petridis [Tue, 24 Sep 2019 05:55:07 +0000 (08:55 +0300)]
lv2: fix build without the debug system

```
FAILED: subprojects/gst-plugins-bad/ext/lv2/b8a2ebe@@gstlv2@sha/gstlv2utils.c.o
../subprojects/gst-plugins-bad/ext/lv2/gstlv2utils.c: In function 'lv2_log_printf':
../subprojects/gst-plugins-bad/ext/lv2/gstlv2utils.c:50:3: error: attempt to use poisoned "gst_debug_log_valist"
   50 |   gst_debug_log_valist (lv2_debug, GST_LEVEL_INFO, "", "", 0, NULL, fmt, ap);
      |   ^
../subprojects/gst-plugins-bad/ext/lv2/gstlv2utils.c:50:25: error: 'lv2_debug' undeclared (first use in this function); did you mean 'g_debug'?
   50 |   gst_debug_log_valist (lv2_debug, GST_LEVEL_INFO, "", "", 0, NULL, fmt, ap);
      |                         ^~~~~~~~~
      |                         g_debug
```

5 years agocamerabin2: preview: remove redundant property setting on appsink
Ratchanan Srirattanamet [Thu, 29 Aug 2019 14:20:37 +0000 (21:20 +0700)]
camerabin2: preview: remove redundant property setting on appsink

Commit 8a56a7de6d5f2cf70dbe6efbd7c8ed74600c8565 (camerabin2: preview:
Appsink doesn't need to sync) add a line that set the "sync" property on
the appsink. However, the author seems to forget that there's another
property setting on appsink a few lines below.

It's very likely that the added line is required because the original
line doesn't take effect (maybe because it's too late). But for whatever
reason, the original line is now redundant. So, I remove it in this
commit.

5 years agomeson: use gir_init_section in GstTranscoder
Alistair Buxton [Sat, 19 Oct 2019 12:52:54 +0000 (13:52 +0100)]
meson: use gir_init_section in GstTranscoder

GstTranscoder adds extra_args for gir which call gst_init() during
introspection. These extra arguments are the same as the standard
ones defined in the top level meson.build as "git_init_section",
However, the top level definition also ensures an empty plugin
repository is used.

Because GstTranscoder does not use the standard args, plugins get
loaded when it is introspected. Since some of the plugins fail
without specific hardware, this causes #1100.

This patch makes it use gir_init_section.

Fixes #1100.

5 years agomeson: build gir even when cross-compiling if introspection was enabled explicitly
Tim-Philipp Müller [Thu, 17 Oct 2019 23:39:12 +0000 (00:39 +0100)]
meson: build gir even when cross-compiling if introspection was enabled explicitly

This can be made to work in certain circumstances when
cross-compiling, so default to not building g-i stuff
when cross-compiling, but allow it if introspection was
enabled explicitly via -Dintrospection=enabled.

See gstreamer/gstreamer#454 and gstreamer/gstreamer#381.

5 years agowpesrc: Implement load-bytes action signal
Philippe Normand [Tue, 24 Sep 2019 23:57:54 +0000 (16:57 -0700)]
wpesrc: Implement load-bytes action signal

5 years agowpe: Rewrite wpesrc as a glbasesrc subclass
Philippe Normand [Wed, 7 Aug 2019 16:07:21 +0000 (17:07 +0100)]
wpe: Rewrite wpesrc as a glbasesrc subclass

And since it no longer allocates memories itself, this fixes issues with
fakevideosink. A lot of code previously copied from gltestsrc is no longer
needed thanks to the glbasesrc super-class.

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

5 years agoFix get_supported_types function name
Javier Celaya [Wed, 9 Oct 2019 12:55:55 +0000 (14:55 +0200)]
Fix get_supported_types function name

5 years agoFix releasing local refs
Javier Celaya [Wed, 9 Oct 2019 12:55:29 +0000 (14:55 +0200)]
Fix releasing local refs

5 years agoFix names of MediaCodecInfo inner classes
Javier Celaya [Wed, 9 Oct 2019 12:55:05 +0000 (14:55 +0200)]
Fix names of MediaCodecInfo inner classes

5 years agoFix getting MediaCodecList static methods
Javier Celaya [Wed, 9 Oct 2019 12:54:24 +0000 (14:54 +0200)]
Fix getting MediaCodecList static methods

5 years agomsdkenc: close encoder upon bitrate change
Julien Isorce [Fri, 11 Oct 2019 16:51:24 +0000 (09:51 -0700)]
msdkenc: close encoder upon bitrate change

Upon bitrate change, make sure to close the encoder otherwise
the encoder is not re-initialized and the target bitrate is
never reached, and the encoder was flushed at each frame
from this moment.

Regression introduced in f2b35abcab which replaced the call
that was closing the encoder by an early return to avoid
re-initialization.

5 years agowasapi: Fix build warnings
Seungha Yang [Tue, 17 Sep 2019 11:32:18 +0000 (20:32 +0900)]
wasapi: Fix build warnings

gstwasapiutil.c(173) : warning C4715: 'gst_wasapi_device_role_to_erole': not all control paths return a value
gstwasapiutil.c(188) : warning C4715: 'gst_wasapi_erole_to_device_role': not all control paths return a value

5 years agowasapi: Don't cast GstDeviceProvider to GstElement
Seungha Yang [Tue, 17 Sep 2019 11:29:03 +0000 (20:29 +0900)]
wasapi: Don't cast GstDeviceProvider to GstElement

The GstDeviceProvider isn't subclass of GstElement.

(gst-device-monitor-1.0:49356): GLib-GObject-WARNING **: 20:21:18.651:
invalid cast from 'GstWasapiDeviceProvider' to 'GstElement'

5 years agoRemove autotools build system
Tim-Philipp Müller [Sun, 13 Oct 2019 13:22:50 +0000 (14:22 +0100)]
Remove autotools build system

5 years agodecklink: fix timestamp tracking when pausing
Matthew Waters [Mon, 14 Oct 2019 07:22:18 +0000 (02:22 -0500)]
decklink: fix timestamp tracking when pausing

play->pause->sleep()->play would result in late frames being scheduled

5 years agocodecparsers: h264: record pic_order_cnt elements size
Philipp Zabel [Wed, 4 Sep 2019 14:48:29 +0000 (16:48 +0200)]
codecparsers: h264: record pic_order_cnt elements size

Some hardware decoders, for example Hantro G1, have to be told the
size of the pic_order_cnt related syntax elements pic_order_cnt_lsb,
delta_pic_order_cnt_bottom, delta_pic_order_cnt[0], and
delta_pic_order_cnt[1] in bits.

5 years agocodecparsers: h264: record dec_ref_pic_marking() size
Philipp Zabel [Wed, 4 Sep 2019 13:57:30 +0000 (15:57 +0200)]
codecparsers: h264: record dec_ref_pic_marking() size

Some hardware decoders, for example Hantro G1, have to be told the size
of the dec_ref_pic_marking() syntax element in bits. Record the size so
it can be passed on to the hardware.

5 years agoh265parser: Calculate short term RPS size in slice header
Seungha Yang [Fri, 20 Sep 2019 11:14:57 +0000 (20:14 +0900)]
h265parser: Calculate short term RPS size in slice header

The calculated size of short_term_ref_pic_set is not a part of
HEVC syntax but the value is used by some stateless decoders
(e.g., vaapi, dxva, vdpau and nvdec) for the purpose of skipping
parsing the syntax by the accelerator.

5 years agoh265parser: Add H265 slice segment header documentation
Seungha Yang [Mon, 7 Oct 2019 01:36:37 +0000 (10:36 +0900)]
h265parser: Add H265 slice segment header documentation

Adding brief description for each value.

5 years agoh264parser: Expose parsed GstH264PPS::pic_scaling_matrix_present_flag
Seungha Yang [Wed, 11 Sep 2019 08:59:37 +0000 (17:59 +0900)]
h264parser: Expose parsed GstH264PPS::pic_scaling_matrix_present_flag

5 years agoh264parser: Expose all parsed flags of slice header
Seungha Yang [Tue, 27 Aug 2019 11:34:48 +0000 (20:34 +0900)]
h264parser: Expose all parsed flags of slice header

Add num_ref_idx_active_override_flag and sp_for_switch_flag to
member of GstH264SliceHdr. No reason to hiding them and
some decoder implementations (e.g., DXVA) rely on externally parsed header
data which can be provided by h264parser.

5 years agomsdk: return the right pointer
Haihao Xiang [Wed, 9 Oct 2019 06:00:01 +0000 (14:00 +0800)]
msdk: return the right pointer

The first channel in memory for MFX_FOURCC_RGB4 (VA_FOURCC_ARGB or
GST_VIDEO_FORMAT_BGRA) is B, not A. In MSDK, channle B is used to access
data for RGB4 surface. In addition, the returned pointers for
MFX_FOURCC_AYUV and MFX_FOURCC_Y410 in gst_msdk_video_memory_map_full
were wrong too before this fix.

5 years agomsdkenc: handle bitrate changes in playing state
Josep Torra [Mon, 7 Oct 2019 15:39:06 +0000 (08:39 -0700)]
msdkenc: handle bitrate changes in playing state

When the bitrate is changed in playing state the encoder issues a reconfig
that drains and recreates the underlaying hw encoder instance.
With this set of changes we ensure that all this work is only made when
the bitrate did actually change. It also tries to reuse the vpp buffer
pool and fixes the pool leak spotted when testing this feature.

5 years agoext: add libmicrodns-based mdns device provider
Mathieu Duponchelle [Mon, 16 Sep 2019 23:52:54 +0000 (01:52 +0200)]
ext: add libmicrodns-based mdns device provider

The provider for now only detects and handles rtsp devices, but
more protocols should be easy to add.

5 years agomsdkh265enc: add the missing profile string
Haihao Xiang [Tue, 8 Oct 2019 01:40:06 +0000 (09:40 +0800)]
msdkh265enc: add the missing profile string

5 years agohlssink2: Respect requested max-files property for decision on removing old fragments...
Seungha Yang [Mon, 7 Oct 2019 05:21:58 +0000 (14:21 +0900)]
hlssink2: Respect requested max-files property for decision on removing old fragments from disk

hlssink2 defined "max-files" property to decide the maximum number
of fragments which should be stored in disk. But we've not used
the property. Instead, the size has been maintained by "playlist-length".
Since "max-files" and "playlist-length" have different meaning,
the decision should be done by "max-files" property.

For example, an user might want expose only 3 fragments via playlist
but might want to keep more files than 3 in disk.

5 years agoass: avoid infinite unref loop with bad data
Matthew Waters [Sun, 6 Oct 2019 13:05:08 +0000 (00:05 +1100)]
ass: avoid infinite unref loop with bad data

A classic case of not updating the next item to iterate after deleting
it from the singly linked list.

Only ever hit with a text buffer with GST_CLOCK_TIME_NONE for either the
timestamp or duration.

5 years agod3d11window: Protect registration/creation of WIN32 window
Seungha Yang [Tue, 17 Sep 2019 10:56:23 +0000 (19:56 +0900)]
d3d11window: Protect registration/creation of WIN32 window

Querying existing window class info and creation of window object
should be protected since they are not thread safe.

5 years agod3d11videosink: Don't try to post error message by d3d11window self
Seungha Yang [Fri, 4 Oct 2019 12:15:15 +0000 (21:15 +0900)]
d3d11videosink: Don't try to post error message by d3d11window self

The d3d11window isn't GstElement. To post error message, proxy it
to d3d11videosink instead.

5 years agopkgconfig: Fix gstreamer-bad-transcoder-1.0.pc generation
Alexandru Băluț [Thu, 3 Oct 2019 23:32:34 +0000 (01:32 +0200)]
pkgconfig: Fix gstreamer-bad-transcoder-1.0.pc generation

5 years agomsdkenc: guard MFX_FOURCC_Y410 with MFX version 1027
Víctor Manuel Jáquez Leal [Tue, 1 Oct 2019 09:00:02 +0000 (11:00 +0200)]
msdkenc: guard MFX_FOURCC_Y410 with MFX version 1027

5 years agohlssink,hlssink2: Ensure writing ENDLIST tag at the end
Seungha Yang [Tue, 1 Oct 2019 06:36:29 +0000 (15:36 +0900)]
hlssink,hlssink2: Ensure writing ENDLIST tag at the end

hlssink* elements could be finalized without EOS event, and in that case
the final playlist might not include the EXT-X-ENDLIST tag.
Since missing ENDLIST tag means it's live stream, but we did't intend it,
hlssink* elements should put the tag at the end.

5 years agomsdkdec: set lockable flag
Haihao Xiang [Thu, 26 Sep 2019 01:52:14 +0000 (09:52 +0800)]
msdkdec: set lockable flag

When postpone_free_surface is TRUE, the output buffer is not writable,
however the base decoder needs a writable buffer as output buffer,
otherwise it will make a copy of the output buffer. As the underlying
memory is always lockable, so we may set the LOCKABLE flag for this buffer
to avoid buffer copy in the base class.

The refcount of the output buffer is 1 when postpone_free_surface is
FALSE, so needn't set the LOCKABLE flag for this case.

5 years agomsdkh265enc: add support for Y410 in sink pad
Haihao Xiang [Mon, 30 Sep 2019 02:13:56 +0000 (10:13 +0800)]
msdkh265enc: add support for Y410 in sink pad

Sample pipeline:
gst-launch-1.0 videotestsrc ! video/x-raw,format=Y410 !
msdkh265enc low-power=1 ! filesink location=output.h265

5 years agomsdkh265enc: add support for VUYA in sink pad
Haihao Xiang [Mon, 30 Sep 2019 01:48:26 +0000 (09:48 +0800)]
msdkh265enc: add support for VUYA in sink pad

sample pipelie:
gst-launch-1.0 videotestsrc ! video/x-raw,format=VUYA !
msdkh265enc low-power=1 ! filesink location=output.h265

5 years agomsdkenc: clean up code by using switch
Haihao Xiang [Mon, 30 Sep 2019 00:57:42 +0000 (08:57 +0800)]
msdkenc: clean up code by using switch

It is convenient for us to add support for new formats in future, there
is no change in functionality.

5 years agomsdk: remove some dead code
Haihao Xiang [Mon, 30 Sep 2019 01:09:23 +0000 (09:09 +0800)]
msdk: remove some dead code

5 years agowayland: Add more DRM formats
olivier.crete@collabora.com [Tue, 6 Aug 2019 20:08:12 +0000 (21:08 +0100)]
wayland: Add more DRM formats

Add DRM format equivalents that we were missing compared
to our caps.

5 years agowayland: Drop big-endian version of the DRM formats
olivier.crete@collabora.com [Tue, 6 Aug 2019 18:09:54 +0000 (19:09 +0100)]
wayland: Drop big-endian version of the DRM formats

They were a big in some big-endian implementations

5 years agod3d11videosink: Use pixel aspect ratio to setup window draw area
Seungha Yang [Fri, 23 Aug 2019 04:41:54 +0000 (13:41 +0900)]
d3d11videosink: Use pixel aspect ratio to setup window draw area

... instead of calculated display ratio from given PAR and DAR.

d3d11window calculates output display ratio
to decide padding area per window resize event. In the formula,
actual PAR is required to handle both 1:1 PAR and non-1:1 PAR.

5 years agofluidsynth: add sf3 to soundfont search path
Fabian Greffrath [Tue, 24 Sep 2019 18:29:21 +0000 (20:29 +0200)]
fluidsynth: add sf3 to soundfont search path

In Debian, soundfonts in SF3 format (i.e. the same as SF2 format but
with Ogg/Vorbis-compressed samples) are installed into
/usr/share/sounds/sf3. Soundfonts in SF3 format are supported since
FluidSynth 1.1.7 (released in Feb 2018).

5 years agovulkan: Fix build on Windows
Seungha Yang [Wed, 25 Sep 2019 12:36:58 +0000 (21:36 +0900)]
vulkan: Fix build on Windows

* Fix meson build script for Windows. Since the Vulkan dependency
object was declared by us in case of Windows, the dependency object
shouldn't be used for finding header

* Fix build error by including Windows specific header
gstvkdisplay.c(563): error C2065: 'VK_KHR_WIN32_SURFACE_EXTENSION_NAME': undeclared identifier

5 years agovulkan: remove VkImageView from the memory
Matthew Waters [Tue, 24 Sep 2019 07:24:38 +0000 (17:24 +1000)]
vulkan: remove VkImageView from the memory

There can be multiple views per image for different subresource ranges
or planes in multi-planer images.

5 years agovkbuffer: remove buffer view from the memory
Matthew Waters [Tue, 24 Sep 2019 03:53:22 +0000 (13:53 +1000)]
vkbuffer: remove buffer view from the memory

It's only really useful for texture buffers which we currently do not
use.

5 years agobuild/vulkan: fix copy-paste error in gstvkconfig.h
Matthew Waters [Tue, 24 Sep 2019 03:52:17 +0000 (13:52 +1000)]
build/vulkan: fix copy-paste error in gstvkconfig.h

5 years agovulkan: remove the winsys-specific headers from gst/vulkan/vulkan.h
Matthew Waters [Wed, 18 Sep 2019 13:49:08 +0000 (23:49 +1000)]
vulkan: remove the winsys-specific headers from gst/vulkan/vulkan.h

Allows not having wayland, xcb, Cocoa, UIKit, windows.h included in the
public GstVulkan API.

5 years agoerrorignore: Added convert-error signal
Vivia Nikolaidou [Tue, 24 Sep 2019 08:25:00 +0000 (11:25 +0300)]
errorignore: Added convert-error signal

The convert-error signal is emitted whenever we get a GstFlowReturn
other than GST_FLOW_OK. The handler can then decide what to convert that
into - for instance, return the same GstFlowReturn to not convert it.
The default handler will act according to the ignore-error,
ignore-notlinked, ignore-notnegotiated and convert-to properties. If a
handler is connected, these properties are ignored.

5 years agobuild: fix werror build with newer gcc
Matthew Waters [Tue, 24 Sep 2019 00:29:44 +0000 (10:29 +1000)]
build: fix werror build with newer gcc

In file included from ../../../../dist/linux_x86_64/include/gstreamer-1.0/gst/gstbin.h:27,
                 from ../../../../dist/linux_x86_64/include/gstreamer-1.0/gst/gst.h:35,
                 from ../gst/rtp/gstrtpsink.h:23,
                 from ../gst/rtp/gstrtpsink.c:49:
In function ‘gst_rtp_sink_start’,
    inlined from ‘gst_rtp_sink_change_state’ at ../gst/rtp/gstrtpsink.c:509:11:
../../../../dist/linux_x86_64/include/gstreamer-1.0/gst/gstelement.h:422:18: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  422 |   gchar *__txt = _gst_element_error_printf text;                        \
../gst/rtp/gstrtpsink.c:476:3: note: in expansion of macro ‘GST_ELEMENT_ERROR’
  476 |   GST_ELEMENT_ERROR (self, RESOURCE, NOT_FOUND,
      |   ^~~~~~~~~~~~~~~~~
../gst/rtp/gstrtpsink.c: In function ‘gst_rtp_sink_change_state’:
../gst/rtp/gstrtpsink.c:477:37: note: format string is defined here
  477 |       ("Could not resolve hostname '%s'", remote_addr),
      |                                     ^~

In file included from ../../../../dist/linux_x86_64/include/gstreamer-1.0/gst/gstbin.h:27,
                 from ../../../../dist/linux_x86_64/include/gstreamer-1.0/gst/gst.h:35,
                 from ../../../../dist/linux_x86_64/include/gstreamer-1.0/gst/rtp/gstrtpdefs.h:27,
                 from ../../../../dist/linux_x86_64/include/gstreamer-1.0/gst/rtp/rtp.h:25,
                 from ../gst/rist/gstristsink.c:72:
In function ‘gst_rist_sink_setup_rtcp_socket’,
    inlined from ‘gst_rist_sink_start’ at ../gst/rist/gstristsink.c:658:10,
    inlined from ‘gst_rist_sink_change_state’ at ../gst/rist/gstristsink.c:801:13:
../../../../dist/linux_x86_64/include/gstreamer-1.0/gst/gstelement.h:422:18: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  422 |   gchar *__txt = _gst_element_error_printf text;                        \
../gst/rist/gstristsink.c:595:3: note: in expansion of macro ‘GST_ELEMENT_ERROR’
  595 |   GST_ELEMENT_ERROR (sink, RESOURCE, NOT_FOUND,
      |   ^~~~~~~~~~~~~~~~~
../gst/rist/gstristsink.c: In function ‘gst_rist_sink_change_state’:
../gst/rist/gstristsink.c:596:37: note: format string is defined here
  596 |       ("Could not resolve hostname '%s'", remote_addr),
      |                                     ^~

5 years agomsdk: fix for mfx frame alloc response
Haihao Xiang [Mon, 9 Sep 2019 05:40:53 +0000 (13:40 +0800)]
msdk: fix for mfx frame alloc response

Both MSDK and this plugin use mfxFrameAllocResponse for video and DMABuf
memory, it is possible that some GST buffers are still in use when calling
gst_msdk_frame_free, so add a reference count in the wrapper of
mfxFrameAllocResponse (GstMsdkAllocResponse) to make sure the underlying
mfx resources are still available if the corresponding buffer pool is in
use.

In addtion, currently all allocators for input or output share the same
mfxFrameAllocResponse pointer in an element, so it is possible that
the content of mfxFrameAllocResponse is updated for a new caps then all
GST buffers allocated from an old allocator will use this new content of
mfxFrameAllocResponse, which will result in unexpected behavior. In this
fix, we save the the content of mfxFrameAllocResponse in the corresponding
tructure to avoid such issue

Sample pipeline:

gst-launch-1.0 filesrc location=vp9_multi_resolutions.ivf ! ivfparse ! msdkvp9dec !
msdkvpp ! video/x-raw\(memory:DMABuf\),format=NV12 ! glimagesink

5 years agomsdk: don't cache mfxFrameAllocResponse pointer
Haihao Xiang [Wed, 11 Sep 2019 02:49:10 +0000 (10:49 +0800)]
msdk: don't cache mfxFrameAllocResponse pointer

Otherwise it is possible that different wrappers share the same
mfxFrameAllocResponse pointer, so instead of caching the pointer, we may
cache the content of mfxFrameAllocResponse

5 years agomsdkdec: postpone surface free for VC1
Haihao Xiang [Tue, 2 Jul 2019 07:21:24 +0000 (15:21 +0800)]
msdkdec: postpone surface free for VC1

For a skipped frame in VC1, MSDK returns the mfx surface of the reference
frame, so we have to make sure the corresponding surface for the
reference frame is not freed. In this fix, we postpone surface free because
we don't know whether a surface is referenced

Before this fix, the error is like as below:

New clock: GstSystemClock
0:00:00.181793130 23098 0x55f8a9d622d0 ERROR                msdkdec
gstmsdkdec.c:622:gst_msdkdec_finish_task:<msdkvc1dec0> Couldn't find the
cached MSDK surface

Sample pipeline:
gst-launch-1.0 filesrc location=input_has_skipped_frame.wmv ! asfdemux !
vc1parse ! msdkvc1dec ! glimagesink

5 years agomsdkdec: release the surface if this surface is not in use
Haihao Xiang [Tue, 17 Sep 2019 06:42:51 +0000 (14:42 +0800)]
msdkdec: release the surface if this surface is not in use

If the surface is not in use, we may release it even if GST_FLOW_OK is going
to be returned, which may avoid the issue of failing to get surface
available

This fixes the regression caused by commit c05acf4

5 years agomsdk: adjust the stride align
Haihao Xiang [Thu, 1 Aug 2019 05:48:54 +0000 (13:48 +0800)]
msdk: adjust the stride align

GstAllocationParams::align is set to 31 in msdkdec/msdken/msdkvpp, hence
the stride align should be greater than or equal to 31, otherwise it
will result in issue
https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/861
(msdk: "GStreamer-CRITICAL: gst_buffer_resize_range failed" SPAM),

In addition, the stride should match the pitch alignment in the media driver,
otherwise it will result in some issues when a buffer is shared between
different elements, e.g. the NV12 issue mentioned in commit 3f2314a, which
can be reproduced by `gst-launch-1.0 vidoetestsrc ! msdkvpp !
video/x-raw\(memory:DMABuf\),format=NV12 ! glimagesink`

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

5 years agortpmanagerbad: allow creation of elements at initialisation
Marc Leeman [Fri, 20 Sep 2019 15:35:09 +0000 (15:35 +0000)]
rtpmanagerbad: allow creation of elements at initialisation

5 years agovulkan: implement command buffer reuse
Matthew Waters [Tue, 17 Sep 2019 12:24:04 +0000 (22:24 +1000)]
vulkan: implement command buffer reuse

Using a similar design for reference counting as
GstBuffer/GstBufferPool.

5 years agoristsrc: Fix comment about odd/even ports
Nicolas Dufresne [Wed, 18 Sep 2019 20:27:35 +0000 (16:27 -0400)]
ristsrc: Fix comment about odd/even ports

It is the RTP port that is even, and the RTCP port being +1 (hence odd).

5 years agod3d11: Use g_cond_broadcast() to wake up waiting threads
Seungha Yang [Wed, 18 Sep 2019 09:43:41 +0000 (18:43 +0900)]
d3d11: Use g_cond_broadcast() to wake up waiting threads

gst_d3d11_device_thread_add() can be called concurrently from different
threads so the cond signal should reach to all waiting threads.

5 years agovulkan: add device provider implementation
Matthew Waters [Mon, 16 Sep 2019 05:29:26 +0000 (15:29 +1000)]
vulkan: add device provider implementation

5 years agovulkansink: attempt a context query for a device
Matthew Waters [Mon, 16 Sep 2019 03:00:34 +0000 (13:00 +1000)]
vulkansink: attempt a context query for a device

5 years agovulkan: split physical device from logical device
Matthew Waters [Mon, 16 Sep 2019 02:59:08 +0000 (12:59 +1000)]
vulkan: split physical device from logical device

5 years agovulkan: expose various flags to string methods
Matthew Waters [Mon, 16 Sep 2019 01:24:13 +0000 (11:24 +1000)]
vulkan: expose various flags to string methods

5 years agovulkan: only pass the device/instance/display in to *_handle_*() functions
Matthew Waters [Mon, 16 Sep 2019 01:21:55 +0000 (11:21 +1000)]
vulkan: only pass the device/instance/display in to *_handle_*() functions

We don't need to change the pointer value in these functions.

5 years agomsdkenc: remove unneeded label
Haihao Xiang [Mon, 16 Sep 2019 02:52:53 +0000 (10:52 +0800)]
msdkenc: remove unneeded label

5 years agoGstViewfinderBin: Fix typo in videoscale's name element
VaL Doroshchuk [Mon, 9 Sep 2019 13:28:32 +0000 (15:28 +0200)]
GstViewfinderBin: Fix typo in videoscale's name element

If user's video sink has been changed, it is unable to fetch
videoscale element by name and link to the video sink.

5 years agoapplemedia/videocache: remove unimplemented/used upload function
Matthew Waters [Mon, 26 Aug 2019 06:48:13 +0000 (16:48 +1000)]
applemedia/videocache: remove unimplemented/used upload function

5 years agovulkan/window/ios: fix race on window startup
Matthew Waters [Wed, 11 Sep 2019 13:09:35 +0000 (23:09 +1000)]
vulkan/window/ios: fix race on window startup

1. The iOS create_surface implementation needs to call out to the main
thread to create the window (UIKit requirement)
2. get_surface() can be called and will attempt to create the VkSurface
from an invalid view/layer.

Also pass the layer for MoltenVK so we don't get pesky 'UIView function
not called on main thread' warnings.

5 years agovulkan: create the macos/ios-specific displays
Matthew Waters [Wed, 11 Sep 2019 14:10:37 +0000 (00:10 +1000)]
vulkan: create the macos/ios-specific displays

5 years agovulkan: install public gstvkdebug.h header
Matthew Waters [Thu, 12 Sep 2019 05:29:05 +0000 (15:29 +1000)]
vulkan: install public gstvkdebug.h header

5 years agomsdkdec: set pointer to NULL to avoid freeing an used surface
Haihao Xiang [Wed, 11 Sep 2019 07:06:58 +0000 (15:06 +0800)]
msdkdec: set pointer to NULL to avoid freeing an used surface

The surface should be cached in the surface list when GST_FLOW_OK is
going to be returned

This fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1051

5 years agomsdk: free mfx frames to avoid memory leaks in encoder and vpp
Haihao Xiang [Wed, 21 Aug 2019 04:45:37 +0000 (12:45 +0800)]
msdk: free mfx frames to avoid memory leaks in encoder and vpp

5 years agomsdkdec: unref the caps to avoid memory leaks
Haihao Xiang [Tue, 10 Sep 2019 06:44:19 +0000 (14:44 +0800)]
msdkdec: unref the caps to avoid memory leaks

5 years agomsdkvpp: free msdk surfaces to avoid memory leak
Haihao Xiang [Thu, 29 Aug 2019 01:31:22 +0000 (09:31 +0800)]
msdkvpp: free msdk surfaces to avoid memory leak

5 years agomsdkvpp: unref buffer pools
Haihao Xiang [Wed, 21 Aug 2019 04:27:57 +0000 (12:27 +0800)]
msdkvpp: unref buffer pools

Unref the pools first in caps re-negotiation to avoid memory leak

5 years agomsdk: fix memory leaks in msdk allocators
Haihao Xiang [Thu, 29 Aug 2019 07:28:36 +0000 (15:28 +0800)]
msdk: fix memory leaks in msdk allocators

5 years agomsdkenc: work-around to avoid zero fps in MediaSDK structure
Fuwei Tang [Thu, 5 Sep 2019 01:05:10 +0000 (09:05 +0800)]
msdkenc: work-around to avoid zero fps in MediaSDK structure

5 years agomsdkenc: add an extra surface for hevc encoding
Fuwei Tang [Mon, 9 Sep 2019 05:42:56 +0000 (13:42 +0800)]
msdkenc: add an extra surface for hevc encoding

For some hevc 10bit 4K encoding cases, the encoding process may be
slow, and MediaSDK surface can't be released in time before one other
available surface is needed. So add an extra surface for hevc encoding
to avoid this issue.

5 years agowebrtc/stats: redo considering internal sources
Matthew Waters [Mon, 12 Aug 2019 09:42:12 +0000 (19:42 +1000)]
webrtc/stats: redo considering internal sources

Internal sources seem to be rtp streams we are sending whereas
non-internal sources are the rtp streams we are receiving. Redo the
statistics with that in mind.