platform/upstream/gstreamer.git
4 years agogstlv2utils.c: avoid implicit float to int conversion
Jordan Petridis [Mon, 3 Aug 2020 15:40:31 +0000 (18:40 +0300)]
gstlv2utils.c: avoid implicit float to int conversion

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

4 years agogstautoconvert.c: fix clang warnings
Jordan Petridis [Mon, 3 Aug 2020 15:35:56 +0000 (18:35 +0300)]
gstautoconvert.c: fix clang warnings

clang 10 is complaining about incompatible types due to the
glib typesystem.

```
gst-plugins-bad/gst/autoconvert/b5c3019@@gstautoconvert@sha/gstautoconvert.c.o' -c ../subprojects/gst-plugins-bad/gst/autoconvert/gstautoconvert.c
../subprojects/gst-plugins-bad/gst/autoconvert/gstautoconvert.c:898:8: error: incompatible pointer types passing 'typeof ((((void *)0))) *' (aka 'void **') to parameter of type 'GList **' (aka 'struct _GList **') [-Werror,-Wincompatible-pointer-types]
  if (!g_atomic_pointer_compare_and_exchange (&autoconvert->factories, NULL,
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gatomic.h:192:44: note: expanded from macro 'g_atomic_pointer_compare_and_exchange'
    __atomic_compare_exchange_n ((atomic), &gapcae_oldval, (newval), FALSE, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) ? TRUE : FALSE; \
                                           ^~~~~~~~~~~~~~
1 error generated.
```

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

4 years agogstladspautils.c: avoid implicit float to int conversion
Jordan Petridis [Mon, 3 Aug 2020 15:25:28 +0000 (18:25 +0300)]
gstladspautils.c: avoid implicit float to int conversion

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

4 years agoandroidmedia: ignore additional camera effects if not present
Andrew Branson [Mon, 27 Jul 2020 13:45:49 +0000 (15:45 +0200)]
androidmedia: ignore additional camera effects if not present

Fixes https://gitlab.freedesktop.org/gstreamer/cerbero/-/issues/283

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

4 years agomeson: Only look for Obj-C/C++ compilers on macOS/iOS
Nirbheek Chauhan [Tue, 4 Aug 2020 00:04:23 +0000 (05:34 +0530)]
meson: Only look for Obj-C/C++ compilers on macOS/iOS

On Windows, MinGW-GCC Objective-C/C++ compilers can be in PATH and
mess up the build since they may not match the CPU family of the C/C++
compilers we are using.

Also require them on macOS/iOS, because they should always be present.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-build/-/issues/88

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

4 years agova: h264dec: log if upstream pool is kept
Víctor Manuel Jáquez Leal [Tue, 4 Aug 2020 08:38:30 +0000 (10:38 +0200)]
va: h264dec: log if upstream pool is kept

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

4 years agova: utils: fix precondition check for handle_context_query()
Víctor Manuel Jáquez Leal [Tue, 4 Aug 2020 08:24:49 +0000 (10:24 +0200)]
va: utils: fix precondition check for handle_context_query()

display paramater can be NULL, but if it's not, it has to be a
GstVaDisplay.

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

4 years agova: tests: example: Fix memory leaks
Víctor Manuel Jáquez Leal [Tue, 4 Aug 2020 08:20:46 +0000 (10:20 +0200)]
va: tests: example: Fix memory leaks

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

4 years agosrtobject: Add support for IPv6
Francisco Javier Velázquez-García [Thu, 30 Jul 2020 16:26:34 +0000 (18:26 +0200)]
srtobject: Add support for IPv6

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

4 years agosrtobject: Reset parameters before setting URI
Francisco Javier Velázquez-García [Thu, 30 Jul 2020 16:26:34 +0000 (18:26 +0200)]
srtobject: Reset parameters before setting URI

This makes `gst_srt_object_validate_parameters` work properly since
`localaddress` and `localport` will be missing if the URL did not
provide them.

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

4 years agosrtobject: Simplify gst_srt_object_set_*_value
Francisco Javier Velázquez-García [Thu, 30 Jul 2020 16:26:33 +0000 (18:26 +0200)]
srtobject: Simplify gst_srt_object_set_*_value

This fixes `gst_srt_object_set_string_value` in particular because the
value might not be a static string.

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

4 years agosrtobject: Store passphrase like other parameters
Francisco Javier Velázquez-García [Thu, 30 Jul 2020 16:26:33 +0000 (18:26 +0200)]
srtobject: Store passphrase like other parameters

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

4 years agowebrtc, rtmp2: Warn if the user or password aren't escaped
Nirbheek Chauhan [Fri, 31 Jul 2020 20:48:39 +0000 (02:18 +0530)]
webrtc, rtmp2: Warn if the user or password aren't escaped

