platform/upstream/gstreamer.git
4 years agosctpenc: Use g_signal_emit() instead of g_signal_emit_by_name()
Sebastian Dröge [Thu, 30 Jan 2020 13:59:12 +0000 (15:59 +0200)]
sctpenc: Use g_signal_emit() instead of g_signal_emit_by_name()

We have all the required information around so make use of it.

4 years agosctpenc: Propagate downstream flow errors upstream
Sebastian Dröge [Thu, 30 Jan 2020 13:58:30 +0000 (15:58 +0200)]
sctpenc: Propagate downstream flow errors upstream

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

4 years agosctpdec: Use a flow combiner for the source pad flow returns and propagate errors...
Sebastian Dröge [Thu, 30 Jan 2020 13:56:36 +0000 (15:56 +0200)]
sctpdec: Use a flow combiner for the source pad flow returns and propagate errors upstream

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

4 years agompegtsparse: Moved dispose function into finalize
Vivia Nikolaidou [Fri, 17 Jan 2020 15:44:34 +0000 (17:44 +0200)]
mpegtsparse: Moved dispose function into finalize

dispose can be called several times and would double-free the flow
combiner in that case.

4 years agompegtsparse: Added alignment property
Vivia Nikolaidou [Wed, 22 Jan 2020 11:55:58 +0000 (13:55 +0200)]
mpegtsparse: Added alignment property

alignment works like in mpegtsmux, joining several MpegTS packets into
one buffer. Default value of 0 joins as many as possible for each
incoming buffer, to optimise CPU usage.

4 years agompegtsparse: Set delta unit flag on non-random-access buffers
Vivia Nikolaidou [Fri, 10 Jan 2020 16:00:07 +0000 (18:00 +0200)]
mpegtsparse: Set delta unit flag on non-random-access buffers

If they don't have the random access flag set, they cannot be decoded
independently.

4 years agompegtsparse: Packetize output on default srcpad
Vivia Nikolaidou [Fri, 10 Jan 2020 15:58:34 +0000 (17:58 +0200)]
mpegtsparse: Packetize output on default srcpad

Align buffer boundaries with mpeg-ts packets, instead of keeping
whatever packetization we have from the source (network, file reading).

4 years agompegtsparse: Factor common code into mpegts_packet_to_buffer
Vivia Nikolaidou [Fri, 10 Jan 2020 15:54:54 +0000 (17:54 +0200)]
mpegtsparse: Factor common code into mpegts_packet_to_buffer

The same code was used twice for turning an MpegTSPacketizerPacket into
a GstBuffer.

4 years agompegtspacketizer: Fix typo in flag name
Vivia Nikolaidou [Fri, 10 Jan 2020 15:52:58 +0000 (17:52 +0200)]
mpegtspacketizer: Fix typo in flag name

4 years agomsdkdec: Fix GstMsdkContext leak
Seungha Yang [Wed, 29 Jan 2020 05:10:06 +0000 (14:10 +0900)]
msdkdec: Fix GstMsdkContext leak

4 years agomsdk: Clear reference counted object in dispose() method
Seungha Yang [Wed, 29 Jan 2020 05:02:09 +0000 (14:02 +0900)]
msdk: Clear reference counted object in dispose() method

Follow GObject's memory management model

4 years agowaylandsink: Clear window when pipeline is stopped
Guillermo Rodríguez [Tue, 28 Jan 2020 12:06:59 +0000 (13:06 +0100)]
waylandsink: Clear window when pipeline is stopped

When a pipeline is stopped (actually when the waylandsink element
state changes from PAUSED to READY) the video surface is cleared, but
the opaque black surface behind is not. Fix this by actually clearing
both surfaces.

4 years agomsdk: use cached response for DMABuf when the frame size is same
Haihao Xiang [Thu, 9 Jan 2020 14:23:17 +0000 (22:23 +0800)]
msdk: use cached response for DMABuf when the frame size is same

User is seeing corrupted display when running `videotestsrc !
video/x-raw,format=NV12,width=xxx,height=xxx ! msdkh265enc ! msdkh265dec
! glimagesink` with changed frame size, e.g. from 1920x1080 to 1920x240

The root cause is a same dmabuf fd is used for frames with
different size, which causes some unexpected result. This patch requires
cached response is used for frames with same size only for DMABuf, so a
dmabuf fd can't be used for frames with different size any more.

4 years agod3d11window_win32: Let DXGI choose client area
Seungha Yang [Sat, 25 Jan 2020 09:39:52 +0000 (18:39 +0900)]
d3d11window_win32: Let DXGI choose client area

Don't specify the resolution of backbuffer. Then dxgi will let us know the
actual client area. When upstream resolution is chagned, updating the size
of backbuffer without the consideration for client size would cause mismatch
between them.

