d3d12videosink
A Direct3D12 Video Sink
Hierarchy
GObject ╰──GInitiallyUnowned ╰──GstObject ╰──GstElement ╰──GstBaseSink ╰──GstVideoSink ╰──d3d12videosink
Implemented interfaces
Factory details
Authors: – Seungha Yang
Classification: – Sink/Video
Rank – primary + 1
Plugin – d3d12
Package – GStreamer Bad Plug-ins
Pad Templates
sink
video/x-raw(memory:D3D12Memory):
format: { RGBA64_LE, BGRA64_LE, Y416_LE, Y412_LE, RGB10A2_LE, Y410, BGR10A2_LE, Y216_LE, Y212_LE, Y210, VUYA, RGBA, BGRA, RBGA, P016_LE, P012_LE, P010_10LE, RGBx, BGRx, YUY2, NV12, ARGB64_LE, AYUV64, GBRA_12LE, GBRA_10LE, AYUV, ABGR, ARGB, GBRA, Y444_16LE, A444_16LE, A444_12LE, A444_10LE, A444, A422_16LE, A422_12LE, A422_10LE, A422, A420_16LE, A420_12LE, A420_10LE, A420, AV12, GBR_16LE, Y444_12LE, GBR_12LE, I422_12LE, I420_12LE, Y444_10LE, GBR_10LE, I422_10LE, I420_10LE, Y444, BGRP, GBR, RGBP, xBGR, xRGB, Y42B, NV24, NV16, NV61, NV21, I420, YV12, Y41B, YUV9, YVU9, GRAY16_LE, GRAY8, v216, v210, r210, v308, IYU2, RGB, BGR, UYVY, VYUY, YVYU, RGB16, BGR16, RGB15, BGR15 }
width: [ 1, 2147483647 ]
height: [ 1, 2147483647 ]
framerate: [ 0/1, 2147483647/1 ]
video/x-raw(memory:D3D12Memory, meta:GstVideoOverlayComposition):
format: { RGBA64_LE, BGRA64_LE, Y416_LE, Y412_LE, RGB10A2_LE, Y410, BGR10A2_LE, Y216_LE, Y212_LE, Y210, VUYA, RGBA, BGRA, RBGA, P016_LE, P012_LE, P010_10LE, RGBx, BGRx, YUY2, NV12, ARGB64_LE, AYUV64, GBRA_12LE, GBRA_10LE, AYUV, ABGR, ARGB, GBRA, Y444_16LE, A444_16LE, A444_12LE, A444_10LE, A444, A422_16LE, A422_12LE, A422_10LE, A422, A420_16LE, A420_12LE, A420_10LE, A420, AV12, GBR_16LE, Y444_12LE, GBR_12LE, I422_12LE, I420_12LE, Y444_10LE, GBR_10LE, I422_10LE, I420_10LE, Y444, BGRP, GBR, RGBP, xBGR, xRGB, Y42B, NV24, NV16, NV61, NV21, I420, YV12, Y41B, YUV9, YVU9, GRAY16_LE, GRAY8, v216, v210, r210, v308, IYU2, RGB, BGR, UYVY, VYUY, YVYU, RGB16, BGR16, RGB15, BGR15 }
width: [ 1, 2147483647 ]
height: [ 1, 2147483647 ]
framerate: [ 0/1, 2147483647/1 ]
video/x-raw:
format: { RGBA64_LE, BGRA64_LE, Y416_LE, Y412_LE, RGB10A2_LE, Y410, BGR10A2_LE, Y216_LE, Y212_LE, Y210, VUYA, RGBA, BGRA, RBGA, P016_LE, P012_LE, P010_10LE, RGBx, BGRx, YUY2, NV12, ARGB64_LE, AYUV64, GBRA_12LE, GBRA_10LE, AYUV, ABGR, ARGB, GBRA, Y444_16LE, A444_16LE, A444_12LE, A444_10LE, A444, A422_16LE, A422_12LE, A422_10LE, A422, A420_16LE, A420_12LE, A420_10LE, A420, AV12, GBR_16LE, Y444_12LE, GBR_12LE, I422_12LE, I420_12LE, Y444_10LE, GBR_10LE, I422_10LE, I420_10LE, Y444, BGRP, GBR, RGBP, xBGR, xRGB, Y42B, NV24, NV16, NV61, NV21, I420, YV12, Y41B, YUV9, YVU9, GRAY16_LE, GRAY8, v216, v210, r210, v308, IYU2, RGB, BGR, UYVY, VYUY, YVYU, RGB16, BGR16, RGB15, BGR15 }
width: [ 1, 2147483647 ]
height: [ 1, 2147483647 ]
framerate: [ 0/1, 2147483647/1 ]
video/x-raw(memory:SystemMemory, meta:GstVideoOverlayComposition):
format: { RGBA64_LE, BGRA64_LE, Y416_LE, Y412_LE, RGB10A2_LE, Y410, BGR10A2_LE, Y216_LE, Y212_LE, Y210, VUYA, RGBA, BGRA, RBGA, P016_LE, P012_LE, P010_10LE, RGBx, BGRx, YUY2, NV12, ARGB64_LE, AYUV64, GBRA_12LE, GBRA_10LE, AYUV, ABGR, ARGB, GBRA, Y444_16LE, A444_16LE, A444_12LE, A444_10LE, A444, A422_16LE, A422_12LE, A422_10LE, A422, A420_16LE, A420_12LE, A420_10LE, A420, AV12, GBR_16LE, Y444_12LE, GBR_12LE, I422_12LE, I420_12LE, Y444_10LE, GBR_10LE, I422_10LE, I420_10LE, Y444, BGRP, GBR, RGBP, xBGR, xRGB, Y42B, NV24, NV16, NV61, NV21, I420, YV12, Y41B, YUV9, YVU9, GRAY16_LE, GRAY8, v216, v210, r210, v308, IYU2, RGB, BGR, UYVY, VYUY, YVYU, RGB16, BGR16, RGB15, BGR15 }
width: [ 1, 2147483647 ]
height: [ 1, 2147483647 ]
framerate: [ 0/1, 2147483647/1 ]
Signals
overlay
overlay_callback (GstElement * d3d12videosink, gpointer command_queue, gpointer resource12, gpointer device11on12, gpointer resource11, gpointer context2d, gpointer viewport, gpointer udata)
def overlay_callback (d3d12videosink, command_queue, resource12, device11on12, resource11, context2d, viewport, udata):
#python callback for the 'overlay' signal
function overlay_callback(d3d12videosink: GstElement * d3d12videosink, command_queue: gpointer command_queue, resource12: gpointer resource12, device11on12: gpointer device11on12, resource11: gpointer resource11, context2d: gpointer context2d, viewport: gpointer viewport, udata: gpointer udata): {
// javascript callback for the 'overlay' signal
}
Signal emitted with Direct3D12, Direct3D11 and Direct2D resources associated with swapchain backbuffer.
This signal is emitted from the streaming thread if "overlay-mode" property includes GST_D3D12_WINDOW_OVERLAY_D3D12. The resource12 is a render target backbuffer of the swapchain. The Resource state of resource12 when this signal is emitted will be always D3D12_RESOURCE_STATE_RENDER_TARGET and signal handler should make sure the state is D3D12_RESOURCE_STATE_RENDER_TARGET when signal handler is returned, so that state change to final D3D12_RESOURCE_STATE_PRESENT can be processed by videosink.
In addition to the d2d12 resources, if "overlay-mode" includes GST_D3D12_WINDOW_OVERLAY_D3D11 flag and d3d11on12 API is supported by system, device11on12 and resource11 will be valid handles. Singla handler should not assume the device11on12 and resource11 are always valid handle since d3d11on12 API may not be supported. The resource11 is wrapped resource created via ID3D11On12Device::CreateWrappedResource. Thus, signal handler must follow required steps for d3d11on12 device, for example, ID3D11On12Device::AcquireWrappedResources must be called before recoding GPU commands. Once GPU commands are recoded via d3d11 or d2d APIs, the resource should be released via ID3D11On12Device::ReleaseWrappedResources, and then ID3D11DeviceContext::Flush must be called in the signal handler.
If "overlay-mode" is GST_D3D12_WINDOW_OVERLAY_D2D and d2d device is available, context2d will be valid handle. When this signal is emitted, context2d has configured render target already. The D2D render target is also a resource derived from resource11 and it's swapchain's backbuffer. The same step for d3d11 resource (i.e., acquire, release, and flush) is required for d2d as well.
Since the resource is swapchain's backbuffer, signal handler must not hold any derived resources such as ID3D11RenderTargetView, so that videosink can clear swapchain resources and resize anytime it's needed.
Parameters:
d3d12videosink
–
the d3d12videosink element that emitted the signal
command_queue
–
ID3D12CommandQueue
resource12
–
ID3D12Resource
device11on12
–
ID3D11On12Device
resource11
–
ID3D11Texture2D
context2d
–
ID2D1DeviceContext2
viewport
–
D3D12_RECT, d3d12videosink's current viewport
udata
–
Flags: Run Last
Since : 1.26
Properties
adapter
“adapter” gint
Adapter index for creating device (-1 for default)
Flags : Read / Write
Default value : -1
direct-swapchain
“direct-swapchain” gboolean
Attach DXGI swapchain to external window handle directly, instead of creating child window. Note that once direct swapchain is configured, GDI will no longer work with the given window handle.
If enabled, GstVideoOverlay::set_render_rectangle will be ignored, and application should handle window positioning.
Flags : Read / Write
Default value : false
Since : 1.26
display-format
“display-format” D3d12video-sink-display-format *
Swapchain display format
Flags : Read / Write
Default value : unknown (0)
Since : 1.26
error-on-closed
“error-on-closed” gboolean
Posts error message if window got closed in playing or paused state
Flags : Read / Write
Default value : true
Since : 1.26
external-window-only
“external-window-only” gboolean
If enabled and window handle is not set by user, videosink will report error instead of creating videosink's own window.
Flags : Read / Write
Default value : false
Since : 1.26
force-aspect-ratio
“force-aspect-ratio” gboolean
When enabled, scaling will respect original aspect ratio
Flags : Read / Write
Default value : true
fullscreen-on-alt-enter
“fullscreen-on-alt-enter” gboolean
Enable fullscreen toggle on alt+enter key input
Flags : Read / Write
Default value : false
gamma-mode
“gamma-mode” GstVideoGammaMode *
Gamma conversion mode
Flags : Read / Write
Default value : none (0)
msaa
“msaa” GstD3D12MSAAMode *
MSAA (Multi-Sampling Anti-Aliasing) level
Flags : Read / Write
Default value : disabled (0)
overlay-mode
“overlay-mode” D3d12window-overlay-mode *
Overly signal type
Flags : Read / Write
Default value : none
Since : 1.26
primaries-mode
“primaries-mode” GstVideoPrimariesMode *
Primaries conversion mode
Flags : Read / Write
Default value : none (0)
redraw-on-update
“redraw-on-update” gboolean
Immediately apply updated geometry related properties and redraw. If disabled, properties will be applied on the next frame or window resize
Flags : Read / Write
Default value : true
rotate-method
“rotate-method” GstVideoOrientationMethod *
Rotate method to use
Flags : Read / Write
Default value : identity (0)
rotation-x
“rotation-x” gfloat
x-axis rotation angle in degrees
Flags : Read / Write
Default value : 0
rotation-y
“rotation-y” gfloat
y-axis rotation angle in degrees
Flags : Read / Write
Default value : 0
rotation-z
“rotation-z” gfloat
z-axis rotation angle in degrees
Flags : Read / Write
Default value : 0
sampling-method
“sampling-method” GstD3D12SamplingMethod *
Sampler filter type to use
Flags : Read / Write
Default value : bilinear (1)
Named constants
GstD3D12MSAAMode
Members
disabled
(0) – Disabled
2x
(1) – 2x MSAA
4x
(2) – 4x MSAA
8x
(3) – 8x MSAA
D3d12video-sink-display-format
Swapchain display format
Members
unknown
(0) – DXGI_FORMAT_UNKNOWN
r10g10b10a2-unorm
(24) – DXGI_FORMAT_R10G10B10A2_UNORM
r8g8b8a8-unorm
(28) – DXGI_FORMAT_R8G8B8A8_UNORM
b8g8r8a8-unorm
(87) – DXGI_FORMAT_B8G8R8A8_UNORM
Since : 1.26
D3d12window-overlay-mode
Members
none
(0x00000000) – None
d3d12
(0x00000001) – Emits present signal with Direct3D12 resources
d3d11
(0x00000003) – Emits present signal with Direct3D12/11 resources
d2d
(0x00000007) – Emit present signal with Direct3D12/11 and Direct2D resources
Since : 1.26
The results of the search are