Win32 API 日本語リファレンス
ホームGraphics.DirectDraw › DD_MOTIONCOMPCALLBACKS

DD_MOTIONCOMPCALLBACKS

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

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

フィールド

フィールドサイズx64x86説明
dwSizeDWORD4+0+0この構造体のサイズをバイト単位で示す。
dwFlagsDWORD4+4+4設定済みのコールバックを示すフラグ。
GetMoCompGuidsPDD_MOCOMPCB_GETGUIDS8/4+8+8対応モーション補償GUIDを取得するコールバック関数へのポインタ。
GetMoCompFormatsPDD_MOCOMPCB_GETFORMATS8/4+16+12対応ピクセル形式を取得するコールバック関数へのポインタ。
CreateMoCompPDD_MOCOMPCB_CREATE8/4+24+16モーション補償オブジェクトを作成するコールバック関数へのポインタ。
GetMoCompBuffInfoPDD_MOCOMPCB_GETCOMPBUFFINFO8/4+32+20圧縮バッファ情報を取得するコールバック関数へのポインタ。
GetInternalMoCompInfoPDD_MOCOMPCB_GETINTERNALINFO8/4+40+24内部モーション補償情報を取得するコールバック関数へのポインタ。
BeginMoCompFramePDD_MOCOMPCB_BEGINFRAME8/4+48+28フレームのデコード開始を通知するコールバック関数へのポインタ。
EndMoCompFramePDD_MOCOMPCB_ENDFRAME8/4+56+32フレームのデコード終了を通知するコールバック関数へのポインタ。
RenderMoCompPDD_MOCOMPCB_RENDER8/4+64+36モーション補償レンダリングを行うコールバック関数へのポインタ。
QueryMoCompStatusPDD_MOCOMPCB_QUERYSTATUS8/4+72+40デコード状態を問い合わせるコールバック関数へのポインタ。
DestroyMoCompPDD_MOCOMPCB_DESTROY8/4+80+44モーション補償オブジェクトを破棄するコールバック関数へのポインタ。

各言語での定義

#include <windows.h>