4 years agonvdec: Do not map GStreamer discont to CUVid discont
Nicolas Dufresne [Thu, 23 Jan 2020 16:01:33 +0000 (11:01 -0500)]
nvdec: Do not map GStreamer discont to CUVid discont

Setting the CUVID_PKT_DISCONTINUITY implies clearing any past information
about the stream in the decoder. The GStreamer discont flag is used for
discontinuity caused by a seek, for first buffer and if a buffer was
dropped. In the first two cases, the parsers and demuxers should ensure we
start from a synchronization point, so it's unlikely that delta will be
matched against the wrong state.

For packet lost, the discontinuity flag will prevent the decoder from doing
any concealment, with a result that ca be much worst visually, or freeze the
playback until an IDR is met. It's better to let the decoder handle that for
us.

Removing this flag, also workaround a but in NVidia parser that makes it
ignore our ENDOFFRAME flag and increase the latency by one frame.

4 years agonvdec: Tell the parser we have complete pictures
Nicolas Dufresne [Wed, 22 Jan 2020 15:26:02 +0000 (10:26 -0500)]
nvdec: Tell the parser we have complete pictures

This sets the CUVID_PKT_ENDOFPICTURE flag in order to inform the decoder that
we have a complete picture. This should remove one frame latency otherwise
introduce by NVidia parser.

4 years agoccconverter: Fill remainder of the cc_data in CDP packets with empty packets
Sebastian Dröge [Thu, 23 Jan 2020 16:08:53 +0000 (18:08 +0200)]
ccconverter: Fill remainder of the cc_data in CDP packets with empty packets

Instead of filling it completely with zeroes. Filling with zeroes is
considered invalid by various CC implementations.

4 years agod3d11window_corewindow: Always call methods of CoreWindow interface from UI thread
Seungha Yang [Tue, 21 Jan 2020 12:25:28 +0000 (21:25 +0900)]
d3d11window_corewindow: Always call methods of CoreWindow interface from UI thread

Like swapchain panel implementation, most methods of CoreWindow
should be called from UI thread.

4 years agompegdemux: Update the last_ts correctly if we have no DTS
Sebastian Dröge [Tue, 21 Jan 2020 14:50:22 +0000 (16:50 +0200)]
mpegdemux: Update the last_ts correctly if we have no DTS

If we have no DTS but a PTS then this means both are the same, and we
should update the last_ts with the PTS. Only if both are unknown then we
don't know the current position and should not update it at all.

Previously we would always update the last_ts to GST_CLOCK_TIME_NONE if
the DTS is unknown, which caused the position to jump around and to
cause spurious gap events to be sent.

4 years agomsdk: Fix compiler warning
Haihao Xiang [Tue, 21 Jan 2020 07:14:08 +0000 (15:14 +0800)]
msdk: Fix compiler warning

This patch fixed compiler warning below:

[1/4] Compiling C object 'sys/msdk/dc44ea0@@gstmsdk@sha/gstmsdkvpp.c.o'.
../../gst-plugins-bad/sys/msdk/gstmsdkvpp.c: In function
‘gst_msdkvpp_context_prepare’:
../../gst-plugins-bad/sys/msdk/gstmsdkvpp.c:214:7: warning: suggest
parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’
[-Wparentheses]

4 years agowebrtcbin: connect rtp funnel after updating ptmaps
Mathieu Duponchelle [Tue, 21 Jan 2020 11:14:49 +0000 (12:14 +0100)]
webrtcbin: connect rtp funnel after updating ptmaps

We need the streams' pt maps updated before requesting pads
on rtpbin, because this is what will trigger the requesting
of FEC encoders, and our handler for this request looks for
the payload types in the relevant stream's pt map.

Fixes #1187

4 years agompegpsdemux: Send gap events for late streams whenever updating the SCR
Sebastian Dröge [Mon, 20 Jan 2020 14:35:50 +0000 (16:35 +0200)]
mpegpsdemux: Send gap events for late streams whenever updating the SCR

Instead of doing it on each packet and doing it based on the distance to
the previous SCR instead of based on the DTS.

Previously we would send gap events for audio all the time if the SCR
distance was 400ms because the threshold for audio is 300ms and by only
ever updating the position when the SCR updates we would always be 100ms
above the threshold and send needless gap events.

This fixes audio glitches on various files caused by gap events.

4 years agonvenc: Do not access to broken encode session
Seungha Yang [Thu, 16 Jan 2020 04:00:33 +0000 (13:00 +0900)]
nvenc: Do not access to broken encode session

If an encode session failed in initializing, the encode
session would be broken and the next nvenc API will cause crash.

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

4 years agomsdk: Fix increasing memory usage in dynamic pipelines
Nirbheek Chauhan [Fri, 17 Jan 2020 05:37:47 +0000 (11:07 +0530)]
msdk: Fix increasing memory usage in dynamic pipelines

