Commit graph

4177 commits

Author SHA1 Message Date
Seungha Yang
2f5257fd69 Revert "d3d11decoder: Use D3D11/DXGI standard colorimetry"
This reverts commit a52fc6deed.

The change breaks H264/HEVC conformance bitstream tests

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1753>
2020-11-02 17:58:23 +00:00
Seungha Yang
a52fc6deed d3d11decoder: Use D3D11/DXGI standard colorimetry
D3D11/DXGI supports smaller set of colorimetry than all possible
combination. This restriction would make more streams convertible
by using ID3D11VideoProcessor

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1743>
2020-11-02 18:48:58 +09:00
Seungha Yang
a3a7e21f87 d3d11window: Use ID3D11VideoProcessor only if device supports corresponding conversion
... and drop support for ID3D11VideoProcessor if device doesn't
support ID3D11VideoContext1 interface and therefore we cannot
query conversion supportability.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1743>
2020-11-02 18:48:54 +09:00
Seungha Yang
337cb883fa d3d11h{264,265}dec: Submit picture level parameters only once
Submit PICTURE_PARAMETERS and INVERSE_QUANTIZATION_MATRIX
buffers only once per picture. Multiple submission is redundant.
Also this modification would fix broken hevc decoding with
dependent slice.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1749>
2020-11-01 14:29:42 +00:00
Seungha Yang
0bb73ec800 d3d11decoder: Get rid of framerate field from pad template
Framerate is optional value and we don't have any framerate
related restriction for those elements. This commit is to fix
negotiation failure when upstream doesn't set framerate on caps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1747>
2020-11-01 00:51:46 +09:00
Seungha Yang
9a796482dc d3d11decoder: Allow 10bits only profiles
HEVC_VLD_Main10 and VP9_VLD_10bit_Profile2 might not support
8bit format (i.e., NV12) depending on GPU vendor.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1742>
2020-10-31 00:37:48 +09:00
Sebastian Dröge
f71493a57c decklink: Remove \n from debug output
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1721>
2020-10-30 16:23:31 +02:00
Sebastian Dröge
60b7bd23a8 decklink: Correctly indent everything
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1721>
2020-10-30 16:23:31 +02:00
Sebastian Dröge
56b2130300 decklink: Add a default profile id
This causes no changes to the profile but keeps the existing settings.
The profile can also be changed from e.g. the card's configuration
application and in that case probably should be left alone.

