ホーム › Media.MediaFoundation › D3D12_FEATURE_DATA_VIDEO_DECODE_CONVERSION_SUPPORT
D3D12_FEATURE_DATA_VIDEO_DECODE_CONVERSION_SUPPORT
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| NodeIndex | DWORD | 4 | +0 | +0 | 対象とする物理アダプタノードのインデックス。 |
| Configuration | D3D12_VIDEO_DECODE_CONFIGURATION | 24 | +4 | +4 | 問い合わせるデコード構成を示すD3D12_VIDEO_DECODE_CONFIGURATION。 |
| DecodeSample | D3D12_VIDEO_SAMPLE | 16 | +28 | +28 | デコード出力サンプルの寸法と形式を示すD3D12_VIDEO_SAMPLE。 |
| OutputFormat | D3D12_VIDEO_FORMAT | 8 | +44 | +44 | 変換後の出力形式を示すD3D12_VIDEO_FORMAT。 |
| FrameRate | DXGI_RATIONAL | 8 | +52 | +52 | 対象のフレームレートを示すDXGI_RATIONAL。 |
| BitRate | DWORD | 4 | +60 | +60 | 対象のビットレート(bps単位)。 |
| SupportFlags | D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS | 4 | +64 | +64 | デコード変換サポート可否を示すD3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS(出力)。 |
| ScaleSupport | D3D12_VIDEO_SCALE_SUPPORT | 20 | +68 | +68 | スケーリングサポート情報を示すD3D12_VIDEO_SCALE_SUPPORT(出力)。 |
各言語での定義
#include <windows.h>
// D3D12_VIDEO_DECODE_CONFIGURATION (x64 24 / x86 24 バイト)
typedef struct D3D12_VIDEO_DECODE_CONFIGURATION {
GUID DecodeProfile;
D3D12_BITSTREAM_ENCRYPTION_TYPE BitstreamEncryption;
D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE InterlaceType;
} D3D12_VIDEO_DECODE_CONFIGURATION;
// D3D12_VIDEO_FORMAT (x64 8 / x86 8 バイト)
typedef struct D3D12_VIDEO_FORMAT {
DXGI_FORMAT Format;
DXGI_COLOR_SPACE_TYPE ColorSpace;
} D3D12_VIDEO_FORMAT;
// D3D12_VIDEO_SAMPLE (x64 16 / x86 16 バイト)
typedef struct D3D12_VIDEO_SAMPLE {
DWORD Width;
DWORD Height;
D3D12_VIDEO_FORMAT Format;
} D3D12_VIDEO_SAMPLE;
// DXGI_RATIONAL (x64 8 / x86 8 バイト)
typedef struct DXGI_RATIONAL {
DWORD Numerator;
DWORD Denominator;
} DXGI_RATIONAL;
// D3D12_VIDEO_SIZE_RANGE (x64 16 / x86 16 バイト)
typedef struct D3D12_VIDEO_SIZE_RANGE {
DWORD MaxWidth;
DWORD MaxHeight;
DWORD MinWidth;
DWORD MinHeight;
} D3D12_VIDEO_SIZE_RANGE;
// D3D12_VIDEO_SCALE_SUPPORT (x64 20 / x86 20 バイト)
typedef struct D3D12_VIDEO_SCALE_SUPPORT {
D3D12_VIDEO_SIZE_RANGE OutputSizeRange;
D3D12_VIDEO_SCALE_SUPPORT_FLAGS Flags;
} D3D12_VIDEO_SCALE_SUPPORT;
// D3D12_FEATURE_DATA_VIDEO_DECODE_CONVERSION_SUPPORT (x64 88 / x86 88 バイト)
typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_CONVERSION_SUPPORT {
DWORD NodeIndex;
D3D12_VIDEO_DECODE_CONFIGURATION Configuration;
D3D12_VIDEO_SAMPLE DecodeSample;
D3D12_VIDEO_FORMAT OutputFormat;
DXGI_RATIONAL FrameRate;
DWORD BitRate;
D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS SupportFlags;
D3D12_VIDEO_SCALE_SUPPORT ScaleSupport;
} D3D12_FEATURE_DATA_VIDEO_DECODE_CONVERSION_SUPPORT;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_DECODE_CONFIGURATION
{
public Guid DecodeProfile;
public int BitstreamEncryption;
public int InterlaceType;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_FORMAT
{
public int Format;
public int ColorSpace;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_SAMPLE
{
public uint Width;
public uint Height;
public D3D12_VIDEO_FORMAT Format;
}
[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_SIZE_RANGE
{
public uint MaxWidth;
public uint MaxHeight;
public uint MinWidth;
public uint MinHeight;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_SCALE_SUPPORT
{
public D3D12_VIDEO_SIZE_RANGE OutputSizeRange;
public int Flags;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_FEATURE_DATA_VIDEO_DECODE_CONVERSION_SUPPORT
{
public uint NodeIndex;
public D3D12_VIDEO_DECODE_CONFIGURATION Configuration;
public D3D12_VIDEO_SAMPLE DecodeSample;
public D3D12_VIDEO_FORMAT OutputFormat;
public DXGI_RATIONAL FrameRate;
public uint BitRate;
public int SupportFlags;
public D3D12_VIDEO_SCALE_SUPPORT ScaleSupport;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_DECODE_CONFIGURATION
Public DecodeProfile As Guid
Public BitstreamEncryption As Integer
Public InterlaceType As Integer
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_FORMAT
Public Format As Integer
Public ColorSpace As Integer
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_SAMPLE
Public Width As UInteger
Public Height As UInteger
Public Format As D3D12_VIDEO_FORMAT
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_SIZE_RANGE
Public MaxWidth As UInteger
Public MaxHeight As UInteger
Public MinWidth As UInteger
Public MinHeight As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_SCALE_SUPPORT
Public OutputSizeRange As D3D12_VIDEO_SIZE_RANGE
Public Flags As Integer
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_FEATURE_DATA_VIDEO_DECODE_CONVERSION_SUPPORT
Public NodeIndex As UInteger
Public Configuration As D3D12_VIDEO_DECODE_CONFIGURATION
Public DecodeSample As D3D12_VIDEO_SAMPLE
Public OutputFormat As D3D12_VIDEO_FORMAT
Public FrameRate As DXGI_RATIONAL
Public BitRate As UInteger
Public SupportFlags As Integer
Public ScaleSupport As D3D12_VIDEO_SCALE_SUPPORT
End Structureimport ctypes
from ctypes import wintypes
class D3D12_VIDEO_DECODE_CONFIGURATION(ctypes.Structure):
_fields_ = [
("DecodeProfile", GUID),
("BitstreamEncryption", ctypes.c_int),
("InterlaceType", ctypes.c_int),
]
class D3D12_VIDEO_FORMAT(ctypes.Structure):
_fields_ = [
("Format", ctypes.c_int),
("ColorSpace", ctypes.c_int),
]
class D3D12_VIDEO_SAMPLE(ctypes.Structure):
_fields_ = [
("Width", wintypes.DWORD),
("Height", wintypes.DWORD),
("Format", D3D12_VIDEO_FORMAT),
]
class DXGI_RATIONAL(ctypes.Structure):
_fields_ = [
("Numerator", wintypes.DWORD),
("Denominator", wintypes.DWORD),
]
class D3D12_VIDEO_SIZE_RANGE(ctypes.Structure):
_fields_ = [
("MaxWidth", wintypes.DWORD),
("MaxHeight", wintypes.DWORD),
("MinWidth", wintypes.DWORD),
("MinHeight", wintypes.DWORD),
]
class D3D12_VIDEO_SCALE_SUPPORT(ctypes.Structure):
_fields_ = [
("OutputSizeRange", D3D12_VIDEO_SIZE_RANGE),
("Flags", ctypes.c_int),
]
class D3D12_FEATURE_DATA_VIDEO_DECODE_CONVERSION_SUPPORT(ctypes.Structure):
_fields_ = [
("NodeIndex", wintypes.DWORD),
("Configuration", D3D12_VIDEO_DECODE_CONFIGURATION),
("DecodeSample", D3D12_VIDEO_SAMPLE),
("OutputFormat", D3D12_VIDEO_FORMAT),
("FrameRate", DXGI_RATIONAL),
("BitRate", wintypes.DWORD),
("SupportFlags", ctypes.c_int),
("ScaleSupport", D3D12_VIDEO_SCALE_SUPPORT),
]#[repr(C)]
pub struct D3D12_VIDEO_DECODE_CONFIGURATION {
pub DecodeProfile: GUID,
pub BitstreamEncryption: i32,
pub InterlaceType: i32,
}
#[repr(C)]
pub struct D3D12_VIDEO_FORMAT {
pub Format: i32,
pub ColorSpace: i32,
}
#[repr(C)]
pub struct D3D12_VIDEO_SAMPLE {
pub Width: u32,
pub Height: u32,
pub Format: D3D12_VIDEO_FORMAT,
}
#[repr(C)]
pub struct DXGI_RATIONAL {
pub Numerator: u32,
pub Denominator: u32,
}
#[repr(C)]
pub struct D3D12_VIDEO_SIZE_RANGE {
pub MaxWidth: u32,
pub MaxHeight: u32,
pub MinWidth: u32,
pub MinHeight: u32,
}
#[repr(C)]
pub struct D3D12_VIDEO_SCALE_SUPPORT {
pub OutputSizeRange: D3D12_VIDEO_SIZE_RANGE,
pub Flags: i32,
}
#[repr(C)]
pub struct D3D12_FEATURE_DATA_VIDEO_DECODE_CONVERSION_SUPPORT {
pub NodeIndex: u32,
pub Configuration: D3D12_VIDEO_DECODE_CONFIGURATION,
pub DecodeSample: D3D12_VIDEO_SAMPLE,
pub OutputFormat: D3D12_VIDEO_FORMAT,
pub FrameRate: DXGI_RATIONAL,
pub BitRate: u32,
pub SupportFlags: i32,
pub ScaleSupport: D3D12_VIDEO_SCALE_SUPPORT,
}import "golang.org/x/sys/windows"
type D3D12_VIDEO_DECODE_CONFIGURATION struct {
DecodeProfile windows.GUID
BitstreamEncryption int32
InterlaceType int32
}
type D3D12_VIDEO_FORMAT struct {
Format int32
ColorSpace int32
}
type D3D12_VIDEO_SAMPLE struct {
Width uint32
Height uint32
Format D3D12_VIDEO_FORMAT
}
type DXGI_RATIONAL struct {
Numerator uint32
Denominator uint32
}
type D3D12_VIDEO_SIZE_RANGE struct {
MaxWidth uint32
MaxHeight uint32
MinWidth uint32
MinHeight uint32
}
type D3D12_VIDEO_SCALE_SUPPORT struct {
OutputSizeRange D3D12_VIDEO_SIZE_RANGE
Flags int32
}
type D3D12_FEATURE_DATA_VIDEO_DECODE_CONVERSION_SUPPORT struct {
NodeIndex uint32
Configuration D3D12_VIDEO_DECODE_CONFIGURATION
DecodeSample D3D12_VIDEO_SAMPLE
OutputFormat D3D12_VIDEO_FORMAT
FrameRate DXGI_RATIONAL
BitRate uint32
SupportFlags int32
ScaleSupport D3D12_VIDEO_SCALE_SUPPORT
}type
D3D12_VIDEO_DECODE_CONFIGURATION = record
DecodeProfile: TGUID;
BitstreamEncryption: Integer;
InterlaceType: Integer;
end;
D3D12_VIDEO_FORMAT = record
Format: Integer;
ColorSpace: Integer;
end;
D3D12_VIDEO_SAMPLE = record
Width: DWORD;
Height: DWORD;
Format: D3D12_VIDEO_FORMAT;
end;
DXGI_RATIONAL = record
Numerator: DWORD;
Denominator: DWORD;
end;
D3D12_VIDEO_SIZE_RANGE = record
MaxWidth: DWORD;
MaxHeight: DWORD;
MinWidth: DWORD;
MinHeight: DWORD;
end;
D3D12_VIDEO_SCALE_SUPPORT = record
OutputSizeRange: D3D12_VIDEO_SIZE_RANGE;
Flags: Integer;
end;
D3D12_FEATURE_DATA_VIDEO_DECODE_CONVERSION_SUPPORT = record
NodeIndex: DWORD;
Configuration: D3D12_VIDEO_DECODE_CONFIGURATION;
DecodeSample: D3D12_VIDEO_SAMPLE;
OutputFormat: D3D12_VIDEO_FORMAT;
FrameRate: DXGI_RATIONAL;
BitRate: DWORD;
SupportFlags: Integer;
ScaleSupport: D3D12_VIDEO_SCALE_SUPPORT;
end;const D3D12_VIDEO_DECODE_CONFIGURATION = extern struct {
DecodeProfile: GUID,
BitstreamEncryption: i32,
InterlaceType: i32,
};
const D3D12_VIDEO_FORMAT = extern struct {
Format: i32,
ColorSpace: i32,
};
const D3D12_VIDEO_SAMPLE = extern struct {
Width: u32,
Height: u32,
Format: D3D12_VIDEO_FORMAT,
};
const DXGI_RATIONAL = extern struct {
Numerator: u32,
Denominator: u32,
};
const D3D12_VIDEO_SIZE_RANGE = extern struct {
MaxWidth: u32,
MaxHeight: u32,
MinWidth: u32,
MinHeight: u32,
};
const D3D12_VIDEO_SCALE_SUPPORT = extern struct {
OutputSizeRange: D3D12_VIDEO_SIZE_RANGE,
Flags: i32,
};
const D3D12_FEATURE_DATA_VIDEO_DECODE_CONVERSION_SUPPORT = extern struct {
NodeIndex: u32,
Configuration: D3D12_VIDEO_DECODE_CONFIGURATION,
DecodeSample: D3D12_VIDEO_SAMPLE,
OutputFormat: D3D12_VIDEO_FORMAT,
FrameRate: DXGI_RATIONAL,
BitRate: u32,
SupportFlags: i32,
ScaleSupport: D3D12_VIDEO_SCALE_SUPPORT,
};type
D3D12_VIDEO_DECODE_CONFIGURATION {.bycopy.} = object
DecodeProfile: GUID
BitstreamEncryption: int32
InterlaceType: int32
D3D12_VIDEO_FORMAT {.bycopy.} = object
Format: int32
ColorSpace: int32
D3D12_VIDEO_SAMPLE {.bycopy.} = object
Width: uint32
Height: uint32
Format: D3D12_VIDEO_FORMAT
DXGI_RATIONAL {.bycopy.} = object
Numerator: uint32
Denominator: uint32
D3D12_VIDEO_SIZE_RANGE {.bycopy.} = object
MaxWidth: uint32
MaxHeight: uint32
MinWidth: uint32
MinHeight: uint32
D3D12_VIDEO_SCALE_SUPPORT {.bycopy.} = object
OutputSizeRange: D3D12_VIDEO_SIZE_RANGE
Flags: int32
D3D12_FEATURE_DATA_VIDEO_DECODE_CONVERSION_SUPPORT {.bycopy.} = object
NodeIndex: uint32
Configuration: D3D12_VIDEO_DECODE_CONFIGURATION
DecodeSample: D3D12_VIDEO_SAMPLE
OutputFormat: D3D12_VIDEO_FORMAT
FrameRate: DXGI_RATIONAL
BitRate: uint32
SupportFlags: int32
ScaleSupport: D3D12_VIDEO_SCALE_SUPPORTstruct D3D12_VIDEO_DECODE_CONFIGURATION
{
GUID DecodeProfile;
int BitstreamEncryption;
int InterlaceType;
}
struct D3D12_VIDEO_FORMAT
{
int Format;
int ColorSpace;
}
struct D3D12_VIDEO_SAMPLE
{
uint Width;
uint Height;
D3D12_VIDEO_FORMAT Format;
}
struct DXGI_RATIONAL
{
uint Numerator;
uint Denominator;
}
struct D3D12_VIDEO_SIZE_RANGE
{
uint MaxWidth;
uint MaxHeight;
uint MinWidth;
uint MinHeight;
}
struct D3D12_VIDEO_SCALE_SUPPORT
{
D3D12_VIDEO_SIZE_RANGE OutputSizeRange;
int Flags;
}
struct D3D12_FEATURE_DATA_VIDEO_DECODE_CONVERSION_SUPPORT
{
uint NodeIndex;
D3D12_VIDEO_DECODE_CONFIGURATION Configuration;
D3D12_VIDEO_SAMPLE DecodeSample;
D3D12_VIDEO_FORMAT OutputFormat;
DXGI_RATIONAL FrameRate;
uint BitRate;
int SupportFlags;
D3D12_VIDEO_SCALE_SUPPORT ScaleSupport;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D12_FEATURE_DATA_VIDEO_DECODE_CONVERSION_SUPPORT サイズ: 88 バイト(x64)
dim st, 22 ; 4byte整数×22(構造体サイズ 88 / 4 切り上げ)
; NodeIndex : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Configuration : D3D12_VIDEO_DECODE_CONFIGURATION (+4, 24byte) varptr(st)+4 を基点に操作(24byte:入れ子/配列)
; DecodeSample : D3D12_VIDEO_SAMPLE (+28, 16byte) varptr(st)+28 を基点に操作(16byte:入れ子/配列)
; OutputFormat : D3D12_VIDEO_FORMAT (+44, 8byte) varptr(st)+44 を基点に操作(8byte:入れ子/配列)
; FrameRate : DXGI_RATIONAL (+52, 8byte) varptr(st)+52 を基点に操作(8byte:入れ子/配列)
; BitRate : DWORD (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; SupportFlags : D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; ScaleSupport : D3D12_VIDEO_SCALE_SUPPORT (+68, 20byte) varptr(st)+68 を基点に操作(20byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
#field int Data1
#field short Data2
#field short Data3
#field byte Data4 8
#endstruct
#defstruct global D3D12_VIDEO_DECODE_CONFIGURATION
#field GUID DecodeProfile
#field int BitstreamEncryption
#field int InterlaceType
#endstruct
#defstruct global D3D12_VIDEO_FORMAT
#field int Format
#field int ColorSpace
#endstruct
#defstruct global D3D12_VIDEO_SAMPLE
#field int Width
#field int Height
#field D3D12_VIDEO_FORMAT Format
#endstruct
#defstruct global DXGI_RATIONAL
#field int Numerator
#field int Denominator
#endstruct
#defstruct global D3D12_VIDEO_SIZE_RANGE
#field int MaxWidth
#field int MaxHeight
#field int MinWidth
#field int MinHeight
#endstruct
#defstruct global D3D12_VIDEO_SCALE_SUPPORT
#field D3D12_VIDEO_SIZE_RANGE OutputSizeRange
#field int Flags
#endstruct
#defstruct global D3D12_FEATURE_DATA_VIDEO_DECODE_CONVERSION_SUPPORT
#field int NodeIndex
#field D3D12_VIDEO_DECODE_CONFIGURATION Configuration
#field D3D12_VIDEO_SAMPLE DecodeSample
#field D3D12_VIDEO_FORMAT OutputFormat
#field DXGI_RATIONAL FrameRate
#field int BitRate
#field int SupportFlags
#field D3D12_VIDEO_SCALE_SUPPORT ScaleSupport
#endstruct
stdim st, D3D12_FEATURE_DATA_VIDEO_DECODE_CONVERSION_SUPPORT ; NSTRUCT 変数を確保
st->NodeIndex = 100
mes "NodeIndex=" + st->NodeIndex