Commit graph

27252 commits

Author SHA1 Message Date
Doug Nazar
8b8428aec2 dtls: Add ability to set custom GstFlowReturn on callback error
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2229>
2021-05-19 03:21:58 +00:00
Olivier Crête
3bdf1e691e webrtc: Remove reundundant context object in transportsendbin
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2260>
2021-05-18 20:26:38 -04:00
Olivier Crête
51821644ba webrtc: Wait until ICE is connected to start DTLS handshake process
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2260>
2021-05-18 20:18:28 -04:00
Olivier Crête
b6965e9906 webrtcbin: Remove pad probe on nicesink
This pad probe is no longer necessary, libnice now drops
all buffers before the stream is connected. This pad problem
also caused deadlocks in some situations.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2260>
2021-05-18 19:08:48 -04:00
Olivier Crête
28bd479ea2 kate: Initialize debug categories
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2258>
2021-05-18 13:22:49 +00:00
Víctor Manuel Jáquez Leal
d09aae68a5 libs: va: Documentation and annotations.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2196>
2021-05-18 12:15:36 +02:00
He Junyan
c335f00d62 examples: va: Update the VA examples because of the new va lib.
Because we introduce the new va lib, the va examples need to include
new header files and add more library linkage.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2196>
2021-05-18 12:15:36 +02:00
Víctor Manuel Jáquez Leal
031b77ce97 libs: va: display_wrapper: Use gpointer for VADisplay.
In order to be coherent along all the implementation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2196>
2021-05-18 12:15:36 +02:00
He Junyan
e0915ce982 libs: va: Move the VA common logic as a lib.
The VA acceleration now has more usages in linux-like platforms,
such as the MSDK. The different plugins based on the VA acceleration
need to share some common logic and types. We now move the display
related functions and types into a common va lib.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2196>
2021-05-18 12:15:30 +02:00
mkba
19b8d79e7d msdk: add profile main-still-picture for hevc encoder
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2253>
2021-05-18 01:29:55 +00:00
Seungha Yang
5c4a13b5a0 interlace: Fix too small buffer size error
Even though input/output resolutions are identical there, default
buffer size of progressive and interleaved formats could be different
because we are rounding up height of all plane of interlaced frame
to be multiple of two.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2244>
2021-05-17 08:49:30 +00:00
Haihao Xiang
bda11a3e73 msdk: use MFXJoinSession() to join the parent and child sessions
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1503>
2021-05-17 01:58:24 +00:00
Haihao Xiang
cd3a3534c4 msdk: use a new method to create mfx session when using oneVPL dispatcher
In oneVPL, MFXLoad() and MFXCreateSession() are required to create a
workable mfx session[1]

[1] https://spec.oneapi.com/versions/latest/elements/oneVPL/source/programming_guide/VPL_prg_session.html#onevpl-dispatcher

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1503>
2021-05-17 01:58:24 +00:00
Haihao Xiang
beda9a7333 msdk: allow user build this plugin against MFX version 2.2+ (oneVPL)
Intel oneVPL SDK (oneVPL) is a successor to Intel Media SDK (MSDK)[1].
User may use -Dmfx_api=MSDK or -Dmfx_api=oneVPL to specify the required
SDK when building this plugin. If the SDK is not specified, meson will
try MSDK firstly, then oneVPL if MSDK is not available

Version 2.2+ is required in this patch because pkg-config file was not
provided officially before version 2.2

[1]https://spec.oneapi.com/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1503>
2021-05-17 01:58:24 +00:00
Haihao Xiang
5e02cec1c1 msdkvp9dec: do not include mfxvp9.h
The VP9 related definitions in mfxvp9.h are available under the
condition of 'MFX_VERSION >= MFX_VERSION_NEXT', which implies that these
definitions are never used in a public release.

This is in preparation for oneVPL support because mfxvp9.h was
removed from oneVPL

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1503>
2021-05-17 01:58:24 +00:00
Haihao Xiang
967c835ea6 msdk: don't load user plugins for MFX version 2.0+
MFX version 2.0+ no longer supports user plugins, please refer to the
links for details

https://spec.oneapi.com/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals
https://github.com/oneapi-src/oneVPL

This is in preparation for oneVPL support

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1503>
2021-05-17 01:58:24 +00:00
Haihao Xiang
73cd763b01 msdk: exclude the audio code for MFX version 2.0+
MFX version 2.0+ no longer supports audio functions, please refer to the
links below for details

https://spec.oneapi.com/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals
https://github.com/oneapi-src/oneVPL

This is in preparation for oneVPL support

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1503>
2021-05-17 01:58:24 +00:00
Nicolas Dufresne
e7b962d9b5 alphacombine: Ignore all events coming from the alpha_pad
As per usage of this element, everything from this pad is a
duplicate. Instead of implemented needless aggregation, simply
drop all events from this pad and let the one from the main stream
passthrough. Also stop proxying some queries from the alpha pad_too.

