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

VMRPRESENTATIONINFO

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

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

フィールド

フィールドサイズx64x86説明
dwFlagsDWORD4+0+0提示情報のフラグ(VMRSample_*)を示す。
lpSurfIDirectDrawSurface7*8/4+8+4ビデオフレームを保持するIDirectDrawSurface7へのポインター。
rtStartLONGLONG8+16+8フレームの開始時刻を100ナノ秒単位で示す。
rtEndLONGLONG8+24+16フレームの終了時刻を100ナノ秒単位で示す。
szAspectRatioSIZE8+32+24ビデオのアスペクト比をSIZE構造体で示す。
rcSrcRECT16+40+32ソース矩形を示すRECT構造体。
rcDstRECT16+56+48描画先矩形を示すRECT構造体。
dwTypeSpecificFlagsDWORD4+72+64メディア種別固有のフラグを示す。
dwInterlaceFlagsDWORD4+76+68インターレースに関するフラグを示す。

各言語での定義

#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;

// VMRPRESENTATIONINFO  (x64 80 / x86 72 バイト)
typedef struct VMRPRESENTATIONINFO {
    DWORD dwFlags;
    IDirectDrawSurface7* lpSurf;
    LONGLONG rtStart;
    LONGLONG rtEnd;
    SIZE szAspectRatio;
    RECT rcSrc;
    RECT rcDst;
    DWORD dwTypeSpecificFlags;
    DWORD dwInterlaceFlags;
} VMRPRESENTATIONINFO;
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 VMRPRESENTATIONINFO
{
    public uint dwFlags;
    public IntPtr lpSurf;
    public long rtStart;
    public long rtEnd;
    public SIZE szAspectRatio;
    public RECT rcSrc;
    public RECT rcDst;
    public uint dwTypeSpecificFlags;
    public uint dwInterlaceFlags;
}
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 VMRPRESENTATIONINFO
    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 dwTypeSpecificFlags As UInteger
    Public dwInterlaceFlags 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 VMRPRESENTATIONINFO(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),
        ("dwTypeSpecificFlags", wintypes.DWORD),
        ("dwInterlaceFlags", 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 VMRPRESENTATIONINFO {
    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 dwTypeSpecificFlags: u32,
    pub dwInterlaceFlags: 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 VMRPRESENTATIONINFO struct {
	dwFlags uint32
	lpSurf uintptr
	rtStart int64
	rtEnd int64
	szAspectRatio SIZE
	rcSrc RECT
	rcDst RECT
	dwTypeSpecificFlags uint32
	dwInterlaceFlags uint32
}
type
  SIZE = record
    cx: Integer;
    cy: Integer;
  end;

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

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

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

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

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

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

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

struct VMRPRESENTATIONINFO
{
    uint dwFlags;
    void* lpSurf;
    long rtStart;
    long rtEnd;
    SIZE szAspectRatio;
    RECT rcSrc;
    RECT rcDst;
    uint dwTypeSpecificFlags;
    uint dwInterlaceFlags;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; VMRPRESENTATIONINFO サイズ: 72 バイト(x86)
dim st, 18    ; 4byte整数×18(構造体サイズ 72 / 4 切り上げ)
; dwFlags : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; lpSurf : IDirectDrawSurface7* (+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:入れ子/配列)
; dwTypeSpecificFlags : DWORD (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; dwInterlaceFlags : DWORD (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; VMRPRESENTATIONINFO サイズ: 80 バイト(x64)
dim st, 20    ; 4byte整数×20(構造体サイズ 80 / 4 切り上げ)
; dwFlags : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; lpSurf : IDirectDrawSurface7* (+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:入れ子/配列)
; dwTypeSpecificFlags : DWORD (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; dwInterlaceFlags : 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 VMRPRESENTATIONINFO
    #field int dwFlags
    #field intptr lpSurf
    #field int64 rtStart
    #field int64 rtEnd
    #field SIZE szAspectRatio
    #field RECT rcSrc
    #field RECT rcDst
    #field int dwTypeSpecificFlags
    #field int dwInterlaceFlags
#endstruct

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