Win32 API 日本語リファレンス
ホームMedia.MediaFoundation › D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT

D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT

構造体
サイズx64: 160 バイト / x86: 100 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
NodeIndexDWORD4+0+0マルチGPUアダプタにおける対象ノードのインデックスを指定する。
CodecD3D12_VIDEO_ENCODER_CODEC4+4+4問い合わせ対象のエンコードコーデックを指定する。
InputFormatDXGI_FORMAT4+8+8入力フレームのDXGIピクセルフォーマットを指定する。
CodecConfigurationD3D12_VIDEO_ENCODER_CODEC_CONFIGURATION16/8+16+12問い合わせ対象のコーデック構成を指定する。
CodecGopSequenceD3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE16/8+32+20問い合わせ対象のGOP構造を指定する。
RateControlD3D12_VIDEO_ENCODER_RATE_CONTROL32/24+48+28問い合わせ対象のレート制御設定を指定する。
IntraRefreshD3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE4+80+52問い合わせ対象のイントラリフレッシュモードを指定する。
SubregionFrameEncodingD3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE4+84+56問い合わせ対象のサブリージョン(スライス)分割モードを指定する。
ResolutionsListCountDWORD4+88+60pResolutionListが指す解像度配列の要素数を指定する。
pResolutionListD3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC*8/4+96+64問い合わせ対象の解像度記述子配列へのポインタである。
MaxReferenceFramesInDPBDWORD4+104+68DPBに保持できる参照フレームの最大数を返す。
ValidationFlagsD3D12_VIDEO_ENCODER_VALIDATION_FLAGS4+108+72指定構成が非対応の場合にどの項目が原因かを示す検証フラグを返す。
SupportFlagsD3D12_VIDEO_ENCODER_SUPPORT_FLAGS4+112+76サポートされる機能を示すフラグの組み合わせを返す。
SuggestedProfileD3D12_VIDEO_ENCODER_PROFILE_DESC16/8+120+80ドライバが推奨するプロファイル記述子を返す。
SuggestedLevelD3D12_VIDEO_ENCODER_LEVEL_SETTING16/8+136+88ドライバが推奨するレベル設定を返す。
pResolutionDependentSupportD3D12_FEATURE_DATA_VIDEO_ENCODER_RESOLUTION_SUPPORT_LIMITS*8/4+152+96解像度ごとのサポート上限情報配列へのポインタである。

各言語での定義

#include <windows.h>

// D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION  (x64 16 / x86 8 バイト)
typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION {
    DWORD DataSize;
    _Anonymous_e__Union Anonymous;
} D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION;

// D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE  (x64 16 / x86 8 バイト)
typedef struct D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE {
    DWORD DataSize;
    _Anonymous_e__Union Anonymous;
} D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE;

// D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS  (x64 16 / x86 8 バイト)
typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS {
    DWORD DataSize;
    _Anonymous_e__Union Anonymous;
} D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS;

// DXGI_RATIONAL  (x64 8 / x86 8 バイト)
typedef struct DXGI_RATIONAL {
    DWORD Numerator;
    DWORD Denominator;
} DXGI_RATIONAL;

// D3D12_VIDEO_ENCODER_RATE_CONTROL  (x64 32 / x86 24 バイト)
typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL {
    D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE Mode;
    D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAGS Flags;
    D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS ConfigParams;
    DXGI_RATIONAL TargetFrameRate;
} D3D12_VIDEO_ENCODER_RATE_CONTROL;

// D3D12_VIDEO_ENCODER_PROFILE_DESC  (x64 16 / x86 8 バイト)
typedef struct D3D12_VIDEO_ENCODER_PROFILE_DESC {
    DWORD DataSize;
    _Anonymous_e__Union Anonymous;
} D3D12_VIDEO_ENCODER_PROFILE_DESC;

