ホーム › Media.MediaFoundation › D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION
D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| NodeIndex | DWORD | 4 | +0 | +0 | 対象とする物理アダプタノードのインデックス。 |
| Codec | D3D12_VIDEO_ENCODER_CODEC | 4 | +4 | +4 | 対象とするエンコードコーデックを示すD3D12_VIDEO_ENCODER_CODEC。 |
| ResolutionRatiosCount | DWORD | 4 | +8 | +8 | pResolutionRatios配列の要素数。 |
| IsSupported | BOOL | 4 | +12 | +12 | 指定構成での出力解像度がサポートされるか否かを示すBOOL(出力)。 |
| MinResolutionSupported | D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC | 8 | +16 | +16 | サポートされる最小解像度を示すD3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC(出力)。 |
| MaxResolutionSupported | D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC | 8 | +24 | +24 | サポートされる最大解像度を示すD3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC(出力)。 |
| ResolutionWidthMultipleRequirement | DWORD | 4 | +32 | +32 | 幅が満たすべき倍数の制約(ピクセル単位、出力)。 |
| ResolutionHeightMultipleRequirement | DWORD | 4 | +36 | +36 | 高さが満たすべき倍数の制約(ピクセル単位、出力)。 |
| pResolutionRatios | D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_RATIO_DESC* | 8/4 | +40 | +40 | サポートされる解像度比を受け取る配列へのポインタD3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_RATIO_DESC*。 |
各言語での定義
#include <windows.h>
// D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC (x64 8 / x86 8 バイト)
typedef struct D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC {
DWORD Width;
DWORD Height;
} D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC;
// D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION (x64 48 / x86 44 バイト)
typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION {
DWORD NodeIndex;
D3D12_VIDEO_ENCODER_CODEC Codec;
DWORD ResolutionRatiosCount;
BOOL IsSupported;
D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC MinResolutionSupported;
D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC MaxResolutionSupported;
DWORD ResolutionWidthMultipleRequirement;
DWORD ResolutionHeightMultipleRequirement;
D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_RATIO_DESC* pResolutionRatios;
} D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC
{
public uint Width;
public uint Height;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION
{
public uint NodeIndex;
public int Codec;
public uint ResolutionRatiosCount;
[MarshalAs(UnmanagedType.Bool)] public bool IsSupported;
public D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC MinResolutionSupported;
public D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC MaxResolutionSupported;
public uint ResolutionWidthMultipleRequirement;
public uint ResolutionHeightMultipleRequirement;
public IntPtr pResolutionRatios;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC
Public Width As UInteger
Public Height As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION
Public NodeIndex As UInteger
Public Codec As Integer
Public ResolutionRatiosCount As UInteger
<MarshalAs(UnmanagedType.Bool)> Public IsSupported As Boolean
Public MinResolutionSupported As D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC
Public MaxResolutionSupported As D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC
Public ResolutionWidthMultipleRequirement As UInteger
Public ResolutionHeightMultipleRequirement As UInteger
Public pResolutionRatios As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC(ctypes.Structure):
_fields_ = [
("Width", wintypes.DWORD),
("Height", wintypes.DWORD),
]
class D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION(ctypes.Structure):
_fields_ = [
("NodeIndex", wintypes.DWORD),
("Codec", ctypes.c_int),
("ResolutionRatiosCount", wintypes.DWORD),
("IsSupported", wintypes.BOOL),
("MinResolutionSupported", D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC),
("MaxResolutionSupported", D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC),
("ResolutionWidthMultipleRequirement", wintypes.DWORD),
("ResolutionHeightMultipleRequirement", wintypes.DWORD),
("pResolutionRatios", ctypes.c_void_p),
]#[repr(C)]
pub struct D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC {
pub Width: u32,
pub Height: u32,
}
#[repr(C)]
pub struct D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION {
pub NodeIndex: u32,
pub Codec: i32,
pub ResolutionRatiosCount: u32,
pub IsSupported: i32,
pub MinResolutionSupported: D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC,
pub MaxResolutionSupported: D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC,
pub ResolutionWidthMultipleRequirement: u32,
pub ResolutionHeightMultipleRequirement: u32,
pub pResolutionRatios: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC struct {
Width uint32
Height uint32
}
type D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION struct {
NodeIndex uint32
Codec int32
ResolutionRatiosCount uint32
IsSupported int32
MinResolutionSupported D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC
MaxResolutionSupported D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC
ResolutionWidthMultipleRequirement uint32
ResolutionHeightMultipleRequirement uint32
pResolutionRatios uintptr
}type
D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC = record
Width: DWORD;
Height: DWORD;
end;
D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION = record
NodeIndex: DWORD;
Codec: Integer;
ResolutionRatiosCount: DWORD;
IsSupported: BOOL;
MinResolutionSupported: D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC;
MaxResolutionSupported: D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC;
ResolutionWidthMultipleRequirement: DWORD;
ResolutionHeightMultipleRequirement: DWORD;
pResolutionRatios: Pointer;
end;const D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC = extern struct {
Width: u32,
Height: u32,
};
const D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION = extern struct {
NodeIndex: u32,
Codec: i32,
ResolutionRatiosCount: u32,
IsSupported: i32,
MinResolutionSupported: D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC,
MaxResolutionSupported: D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC,
ResolutionWidthMultipleRequirement: u32,
ResolutionHeightMultipleRequirement: u32,
pResolutionRatios: ?*anyopaque,
};type
D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC {.bycopy.} = object
Width: uint32
Height: uint32
D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION {.bycopy.} = object
NodeIndex: uint32
Codec: int32
ResolutionRatiosCount: uint32
IsSupported: int32
MinResolutionSupported: D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC
MaxResolutionSupported: D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC
ResolutionWidthMultipleRequirement: uint32
ResolutionHeightMultipleRequirement: uint32
pResolutionRatios: pointerstruct D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC
{
uint Width;
uint Height;
}
struct D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION
{
uint NodeIndex;
int Codec;
uint ResolutionRatiosCount;
int IsSupported;
D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC MinResolutionSupported;
D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC MaxResolutionSupported;
uint ResolutionWidthMultipleRequirement;
uint ResolutionHeightMultipleRequirement;
void* pResolutionRatios;
}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_OUTPUT_RESOLUTION サイズ: 44 バイト(x86)
dim st, 11 ; 4byte整数×11(構造体サイズ 44 / 4 切り上げ)
; NodeIndex : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Codec : D3D12_VIDEO_ENCODER_CODEC (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; ResolutionRatiosCount : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; IsSupported : BOOL (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; MinResolutionSupported : D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC (+16, 8byte) varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; MaxResolutionSupported : D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC (+24, 8byte) varptr(st)+24 を基点に操作(8byte:入れ子/配列)
; ResolutionWidthMultipleRequirement : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; ResolutionHeightMultipleRequirement : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; pResolutionRatios : D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_RATIO_DESC* (+40, 4byte) varptr(st)+40 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION サイズ: 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 も可)
; ResolutionRatiosCount : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; IsSupported : BOOL (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; MinResolutionSupported : D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC (+16, 8byte) varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; MaxResolutionSupported : D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC (+24, 8byte) varptr(st)+24 を基点に操作(8byte:入れ子/配列)
; ResolutionWidthMultipleRequirement : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; ResolutionHeightMultipleRequirement : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; pResolutionRatios : D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_RATIO_DESC* (+40, 8byte) varptr(st)+40 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC
#field int Width
#field int Height
#endstruct
#defstruct global D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION
#field int NodeIndex
#field int Codec
#field int ResolutionRatiosCount
#field bool IsSupported
#field D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC MinResolutionSupported
#field D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC MaxResolutionSupported
#field int ResolutionWidthMultipleRequirement
#field int ResolutionHeightMultipleRequirement
#field intptr pResolutionRatios
#endstruct
stdim st, D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION ; NSTRUCT 変数を確保
st->NodeIndex = 100
mes "NodeIndex=" + st->NodeIndex