This fixes racy test failure:
- validate.file.playback.scrub_forward_seeking.opus_vp9-alpha_webm

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2247>
2021-05-14 14:11:39 -04:00
Nicolas Dufresne
0484d658a8 codecalphademux: Do not set a GstFlowReturn from a boolean
This was a small overlook, gst_pad_send_event() returns a boolean,
so setting it into ret could confuse the flow combiner. Though,
it didn't bug, since both 0 and 1 are success (though 1 being
undefined).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2247>
2021-05-14 14:11:39 -04:00
Nicolas Dufresne
35775f1aec codecalphademux: Remove eos flow return workaround
It turns out that downstream returning OK after EOS is a bug in
multiqueue. As we moved to queue, we no longer have this issue.
Let's keep the code clean and just assuming that downstream will
keep returning EOS and allow convergence of flow.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2247>
2021-05-14 14:11:39 -04:00
Olivier Crête
761206291b openh264: Don't use GOnce for ABI check
It turns out the value used for g_once_* APIs can't be
zero. And this is a very cheap check, so let's just do it every time.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2240>
2021-05-13 21:40:02 +00:00
Olivier Crête
8b595e7c8b webrtc test: Print content of error GstMessage
Makes it easier to interpret the result of the CI!

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2183>
2021-05-13 16:37:31 -04:00
Olivier Crête
78d2d6cf6f webrtcbin tests: Add test for intersection src pad caps
This checks that the codec preferences are intersected also with what
the src pad can handle.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2183>
2021-05-13 16:37:31 -04:00
Olivier Crête
cc556452ce webrtc test: Add explicit test clock
This way the test clock is not linked to the multiple harnesses

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2183>
2021-05-13 15:05:00 -04:00
Olivier Crête
f34be8a3bd webrtcbin: Intersect answer with codec prefs & capabilities
In case the local capabilities changed since the last negotiaton,
we need to re-intersect and see if the result would be different.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2183>
2021-05-13 15:05:00 -04:00
Olivier Crête
3065ac49fb webrtcbin: Ignore current caps for codec negotiation
On the sink pad, we want the caps of the current stream, those
are the "received_caps" field. If we haven't received caps yet, then
we only care about the caps that the next element can accept, that is
the caps from the peer pad (and the preferences). Otherwise, we prevent
re-negotiation to a better codec when possible.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2183>
2021-05-13 15:05:00 -04:00
Olivier Crête
4bb94c6970 webrtcbin: Remove dead code
The function is only called to create an offer, so no
need to pass the offer parameter and then check it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2183>
2021-05-13 15:05:00 -04:00
Olivier Crête
2aa7efedd3 webrtc test: Add test for codec preferences negotiation
Validate that it does the intersection with the caps from
the sink pad and rejects the offer creation otherwise.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2183>
2021-05-13 15:05:00 -04:00
Olivier Crête
f6345b4b03 webrtcbin: Refactor codec preference retrieval
Now intersect against pads on both sides if they are available.
If the intersection fails, we now just reject the creation of the offer
or answer as it means that the codec_preferences are too restrictive or
that the caps on both sides the webrtcbin are not compatible.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2183>
2021-05-13 15:05:00 -04:00
Olivier Crête
48f4498801 webrtcbin: Intersect codec preferences with caps from pads
When creating an offer or an answer, also take into account
the caps on the pads as well as the codec preferences when both are set.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2183>
2021-05-13 15:05:00 -04:00
Olivier Crête
70befc0b21 webrtcbin: Implement caps queries on sinkpad based on codec preferences
Also includes a unit test.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2183>
2021-05-13 15:05:00 -04:00
Olivier Crête
dc6655542d webrtcbin: Hold transceiver lock when accessing codec_preferences
This is required to allow the applications to modify the preferences.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2183>
2021-05-13 15:05:00 -04:00
Olivier Crête
e9f14ed117 webrtcbin: Hold lock while accessing the codec preferences
They could be changed at runtime by the application, so take the lock
when modifying them.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2183>
2021-05-13 15:05:00 -04:00
Olivier Crête
6a3a62abae webrtcbin tests: Use properties to access the inside of the transceiver object
This will allow hiding the insides from unsafe application access.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2183>
2021-05-13 15:05:00 -04:00
Olivier Crête
4c3270409d webrtc rtptransceiver: Implement "codec-preferences" property
This allows safer access to the internals of the codec-preferences

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2183>
2021-05-13 15:05:00 -04:00
Olivier Crête
97a78a903a webrtc rtptransceiver: Implement "kind" property
Implement the property as read-only to follow the WebRTC spec

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2183>
2021-05-13 15:05:00 -04:00
Olivier Crête
5fd0ee3227 webrtc rtptransceiver: Implement "current-direction" property
Implement the property as read-only to follow the WebRTC spec

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2183>
2021-05-13 15:05:00 -04:00
Olivier Crête
7e7678f4cb webrtc rtptransceiver: Implement "mid" property
Implement the property as read-only to follow the WebRTC spec

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2183>
2021-05-13 15:05:00 -04:00
Nicolas Dufresne
c63b2f2712 alphadecodebin: Use normal queues instead of multiqueue
The multiqueue was too flexible for our need, allowing to queue passed
the configured threshold. It also didn't work well when trying to
propagate EOS flow return.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2238>
2021-05-13 14:38:47 +00:00
Nicolas Dufresne
1229257ad4 alphacombine: Implement flow return propagation
The EOS handling was not the problem way. Instead of this, implement
proper prorogation of the flow return for the alpha chain function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2238>
2021-05-13 14:38:47 +00:00
Nicolas Dufresne
ea08442699 codecalphademux: Fix handling of flow combine
As the alphacombine is simplified to received matching pair of buffers,
we can't just stop streaming when we receive EOS from downstream. Due
to usage of queue, the moment we get this return value may differ.