Our context is non-persistent, and we propagate it throughout the
pipeline. This means that if we try to reuse any gstmsdk element by
removing it from the pipeline and then re-adding it, we'll clone the
mfxSession and create a new gstmsdk context as a child of the old one
inside `gst_msdk_context_new_with_parent()`.

Normally this only allocates a few KB inside the driver, but on
Windows it seems to allocate tens of MBs which leads to linearly
increasing memory usage for each PLAYING->NULL->PLAYING state cycle
for the process. The contexts will only be freed when the pipeline
itself goes to `NULL`, which would defeat the purpose of dynamic
pipelines.

Essentially, we need to optimize the case in which the element is
removed from the pipeline and re-added and the same context is re-set
on it. To detect that case, we set the context on `old_context`, and
compare it to the new one when preparing the context. If they're the
same, we don't need to do anything.

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

4 years agomsdk: Reorganize context preparation code
Nirbheek Chauhan [Fri, 17 Jan 2020 05:13:11 +0000 (10:43 +0530)]
msdk: Reorganize context preparation code

Split it out into a separate function with early exits to make the
flow clearer, and document what the function is doing clearly.
No functional changes.

4 years agomsdk: Fix warning about unused variable on Windows
Nirbheek Chauhan [Fri, 17 Jan 2020 04:43:49 +0000 (10:13 +0530)]
msdk: Fix warning about unused variable on Windows

4 years agomsdk: Use gst_clear_object()
Nirbheek Chauhan [Fri, 17 Jan 2020 08:15:35 +0000 (13:45 +0530)]
msdk: Use gst_clear_object()

`gst_object_replace()` is not supposed to be used for unreffing and
NULLing objects.

4 years agonvcodec: Print debug info when initializing nvenc
Nirbheek Chauhan [Mon, 20 Jan 2020 10:57:30 +0000 (16:27 +0530)]
nvcodec: Print debug info when initializing nvenc

We weren't printing the return value.

4 years agonvcodec: Fix crash on 32-bit Windows
Nirbheek Chauhan [Mon, 20 Jan 2020 09:52:26 +0000 (15:22 +0530)]
nvcodec: Fix crash on 32-bit Windows

We weren't using the correct calling convention when calling CUDA and
CUVID APIs. `CUDAAPI` is `__stdcall` on Windows. This was working fine
on x64 because `__stdcall` is ignored and there's no special calling
convention. However, on x86, we need to use `__stdcall`.

4 years agonvcodec: cuda.h only needs glib.h, not gst.h
Nirbheek Chauhan [Mon, 20 Jan 2020 09:40:51 +0000 (15:10 +0530)]
nvcodec: cuda.h only needs glib.h, not gst.h

Just a nitpick. Also, force the compiler to use our stub header
instead of searching for it in the include paths.

4 years agowebrtcbin: Start datachannel SCTP elements only after the DTLS connection is established
Sebastian Dröge [Fri, 17 Jan 2020 09:19:53 +0000 (11:19 +0200)]
webrtcbin: Start datachannel SCTP elements only after the DTLS connection is established

Otherwise we would start sending data to the DTLS connection before, and
the DTLS elements consider this an error.

Also RFC 8261 mentions:
  o A DTLS connection MUST be established before an SCTP association can
    be set up.

4 years agowebrtcbin: Add handling of unspecified peer-connection-state situation
Sebastian Dröge [Sun, 12 Jan 2020 15:04:22 +0000 (17:04 +0200)]
webrtcbin: Add handling of unspecified peer-connection-state situation

For us it can happen that the DTLS transports are still in the process
of connecting while the ICE transport is already completed. This
situation is not specified in the spec but conceptually that means it is
still in the process of connecting.

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

4 years agowebrtcbin: Return the old state if we ended up being in an unspecified situation
Sebastian Dröge [Sun, 12 Jan 2020 14:32:20 +0000 (16:32 +0200)]
webrtcbin: Return the old state if we ended up being in an unspecified situation

Previously we would've returned NEW, which is usually more wrong.

4 years agowebrtcbin: Fix transitions for the peer connection state
Sebastian Dröge [Thu, 9 Jan 2020 17:21:08 +0000 (19:21 +0200)]
webrtcbin: Fix transitions for the peer connection state

They're now mapping exactly to what
  https://www.w3.org/TR/webrtc/#rtcpeerconnectionstate-enum
actually specifies.

Related to https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/758

4 years agowebrtcbin: Fix transitions for the connection state
Sebastian Dröge [Thu, 9 Jan 2020 16:55:56 +0000 (18:55 +0200)]
webrtcbin: Fix transitions for the connection state

They're now mapping exactly to what
  https://www.w3.org/TR/webrtc/#dom-rtciceconnectionstate
