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

D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC

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

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

フィールド

フィールドサイズx64x86説明
FormatDXGI_FORMAT4+0+0入力ストリームのピクセル形式を示すDXGI_FORMAT。
ColorSpaceDXGI_COLOR_SPACE_TYPE4+4+4入力ストリームの色空間を示すDXGI_COLOR_SPACE_TYPE。
SourceAspectRatioDXGI_RATIONAL8+8+8ソースのアスペクト比を示すDXGI_RATIONAL。
DestinationAspectRatioDXGI_RATIONAL8+16+16出力先のアスペクト比を示すDXGI_RATIONAL。
FrameRateDXGI_RATIONAL8+24+24入力ストリームのフレームレートを示すDXGI_RATIONAL。
SourceSizeRangeD3D12_VIDEO_SIZE_RANGE16+32+32ソース寸法の許容範囲を示すD3D12_VIDEO_SIZE_RANGE。
DestinationSizeRangeD3D12_VIDEO_SIZE_RANGE16+48+48出力寸法の許容範囲を示すD3D12_VIDEO_SIZE_RANGE。
EnableOrientationBOOL4+64+64回転/反転などの向き変換を有効にするか否かを示すBOOL。
FilterFlagsD3D12_VIDEO_PROCESS_FILTER_FLAGS4+68+68適用するフィルタを示すD3D12_VIDEO_PROCESS_FILTER_FLAGS。
StereoFormatD3D12_VIDEO_FRAME_STEREO_FORMAT4+72+72ステレオ3D形式を示すD3D12_VIDEO_FRAME_STEREO_FORMAT。
FieldTypeD3D12_VIDEO_FIELD_TYPE4+76+76フィールド種別(プログレッシブ/インターレース)を示すD3D12_VIDEO_FIELD_TYPE。
DeinterlaceModeD3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS4+80+80デインターレース方式を示すD3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS。
EnableAlphaBlendingBOOL4+84+84アルファブレンディングを有効にするか否かを示すBOOL。
LumaKeyD3D12_VIDEO_PROCESS_LUMA_KEY12+88+88輝度キーの設定を示すD3D12_VIDEO_PROCESS_LUMA_KEY。
NumPastFramesDWORD4+100+100処理に用いる過去参照フレーム数。
NumFutureFramesDWORD4+104+104処理に用いる未来参照フレーム数。
EnableAutoProcessingBOOL4+108+108ドライバ自動最適化処理を有効にするか否かを示すBOOL。

各言語での定義

#include <windows.h>

// 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_PROCESS_LUMA_KEY  (x64 12 / x86 12 バイト)
typedef struct D3D12_VIDEO_PROCESS_LUMA_KEY {
    BOOL Enable;
    FLOAT Lower;
    FLOAT Upper;
} D3D12_VIDEO_PROCESS_LUMA_KEY;

// D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC  (x64 112 / x86 112 バイト)
typedef struct D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC {
    DXGI_FORMAT Format;
    DXGI_COLOR_SPACE_TYPE ColorSpace;
    DXGI_RATIONAL SourceAspectRatio;
    DXGI_RATIONAL DestinationAspectRatio;
    DXGI_RATIONAL FrameRate;
    D3D12_VIDEO_SIZE_RANGE SourceSizeRange;
    D3D12_VIDEO_SIZE_RANGE DestinationSizeRange;
    BOOL EnableOrientation;
    D3D12_VIDEO_PROCESS_FILTER_FLAGS FilterFlags;
    D3D12_VIDEO_FRAME_STEREO_FORMAT StereoFormat;
    D3D12_VIDEO_FIELD_TYPE FieldType;
    D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS DeinterlaceMode;
    BOOL EnableAlphaBlending;
    D3D12_VIDEO_PROCESS_LUMA_KEY LumaKey;
    DWORD NumPastFrames;
    DWORD NumFutureFrames;
    BOOL EnableAutoProcessing;
} D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC;
using System;
using System.Runtime.InteropServices;

