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

D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT

構造体
サイズx64: 48 バイト / x86: 28 バイト

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

フィールド

フィールドサイズx64x86説明
NodeIndexDWORD4+0+0マルチGPUアダプタにおける対象ノードのインデックスを指定する。単一GPUでは0。
CodecD3D12_VIDEO_ENCODER_CODEC4+4+4問い合わせ対象のエンコードコーデック(H264/HEVC等)を指定する。
ProfileD3D12_VIDEO_ENCODER_PROFILE_DESC16/8+8+8問い合わせ対象のコーデックプロファイル記述子を指定する。
IsSupportedBOOL4+24+16指定構成のピクチャ制御がサポートされるか否かを返す。TRUEで対応。
PictureSupportD3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT16/8+32+20サポートされるピクチャ制御の能力詳細を格納する出力メンバである。

各言語での定義

#include <windows.h>

// 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_CODEC_PICTURE_CONTROL_SUPPORT  (x64 16 / x86 8 バイト)
typedef struct D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT {
    DWORD DataSize;
    _Anonymous_e__Union Anonymous;
} D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT;

// D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT  (x64 48 / x86 28 バイト)
typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT {
    DWORD NodeIndex;
    D3D12_VIDEO_ENCODER_CODEC Codec;
    D3D12_VIDEO_ENCODER_PROFILE_DESC Profile;
    BOOL IsSupported;
    D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT PictureSupport;
} D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT;
using System;
using System.Runtime.InteropServices;

[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_CODEC_PICTURE_CONTROL_SUPPORT
{
    public uint DataSize;
    public _Anonymous_e__Union Anonymous;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT
{
    public uint NodeIndex;
    public int Codec;
    public D3D12_VIDEO_ENCODER_PROFILE_DESC Profile;
    [MarshalAs(UnmanagedType.Bool)] public bool IsSupported;
    public D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT PictureSupport;
}
Imports System.Runtime.InteropServices

<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_CODEC_PICTURE_CONTROL_SUPPORT
    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_CODEC_PICTURE_CONTROL_SUPPORT
    Public NodeIndex As UInteger
    Public Codec As Integer
    Public Profile As D3D12_VIDEO_ENCODER_PROFILE_DESC
    <MarshalAs(UnmanagedType.Bool)> Public IsSupported As Boolean
    Public PictureSupport As D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT
End Structure
import ctypes
from ctypes import wintypes

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

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

class D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT(ctypes.Structure):
    _fields_ = [
        ("NodeIndex", wintypes.DWORD),
        ("Codec", ctypes.c_int),
        ("Profile", D3D12_VIDEO_ENCODER_PROFILE_DESC),
        ("IsSupported", wintypes.BOOL),
        ("PictureSupport", D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT),
    ]
#[repr(C)]
pub struct D3D12_VIDEO_ENCODER_PROFILE_DESC {
    pub DataSize: u32,
    pub Anonymous: _Anonymous_e__Union,
}

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

#[repr(C)]
pub struct D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT {
    pub NodeIndex: u32,
    pub Codec: i32,
    pub Profile: D3D12_VIDEO_ENCODER_PROFILE_DESC,
    pub IsSupported: i32,
    pub PictureSupport: D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT,
}
import "golang.org/x/sys/windows"

type D3D12_VIDEO_ENCODER_PROFILE_DESC struct {
	DataSize uint32
	Anonymous _Anonymous_e__Union
}

type D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT struct {
	DataSize uint32
	Anonymous _Anonymous_e__Union
}

type D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT struct {
	NodeIndex uint32
	Codec int32
	Profile D3D12_VIDEO_ENCODER_PROFILE_DESC
	IsSupported int32
	PictureSupport D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT
}
type
  D3D12_VIDEO_ENCODER_PROFILE_DESC = record
    DataSize: DWORD;
    Anonymous: _Anonymous_e__Union;
  end;

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

  D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT = record
    NodeIndex: DWORD;
    Codec: Integer;
    Profile: D3D12_VIDEO_ENCODER_PROFILE_DESC;
    IsSupported: BOOL;
    PictureSupport: D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT;
  end;
const D3D12_VIDEO_ENCODER_PROFILE_DESC = extern struct {
    DataSize: u32,
    Anonymous: _Anonymous_e__Union,
};

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

const D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT = extern struct {
    NodeIndex: u32,
    Codec: i32,
    Profile: D3D12_VIDEO_ENCODER_PROFILE_DESC,
    IsSupported: i32,
    PictureSupport: D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT,
};
type
  D3D12_VIDEO_ENCODER_PROFILE_DESC {.bycopy.} = object
    DataSize: uint32
    Anonymous: _Anonymous_e__Union

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

  D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT {.bycopy.} = object
    NodeIndex: uint32
    Codec: int32
    Profile: D3D12_VIDEO_ENCODER_PROFILE_DESC
    IsSupported: int32
    PictureSupport: D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT
struct D3D12_VIDEO_ENCODER_PROFILE_DESC
{
    uint DataSize;
    _Anonymous_e__Union Anonymous;
}

struct D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT
{
    uint DataSize;
    _Anonymous_e__Union Anonymous;
}

struct D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT
{
    uint NodeIndex;
    int Codec;
    D3D12_VIDEO_ENCODER_PROFILE_DESC Profile;
    int IsSupported;
    D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT PictureSupport;
}

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_CODEC_PICTURE_CONTROL_SUPPORT サイズ: 28 バイト(x86)
dim st, 7    ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; NodeIndex : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Codec : D3D12_VIDEO_ENCODER_CODEC (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; Profile : D3D12_VIDEO_ENCODER_PROFILE_DESC (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; IsSupported : BOOL (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; PictureSupport : D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT (+20, 8byte)  varptr(st)+20 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; NodeIndex : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Codec : D3D12_VIDEO_ENCODER_CODEC (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; Profile : D3D12_VIDEO_ENCODER_PROFILE_DESC (+8, 16byte)  varptr(st)+8 を基点に操作(16byte:入れ子/配列)
; IsSupported : BOOL (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; PictureSupport : D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT (+32, 16byte)  varptr(st)+32 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global D3D12_VIDEO_ENCODER_PROFILE_DESC
    #field int DataSize
    #field byte Anonymous 8
#endstruct

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

#defstruct global D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT
    #field int NodeIndex
    #field int Codec
    #field D3D12_VIDEO_ENCODER_PROFILE_DESC Profile
    #field bool IsSupported
    #field D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT PictureSupport
#endstruct

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