actually specifies.

Related to https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/758

4 years agowebrtc/dtlstransport: Proxy DTLS connection state from the DTLS elements to the transport
Sebastian Dröge [Sun, 12 Jan 2020 14:25:01 +0000 (16:25 +0200)]
webrtc/dtlstransport: Proxy DTLS connection state from the DTLS elements to the transport

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

4 years agodtls: Keep track of the connection state and signal it through all the layers
Sebastian Dröge [Sun, 12 Jan 2020 14:18:09 +0000 (16:18 +0200)]
dtls: Keep track of the connection state and signal it through all the layers

This allows the application to keep track of the underlying DTLS
connection state and act accordingly.

4 years agodtls: Handle errors/close_notify at all steps and propagate through the layers properly
Sebastian Dröge [Sun, 12 Jan 2020 11:56:00 +0000 (13:56 +0200)]
dtls: Handle errors/close_notify at all steps and propagate through the layers properly

Previously we simply logged errors but never reported them to elements
or even to the user. Fatal errors are now properly reported.

Additionally proper connection closing is implemented based on EOS:
- dtlsenc: EOS will cause close_notify to be sent to the peer and only
           if the peer also sent back close_notify we will forward the
           EOS event.
- dtlsdec: EOS will be forwarded normally, this only means that the
           unterlying transport was closed. On receiving a DTLS packet
           containing close_notify, return EOS and send EOS downstream.

4 years agodtls: Propagate write errors backwards through dtlsenc/dtlsconnection
Sebastian Dröge [Sun, 12 Jan 2020 10:48:55 +0000 (12:48 +0200)]
dtls: Propagate write errors backwards through dtlsenc/dtlsconnection

4 years agodtls: Use a plain function pointer instead of a GClosure for the send callback
Sebastian Dröge [Sun, 12 Jan 2020 09:24:15 +0000 (11:24 +0200)]
dtls: Use a plain function pointer instead of a GClosure for the send callback

There's not point in using GClosure and going through all the
GValue/libffi infrastructure for each DTLS packet.

4 years agowebrtcbin: Don't consider transceivers without mid as inactive during ICE gathering...
Sebastian Dröge [Thu, 9 Jan 2020 10:32:24 +0000 (12:32 +0200)]
webrtcbin: Don't consider transceivers without mid as inactive during ICE gathering state updates

We don't have any mid before parsing the SDP, which happens after we
handled the SDP answer and that usually happens long after ICE candidate
gathering is finished.

Without this all transceivers are considered inactive and as such ICE
gathering is for active transceiver was considered complete from the
very beginning.

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

4 years agowebrtcbin: Don't consider RTP receivers stopped
Sebastian Dröge [Thu, 9 Jan 2020 10:27:31 +0000 (12:27 +0200)]
webrtcbin: Don't consider RTP receivers stopped

We don't support stopping RTP receivers currently so let's not consider
them all stopped all the time. This fixes some of the ICE/DTLS state
change handling and specifically fixes the ICE gathering state.

Previously the ICE gathering state was immediately going from NEW to
COMPLETE because it considered all transceivers stopped and as such all
activate transceivers were finished gathering ICE candidates.

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

4 years agowebrtcbin: Improve logging related to ICE/DTLS state changes
Sebastian Dröge [Thu, 9 Jan 2020 10:26:41 +0000 (12:26 +0200)]
webrtcbin: Improve logging related to ICE/DTLS state changes

4 years agoyadif: Re-renable MMX asm on x86_64 with meson
Jan Schmidt [Mon, 30 Dec 2019 15:41:40 +0000 (02:41 +1100)]
yadif: Re-renable MMX asm on x86_64 with meson

The meson build doesn't automatically set HAVE_CPU_* defines
like autotools did, so the yadif plugin was being built without
the MMX assembler support

4 years agoyadif: Only build inline Asm with gcc/clang
Jan Schmidt [Sun, 19 Jan 2020 03:50:12 +0000 (14:50 +1100)]
yadif: Only build inline Asm with gcc/clang

4 years agomsdkdec: align frame list using decoded timestamp
Josep Torra [Wed, 6 Nov 2019 12:45:09 +0000 (04:45 -0800)]
msdkdec: align frame list using decoded timestamp

Before this change decoder used the oldest frame in the list to pair it
with the decoded surface. This only works when there's a perfect stream
like HEADERS,SYNCPOINT,DELTA...

When playing RTSP streams we can get imperfect streams like HEADERS,
DELTA,SYNCPOINT,DELTA... In this case decoder drops the frames
between HEADERS and SYNCPOINT which leads into using wrong PTS on
the output frames.

With this change we inject the input PTS into the bitstream and use it
to align the internal frame list with the actually decoded position.

