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

KS_AMVPDATAINFO

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

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

フィールド

フィールドサイズx64x86説明
dwSizeDWORD4+0+0この構造体のサイズをバイト単位で示す。
dwMicrosecondsPerFieldDWORD4+4+41フィールドあたりの時間をマイクロ秒で示す。
amvpDimInfoKS_AMVPDIMINFO32+8+8映像の寸法情報を保持するKS_AMVPDIMINFO。
dwPictAspectRatioXDWORD4+40+40画面アスペクト比の水平成分を示す。
dwPictAspectRatioYDWORD4+44+44画面アスペクト比の垂直成分を示す。
bEnableDoubleClockBOOL4+48+48ダブルクロックを有効にするかを示すBOOL値。
bEnableVACTBOOL4+52+52VACT(垂直アクティブ)信号を有効にするかを示すBOOL値。
bDataIsInterlacedBOOL4+56+56データがインターレースかを示すBOOL値。
lHalfLinesOddINT4+60+60奇数フィールドのハーフライン数を示す。
bFieldPolarityInvertedBOOL4+64+64フィールド極性が反転しているかを示すBOOL値。
dwNumLinesInVREFDWORD4+68+68VREF区間に含まれるライン数を示す。
lHalfLinesEvenINT4+72+72偶数フィールドのハーフライン数を示す。
dwReserved1DWORD4+76+76予約フィールド。将来の拡張用で通常は0を設定する。

各言語での定義

#include <windows.h>

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

// KS_AMVPDIMINFO  (x64 32 / x86 32 バイト)
typedef struct KS_AMVPDIMINFO {
    DWORD dwFieldWidth;
    DWORD dwFieldHeight;
    DWORD dwVBIWidth;
    DWORD dwVBIHeight;
    RECT rcValidRegion;
} KS_AMVPDIMINFO;

// KS_AMVPDATAINFO  (x64 80 / x86 80 バイト)
typedef struct KS_AMVPDATAINFO {
    DWORD dwSize;
    DWORD dwMicrosecondsPerField;
    KS_AMVPDIMINFO amvpDimInfo;
    DWORD dwPictAspectRatioX;
    DWORD dwPictAspectRatioY;
    BOOL bEnableDoubleClock;
    BOOL bEnableVACT;
    BOOL bDataIsInterlaced;
    INT lHalfLinesOdd;
    BOOL bFieldPolarityInverted;
    DWORD dwNumLinesInVREF;
    INT lHalfLinesEven;
    DWORD dwReserved1;
} KS_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 KS_AMVPDIMINFO
{
    public uint dwFieldWidth;
    public uint dwFieldHeight;
    public uint dwVBIWidth;
    public uint dwVBIHeight;
    public RECT rcValidRegion;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KS_AMVPDATAINFO
{
    public uint dwSize;
    public uint dwMicrosecondsPerField;
    public KS_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 KS_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 KS_AMVPDATAINFO
    Public dwSize As UInteger
    Public dwMicrosecondsPerField As UInteger
    Public amvpDimInfo As KS_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 Structure
import 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 KS_AMVPDIMINFO(ctypes.Structure):
    _fields_ = [
        ("dwFieldWidth", wintypes.DWORD),
        ("dwFieldHeight", wintypes.DWORD),
        ("dwVBIWidth", wintypes.DWORD),
        ("dwVBIHeight", wintypes.DWORD),
        ("rcValidRegion", RECT),
    ]

class KS_AMVPDATAINFO(ctypes.Structure):
    _fields_ = [
        ("dwSize", wintypes.DWORD),
        ("dwMicrosecondsPerField", wintypes.DWORD),
        ("amvpDimInfo", KS_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 KS_AMVPDIMINFO {
    pub dwFieldWidth: u32,
    pub dwFieldHeight: u32,
    pub dwVBIWidth: u32,
    pub dwVBIHeight: u32,
    pub rcValidRegion: RECT,
}

#[repr(C)]
pub struct KS_AMVPDATAINFO {
    pub dwSize: u32,
    pub dwMicrosecondsPerField: u32,
    pub amvpDimInfo: KS_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 KS_AMVPDIMINFO struct {
	dwFieldWidth uint32
	dwFieldHeight uint32
	dwVBIWidth uint32
	dwVBIHeight uint32
	rcValidRegion RECT
}

type KS_AMVPDATAINFO struct {
	dwSize uint32
	dwMicrosecondsPerField uint32
	amvpDimInfo KS_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;

  KS_AMVPDIMINFO = record
    dwFieldWidth: DWORD;
    dwFieldHeight: DWORD;
    dwVBIWidth: DWORD;
    dwVBIHeight: DWORD;
    rcValidRegion: RECT;
  end;

  KS_AMVPDATAINFO = record
    dwSize: DWORD;
    dwMicrosecondsPerField: DWORD;
    amvpDimInfo: KS_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 KS_AMVPDIMINFO = extern struct {
    dwFieldWidth: u32,
    dwFieldHeight: u32,
    dwVBIWidth: u32,
    dwVBIHeight: u32,
    rcValidRegion: RECT,
};

const KS_AMVPDATAINFO = extern struct {
    dwSize: u32,
    dwMicrosecondsPerField: u32,
    amvpDimInfo: KS_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

  KS_AMVPDIMINFO {.bycopy.} = object
    dwFieldWidth: uint32
    dwFieldHeight: uint32
    dwVBIWidth: uint32
    dwVBIHeight: uint32
    rcValidRegion: RECT

  KS_AMVPDATAINFO {.bycopy.} = object
    dwSize: uint32
    dwMicrosecondsPerField: uint32
    amvpDimInfo: KS_AMVPDIMINFO
    dwPictAspectRatioX: uint32
    dwPictAspectRatioY: uint32
    bEnableDoubleClock: int32
    bEnableVACT: int32
    bDataIsInterlaced: int32
    lHalfLinesOdd: int32
    bFieldPolarityInverted: int32
    dwNumLinesInVREF: uint32
    lHalfLinesEven: int32
    dwReserved1: uint32
struct RECT
{
    int left;
    int top;
    int right;
    int bottom;
}

struct KS_AMVPDIMINFO
{
    uint dwFieldWidth;
    uint dwFieldHeight;
    uint dwVBIWidth;
    uint dwVBIHeight;
    RECT rcValidRegion;
}

struct KS_AMVPDATAINFO
{
    uint dwSize;
    uint dwMicrosecondsPerField;
    KS_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 レイアウト)
; KS_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 : KS_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 KS_AMVPDIMINFO
    #field int dwFieldWidth
    #field int dwFieldHeight
    #field int dwVBIWidth
    #field int dwVBIHeight
    #field RECT rcValidRegion
#endstruct

#defstruct global KS_AMVPDATAINFO
    #field int dwSize
    #field int dwMicrosecondsPerField
    #field KS_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, KS_AMVPDATAINFO        ; NSTRUCT 変数を確保
st->dwSize = 100
mes "dwSize=" + st->dwSize