If the user/pass aren't escaped, the userinfo will be ambiguous and we
won't know where to split. We will accidentally get it right if the :
belongs in the password.

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

4 years agowebrtc, rtmp2: Fix parsing of userinfo in URI strings
Nirbheek Chauhan [Fri, 31 Jul 2020 20:42:21 +0000 (02:12 +0530)]
webrtc, rtmp2: Fix parsing of userinfo in URI strings

While parsing the string, `gst_uri_from_string()` also unescapes the
userinfo. This is bad if your username contains a `:` character, since
we will then split the userinfo at the wrong location when parsing it.

To fix this, we can use the new `gst_uri_from_string_escaped()` API
that was added in
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/583

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

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

4 years agotests: examples: add va-x11-render example
Víctor Manuel Jáquez Leal [Mon, 3 Aug 2020 11:50:23 +0000 (13:50 +0200)]
tests: examples: add va-x11-render example

This a GTK+ example will share, through GstContext, a custom X11
VADisplay to a pipeline using vah264dec and appsink.

When the frames are processed for rendering, the VASurfaceID is
fetched from the buffer and it is rendered using vaPutSurface in a X11
widget.

4 years agotests: examples: Comply with compilation order
Víctor Manuel Jáquez Leal [Mon, 3 Aug 2020 11:45:49 +0000 (13:45 +0200)]
tests: examples: Comply with compilation order

4 years agova: allocator: support for GST_MAP_VA map flag
Víctor Manuel Jáquez Leal [Sun, 2 Aug 2020 15:52:50 +0000 (17:52 +0200)]
va: allocator: support for GST_MAP_VA map flag

This flag will return the VASurface value at mapping

4 years agova: context: instanciate VA display through GstContext
Víctor Manuel Jáquez Leal [Sun, 2 Aug 2020 13:51:08 +0000 (15:51 +0200)]
va: context: instanciate VA display through GstContext

Add all the machinery to instanciate VA display through GstContext,
thus all va elements can share the same display and the user can set
a custom one.

4 years agova: h264dec: don't copy frames if VAMemory capsfeature is negotiated
Víctor Manuel Jáquez Leal [Mon, 3 Aug 2020 11:44:23 +0000 (13:44 +0200)]
va: h264dec: don't copy frames if VAMemory capsfeature is negotiated

Otherwise the VASurfaceID is lost.

4 years agova: h264dec: copy render_device_path in klass
Víctor Manuel Jáquez Leal [Mon, 3 Aug 2020 11:42:54 +0000 (13:42 +0200)]
va: h264dec: copy render_device_path in klass

It it's not copied both cdata and klass, the string is lost. Thus
also it's freed from cdata when freeing it.

4 years agova: display: wrapped: Fix property name
Víctor Manuel Jáquez Leal [Mon, 3 Aug 2020 11:42:00 +0000 (13:42 +0200)]
va: display: wrapped: Fix property name

4 years agova: decoder: remove unused argument
Víctor Manuel Jáquez Leal [Sun, 2 Aug 2020 13:54:31 +0000 (15:54 +0200)]
va: decoder: remove unused argument

And that changes function's namespace

4 years agova: caps: bail raw caps if driver doesn't report surface formats
Víctor Manuel Jáquez Leal [Sat, 1 Aug 2020 19:59:30 +0000 (21:59 +0200)]
va: caps: bail raw caps if driver doesn't report surface formats

This is a bug in Gallium RadeonSI driver for Polaris10, which doesn't
report sufrace formats for reported chroma.

If one chroma doesn't report surface formats, skip the generated caps.

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

4 years agova: allocator: get a surface format from a image format
Víctor Manuel Jáquez Leal [Sat, 1 Aug 2020 13:47:19 +0000 (15:47 +0200)]
va: allocator: get a surface format from a image format

For the allocator to create surfaces with the correct chroma an
fourcc, it should use a surface format, not necessarily the negotiated
format.

Instead of the previous arbitrary extra formats list, the decoder
extracts the valid pixel formats from the given VA config, and pass
that list to the allocator which stores it (full transfer).

Then, when the allocator allocates a new surface, it looks for a
surface color format chroma-compatible with the negotiated image color
format.

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

4 years agova: caps: add raw caps image formats with same chroma of surfaces
Víctor Manuel Jáquez Leal [Sat, 1 Aug 2020 13:03:22 +0000 (15:03 +0200)]
va: caps: add raw caps image formats with same chroma of surfaces

Instead of adding a list of ad-hoc formats for raw caps (I420 and
YV12), the display queries the available image formats and we assume
that driver can download frames in that available format with same
chroma of the config surfaces chroma.

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

