Commit graph

674 commits

Author SHA1 Message Date
Seungha Yang b74da32b5c Revert "vah264enc: Disable derived image support"
This reverts commit 0011feb0d6.

The commit caused performance-wise regression for some platforms

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2111>
2022-04-04 21:18:13 +00:00
Tong Wu 4e97cc24a7 msdk: use mfxU32 instead of uint32_t
Msdk should use mfx variables defined in mfxdefs.h. Replace uint32_t
with mfxU32.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2091>
2022-04-04 20:28:25 +00:00
Stéphane Cerveau e7f198a898 bad: examples: fix unused res warning
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2095>
2022-04-04 16:27:45 +00:00
Johan Sternerup 1842ffc906 webrtc: Improve robustness of nice agent signal handlers
NiceAgent and it's associated thread is alive for as long as
GstWebRTCICE is alive so make sure any signal handlers connected to
NiceAgent do not access data that is deleted earlier.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2073>
2022-04-04 02:10:35 +00:00
Seungha Yang 5ed8e416fe nvcodec: Fix typos
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2107>
2022-04-03 22:12:33 +09:00
Seungha Yang 9b5fe81d01 nvencoder: Fix operator overloading
GUID equality check was inverted

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2107>
2022-04-03 22:09:19 +09:00
Tim-Philipp Müller 296094508e libs: va: make sure va-enumtypes.h is generated before it's used
Need to add a dep for the generated header file to the dependency()
so that it gets generated before anyone tries to #include files
from it (which may happen before the actual lib is built because
that's only needed when stuff is linked together later).

See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2057#note_1323236
and CI build failures in https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2096

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2103>
2022-04-02 18:58:52 +00:00
Seungha Yang 0011feb0d6 vah264enc: Disable derived image support
Behavior of derived image seems to be platform dependent and
it's buggy in some cases.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1110
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2086>
2022-04-02 07:04:03 +00:00
He Junyan 976356e159 va: h264enc: Do not use USAGE_HINT_ENCODER for input pool.
It seems that the VA_SURFACE_ATTRIB_USAGE_HINT_ENCODER is used only
for the recon surfaces, if we set this flags for input raw surfaces,
the alignment is wrong and we get broken result.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2100>
2022-04-02 06:23:03 +00:00
Nicolas Dufresne 8d9e649570 va: Fix printf format modifier for drm modifiers
DRM modifiers are 64bit, the printf modifier is platform dependant. Use
the G_GINT64_MODIFIER macro to make this printf portable.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2102>
2022-04-01 20:09:36 +00:00
Xavier Claessens a40634eebe Use gmodule-no-export-2.0
We don't need `-Wl,--export-dynamic`, that's used only for executables
that needs to export an API to be used by plugins they load.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2031>
2022-04-01 16:32:17 +00:00
Xavier Claessens b004464ac6 Remove glib and gobject dependencies everywhere
They are part of gst_dep already and we have to make sure to always have
gst_dep. The order in dependencies matters, because it is also the order
in which Meson will set -I args. We want gstreamer's config.h to take
precedence over glib's private config.h when it's a subproject.

While at it, remove useless fallback args for gmodule/gio dependencies,
only gstreamer core needs it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2031>
2022-04-01 16:32:17 +00:00
Xavier Claessens f270f9e974 Fix cross build with mingw32
At least on Ubuntu 20.04 the x86_64-w64-mingw32-gcc toolchain defaults
to WinXP. We require at least Vista for FILE_STANDARD_INFO.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2022>
2022-04-01 15:52:28 +00:00
Seungha Yang b5ed0eb4b0 qsvencoder: Add support for VA memory
Use VA allocator and buffer pool implementation for zero-copy
encoding with upstream VA elements

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2030>
2022-03-31 20:48:24 +00:00
Seungha Yang 9c44b32c21 qsv: Use pipeline's VA context
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2030>
2022-03-31 20:48:24 +00:00
Víctor Manuel Jáquez Leal 6d2f57b6c7 libs: va: add VA allocator parameter for derived images usage.
Added GstVaFeature enum type, and new parameter for VA allocator's
set_format() and get_format(). Also added a new parameter in VA pool
gst_va_pool_new_with_config() and
gst_buffer_pool_config_set_va_allocation_params().

This new parameter will define if derived images will by used for
buffer mapping.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2057>
2022-03-31 14:14:45 +00:00
Sangchul Lee a801d6dd63 webrtcstats: Unify 'packets-lost' data type to int64
Previously, 'packets-lost' member of RTCReceivedRtpStreamStats had
a value of G_TYPE_INT from rtpsource or a value of G_TYPE_UINT64
from rtpjitterbuffer.
Because of the negative value of estimated amount of packets lost
in rtpsource as well as the description in
https://www.w3.org/TR/webrtc-stats/#dom-rtcreceivedrtpstreamstats
it is fixed to set this value with G_TYPE_INT64.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2049>
2022-03-31 05:37:39 +00:00
Víctor Manuel Jáquez Leal 8759014f4c va: encoder: Remove unused allocation config.
Since it's also done inside of gst_va_pool_new_with_config().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2072>
2022-03-30 22:18:06 +00:00
Seungha Yang 6451a13b0b vadisplay: Add description readonly property
Expose description of vendor for user information, similar to
the description property of d3d11device.
Also, set description and DRM device path on GstContext structure
so that user can read them and it will be printed on terminal
when gst-launch-1.0 is used

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2064>
2022-03-30 21:41:27 +00:00
Víctor Manuel Jáquez Leal 602d249847 va: Don't expose internal classes.
VA allocators and pools classes don't need to be exposed as external
symbols.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2070>
2022-03-30 11:36:03 +02:00
Haihua Hu 630acb40f0 gstplay: don't print error log in warning_cb
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2069>
2022-03-30 08:12:05 +00:00
Víctor Manuel Jáquez Leal 599257bf10 vapostproc: Build classification dynamically.
By default, the classification is
"Converter/Filter/Colorspace/Scaler/Video/Hardware", but if VA
post-processor driver supports either color balance, skin tone
enhancement, sharpening or noise reduction, "Effect" is added.

Thus, if vapostproc ranking is raised, it can be chosen by
autovideosink.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2066>
2022-03-30 04:24:35 +00:00
Matthew Waters 041eee6c2e webrtc: produce stats for all relevant streams
Instead of only using the last ssrc that was pushed into a sink pad.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1664>
2022-03-29 23:55:41 +00:00
Matthew Waters 04de1a161f webrtc: avoid different versions of gnu-indent always wanting to change !!
Add some sneaky parenthesis to avoid always having to use git commit -n
or revert out hunk of the change.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1664>
2022-03-29 23:55:41 +00:00
Matthew Waters 5bfe36746a webrtc: implement initial simulcast fec/rtx usage
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1664>
2022-03-29 23:55:41 +00:00
Matthew Waters 5741ee38e0 webrtc/datachannel: fix use-after-free in sctp state notification
g_signal_disconnect*() doesn't stop any existing callbacks from running
which means that if the notify::state callback is in progress in one
thread and the data channel object is finalize()ed in another thread,
then there could be a use-after-free trying lock the data channel
object.

We can't reasonably use a GWeakRef as we don't have a 'parent' object to
free the GWeakRef after the data channel is finalized.  This is also
complicated by the fact that the application can hold a reference to the
data channel object that would live beyond the lifetime of webrtcbin
itself.

We solve this by implementing a ghetto weak-ref solution internally with
a list of outstanding data channels.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1664>
2022-03-29 23:55:40 +00:00
Matthew Waters 831b34fb43 tests/webrtc: fix a use-after-free in test_data_channel_close
g_object_weak_ref() is not thread-safe and the data channel object's
refs/unrefs can happen on multiple threads.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1664>
2022-03-29 23:55:40 +00:00
Matthew Waters f11e0e76c6 tests/webrtc: fix a race in the tests related to state tracking
If things progress fast enough, some state changes may not be seen be
the waiting code.

Fix by:
1. keeping a list of all the state changes
2. waiting checks each entry and if the relevant state is found, all
   states up to and including then are removed.

This ensures that any waits will see all the state sets.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1664>
2022-03-29 23:55:40 +00:00
Matthew Waters 5257093268 tests/webrtc: factor out src pad property checking to a separate function
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1664>
2022-03-29 23:55:40 +00:00
Matthew Waters 2377f8b3f2 webrtcbin: initial support for sending and receiving simulcast streams
Input (sink pads) is the already-ssrc-muxed stream with the relevant rtp
sdes header extensions already applied:
  - mid
  - stream-id
  - repaired-stream-id

Output (src pads) have the pads separated into individual ssrc's as
that's what rtpbin gives us.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1664>
2022-03-29 23:55:40 +00:00
Matthew Waters 75b23d646a tests/webrtc: test for enabled bundled fec/rtx
Doesn't actually check that any fec/rtx happens, just that the pipeline
is vaguely sane and doesn't error.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1664>
2022-03-29 23:55:40 +00:00
Matthew Waters 699739c130 webrtcbin: support multiple received streams for a single mline
Each rtpbin exposed recv_src pad is now exposed as webrtcbin src_%u pad
now with no meaining applied to the value of %u.  Previously this used
to mean the mline in the SDP.  If this is is still required, then the
transceiver can be retrieved from the pad and the "mlineindex" property
from the transciever.  The "mid" is also retrievable from the
transceiver.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1664>
2022-03-29 23:55:40 +00:00
Matthew Waters e28c45fd05 webrtc: explicitly error out in a couple of renegotiation cases
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1664>
2022-03-29 23:55:40 +00:00
Matthew Waters 318a639e43 webrtc/transportstream: add debug category
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1664>
2022-03-29 23:55:40 +00:00
Matthew Waters e18ee04cd2 tests/webrtc: also check valid mline for srcpad codec-preferences negotiation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1664>
2022-03-29 23:55:40 +00:00
Matthew Waters 2aeca9ed84 webrtcbin: don't name src pads based on the mline specifically anymore
Naming based on the mline doesn't really work with e.g. simulcast
scenarios.

It is entirely possible to retrieve the transceiver and then the mline
from that if that is so required.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1664>
2022-03-29 23:55:40 +00:00
Matthew Waters 8a65fa40c7 webrtc/tests: print the correct media idx on error
Instead of the attribute index

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1664>
2022-03-29 23:55:40 +00:00
Matthew Waters b153ffdd56 webrtc/tests: give slightly better names to the dot file dumps
Don't use printf-specifiers with g_strconcat().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1664>
2022-03-29 23:55:40 +00:00
Matthew Waters cda81bdb1e webrtcbin: improve some debugging output
- Put human readable names into debug strings.
- Demote some frequent rtpbin signal logging
- Don't use GST_PTR_FORMAT in g_set_error()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1664>
2022-03-29 23:55:40 +00:00
Matthew Waters c02c8a85ce webrtcbin: silence spurious warning when creating answer transceiver
When creating a transceiver when creating an answer, the media kind of the
transceiver was never set correctly initially.  This would lead to a
GST_WARNING being produced about changin a transceiver's media kind.

Fix by retrieving the GstSDPMedia kind from the offer instead as the answer
GstSDPMedia has not been set as the answer caps have not been chosen yet.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1664>
2022-03-29 23:55:40 +00:00
Matthew Waters 246374c4e7 tests/webrtc: always use a unique SSRC for each stream
Will become more relevant with mid/rid->ssrc mappings

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1664>
2022-03-29 23:55:40 +00:00
Matthew Waters 533d4937fe webrtcbin: add a specific find_transceiver_by_mid function
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1664>
2022-03-29 23:55:40 +00:00
Matthew Waters 79d58200c9 webrtcbin: explicitly use a variable for the rtp session idx
Slightly clearer in meaning.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1664>
2022-03-29 23:55:40 +00:00
Matthew Waters 9a758d78a9 webrtcbin: support using an a=mid value from the sink/transceiver caps
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1664>
2022-03-29 23:55:40 +00:00
Víctor Manuel Jáquez Leal 400faf7361 va: Set <gst/va/gstva.h> as library single point entry header.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2048>
2022-03-29 19:48:30 +00:00
He Junyan 990fbb3b52 va: Move allocators and pool objects into gstva library.
In order to other plugins use gstva objects, such as allocators and buffer
pools, this merge request move them from the va plugin to the gstva library.

This objects are not exposed in <gst/va/gstva.h> since they are not expected
to be used by users, only by plugin implementators.

Because of the surface copy design, which is used to implement allocator's
mem_copy() virtual function, depends on the vafilter, which is kept inside
the plugin, memory copy through VAPosproc is disabled and removed temporarly.

Also added some missing parameter validation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2048>
2022-03-29 19:48:30 +00:00
He Junyan 53783eab6c va: Move the video format functions into gstlibva.
Untabifying header file.

The logging category was moved from the plugin generic category to
the display category. It can argue that video formats hacks are
display dependant.

Added validations for input parameters.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2048>
2022-03-29 19:48:30 +00:00
Seungha Yang 886cfecd36 qsvencoder: Add support for dynamic bitrate update
... and add more encoding options.

QSV API supports dynamic bitrate change without IDR insertion.
That's more efficient way of runtime encoding option update
than starting from new sequence with IDR per bitrate option change.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2039>
2022-03-29 15:52:58 +00:00
Seungha Yang a8d7b10cc4 qsvh265enc: Add missing gop-size property
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2039>
2022-03-29 15:52:58 +00:00
Seungha Yang 1a7b23dc02 qsv: Fix mfxFrameAllocator::Lock for encoder
Only read map is possible for encoder input system memory

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2039>
2022-03-29 15:52:58 +00:00