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

VMR9PresentationInfo

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

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

フィールド

フィールドサイズx64x86説明
dwFlagsDWORD4+0+0表示情報のフラグ。インターレース等の属性を示すビット集合。
lpSurfIDirect3DSurface9*8/4+8+4表示するDirect3D9サーフェスへのポインタ。
rtStartLONGLONG8+16+8サンプルの表示開始時刻。単位は100ナノ秒。
rtEndLONGLONG8+24+16サンプルの表示終了時刻。単位は100ナノ秒。
szAspectRatioSIZE8+32+24映像のアスペクト比を示すサイズ(SIZE)。
rcSrcRECT16+40+32ソースから切り出す矩形領域(RECT)。
rcDstRECT16+56+48出力先の描画矩形領域(RECT)。
dwReserved1DWORD4+72+64予約フィールド。将来の拡張用で通常は0。
dwReserved2DWORD4+76+68予約フィールド。将来の拡張用で通常は0。

各言語での定義

#include <windows.h>

// SIZE  (x64 8 / x86 8 バイト)
typedef struct SIZE {
    INT cx;
    INT cy;
} SIZE;

// RECT  (x64 16 / x86 16 バイト)
typedef struct RECT {
    INT left;
    INT top;
    INT right;
    INT bottom;
} RECT;

