Commit graph

84 commits

Author SHA1 Message Date
Mengkejiergeli Ba 40d559adcf msdkenc: fix vp9enc initialization fail
MediaSDK does not support to handle extbuff with id
MFX_EXTBUFF_VIDEO_SIGNAL_INFO for mjpegenc and vp9enc. Hence, need to
exclude mjpeg and vp9 when passing color properties to MediaSDK during
msdkenc initialization.

Fix issue: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/764

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1101>
2021-10-12 03:45:41 +00:00
Seungha Yang 1bf237e767 examples: d3d11: Add a desktop capture example
... with d3d11 desktop capture device provider

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1103>
2021-10-11 15:21:26 +00:00
Seungha Yang 4b85704b88 d3d11: Add device provider for d3d11desktopdupsrc
... and add support for multi-GPU/multi-monitor

By using newly added "monitor-handle" property, user can specify a
monitor to be captured via HMONITOR handle.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1673
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1103>
2021-10-11 15:21:26 +00:00
Stéphane Cerveau 2200a3dbcd ttml: fix log init
The log system should be init before calling a log

Fix regression after:

https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2038

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1112>
2021-10-11 15:23:08 +02:00
Víctor Manuel Jáquez Leal 1cfae69bc9 tests: va: Add VA buffer copy tests.
It should only work for raw buffers, but fails on dmabuf since it
should have a drm modifier.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1023>
2021-10-10 17:03:29 +00:00
Víctor Manuel Jáquez Leal 35575e7b11 va: allocator: dmabuf: Use GstVaSurfaceCopy, if possible.
If dmabuf-based buffer to copy contains only one memory, and there are
memories available in the allocator's pool, it's possible a fast
memory copy using GstVaSurfaceCopy, regardless the drm modifier.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1023>
2021-10-10 17:03:29 +00:00
Víctor Manuel Jáquez Leal cf751d54a9 va: allocator: Use GstVaSurfaceCopy.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1023>
2021-10-10 17:03:29 +00:00
Víctor Manuel Jáquez Leal ffa2522fc0 va: Add GstVaSurfaceCopy class.
This new class is a helper for fast/tricky copy of surfaces. First it
tries to copy using the function vaCopy in libva 1.12. If it fails, or
it's not available, a GstVaFilter is tried to be instantiated with the
allocator's parameters, and if succeed, it's used for copying the
source surface.

This is required for dmabuf surfaces with drm modifier.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1023>
2021-10-10 17:03:29 +00:00
Víctor Manuel Jáquez Leal f1e2eb4f1e va: filter: Enable to pass VASurfaceID in GstVaSample.
Initially GstVaSample processed its GstBuffer member to get the
VASurfaceID. But it might cases where we already have the VASurfaceID
to process by the filter.

This patch enables the possibility to pass the surfaces rather than
the buffers. In order to validate the surfaces a function to check
surfaces were added.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1023>
2021-10-10 17:03:29 +00:00
Víctor Manuel Jáquez Leal 14156f8270 va: Split VA memory handling in different files.
Take out the VA memory wrappers from gstvallocator.c to an external
file exposing the functions.

This is going to be needed for the copy helper object.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1023>
2021-10-10 17:03:29 +00:00
Víctor Manuel Jáquez Leal 1be43e76cc va: allocator: Add missing header file.
Added stdint.h because uintptr_t is used.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1023>
2021-10-10 17:03:29 +00:00
Víctor Manuel Jáquez Leal 2947bd6ef1 va: display: Add gst_va_display_has_vpp()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1023>
2021-10-10 17:03:29 +00:00
Benjamin Gaignard 7e9e17ebbe v4l2codecs: Align v4l2-controls header with kernel 5.15-rc3
Update v4l2-controls to be aligned with kernel 5.15-rc3.
Fix VP8 decoder to use the correct field name.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1081>
2021-10-10 15:50:57 +00:00
Seungha Yang 0d96e43c91 mediafoundation: mfvideoenc: Use DXGI adapter LUID
Make use of new DXGI adapter LUID based device context sharing.
Note that we were using DXGI adapter LUID to open MFT already.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1098>
2021-10-10 03:23:58 +09:00
Seungha Yang 5707e487cf d3d11: d3d11decoder: Use DXGI adapter LUID
... instead of index of DXGI adapter.

