ホーム › Media.MediaFoundation › D3D12_FEATURE_DATA_VIDEO_ENCODER_HEAP_SIZE
D3D12_FEATURE_DATA_VIDEO_ENCODER_HEAP_SIZE
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| HeapDesc | D3D12_VIDEO_ENCODER_HEAP_DESC | 64/36 | +0 | +0 | サイズを問い合わせるエンコーダヒープの記述子D3D12_VIDEO_ENCODER_HEAP_DESC。 |
| IsSupported | BOOL | 4 | +64 | +36 | 指定ヒープ構成がサポートされるか否かを示すBOOL(出力)。 |
| MemoryPoolL0Size | ULONGLONG | 8 | +72 | +40 | メモリプールL0に必要なサイズ(バイト単位、出力)。 |
| MemoryPoolL1Size | ULONGLONG | 8 | +80 | +48 | メモリプールL1に必要なサイズ(バイト単位、出力)。 |
各言語での定義
#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_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_VIDEO_ENCODER_HEAP_DESC (x64 64 / x86 36 バイト)
typedef struct D3D12_VIDEO_ENCODER_HEAP_DESC {
DWORD NodeMask;
D3D12_VIDEO_ENCODER_HEAP_FLAGS Flags;
D3D12_VIDEO_ENCODER_CODEC EncodeCodec;
D3D12_VIDEO_ENCODER_PROFILE_DESC EncodeProfile;
D3D12_VIDEO_ENCODER_LEVEL_SETTING EncodeLevel;
DWORD ResolutionsListCount;
D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC* pResolutionList;
} D3D12_VIDEO_ENCODER_HEAP_DESC;
// D3D12_FEATURE_DATA_VIDEO_ENCODER_HEAP_SIZE (x64 88 / x86 56 バイト)
typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_HEAP_SIZE {
D3D12_VIDEO_ENCODER_HEAP_DESC HeapDesc;
BOOL IsSupported;
ULONGLONG MemoryPoolL0Size;
ULONGLONG MemoryPoolL1Size;
} D3D12_FEATURE_DATA_VIDEO_ENCODER_HEAP_SIZE;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_LEVEL_SETTING
{
public uint DataSize;
public _Anonymous_e__Union Anonymous;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_ENCODER_HEAP_DESC
{
public uint NodeMask;
public int Flags;
public int EncodeCodec;
public D3D12_VIDEO_ENCODER_PROFILE_DESC EncodeProfile;
public D3D12_VIDEO_ENCODER_LEVEL_SETTING EncodeLevel;
public uint ResolutionsListCount;
public IntPtr pResolutionList;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_FEATURE_DATA_VIDEO_ENCODER_HEAP_SIZE
{
public D3D12_VIDEO_ENCODER_HEAP_DESC HeapDesc;
[MarshalAs(UnmanagedType.Bool)] public bool IsSupported;
public ulong MemoryPoolL0Size;
public ulong MemoryPoolL1Size;
}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_LEVEL_SETTING
Public DataSize As UInteger
Public Anonymous As _Anonymous_e__Union
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_ENCODER_HEAP_DESC
Public NodeMask As UInteger
Public Flags As Integer
Public EncodeCodec As Integer
Public EncodeProfile As D3D12_VIDEO_ENCODER_PROFILE_DESC
Public EncodeLevel As D3D12_VIDEO_ENCODER_LEVEL_SETTING
Public ResolutionsListCount As UInteger
Public pResolutionList As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_FEATURE_DATA_VIDEO_ENCODER_HEAP_SIZE
Public HeapDesc As D3D12_VIDEO_ENCODER_HEAP_DESC
<MarshalAs(UnmanagedType.Bool)> Public IsSupported As Boolean
Public MemoryPoolL0Size As ULong
Public MemoryPoolL1Size As ULong
End Structureimport 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_LEVEL_SETTING(ctypes.Structure):
_fields_ = [
("DataSize", wintypes.DWORD),
("Anonymous", _Anonymous_e__Union),
]
class D3D12_VIDEO_ENCODER_HEAP_DESC(ctypes.Structure):
_fields_ = [
("NodeMask", wintypes.DWORD),
("Flags", ctypes.c_int),
("EncodeCodec", ctypes.c_int),
("EncodeProfile", D3D12_VIDEO_ENCODER_PROFILE_DESC),
("EncodeLevel", D3D12_VIDEO_ENCODER_LEVEL_SETTING),
("ResolutionsListCount", wintypes.DWORD),
("pResolutionList", ctypes.c_void_p),
]
class D3D12_FEATURE_DATA_VIDEO_ENCODER_HEAP_SIZE(ctypes.Structure):
_fields_ = [
("HeapDesc", D3D12_VIDEO_ENCODER_HEAP_DESC),
("IsSupported", wintypes.BOOL),
("MemoryPoolL0Size", ctypes.c_ulonglong),
("MemoryPoolL1Size", ctypes.c_ulonglong),
]#[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_VIDEO_ENCODER_HEAP_DESC {
pub NodeMask: u32,
pub Flags: i32,
pub EncodeCodec: i32,
pub EncodeProfile: D3D12_VIDEO_ENCODER_PROFILE_DESC,
pub EncodeLevel: D3D12_VIDEO_ENCODER_LEVEL_SETTING,
pub ResolutionsListCount: u32,
pub pResolutionList: *mut core::ffi::c_void,
}
#[repr(C)]
pub struct D3D12_FEATURE_DATA_VIDEO_ENCODER_HEAP_SIZE {
pub HeapDesc: D3D12_VIDEO_ENCODER_HEAP_DESC,
pub IsSupported: i32,
pub MemoryPoolL0Size: u64,
pub MemoryPoolL1Size: u64,
}import "golang.org/x/sys/windows"
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_VIDEO_ENCODER_HEAP_DESC struct {
NodeMask uint32
Flags int32
EncodeCodec int32
EncodeProfile D3D12_VIDEO_ENCODER_PROFILE_DESC
EncodeLevel D3D12_VIDEO_ENCODER_LEVEL_SETTING
ResolutionsListCount uint32
pResolutionList uintptr
}
type D3D12_FEATURE_DATA_VIDEO_ENCODER_HEAP_SIZE struct {
HeapDesc D3D12_VIDEO_ENCODER_HEAP_DESC
IsSupported int32
MemoryPoolL0Size uint64
MemoryPoolL1Size uint64
}type
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_VIDEO_ENCODER_HEAP_DESC = record
NodeMask: DWORD;
Flags: Integer;
EncodeCodec: Integer;
EncodeProfile: D3D12_VIDEO_ENCODER_PROFILE_DESC;
EncodeLevel: D3D12_VIDEO_ENCODER_LEVEL_SETTING;
ResolutionsListCount: DWORD;
pResolutionList: Pointer;
end;
D3D12_FEATURE_DATA_VIDEO_ENCODER_HEAP_SIZE = record
HeapDesc: D3D12_VIDEO_ENCODER_HEAP_DESC;
IsSupported: BOOL;
MemoryPoolL0Size: UInt64;
MemoryPoolL1Size: UInt64;
end;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_VIDEO_ENCODER_HEAP_DESC = extern struct {
NodeMask: u32,
Flags: i32,
EncodeCodec: i32,
EncodeProfile: D3D12_VIDEO_ENCODER_PROFILE_DESC,
EncodeLevel: D3D12_VIDEO_ENCODER_LEVEL_SETTING,
ResolutionsListCount: u32,
pResolutionList: ?*anyopaque,
};
const D3D12_FEATURE_DATA_VIDEO_ENCODER_HEAP_SIZE = extern struct {
HeapDesc: D3D12_VIDEO_ENCODER_HEAP_DESC,
IsSupported: i32,
MemoryPoolL0Size: u64,
MemoryPoolL1Size: u64,
};type
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_VIDEO_ENCODER_HEAP_DESC {.bycopy.} = object
NodeMask: uint32
Flags: int32
EncodeCodec: int32
EncodeProfile: D3D12_VIDEO_ENCODER_PROFILE_DESC
EncodeLevel: D3D12_VIDEO_ENCODER_LEVEL_SETTING
ResolutionsListCount: uint32
pResolutionList: pointer
D3D12_FEATURE_DATA_VIDEO_ENCODER_HEAP_SIZE {.bycopy.} = object
HeapDesc: D3D12_VIDEO_ENCODER_HEAP_DESC
IsSupported: int32
MemoryPoolL0Size: uint64
MemoryPoolL1Size: uint64struct 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_VIDEO_ENCODER_HEAP_DESC
{
uint NodeMask;
int Flags;
int EncodeCodec;
D3D12_VIDEO_ENCODER_PROFILE_DESC EncodeProfile;
D3D12_VIDEO_ENCODER_LEVEL_SETTING EncodeLevel;
uint ResolutionsListCount;
void* pResolutionList;
}
struct D3D12_FEATURE_DATA_VIDEO_ENCODER_HEAP_SIZE
{
D3D12_VIDEO_ENCODER_HEAP_DESC HeapDesc;
int IsSupported;
ulong MemoryPoolL0Size;
ulong MemoryPoolL1Size;
}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_HEAP_SIZE サイズ: 56 バイト(x86)
dim st, 14 ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; HeapDesc : D3D12_VIDEO_ENCODER_HEAP_DESC (+0, 36byte) varptr(st)+0 を基点に操作(36byte:入れ子/配列)
; IsSupported : BOOL (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; MemoryPoolL0Size : ULONGLONG (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; MemoryPoolL1Size : ULONGLONG (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D12_FEATURE_DATA_VIDEO_ENCODER_HEAP_SIZE サイズ: 88 バイト(x64)
dim st, 22 ; 4byte整数×22(構造体サイズ 88 / 4 切り上げ)
; HeapDesc : D3D12_VIDEO_ENCODER_HEAP_DESC (+0, 64byte) varptr(st)+0 を基点に操作(64byte:入れ子/配列)
; IsSupported : BOOL (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; MemoryPoolL0Size : ULONGLONG (+72, 8byte) qpoke st,72,値 / qpeek(st,72) ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; MemoryPoolL1Size : ULONGLONG (+80, 8byte) qpoke st,80,値 / qpeek(st,80) ※IronHSPのみ。3.7/3.8は lpoke st,80,下位 : lpoke st,84,上位
; ※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_LEVEL_SETTING
#field int DataSize
#field byte Anonymous 8
#endstruct
#defstruct global D3D12_VIDEO_ENCODER_HEAP_DESC
#field int NodeMask
#field int Flags
#field int EncodeCodec
#field D3D12_VIDEO_ENCODER_PROFILE_DESC EncodeProfile
#field D3D12_VIDEO_ENCODER_LEVEL_SETTING EncodeLevel
#field int ResolutionsListCount
#field intptr pResolutionList
#endstruct
#defstruct global D3D12_FEATURE_DATA_VIDEO_ENCODER_HEAP_SIZE
#field D3D12_VIDEO_ENCODER_HEAP_DESC HeapDesc
#field bool IsSupported
#field int64 MemoryPoolL0Size
#field int64 MemoryPoolL1Size
#endstruct
stdim st, D3D12_FEATURE_DATA_VIDEO_ENCODER_HEAP_SIZE ; NSTRUCT 変数を確保
st->IsSupported = 100
mes "IsSupported=" + st->IsSupported