Commit graph

3934 commits

Author SHA1 Message Date
Sebastian Dröge
74f2f733be plugins: Use gst_type_mark_as_plugin_api() for all non-element plugin types 2020-06-04 13:33:16 -04:00
Seungha Yang
c4a2fd7683 d3dvideosink: Use secondary rank
d3dvideosink will be replaced by d3d11videosink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1311>
2020-06-03 17:57:40 +09:00
Seungha Yang
116d7453cb d3d11videosink: Assign primary rank
d3d11videosink has an advantage over d3dvideosink, such as
* Zero-copy playback with d3d11 decoders
* HDR rendering with 10-bit format/swapchain support
* UWP support
* Any system memory alignment/padding can be supported
* User can select target GPU device
And old d3dvideosink's functionality (e.g., navigation event, overlaycomposition)
can be covered by d3d11videosink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1311>
2020-06-03 17:57:41 +09:00
Haihao Xiang
f685893ed2 msdkh265enc: add support 12-bit 420 encoding
P016 is used for 12-bit encoding in MediaSDK, so the Shift flag is set
in the mfx parameters

Sample pipeline:
gst-launch-1.0 videotestsrc ! video/x-raw,format=P012_LE ! msdkh265enc ! \
fakesink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1174>
2020-06-01 05:04:30 +00:00
Xu Guangxin
52be289847 msdkvpp: fix "failed to create new MSDK memory"
all msdk output surfaces come from out_alloc_resp, so the buffer count is not resizable.
we need set min_buffers, max_buffers to same size.

steps to reproduce
1. ffmpeg -f lavfi -i testsrc=duration=10:size=320x240:rate=30:decimals=3 -pix_fmt yuv420p -c:v libx265 ~/bits/hevc/test.265
2. GST_GL_PLATFORM=egl gst-launch-1.0 -v filesrc location=~/bits/hevc/test.265  ! h265parse ! msdkh265dec  ! msdkvpp ! queue ! glimagesink
you will see error like this:
ERROR                default gstmsdkvideomemory.c:77:gst_msdk_video_allocator_get_surface: failed to get surface available
ERROR         msdkbufferpool gstmsdkbufferpool.c:270:gst_msdk_buffer_pool_alloc_buffer:<msdkbufferpool2> failed to create new MSDK memory
ERROR                msdkvpp gstmsdkvpp.c:297:create_output_buffer:<msdkvpp0> failed to create output video buffer
ERROR                msdkdec gstmsdkdec.c:699:gst_msdkdec_finish_task:<msdkh265dec0> Failed to finish frame
ERROR                msdkdec gstmsdkdec.c:1085:gst_msdkdec_handle_frame:<msdkh265dec0> Failed to finish a task

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1278>
2020-06-01 02:09:04 +00:00
Xu Guangxin
275518f661 msdkvpp: hold GstBuffer ref count for locked surfaces
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1278>
2020-06-01 02:09:04 +00:00
Seungha Yang
12532cc8bb mediafoundation: Use core dispatcher of current view instead of main view
Main view might be hidden depending on application's view tree.
In that case, ICoreApplication object doesn't return get_MainView() method

Note that nothing about this behavior was documented by Microsoft
https://docs.microsoft.com/en-us/uwp/api/windows.applicationmodel.core.coreapplication.mainview

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1310>
2020-05-29 23:01:08 +09:00
Seungha Yang
2dc689c2c8 mediafoundation: Fix undeclared identifier error on UWP build
Some symbols are not available in case of UWP

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1306>
2020-05-28 12:04:43 +00:00
Seungha Yang
7b5f99b47a mediafoundation: Add support MP3 audio encoding
Add MediaFoundation MP3 encoder

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1280>
2020-05-27 10:34:47 +00:00
Seungha Yang
cee619486a mediafoundation: Add support for AAC encoding
Add MediaFoundation AAC encoder element.

Before Windows 10, mono and stereo channels were supported audio channels
configuration by AAC encoder MFT. However, on Windows 10,
5.1 channels support was introduced.

