Commit graph

24 commits

Author SHA1 Message Date
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
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
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
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
Seungha Yang
2a0de96015 d3d11window: Disable d3d11 video processor for HDR10 stream.
d3d11 video processor is showing buggy behaviors in various cases.
And this HDR10 is one case of them.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1454>
2020-07-21 15:41:20 +00:00
Seungha Yang
495ed45d05 d3d11decoder: Disable zero-copy for Qualcomm devices
Qualcomm driver looks buggy in zero-copy scenario. Even if we disable
zero-copy, device-to-device memory copy will be used with d3d11videosink
which should be fast enough.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1432>
2020-07-12 01:40:45 +09: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
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
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
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
Seungha Yang
c5abdf8a63 d3d11window: Fix videoprocessor leak
Clear all objects in dispose function
2020-04-21 15:32:30 +09:00
Seungha Yang
b2a650cf28 d3d11window: Always reuse swapchain
DXGI format can be updated via ResizeBuffers()
2020-03-28 11:45:48 +00:00
Seungha Yang
f9f6916aa1 d3d11window: Reorganize display colorspace selection
The set of supported color space by DXGI is not full combination of
our colorimetry. That means we should convert color space to one
of supported color space by DXGI. This commit modifies the color space
selection step so that d3d11window can find the best matching DXGI color space
first and then the selected input/output color space will be referenced
by shader and/or d3d11videoprocessor.
2020-03-28 11:45:48 +00:00
Seungha Yang
9b7c20bfca d3d11videosink: Clarify the meaning of various width and height variables
* Remove redundant variables for width/height and par from GstD3D11Window.
  GstVideoInfo holds all the values.
* Don't need to pass par to gst_d3d11_window_prepare().
  It will be parsed from caps again
* Remove duplicated math

Fixing regression of the commit 9dada90108
2020-03-02 22:01:43 +09:00
Seungha Yang
f2e322197e d3d11window: Set DXGI_PRESENT_ALLOW_TEARING only in fullscreen mode
The DXGI_PRESENT_ALLOW_TEARING flag might cause unexpected tearing
side effect. Setting it in fullscreen mode only seems to be
the correct usage as in the Microsoft's direct3d examples.
2020-02-26 13:18:16 +09:00
Seungha Yang
4383b387b7 d3d11window: Fix for dxva decoder output view rendering
Use resolution specified in caps for input_rect instead of
passed width and height value. The width and height might be modified
ones by d3d11videosink, then frame resolution might be different.
2020-02-12 12:34:58 +00:00
Seungha Yang
478fb29974 d3d11window: Clear cached buffer per new caps
d3d11window holds one buffer to redraw client area per resize event.

When the input format is being changed, this buffer should be cleared
to avoid mismatch beween newly configured shader/videoprocessor and
the format of previously cached buffer.
2020-02-06 00:46:46 +09:00
Seungha Yang
2aa9f0bd6c d3d11window: Don't create swapchain again per caps change
Creating swapchain is relatively heavy operation. If output dxgi format
is not being chagned, we don't need to destroy and create swachain again.
2020-02-05 00:52:48 +00:00
Seungha Yang
c1d2d9171d d3d11window: Invoke initial resize method from baseclass
... instead of calling from subclass in order for baseclass to handle
more things between swapchain creation and resource creation.
2020-02-05 00:52:48 +00:00
Seungha Yang
7aad9187e4 d3d11videosink: Use ID3D11VideoProcessor interface
...for color space conversion if available

ID3D11VideoProcessor is equivalent to DXVA-HD video processor
which might use specialized blocks for video processing
instead of general GPU resource. In addition to that feature,
we need to use this API for color space conversion of DXVA2 decoder
output memory, because any d3d11 texture arrays that were
created with D3D11_BIND_DECODER cannot be used for shader resource.

This is prework for d3d11decoder zero-copy rendering and also
for conditional HDR tone-map support.
Note that some Intel platform is known to support tone-mapping
at the driver level using this API on Windows 10.
2020-02-05 00:52:48 +00:00
Seungha Yang
a967db3b20 d3d11format: Add util methods for mapping DXGI color space with ours
Move color space mapping and hdr10 metadata conversion methods to
d3d11format in order to reuse the code.
2020-02-05 00:52:48 +00:00
Seungha Yang
e97ef8a562 d3d11window_win32: Let DXGI choose client area
Don't specify the resolution of backbuffer. Then dxgi will let us know the
actual client area. When upstream resolution is chagned, updating the size
of backbuffer without the consideration for client size would cause mismatch
between them.
2020-01-26 12:13:24 +00:00
Seungha Yang
96f0f4b613 d3d11memory: Always use native DXGI format if device support it
Use consistent memory layout between dxva and other shader use case.
For example, use DXGI_FORMAT_NV12 texture format instead of
two textures with DXGI_FORMAT_R8_UNORM and DXGI_FORMAT_R8G8_UNORM.
2020-01-13 01:58:08 +00:00
Seungha Yang
e4daa2ef43 d3d11: Add support for Universal Windows Platform
Initial UWP support via new window (CoreWindow and SwapChainPanel) implementation.
2020-01-06 20:14:51 +09:00