Commit graph

3925 commits

Author SHA1 Message Date
Seungha Yang
82189d6859 d3d11videosink: Disable d3d11videosink depending on supported feature level
Current shader code is not compatible with HLSL profile "ps_4_0_level_9_3"
or lower. So d3dcompiler cannot compile our shader code in that case.
Note that VirtualBox is one known driver which doesn't support currently
implemented shader code.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1343>
2020-06-25 07:55:47 +00:00
Kevin King
eebfed0726 avfvideosrc: wait for permissions request dialog callback
otherwise gstreamer gives up on transitioning the pipeline before the
user has accepted

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1370>
2020-06-24 18:56:53 +00:00
Seungha Yang
133b902044 nvh264sldec: Remove useless double space
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1357>
2020-06-24 16:25:58 +00:00
Seungha Yang
711e964572 nvcodec: Add H265 stateless codec implementation
Add a new GstCodecs based H265 decoder element

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1357>
2020-06-24 16:25:58 +00:00
Seungha Yang
1e544f741a nvcodec: Move common methods to nvdecoder
... and remove all #ifdef from nvh264sldec implementation.
New helper methods will take care of OpenGL specific ones.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1357>
2020-06-24 16:25:58 +00:00
Seungha Yang
1f452c0577 nvh264sldec: Declare OpenGL related objects unconditionally
GstGLDisplay and GstGLContext are subclass of GstObject so we can
remove #ifdef for such object. This is prework for nvh265sldec.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1357>
2020-06-24 16:25:58 +00:00
Seungha Yang
82ddb0600b nvh264sldec: Fix for possible wrong device selction
decoder should select assigned CUDA device id

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1357>
2020-06-24 16:25:58 +00:00
Mathieu Duponchelle
ad49ae42f7 docs: mark more types as plugin API 2020-06-23 12:10:19 -04:00
Seungha Yang
863c663b1d d3d11window_win32: Chain up mouse event to parent window
Unlike key event, mouse event will not be chained up to parent window
by DefWindowProc

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1361>
2020-06-22 15:09:22 +00:00
Seungha Yang
9042062072 dxgiscreencapsrc: Load HLSL compiler library using g_module_open
Depending on OS version, available d3dcompiler library name is different.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1355>
2020-06-22 14:36:16 +00:00
Seungha Yang
96a5760751 dxgiscreencapsrc: Reorganize debug category usage
Use the same debug category in all dxgiscreencap related source code

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1355>
2020-06-22 14:36:16 +00:00
Seungha Yang
4aa7d3d589 winscreencap: Remove trailing whitespaces
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1355>
2020-06-22 14:36:16 +00:00
Seungha Yang
3dd2b6f20b d3d11device: Print supported DXGI format for debugging
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1355>
2020-06-22 14:36:16 +00:00
Seungha Yang
8fe1aae96c d3d11: Load HLSL compiler library using g_module_open
Depending on OS version, available d3dcompiler library name is different.
But for UWP, we can still use the current way

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1355>
2020-06-22 14:36:16 +00:00
Seungha Yang
9b8eec39b6 d3d11shader: Add missing config.h include
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1355>
2020-06-22 14:36:16 +00:00
Seungha Yang
4997cde699 mediafoundation: Add VP9 encoder element
Some Intel GPUs support hardware accelerated VP9 encoding and
Microsoft provides software VP9 encoding implementation as well.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1295>
2020-06-22 07:58:03 +00:00
Seungha Yang
1a68da54b6 mfvideosrc: Add support for jpeg on Win32 application
Enable reading jpeg data from webcam if it's supported.
Note that this would be enabled only for Win32.
For UWP, we need to research more about how to support jpeg.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1342>
2020-06-17 17:45:32 +09:00
Seungha Yang
f508c8b988 mfvideosrc: Fix wrong casting
Don't cast ISoftwareBitmap to IMFMediaBuffer

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1342>
2020-06-17 17:37:05 +09:00
Seungha Yang
86e3df9493 mfvideosrc: Add support YUY2 format for UWP
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1342>
2020-06-17 17:37:05 +09:00
Seungha Yang
8d7f537782 mediafoundation: Drop IMFCaptureEngine implementation
It was introduced for later use of its enhanced feature over IMFSourceReader
such as taking photo with video preview, audio/video capturing at
the same time, etc. But currently it's not our use case, and it would
be maintenance burden.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1342>
2020-06-17 17:37:05 +09:00
Seungha Yang
f899728dd4 d3d11: Don't assume response of context query has valid d3d11 device context
Peer elements should return FALSE if d3d11 device context is unavailable
but it might happen for some reason (e.g., wrong implementation or so)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1347>
2020-06-16 11:23:34 +00:00
Seungha Yang
bc99ea1e30 d3d11decoder: Disable zero-copy for blacklisted device
Should enable it for verified devices. For now, Xbox is blacklisted

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1339>
2020-06-16 10:49:02 +00:00
Seungha Yang
1144cdc63a d3d11decoder: Adjust alignment constraint for Xbox device
XBox doesn't seem to support 128 bytes alignment for 4K HEVC

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1339>
2020-06-16 10:49:02 +00:00
Seungha Yang
fe361ecc25 d3d11window: Do not configure video processor for Xbox device
Disable video processor for Xbox until it's verified

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1339>
2020-06-16 10:49:02 +00:00
Seungha Yang
d12c0c4c7b d3d11utils: Add a helper method for checking Xbox device
Required for some cases to work around device specific issue

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1339>
2020-06-16 10:49:02 +00:00
Seungha Yang
b5c8889d4f d3d11videosink: Use GPU memory copy if possible
Even if fallback buffer is required (e.g., shader resource view is unavailable),
use direct GPU memory copy if possible. It must be much faster than
system memory copy approach.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1339>
2020-06-16 10:49:02 +00:00
Seungha Yang
73b39407a6 d3d11videosink: Ensure shader resource view of fallback buffer
SRV must be configured for color conversion

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1339>
2020-06-16 10:49:02 +00:00
Seungha Yang
4471788e4a d3d11window: Fix typo "configureed"
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1339>
2020-06-16 10:49:02 +00:00
Jun-ichi OKADA
d43c5b6485 winscreencap: Add dxgiscreencapsrc element.
This element uses the Desktop Duplication API to capture the desktop screen at high speed.
It supports Windows 8 or later.

