# d3d11videosink

Direct3D11 based video render element

## Example launch line

    gst-launch-1.0 videotestsrc ! d3d11upload ! d3d11videosink

This pipeline will display test video stream on screen via d3d11videosink

## Hierarchy

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

## Implemented interfaces

    GstVideoOverlay
    GstNavigation

## Factory details

Authors: – Seungha Yang

Classification: – `Sink/Video`

Rank – primary

Plugin – d3d11

Package – GStreamer Bad Plug-ins

## Pad Templates

### `sink`

    video/x-raw(memory:D3D11Memory):
             format: { BGRA, RGBA, RGB10A2_LE, BGRx, RGBx, VUYA, NV12, NV21, P010_10LE, P012_LE, P016_LE, I420, YV12, I420_10LE, I420_12LE, Y42B, I422_10LE, I422_12LE, Y444, Y444_10LE, Y444_12LE, Y444_16LE, GRAY8, GRAY16_LE, Y410 }
              width: [ 1, 16384 ]
             height: [ 1, 16384 ]
          framerate: [ 0/1, 2147483647/1 ]

    video/x-raw(memory:D3D11Memory, meta:GstVideoOverlayComposition):
             format: { BGRA, RGBA, RGB10A2_LE, BGRx, RGBx, VUYA, NV12, NV21, P010_10LE, P012_LE, P016_LE, I420, YV12, I420_10LE, I420_12LE, Y42B, I422_10LE, I422_12LE, Y444, Y444_10LE, Y444_12LE, Y444_16LE, GRAY8, GRAY16_LE, Y410 }
              width: [ 1, 16384 ]
             height: [ 1, 16384 ]
          framerate: [ 0/1, 2147483647/1 ]
    video/x-raw:
             format: { BGRA, RGBA, RGB10A2_LE, BGRx, RGBx, VUYA, NV12, NV21, P010_10LE, P012_LE, P016_LE, I420, YV12, I420_10LE, I420_12LE, Y42B, I422_10LE, I422_12LE, Y444, Y444_10LE, Y444_12LE, Y444_16LE, GRAY8, GRAY16_LE, Y410 }
              width: [ 1, 16384 ]
             height: [ 1, 16384 ]
          framerate: [ 0/1, 2147483647/1 ]

    video/x-raw(memory:SystemMemory, meta:GstVideoOverlayComposition):
             format: { BGRA, RGBA, RGB10A2_LE, BGRx, RGBx, VUYA, NV12, NV21, P010_10LE, P012_LE, P016_LE, I420, YV12, I420_10LE, I420_12LE, Y42B, I422_10LE, I422_12LE, Y444, Y444_10LE, Y444_12LE, Y444_16LE, GRAY8, GRAY16_LE, Y410 }
              width: [ 1, 16384 ]
             height: [ 1, 16384 ]
          framerate: [ 0/1, 2147483647/1 ]

Presence – always

Direction – sink

Object type – GstPad

## Signals

### begin-draw

    begin_draw_callback (GstElement * videosink,
                         gpointer udata)

    def begin_draw_callback (videosink, udata):
        #python callback for the 'begin-draw' signal

    function begin_draw_callback(videosink: GstElement * videosink, udata: gpointer udata): {
        // javascript callback for the 'begin-draw' signal
    }

Emitted when sink has a texture to draw. Application needs to invoke draw action signal before returning from begin-draw signal handler.

Parameters:

`videosink` –

the d3d11videosink

`udata` –
No description available

Flags: Run Last

Since : 1.20

## Action Signals

### draw

    g_signal_emit_by_name (videosink, "draw", shard_handle, texture_misc_flags, acquire_key, release_key, &ret);

    ret = videosink.emit ("draw", shard_handle, texture_misc_flags, acquire_key, release_key)

    let ret = videosink.emit ("draw", shard_handle, texture_misc_flags, acquire_key, release_key);

Draws on a shared texture. shard_handle must be a valid pointer to a HANDLE which was obtained via IDXGIResource::GetSharedHandle or IDXGIResource1::CreateSharedHandle.

If the texture was created with D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX flag, caller must specify valid acquire_key and release_key. Otherwise (i.e., created with D3D11_RESOURCE_MISC_SHARED flag), acquire_key and release_key will be ignored.

Parameters:

`videosink` (GstElement *) –

the d3d11videosink

`shard_handle` (gpointer) –

a pointer to HANDLE

`texture_misc_flags` (guint) –

a D3D11_RESOURCE_MISC_FLAG value

`acquire_key` (guint64) –

a key value used for IDXGIKeyedMutex::AcquireSync

`release_key` (guint64) –

a key value used for IDXGIKeyedMutex::ReleaseSync

Returns (gboolean) –
No description available

Flags: Run Last / Action

Since : 1.20

## Properties

### adapter

    “adapter” gint

Adapter index for creating device (-1 for default)

Flags : Read / Write

Default value : -1

### draw-on-shared-texture

    “draw-on-shared-texture” gboolean

Instruct the sink to draw on a shared texture provided by user. User must watch begin-draw signal and should call draw method on the begin-draw signal handler.

Currently supported formats for user texture are:

- DXGI_FORMAT_R8G8B8A8_UNORM
- DXGI_FORMAT_B8G8R8A8_UNORM
- DXGI_FORMAT_R10G10B10A2_UNORM

Flags : Read / Write

Default value : false

### force-aspect-ratio

    “force-aspect-ratio” gboolean

When enabled, scaling will respect original aspect ratio

Flags : Read / Write

Default value : true

### fullscreen

    “fullscreen” gboolean

Ignored when "fullscreen-toggle-mode" does not include "property"

Flags : Read / Write

Default value : false

### fullscreen-toggle-mode

    “fullscreen-toggle-mode” D3d11window-fullscreen-toggle-mode *

Full screen toggle mode used to trigger fullscreen mode change

Flags : Read / Write

Default value : none

## Named constants

### D3d11window-fullscreen-toggle-mode

#### Members

`none` (0x00000000) – GST_D3D11_WINDOW_FULLSCREEN_TOGGLE_MODE_NONE
`alt-enter` (0x00000002) – GST_D3D11_WINDOW_FULLSCREEN_TOGGLE_MODE_ALT_ENTER
`property` (0x00000004) – GST_D3D11_WINDOW_FULLSCREEN_TOGGLE_MODE_PROPERTY

The results of the search are