// DD_MOTIONCOMPCALLBACKS  (x64 88 / x86 48 バイト)
typedef struct DD_MOTIONCOMPCALLBACKS {
    DWORD dwSize;
    DWORD dwFlags;
    PDD_MOCOMPCB_GETGUIDS GetMoCompGuids;
    PDD_MOCOMPCB_GETFORMATS GetMoCompFormats;
    PDD_MOCOMPCB_CREATE CreateMoComp;
    PDD_MOCOMPCB_GETCOMPBUFFINFO GetMoCompBuffInfo;
    PDD_MOCOMPCB_GETINTERNALINFO GetInternalMoCompInfo;
    PDD_MOCOMPCB_BEGINFRAME BeginMoCompFrame;
    PDD_MOCOMPCB_ENDFRAME EndMoCompFrame;
    PDD_MOCOMPCB_RENDER RenderMoComp;
    PDD_MOCOMPCB_QUERYSTATUS QueryMoCompStatus;
    PDD_MOCOMPCB_DESTROY DestroyMoComp;
} DD_MOTIONCOMPCALLBACKS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DD_MOTIONCOMPCALLBACKS
{
    public uint dwSize;
    public uint dwFlags;
    public IntPtr GetMoCompGuids;
    public IntPtr GetMoCompFormats;
    public IntPtr CreateMoComp;
    public IntPtr GetMoCompBuffInfo;
    public IntPtr GetInternalMoCompInfo;
    public IntPtr BeginMoCompFrame;
    public IntPtr EndMoCompFrame;
    public IntPtr RenderMoComp;
    public IntPtr QueryMoCompStatus;
    public IntPtr DestroyMoComp;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DD_MOTIONCOMPCALLBACKS
    Public dwSize As UInteger
    Public dwFlags As UInteger
    Public GetMoCompGuids As IntPtr
    Public GetMoCompFormats As IntPtr
    Public CreateMoComp As IntPtr
    Public GetMoCompBuffInfo As IntPtr
    Public GetInternalMoCompInfo As IntPtr
    Public BeginMoCompFrame As IntPtr
    Public EndMoCompFrame As IntPtr
    Public RenderMoComp As IntPtr
    Public QueryMoCompStatus As IntPtr
    Public DestroyMoComp As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class DD_MOTIONCOMPCALLBACKS(ctypes.Structure):
    _fields_ = [
        ("dwSize", wintypes.DWORD),
        ("dwFlags", wintypes.DWORD),
        ("GetMoCompGuids", ctypes.c_void_p),
        ("GetMoCompFormats", ctypes.c_void_p),
        ("CreateMoComp", ctypes.c_void_p),
        ("GetMoCompBuffInfo", ctypes.c_void_p),
        ("GetInternalMoCompInfo", ctypes.c_void_p),
        ("BeginMoCompFrame", ctypes.c_void_p),
        ("EndMoCompFrame", ctypes.c_void_p),
        ("RenderMoComp", ctypes.c_void_p),
        ("QueryMoCompStatus", ctypes.c_void_p),
        ("DestroyMoComp", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct DD_MOTIONCOMPCALLBACKS {
    pub dwSize: u32,
    pub dwFlags: u32,
    pub GetMoCompGuids: *mut core::ffi::c_void,
    pub GetMoCompFormats: *mut core::ffi::c_void,
    pub CreateMoComp: *mut core::ffi::c_void,
    pub GetMoCompBuffInfo: *mut core::ffi::c_void,
    pub GetInternalMoCompInfo: *mut core::ffi::c_void,
    pub BeginMoCompFrame: *mut core::ffi::c_void,
    pub EndMoCompFrame: *mut core::ffi::c_void,
    pub RenderMoComp: *mut core::ffi::c_void,
    pub QueryMoCompStatus: *mut core::ffi::c_void,
    pub DestroyMoComp: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type DD_MOTIONCOMPCALLBACKS struct {
	dwSize uint32
	dwFlags uint32
	GetMoCompGuids uintptr
	GetMoCompFormats uintptr
	CreateMoComp uintptr
	GetMoCompBuffInfo uintptr
	GetInternalMoCompInfo uintptr
	BeginMoCompFrame uintptr
	EndMoCompFrame uintptr
	RenderMoComp uintptr
	QueryMoCompStatus uintptr
	DestroyMoComp uintptr
}
type
  DD_MOTIONCOMPCALLBACKS = record
    dwSize: DWORD;
    dwFlags: DWORD;
    GetMoCompGuids: Pointer;
    GetMoCompFormats: Pointer;
    CreateMoComp: Pointer;
    GetMoCompBuffInfo: Pointer;
    GetInternalMoCompInfo: Pointer;
    BeginMoCompFrame: Pointer;
    EndMoCompFrame: Pointer;
    RenderMoComp: Pointer;
    QueryMoCompStatus: Pointer;
    DestroyMoComp: Pointer;
  end;
const DD_MOTIONCOMPCALLBACKS = extern struct {
    dwSize: u32,
    dwFlags: u32,
    GetMoCompGuids: ?*anyopaque,
    GetMoCompFormats: ?*anyopaque,
    CreateMoComp: ?*anyopaque,
    GetMoCompBuffInfo: ?*anyopaque,
    GetInternalMoCompInfo: ?*anyopaque,
    BeginMoCompFrame: ?*anyopaque,
    EndMoCompFrame: ?*anyopaque,
    RenderMoComp: ?*anyopaque,
    QueryMoCompStatus: ?*anyopaque,
    DestroyMoComp: ?*anyopaque,
};
type
  DD_MOTIONCOMPCALLBACKS {.bycopy.} = object
    dwSize: uint32
    dwFlags: uint32
    GetMoCompGuids: pointer
    GetMoCompFormats: pointer
    CreateMoComp: pointer
    GetMoCompBuffInfo: pointer
    GetInternalMoCompInfo: pointer
    BeginMoCompFrame: pointer
    EndMoCompFrame: pointer
    RenderMoComp: pointer
    QueryMoCompStatus: pointer
    DestroyMoComp: pointer
struct DD_MOTIONCOMPCALLBACKS
{
    uint dwSize;
    uint dwFlags;
    void* GetMoCompGuids;
    void* GetMoCompFormats;
    void* CreateMoComp;
    void* GetMoCompBuffInfo;
    void* GetInternalMoCompInfo;
    void* BeginMoCompFrame;
    void* EndMoCompFrame;
    void* RenderMoComp;
    void* QueryMoCompStatus;
    void* DestroyMoComp;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DD_MOTIONCOMPCALLBACKS サイズ: 48 バイト(x86)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; GetMoCompGuids : PDD_MOCOMPCB_GETGUIDS (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; GetMoCompFormats : PDD_MOCOMPCB_GETFORMATS (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; CreateMoComp : PDD_MOCOMPCB_CREATE (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; GetMoCompBuffInfo : PDD_MOCOMPCB_GETCOMPBUFFINFO (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; GetInternalMoCompInfo : PDD_MOCOMPCB_GETINTERNALINFO (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; BeginMoCompFrame : PDD_MOCOMPCB_BEGINFRAME (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; EndMoCompFrame : PDD_MOCOMPCB_ENDFRAME (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; RenderMoComp : PDD_MOCOMPCB_RENDER (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; QueryMoCompStatus : PDD_MOCOMPCB_QUERYSTATUS (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; DestroyMoComp : PDD_MOCOMPCB_DESTROY (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DD_MOTIONCOMPCALLBACKS サイズ: 88 バイト(x64)
dim st, 22    ; 4byte整数×22(構造体サイズ 88 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; GetMoCompGuids : PDD_MOCOMPCB_GETGUIDS (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; GetMoCompFormats : PDD_MOCOMPCB_GETFORMATS (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; CreateMoComp : PDD_MOCOMPCB_CREATE (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; GetMoCompBuffInfo : PDD_MOCOMPCB_GETCOMPBUFFINFO (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; GetInternalMoCompInfo : PDD_MOCOMPCB_GETINTERNALINFO (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; BeginMoCompFrame : PDD_MOCOMPCB_BEGINFRAME (+48, 8byte)  qpoke st,48,値 / qpeek(st,48)  ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; EndMoCompFrame : PDD_MOCOMPCB_ENDFRAME (+56, 8byte)  qpoke st,56,値 / qpeek(st,56)  ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; RenderMoComp : PDD_MOCOMPCB_RENDER (+64, 8byte)  qpoke st,64,値 / qpeek(st,64)  ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; QueryMoCompStatus : PDD_MOCOMPCB_QUERYSTATUS (+72, 8byte)  qpoke st,72,値 / qpeek(st,72)  ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; DestroyMoComp : PDD_MOCOMPCB_DESTROY (+80, 8byte)  qpoke st,80,値 / qpeek(st,80)  ※IronHSPのみ。3.7/3.8は lpoke st,80,下位 : lpoke st,84,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DD_MOTIONCOMPCALLBACKS
    #field int dwSize
    #field int dwFlags
    #field intptr GetMoCompGuids
    #field intptr GetMoCompFormats
    #field intptr CreateMoComp
    #field intptr GetMoCompBuffInfo
    #field intptr GetInternalMoCompInfo
    #field intptr BeginMoCompFrame
    #field intptr EndMoCompFrame
    #field intptr RenderMoComp
    #field intptr QueryMoCompStatus
    #field intptr DestroyMoComp
#endstruct

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