# d3d12swapchainsink

d3d12swapchainsink offers DXGI swapchain created via IDXGIFactory2::CreateSwapChainForComposition for DirectComposition, WinUI3, and UWP applications, and presents video frames using swapchain

## Hierarchy

    GObject
        ╰──GInitiallyUnowned
            ╰──GstObject
                ╰──GstElement
                    ╰──GstBaseSink
                        ╰──GstVideoSink
                            ╰──d3d12swapchainsink

## Implemented interfaces

    GstColorBalance

## Factory details

Authors: – Seungha Yang

Classification: – `Sink/Video`

Rank – none

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 ]

Presence – always

Direction – sink

Object type – GstPad

## Action Signals

### last-rendered-sample

    g_signal_emit_by_name (videosink, "last-rendered-sample", remove_borders, &ret);

    ret = videosink.emit ("last-rendered-sample", remove_borders)

    let ret = videosink.emit ("last-rendered-sample", remove_borders);

Get last rendered swapchain backbuffer content

Parameters:

`videosink` (GstElement *) –

the d3d12swapchainsink

`remove_borders` (gboolean) –

Remove background borders

Returns (GstSample *) –

a GstSample of the last rendered swapchain backbuffer content or NULL if swapchain is not configured yet

Flags: Run Last / Action

Since : 1.28

### redraw

    g_signal_emit_by_name (videosink, "redraw");

    ret = videosink.emit ("redraw")

    let ret = videosink.emit ("redraw");

Redraw last buffer and present it

Parameters:

`videosink` (GstElement *) –

the d3d12swapchainsink

Flags: Run Last / Action

Since : 1.28

### resize

    g_signal_emit_by_name (param_0, "resize", arg0, arg1);

    ret = param_0.emit ("resize", arg0, arg1)

    let ret = param_0.emit ("resize", arg0, arg1);

Parameters:

`param_0` (GstElement *) –
No description available
`arg0` (guint) –
No description available
`arg1` (guint) –
No description available

Flags: Run Last / Action

### uv-remap

    g_signal_emit_by_name (videosink, "uv-remap", num_lut, lut, viewport, bg_color);

    ret = videosink.emit ("uv-remap", num_lut, lut, viewport, bg_color)

    let ret = videosink.emit ("uv-remap", num_lut, lut, viewport, bg_color);

Sets list of ID3D12Resource for UV coordinates remapping. Valid formats are R8G8B8A8_UNORM and R16G16B16A16_UNORM. R -> U, G -> U, B -> unused, and A -> mask where A >= 0.5 applies remapping, otherwise fill background color"

TopLeftX, TopLeftY, Width, and Height values are used to calculate final viewport size. The coordinates must be normalized value in [0, 1] range instead of real viewport size.

Parameters:

`videosink` (GstElement *) –

the d3d12swapchainsink

`num_lut` (guint) –

LUT resource array length

`lut` (gpointer) –

Array of ID3D12Resource used for UV remap operation

`viewport` (gpointer) –

Array of D3D12_VIEWPORT

`bg_color` (gpointer) –

Array of background color represented via ARGB64 value

Flags: Run Last / Action

Since : 1.28

## Properties

### adapter

    “adapter” gint

Adapter index for creating device (-1 for default)

Flags : Read / Write

Default value : -1

### border-color

    “border-color” guint64

ARGB64 representation of the border color to use

Flags : Read / Write

Default value : 18446462598732840960

### brightness

    “brightness” gdouble

brightness

Flags : Read / Write

Default value : 0

### contrast

    “contrast” gdouble

contrast

Flags : Read / Write

Default value : 1

### force-aspect-ratio

    “force-aspect-ratio” gboolean

When enabled, scaling will respect original aspect ratio

Flags : Read / Write

Default value : true

### hue

    “hue” gdouble

hue

Flags : Read / Write

Default value : 0

### max-mip-levels

    “max-mip-levels” guint

Flags : Read / Write

Default value : 1

Since : 1.26

### msaa

    “msaa” GstD3D12MSAAMode *

MSAA (Multi-Sampling Anti-Aliasing) level

Flags : Read / Write

Default value : disabled (0)

### sampling-method

    “sampling-method” GstD3D12SamplingMethod *

Sampler filter type to use

Flags : Read / Write

Default value : bilinear (1)

### saturation

    “saturation” gdouble

saturation

Flags : Read / Write

Default value : 1

### swapchain

    “swapchain” gpointer

DXGI swapchain handle

Flags : Read

### swapchain-height

    “swapchain-height” guint

Height of swapchain buffers

Flags : Read

Default value : 720

### swapchain-width

    “swapchain-width” guint

Width of swapchain buffers

Flags : Read

Default value : 1280

The results of the search are