Though, by continuing pushing, we override the last_flowret on the pad
which can make us miss that we effectively can combine all flow into
EOS.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2238>
2021-05-13 14:38:47 +00:00
Thibault Saunier
61a04cf51f testbinsrc: Handle setting URI on the fly
Reusing existing streams when possible

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2210>
2021-05-13 02:03:57 +00:00
Bing Song
711008674b transcoding: add encoding target for TS.
Add encoding target for streamming.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1965>
2021-05-13 01:33:30 +00:00
Johan Sternerup
caefc3a831 webrtcbin: Add unit test for closing of data channels
Add test for verifying that the data channel "close" action signal
triggers an SCTP_RESET_STREAMS request that is propagated to the other
side and eventually leads to both sides closing properly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2186>
2021-05-12 03:02:27 +00:00
Johan Sternerup
4d514abfd6 webrtcbin: Fix deadlock when receiving new sctp stream
When receiving an sctp message for a stream that not yet has an
sctpdec pad associated with it means we end up in
_on_sctpdec_pad_added. At this point we're holding the sctpassocation
lock. Then it's not possible to take the pc_lock because then code
executing under the pc_lock (which means anything in the webrtc
thread) may not take the sctpassociation lock. For example, running
the data channel close procedure from the webrtc thread means we
eventually end up sending a SCTP_RESET_STREAMS packet which needs to
grab the sctpassociation lock.

This means _on_sctpdec_pad_added simply cannot take the pc_lock and
also it is not possible to postpone the channel creation as we need to
link the pads right there. The solution is to introduce a more
granular dc_lock that protects only the things that needs to be done
to create the datachannel.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2186>
2021-05-12 03:02:27 +00:00
Johan Sternerup
8dbdfad914 webrtcbin: Support closing of data channels
Support for closing WebRTC data channels as described in RFC
8831 (section 6.7) now fully supported. This means that we can now
reuse data channels that have been closed properly. Previously, an
application that created a lot of short-lived on-demand data channels
would quickly exhaust resources held by lingering non-closed data
channels.

We now use a one-to-one style socket interface to SCTP just like the
Google implementation (i.e. SOCK_STREAM instead of SOCK_SEQPACKET, see
RFC 6458). For some reason the socket interface to use was made
optional through a property "use-sock-stream" even though code wasn't
written to handle the SOCK_SEQPACKET style. Specifically the
SCTP_RESET_STREAMS command wouldn't work without passing the correct
assocation id. Changing the default interface to use from
SOCK_SEQPACKET to SOCK_STREAM now means we don't have to bother about
the association id as there is only one association per socket. For
the SCTP_RESET_STREAMS command we set it to SCTP_ALL_ASSOC just to
match the Google implementation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2186>
2021-05-12 03:02:27 +00:00
Nicolas Dufresne
b884bcb93e vp9parse: Manually fixate codec-alpha field
This is a newly introduced field, and we interpret it as false when missing in
the caps. Otherwise, a simple capsfilter will just add the missing field and
keep going, despite the upstream caps being a superset.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2199>
2021-05-11 16:06:56 -04:00
Nicolas Dufresne
e08c0803e1 doc: codecalpha: Add plugin documentation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2199>
2021-05-11 16:06:56 -04:00
Nicolas Dufresne
69ec933605 doc: Add codecalpha plugin to the plugins cache
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2199>
2021-05-11 16:06:56 -04:00
Nicolas Dufresne
ba4053a2b9 alphadecodebin: Add wrappers to decode VP8/VP9 alpha
This includes base class with wrappers bin that will create a static
pipeline capable of handling the VP8/VP9 alpha channel decoding
using two instances of vp8/vp9dec element each.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2199>
2021-05-11 16:06:56 -04:00