To expose correct range of support format by this element
whatever the OS version is, this element will enumerate
all the supported format by the AAC encoder MFT
and then will configure sink/src templates while plugin init.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1280>
2020-05-27 10:34:47 +00:00
Seungha Yang
18f5bdee16 mfutils: Move IMediaType release function to common utility
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1280>
2020-05-27 10:34:47 +00:00
Seungha Yang
c8469644dd mediafoundation: Add util function to dump IMFAttributes values
It would be useful for debugging.

Reference: https://docs.microsoft.com/en-us/windows/win32/medfound/media-type-debugging-code
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1280>
2020-05-27 10:34:47 +00:00
Seungha Yang
bd8a415747 d3d11window_win32: Create internal window on parent window's thread
If parent and child windows are running on different thread,
there is always a chance to cause deadlock as DefWindowProc() call
from child window thread might be blocked until the message
is handled by parent's window procedure.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1299>
2020-05-27 05:08:48 +09:00
Seungha Yang
afe941249e d3d11window: Add unprepare method to clear internal resource
GObject::dispose method can be called multiple times. As win32 d3d11window
has an internal thread and because GObject::dispose method could be called from the
thread, it might cause problems such as trying to join self-thread

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1299>
2020-05-27 04:59:50 +09:00
Seungha Yang
8ce4980273 mfsourceobject: Remove useless null check for string
We can pass null for the value of string type property.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1241>
2020-05-25 15:09:20 +00:00
Seungha Yang
50b36ce257 mediafoundation: Use G_BEGIN_DECLS/G_END_DECLS pair everywhere
... instead of extern "c" {} block.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1241>
2020-05-25 15:09:20 +00:00
Seungha Yang
c4cb51c63d mediafoundation: Add support video capture on UWP app
New video capture implementation using WinRT Media APIs for UWP app.
Due to the strict permission policy of UWP, device enumeration and
open should be done via new WinRT APIs and to get permission from users,
it will invoke permission dialog on UI.
Strictly saying, this implementation is not a part of MediaFoundation
but structurally it's very similar to MediaFoundation API.
So we can avoid some code duplication by adding this implementation
into MediaFoundation plugin.

This implementation requires UniversalApiContract version >= 6.0
which is part of Windows 10 version 1803 (Redstone 4)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1241>
2020-05-25 15:09:20 +00:00
Seungha Yang
e580676747 mfsourceobject: Move device name, path, and index to public struct
... so that subclass can access each value and update them.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1241>
2020-05-25 15:09:20 +00:00
Seungha Yang
6ae478946c mediafoundation: Fix typo in source object impl.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1241>
2020-05-25 15:09:20 +00:00
Seungha Yang
3efc8f5de9 mftransform: Clear unused output IMediaSample
If MFT doesn't produce encoded output, need to free allocated
output sample and buffer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1297>
2020-05-25 10:25:37 +00:00
Seungha Yang
b93fbdd3cd mfvideoenc: Fix huge memory leak
Subclass must unref passed GstVideoCodecFrame on GstVideoEncoder::handle_frame()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1294>
2020-05-24 19:12:28 +09:00
Seungha Yang
e75049eb84 nvh264sldec: Fix wrong scaling list matrix scan order
Quatization matrix of NVDEC should be raster scan order but
h264parser stores it in zig-zag scan order. We need to convert
the matrix.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1290>
2020-05-23 01:06:28 +09:00
Nicolas Dufresne
d16367f046 v4l2codecs: h264: Add missing break
There was a missing break for the 4:4:4 case which would break the sizeimage
calculation. We don't currently have hardware that supports 4:4:4, so this
code wasn't tested. This was detected by Coverity.

CID 1463592 1463591

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1283>
2020-05-21 20:12:07 +00:00
Matthew Waters
8403d97587 amc/videodec: only retrieve the stride/slice-height for raw output
When outputting to a surface, these values may not exist.