4 years agova: display: add gst_va_display_get_image_formats()
Víctor Manuel Jáquez Leal [Mon, 27 Jul 2020 09:14:02 +0000 (11:14 +0200)]
va: display: add gst_va_display_get_image_formats()

For this it was also added gst_va_video_format_from_va_image_format()

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

4 years agova: decoder: initialize rt_formas to zero
Víctor Manuel Jáquez Leal [Mon, 27 Jul 2020 09:14:49 +0000 (11:14 +0200)]
va: decoder: initialize rt_formas to zero

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

4 years agod3d11download: Allow linking with downstream d3d11 elements
Seungha Yang [Mon, 3 Aug 2020 10:49:15 +0000 (19:49 +0900)]
d3d11download: Allow linking with downstream d3d11 elements

It will make pipeline configuration easier since d3d11download
element can be placed unconditionally. This behavior is similar
to that of gldownload element.

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

4 years agohlssink2: Don't assert if we don't have a current location when receiving the fragmen...
Sebastian Dröge [Mon, 27 Jul 2020 13:37:20 +0000 (16:37 +0300)]
hlssink2: Don't assert if we don't have a current location when receiving the fragment-closed message

This can happen if the application did not provide an output stream for
the fragment and didn't handle the error message before splitmuxsink
decided to consider the fragment closed.

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

4 years agoopencv: allow compilation against 4.4.x
Nicola Murino [Fri, 31 Jul 2020 21:38:56 +0000 (23:38 +0200)]
opencv: allow compilation against 4.4.x

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

4 years agomfvideosrc: Select common formats if both VideoPreview and VideoRecord are available
Seungha Yang [Fri, 31 Jul 2020 17:19:07 +0000 (02:19 +0900)]
mfvideosrc: Select common formats if both VideoPreview and VideoRecord are available

Some devices (e.g., Surface Book 2, Surface Pro X) will expose
both MediaStreamType_VideoPreview and MediaStreamType_VideoRecord types
for a logical device. And for some reason, MediaStreamType_VideoPreview
seems to be selected between them while initiailzing device.
But I cannot find any documentation for the decision rule.
To be safe, we will select common formats between them.

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

4 years agomfvideosrc: Check framerate for target IMediaFrameFormat selection
Seungha Yang [Fri, 31 Jul 2020 15:53:46 +0000 (00:53 +0900)]
mfvideosrc: Check framerate for target IMediaFrameFormat selection

Not only resolution and format, but framerate needs to be checked
for proper target IMediaFrameFormat selection.

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

4 years agomfvideosrc: Handle I420/IYUV subtypes for UWP cases
Seungha Yang [Thu, 30 Jul 2020 18:46:39 +0000 (03:46 +0900)]
mfvideosrc: Handle I420/IYUV subtypes for UWP cases

Microsoft defines two I420 formats, one is I420, and the other is
IYUV (but both are same, just names are different).
Since both will be converted to GST_VIDEO_FORMAT_I420,
we should check both I420 and IYUV subtypes during
GstVideoFormat to Microsoft's format conversion.

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

4 years agomfvideosrc: Add more debug log
Seungha Yang [Thu, 30 Jul 2020 18:26:35 +0000 (03:26 +0900)]
mfvideosrc: Add more debug log

It would be useful for finding the error reason.

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

4 years agodocs: Update wasapi2 and mfvideosrc doc
Seungha Yang [Fri, 31 Jul 2020 12:07:15 +0000 (21:07 +0900)]
docs: Update wasapi2 and mfvideosrc doc

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

4 years agowasapi2, mfvideosrc: Update "dispatcher" property to be only writable
Seungha Yang [Fri, 31 Jul 2020 11:57:29 +0000 (20:57 +0900)]
wasapi2, mfvideosrc: Update "dispatcher" property to be only writable

Disallow getting dispatcher pointer, since it doesn't seem to be useful
and might not be safe.

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

4 years agocccombiner: implement samples selection API
Mathieu Duponchelle [Wed, 1 Jul 2020 01:59:56 +0000 (03:59 +0200)]
cccombiner: implement samples selection API

Call gst_aggregator_selected_samples() after identifying the
caption buffers that will be added as a meta on the next video
buffer.

Implement GstAggregator.peek_next_sample.

Add an example that demonstrates usage of the new API in
combination with the existing buffer-consumed signal.

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

4 years agowpesrc: timestamp buffers when working with SHM buffers
Mathieu Duponchelle [Tue, 28 Jul 2020 22:04:40 +0000 (00:04 +0200)]
wpesrc: timestamp buffers when working with SHM buffers