[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_PROCESS_LUMA_KEY
{
    [MarshalAs(UnmanagedType.Bool)] public bool Enable;
    public float Lower;
    public float Upper;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC
{
    public int Format;
    public int ColorSpace;
    public DXGI_RATIONAL SourceAspectRatio;
    public DXGI_RATIONAL DestinationAspectRatio;
    public DXGI_RATIONAL FrameRate;
    public D3D12_VIDEO_SIZE_RANGE SourceSizeRange;
    public D3D12_VIDEO_SIZE_RANGE DestinationSizeRange;
    [MarshalAs(UnmanagedType.Bool)] public bool EnableOrientation;
    public int FilterFlags;
    public int StereoFormat;
    public int FieldType;
    public uint DeinterlaceMode;
    [MarshalAs(UnmanagedType.Bool)] public bool EnableAlphaBlending;
    public D3D12_VIDEO_PROCESS_LUMA_KEY LumaKey;
    public uint NumPastFrames;
    public uint NumFutureFrames;
    [MarshalAs(UnmanagedType.Bool)] public bool EnableAutoProcessing;
}
Imports System.Runtime.InteropServices

<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_PROCESS_LUMA_KEY
    <MarshalAs(UnmanagedType.Bool)> Public Enable As Boolean
    Public Lower As Single
    Public Upper As Single
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC
    Public Format As Integer
    Public ColorSpace As Integer
    Public SourceAspectRatio As DXGI_RATIONAL
    Public DestinationAspectRatio As DXGI_RATIONAL
    Public FrameRate As DXGI_RATIONAL
    Public SourceSizeRange As D3D12_VIDEO_SIZE_RANGE
    Public DestinationSizeRange As D3D12_VIDEO_SIZE_RANGE
    <MarshalAs(UnmanagedType.Bool)> Public EnableOrientation As Boolean
    Public FilterFlags As Integer
    Public StereoFormat As Integer
    Public FieldType As Integer
    Public DeinterlaceMode As UInteger
    <MarshalAs(UnmanagedType.Bool)> Public EnableAlphaBlending As Boolean
    Public LumaKey As D3D12_VIDEO_PROCESS_LUMA_KEY
    Public NumPastFrames As UInteger
    Public NumFutureFrames As UInteger
    <MarshalAs(UnmanagedType.Bool)> Public EnableAutoProcessing As Boolean
End Structure
import ctypes
from ctypes import wintypes

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_PROCESS_LUMA_KEY(ctypes.Structure):
    _fields_ = [
        ("Enable", wintypes.BOOL),
        ("Lower", ctypes.c_float),
        ("Upper", ctypes.c_float),
    ]

class D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC(ctypes.Structure):
    _fields_ = [
        ("Format", ctypes.c_int),
        ("ColorSpace", ctypes.c_int),
        ("SourceAspectRatio", DXGI_RATIONAL),
        ("DestinationAspectRatio", DXGI_RATIONAL),
        ("FrameRate", DXGI_RATIONAL),
        ("SourceSizeRange", D3D12_VIDEO_SIZE_RANGE),
        ("DestinationSizeRange", D3D12_VIDEO_SIZE_RANGE),
        ("EnableOrientation", wintypes.BOOL),
        ("FilterFlags", ctypes.c_int),
        ("StereoFormat", ctypes.c_int),
        ("FieldType", ctypes.c_int),
        ("DeinterlaceMode", wintypes.DWORD),
        ("EnableAlphaBlending", wintypes.BOOL),
        ("LumaKey", D3D12_VIDEO_PROCESS_LUMA_KEY),
        ("NumPastFrames", wintypes.DWORD),
        ("NumFutureFrames", wintypes.DWORD),
        ("EnableAutoProcessing", wintypes.BOOL),
    ]
#[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_PROCESS_LUMA_KEY {
    pub Enable: i32,
    pub Lower: f32,
    pub Upper: f32,
}

#[repr(C)]
pub struct D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC {
    pub Format: i32,
    pub ColorSpace: i32,
    pub SourceAspectRatio: DXGI_RATIONAL,
    pub DestinationAspectRatio: DXGI_RATIONAL,
    pub FrameRate: DXGI_RATIONAL,
    pub SourceSizeRange: D3D12_VIDEO_SIZE_RANGE,
    pub DestinationSizeRange: D3D12_VIDEO_SIZE_RANGE,
    pub EnableOrientation: i32,
    pub FilterFlags: i32,
    pub StereoFormat: i32,
    pub FieldType: i32,
    pub DeinterlaceMode: u32,
    pub EnableAlphaBlending: i32,
    pub LumaKey: D3D12_VIDEO_PROCESS_LUMA_KEY,
    pub NumPastFrames: u32,
    pub NumFutureFrames: u32,
    pub EnableAutoProcessing: i32,
}
import "golang.org/x/sys/windows"

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_PROCESS_LUMA_KEY struct {
	Enable int32
	Lower float32
	Upper float32
}

type D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC struct {
	Format int32
	ColorSpace int32
	SourceAspectRatio DXGI_RATIONAL
	DestinationAspectRatio DXGI_RATIONAL
	FrameRate DXGI_RATIONAL
	SourceSizeRange D3D12_VIDEO_SIZE_RANGE
	DestinationSizeRange D3D12_VIDEO_SIZE_RANGE
	EnableOrientation int32
	FilterFlags int32
	StereoFormat int32
	FieldType int32
	DeinterlaceMode uint32
	EnableAlphaBlending int32
	LumaKey D3D12_VIDEO_PROCESS_LUMA_KEY
	NumPastFrames uint32
	NumFutureFrames uint32
	EnableAutoProcessing int32
}
type
  DXGI_RATIONAL = record
    Numerator: DWORD;
    Denominator: DWORD;
  end;

  D3D12_VIDEO_SIZE_RANGE = record
    MaxWidth: DWORD;
    MaxHeight: DWORD;
    MinWidth: DWORD;
    MinHeight: DWORD;
  end;

  D3D12_VIDEO_PROCESS_LUMA_KEY = record
    Enable: BOOL;
    Lower: Single;
    Upper: Single;
  end;

  D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC = record
    Format: Integer;
    ColorSpace: Integer;
    SourceAspectRatio: DXGI_RATIONAL;
    DestinationAspectRatio: DXGI_RATIONAL;
    FrameRate: DXGI_RATIONAL;
    SourceSizeRange: D3D12_VIDEO_SIZE_RANGE;
    DestinationSizeRange: D3D12_VIDEO_SIZE_RANGE;
    EnableOrientation: BOOL;
    FilterFlags: Integer;
    StereoFormat: Integer;
    FieldType: Integer;
    DeinterlaceMode: DWORD;
    EnableAlphaBlending: BOOL;
    LumaKey: D3D12_VIDEO_PROCESS_LUMA_KEY;
    NumPastFrames: DWORD;
    NumFutureFrames: DWORD;
    EnableAutoProcessing: BOOL;
  end;
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_PROCESS_LUMA_KEY = extern struct {
    Enable: i32,
    Lower: f32,
    Upper: f32,
};

const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC = extern struct {
    Format: i32,
    ColorSpace: i32,
    SourceAspectRatio: DXGI_RATIONAL,
    DestinationAspectRatio: DXGI_RATIONAL,
    FrameRate: DXGI_RATIONAL,
    SourceSizeRange: D3D12_VIDEO_SIZE_RANGE,
    DestinationSizeRange: D3D12_VIDEO_SIZE_RANGE,
    EnableOrientation: i32,
    FilterFlags: i32,
    StereoFormat: i32,
    FieldType: i32,
    DeinterlaceMode: u32,
    EnableAlphaBlending: i32,
    LumaKey: D3D12_VIDEO_PROCESS_LUMA_KEY,
    NumPastFrames: u32,
    NumFutureFrames: u32,
    EnableAutoProcessing: i32,
};
type
  DXGI_RATIONAL {.bycopy.} = object
    Numerator: uint32
    Denominator: uint32

  D3D12_VIDEO_SIZE_RANGE {.bycopy.} = object
    MaxWidth: uint32
    MaxHeight: uint32
    MinWidth: uint32
    MinHeight: uint32

  D3D12_VIDEO_PROCESS_LUMA_KEY {.bycopy.} = object
    Enable: int32
    Lower: float32
    Upper: float32

  D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC {.bycopy.} = object
    Format: int32
    ColorSpace: int32
    SourceAspectRatio: DXGI_RATIONAL
    DestinationAspectRatio: DXGI_RATIONAL
    FrameRate: DXGI_RATIONAL
    SourceSizeRange: D3D12_VIDEO_SIZE_RANGE
    DestinationSizeRange: D3D12_VIDEO_SIZE_RANGE
    EnableOrientation: int32
    FilterFlags: int32
    StereoFormat: int32
    FieldType: int32
    DeinterlaceMode: uint32
    EnableAlphaBlending: int32
    LumaKey: D3D12_VIDEO_PROCESS_LUMA_KEY
    NumPastFrames: uint32
    NumFutureFrames: uint32
    EnableAutoProcessing: int32
struct DXGI_RATIONAL
{
    uint Numerator;
    uint Denominator;
}

struct D3D12_VIDEO_SIZE_RANGE
{
    uint MaxWidth;
    uint MaxHeight;
    uint MinWidth;
    uint MinHeight;
}

struct D3D12_VIDEO_PROCESS_LUMA_KEY
{
    int Enable;
    float Lower;
    float Upper;
}

struct D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC
{
    int Format;
    int ColorSpace;
    DXGI_RATIONAL SourceAspectRatio;
    DXGI_RATIONAL DestinationAspectRatio;
    DXGI_RATIONAL FrameRate;
    D3D12_VIDEO_SIZE_RANGE SourceSizeRange;
    D3D12_VIDEO_SIZE_RANGE DestinationSizeRange;
    int EnableOrientation;
    int FilterFlags;
    int StereoFormat;
    int FieldType;
    uint DeinterlaceMode;
    int EnableAlphaBlending;
    D3D12_VIDEO_PROCESS_LUMA_KEY LumaKey;
    uint NumPastFrames;
    uint NumFutureFrames;
    int EnableAutoProcessing;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC サイズ: 112 バイト(x64)
dim st, 28    ; 4byte整数×28(構造体サイズ 112 / 4 切り上げ)
; Format : DXGI_FORMAT (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; ColorSpace : DXGI_COLOR_SPACE_TYPE (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; SourceAspectRatio : DXGI_RATIONAL (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; DestinationAspectRatio : DXGI_RATIONAL (+16, 8byte)  varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; FrameRate : DXGI_RATIONAL (+24, 8byte)  varptr(st)+24 を基点に操作(8byte:入れ子/配列)
; SourceSizeRange : D3D12_VIDEO_SIZE_RANGE (+32, 16byte)  varptr(st)+32 を基点に操作(16byte:入れ子/配列)
; DestinationSizeRange : D3D12_VIDEO_SIZE_RANGE (+48, 16byte)  varptr(st)+48 を基点に操作(16byte:入れ子/配列)
; EnableOrientation : BOOL (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; FilterFlags : D3D12_VIDEO_PROCESS_FILTER_FLAGS (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; StereoFormat : D3D12_VIDEO_FRAME_STEREO_FORMAT (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; FieldType : D3D12_VIDEO_FIELD_TYPE (+76, 4byte)  st.19 = 値  /  値 = st.19   (lpoke/lpeek も可)
; DeinterlaceMode : D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS (+80, 4byte)  st.20 = 値  /  値 = st.20   (lpoke/lpeek も可)
; EnableAlphaBlending : BOOL (+84, 4byte)  st.21 = 値  /  値 = st.21   (lpoke/lpeek も可)
; LumaKey : D3D12_VIDEO_PROCESS_LUMA_KEY (+88, 12byte)  varptr(st)+88 を基点に操作(12byte:入れ子/配列)
; NumPastFrames : DWORD (+100, 4byte)  st.25 = 値  /  値 = st.25   (lpoke/lpeek も可)
; NumFutureFrames : DWORD (+104, 4byte)  st.26 = 値  /  値 = st.26   (lpoke/lpeek も可)
; EnableAutoProcessing : BOOL (+108, 4byte)  st.27 = 値  /  値 = st.27   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#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_PROCESS_LUMA_KEY
    #field bool Enable
    #field float Lower
    #field float Upper
#endstruct

#defstruct global D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC
    #field int Format
    #field int ColorSpace
    #field DXGI_RATIONAL SourceAspectRatio
    #field DXGI_RATIONAL DestinationAspectRatio
    #field DXGI_RATIONAL FrameRate
    #field D3D12_VIDEO_SIZE_RANGE SourceSizeRange
    #field D3D12_VIDEO_SIZE_RANGE DestinationSizeRange
    #field bool EnableOrientation
    #field int FilterFlags
    #field int StereoFormat
    #field int FieldType
    #field int DeinterlaceMode
    #field bool EnableAlphaBlending
    #field D3D12_VIDEO_PROCESS_LUMA_KEY LumaKey
    #field int NumPastFrames
    #field int NumFutureFrames
    #field bool EnableAutoProcessing
#endstruct

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