ホーム › Media.DirectShow › VMR9AllocationInfo
VMR9AllocationInfo
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwFlags | DWORD | 4 | +0 | +0 | VMR9SurfaceAllocationFlags 列挙型のフラグのビット単位の組み合わせを指定します。 |
| dwWidth | DWORD | 4 | +4 | +4 | サーフェスの幅を指定します。 |
| dwHeight | DWORD | 4 | +8 | +8 | サーフェスの高さを指定します。 |
| Format | D3DFORMAT | 4 | +12 | +12 | サーフェスの形式を D3DFORMAT 型として指定します。値 D3DFMT_UNKNOWN (0) は、サーフェス形式がディスプレイと互換性を持つべきであることを示します。 |
| Pool | D3DPOOL | 4 | +16 | +16 | サーフェスに使用する Direct3D のメモリ プールを D3DPOOL 型として指定します。 |
| MinBuffers | DWORD | 4 | +20 | +20 | 作成するバッファーの最小数を指定します。 |
| szAspectRatio | SIZE | 8 | +24 | +24 | ビデオの縦横比を SIZE 構造体として指定します。 |
| szNativeSize | SIZE | 8 | +32 | +32 | ビデオのネイティブ サイズを SIZE 構造体として指定します。 |
公式ドキュメント
[このページに関連する機能である DirectShow はレガシー機能です。これは MediaPlayer、IMFMediaEngine、および Media Foundation でのオーディオ/ビデオ キャプチャ に置き換えられました。これらの機能は Windows 10 および Windows 11 向けに最適化されています。Microsoft は、新しいコードでは可能な限り DirectShow ではなく MediaPlayer、IMFMediaEngine、Media Foundation でのオーディオ/ビデオ キャプチャ を使用することを強く推奨します。また、レガシー API を使用している既存のコードについても、可能であれば新しい API を使用するように書き換えることを推奨します。]
VMR9AllocationInfo 構造体は、VMR-9 アロケーター/プレゼンター オブジェクトが割り当てる Direct3D サーフェスを記述します。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// SIZE (x64 8 / x86 8 バイト)
typedef struct SIZE {
INT cx;
INT cy;
} SIZE;
// VMR9AllocationInfo (x64 40 / x86 40 バイト)
typedef struct VMR9AllocationInfo {
DWORD dwFlags;
DWORD dwWidth;
DWORD dwHeight;
D3DFORMAT Format;
D3DPOOL Pool;
DWORD MinBuffers;
SIZE szAspectRatio;
SIZE szNativeSize;
} VMR9AllocationInfo;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 VMR9AllocationInfo
{
public uint dwFlags;
public uint dwWidth;
public uint dwHeight;
public uint Format;
public int Pool;
public uint MinBuffers;
public SIZE szAspectRatio;
public SIZE szNativeSize;
}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 VMR9AllocationInfo
Public dwFlags As UInteger
Public dwWidth As UInteger
Public dwHeight As UInteger
Public Format As UInteger
Public Pool As Integer
Public MinBuffers As UInteger
Public szAspectRatio As SIZE
Public szNativeSize As SIZE
End Structureimport ctypes
from ctypes import wintypes
class SIZE(ctypes.Structure):
_fields_ = [
("cx", ctypes.c_int),
("cy", ctypes.c_int),
]
class VMR9AllocationInfo(ctypes.Structure):
_fields_ = [
("dwFlags", wintypes.DWORD),
("dwWidth", wintypes.DWORD),
("dwHeight", wintypes.DWORD),
("Format", wintypes.DWORD),
("Pool", ctypes.c_int),
("MinBuffers", wintypes.DWORD),
("szAspectRatio", SIZE),
("szNativeSize", SIZE),
]#[repr(C)]
pub struct SIZE {
pub cx: i32,
pub cy: i32,
}
#[repr(C)]
pub struct VMR9AllocationInfo {
pub dwFlags: u32,
pub dwWidth: u32,
pub dwHeight: u32,
pub Format: u32,
pub Pool: i32,
pub MinBuffers: u32,
pub szAspectRatio: SIZE,
pub szNativeSize: SIZE,
}import "golang.org/x/sys/windows"
type SIZE struct {
cx int32
cy int32
}
type VMR9AllocationInfo struct {
dwFlags uint32
dwWidth uint32
dwHeight uint32
Format uint32
Pool int32
MinBuffers uint32
szAspectRatio SIZE
szNativeSize SIZE
}type
SIZE = record
cx: Integer;
cy: Integer;
end;
VMR9AllocationInfo = record
dwFlags: DWORD;
dwWidth: DWORD;
dwHeight: DWORD;
Format: DWORD;
Pool: Integer;
MinBuffers: DWORD;
szAspectRatio: SIZE;
szNativeSize: SIZE;
end;const SIZE = extern struct {
cx: i32,
cy: i32,
};
const VMR9AllocationInfo = extern struct {
dwFlags: u32,
dwWidth: u32,
dwHeight: u32,
Format: u32,
Pool: i32,
MinBuffers: u32,
szAspectRatio: SIZE,
szNativeSize: SIZE,
};type
SIZE {.bycopy.} = object
cx: int32
cy: int32
VMR9AllocationInfo {.bycopy.} = object
dwFlags: uint32
dwWidth: uint32
dwHeight: uint32
Format: uint32
Pool: int32
MinBuffers: uint32
szAspectRatio: SIZE
szNativeSize: SIZEstruct SIZE
{
int cx;
int cy;
}
struct VMR9AllocationInfo
{
uint dwFlags;
uint dwWidth;
uint dwHeight;
uint Format;
int Pool;
uint MinBuffers;
SIZE szAspectRatio;
SIZE szNativeSize;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; VMR9AllocationInfo サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; dwFlags : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwWidth : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwHeight : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; Format : D3DFORMAT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; Pool : D3DPOOL (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; MinBuffers : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; szAspectRatio : SIZE (+24, 8byte) varptr(st)+24 を基点に操作(8byte:入れ子/配列)
; szNativeSize : SIZE (+32, 8byte) varptr(st)+32 を基点に操作(8byte:入れ子/配列)
; ※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 VMR9AllocationInfo
#field int dwFlags
#field int dwWidth
#field int dwHeight
#field int Format
#field int Pool
#field int MinBuffers
#field SIZE szAspectRatio
#field SIZE szNativeSize
#endstruct
stdim st, VMR9AllocationInfo ; NSTRUCT 変数を確保
st->dwFlags = 100
mes "dwFlags=" + st->dwFlags