The default is the new value as it keeps the profile setting as it is,
which is consistent with the previous behaviour in 1.18.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1721>
2020-10-30 16:23:31 +02:00
Sebastian Dröge
d1df412d70 decklink: Mark internal function as static
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1721>
2020-10-30 13:47:51 +00:00
Sebastian Dröge
1ea2796cfc decklink: Remove some dead code
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1721>
2020-10-30 13:47:51 +00:00
Sebastian Dröge
c6aca271a1 decklink: Update enum value bounds check in gst_decklink_get_mode()
The widescreen modes moved after GST_DECKLINK_MODE_2160p60 and using
them now would cause an assertion. This is a regression from
309f6187fe.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1737>
2020-10-30 10:02:32 +02:00
Xavier Claessens
dd7b672830 amc: Fix crash when encoding AVC
gstamcvideoenc.c calls gst_amc_avc_profile_to_string() with alternatives
set to NULL which causes a crash.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1732>
2020-10-29 17:51:57 +00:00
Seungha Yang
b62867ecc8 d3d11videoprocessor: Fix wrong input/output supportability check
The flag argument of ID3D11VideoProcessorEnumerator::CheckVideoProcessorFormat
method is output value, not input.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1726>
2020-10-28 15:53:54 +00:00
Seungha Yang
8f96361c81 nvcodec: nvsldec: Add support for CUDA memory
Add CUDA memory support. Note that zero copying is not supported yet

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1720>
2020-10-27 18:31:42 +00:00
Seungha Yang
fab234f2f1 d3d11memory: Adjust log level for some spammy debug messages
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1723>
2020-10-27 16:20:49 +00:00
Seungha Yang
10f622aa5d d3d11convert: Use ID3D11VideoProcessor only if device supports colorspace
Check whether conversion with given combination of input/output
format and dxgi colorspace is supported or not by driver.
If not, we should use shader.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1723>
2020-10-27 16:20:49 +00:00
Seungha Yang
6b992f291b d3d11videoprocessor: Add a method for device's conversion caps check
Add a wrapper method for
ID3D11VideoProcessorEnumerator1::CheckVideoProcessorFormatConversion.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1723>
2020-10-27 16:20:49 +00:00
Seungha Yang
1e038ce322 d3d11format: Map more colorimetry with dxgi colorspace
Map more logically identical set of GstVideoColorimetry formats
with dxgi color space.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1723>
2020-10-27 16:20:49 +00:00
He Junyan
d76204d14f va: pool: Set the video_alignment after we get image info.
The set_format() of the allocator may change the stride of the
alloc_info. We should update the video_align.stride_align based
on it. Or, we get a warning in gst_video_meta_validate_alignment().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1698>
2020-10-27 14:18:07 +00:00
He Junyan
caf28d8f12 va: h264dec: Set the padding to VideoAlignment's right.
In our va implemenation, we just use image's info to map the buffer.
The padding info just plays a role as a place holder to expand the
allocation size in caps when decoding size is bigger than display
size. So the padding_right or padding_left does not change the result.
But we find if using padding_left, it is hard to meet the requirement
of gst_video_meta_validate_alignment(), when the video meta's stride
is different from the allocation width.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1698>
2020-10-27 14:18:07 +00:00
He Junyan
6e72f45a8f va: basedec: No need to call base class' decide_allocation().
We have already done the jobs in gst_va_base_dec_decide_allocation()
and no need to call base class' decide_allocation() again. The base
class' decide_allocation() will set_format() again and let use do the
image/surface testing again, which is low performance and no needed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1698>
2020-10-27 14:18:07 +00:00
He Junyan
32133c85d3 va: allocator: use _update_image_info() to set allocator parameters.
Use this standalone function to update the allocator info and make
all ensure_image() and mem_alloc() API clean.
We also change the default way of using image. We now set the non
derive manner as the default manner, and if it fails, then fallback
to the derived image manner.
On a lot of platforms, the derived image does not have caches, so the
read and write operations have very low performance.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1698>
2020-10-27 14:18:07 +00:00
He Junyan
e577ca140f va: allocator: Add a helper function to update the image info.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1698>
2020-10-27 14:18:06 +00:00
He Junyan
16ff523575 va: allocator: Decide the allocator's parameters when set_format().
Moving the parameters testing and setting from the allocator_alloc_full()
to the allocator_try(). The allocator_alloc_full() will be called every
time when we need to allocate a new memory. But all these parameters such
as the surface and the image format, rt_format, etc, are unchanged during
the whole allocator lifetime. Just setting them in set_format() is enough.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1698>
2020-10-27 14:18:06 +00:00
Sebastian Dröge
8a923af42f decklink: Reset skip counters when starting the sources
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/378>
2020-10-25 11:46:29 +02:00
Vivia Nikolaidou
675d8b347b decklink*src: Post a warning message on the bus about dropped frames
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/378>
2020-10-25 11:39:09 +02:00
Georg Lippitsch
a45b0c8f1a decklink*src: Aggregate dropped frame/packet logging
decklink*src currently prints a log entry for every dropped frame and
audio packet. That completely spams the logs.

