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マルチアダプター動作において、この操作が適用されるデバイスの物理アダプターを示します。
CodecD3D12_VIDEO_ENCODER_CODEC4+4+4サポート状況を照会する対象のコーデックを指定する、D3D12_VIDEO_ENCODER_CODEC 列挙型のメンバー。
InputFormatDXGI_FORMAT4+8+8サポート状況を照会する対象のプロファイルを指定する D3D12_VIDEO_ENCODER_PROFILE_DESC 構造体。
CodecConfigurationD3D12_VIDEO_ENCODER_CODEC_CONFIGURATION16/8+16+12サポート状況を照会する対象のコーデック構成を表す D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION 構造体。
CodecGopSequenceD3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE16/8+32+20サポート状況を照会する対象の GOP 構造を表す D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE 構造体。
RateControlD3D12_VIDEO_ENCODER_RATE_CONTROL32/24+48+28サポート状況を照会する対象のレート制御設定を表す D3D12_VIDEO_ENCODER_RATE_CONTROL
IntraRefreshD3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE4+80+52サポート状況を照会する対象のイントラリフレッシュモードを指定する、D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE 列挙型のメンバー。
SubregionFrameEncodingD3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE4+84+56サポート状況を照会する対象のサブリージョンレイアウトモードを指定する、D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE 列挙型のメンバー。
ResolutionsListCountDWORD4+88+60pResolutionList フィールドで指定される解像度の数を示す UINT。
pResolutionListD3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC*8/4+96+64サポート状況を照会する対象のピクチャ解像度を指定する D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC の配列へのポインター。
MaxReferenceFramesInDPBDWORD4+104+68インターフレームに対して EncodeFrame を呼び出す際に使用される、過去の参照フレームの最大数を示す UINT。この値は、SuggestedLevel フィールドで返される推奨レベルの算出に使用されます。
ValidationFlagsD3D12_VIDEO_ENCODER_VALIDATION_FLAGS4+108+72SupportFlags フィールドに D3D12_VIDEO_ENCODER_SUPPORT_FLAG_GENERAL_SUPPORT_OK フラグが設定されていない場合に、その詳細を示す D3D12_VIDEO_ENCODER_VALIDATION_FLAGS 列挙型のフラグのビット単位のOR の組み合わせを受け取ります。詳細については「解説」を参照してください。
SupportFlagsD3D12_VIDEO_ENCODER_SUPPORT_FLAGS4+112+76指定されたエンコーダー機能および構成値に対するサポートの詳細を示す、D3D12_VIDEO_ENCODER_SUPPORT_FLAGS 列挙型のフラグのビット単位のOR の組み合わせを受け取ります。
SuggestedProfileD3D12_VIDEO_ENCODER_PROFILE_DESC16/8+120+80指定されたエンコーダー機能および構成値に対する推奨プロファイルを示す D3D12_VIDEO_ENCODER_PROFILE_DESC を受け取ります。
SuggestedLevelD3D12_VIDEO_ENCODER_LEVEL_SETTING16/8+136+88指定されたエンコーダー機能および構成値に対する推奨レベルを示す D3D12_VIDEO_ENCODER_LEVEL_SETTING を受け取ります。推奨レベルは、pResolutionList で指定されたリスト内の最大解像度を前提としています。
pResolutionDependentSupportD3D12_FEATURE_DATA_VIDEO_ENCODER_RESOLUTION_SUPPORT_LIMITS*8/4+152+96pResolutionList で指定された各解像度に対応する、解像度依存のサポート制限を示す D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOLUTION_SUPPORT_LIMITS 構造体の配列へのポインターを受け取ります。

公式ドキュメント

指定する機能が D3D12_FEATURE_VIDEO_ENCODER_SUPPORT である場合の ID3D12VideoDevice::CheckFeatureSupport の呼び出しにデータを提供します。指定されたビデオエンコード機能および構成値のサポート状況を示す値を取得します。

解説(Remarks)

この照会によって許可または拒否されるサポートは、同一のエンコードセッションで使用するように選択されたすべての機能を同時にサポートできるかどうかを示します。個別の照会呼び出しでは個々にサポートされていても、同時にはサポートされない機能が存在する場合があります。

たとえば、D3D12_FEATURE_VIDEO_ENCODER_INTRA_REFRESH_MODE を確認したときにイントラリフレッシュがサポートされており、かつ D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT_H264.MaxL1ReferencesForB > 0 を確認したときに B フレームがサポートされている場合があります。しかし、イントラリフレッシュと B フレームが同時にはサポートされない場合もあります。この場合、B フレームを含む CodecGopSequence と行ベースのイントラリフレッシュモードを指定して D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT を照会すると、D3D12_VIDEO_ENCODER_SUPPORT_FLAG_GENERAL_SUPPORT_OK フラグはオフになります。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#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