As found on a Google Pixel 3.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1284>
2020-05-21 12:40:21 +00:00
Seungha Yang
dac36cb98f mediafoundation: Add device provider implementation
Only static device probing is supported for now

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1236>
2020-05-20 11:06:09 +00:00
Seungha Yang
ba45e3f82b mfsourceobject: Store selected device path, name and index
Update path, name and index with selected device so that checked by
get_property() after constructed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1236>
2020-05-20 11:06:09 +00:00
Nicolas Dufresne
2160239548 v4l2slh264dec: Request large enough bitstream buffer
The Cedrus driver would otherwise choose 1KB buffer, which is too small.
This follows what some drivers do, which is simply to use the size a
packed raw image would have. Specifications do not really guaranty any minimum
compression ratio.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1268>
2020-05-19 17:51:11 +00:00
Nicolas Dufresne
037730a787 v4l2slh264dec: Add slice based decoder support
This adds support for slice based decoder like the Allwinner/Cedrus driver. In
order to keep things efficient, we hold the sink buffer until we reach the end
of the picture. Note that as we don't know which one is last, we lazy queue the
slices. This effectively introduces one slice latency.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1268>
2020-05-19 17:51:11 +00:00
Nicolas Dufresne
661f0c161e v4l2codecdec: Fix error handling
If none of the format the HW produce is supported, the fiter will be NULL,
which would lead to assertion when trying to release it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1268>
2020-05-19 17:51:11 +00:00
Nicolas Dufresne
26264163de v4l2decoder: Add legacy non-multiplanar support
The Cedrus driver uses the lagacy buffer type (non-mplane). This automatically
detect and use the right v4l2_buf_type. This also affect code using
v4l2_buffer and v4l2_format structures.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1268>
2020-05-19 17:51:11 +00:00
Nicolas Dufresne
14b0b68354 v4l2codecs: Update kernel headers
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1268>
2020-05-19 17:51:11 +00:00
Seungha Yang
24f30b2e6e d3d11convert: Fix fallback texture setup when resolution is not even number
When texture format is semi-planar, resolution should be even number,
and add missing P016 format handling

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1275>
2020-05-19 17:25:05 +00:00
Seungha Yang
a966cc20bc d3d11convert: Fix fallback texture copy
Fix texture copy when input texture has non-zero subresource index

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1275>
2020-05-19 17:25:05 +00:00
Seungha Yang
a24d4e654d d3d11: Add support for video rescale and rename element to d3d11convert
GstD3D11ColorConverter implementation is able to rescale video as well.
By doing colorspace conversion and rescale at once, we can save
one cycle of shader pipeline which will can save GPU resource.

Since this element can support color space conversion and rescale,
it's renamed as d3d11convert

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1275>
2020-05-19 17:25:05 +00:00
Seungha Yang
0e842c74b6 d3d11: Move scoring util method for colorspace conversion to colorconvert element
It's used only by colorconvert element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1275>
2020-05-19 17:25:05 +00:00
Víctor Manuel Jáquez Leal
d2aae6bb96 codecs: h264decoder: ref pic lists as decode_slice parameters
Pass reference picture lists to decode_slice() vmethods

Change gstv4l2codech264dec and gstnvh264dec accordingly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1238>
2020-05-19 16:57:09 +00:00
Arun Raghavan
d0776faf47 opensles: Remove hard-coded buffer-/latency-time values
These were originally required in early Android versions, but are no
longer needed.
2020-05-16 19:23:06 +00:00
Seungha Yang
8afc283b51 mediafoundation: Refactor GstMFSourceObject implementation
* Move CoInitializeEx/CoUninitialize pair into thread function in order to
  ensure MTA COM thread
* Move common code to baseclass

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1269>
2020-05-15 09:03:13 +00:00
Seungha Yang
c29c71ae9d mediafoundation: Remove COM thread constraints from GstMFTransform object
Move CoInitializeEx/CoUninitialize pair into our dedicated thread so that
we can ensure COM thread is MTA. This will remove thread constraints
around plugin init.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1269>
2020-05-15 09:03:13 +00:00
Matthew Waters
b3cbdb1d26 amcvideodec: fix sync meta copying not taking a reference
Fixup for
9b9e39be24: amc: Fix crash when a sync_meta survives its sink
https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/603

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1272>
2020-05-15 13:54:56 +10:00
Ting-Wei Lan
d10e2381c7 v4l2codecs: Fix compilation error on FreeBSD
This commit does the following things to fix compilation on FreeBSD:

1. Add required typedefs to linux/types-compat.h.
2. Remove unnecessary include linux/ioctl.h and replace linux/types.h
   with linux/types-compat.h. Both files do not exist on FreeBSD.
3. Check the header including makedev macro. FreeBSD does not have
   sys/sysmacros.h, and including it unconditionally causes error.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1259>
2020-05-11 15:17:31 +00:00
Haihao Xiang
98600942e4 msdkvpp: clear the parameters after closing the session
Otherwise the stale values are used for the new process.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1159>
2020-05-11 02:16:44 +00:00
Xu Guangxin
cab1ddf48b msdk: bufferpool: set alignment to video meta
else gst_video_meta_validate_alignment will report error like
"videometa gstvideometa.c:416:gst_video_meta_validate_alignment: Stride of plane 0 defined in meta (384) is different from the one computed from the alignment (320)"

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1224>
2020-05-07 05:45:36 +00:00
Nicolas Dufresne
5ece17ecbd v4l2slvp8dec: Flip the meaning of segment_feature_mode
In section 9.3.4 a), segment_feature_mode have 0 for absolute and 1 for delta,
while in 19.2, it says the opposite. But the reference code, which usually
rules over the text state that 1 means absolute:

 if (hdr->update_data)
 {
     hdr->abs = bool_get_bit(bool);

And uses it with that meaning to decide weither to override the existing value
or just add the detla. This fixes multiple decoding issues.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1245>
2020-05-05 17:57:08 +00:00
Nicolas Dufresne
11c62eb015 v4l2slvp8dec: Copy header version
This field was not copied.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1245>
2020-05-05 17:57:08 +00:00
Nicolas Dufresne
8c56822936 v4l2slvp8dec: Add debugging for reference frames
This simply trace the frame number of the references used for decoding.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1245>
2020-05-05 17:57:08 +00:00
Nicolas Dufresne
a449815f95 v4l2slvp8dec: Ensure width/height is always set
Our parser strictly read the bitstream. As it's known from DXVA that always
having a valid width/height might be needed, use the cached width/height
instead of the value from the parser. This didn't impact Hantro driver.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1245>
2020-05-05 17:57:08 +00:00
Nicolas Dufresne
ffd74fb5ec v4l2slvp8dec: Fix debug category name
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1245>
2020-05-05 17:57:08 +00:00
Seungha Yang
d9c552802e d3d11vp8dec: Remove useless assign operation
It's already been done in the line just above.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1246>
2020-05-05 16:37:14 +00:00
Seungha Yang
a4fbb49ef3 d3d11window: Fix processor output view resource leak
Because this object holds reference to native d3d11 device handle internally,
related native d3d11 objects would be leaked as well.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1243>
2020-05-05 20:49:32 +09:00
Tim-Philipp Müller
9539eecf20 nvcodec: fix compiler warning in certain setups
Fixes gstnvh264dec.c:648:12: warning: unused variable ‘ret’
compiler warning on raspbian where HAVE_NVCODEC_GST_GL is
not defined.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1239>
2020-05-03 11:08:29 +01:00
Seungha Yang
ed147a3b48 d3d11h264dec: Rearrange the order of supported profiles in caps
constrained-baseline profile is much preferred than baseline.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1229>
2020-04-29 18:13:42 +00:00
Seungha Yang
28dc4a1dd8 nvh264sldec: Allow constrained-baseline and baseline profiles
Like d3d11h264dec, we need to relax the condition for profiles of nvh264sldec

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1228>
2020-04-30 02:36:34 +09:00
Seungha Yang
7db29fc382 d3d11h264dec: Add constrained-baseline and baseline profile
Both profiles are expected to be supported profile by DXVA hardware

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1212>
2020-04-29 14:24:02 +00:00
Nicolas Dufresne
bf9f82c8c3 v4l2codecs: Factor out plugin registration
This introduce a common place for generic functions and factor out the plugin
registration code. This code is nearly identical between implementation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1216>
2020-04-28 22:53:11 +00:00
Nicolas Dufresne
de2cccaa47 v4l2decoder: Relax width/height return value check
The driver adjust the width/height to coded size. This was not an issue for
H264, as the coded size is in the bitstream, but is an issue with VP8.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1216>
2020-04-28 22:53:11 +00:00
Nicolas Dufresne
72c0b3e5ae v4l2codecs: Add VP8 decoder
This is derived from the H264 decoder, some boiler plate will be factored out
in the following commits.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1216>
2020-04-28 22:53:11 +00:00
Joshua M. Doe
bfc605a666 mfvideosrc: add GRAY16_LE format support
FOURCC "Y16 " is used by FLIR Boson USB Video Class (UVC) camera

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1222>
2020-04-28 15:14:50 -04:00
Seungha Yang
3804dfb28d d3d11device: Add fallback for device creation
D3D11_CREATE_DEVICE_DEBUG flag will be used while creating d3d11 device
to activate debug layer. However, if system doesn't support the
debug layer for some reason, we should try to create d3d11 device
without the flag. Debug layer should be optional for device creation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1217>
2020-04-28 17:33:56 +00:00
Seungha Yang
912b2d7af9 mediafoundation: Disable querying supprted maximum resolution
Initializing MFT for checking supported maximum resolution is too
slow.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/760>
2020-04-28 14:37:31 +00:00
Seungha Yang
565817abd8 mediafoundation: Add h265 encoder
Add Media Foundation HEVC encoder

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/760>
2020-04-28 14:37:31 +00:00
Seungha Yang
9625d19279 mediafoundation: Add h264 encoder
Add Media Foundation h264 encoder. If hardware encoders are available
on system, they will have higher rank than software encoder.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/760>
2020-04-28 14:37:31 +00:00
Seungha Yang
eece89042a mediafoundation: Introduce Microsoft Media Foundation plugin
The Microsoft Media Foundation (MF) is the successor of DirectShow.
This commit includes two kinds of video capture implementation,
one uses IMFSourceReader interface which is available since Windows Vista
and the other is based on IMFCaptureEngine interface which is available
since Windows 8.
Note that this new video source element cannot be used in UWP app
for now, since device activation using those APIs are not allowed by MS.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/760>
2020-04-28 14:37:31 +00:00
Nicolas Dufresne
ed6236f551 d3d11vp8dec: Remove unused parameters
Minor cleanup removing unused picture parameters in two internal functions.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1221>
2020-04-28 06:21:53 +00:00
Seungha Yang
4d585c64d1 nvcodec: Add suppport for environment based primary h264 decoder implementation
Introduce GST_USE_NV_STATELESS_CODEC environment to allow user to select
primary nvidia decoder implementation. In case the environment
GST_USE_NV_STATELESS_CODEC=h264 was set, old nvidia h264 decoder element
will not be registered. Instead, both nvh264dec and nvh264sldec
factory name will create gstcodecs based new nvidia h264 decoder element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1198>
2020-04-24 09:23:10 +00:00
Seungha Yang
9c21923f04 nvcodec: Add H264 stateless codec implementation
Introduce GstH264Decoder based Nvidia H.264 decoder element.
Similar the element factory name of to v4l2 stateless codec,
this element can be configured with factory name "gstnvh264sldec".
Note that "sl" in the name stands for "stateless"

For now, existing nvh264dec covers more profile and formats
(e.g., interlaced stream) than this implementation.
However, this implementation allows us to control lower level
parameters such as decoded picture buffer management and therefore
we can get a chance to improve performance in terms of latency.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1198>
2020-04-24 09:23:10 +00:00
Seungha Yang
ac850fd25d v4l2slh264dec: Support avc and avc3 formats
h264decoder baseclass provides parsed sps/pps (from codec data) for
subclass. Also, since current implementation is putting start code prefix
manually, the format of stream should not be matter for subclass.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1214>
2020-04-23 23:38:03 +00:00
Seungha Yang
2fe473fa50 d3d11decoder: Fix wrong return type from output_picture vfunc
Return type should be GstFlowReturn, not gboolean

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1213>
2020-04-23 22:06:24 +00:00
Seungha Yang
15365aba70 d3d11decoder: Add VP8 decoder element
New d3d11 VP8 decoder implementation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1079>
2020-04-22 23:20:44 +00:00
Seungha Yang
5965b6ef85 d3d11decoder: Add helper methods for negotiation and decide_allocation
The implementation for all codecs is almost the same.
No need to duplicate code.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1079>
2020-04-22 23:20:44 +00:00
Seungha Yang
09a8d2db05 kmssink: Add support for P010 and P016 formats
Support high bit-depth YUV formats

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1188>
2020-04-22 22:39:04 +00:00
Seungha Yang
c5abdf8a63 d3d11window: Fix videoprocessor leak
Clear all objects in dispose function
2020-04-21 15:32:30 +09:00
Seungha Yang
64a015d51f d3d11device: Drop floating reference count
... and use gst_object_unref instead of g_object_unref for tracer
to be happy.
2020-04-21 15:32:26 +09:00
Víctor Manuel Jáquez Leal
e96435dfea v4l2codecs: allocator: use gst_clear_object
So tracer can do its job.
2020-04-20 12:23:32 +00:00
Stéphane Cerveau
040077dbc8 kmssink: fix memory leak on failing allowed caps
When drm does not find any format, the allowed_caps is
empty one and need to be unref by the caller.

Fix #1268
2020-04-16 16:10:56 +02:00
Nicolas Dufresne
63940feaaf kmssink: Save last metadata at the same time as the last buffer
The render width/height and the vinfo was only saved upon renegotiation. This
fixes the problem by saving this metadata at the same time the buffer is
saved. The saved copy of this is needed for expose() and drain() virtual functions.
This fixes various assertion that happens on drain query.
2020-04-15 16:26:23 +00:00
Víctor Manuel Jáquez Leal
691fdb85c0 v4l2codecs: fix v4l2codecdevice get type
Currently the GType of v4l2codecdevice is hardcoded to zero, but it
rather should be delivered by the GType system.
2020-04-10 21:05:19 +02:00
Jordan Petridis
87fc038f67
gstmsdkdec: fix logical operation that misses parenthesis
in C, & is weaker than the ! operator and clang is giving the following
error about it.

```
../subprojects/gst-plugins-bad/sys/msdk/gstmsdkdec.c:731:7: error: logical not is only applied to the left hand side of this bitwise operator [-Werror,-Wlogical-not-parentheses]
  if (!gst_msdk_context_get_job_type (thiz->context) & GST_MSDK_JOB_DECODER) {
      ^                                              ~
../subprojects/gst-plugins-bad/sys/msdk/gstmsdkdec.c:731:7: note: add parentheses after the '!' to evaluate the bitwise operator first
  if (!gst_msdk_context_get_job_type (thiz->context) & GST_MSDK_JOB_DECODER) {
      ^
       (                                                                   )
../subprojects/gst-plugins-bad/sys/msdk/gstmsdkdec.c:731:7: note: add parentheses around left hand side expression to silence this warning
  if (!gst_msdk_context_get_job_type (thiz->context) & GST_MSDK_JOB_DECODER) {
      ^
      (                                             )
1 error generated.
```
2020-04-10 18:22:21 +03:00
Seungha Yang
430848548d meson: kmssink: Allow fallback only on linux
Otherwise fallback will waste meson configure time on non-linux
2020-04-09 18:36:12 +00:00
Seungha Yang
b4efdeba11 nvdec: Don't hardcode DPB size
Too many decode surface would waste GPU memory. Also it seems to be
introducing additional latency depending on stream. Since nvcodec
sdk version 9.0, CUVID parser API has been providing the minimum
required number of surface. By using it, we can save GPU memory
and reduce possible latency.
2020-04-09 16:30:58 +09:00
Nicolas Dufresne
8f0ceba251 v4l2codecs: Fix FD leak during device enumeration
This was revealed by Coverity.

CID 1461248
2020-04-08 20:25:44 +00:00
Nicolas Dufresne
f5da12bcf5 v4l2decoder: Fix file descriptor leak
A copy paste error was leading to file descriptor leak. This was detected by
Coverity.

CID 1461285
2020-04-07 17:10:08 -04:00
Haihao Xiang
00baed3ebe msdkvp9dec: add support for VP9 12bit
The output formats are P012_LE for 12bit 420 and Y412_LE for 12bit 444.
2020-04-07 00:39:35 +00:00
Nirbheek Chauhan
387b6df948 meson: Don't use get_option('buildtype')
We should directly check the values of the `debug` and `optimization`
options instead.

`get_option('buildtype')` will return `'custom'` for most combinations
of `-Doptimization` and `-Ddebug`, but those two will always be set
correctly if only `-Dbuildtype` is set. So we should look at those
options directly.

For the two-way mapping between `buildtype` and `optimization`
+ `debug`, see this table:
https://mesonbuild.com/Builtin-options.html#build-type-options
2020-04-03 17:07:47 +05:30
Stéphane Cerveau
1f62fe1cbc kms: add fallback on libdrm project if available. 2020-04-03 10:53:01 +00:00
Haihao Xiang
4cc5321010 msdkh265dec: add support for main-444-12, main-444-12-intra profiles
The video format is Y412_LE
2020-04-03 01:19:45 +00:00
Haihao Xiang
4d756c07b0 msdk: map Y412_LE to VA_FOURCC_Y416
In media driver, VA_FOURCC_Y416 is used for packed 12 bits 4:4:4:4 YUV
format, the corresponding RT format is VA_RT_FORMAT_YUV442_12
2020-04-03 01:19:45 +00:00
Haihao Xiang
55ed9458b5 msdk: map MFX_FOURCC_Y416 to VA_FOURCC_Y416
Y416 is used for packed 12 bits 4:4:4:4 YUV format in media driver, the
RT format is VA_RT_FORMAT_YUV444_12
2020-04-03 01:19:45 +00:00
Haihao Xiang
e769df9689 msdk: map Y412_LE to MFX_FOURCC_Y416
MFX_FOURCC_Y416 is used for packed 12 bits 4:4:4:4 YUV format in
MediaSDK
2020-04-03 01:19:45 +00:00
Haihao Xiang
3de690ceda msdkh265dec: add support for main-422-12, main-422-12-intra profiles
The video format is Y212_LE
2020-04-03 01:19:45 +00:00
Haihao Xiang
01edef09a3 msdk: map Y212_LE to VA_FOURCC_Y216
In media driver, VA_FOURCC_Y216 is used for packed 12 bits 4:2:2 YUV
format, the corresponding RT format is VA_RT_FORMAT_YUV422_12
2020-04-03 01:19:45 +00:00
Haihao Xiang
34177985e2 msdk: map MFX_FOURCC_Y216 to VA_FOURCC_Y216
In media driver, Y216 is used for packed 12 bits 4:2:2 format YUV
format, so the RT format is VA_RT_FORMAT_YUV422_12.
2020-04-03 01:19:45 +00:00
Haihao Xiang
fb200ccfdd msdk: map Y212_LE to MFX_FOURCC_Y216
MFX_FOURCC_Y216 is used for packed 12 bits 422 YUV format in MediaSDK
2020-04-03 01:19:45 +00:00
Seungha Yang
950aa3d1db msdkh265enc: Fix for wrong parser free function 2020-04-03 00:42:23 +09:00
Seungha Yang
71cf93c361 msdkh264enc: Configure parser and SEI array only if it's required 2020-04-02 09:20:11 +00:00
Seungha Yang
206fe1534d msdkh265enc: Add support for CEA708 closed caption insertion
Functionally identical to that of msdkh264enc
2020-04-02 09:20:11 +00:00
Seungha Yang
fc9f7a6ade d3d11: Update for video-hdr struct change
See the change of -base https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/594
2020-04-01 05:18:11 +00:00
Seungha Yang
bd706edc52 nvh265enc: Update for video-hdr struct change
See the change of -base https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/594
2020-04-01 05:18:11 +00:00
Nicolas Dufresne
4cb871eb53 v4l2codecs: Only build this plugin on Linux
This is not useful on any other OSs, it will also avoid potential build
failure as this code uses Linux specific calls.
2020-03-31 09:34:05 -04:00
Nicolas Dufresne
7254a18f0f v4l2codecs: Add plugin dependency
This ensure that the registry cache get updated when a meaningful change is
made in /dev for files named media*.
2020-03-31 09:34:05 -04:00