The order of IDXGIAdapter1 enumerated via IDXGIFactory1::EnumAdapters1
can be varying even there's no rebooting in case that GPU preference order
is updated by user (for example, it can be done by using NVIDIA Control Panel
in case of multi-GPU laptop system) and eGPU is another possible case.

So, for an element which requires fixed target GPU requirement,
index based device enumeration is unreliable.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1098>
2021-10-10 03:23:58 +09:00
Seungha Yang 98b82ef286 d3d11: d3d11utils: Add support for DXGI Adapter LUID based D3D11 device context sharing
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1098>
2021-10-10 03:23:58 +09:00
Seungha Yang 5ac7a21ef0 d3d11: d3d11device: Add gst_d3d11_device_new_{for_adapter_luid,wrapped}
* gst_d3d11_device_new_for_adapter_luid()
  Used for creating D3D11 device for a DXGI adapter (i.e., GPU)
  corresponding to a LUID (Locally Unique Identifier).
  This method can be useful for interop with other APIs such as
  Direct3D12, MediaFoundation, CUDA, etc.
* gst_d3d11_device_new_wrapped()
  Allows creating a new GstD3D11Device object by using already
  configured ID3D11Device. This is conceptually equivalent to
  gst_gl_context_new_wrapped()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1098>
2021-10-10 03:23:53 +09:00
Seungha Yang d8eff2623d d3d11: d3d11device: Remove "allow-tearing" property
Plugin can query DXGI_FEATURE_PRESENT_ALLOW_TEARING without d3d11device
help

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1098>
2021-10-10 01:01:44 +09:00
Sebastian Dröge 3011fa7ddd webrtcbin: Use the same promise reply structure name everywhere
This was an inconsistent mix of different names in the past. The name
has no meaning at all so let's set all to "application/x-gst-promise".

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1099>
2021-10-09 11:45:46 +03:00
Vivia Nikolaidou 1fa1b18a24 chopmydata: Fix FIXMEs in gst_element_class_set_static_metadata
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1097>
2021-10-08 16:20:10 +03:00
Seungha Yang 7286c8e302 d3d11: d3d11desktopdupsrc: Add support for non-D3D11 downstream element
By this commit, application doesn't need to configure d3d11download
element for software pipeline which will make things simpler

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1082>
2021-10-08 16:13:46 +09:00
Seungha Yang 88437a9c9b codecs: Use GST_VIDEO_DECODER_ERROR() only for decoding error case
The GST_VIDEO_DECODER_ERROR() should be used only for robust/error-resilient
decoding purpose. Any other error codes such as not-negotiated or flushing
should be returned without modified for upstream to be able to handle
it immediately. (for example, application might want to try other
decoder element on not-negotiated)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1070>
2021-10-07 06:48:46 +00:00
Seungha Yang e31b797c05 codecs: h264decoder: Update for remaining gboolean to GstFlowReturn port
Fix for spurious/spammy warning and wrong function return type

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1085>
2021-10-07 06:07:29 +00:00
Nirbheek Chauhan be607d7cca meson: Fix build with -Dopenjpeg=disabled
tests/check/meson.build uses the openjpeg_dep variable
unconditionally, and the subdir_done() is useless anyway, since the
plugin is only built if openjpeg_dep.found() is true. Fixes:

..\tests\check\meson.build:23:0: ERROR: Unknown variable "openjpeg_dep".