GLBaseSrc::fill() will take care of that when dealing with
images, but as we don't chain up when dealing with SHM buffers
this needs to be done in order for GLBaseSrc::get_times() to
work appropriately.

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

4 years agowpe: fix ready signalling
Mathieu Duponchelle [Tue, 28 Jul 2020 21:28:12 +0000 (23:28 +0200)]
wpe: fix ready signalling

Receiving the WEBKIT_LOAD_COMMITTED event doesn't actually
mean we have committed an SHM buffer / image yet.

As this is the condition we are interested in, check it
instead.

Also wrap g_cond_wait in a loop for extra correctness points.

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

4 years agobasecamerabinsrc: silence g-ir-scanner warnings
Tim-Philipp Müller [Tue, 28 Jul 2020 10:43:47 +0000 (11:43 +0100)]
basecamerabinsrc: silence g-ir-scanner warnings

They're legit, but there's lots of other stuff that needs
fixing up in this API, so just silence for now and add a
FIXME and leave it for some other day.

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

4 years agoristsrc: drop stream-start & eos messages posted from the internal udp sink(s)
George Kiagiadakis [Tue, 28 Jul 2020 09:24:07 +0000 (12:24 +0300)]
ristsrc: drop stream-start & eos messages posted from the internal udp sink(s)

See #1368

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

4 years agortpsrc: drop stream-start & eos messages posted from the internal udp sink(s)
George Kiagiadakis [Tue, 28 Jul 2020 09:16:10 +0000 (12:16 +0300)]
rtpsrc: drop stream-start & eos messages posted from the internal udp sink(s)

See #1368

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

4 years agotsmux: Fix PCR calculation for CBR live streams
Vivia Nikolaidou [Fri, 10 Jul 2020 18:14:01 +0000 (21:14 +0300)]
tsmux: Fix PCR calculation for CBR live streams

Take the first ever timestamp as an offset

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

4 years agotsmux: Refactor get_current_pcr
Jan Alexander Steffens (heftig) [Wed, 15 Jul 2020 14:25:07 +0000 (16:25 +0200)]
tsmux: Refactor get_current_pcr

No functional change.

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

4 years agocamerabinpreview: fix potential crash on preview pipeline error
Tim-Philipp Müller [Tue, 28 Jul 2020 10:27:37 +0000 (11:27 +0100)]
camerabinpreview: fix potential crash on preview pipeline error

Post error message on actual element, not the allocated helper struct.

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

4 years agowaylandsink: Update stale GstBuffer references in wayland buffer cache
Damian Hobson-Garcia [Wed, 22 Jul 2020 07:32:37 +0000 (16:32 +0900)]
waylandsink: Update stale GstBuffer references in wayland buffer cache

"waylandsink: use GstMemory instead of GstBuffer for cache lookup"
changes the cache key to GstMemory, but the cached data still needs
a pointer to the GstBuffer to control the buffer lifecycle.
If the GstMemory used as the cache key moves from one GstBuffer to
another, the pointer in the cached data will be out-of-date.

Update the current GstBuffer pointer for each frame so that it always
represents the currently in use (from attach to release) GstBuffer
for each wl_buffer.

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

4 years agowasapi2device: Allow empty caps for UWP use case
Seungha Yang [Sat, 25 Jul 2020 11:40:52 +0000 (20:40 +0900)]
wasapi2device: Allow empty caps for UWP use case

If the device has not been activated yet, caps might not be available.

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

4 years agowasapi2: Activate device asynchronously if required
Seungha Yang [Fri, 24 Jul 2020 15:17:29 +0000 (00:17 +0900)]
wasapi2: Activate device asynchronously if required

In case of UWP, documentation from MS is saying that
ActivateAudioInterfaceAsync() method should be called from UI thread.
And the resulting callback might not happen until user interaction
has been made.
So we cannot wait the activation result on constructed() method.
and therefore we should return gst_wasapi2_client_new()
immediately without waiting the result if wasapi2 elements are
running on UWP application.
In addition to async operation fix, this commit includes COM object
reference counting issue around ActivateAudioInterfaceAsync() call.

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

4 years agowasapi2: Add a new property for ICoreDispatcher setting
Seungha Yang [Fri, 24 Jul 2020 12:53:37 +0000 (21:53 +0900)]
wasapi2: Add a new property for ICoreDispatcher setting

... so that ensure device activation on UI thread.

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

4 years agomfvideosrc: Only device activation needs to be running on UI thread
Seungha Yang [Fri, 24 Jul 2020 15:24:45 +0000 (00:24 +0900)]
mfvideosrc: Only device activation needs to be running on UI thread

... and the other operations does not have the thread constraint.

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