// D3D12_VIDEO_ENCODER_LEVEL_SETTING  (x64 16 / x86 8 バイト)
typedef struct D3D12_VIDEO_ENCODER_LEVEL_SETTING {
    DWORD DataSize;
    _Anonymous_e__Union Anonymous;
} D3D12_VIDEO_ENCODER_LEVEL_SETTING;

// D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT  (x64 160 / x86 100 バイト)
typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT {
    DWORD NodeIndex;
    D3D12_VIDEO_ENCODER_CODEC Codec;
    DXGI_FORMAT InputFormat;
    D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION CodecConfiguration;
    D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE CodecGopSequence;
    D3D12_VIDEO_ENCODER_RATE_CONTROL RateControl;
    D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE IntraRefresh;
    D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE SubregionFrameEncoding;
    DWORD ResolutionsListCount;
    D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC* pResolutionList;
    DWORD MaxReferenceFramesInDPB;
    D3D12_VIDEO_ENCODER_VALIDATION_FLAGS ValidationFlags;
    D3D12_VIDEO_ENCODER_SUPPORT_FLAGS SupportFlags;
    D3D12_VIDEO_ENCODER_PROFILE_DESC SuggestedProfile;
    D3D12_VIDEO_ENCODER_LEVEL_SETTING SuggestedLevel;
    D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOLUTION_SUPPORT_LIMITS* pResolutionDependentSupport;
} D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION
{
    public uint DataSize;
    public _Anonymous_e__Union Anonymous;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE
{
    public uint DataSize;
    public _Anonymous_e__Union Anonymous;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS
{
    public uint DataSize;
    public _Anonymous_e__Union Anonymous;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXGI_RATIONAL
{
    public uint Numerator;
    public uint Denominator;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_ENCODER_RATE_CONTROL
{
    public int Mode;
    public int Flags;
    public D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS ConfigParams;
    public DXGI_RATIONAL TargetFrameRate;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_ENCODER_PROFILE_DESC
{
    public uint DataSize;
    public _Anonymous_e__Union Anonymous;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_ENCODER_LEVEL_SETTING
{
    public uint DataSize;
    public _Anonymous_e__Union Anonymous;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT
{
    public uint NodeIndex;
    public int Codec;
    public int InputFormat;
    public D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION CodecConfiguration;
    public D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE CodecGopSequence;
    public D3D12_VIDEO_ENCODER_RATE_CONTROL RateControl;
    public int IntraRefresh;
    public int SubregionFrameEncoding;
    public uint ResolutionsListCount;
    public IntPtr pResolutionList;
    public uint MaxReferenceFramesInDPB;
    public int ValidationFlags;
    public int SupportFlags;
    public D3D12_VIDEO_ENCODER_PROFILE_DESC SuggestedProfile;
    public D3D12_VIDEO_ENCODER_LEVEL_SETTING SuggestedLevel;
    public IntPtr pResolutionDependentSupport;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION
    Public DataSize As UInteger
    Public Anonymous As _Anonymous_e__Union
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE
    Public DataSize As UInteger
    Public Anonymous As _Anonymous_e__Union
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS
    Public DataSize As UInteger
    Public Anonymous As _Anonymous_e__Union
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXGI_RATIONAL
    Public Numerator As UInteger
    Public Denominator As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_ENCODER_RATE_CONTROL
    Public Mode As Integer
    Public Flags As Integer
    Public ConfigParams As D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS
    Public TargetFrameRate As DXGI_RATIONAL
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_ENCODER_PROFILE_DESC
    Public DataSize As UInteger
    Public Anonymous As _Anonymous_e__Union
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_ENCODER_LEVEL_SETTING
    Public DataSize As UInteger
    Public Anonymous As _Anonymous_e__Union
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT
    Public NodeIndex As UInteger
    Public Codec As Integer
    Public InputFormat As Integer
    Public CodecConfiguration As D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION
    Public CodecGopSequence As D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE
    Public RateControl As D3D12_VIDEO_ENCODER_RATE_CONTROL
    Public IntraRefresh As Integer
    Public SubregionFrameEncoding As Integer
    Public ResolutionsListCount As UInteger
    Public pResolutionList As IntPtr
    Public MaxReferenceFramesInDPB As UInteger
    Public ValidationFlags As Integer
    Public SupportFlags As Integer
    Public SuggestedProfile As D3D12_VIDEO_ENCODER_PROFILE_DESC
    Public SuggestedLevel As D3D12_VIDEO_ENCODER_LEVEL_SETTING
    Public pResolutionDependentSupport As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION(ctypes.Structure):
    _fields_ = [
        ("DataSize", wintypes.DWORD),
        ("Anonymous", _Anonymous_e__Union),
    ]

class D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE(ctypes.Structure):
    _fields_ = [
        ("DataSize", wintypes.DWORD),
        ("Anonymous", _Anonymous_e__Union),
    ]

class D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS(ctypes.Structure):
    _fields_ = [
        ("DataSize", wintypes.DWORD),
        ("Anonymous", _Anonymous_e__Union),
    ]

class DXGI_RATIONAL(ctypes.Structure):
    _fields_ = [
        ("Numerator", wintypes.DWORD),
        ("Denominator", wintypes.DWORD),
    ]

class D3D12_VIDEO_ENCODER_RATE_CONTROL(ctypes.Structure):
    _fields_ = [
        ("Mode", ctypes.c_int),
        ("Flags", ctypes.c_int),
        ("ConfigParams", D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS),
        ("TargetFrameRate", DXGI_RATIONAL),
    ]

class D3D12_VIDEO_ENCODER_PROFILE_DESC(ctypes.Structure):
    _fields_ = [
        ("DataSize", wintypes.DWORD),
        ("Anonymous", _Anonymous_e__Union),
    ]

class D3D12_VIDEO_ENCODER_LEVEL_SETTING(ctypes.Structure):
    _fields_ = [
        ("DataSize", wintypes.DWORD),
        ("Anonymous", _Anonymous_e__Union),
    ]

class D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT(ctypes.Structure):
    _fields_ = [
        ("NodeIndex", wintypes.DWORD),
        ("Codec", ctypes.c_int),
        ("InputFormat", ctypes.c_int),
        ("CodecConfiguration", D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION),
        ("CodecGopSequence", D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE),
        ("RateControl", D3D12_VIDEO_ENCODER_RATE_CONTROL),
        ("IntraRefresh", ctypes.c_int),
        ("SubregionFrameEncoding", ctypes.c_int),
        ("ResolutionsListCount", wintypes.DWORD),
        ("pResolutionList", ctypes.c_void_p),
        ("MaxReferenceFramesInDPB", wintypes.DWORD),
        ("ValidationFlags", ctypes.c_int),
        ("SupportFlags", ctypes.c_int),
        ("SuggestedProfile", D3D12_VIDEO_ENCODER_PROFILE_DESC),
        ("SuggestedLevel", D3D12_VIDEO_ENCODER_LEVEL_SETTING),
        ("pResolutionDependentSupport", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION {
    pub DataSize: u32,
    pub Anonymous: _Anonymous_e__Union,
}

#[repr(C)]
pub struct D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE {
    pub DataSize: u32,
    pub Anonymous: _Anonymous_e__Union,
}

#[repr(C)]
pub struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS {
    pub DataSize: u32,
    pub Anonymous: _Anonymous_e__Union,
}

#[repr(C)]
pub struct DXGI_RATIONAL {
    pub Numerator: u32,
    pub Denominator: u32,
}

#[repr(C)]
pub struct D3D12_VIDEO_ENCODER_RATE_CONTROL {
    pub Mode: i32,
    pub Flags: i32,
    pub ConfigParams: D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS,
    pub TargetFrameRate: DXGI_RATIONAL,
}

#[repr(C)]
pub struct D3D12_VIDEO_ENCODER_PROFILE_DESC {
    pub DataSize: u32,
    pub Anonymous: _Anonymous_e__Union,
}

#[repr(C)]
pub struct D3D12_VIDEO_ENCODER_LEVEL_SETTING {
    pub DataSize: u32,
    pub Anonymous: _Anonymous_e__Union,
}

#[repr(C)]
pub struct D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT {
    pub NodeIndex: u32,
    pub Codec: i32,
    pub InputFormat: i32,
    pub CodecConfiguration: D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION,
    pub CodecGopSequence: D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE,
    pub RateControl: D3D12_VIDEO_ENCODER_RATE_CONTROL,
    pub IntraRefresh: i32,
    pub SubregionFrameEncoding: i32,
    pub ResolutionsListCount: u32,
    pub pResolutionList: *mut core::ffi::c_void,
    pub MaxReferenceFramesInDPB: u32,
    pub ValidationFlags: i32,
    pub SupportFlags: i32,
    pub SuggestedProfile: D3D12_VIDEO_ENCODER_PROFILE_DESC,
    pub SuggestedLevel: D3D12_VIDEO_ENCODER_LEVEL_SETTING,
    pub pResolutionDependentSupport: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION struct {
	DataSize uint32
	Anonymous _Anonymous_e__Union
}

type D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE struct {
	DataSize uint32
	Anonymous _Anonymous_e__Union
}

type D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS struct {
	DataSize uint32
	Anonymous _Anonymous_e__Union
}

type DXGI_RATIONAL struct {
	Numerator uint32
	Denominator uint32
}

type D3D12_VIDEO_ENCODER_RATE_CONTROL struct {
	Mode int32
	Flags int32
	ConfigParams D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS
	TargetFrameRate DXGI_RATIONAL
}

type D3D12_VIDEO_ENCODER_PROFILE_DESC struct {
	DataSize uint32
	Anonymous _Anonymous_e__Union
}

type D3D12_VIDEO_ENCODER_LEVEL_SETTING struct {
	DataSize uint32
	Anonymous _Anonymous_e__Union
}

type D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT struct {
	NodeIndex uint32
	Codec int32
	InputFormat int32
	CodecConfiguration D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION
	CodecGopSequence D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE
	RateControl D3D12_VIDEO_ENCODER_RATE_CONTROL
	IntraRefresh int32
	SubregionFrameEncoding int32
	ResolutionsListCount uint32
	pResolutionList uintptr
	MaxReferenceFramesInDPB uint32
	ValidationFlags int32
	SupportFlags int32
	SuggestedProfile D3D12_VIDEO_ENCODER_PROFILE_DESC
	SuggestedLevel D3D12_VIDEO_ENCODER_LEVEL_SETTING
	pResolutionDependentSupport uintptr
}
type
  D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION = record
    DataSize: DWORD;
    Anonymous: _Anonymous_e__Union;
  end;

  D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE = record
    DataSize: DWORD;
    Anonymous: _Anonymous_e__Union;
  end;

  D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS = record
    DataSize: DWORD;
    Anonymous: _Anonymous_e__Union;
  end;

  DXGI_RATIONAL = record
    Numerator: DWORD;
    Denominator: DWORD;
  end;

  D3D12_VIDEO_ENCODER_RATE_CONTROL = record
    Mode: Integer;
    Flags: Integer;
    ConfigParams: D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS;
    TargetFrameRate: DXGI_RATIONAL;
  end;

  D3D12_VIDEO_ENCODER_PROFILE_DESC = record
    DataSize: DWORD;
    Anonymous: _Anonymous_e__Union;
  end;

  D3D12_VIDEO_ENCODER_LEVEL_SETTING = record
    DataSize: DWORD;
    Anonymous: _Anonymous_e__Union;
  end;

  D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT = record
    NodeIndex: DWORD;
    Codec: Integer;
    InputFormat: Integer;
    CodecConfiguration: D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION;
    CodecGopSequence: D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE;
    RateControl: D3D12_VIDEO_ENCODER_RATE_CONTROL;
    IntraRefresh: Integer;
    SubregionFrameEncoding: Integer;
    ResolutionsListCount: DWORD;
    pResolutionList: Pointer;
    MaxReferenceFramesInDPB: DWORD;
    ValidationFlags: Integer;
    SupportFlags: Integer;
    SuggestedProfile: D3D12_VIDEO_ENCODER_PROFILE_DESC;
    SuggestedLevel: D3D12_VIDEO_ENCODER_LEVEL_SETTING;
    pResolutionDependentSupport: Pointer;
  end;
const D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION = extern struct {
    DataSize: u32,
    Anonymous: _Anonymous_e__Union,
};

const D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE = extern struct {
    DataSize: u32,
    Anonymous: _Anonymous_e__Union,
};

const D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS = extern struct {
    DataSize: u32,
    Anonymous: _Anonymous_e__Union,
};

const DXGI_RATIONAL = extern struct {
    Numerator: u32,
    Denominator: u32,
};

const D3D12_VIDEO_ENCODER_RATE_CONTROL = extern struct {
    Mode: i32,
    Flags: i32,
    ConfigParams: D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS,
    TargetFrameRate: DXGI_RATIONAL,
};

const D3D12_VIDEO_ENCODER_PROFILE_DESC = extern struct {
    DataSize: u32,
    Anonymous: _Anonymous_e__Union,
};

const D3D12_VIDEO_ENCODER_LEVEL_SETTING = extern struct {
    DataSize: u32,
    Anonymous: _Anonymous_e__Union,
};

const D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT = extern struct {
    NodeIndex: u32,
    Codec: i32,
    InputFormat: i32,
    CodecConfiguration: D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION,
    CodecGopSequence: D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE,
    RateControl: D3D12_VIDEO_ENCODER_RATE_CONTROL,
    IntraRefresh: i32,
    SubregionFrameEncoding: i32,
    ResolutionsListCount: u32,
    pResolutionList: ?*anyopaque,
    MaxReferenceFramesInDPB: u32,
    ValidationFlags: i32,
    SupportFlags: i32,
    SuggestedProfile: D3D12_VIDEO_ENCODER_PROFILE_DESC,
    SuggestedLevel: D3D12_VIDEO_ENCODER_LEVEL_SETTING,
    pResolutionDependentSupport: ?*anyopaque,
};
type
  D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION {.bycopy.} = object
    DataSize: uint32
    Anonymous: _Anonymous_e__Union

  D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE {.bycopy.} = object
    DataSize: uint32
    Anonymous: _Anonymous_e__Union

  D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS {.bycopy.} = object
    DataSize: uint32
    Anonymous: _Anonymous_e__Union

  DXGI_RATIONAL {.bycopy.} = object
    Numerator: uint32
    Denominator: uint32

  D3D12_VIDEO_ENCODER_RATE_CONTROL {.bycopy.} = object
    Mode: int32
    Flags: int32
    ConfigParams: D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS
    TargetFrameRate: DXGI_RATIONAL

  D3D12_VIDEO_ENCODER_PROFILE_DESC {.bycopy.} = object
    DataSize: uint32
    Anonymous: _Anonymous_e__Union

  D3D12_VIDEO_ENCODER_LEVEL_SETTING {.bycopy.} = object
    DataSize: uint32
    Anonymous: _Anonymous_e__Union

  D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT {.bycopy.} = object
    NodeIndex: uint32
    Codec: int32
    InputFormat: int32
    CodecConfiguration: D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION
    CodecGopSequence: D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE
    RateControl: D3D12_VIDEO_ENCODER_RATE_CONTROL
    IntraRefresh: int32
    SubregionFrameEncoding: int32
    ResolutionsListCount: uint32
    pResolutionList: pointer
    MaxReferenceFramesInDPB: uint32
    ValidationFlags: int32
    SupportFlags: int32
    SuggestedProfile: D3D12_VIDEO_ENCODER_PROFILE_DESC
    SuggestedLevel: D3D12_VIDEO_ENCODER_LEVEL_SETTING
    pResolutionDependentSupport: pointer
struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION
{
    uint DataSize;
    _Anonymous_e__Union Anonymous;
}

struct D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE
{
    uint DataSize;
    _Anonymous_e__Union Anonymous;
}

struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS
{
    uint DataSize;
    _Anonymous_e__Union Anonymous;
}

struct DXGI_RATIONAL
{
    uint Numerator;
    uint Denominator;
}

struct D3D12_VIDEO_ENCODER_RATE_CONTROL
{
    int Mode;
    int Flags;
    D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS ConfigParams;
    DXGI_RATIONAL TargetFrameRate;
}

struct D3D12_VIDEO_ENCODER_PROFILE_DESC
{
    uint DataSize;
    _Anonymous_e__Union Anonymous;
}

struct D3D12_VIDEO_ENCODER_LEVEL_SETTING
{
    uint DataSize;
    _Anonymous_e__Union Anonymous;
}

struct D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT
{
    uint NodeIndex;
    int Codec;
    int InputFormat;
    D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION CodecConfiguration;
    D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE CodecGopSequence;
    D3D12_VIDEO_ENCODER_RATE_CONTROL RateControl;
    int IntraRefresh;
    int SubregionFrameEncoding;
    uint ResolutionsListCount;
    void* pResolutionList;
    uint MaxReferenceFramesInDPB;
    int ValidationFlags;
    int SupportFlags;
    D3D12_VIDEO_ENCODER_PROFILE_DESC SuggestedProfile;
    D3D12_VIDEO_ENCODER_LEVEL_SETTING SuggestedLevel;
    void* pResolutionDependentSupport;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT サイズ: 100 バイト(x86)
dim st, 25    ; 4byte整数×25(構造体サイズ 100 / 4 切り上げ)
; NodeIndex : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Codec : D3D12_VIDEO_ENCODER_CODEC (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; InputFormat : DXGI_FORMAT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; CodecConfiguration : D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION (+12, 8byte)  varptr(st)+12 を基点に操作(8byte:入れ子/配列)
; CodecGopSequence : D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE (+20, 8byte)  varptr(st)+20 を基点に操作(8byte:入れ子/配列)
; RateControl : D3D12_VIDEO_ENCODER_RATE_CONTROL (+28, 24byte)  varptr(st)+28 を基点に操作(24byte:入れ子/配列)
; IntraRefresh : D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; SubregionFrameEncoding : D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; ResolutionsListCount : DWORD (+60, 4byte)  st.15 = 値  /  値 = st.15   (lpoke/lpeek も可)
; pResolutionList : D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC* (+64, 4byte)  varptr(st)+64 を基点に操作(4byte:入れ子/配列)
; MaxReferenceFramesInDPB : DWORD (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; ValidationFlags : D3D12_VIDEO_ENCODER_VALIDATION_FLAGS (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; SupportFlags : D3D12_VIDEO_ENCODER_SUPPORT_FLAGS (+76, 4byte)  st.19 = 値  /  値 = st.19   (lpoke/lpeek も可)
; SuggestedProfile : D3D12_VIDEO_ENCODER_PROFILE_DESC (+80, 8byte)  varptr(st)+80 を基点に操作(8byte:入れ子/配列)
; SuggestedLevel : D3D12_VIDEO_ENCODER_LEVEL_SETTING (+88, 8byte)  varptr(st)+88 を基点に操作(8byte:入れ子/配列)
; pResolutionDependentSupport : D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOLUTION_SUPPORT_LIMITS* (+96, 4byte)  varptr(st)+96 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT サイズ: 160 バイト(x64)
dim st, 40    ; 4byte整数×40(構造体サイズ 160 / 4 切り上げ)
; NodeIndex : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Codec : D3D12_VIDEO_ENCODER_CODEC (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; InputFormat : DXGI_FORMAT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; CodecConfiguration : D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION (+16, 16byte)  varptr(st)+16 を基点に操作(16byte:入れ子/配列)
; CodecGopSequence : D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE (+32, 16byte)  varptr(st)+32 を基点に操作(16byte:入れ子/配列)
; RateControl : D3D12_VIDEO_ENCODER_RATE_CONTROL (+48, 32byte)  varptr(st)+48 を基点に操作(32byte:入れ子/配列)
; IntraRefresh : D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE (+80, 4byte)  st.20 = 値  /  値 = st.20   (lpoke/lpeek も可)
; SubregionFrameEncoding : D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE (+84, 4byte)  st.21 = 値  /  値 = st.21   (lpoke/lpeek も可)
; ResolutionsListCount : DWORD (+88, 4byte)  st.22 = 値  /  値 = st.22   (lpoke/lpeek も可)
; pResolutionList : D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC* (+96, 8byte)  varptr(st)+96 を基点に操作(8byte:入れ子/配列)
; MaxReferenceFramesInDPB : DWORD (+104, 4byte)  st.26 = 値  /  値 = st.26   (lpoke/lpeek も可)
; ValidationFlags : D3D12_VIDEO_ENCODER_VALIDATION_FLAGS (+108, 4byte)  st.27 = 値  /  値 = st.27   (lpoke/lpeek も可)
; SupportFlags : D3D12_VIDEO_ENCODER_SUPPORT_FLAGS (+112, 4byte)  st.28 = 値  /  値 = st.28   (lpoke/lpeek も可)
; SuggestedProfile : D3D12_VIDEO_ENCODER_PROFILE_DESC (+120, 16byte)  varptr(st)+120 を基点に操作(16byte:入れ子/配列)
; SuggestedLevel : D3D12_VIDEO_ENCODER_LEVEL_SETTING (+136, 16byte)  varptr(st)+136 を基点に操作(16byte:入れ子/配列)
; pResolutionDependentSupport : D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOLUTION_SUPPORT_LIMITS* (+152, 8byte)  varptr(st)+152 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION
    #field int DataSize
    #field byte Anonymous 8
#endstruct

#defstruct global D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE
    #field int DataSize
    #field byte Anonymous 8
#endstruct

#defstruct global D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS
    #field int DataSize
    #field byte Anonymous 8
#endstruct

#defstruct global DXGI_RATIONAL
    #field int Numerator
    #field int Denominator
#endstruct

#defstruct global D3D12_VIDEO_ENCODER_RATE_CONTROL
    #field int Mode
    #field int Flags
    #field D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS ConfigParams
    #field DXGI_RATIONAL TargetFrameRate
#endstruct

#defstruct global D3D12_VIDEO_ENCODER_PROFILE_DESC
    #field int DataSize
    #field byte Anonymous 8
#endstruct

#defstruct global D3D12_VIDEO_ENCODER_LEVEL_SETTING
    #field int DataSize
    #field byte Anonymous 8
#endstruct

#defstruct global D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT
    #field int NodeIndex
    #field int Codec
    #field int InputFormat
    #field D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION CodecConfiguration
    #field D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE CodecGopSequence
    #field D3D12_VIDEO_ENCODER_RATE_CONTROL RateControl
    #field int IntraRefresh
    #field int SubregionFrameEncoding
    #field int ResolutionsListCount
    #field intptr pResolutionList
    #field int MaxReferenceFramesInDPB
    #field int ValidationFlags
    #field int SupportFlags
    #field D3D12_VIDEO_ENCODER_PROFILE_DESC SuggestedProfile
    #field D3D12_VIDEO_ENCODER_LEVEL_SETTING SuggestedLevel
    #field intptr pResolutionDependentSupport
#endstruct

stdim st, D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT        ; NSTRUCT 変数を確保
st->NodeIndex = 100
mes "NodeIndex=" + st->NodeIndex