In particular, this fixes the build on UWP since we disable openjpeg
explicitly in Cerbero when building for UWP.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1069>
2021-10-07 03:22:25 +00:00
Guillaume Desmottes de05bb3da2 bad: gs: update README
- add one missing dep
- change install path to match monorepo
- fix current dirs

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1008>
2021-10-06 21:35:08 +00:00
Víctor Manuel Jáquez Leal 01cfc1ee7e va: Use macro rather than VAMemory feature string.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1061>
2021-10-06 07:19:50 +00:00
Jan Alexander Steffens (heftig) 0596da1966 mpegtsparse: Don't assert the packet_size when filling for EOS
If the packetizer got reset for any reason (failure to find PCR?) then
the packet_size can be zero here even though we already enqueued some
packets.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1038>
2021-10-05 09:38:27 +00:00
Seungha Yang 7c557c2d65 codecs: mpeg2decoder: Use GstFlowReturn everywhere
boolean return value is not sufficient for representing the reason
of error in most cases. For instance, any errors around new_sequence()
would mean negotiation error, not just *ERROR*.
And some subclasses will allocate buffer/memory/surface on new_picture()
but it could be failed because of expected error, likely flushing

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1019>
2021-10-04 20:56:46 +00:00
Seungha Yang e322745763 codecs: h264decoder: Use GstFlowReturn everywhere
boolean return value is not sufficient for representing the reason
of error in most cases. For instance, any errors around new_sequence()
would mean negotiation error, not just *ERROR*.
And some subclasses will allocate buffer/memory/surface on new_picture()
but it could be failed because of expected error, likely flushing

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1019>
2021-10-04 20:56:46 +00:00
Seungha Yang 5b405d1585 codecs: h265decoder: Use GstFlowReturn everywhere
boolean return value is not sufficient for representing the reason
of error in most cases. For instance, any errors around new_sequence()
would mean negotiation error, not just *ERROR*.
And some subclasses will allocate buffer/memory/surface on new_picture()
but it could be failed because of expected error, likely flushing

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1019>
2021-10-04 20:56:46 +00:00
Seungha Yang 05496df0d1 closedcaption: Fix broken debug function macros with MSVC build
warning C4003: not enough arguments for function-like macro invocation 'warning'

G_STMT_END macro is extended to the below form with MSVC
__pragma(warning(push)) \
__pragma(warning(disable:4127)) \
while(0) \
__pragma(warning(pop))

So MSVC preprocessor will extend it further to
__pragma(VBI_CAT_LEVEL_LOG(push)) ...

Should rename warning() debug macro function therefore.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1018>
2021-10-04 23:03:20 +09:00
Seungha Yang 90e5e0efea mpegtsmux: basetsmux: Don't try to return value from void function
gstbasetsmux.c(1508): warning C4098: 'free_splice': 'void' function returning a value

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1018>
2021-10-04 13:37:09 +00:00
Víctor Manuel Jáquez Leal 2e6cd5c2e4 va: Make libgudev dependency optional.
libgudev is a problematic dependency, particularly in sandboxed
environments, such as flatpak.

This patch implements a way to get the available VA devices using
brute-forced traverse of /dev/drm/renderD* directory. Thus usable in
those sandboxed environments.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1027>
2021-10-04 10:19:36 +00:00
Víctor Manuel Jáquez Leal e699aaeb16 va: meson: Move back libgudev dependency to plugin.
When move the libgstva, libgudev dependency was moved as part of the
library, though it's not use by the library but the plugin. This patch
moves back libgudev dependency to the plugin.