4 years agomfvideosrc: Add a new property for ICoreDispatcher setting
Seungha Yang [Fri, 24 Jul 2020 11:48:20 +0000 (20:48 +0900)]
mfvideosrc: Add a new property for ICoreDispatcher setting

Since the commit c29c71ae9d46cc70e29e0cca2313917f319ef6f2,
device activation method will be called from an internal thread.

A problem is that, CoreApplication::GetCurrentView()
method will return nullptr if it was called from non-UI thread,
and as a result, currently implemented method for accessing ICoreDispatcher
will not work in any case. There seems to be no robust way for
accessing ICoreDispatcher other then setting it by user.

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

4 years agomfvideosrc: Suppress more spammy debug messages
Seungha Yang [Sat, 25 Jul 2020 20:42:27 +0000 (05:42 +0900)]
mfvideosrc: Suppress more spammy debug messages

The failure on compressed format (e.g., MJPG, H264 subtypes) is expected.

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

4 years agodirectfb: suppress compiler warning from directfb headers
Tim-Philipp Müller [Sat, 25 Jul 2020 18:36:10 +0000 (19:36 +0100)]
directfb: suppress compiler warning from directfb headers

On debian sid, directfb 1.7.7

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

4 years agod3d11window: Remove timeout and wait a task if possible
Seungha Yang [Thu, 23 Jul 2020 16:56:27 +0000 (01:56 +0900)]
d3d11window: Remove timeout and wait a task if possible

If the run_async() method is expected to be called from streaming
thread and not from application thread, use INFINITE as timeout value
so that d3d11window can wait UI dispatcher thread in any case.

There is no way to get a robust timeout value from library side.
So the fixed timeout value might not be optimal and therefore
we should avoid it as much as possible.

Rule whether a timeout value can be INFINITE or not is,
* If the waiting can be cancelled by GstBaseSink:unlock(), use INFINITE.
  GstD3D11Window:on_resize() is one case for example.
* Otherwise, use timeout value
  Some details are, GstBaseSink:start() and GstBaseSink:stop() will be called
  when NULL to READY or READY to NULL state change, so there will be no
  chance for GstBaseSink:unlock() and GstBaseSink:unlock_stop()
  to be called around them. So there is no other way then timeout way.
  GstD3D11Window:consturcted() and GstD3D11Window:unprepare() are the case.

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

4 years agod3d11window: Increase timeout to 10 sec for WinRT window implementations
Seungha Yang [Thu, 23 Jul 2020 16:43:16 +0000 (01:43 +0900)]
d3d11window: Increase timeout to 10 sec for WinRT window implementations

No strong reason for this number, but we can follow other well known
UWP implementation ANGLE.

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

4 years agocodecs: vp8decoder: Sync up with h264decoder implementation
Seungha Yang [Thu, 23 Jul 2020 08:45:03 +0000 (17:45 +0900)]
codecs: vp8decoder: Sync up with h264decoder implementation

Pass GstVideoCodecFrame with GstVp8Picture to new_picture() and
output_picture() methods for subclass to be able to reference
it directly.

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

4 years agov4l2codecs: vp8dec: Remove white space
Seungha Yang [Thu, 23 Jul 2020 08:26:37 +0000 (17:26 +0900)]
v4l2codecs: vp8dec: Remove white space

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

4 years agomeson: add a plugin summary
Stéphane Cerveau [Thu, 23 Jul 2020 15:00:52 +0000 (17:00 +0200)]
meson: add a plugin summary

This summary displays a list of plugins which
have been enabled.

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

4 years agoiqa: Add a 'mode' property
Thibault Saunier [Mon, 29 Jun 2020 21:31:15 +0000 (17:31 -0400)]
iqa: Add a 'mode' property

This property currently only supports a 'strict' that checks that
all the input streams have the exact same number of frames.

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

4 years agoiqa: Implement child proxy
Thibault Saunier [Mon, 29 Jun 2020 21:28:30 +0000 (17:28 -0400)]
iqa: Implement child proxy

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

4 years agocodecs: vp9decoder: Sync up with h264decoder implementation
Seungha Yang [Tue, 21 Jul 2020 14:08:15 +0000 (23:08 +0900)]
codecs: vp9decoder: Sync up with h264decoder implementation

* Pass GstVideoCodecFrame to new_picture() and output_picture()
* Pass the last reference of GstVp9Picture to subclass if possible

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

4 years agowasapi2: Fix broken debug log
Seungha Yang [Thu, 23 Jul 2020 14:01:03 +0000 (23:01 +0900)]
wasapi2: Fix broken debug log

I hope that MSVC is smart enought to warn this at build time

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

4 years agov4l2codecs: h264dec: Remove outdated comment
Seungha Yang [Thu, 23 Jul 2020 09:03:23 +0000 (18:03 +0900)]
v4l2codecs: h264dec: Remove outdated comment