Fixes playback with:
```
gst-launch-1.0 rtspsrc location=... latency=0 drop-on-latency=1 ! ...
```

4 years agonvenc: Query supported minimum resolution
Seungha Yang [Thu, 28 Nov 2019 12:30:18 +0000 (21:30 +0900)]
nvenc: Query supported minimum resolution

Hard-coded 16x16 resolution is likely to differ from the device's support
in most cases. If we can use NV_ENC_CAPS_WIDTH_MIN and NV_ENC_CAPS_HEIGHT_MIN,
update pad template with returned value.

4 years agonvcodec: Bump SDK header to version 9.1
Seungha Yang [Thu, 28 Nov 2019 11:47:34 +0000 (20:47 +0900)]
nvcodec: Bump SDK header to version 9.1

Update header to query minimum resolution of encoder and to control
the number of reference frame if it's supported

4 years agomxfdemux: add support for Apple ProRes
Tim-Philipp Müller [Wed, 18 Dec 2019 18:01:30 +0000 (18:01 +0000)]
mxfdemux: add support for Apple ProRes

4 years agoexamples: add test-roi for gst-msdk
Haihao Xiang [Wed, 27 Nov 2019 04:23:58 +0000 (12:23 +0800)]
examples: add test-roi for gst-msdk

Copied and pasted from gstreamer-vaapi and did a few changes for gst-msdk.

4 years agomsdkdec: support transform_meta virtual method
Haihao Xiang [Wed, 27 Nov 2019 07:16:17 +0000 (15:16 +0800)]
msdkdec: support transform_meta virtual method

Allow the base class to copy GstVideoRegionOfInterestMeta data to the
output buffer when calling gst_video_decoder_finish_frame

4 years agomsdkenc: set ROI region for msdk{h264, h265}enc
Haihao Xiang [Wed, 27 Nov 2019 08:00:59 +0000 (16:00 +0800)]
msdkenc: set ROI region for msdk{h264, h265}enc

A reconfig is needed when ROI is changed, otherwise the ROI parameters won't
take effect

4 years agomsdkenc: add set_extra_params virtual method
Haihao Xiang [Tue, 3 Dec 2019 02:48:21 +0000 (10:48 +0800)]
msdkenc: add set_extra_params virtual method

set_extra_params is added to allow sub class to add extra mfx parameters
for changed input frame or meta data

4 years agomsdkenc: add need_reconfig virtual method
Haihao Xiang [Thu, 28 Nov 2019 06:54:30 +0000 (14:54 +0800)]
msdkenc: add need_reconfig virtual method

need_reconfig is added to allow sub class requires a reconfig when
the input frame or the MetaData (e.g. GstVideoRegionOfInterestMeta)
attached to the input frame is changed.

4 years agod3d11h265dec: Fix wrong NoRaslOutputFlag setting
Seungha Yang [Mon, 13 Jan 2020 08:20:14 +0000 (17:20 +0900)]
d3d11h265dec: Fix wrong NoRaslOutputFlag setting

... and handle EOS and EOB nals.

Only the first CRA picture should be associated with NoRaslOutputFlag
as the comment in code.

4 years agopkgconfig: Remove unused substitution in uninstalled.pc.in
Nirbheek Chauhan [Sun, 12 Jan 2020 02:37:23 +0000 (08:07 +0530)]
pkgconfig: Remove unused substitution in uninstalled.pc.in

`@videolibdir@` isn't used anymore.

4 years agotests: Fix minor bugs in usage of config.h
Nirbheek Chauhan [Sun, 12 Jan 2020 02:19:47 +0000 (07:49 +0530)]
tests: Fix minor bugs in usage of config.h

4 years agoipcpipeline: Minimal fixes that allow building with MSVC
Nirbheek Chauhan [Sun, 12 Jan 2020 02:11:34 +0000 (07:41 +0530)]
ipcpipeline: Minimal fixes that allow building with MSVC

4 years agoipcpipeline: Rework compiler checks
Nirbheek Chauhan [Sat, 11 Jan 2020 09:17:13 +0000 (14:47 +0530)]
ipcpipeline: Rework compiler checks

`pipe()` isn't used since 15927b6511bc8304ae144a45c9fbfca88e5dd641,
and `socketpair()` from `#include <sys/socket.h>` is used only in the
examples. In practice, you can use probably also use anything that
allows you to create fd pairs, such as named pipes or anonymous pipes.

We use the cross-platform GstPollFD API in the plugin.

4 years agotimecodestamper: Add property to set the extra latency to introduce for waiting for...
Sebastian Dröge [Mon, 13 Jan 2020 15:10:39 +0000 (17:10 +0200)]
timecodestamper: Add property to set the extra latency to introduce for waiting for LTC timecodes

Default to 150ms instead of 8 frames, which seems to work in the
majority of cases.