Also HAVE_LIBDRM is move to the library which is the one who use it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1027>
2021-10-04 10:19:36 +00:00
Seungha Yang da7f4e0a69 nvcodec: nvh264sldec: Add support for interlaced stream
Implement missing interlaced stream support

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1026>
2021-10-04 08:04:00 +00:00
Seungha Yang ce8965b75b nvcodec: nvh264sldec: Consider additional render delay DPB pictures
At least additional 4 pictures are required

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1026>
2021-10-04 08:04:00 +00:00
Seungha Yang 613d380b97 nvcodec: nvvp9sldec: Fix for VP9 profile2 decoding
Fix for output video format to be selected correctly

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1026>
2021-10-04 08:04:00 +00:00
Seungha Yang baf252b48b msdk: meson: Fix build on Windows
subprojects\gst-plugins-bad\sys\msdk\meson.build:160:2: ERROR: Unknown variable "libva_dep".

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1022>
2021-10-04 07:14:33 +00:00
Seungha Yang 6a756b9f46 d3d11: d3d11vp9dec: Fix use_prev_in_find_mv_refs value setting
"last_show_frame" should be updated based on
GstVp9FrameHeader::show_frame, not show_existing_frame

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1021>
2021-10-03 02:25:50 +09:00
Seungha Yang 571aad3980 codecs: {vp8,vp9}decoder: Drain on new_sequence()
Decoder should drain queued frame (if any) and empty DPB before
starting new sequence.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/987>
2021-10-02 12:11:48 +00:00
Seungha Yang 834d6f4031 nvcodec: nv{vp8,vp9}sldec: Implement get_preferred_output_delay()
Equivalent to that of nvh264sldec. Use render delay in case of non-live
pipeline for the better throughput performance.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/987>
2021-10-02 12:11:48 +00:00
Seungha Yang aab3ea2736 codecs: {vp8,vp9}decoder: Cleanup drain code
Make them consistent with h26x decoder baseclass

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/987>
2021-10-02 12:11:48 +00:00
Seungha Yang 9f4ea145e0 codecs: vp8decoder: Fix typo
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/987>
2021-10-02 12:11:48 +00:00
Seungha Yang c6ec7f3ea4 codecs: vp9decoder: add support for render delay
Some decoding APIs support delayed output for performance reasons.
One example would be to request decoding for multiple frames and
then query for the oldest frame in the output queue.

This also increases throughput for transcoding and improves seek
performance when supported by the underlying backend.

Introduce support in the vp9 base class, so that backends that
support render delays can actually implement it.

Co-authored by Seungha Yang <seungha@centricular.com>

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/987>
2021-10-02 12:11:48 +00:00
Seungha Yang 505c794748 codecs: vp9decoder: Fix class struct documentation
s/GstVp9Decoder/GstVp9DecoderClass

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/987>
2021-10-02 12:11:48 +00:00
Víctor Manuel Jáquez Leal 5e08ede8f6 va: meson: Update and enhance meson syntax usage.
This patch contains two updates:

1. Instead of checking for dependency already checked just to verify a
   version, we use the dependency version API.
2. Update the deprecated function get_pkgconfig_variable.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/997>
2021-10-02 00:54:56 +00:00
Víctor Manuel Jáquez Leal a769e3308d msdk: meson: Don't get dependency variable before it's valid.
It's possible to have installed MediaSDK environment
package (libmfx-dev in Debian) without libva environment package. This
setup will lead to a breakage of meson configuration.

The fix is to get the libva's driver directory variable after the
dependency is validated as found.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/998>
2021-10-01 23:43:41 +00:00
Marc Leeman 58d4a5b449 ristsink: set sync to FALSE on RTCP sink
See commit 921e9a54: rtpsink: set sync off on rtcp_sink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/993>
2021-10-01 22:57:02 +00:00
Marc Leeman b7820a0de7 rtpsink: set sync off on rtcp_sink
When using the following setup (the error can be reproduced using
simpler sender pipelines), the receiver resynchronises the clock on RTCP
packets. The effect was that a couple seconds were cut out of the
playback because an initial RTCP packet was dropped.

When sending out all RTCP packets (setting sync=FALSE on the RTCP
updsink), the playback is fine.

This syncs rtpsink with rtpsrc (where this property was already set).

gst-launch-1.0 filesrc location=899-en.mp3 \
    ! mpegaudioparse \
    ! mpg123audiodec \
    ! audioconvert \
    ! audioresample \
    ! avenc_g722 \
    ! rtpg722pay
    ! rtpsink uri=rtp://239.1.2.3:1234

gst-launch-1.0 uridecodebin rtp://239.1.2.3:1234?encoding-name=G722 \
    ! autoaudiosink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/993>
2021-10-01 22:57:02 +00:00
Marc Leeman a774dfb18f rtpmanagerbad: do not set iface on sink
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/994>
2021-10-01 20:31:17 +00:00