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

D3D12_VIDEO_ENCODER_DIRTY_RECT_INFO

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

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

フィールド

フィールドサイズx64x86説明
FullFrameIdenticalBOOL4+0+0前フレームと完全同一でフレーム全体がダーティでないかを示す。TRUEで全同一。
MapValuesTypeD3D12_VIDEO_ENCODER_DIRTY_REGIONS_MAP_VALUES_MODE4+4+4ダーティ領域値の解釈方式(ダーティ/非ダーティ等)を指定する。
NumDirtyRectsDWORD4+8+8pDirtyRectsが指すダーティ矩形配列の要素数を指定する。
pDirtyRectsRECT*8/4+16+12変化があったダーティ矩形領域の配列へのポインタである。
SourceDPBFrameReferenceDWORD4+24+16ダーティ判定の基準となるDPB内参照フレームのインデックスを指定する。

各言語での定義

#include <windows.h>

// D3D12_VIDEO_ENCODER_DIRTY_RECT_INFO  (x64 32 / x86 20 バイト)
typedef struct D3D12_VIDEO_ENCODER_DIRTY_RECT_INFO {
    BOOL FullFrameIdentical;
    D3D12_VIDEO_ENCODER_DIRTY_REGIONS_MAP_VALUES_MODE MapValuesType;
    DWORD NumDirtyRects;
    RECT* pDirtyRects;
    DWORD SourceDPBFrameReference;
} D3D12_VIDEO_ENCODER_DIRTY_RECT_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_ENCODER_DIRTY_RECT_INFO
{
    [MarshalAs(UnmanagedType.Bool)] public bool FullFrameIdentical;
    public int MapValuesType;
    public uint NumDirtyRects;
    public IntPtr pDirtyRects;
    public uint SourceDPBFrameReference;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_ENCODER_DIRTY_RECT_INFO
    <MarshalAs(UnmanagedType.Bool)> Public FullFrameIdentical As Boolean
    Public MapValuesType As Integer
    Public NumDirtyRects As UInteger
    Public pDirtyRects As IntPtr
    Public SourceDPBFrameReference As UInteger
End Structure
import ctypes
from ctypes import wintypes

class D3D12_VIDEO_ENCODER_DIRTY_RECT_INFO(ctypes.Structure):
    _fields_ = [
        ("FullFrameIdentical", wintypes.BOOL),
        ("MapValuesType", ctypes.c_int),
        ("NumDirtyRects", wintypes.DWORD),
        ("pDirtyRects", ctypes.c_void_p),
        ("SourceDPBFrameReference", wintypes.DWORD),
    ]
#[repr(C)]
pub struct D3D12_VIDEO_ENCODER_DIRTY_RECT_INFO {
    pub FullFrameIdentical: i32,
    pub MapValuesType: i32,
    pub NumDirtyRects: u32,
    pub pDirtyRects: *mut core::ffi::c_void,
    pub SourceDPBFrameReference: u32,
}
import "golang.org/x/sys/windows"

type D3D12_VIDEO_ENCODER_DIRTY_RECT_INFO struct {
	FullFrameIdentical int32
	MapValuesType int32
	NumDirtyRects uint32
	pDirtyRects uintptr
	SourceDPBFrameReference uint32
}
type
  D3D12_VIDEO_ENCODER_DIRTY_RECT_INFO = record
    FullFrameIdentical: BOOL;
    MapValuesType: Integer;
    NumDirtyRects: DWORD;
    pDirtyRects: Pointer;
    SourceDPBFrameReference: DWORD;
  end;
const D3D12_VIDEO_ENCODER_DIRTY_RECT_INFO = extern struct {
    FullFrameIdentical: i32,
    MapValuesType: i32,
    NumDirtyRects: u32,
    pDirtyRects: ?*anyopaque,
    SourceDPBFrameReference: u32,
};
type
  D3D12_VIDEO_ENCODER_DIRTY_RECT_INFO {.bycopy.} = object
    FullFrameIdentical: int32
    MapValuesType: int32
    NumDirtyRects: uint32
    pDirtyRects: pointer
    SourceDPBFrameReference: uint32
struct D3D12_VIDEO_ENCODER_DIRTY_RECT_INFO
{
    int FullFrameIdentical;
    int MapValuesType;
    uint NumDirtyRects;
    void* pDirtyRects;
    uint SourceDPBFrameReference;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; D3D12_VIDEO_ENCODER_DIRTY_RECT_INFO サイズ: 20 バイト(x86)
dim st, 5    ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; FullFrameIdentical : BOOL (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; MapValuesType : D3D12_VIDEO_ENCODER_DIRTY_REGIONS_MAP_VALUES_MODE (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; NumDirtyRects : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; pDirtyRects : RECT* (+12, 4byte)  varptr(st)+12 を基点に操作(4byte:入れ子/配列)
; SourceDPBFrameReference : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D12_VIDEO_ENCODER_DIRTY_RECT_INFO サイズ: 32 バイト(x64)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; FullFrameIdentical : BOOL (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; MapValuesType : D3D12_VIDEO_ENCODER_DIRTY_REGIONS_MAP_VALUES_MODE (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; NumDirtyRects : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; pDirtyRects : RECT* (+16, 8byte)  varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; SourceDPBFrameReference : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3D12_VIDEO_ENCODER_DIRTY_RECT_INFO
    #field bool FullFrameIdentical
    #field int MapValuesType
    #field int NumDirtyRects
    #field intptr pDirtyRects
    #field int SourceDPBFrameReference
#endstruct

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