4 years agotimecodestamper: Add some more debug output
Sebastian Dröge [Mon, 13 Jan 2020 10:54:35 +0000 (12:54 +0200)]
timecodestamper: Add some more debug output

4 years agod3d11memory: Always use native DXGI format if device support it
Seungha Yang [Sat, 11 Jan 2020 09:24:02 +0000 (18:24 +0900)]
d3d11memory: Always use native DXGI format if device support it

Use consistent memory layout between dxva and other shader use case.
For example, use DXGI_FORMAT_NV12 texture format instead of
two textures with DXGI_FORMAT_R8_UNORM and DXGI_FORMAT_R8G8_UNORM.

4 years agoRevert "d3d11: Add support for D3D11_USAGE_DYNAMIC"
Seungha Yang [Fri, 10 Jan 2020 11:44:19 +0000 (20:44 +0900)]
Revert "d3d11: Add support for D3D11_USAGE_DYNAMIC"

This reverts commit ddd13fc7c061a9873b181d0de32aaf9546e7d0af

Dynamic usage can reduce the number of copy per frame but make
things complicated and the benefit seems to not significant.
Also since we don't provide _map() method for the dynamic usage,
application cannot read buffers which make "last-sample" property
unusable in case of d3d11videosink.

4 years agoWebRTC: Support non-trickle ICE candidates in the SDP
Jan Schmidt [Sun, 12 Jan 2020 15:30:07 +0000 (02:30 +1100)]
WebRTC: Support non-trickle ICE candidates in the SDP

Add any ICE candidates from the SDP before adding pending
trickle ICE candidates to support non-trickle peers

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

4 years agod3d11: Don't register decoders if unavailable
Seungha Yang [Fri, 10 Jan 2020 15:01:55 +0000 (00:01 +0900)]
d3d11: Don't register decoders if unavailable

DXVA requires a hardware interface but may not be available,
such as in the case of VMs or when the GPU vendor does not provide a decoder interface.

4 years agod3d11decoder: Don't return not initialized object from _new() method
Seungha Yang [Fri, 10 Jan 2020 14:57:15 +0000 (23:57 +0900)]
d3d11decoder: Don't return not initialized object from _new() method

... and change some debug levels since initialization failure might not be fatal.

4 years agowaylandsink: Fix xdg_shell fullscreen mode
Shinya Saito [Thu, 22 Aug 2019 07:04:37 +0000 (16:04 +0900)]
waylandsink: Fix xdg_shell fullscreen mode

xdg_shell fullscreen mode doesn't work for committing
xdg_surface without configure acknowledgement.

In addition, we can't set different surface setting from
acknowledged config in this mode.

4 years agoh264parse: do not push wrong PTS with some raw files
Josep Torra [Mon, 11 Nov 2019 20:40:07 +0000 (12:40 -0800)]
h264parse: do not push wrong PTS with some raw files

Some raw h264 encoded files trigger the assignment of wrong PTS to buffers
when some SEI data is provided. This change prevents it to happen.

Also ensure this behavior is being tested.

4 years agotimecodestamper: Skip over invalid LTC timecodes immediately
Sebastian Dröge [Fri, 10 Jan 2020 11:08:38 +0000 (13:08 +0200)]
timecodestamper: Skip over invalid LTC timecodes immediately

4 years agotimecodestamper: Clean up old LTC timecodes on LTC discontinuity
Sebastian Dröge [Fri, 10 Jan 2020 09:40:54 +0000 (11:40 +0200)]
timecodestamper: Clean up old LTC timecodes on LTC discontinuity

We might have some old timecodes that are in the future now and have to
drop those to make sure that our queue is correctly ordered and we don't
have multiple timecodes for the same running time.

4 years agotimecodestamper: Fix waiting for the first video frame in case of live video input
Sebastian Dröge [Fri, 10 Jan 2020 09:33:28 +0000 (11:33 +0200)]
timecodestamper: Fix waiting for the first video frame in case of live video input

4 years agotimecodestamper: Fix up handling/queueing of LTC timecodes
Sebastian Dröge [Thu, 9 Jan 2020 15:41:55 +0000 (17:41 +0200)]
timecodestamper: Fix up handling/queueing of LTC timecodes

Directly read them out of the decoder as soon as we passed audio and
then store them in a queue that we handle internally together with their
timestamps. This cleans up memory management and gives us proper control
over the queue instead of guessing how the queue inside the LTC decoder
actually works and when it overflows.

4 years agotimecodestamper: Only allow requesting LTC audio pad in NULL/READY states
Sebastian Dröge [Thu, 9 Jan 2020 13:27:28 +0000 (15:27 +0200)]
timecodestamper: Only allow requesting LTC audio pad in NULL/READY states

And don't introduce any latency at all if not LTC audio pad was
requested.