... and unnecessary user data clear on GstVideoCodecFrame

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

4 years agov4l2codecs: h264dec: Fix leak on decoding failure
Seungha Yang [Thu, 23 Jul 2020 08:48:56 +0000 (17:48 +0900)]
v4l2codecs: h264dec: Fix leak on decoding failure

Given GstVideoCodecFrame and GstH264Picture should be cleared,
and the return must be GST_FLOW_ERROR, not boolean value.

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

4 years agod3d11decoder: Disable array-of-texture
Seungha Yang [Tue, 21 Jul 2020 17:20:07 +0000 (02:20 +0900)]
d3d11decoder: Disable array-of-texture

Some 4K VP9 + super frame enabled streams would be broken with
array-of-texture configuration (i.e., allowing runtime texture registration
for DPB).

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

4 years agomfutils: Suppress spammy debug print
Seungha Yang [Wed, 22 Jul 2020 08:50:58 +0000 (17:50 +0900)]
mfutils: Suppress spammy debug print

Remove FIXME debug print. It seems to be spammy.

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

4 years agomfvideosrc: Expose sorted caps
Seungha Yang [Tue, 21 Jul 2020 07:52:33 +0000 (16:52 +0900)]
mfvideosrc: Expose sorted caps

Sort the list of supported caps for downstream to be able to select
the best image in terms of quality (resolution and framerate) by default.

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

4 years agomfvideosrc: Don't expose unsupported formats
Seungha Yang [Tue, 21 Jul 2020 06:48:08 +0000 (15:48 +0900)]
mfvideosrc: Don't expose unsupported formats

Some UVC cameras support H.264 stream but we don't support it yet.

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

4 years agodocs: update plugins doc cache
Víctor Manuel Jáquez Leal [Tue, 14 Jul 2020 11:18:25 +0000 (13:18 +0200)]
docs: update plugins doc cache

Add va plugin

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

4 years agova: documentation since tag
Víctor Manuel Jáquez Leal [Mon, 20 Jul 2020 14:37:35 +0000 (16:37 +0200)]
va: documentation since tag

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

4 years agovah264dec: add documentation caps for pad templates
Víctor Manuel Jáquez Leal [Tue, 14 Jul 2020 11:17:35 +0000 (13:17 +0200)]
vah264dec: add documentation caps for pad templates

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

4 years agod3d11window: Disable d3d11 video processor for HDR10 stream.
Seungha Yang [Tue, 21 Jul 2020 14:44:03 +0000 (23:44 +0900)]
d3d11window: Disable d3d11 video processor for HDR10 stream.

d3d11 video processor is showing buggy behaviors in various cases.
And this HDR10 is one case of them.

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

4 years agocodecs: h264decoder: Fix wrong annotations
Seungha Yang [Tue, 21 Jul 2020 13:36:14 +0000 (22:36 +0900)]
codecs: h264decoder: Fix wrong annotations

What intended was GstH264Decoder actually.

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

4 years agocodecs: h264decoder: Update document with Since marks
Seungha Yang [Tue, 21 Jul 2020 09:17:09 +0000 (18:17 +0900)]
codecs: h264decoder: Update document with Since marks

To make documentation CI happy with the newly added APIs.

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

4 years agocodecs: h264decoder: Rename API arguments
Seungha Yang [Tue, 21 Jul 2020 08:53:29 +0000 (17:53 +0900)]
codecs: h264decoder: Rename API arguments

Although it's not public ones, make them consistent with vfunc
for them to be nicer.

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

4 years agov4l2codecs: h264dec: Use the new picture lookup
Nicolas Dufresne [Mon, 20 Jul 2020 20:55:10 +0000 (16:55 -0400)]
v4l2codecs: h264dec: Use the new picture lookup

This will avoid having to create a reference chain from CodecFrame
to GstH264Picture to GstV4l2Request.

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

4 years agoh264decoder: Add ability to lookup by system_frame_number
Nicolas Dufresne [Mon, 20 Jul 2020 20:48:32 +0000 (16:48 -0400)]
h264decoder: Add ability to lookup by system_frame_number

This is to avoid having to create a reference chain in decoders from
GstVideoCodecFrame to GstH264PIcture to implementation wrapper.

So this change introduces:

 - gst_h264_dpb_remove_outputed (dpb)
 - gst_h264_dpb_get_picture(dpb, system_frame_num)
 - gst_h264_decoder_get_picture (dec, system_frame_num)

In order to ensure that frames can be looked up during the draining
process, we now first remove all (including reference) frames that
have been outputed but are still in the DPB. Then for each remaining
buffers, we remove it from the DPB to reach reference 1 and output it.

