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

KS_VBI_FRAME_INFO

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

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

フィールド

フィールドサイズx64x86説明
ExtendedHeaderSizeDWORD4+0+0拡張ヘッダ全体のサイズをバイト単位で示す。
dwFrameFlagsDWORD4+4+4VBIフレームの状態を示すフラグの組み合わせ。
PictureNumberLONGLONG8+8+8連続するピクチャ番号を示す64ビット値。
DropCountLONGLONG8+16+16ドロップされたフレームの累積数を示す。
dwSamplingFrequencyDWORD4+24+24VBIデータのサンプリング周波数をHz単位で示す。
TvTunerChangeInfoKS_TVTUNER_CHANGE_INFO16+28+28TVチューナの変更情報を保持するKS_TVTUNER_CHANGE_INFO。
VBIInfoHeaderKS_VBIINFOHEADER44+44+44VBIデータの形式を記述するKS_VBIINFOHEADER。

各言語での定義

#include <windows.h>

// KS_TVTUNER_CHANGE_INFO  (x64 16 / x86 16 バイト)
typedef struct KS_TVTUNER_CHANGE_INFO {
    DWORD dwFlags;
    DWORD dwCountryCode;
    DWORD dwAnalogVideoStandard;
    DWORD dwChannel;
} KS_TVTUNER_CHANGE_INFO;

// KS_VBIINFOHEADER  (x64 44 / x86 44 バイト)
typedef struct KS_VBIINFOHEADER {
    DWORD StartLine;
    DWORD EndLine;
    DWORD SamplingFrequency;
    DWORD MinLineStartTime;
    DWORD MaxLineStartTime;
    DWORD ActualLineStartTime;
    DWORD ActualLineEndTime;
    DWORD VideoStandard;
    DWORD SamplesPerLine;
    DWORD StrideInBytes;
    DWORD BufferSize;
} KS_VBIINFOHEADER;