// VMR9PresentationInfo  (x64 80 / x86 72 バイト)
typedef struct VMR9PresentationInfo {
    DWORD dwFlags;
    IDirect3DSurface9* lpSurf;
    LONGLONG rtStart;
    LONGLONG rtEnd;
    SIZE szAspectRatio;
    RECT rcSrc;
    RECT rcDst;
    DWORD dwReserved1;
    DWORD dwReserved2;
} VMR9PresentationInfo;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SIZE
{
    public int cx;
    public int cy;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RECT
{
    public int left;
    public int top;
    public int right;
    public int bottom;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct VMR9PresentationInfo
{
    public uint dwFlags;
    public IntPtr lpSurf;
    public long rtStart;
    public long rtEnd;
    public SIZE szAspectRatio;
    public RECT rcSrc;
    public RECT rcDst;
    public uint dwReserved1;
    public uint dwReserved2;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SIZE
    Public cx As Integer
    Public cy As Integer
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RECT
    Public left As Integer
    Public top As Integer
    Public right As Integer
    Public bottom As Integer
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure VMR9PresentationInfo
    Public dwFlags As UInteger
    Public lpSurf As IntPtr
    Public rtStart As Long
    Public rtEnd As Long
    Public szAspectRatio As SIZE
    Public rcSrc As RECT
    Public rcDst As RECT
    Public dwReserved1 As UInteger
    Public dwReserved2 As UInteger
End Structure
import ctypes
from ctypes import wintypes

class SIZE(ctypes.Structure):
    _fields_ = [
        ("cx", ctypes.c_int),
        ("cy", ctypes.c_int),
    ]

class RECT(ctypes.Structure):
    _fields_ = [
        ("left", ctypes.c_int),
        ("top", ctypes.c_int),
        ("right", ctypes.c_int),
        ("bottom", ctypes.c_int),
    ]

class VMR9PresentationInfo(ctypes.Structure):
    _fields_ = [
        ("dwFlags", wintypes.DWORD),
        ("lpSurf", ctypes.c_void_p),
        ("rtStart", ctypes.c_longlong),
        ("rtEnd", ctypes.c_longlong),
        ("szAspectRatio", SIZE),
        ("rcSrc", RECT),
        ("rcDst", RECT),
        ("dwReserved1", wintypes.DWORD),
        ("dwReserved2", wintypes.DWORD),
    ]
#[repr(C)]
pub struct SIZE {
    pub cx: i32,
    pub cy: i32,
}

#[repr(C)]
pub struct RECT {
    pub left: i32,
    pub top: i32,
    pub right: i32,
    pub bottom: i32,
}

#[repr(C)]
pub struct VMR9PresentationInfo {
    pub dwFlags: u32,
    pub lpSurf: *mut core::ffi::c_void,
    pub rtStart: i64,
    pub rtEnd: i64,
    pub szAspectRatio: SIZE,
    pub rcSrc: RECT,
    pub rcDst: RECT,
    pub dwReserved1: u32,
    pub dwReserved2: u32,
}
import "golang.org/x/sys/windows"

type SIZE struct {
	cx int32
	cy int32
}

type RECT struct {
	left int32
	top int32
	right int32
	bottom int32
}

type VMR9PresentationInfo struct {
	dwFlags uint32
	lpSurf uintptr
	rtStart int64
	rtEnd int64
	szAspectRatio SIZE
	rcSrc RECT
	rcDst RECT
	dwReserved1 uint32
	dwReserved2 uint32
}
type
  SIZE = record
    cx: Integer;
    cy: Integer;
  end;

  RECT = record
    left: Integer;
    top: Integer;
    right: Integer;
    bottom: Integer;
  end;

  VMR9PresentationInfo = record
    dwFlags: DWORD;
    lpSurf: Pointer;
    rtStart: Int64;
    rtEnd: Int64;
    szAspectRatio: SIZE;
    rcSrc: RECT;
    rcDst: RECT;
    dwReserved1: DWORD;
    dwReserved2: DWORD;
  end;
const SIZE = extern struct {
    cx: i32,
    cy: i32,
};

const RECT = extern struct {
    left: i32,
    top: i32,
    right: i32,
    bottom: i32,
};

const VMR9PresentationInfo = extern struct {
    dwFlags: u32,
    lpSurf: ?*anyopaque,
    rtStart: i64,
    rtEnd: i64,
    szAspectRatio: SIZE,
    rcSrc: RECT,
    rcDst: RECT,
    dwReserved1: u32,
    dwReserved2: u32,
};
type
  SIZE {.bycopy.} = object
    cx: int32
    cy: int32

  RECT {.bycopy.} = object
    left: int32
    top: int32
    right: int32
    bottom: int32

  VMR9PresentationInfo {.bycopy.} = object
    dwFlags: uint32
    lpSurf: pointer
    rtStart: int64
    rtEnd: int64
    szAspectRatio: SIZE
    rcSrc: RECT
    rcDst: RECT
    dwReserved1: uint32
    dwReserved2: uint32
struct SIZE
{
    int cx;
    int cy;
}

struct RECT
{
    int left;
    int top;
    int right;
    int bottom;
}

struct VMR9PresentationInfo
{
    uint dwFlags;
    void* lpSurf;
    long rtStart;
    long rtEnd;
    SIZE szAspectRatio;
    RECT rcSrc;
    RECT rcDst;
    uint dwReserved1;
    uint dwReserved2;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; VMR9PresentationInfo サイズ: 72 バイト(x86)
dim st, 18    ; 4byte整数×18(構造体サイズ 72 / 4 切り上げ)
; dwFlags : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; lpSurf : IDirect3DSurface9* (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; rtStart : LONGLONG (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; rtEnd : LONGLONG (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; szAspectRatio : SIZE (+24, 8byte)  varptr(st)+24 を基点に操作(8byte:入れ子/配列)
; rcSrc : RECT (+32, 16byte)  varptr(st)+32 を基点に操作(16byte:入れ子/配列)
; rcDst : RECT (+48, 16byte)  varptr(st)+48 を基点に操作(16byte:入れ子/配列)
; dwReserved1 : DWORD (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; dwReserved2 : DWORD (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; VMR9PresentationInfo サイズ: 80 バイト(x64)
dim st, 20    ; 4byte整数×20(構造体サイズ 80 / 4 切り上げ)
; dwFlags : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; lpSurf : IDirect3DSurface9* (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; rtStart : LONGLONG (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; rtEnd : LONGLONG (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; szAspectRatio : SIZE (+32, 8byte)  varptr(st)+32 を基点に操作(8byte:入れ子/配列)
; rcSrc : RECT (+40, 16byte)  varptr(st)+40 を基点に操作(16byte:入れ子/配列)
; rcDst : RECT (+56, 16byte)  varptr(st)+56 を基点に操作(16byte:入れ子/配列)
; dwReserved1 : DWORD (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; dwReserved2 : DWORD (+76, 4byte)  st.19 = 値  /  値 = st.19   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global SIZE
    #field int cx
    #field int cy
#endstruct

#defstruct global RECT
    #field int left
    #field int top
    #field int right
    #field int bottom
#endstruct

#defstruct global VMR9PresentationInfo
    #field int dwFlags
    #field intptr lpSurf
    #field int64 rtStart
    #field int64 rtEnd
    #field SIZE szAspectRatio
    #field RECT rcSrc
    #field RECT rcDst
    #field int dwReserved1
    #field int dwReserved2
#endstruct

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