Previously we could take all not outputed outside of the DPB which would
prevent lookup by the base class.

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

4 years agocodecs: h264decoder: Make GstVideoCodecFrame hold the last reference of the buffer
Seungha Yang [Mon, 20 Jul 2020 10:13:29 +0000 (19:13 +0900)]
codecs: h264decoder: Make GstVideoCodecFrame hold the last reference of the buffer

... when gst_video_decoder_finish_frame() is called.

Some subclasses attach GstBuffer to GstH264Picture as an user data
which will increase reference count of the buffer. It would result
to buffer copy per every frame.

Background here is, GstVideoDecoder wants writable output buffer for
GstMeta handling, and if the output buffer is not writable
(i.e., reference count is not one), the buffer will be copied.
Even if underlying GstMemory wouldn't be copied, buffer copy operation
will introduce extra memory allocation overhead which is not optimal.

By this modification, subclass might be able to receive the last
reference to GstH264Picture

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

4 years agocodecs: h264decoder: Pass GstVideoCodecFrame to output_picture()
Seungha Yang [Mon, 20 Jul 2020 09:24:09 +0000 (18:24 +0900)]
codecs: h264decoder: Pass GstVideoCodecFrame to output_picture()

All subclasses are retrieving list to get target output frame, which
can be done by baseclass. And pass the ownership of the GstH264Picture
to subclass so that subclass can clear implementation dependent resources
before finishing the frame.

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

4 years agocodecs: h264decoder: Don't attach extra ref of GstH264Picture to GstVideoCodecFrame
Seungha Yang [Mon, 20 Jul 2020 08:45:12 +0000 (17:45 +0900)]
codecs: h264decoder: Don't attach extra ref of GstH264Picture to GstVideoCodecFrame

The lifecycle of GstH264Picture is being managed by our DPB
implementation. If it's still required, subclass can do that
by itself in the new_picture() method.

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

4 years agomfvideosrc: Don't error out when if we've found supported format
Seungha Yang [Mon, 20 Jul 2020 16:05:47 +0000 (01:05 +0900)]
mfvideosrc: Don't error out when if we've found supported format

While retrieving supported formats by device, the last return might
not be S_OK in case that it's not supported one by us (e.g., H264, JPEG or so).
But if we've found at least one supported raw video format,
we can keep going on.

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

4 years agocodecs: h264decoder: Drop non-decodable frames
Seungha Yang [Mon, 20 Jul 2020 11:54:26 +0000 (20:54 +0900)]
codecs: h264decoder: Drop non-decodable frames

Otherwise GstVideoDecoder baseclass will hold the corresponding broken frames
until new reset event happens such as FLUSH or downwards state change.

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

4 years agowebrtc: remove private properties/signals from the now public ice object
Matthew Waters [Fri, 17 Jul 2020 05:14:48 +0000 (15:14 +1000)]
webrtc: remove private properties/signals from the now public ice object

We don't want to expose all of the webrtcbin internals to the world.

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

4 years agoplugins: Use g_win32_error_message for HRESULT to string conversion
Seungha Yang [Thu, 16 Jul 2020 10:26:55 +0000 (19:26 +0900)]
plugins: Use g_win32_error_message for HRESULT to string conversion

We don't need to duplicate a method for HRESULT error code to string
conversion. This patch is intended to
* Remove duplicated code
* Ensure FormatMessageW (Unicode version) and avoid FormatMessageA
  (ANSI version), as the ANSI format is not portable at all.
  Note that if "UNICODE" is not defined, FormatMessageA will be aliased
  as FormatMessage by default.

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

4 years agowasapi2util: Fix wrong use of debug category
Seungha Yang [Fri, 17 Jul 2020 06:58:16 +0000 (15:58 +0900)]
wasapi2util: Fix wrong use of debug category

Haven't noticed so far since there is no debug statement in the source file.

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

4 years agoavtp: Update documentation
Ederson de Souza [Thu, 16 Jul 2020 20:32:56 +0000 (13:32 -0700)]
avtp: Update documentation

 - Mention that a new capability is required by "avtpsink" element;
 - Use "clockselect" element to change pipeline clock, instead of a
   gst-launch option that never saw the light of day.

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

4 years agowasapi: added missing lock release in case of error in gst_wasapi_xxx_reset
Silvio Lazzeretti [Wed, 15 Jul 2020 08:39:33 +0000 (10:39 +0200)]
wasapi: added missing lock release in case of error in gst_wasapi_xxx_reset

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

4 years agowaylandsink: use GstMemory instead of GstBuffer for cache lookup
Damian Hobson-Garcia [Wed, 15 Jul 2020 04:30:48 +0000 (13:30 +0900)]
waylandsink: use GstMemory instead of GstBuffer for cache lookup