4 years agotimecodestamper: In live mode wait correctly for the latency to pass
Sebastian Dröge [Thu, 9 Jan 2020 13:23:20 +0000 (15:23 +0200)]
timecodestamper: In live mode wait correctly for the latency to pass

And also introduce 6 instead of 2 frames of latency compared to the LTC
audio input as that seems to be an upper bound for how much the LTC
library is lagging behind.

4 years agotimecodestamper: Use the internal LTC timecode tracker instead of the last one we...
Sebastian Dröge [Thu, 9 Jan 2020 13:16:02 +0000 (15:16 +0200)]
timecodestamper: Use the internal LTC timecode tracker instead of the last one we retrieved

Otherwise we don't interpolate between LTC timecodes but only ever put
an LTC timecode on buffers once we actually received one.

4 years agodecklink: Silence no driver / no SO messages
Nicolas Dufresne [Thu, 9 Jan 2020 19:23:08 +0000 (14:23 -0500)]
decklink: Silence no driver / no SO messages

This g_once() is called everywhere, even in provider. This cause
spurious error when device monitor is used. Just silence or remove
the spurious logs.

4 years agohls: Check nettle version to ensure AES128 support
Seungha Yang [Fri, 10 Jan 2020 07:03:48 +0000 (16:03 +0900)]
hls: Check nettle version to ensure AES128 support

AES128 support was added since nettle version 3.0

../subprojects/gst-plugins-bad/ext/hls/gsthlsdemux.h:110:10: error: field ‘ctx’ has incomplete type
   struct CBC_CTX (struct aes128_ctx, AES_BLOCK_SIZE) aes_ctx;

4 years agoRevert "msdkdec: make sure to use video memory on Linux"
Haihao Xiang [Mon, 6 Jan 2020 04:59:36 +0000 (12:59 +0800)]
Revert "msdkdec: make sure to use video memory on Linux"

Commit a1584b6 caused big performance drop if the downstream element
is not a msdk element because it is very slow to read data from video
memory directly.

This reverts commit a1584b6f99caaf61812ac6a9654ec0e6da8240da.

4 years agotests: d3d11colorconvert: Add test cases for visual validation
Seungha Yang [Thu, 9 Jan 2020 12:00:47 +0000 (21:00 +0900)]
tests: d3d11colorconvert: Add test cases for visual validation

By default new test cases are disabled since it might be timed out
or test environment might not have render device.

4 years agod3d11colorconverter: Handle P016_LE format
Seungha Yang [Thu, 9 Jan 2020 10:39:59 +0000 (19:39 +0900)]
d3d11colorconverter: Handle P016_LE format

P016 format is no different than P010. Not much things to add code.

4 years agod3d11colorconverter: Add support for YUV to YUV conversion
Seungha Yang [Thu, 9 Jan 2020 10:32:38 +0000 (19:32 +0900)]
d3d11colorconverter: Add support for YUV to YUV conversion

4 years agod3d11colorconverter: Add support for RGB to YUV conversion
Seungha Yang [Wed, 8 Jan 2020 14:09:51 +0000 (23:09 +0900)]
d3d11colorconverter: Add support for RGB to YUV conversion

... and remove code for RGBx since it's not supported format
by our d3d11 implementation for now.

4 years agod3d11format: Remove invalid format from supported format list
Seungha Yang [Thu, 9 Jan 2020 02:14:47 +0000 (11:14 +0900)]
d3d11format: Remove invalid format from supported format list

4 years agodecklinkvideosink: Always configure 10 bit YUV for VANC frames
Sebastian Dröge [Wed, 8 Jan 2020 05:42:21 +0000 (07:42 +0200)]
decklinkvideosink: Always configure 10 bit YUV for VANC frames

If 8 bit are required by the device/mode then it will be converted internally
by the SDK, but the SDK won't automatically convert from 8 to 10 bit. As
such, always use 10 bit VANC.

Some devices require configuring also a 10 bit video format when using
10 bit VANC is required but those would fail regardless and the
application would have to configure the correct video format.

With newer versions of the SDK this information can be retrieved via the
BMDDeckLinkVANCRequires10BitYUVVideoFrames flag but we don't use a new
enough SDK version yet to extract this information.

4 years agowebrtc: Unmap all non-binary buffers received via the datachannel
Sebastian Dröge [Tue, 7 Jan 2020 18:17:12 +0000 (20:17 +0200)]
webrtc: Unmap all non-binary buffers received via the datachannel

Previously they were only unmapped in case of binary data, causing all
of them to be leaked.

4 years agozbar: remove useless conditional on passthrough
Stéphane Cerveau [Tue, 7 Jan 2020 09:05:33 +0000 (10:05 +0100)]
zbar: remove useless conditional on passthrough

