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

D3D12_VIDEO_PROCESS_REFERENCE_SET

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

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

フィールド

フィールドサイズx64x86説明
NumPastFramesDWORD4+0+0過去参照フレームの数。
ppPastFramesID3D12Resource**8/4+8+4過去参照フレームのリソース(ID3D12Resource)ポインタ配列。
pPastSubresourcesDWORD*8/4+16+8過去参照フレームのサブリソースインデックス配列へのポインタ。
NumFutureFramesDWORD4+24+12未来参照フレームの数。
ppFutureFramesID3D12Resource**8/4+32+16未来参照フレームのリソース(ID3D12Resource)ポインタ配列。
pFutureSubresourcesDWORD*8/4+40+20未来参照フレームのサブリソースインデックス配列へのポインタ。

各言語での定義

#include <windows.h>

// D3D12_VIDEO_PROCESS_REFERENCE_SET  (x64 48 / x86 24 バイト)
typedef struct D3D12_VIDEO_PROCESS_REFERENCE_SET {
    DWORD NumPastFrames;
    ID3D12Resource** ppPastFrames;
    DWORD* pPastSubresources;
    DWORD NumFutureFrames;
    ID3D12Resource** ppFutureFrames;
    DWORD* pFutureSubresources;
} D3D12_VIDEO_PROCESS_REFERENCE_SET;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VIDEO_PROCESS_REFERENCE_SET
{
    public uint NumPastFrames;
    public IntPtr ppPastFrames;
    public IntPtr pPastSubresources;
    public uint NumFutureFrames;
    public IntPtr ppFutureFrames;
    public IntPtr pFutureSubresources;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VIDEO_PROCESS_REFERENCE_SET
    Public NumPastFrames As UInteger
    Public ppPastFrames As IntPtr
    Public pPastSubresources As IntPtr
    Public NumFutureFrames As UInteger
    Public ppFutureFrames As IntPtr
    Public pFutureSubresources As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class D3D12_VIDEO_PROCESS_REFERENCE_SET(ctypes.Structure):
    _fields_ = [
        ("NumPastFrames", wintypes.DWORD),
        ("ppPastFrames", ctypes.c_void_p),
        ("pPastSubresources", ctypes.c_void_p),
        ("NumFutureFrames", wintypes.DWORD),
        ("ppFutureFrames", ctypes.c_void_p),
        ("pFutureSubresources", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct D3D12_VIDEO_PROCESS_REFERENCE_SET {
    pub NumPastFrames: u32,
    pub ppPastFrames: *mut core::ffi::c_void,
    pub pPastSubresources: *mut core::ffi::c_void,
    pub NumFutureFrames: u32,
    pub ppFutureFrames: *mut core::ffi::c_void,
    pub pFutureSubresources: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type D3D12_VIDEO_PROCESS_REFERENCE_SET struct {
	NumPastFrames uint32
	ppPastFrames uintptr
	pPastSubresources uintptr
	NumFutureFrames uint32
	ppFutureFrames uintptr
	pFutureSubresources uintptr
}
type
  D3D12_VIDEO_PROCESS_REFERENCE_SET = record
    NumPastFrames: DWORD;
    ppPastFrames: Pointer;
    pPastSubresources: Pointer;
    NumFutureFrames: DWORD;
    ppFutureFrames: Pointer;
    pFutureSubresources: Pointer;
  end;
const D3D12_VIDEO_PROCESS_REFERENCE_SET = extern struct {
    NumPastFrames: u32,
    ppPastFrames: ?*anyopaque,
    pPastSubresources: ?*anyopaque,
    NumFutureFrames: u32,
    ppFutureFrames: ?*anyopaque,
    pFutureSubresources: ?*anyopaque,
};
type
  D3D12_VIDEO_PROCESS_REFERENCE_SET {.bycopy.} = object
    NumPastFrames: uint32
    ppPastFrames: pointer
    pPastSubresources: pointer
    NumFutureFrames: uint32
    ppFutureFrames: pointer
    pFutureSubresources: pointer
struct D3D12_VIDEO_PROCESS_REFERENCE_SET
{
    uint NumPastFrames;
    void* ppPastFrames;
    void* pPastSubresources;
    uint NumFutureFrames;
    void* ppFutureFrames;
    void* pFutureSubresources;
}

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_PROCESS_REFERENCE_SET サイズ: 24 バイト(x86)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; NumPastFrames : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; ppPastFrames : ID3D12Resource** (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; pPastSubresources : DWORD* (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; NumFutureFrames : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; ppFutureFrames : ID3D12Resource** (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; pFutureSubresources : DWORD* (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D12_VIDEO_PROCESS_REFERENCE_SET サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; NumPastFrames : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; ppPastFrames : ID3D12Resource** (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; pPastSubresources : DWORD* (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; NumFutureFrames : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ppFutureFrames : ID3D12Resource** (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; pFutureSubresources : DWORD* (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3D12_VIDEO_PROCESS_REFERENCE_SET
    #field int NumPastFrames
    #field intptr ppPastFrames
    #field intptr pPastSubresources
    #field int NumFutureFrames
    #field intptr ppFutureFrames
    #field intptr pFutureSubresources
#endstruct

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