This change aggregates information about dropped packets and only prints
a message once when dropping starts, and a summary when dropping ends.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/378>
2020-10-25 11:39:05 +02:00
Seungha Yang
9d810bbd81 d3d11memory: Protect view object with lock
Make resource allocation more thread-safe

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1718>
2020-10-25 00:38:52 +09:00
Seungha Yang
969ab3e664 d3d11convert: Add support for conversion using ID3D11VideoProcessor
Output texture of d3d11 decoder cannot have the bind flag
D3D11_BIND_SHADER_RESOURCE (meaning that it cannot be used for shader
input resource). So d3d11convert (and it's subclasses) was copying
texture into another internal texture to use d3d11 shader.
It's obviously overhead and we can avoid texture copy for
colorspace conversion or resizing via ID3D11VideoProcessor
as it supports decoder output texture.
This commit would be a visible optimization for d3d11 decoder with
d3d11compositor use case because we can avoid texture copy per frame.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1718>
2020-10-25 00:38:44 +09:00
Seungha Yang
484d510558 d3d11memory: Store ID3D11VideoProcessorOutputView object
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1718>
2020-10-25 00:38:39 +09:00
Seungha Yang
35ed7c7811 d3d11window: Reuse ID3D11VideoProcessorInputView if possible
GstMemory object could be disposed if GstBuffer is not allocated
by GstD3D11BufferPool such as via gst_buffer_copy() and/or
gst_buffer_make_writable(). So attaching qdata on GstMemory
object would cause unnecessary view alloc/free.
By using view pool which is implemented in GstD3D11Allocator,
we can avoid redundant view alloc/free.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1716>
2020-10-23 15:44:10 +00:00
Seungha Yang
6c09cdd32b d3d11memory: Implement ID3D11VideoProcessorInputView pool
Similar to ID3D11VideoDecoderOutputView pool implementation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1716>
2020-10-23 15:44:10 +00:00
Nicolas Dufresne
f22fc190e7 h265decoder: Add support for l0/l1
Add support for reference list needed for VA-API and some V4L2 decoders.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1713>
2020-10-21 09:05:57 -04:00
Nicolas Dufresne
f330b5ae62 h265decoder: Sync with the H264 implementation
This ensures that we get the last reference to picture being outputed,
avoiding GstBuffer structure copies and simplifying the buffer management.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1713>
2020-10-21 09:05:57 -04:00
Seungha Yang
f615677051 d3d11decoder: Directly access ID3D11VideoDecoderOutputView for decoding
Decoder output view is stored in GstD3D11Memory object instead of
wrapper struct now. So qdata is no more required.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1712>
2020-10-20 17:56:57 +09:00
Seungha Yang
a4f324d668 d3d11memory: Implement ID3D11VideoDecoderOutputView pool
Similar to texture-array pool, we can reuse decoder output view
since the life time of output view is identical to that of texture-array.
In this way, we can avoid frequent output view alloc/free.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1712>
2020-10-20 17:56:52 +09:00
Seungha Yang
04376397eb d3d11memory: Move to GArray to store texture-array status
The size D3D11_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION is 2048
which is too large in practice especially for a texture
of dpb

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1712>
2020-10-20 01:14:27 +09:00
Víctor Manuel Jáquez Leal
bcd43acd42 va: Add VP9 decoder
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1702>
2020-10-19 13:15:06 +02:00
Víctor Manuel Jáquez Leal
5e3c7f2092 codecs: vp9decoder: Pass parser as new_sequence() parameter.
In order to know the chroma format, besides profile, subsampling_x and
subsampling_y are needed (Spec 7.2.2 Color config semantics). These values are
in GstVp9Parser but not in  GstVp9Framehdr.

Also, bit_depth is available in parser but not frame header. Evenmore, those
values are copied to picture structure later.

In case of VA-API, to configure the pipeline, it is require to know the chroma
format and depth.

It is possible to know chroma and depth through caps coming from vp9parser, but
it requires string parsing. It would be less error prone to get these values
through the parser structure at new_sequence() virtual method.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1700>
2020-10-16 17:50:42 +00:00
Seungha Yang
6e30cbb3fc d3d11: Introduce d3d11compositor element
Add new video composition element which is equivalent to compositor
and glvideomixer elements. When d3d11 decoder elements are used,
d3d11compositor can do efficient graphics memory handling
(zero copying or at least copying memory on GPU memory space).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1323>
2020-10-16 17:02:15 +00:00
Seungha Yang
36f7966a5e d3d11shader: Allow drawing without shader resource view
... for the case that we are rendering on target without input texture.
For example, we might want to draw arbitrary shape on render target view
without shader resource view.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1323>
2020-10-16 17:02:15 +00:00
Seungha Yang
eecb130bd9 d3d11convert: Add new subclasses for only color convert or resize
New d3d11colorconvert and d3d11scale elements will perform only
colorspace conversion and rescale, respectively. Those new elements
would be useful when only colorspace conversion or rescale is required
and the other part should be done by another elements.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1323>
2020-10-16 17:02:15 +00:00
Seungha Yang
4c19962997 d3d11colorconverter: Allow setting alpha value to use
... used for reordering case for now. In other words, non-alpha formats
such as NV12 is not supported case yet.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1323>
2020-10-16 17:02:15 +00:00
Seungha Yang
ca87289e56 d3d11colorconverter: Add support conversion with blending
This is pre-work for d3d11compositor support

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1323>
2020-10-16 17:02:15 +00:00
Seungha Yang
94ac3cc94d d3d11colorconverter: Add method to support updating destination rect
It's equivalent to GST_VIDEO_CONVERTER_OPT_DEST_* options of GstVideoConverter

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1323>
2020-10-16 17:02:15 +00:00
Seungha Yang
5c7caf70e1 d3d11: Clarify target rect to be updated
Rename internal methods to clarify which rect (i.e., input or output)
should be updated

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1323>
2020-10-16 17:02:15 +00:00
Julian Bouzas
32b0afb608 nvcodec: Report latency in decoder based on max-display-delay
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1633>
2020-10-16 15:56:49 +00:00
Julian Bouzas
1d4b6299dc nvcodec: Add max-display-delay decoder property
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1633>
2020-10-16 15:56:49 +00:00
Julian Bouzas
8cf1b7a154 nvcodec: Fix compiler error if OpenGL is not enabled
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1633>
2020-10-16 15:56:49 +00:00