seen that passthrough is never set for this element, no need
to allow to remove the 'transform' call

4 years agozxing: initial plugin revision
Stéphane Cerveau [Fri, 27 Sep 2019 21:02:38 +0000 (23:02 +0200)]
zxing: initial plugin revision

Status:
- scan QR code with low resolution
- Scan barcode with high resolution

4 years agotests: add h26xparse HDR SEI test
Stéphane Cerveau [Fri, 3 Jan 2020 17:14:48 +0000 (18:14 +0100)]
tests: add h26xparse HDR SEI test

Detect caps according to MDCV + CLLI SEI message

4 years agotest: add h265parse test
Stéphane Cerveau [Wed, 18 Dec 2019 09:05:05 +0000 (10:05 +0100)]
test: add h265parse test

4 years agoh26xparse: Handle state change on IDR first slice
Stéphane Cerveau [Tue, 17 Dec 2019 11:08:34 +0000 (12:08 +0100)]
h26xparse: Handle state change on IDR first slice

As the H265/H264 bitstream can support multiple slices,
mastering_display_info_state and content_light_level_state
should be changed only on first slice segment.

Fix #1152

4 years agoh265parse: use same algo for MDCV and CLL SEI management
Stéphane Cerveau [Thu, 5 Dec 2019 15:48:05 +0000 (16:48 +0100)]
h265parse: use same algo for MDCV and CLL SEI management

4 years agoh264parser: add MDCV and CLL SEI message parsing
Stéphane Cerveau [Thu, 28 Nov 2019 11:59:46 +0000 (12:59 +0100)]
h264parser: add MDCV and CLL SEI message parsing

Allow to parse SEI message for:
- mastering display colour volume
- Light level infomation

Set to caps if necessary.

Fix #958

4 years agodash: Remove spurious condition check and remove unused debug category
Seungha Yang [Mon, 6 Jan 2020 16:40:57 +0000 (01:40 +0900)]
dash: Remove spurious condition check and remove unused debug category

Note that uppercase debug category names are used for
core modules and should be redefined in lowercase for plugins if necessary.

4 years agofakevideosink: Use our pad template to create pad
Thibault Saunier [Mon, 6 Jan 2020 19:30:36 +0000 (16:30 -0300)]
fakevideosink: Use our pad template to create pad

4 years agod3d11: Add support for Universal Windows Platform
Seungha Yang [Mon, 30 Dec 2019 09:58:59 +0000 (18:58 +0900)]
d3d11: Add support for Universal Windows Platform

Initial UWP support via new window (CoreWindow and SwapChainPanel) implementation.

4 years agod3d11decoder: Fix build on non-desktop target
Seungha Yang [Tue, 31 Dec 2019 04:36:59 +0000 (13:36 +0900)]
d3d11decoder: Fix build on non-desktop target

Although the target platform of D3D11 decoding API are both desktop and UWP app,
DXVA header is blocked by "WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)"
which is meaning that that's only for desktop app.
To workaround this inconsistent annoyingness, we need to define WINAPI_PARTITION_DESKTOP
regardless of target WinAPI partition.

4 years agomsdkvp9enc: fix 10bit encoding
Haihao Xiang [Wed, 25 Dec 2019 05:21:11 +0000 (13:21 +0800)]
msdkvp9enc: fix 10bit encoding

The codec profile should be consistent with the frame fourcc code, this
fixes pipeline below:

gst-launch-1.0 videotestsrc ! \
video/x-raw,width=320,height=240,format=P010_10LE ! msdkvp9enc ! \
fakesink

4 years agomsdkvp9enc: fix width and height
Haihao Xiang [Wed, 25 Dec 2019 02:51:36 +0000 (10:51 +0800)]
msdkvp9enc: fix width and height

The frame width and height is rounded up to 128 and 32 since commit
8daac1c, so the width, height for initialization should be rounded up to
128 and 32 too because the MSDK VP9 encoder will do some check on width
and height.

Sample pipeline:
gst-launch-1.0 videotestsrc ! \
video/x-raw,width=320,height=240,format=NV12 ! msdkvp9enc ! fakesink

4 years agomsdk: make sure the found response meets the request
Haihao Xiang [Fri, 3 Jan 2020 07:27:30 +0000 (15:27 +0800)]
msdk: make sure the found response meets the request

Otherwise the re-used msdk response doesn't have enough frames so it is
possible the pipeline will be broken

4 years agomsdkenc: renegotiate when video info changes
Julien Isorce [Thu, 26 Dec 2019 21:31:50 +0000 (13:31 -0800)]
msdkenc: renegotiate when video info changes

Renegotiation was implemented for bitrate change. We can re-use
the same sequence when video info changes except that this can be
executed right away when receiving the new input format. I.e. no
need to wait for the next call to handle_frame.