ホーム › Media.DirectShow › AMVPDATAINFO
AMVPDATAINFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwSize | DWORD | 4 | +0 | +0 | この構造体のサイズをバイト単位で示す。 |
| dwMicrosecondsPerField | DWORD | 4 | +4 | +4 | 1フィールドあたりの時間をマイクロ秒で示す。 |
| amvpDimInfo | AMVPDIMINFO | 32 | +8 | +8 | ビデオの寸法情報を示すAMVPDIMINFO構造体。 |
| dwPictAspectRatioX | DWORD | 4 | +40 | +40 | 画像アスペクト比の水平成分を示す。 |
| dwPictAspectRatioY | DWORD | 4 | +44 | +44 | 画像アスペクト比の垂直成分を示す。 |
| bEnableDoubleClock | BOOL | 4 | +48 | +48 | ダブルクロックを有効化するかを示す真偽値。 |
| bEnableVACT | BOOL | 4 | +52 | +52 | VACT(垂直アクティブ)信号を有効化するかを示す真偽値。 |
| bDataIsInterlaced | BOOL | 4 | +56 | +56 | データがインターレースかを示す真偽値。 |
| lHalfLinesOdd | INT | 4 | +60 | +60 | 奇数フィールドのハーフライン数を示す。 |
| bFieldPolarityInverted | BOOL | 4 | +64 | +64 | フィールド極性が反転しているかを示す真偽値。 |
| dwNumLinesInVREF | DWORD | 4 | +68 | +68 | VREF区間に含まれるライン数を示す。 |
| lHalfLinesEven | INT | 4 | +72 | +72 | 偶数フィールドのハーフライン数を示す。 |
| dwReserved1 | DWORD | 4 | +76 | +76 | 将来用に予約された領域。 |
各言語での定義
#include <windows.h>
// RECT (x64 16 / x86 16 バイト)
typedef struct RECT {
INT left;
INT top;
INT right;
INT bottom;
} RECT;
// AMVPDIMINFO (x64 32 / x86 32 バイト)
typedef struct AMVPDIMINFO {
DWORD dwFieldWidth;
DWORD dwFieldHeight;
DWORD dwVBIWidth;
DWORD dwVBIHeight;
RECT rcValidRegion;
} AMVPDIMINFO;
// AMVPDATAINFO (x64 80 / x86 80 バイト)
typedef struct AMVPDATAINFO {
DWORD dwSize;
DWORD dwMicrosecondsPerField;
AMVPDIMINFO amvpDimInfo;
DWORD dwPictAspectRatioX;
DWORD dwPictAspectRatioY;
BOOL bEnableDoubleClock;
BOOL bEnableVACT;
BOOL bDataIsInterlaced;
INT lHalfLinesOdd;
BOOL bFieldPolarityInverted;
DWORD dwNumLinesInVREF;
INT lHalfLinesEven;
DWORD dwReserved1;
} AMVPDATAINFO;using System;
using System.Runtime.InteropServices;
[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 AMVPDIMINFO
{
public uint dwFieldWidth;
public uint dwFieldHeight;
public uint dwVBIWidth;
public uint dwVBIHeight;
public RECT rcValidRegion;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct AMVPDATAINFO
{
public uint dwSize;
public uint dwMicrosecondsPerField;
public AMVPDIMINFO amvpDimInfo;
public uint dwPictAspectRatioX;
public uint dwPictAspectRatioY;
[MarshalAs(UnmanagedType.Bool)] public bool bEnableDoubleClock;
[MarshalAs(UnmanagedType.Bool)] public bool bEnableVACT;
[MarshalAs(UnmanagedType.Bool)] public bool bDataIsInterlaced;
public int lHalfLinesOdd;
[MarshalAs(UnmanagedType.Bool)] public bool bFieldPolarityInverted;
public uint dwNumLinesInVREF;
public int lHalfLinesEven;
public uint dwReserved1;
}Imports System.Runtime.InteropServices
<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 AMVPDIMINFO
Public dwFieldWidth As UInteger
Public dwFieldHeight As UInteger
Public dwVBIWidth As UInteger
Public dwVBIHeight As UInteger
Public rcValidRegion As RECT
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure AMVPDATAINFO
Public dwSize As UInteger
Public dwMicrosecondsPerField As UInteger
Public amvpDimInfo As AMVPDIMINFO
Public dwPictAspectRatioX As UInteger
Public dwPictAspectRatioY As UInteger
<MarshalAs(UnmanagedType.Bool)> Public bEnableDoubleClock As Boolean
<MarshalAs(UnmanagedType.Bool)> Public bEnableVACT As Boolean
<MarshalAs(UnmanagedType.Bool)> Public bDataIsInterlaced As Boolean
Public lHalfLinesOdd As Integer
<MarshalAs(UnmanagedType.Bool)> Public bFieldPolarityInverted As Boolean
Public dwNumLinesInVREF As UInteger
Public lHalfLinesEven As Integer
Public dwReserved1 As UInteger
End Structureimport ctypes
from ctypes import wintypes
class RECT(ctypes.Structure):
_fields_ = [
("left", ctypes.c_int),
("top", ctypes.c_int),
("right", ctypes.c_int),
("bottom", ctypes.c_int),
]
class AMVPDIMINFO(ctypes.Structure):
_fields_ = [
("dwFieldWidth", wintypes.DWORD),
("dwFieldHeight", wintypes.DWORD),
("dwVBIWidth", wintypes.DWORD),
("dwVBIHeight", wintypes.DWORD),
("rcValidRegion", RECT),
]
class AMVPDATAINFO(ctypes.Structure):
_fields_ = [
("dwSize", wintypes.DWORD),
("dwMicrosecondsPerField", wintypes.DWORD),
("amvpDimInfo", AMVPDIMINFO),
("dwPictAspectRatioX", wintypes.DWORD),
("dwPictAspectRatioY", wintypes.DWORD),
("bEnableDoubleClock", wintypes.BOOL),
("bEnableVACT", wintypes.BOOL),
("bDataIsInterlaced", wintypes.BOOL),
("lHalfLinesOdd", ctypes.c_int),
("bFieldPolarityInverted", wintypes.BOOL),
("dwNumLinesInVREF", wintypes.DWORD),
("lHalfLinesEven", ctypes.c_int),
("dwReserved1", wintypes.DWORD),
]#[repr(C)]
pub struct RECT {
pub left: i32,
pub top: i32,
pub right: i32,
pub bottom: i32,
}
#[repr(C)]
pub struct AMVPDIMINFO {
pub dwFieldWidth: u32,
pub dwFieldHeight: u32,
pub dwVBIWidth: u32,
pub dwVBIHeight: u32,
pub rcValidRegion: RECT,
}
#[repr(C)]
pub struct AMVPDATAINFO {
pub dwSize: u32,
pub dwMicrosecondsPerField: u32,
pub amvpDimInfo: AMVPDIMINFO,
pub dwPictAspectRatioX: u32,
pub dwPictAspectRatioY: u32,
pub bEnableDoubleClock: i32,
pub bEnableVACT: i32,
pub bDataIsInterlaced: i32,
pub lHalfLinesOdd: i32,
pub bFieldPolarityInverted: i32,
pub dwNumLinesInVREF: u32,
pub lHalfLinesEven: i32,
pub dwReserved1: u32,
}import "golang.org/x/sys/windows"
type RECT struct {
left int32
top int32
right int32
bottom int32
}
type AMVPDIMINFO struct {
dwFieldWidth uint32
dwFieldHeight uint32
dwVBIWidth uint32
dwVBIHeight uint32
rcValidRegion RECT
}
type AMVPDATAINFO struct {
dwSize uint32
dwMicrosecondsPerField uint32
amvpDimInfo AMVPDIMINFO
dwPictAspectRatioX uint32
dwPictAspectRatioY uint32
bEnableDoubleClock int32
bEnableVACT int32
bDataIsInterlaced int32
lHalfLinesOdd int32
bFieldPolarityInverted int32
dwNumLinesInVREF uint32
lHalfLinesEven int32
dwReserved1 uint32
}type
RECT = record
left: Integer;
top: Integer;
right: Integer;
bottom: Integer;
end;
AMVPDIMINFO = record
dwFieldWidth: DWORD;
dwFieldHeight: DWORD;
dwVBIWidth: DWORD;
dwVBIHeight: DWORD;
rcValidRegion: RECT;
end;
AMVPDATAINFO = record
dwSize: DWORD;
dwMicrosecondsPerField: DWORD;
amvpDimInfo: AMVPDIMINFO;
dwPictAspectRatioX: DWORD;
dwPictAspectRatioY: DWORD;
bEnableDoubleClock: BOOL;
bEnableVACT: BOOL;
bDataIsInterlaced: BOOL;
lHalfLinesOdd: Integer;
bFieldPolarityInverted: BOOL;
dwNumLinesInVREF: DWORD;
lHalfLinesEven: Integer;
dwReserved1: DWORD;
end;const RECT = extern struct {
left: i32,
top: i32,
right: i32,
bottom: i32,
};
const AMVPDIMINFO = extern struct {
dwFieldWidth: u32,
dwFieldHeight: u32,
dwVBIWidth: u32,
dwVBIHeight: u32,
rcValidRegion: RECT,
};
const AMVPDATAINFO = extern struct {
dwSize: u32,
dwMicrosecondsPerField: u32,
amvpDimInfo: AMVPDIMINFO,
dwPictAspectRatioX: u32,
dwPictAspectRatioY: u32,
bEnableDoubleClock: i32,
bEnableVACT: i32,
bDataIsInterlaced: i32,
lHalfLinesOdd: i32,
bFieldPolarityInverted: i32,
dwNumLinesInVREF: u32,
lHalfLinesEven: i32,
dwReserved1: u32,
};type
RECT {.bycopy.} = object
left: int32
top: int32
right: int32
bottom: int32
AMVPDIMINFO {.bycopy.} = object
dwFieldWidth: uint32
dwFieldHeight: uint32
dwVBIWidth: uint32
dwVBIHeight: uint32
rcValidRegion: RECT
AMVPDATAINFO {.bycopy.} = object
dwSize: uint32
dwMicrosecondsPerField: uint32
amvpDimInfo: AMVPDIMINFO
dwPictAspectRatioX: uint32
dwPictAspectRatioY: uint32
bEnableDoubleClock: int32
bEnableVACT: int32
bDataIsInterlaced: int32
lHalfLinesOdd: int32
bFieldPolarityInverted: int32
dwNumLinesInVREF: uint32
lHalfLinesEven: int32
dwReserved1: uint32struct RECT
{
int left;
int top;
int right;
int bottom;
}
struct AMVPDIMINFO
{
uint dwFieldWidth;
uint dwFieldHeight;
uint dwVBIWidth;
uint dwVBIHeight;
RECT rcValidRegion;
}
struct AMVPDATAINFO
{
uint dwSize;
uint dwMicrosecondsPerField;
AMVPDIMINFO amvpDimInfo;
uint dwPictAspectRatioX;
uint dwPictAspectRatioY;
int bEnableDoubleClock;
int bEnableVACT;
int bDataIsInterlaced;
int lHalfLinesOdd;
int bFieldPolarityInverted;
uint dwNumLinesInVREF;
int lHalfLinesEven;
uint dwReserved1;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; AMVPDATAINFO サイズ: 80 バイト(x64)
dim st, 20 ; 4byte整数×20(構造体サイズ 80 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwMicrosecondsPerField : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; amvpDimInfo : AMVPDIMINFO (+8, 32byte) varptr(st)+8 を基点に操作(32byte:入れ子/配列)
; dwPictAspectRatioX : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; dwPictAspectRatioY : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; bEnableDoubleClock : BOOL (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; bEnableVACT : BOOL (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; bDataIsInterlaced : BOOL (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; lHalfLinesOdd : INT (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; bFieldPolarityInverted : BOOL (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; dwNumLinesInVREF : DWORD (+68, 4byte) st.17 = 値 / 値 = st.17 (lpoke/lpeek も可)
; lHalfLinesEven : INT (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; dwReserved1 : DWORD (+76, 4byte) st.19 = 値 / 値 = st.19 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global RECT
#field int left
#field int top
#field int right
#field int bottom
#endstruct
#defstruct global AMVPDIMINFO
#field int dwFieldWidth
#field int dwFieldHeight
#field int dwVBIWidth
#field int dwVBIHeight
#field RECT rcValidRegion
#endstruct
#defstruct global AMVPDATAINFO
#field int dwSize
#field int dwMicrosecondsPerField
#field AMVPDIMINFO amvpDimInfo
#field int dwPictAspectRatioX
#field int dwPictAspectRatioY
#field bool bEnableDoubleClock
#field bool bEnableVACT
#field bool bDataIsInterlaced
#field int lHalfLinesOdd
#field bool bFieldPolarityInverted
#field int dwNumLinesInVREF
#field int lHalfLinesEven
#field int dwReserved1
#endstruct
stdim st, AMVPDATAINFO ; NSTRUCT 変数を確保
st->dwSize = 100
mes "dwSize=" + st->dwSize