Commit graph

4196 commits

Author SHA1 Message Date
Víctor Manuel Jáquez Leal
c118ae11ab va: allocator: dmabuf: log unknown surface format
It is possible that surface format is not assigned, keeping its default
GStreamer value: unknown, but gst_video_format_to_string() doesn't print
unknown format, so this patch does it manually.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1811>
2020-11-15 09:52:51 +01:00
Víctor Manuel Jáquez Leal
a1e8cb76e7 va: allocator: dmabuf: destroy VASurface if no pooled buffer
When gst_va_dmabuf_allocator_setup_buffer_full() receives info (not NULL) it is
supposed that this buffer is not part of the allocator pool, so it has to be
de-allocated as soon it is freed.

This patch sets the destroy notify of the assigned GstVaBufferSurface if info is
not NULL.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1811>
2020-11-15 09:52:01 +01:00
Seungha Yang
9011a58491 vah264dec: Allow missing reference picture
baseclass might provide reference picture list with null picture.
Ensure picture before filling picture information.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1809>
2020-11-14 16:17:18 +00:00
Seungha Yang
f9a0efe3ed d3d11h264dec: Add support for interlaced stream
Add support for interlaced stream.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1534>
2020-11-13 15:25:43 +00:00
Seungha Yang
7a53d7a4aa codecs: h264decoder: Store reference picture type using enum value
Managing reference picture type by using two variables
(ref and long_term) seems to be redundant and that can be
represented by using a single enum value.

This is to sync this implementation with gstreamer-vaapi so that
make comparison between this and gstreamer-vaapi easier and also
in order to minimize the change required for subclass to be able
to support interlaced.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1534>
2020-11-13 15:25:42 +00:00
Seungha Yang
977c3276d4 nvcodec: Fix various typo
Not sure where the DECOCER came from

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1803>
2020-11-12 13:10:13 +00:00
Víctor Manuel Jáquez Leal
5876f232ee va: comments to explain code
There are a couple part where code seems, at least to me, a bit oscure or
confusing. So let's better add an explanation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1802>
2020-11-12 13:33:26 +01:00
Sanchayan Maity
406cd3bdef gsta2dpsink: Fix GstPad leak
The sinkpad returned by a call to gst_element_get_static_pad needs to be
unrefed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1621>
2020-11-11 22:19:33 +05:30
Arun Raghavan
8aa6db2c8d bluez: a2dpsink: Add support for LDAC to a2dpsink
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1621>
2020-11-11 22:19:33 +05:30
Arun Raghavan
ef3085c743 bluez: avdtpsink: Add support for LDAC to avdtpsink
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1621>
2020-11-11 22:19:33 +05:30
Seungha Yang
5578e76e60 nvcodec: Add VP9 stateless decoder element
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1738>
2020-11-10 14:39:40 +00:00
Seungha Yang
71564f471d nvcodec: nvdecoder: Move to refcount based GstNvDecoderFrame
This refcount based way would be helpful for sharing nvdec frame among
multiple codec pictures and later zero-copy use case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1738>
2020-11-10 14:39:40 +00:00
Seungha Yang
2a04fe5403 nvcodec: nvdecoder: Get rid of G_GNUC_INTERNAL
default is visibility=hidden. Don't need to use G_GNUC_INTERNAL
for new code therefore.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1738>
2020-11-10 14:39:40 +00:00
Seungha Yang
36ed24ac05 nvcodec: Add VP8 stateless decoder element
Like other nvcodec stateless decoders, the rank of this new nvvp8sldec
element will be secondary for now.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1738>
2020-11-10 14:39:40 +00:00
Seungha Yang
7c047da4b0 nvcodec: nvsldec: Fix typo in debug message
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1738>
2020-11-10 14:39:40 +00:00
Julian Bouzas
168b5f6536 nvcodec: leave g_once_init when all quarks are initialized
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1782>
2020-11-09 15:03:04 +00:00
Seungha Yang
0551d68bbb d3d11h264dec: Fix for MbaffFrameFlag and FrameNumList
As per spec 7.4.3 Slice header semantics, the flag value is derived as
MbaffFrameFlag = (mb_adaptive_frame_field_flag && !field_pic_flag)
and DXVA uses the value.
Regarding FrameNumList, in case of long-term ref, FrameNumList[i]
value should be long_term_frame_idx not long_term_pic_num.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1780>
2020-11-09 03:07:06 +09:00
Jason Pereira
cba368785b decklink: correct framerate 2KDCI 23.98
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1771>
2020-11-05 14:28:28 +00:00
Nicolas Dufresne
2950c76c8f va: Add HEVC decoding support
This add HEVC decoding support into the new VA plugin. This implementation has
been tested using the ITU comformance test (through fluster). It fails all
MAIN10 tests, as this is not implemented yet along with the following:

CONFWIN_A_Sony_1 (looks fine, but md5sum is incorrect)
PICSIZE_A_Bossen_1 (height too high)
PICSIZE_B_Bossen_1 (same)
VPSSPSPPS_A_MainConcept_1 (parser issue)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1714>
2020-11-04 17:53:23 +00:00
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