The GstMemory objects contained in a GstBuffer could be replaced
by an upstream element, which would break the association beteen
the GstBuffer and the wayland wl_buffer, make the cache lookup
results incorrect.
This patch changes the cache lookup to use the first GstMemory
in a buffer instead.  For multi-plane buffers, this assumes that
all of the GstMemory(s) will always be moved together as a set,
and that the same (first) GstMemory isn't used with different
combinations of other GstMemory(s).

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

4 years agowaylandsink: Keep per display wayland buffer caches
Damian Hobson-Garcia [Wed, 8 Jul 2020 10:06:38 +0000 (19:06 +0900)]
waylandsink: Keep per display wayland buffer caches

Instead of attaching a single wayland wl_buffer to each GStBuffer as qdata,
keep a separate cache for each display.
A unique wl_buffer and associated metadata is created for each display.
This allows for sharing of GstBuffer objects between multiple
displays, such as when using tee elements.

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

4 years agov4l2codecs: Enable 32x32 tiled NV12 support
Nicolas Dufresne [Wed, 15 Jul 2020 01:49:33 +0000 (21:49 -0400)]
v4l2codecs: Enable 32x32 tiled NV12 support

This is used by Cedrus driver to support Allwinner VPU, also known as the
sunxi platforms.

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

4 years agodocs: update for new pixel formats
Tim-Philipp Müller [Wed, 15 Jul 2020 11:43:20 +0000 (12:43 +0100)]
docs: update for new pixel formats

https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/753
https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/754

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

4 years agoopencv: suppress another warning about non-existent include dirs
Jordan Petridis [Fri, 10 Jul 2020 18:58:23 +0000 (21:58 +0300)]
opencv: suppress another warning about non-existent include dirs

Ammend to 92456967d0fbdb57f7bf089b06d930b7d30bc417 !1427

The .pc file of opencv4 seems to be broken

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

4 years agomsdkh265enc: add the missing comma
Haihao Xiang [Wed, 15 Jul 2020 00:37:39 +0000 (08:37 +0800)]
msdkh265enc: add the missing comma

Otherwise main-444 and main-444-10 are concatenated

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

4 years agodoc: Updated cache file for the new pixel format
Nicolas Dufresne [Tue, 14 Jul 2020 21:06:59 +0000 (17:06 -0400)]
doc: Updated cache file for the new pixel format

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

4 years agortpsrc: Add domain name support
Nicolas Dufresne [Sat, 11 Jul 2020 19:41:51 +0000 (15:41 -0400)]
rtpsrc: Add domain name support

This add domain name resolution (similar to udpsrc does) to the rtpsrc
element.

Fixes 1352

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

4 years agoristsrc: Add support for domain name
Nicolas Dufresne [Sat, 11 Jul 2020 19:40:40 +0000 (15:40 -0400)]
ristsrc: Add support for domain name

This add domain name resolution (similar to udpsrc does) to the ristsrc
element.

Fixes 1352

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

4 years agortpsrc: Always set rtcp socket address
Nicolas Dufresne [Sat, 11 Jul 2020 19:16:53 +0000 (15:16 -0400)]
rtpsrc: Always set rtcp socket address

Regardless if it's multicast or not, set the address property to match
the element address. This is the address of the interface to listen to,
which is expected to be ANY in most cases, but should be honnored even
for RTCP non-multicast case.

This also fixes an assertion if the address is not a parsable IPv4 or
IPv6 string.

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

4 years agortpsink: Fix error handling on bad DNS
Nicolas Dufresne [Sat, 11 Jul 2020 19:21:33 +0000 (15:21 -0400)]
rtpsink: Fix error handling on bad DNS

This will properly print the DNS being attempted to resolved and avoid
trying to unref a NULL pointer.

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

4 years agoristsink: Fix error handling on bad DNS
Nicolas Dufresne [Fri, 10 Jul 2020 22:03:20 +0000 (18:03 -0400)]
ristsink: Fix error handling on bad DNS

This will properly print the DNS being attempted to resolved and avoid
trying to unref a NULL pointer.

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

4 years agomfvideosrc: Enable WinRT capture impl. for desktop target
Seungha Yang [Tue, 14 Jul 2020 10:59:09 +0000 (19:59 +0900)]
mfvideosrc: Enable WinRT capture impl. for desktop target

... if target OS version was specified as Windows 10.
When enabled, desktop application can select target capture
implementation between WinRT and Win32
via GST_USE_MF_WINRT_CAPTURE environment
(e,g., GST_USE_MF_WINRT_CAPTURE=1 for WinRT impl.).
Default is Win32 implementation in case of desktop target.

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