It has the following features compared to other elements:
 * Runs faster.
 * It works in High DPI environment.
 * Draws an accurate mouse cursor.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/863>
2020-06-16 10:30:13 +09:00
Xu Guangxin
610e477565 msdkdec: hold a reference for the surfaces locked by msdk
previous code releases GstBuffer too earlier. so we will see

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:<msdkbufferpool0> failed to create new MSDK memory

We need to hold GstBuffer reference for msdk if the surfaced locked by msdk.

step to reproduce.
1. ffmpeg -f lavfi -i testsrc=duration=10:size=320x240:rate=30 -pix_fmt yuv420p -c:v libx265 test.265
2. GST_GL_PLATFORM=egl  gst-launch-1.0 -v filesrc location=test.265  ! h265parse ! msdkh265dec  ! queue ! glimagesink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1277>
2020-06-15 02:46:53 +00:00
Seungha Yang
2e1bec7ff6 wasapi2: Fallback to IAudioClient interface if IAudioClient3 API is unavailable
When default device is selected, IAudioClient3 API doesn't look like
available.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1332>
2020-06-11 12:40:44 +00:00
Seungha Yang
7ab51e85ab wasapi: Fix possible deadlock while downwards state change
IAudioClient::Stop() doesn't seem to wake up the event handle,
then read() or write() could be blocked forever by WaitForSingleObject.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1329>
2020-06-11 11:40:26 +00:00
Nicolas Dufresne
483539f45c v4l2slh264dec: Fix reading mode and start code type
These two controls are not pointer based, so we don't need to pass any size or
pointer and need to copy the values afterward. This fixes H264 decoding
regression with Hantro and RKVDEC drivers.

Fixes 037730a787

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1330>
2020-06-09 10:52:44 -04:00
Seungha Yang
52a82f5b84 mftransform: Fix deadlock when MFT requests processing output twice
This sequence of event/data flow might happen

1) Initially we have one pending output event
  1-1) Then, process the pending output data
2) No pending input event, then we should wait new pending input event
  2-1) Wakeup by new pending event (but it's pending output event)

In above case, MFT will not report new pending input event
if pending output is not processed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1325>
2020-06-08 23:46:43 +09:00
Seungha Yang
309c679c43 mftransform: Add some debug log
Add some trace level log for debugging

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1325>
2020-06-08 23:42:22 +09:00
Seungha Yang
a6a4267c7b wasapi2: Add device provider implementation
Similar to device provider implementation of wasapi plugin,
this implementation supports only static probing.
But we can implement runtime device add/remove/update
monitoring using DeviceWatcher interface later.

See https://docs.microsoft.com/en-us/uwp/api/windows.devices.enumeration.devicewatcher

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1264>
2020-06-08 03:10:05 +00:00
Seungha Yang
2778457678 wasapi2: Introduce new WASAPI plugin
Add a new wasapi implementation mainly to support UWP application.
Basically the core logic of this plugin is almost identical to
existing wasapi plugin, but main target is Windows 10 (+ UWP).
Since this plugin uses WinRT APIs, this plugin most likely might not
work Windows 8 or lower.

Compared with existing wasapi plugin, additional features of this plugin are
* Fully compatible with both Windows 10 desktop and UWP application
* Supports automatic stream routing (auto fallback when device was removed)
* Support device level mute/volume control

But some features of existing wasapi plugin are not implemented
in this plugin yet
* Exclusive streaming mode is not supported
* Loopback feature is not implemented
* Cross-compile is not possible with current mingw toolchain
  (meaning that MSVC and Windows 10 SDK are required to build this plugin)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1264>
2020-06-08 03:10:05 +00:00
Seungha Yang
0f74785b8e mfvideoenc: Set PAR to output IMFMediaType
We've set it to input IMFMediaType but not for output.
So, if PAR is not 1:1, the input IMFMediaType will be accepted
by MFT (default is 1:1).
The PAR of input/output IMFMediaType must be identical

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1322>
2020-06-06 21:19:48 +09:00
Seungha Yang
cec6858401 mftransform: Don't try to drain if MFT is not running
Otherwise MFT will be blocked forever as no event can be generated by
IMFMediaEventGenerator.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1322>
2020-06-06 21:03:05 +09:00
Mathieu Duponchelle
a048ce81d4 plugins: uddate gst_type_mark_as_plugin_api() calls 2020-06-06 00:40:42 +02:00
Seungha Yang
a38ac7a865 d3d11overlaycompositor: Fix wrong Y position calculation
The Y coordinate of vertex and screen/image are opposite

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1319>
2020-06-05 13:47:49 +00:00
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