// KS_VBI_FRAME_INFO  (x64 88 / x86 88 バイト)
typedef struct KS_VBI_FRAME_INFO {
    DWORD ExtendedHeaderSize;
    DWORD dwFrameFlags;
    LONGLONG PictureNumber;
    LONGLONG DropCount;
    DWORD dwSamplingFrequency;
    KS_TVTUNER_CHANGE_INFO TvTunerChangeInfo;
    KS_VBIINFOHEADER VBIInfoHeader;
} KS_VBI_FRAME_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KS_TVTUNER_CHANGE_INFO
{
    public uint dwFlags;
    public uint dwCountryCode;
    public uint dwAnalogVideoStandard;
    public uint dwChannel;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KS_VBIINFOHEADER
{
    public uint StartLine;
    public uint EndLine;
    public uint SamplingFrequency;
    public uint MinLineStartTime;
    public uint MaxLineStartTime;
    public uint ActualLineStartTime;
    public uint ActualLineEndTime;
    public uint VideoStandard;
    public uint SamplesPerLine;
    public uint StrideInBytes;
    public uint BufferSize;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KS_VBI_FRAME_INFO
{
    public uint ExtendedHeaderSize;
    public uint dwFrameFlags;
    public long PictureNumber;
    public long DropCount;
    public uint dwSamplingFrequency;
    public KS_TVTUNER_CHANGE_INFO TvTunerChangeInfo;
    public KS_VBIINFOHEADER VBIInfoHeader;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure KS_TVTUNER_CHANGE_INFO
    Public dwFlags As UInteger
    Public dwCountryCode As UInteger
    Public dwAnalogVideoStandard As UInteger
    Public dwChannel As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure KS_VBIINFOHEADER
    Public StartLine As UInteger
    Public EndLine As UInteger
    Public SamplingFrequency As UInteger
    Public MinLineStartTime As UInteger
    Public MaxLineStartTime As UInteger
    Public ActualLineStartTime As UInteger
    Public ActualLineEndTime As UInteger
    Public VideoStandard As UInteger
    Public SamplesPerLine As UInteger
    Public StrideInBytes As UInteger
    Public BufferSize As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure KS_VBI_FRAME_INFO
    Public ExtendedHeaderSize As UInteger
    Public dwFrameFlags As UInteger
    Public PictureNumber As Long
    Public DropCount As Long
    Public dwSamplingFrequency As UInteger
    Public TvTunerChangeInfo As KS_TVTUNER_CHANGE_INFO
    Public VBIInfoHeader As KS_VBIINFOHEADER
End Structure
import ctypes
from ctypes import wintypes

class KS_TVTUNER_CHANGE_INFO(ctypes.Structure):
    _fields_ = [
        ("dwFlags", wintypes.DWORD),
        ("dwCountryCode", wintypes.DWORD),
        ("dwAnalogVideoStandard", wintypes.DWORD),
        ("dwChannel", wintypes.DWORD),
    ]

class KS_VBIINFOHEADER(ctypes.Structure):
    _fields_ = [
        ("StartLine", wintypes.DWORD),
        ("EndLine", wintypes.DWORD),
        ("SamplingFrequency", wintypes.DWORD),
        ("MinLineStartTime", wintypes.DWORD),
        ("MaxLineStartTime", wintypes.DWORD),
        ("ActualLineStartTime", wintypes.DWORD),
        ("ActualLineEndTime", wintypes.DWORD),
        ("VideoStandard", wintypes.DWORD),
        ("SamplesPerLine", wintypes.DWORD),
        ("StrideInBytes", wintypes.DWORD),
        ("BufferSize", wintypes.DWORD),
    ]

class KS_VBI_FRAME_INFO(ctypes.Structure):
    _fields_ = [
        ("ExtendedHeaderSize", wintypes.DWORD),
        ("dwFrameFlags", wintypes.DWORD),
        ("PictureNumber", ctypes.c_longlong),
        ("DropCount", ctypes.c_longlong),
        ("dwSamplingFrequency", wintypes.DWORD),
        ("TvTunerChangeInfo", KS_TVTUNER_CHANGE_INFO),
        ("VBIInfoHeader", KS_VBIINFOHEADER),
    ]
#[repr(C)]
pub struct KS_TVTUNER_CHANGE_INFO {
    pub dwFlags: u32,
    pub dwCountryCode: u32,
    pub dwAnalogVideoStandard: u32,
    pub dwChannel: u32,
}

#[repr(C)]
pub struct KS_VBIINFOHEADER {
    pub StartLine: u32,
    pub EndLine: u32,
    pub SamplingFrequency: u32,
    pub MinLineStartTime: u32,
    pub MaxLineStartTime: u32,
    pub ActualLineStartTime: u32,
    pub ActualLineEndTime: u32,
    pub VideoStandard: u32,
    pub SamplesPerLine: u32,
    pub StrideInBytes: u32,
    pub BufferSize: u32,
}

#[repr(C)]
pub struct KS_VBI_FRAME_INFO {
    pub ExtendedHeaderSize: u32,
    pub dwFrameFlags: u32,
    pub PictureNumber: i64,
    pub DropCount: i64,
    pub dwSamplingFrequency: u32,
    pub TvTunerChangeInfo: KS_TVTUNER_CHANGE_INFO,
    pub VBIInfoHeader: KS_VBIINFOHEADER,
}
import "golang.org/x/sys/windows"

type KS_TVTUNER_CHANGE_INFO struct {
	dwFlags uint32
	dwCountryCode uint32
	dwAnalogVideoStandard uint32
	dwChannel uint32
}

type KS_VBIINFOHEADER struct {
	StartLine uint32
	EndLine uint32
	SamplingFrequency uint32
	MinLineStartTime uint32
	MaxLineStartTime uint32
	ActualLineStartTime uint32
	ActualLineEndTime uint32
	VideoStandard uint32
	SamplesPerLine uint32
	StrideInBytes uint32
	BufferSize uint32
}

type KS_VBI_FRAME_INFO struct {
	ExtendedHeaderSize uint32
	dwFrameFlags uint32
	PictureNumber int64
	DropCount int64
	dwSamplingFrequency uint32
	TvTunerChangeInfo KS_TVTUNER_CHANGE_INFO
	VBIInfoHeader KS_VBIINFOHEADER
}
type
  KS_TVTUNER_CHANGE_INFO = record
    dwFlags: DWORD;
    dwCountryCode: DWORD;
    dwAnalogVideoStandard: DWORD;
    dwChannel: DWORD;
  end;

  KS_VBIINFOHEADER = record
    StartLine: DWORD;
    EndLine: DWORD;
    SamplingFrequency: DWORD;
    MinLineStartTime: DWORD;
    MaxLineStartTime: DWORD;
    ActualLineStartTime: DWORD;
    ActualLineEndTime: DWORD;
    VideoStandard: DWORD;
    SamplesPerLine: DWORD;
    StrideInBytes: DWORD;
    BufferSize: DWORD;
  end;

  KS_VBI_FRAME_INFO = record
    ExtendedHeaderSize: DWORD;
    dwFrameFlags: DWORD;
    PictureNumber: Int64;
    DropCount: Int64;
    dwSamplingFrequency: DWORD;
    TvTunerChangeInfo: KS_TVTUNER_CHANGE_INFO;
    VBIInfoHeader: KS_VBIINFOHEADER;
  end;
const KS_TVTUNER_CHANGE_INFO = extern struct {
    dwFlags: u32,
    dwCountryCode: u32,
    dwAnalogVideoStandard: u32,
    dwChannel: u32,
};

const KS_VBIINFOHEADER = extern struct {
    StartLine: u32,
    EndLine: u32,
    SamplingFrequency: u32,
    MinLineStartTime: u32,
    MaxLineStartTime: u32,
    ActualLineStartTime: u32,
    ActualLineEndTime: u32,
    VideoStandard: u32,
    SamplesPerLine: u32,
    StrideInBytes: u32,
    BufferSize: u32,
};

const KS_VBI_FRAME_INFO = extern struct {
    ExtendedHeaderSize: u32,
    dwFrameFlags: u32,
    PictureNumber: i64,
    DropCount: i64,
    dwSamplingFrequency: u32,
    TvTunerChangeInfo: KS_TVTUNER_CHANGE_INFO,
    VBIInfoHeader: KS_VBIINFOHEADER,
};
type
  KS_TVTUNER_CHANGE_INFO {.bycopy.} = object
    dwFlags: uint32
    dwCountryCode: uint32
    dwAnalogVideoStandard: uint32
    dwChannel: uint32

  KS_VBIINFOHEADER {.bycopy.} = object
    StartLine: uint32
    EndLine: uint32
    SamplingFrequency: uint32
    MinLineStartTime: uint32
    MaxLineStartTime: uint32
    ActualLineStartTime: uint32
    ActualLineEndTime: uint32
    VideoStandard: uint32
    SamplesPerLine: uint32
    StrideInBytes: uint32
    BufferSize: uint32

  KS_VBI_FRAME_INFO {.bycopy.} = object
    ExtendedHeaderSize: uint32
    dwFrameFlags: uint32
    PictureNumber: int64
    DropCount: int64
    dwSamplingFrequency: uint32
    TvTunerChangeInfo: KS_TVTUNER_CHANGE_INFO
    VBIInfoHeader: KS_VBIINFOHEADER
struct KS_TVTUNER_CHANGE_INFO
{
    uint dwFlags;
    uint dwCountryCode;
    uint dwAnalogVideoStandard;
    uint dwChannel;
}

struct KS_VBIINFOHEADER
{
    uint StartLine;
    uint EndLine;
    uint SamplingFrequency;
    uint MinLineStartTime;
    uint MaxLineStartTime;
    uint ActualLineStartTime;
    uint ActualLineEndTime;
    uint VideoStandard;
    uint SamplesPerLine;
    uint StrideInBytes;
    uint BufferSize;
}

struct KS_VBI_FRAME_INFO
{
    uint ExtendedHeaderSize;
    uint dwFrameFlags;
    long PictureNumber;
    long DropCount;
    uint dwSamplingFrequency;
    KS_TVTUNER_CHANGE_INFO TvTunerChangeInfo;
    KS_VBIINFOHEADER VBIInfoHeader;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; KS_VBI_FRAME_INFO サイズ: 88 バイト(x64)
dim st, 22    ; 4byte整数×22(構造体サイズ 88 / 4 切り上げ)
; ExtendedHeaderSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwFrameFlags : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; PictureNumber : LONGLONG (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; DropCount : LONGLONG (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; dwSamplingFrequency : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; TvTunerChangeInfo : KS_TVTUNER_CHANGE_INFO (+28, 16byte)  varptr(st)+28 を基点に操作(16byte:入れ子/配列)
; VBIInfoHeader : KS_VBIINFOHEADER (+44, 44byte)  varptr(st)+44 を基点に操作(44byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global KS_TVTUNER_CHANGE_INFO
    #field int dwFlags
    #field int dwCountryCode
    #field int dwAnalogVideoStandard
    #field int dwChannel
#endstruct

#defstruct global KS_VBIINFOHEADER
    #field int StartLine
    #field int EndLine
    #field int SamplingFrequency
    #field int MinLineStartTime
    #field int MaxLineStartTime
    #field int ActualLineStartTime
    #field int ActualLineEndTime
    #field int VideoStandard
    #field int SamplesPerLine
    #field int StrideInBytes
    #field int BufferSize
#endstruct

#defstruct global KS_VBI_FRAME_INFO
    #field int ExtendedHeaderSize
    #field int dwFrameFlags
    #field int64 PictureNumber
    #field int64 DropCount
    #field int dwSamplingFrequency
    #field KS_TVTUNER_CHANGE_INFO TvTunerChangeInfo
    #field KS_VBIINFOHEADER VBIInfoHeader
#endstruct

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