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

AVISTREAMINFOW

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

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

フィールド

フィールドサイズx64x86説明
fccTypeDWORD4+0+0ストリームの種類を示すFOURCC。'vids'や'auds'などを示す。
fccHandlerDWORD4+4+4このストリームを処理するコーデックハンドラのFOURCC。
dwFlagsDWORD4+8+8ストリームの属性を示すフラグ。AVISF_DISABLED等を示す。
dwCapsDWORD4+12+12ストリームの機能を示す能力フラグ。
wPriorityWORD2+16+16ストリームの優先度。
wLanguageWORD2+18+18ストリームの言語ID。
dwScaleDWORD4+20+20時間単位の分母。dwRateとの比でサンプルレートを示す。
dwRateDWORD4+24+24時間単位の分子。dwScaleとの比でサンプルレートを示す。
dwStartDWORD4+28+28ストリームの開始位置。最初のサンプルの時刻を示す。
dwLengthDWORD4+32+32ストリームの長さ。サンプル数で示す。
dwInitialFramesDWORD4+36+36オーディオ先読みフレーム数。音声の先行スキューを示す。
dwSuggestedBufferSizeDWORD4+40+40推奨される読み取りバッファサイズ。バイト単位で示す。
dwQualityDWORD4+44+44ストリームの品質。0〜10000、-1で既定値。
dwSampleSizeDWORD4+48+48サンプル1個のサイズ。可変長の場合は0。
rcFrameRECT16+52+52ビデオフレームの表示位置を示すRECT。
dwEditCountDWORD4+68+68編集操作が行われた回数。
dwFormatChangeCountDWORD4+72+72フォーマットが変更された回数。
szNameWCHAR128+76+76ストリーム名のUnicode文字列。

各言語での定義

#include <windows.h>

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

// AVISTREAMINFOW  (x64 204 / x86 204 バイト)
typedef struct AVISTREAMINFOW {
    DWORD fccType;
    DWORD fccHandler;
    DWORD dwFlags;
    DWORD dwCaps;
    WORD wPriority;
    WORD wLanguage;
    DWORD dwScale;
    DWORD dwRate;
    DWORD dwStart;
    DWORD dwLength;
    DWORD dwInitialFrames;
    DWORD dwSuggestedBufferSize;
    DWORD dwQuality;
    DWORD dwSampleSize;
    RECT rcFrame;
    DWORD dwEditCount;
    DWORD dwFormatChangeCount;
    WCHAR szName[64];
} AVISTREAMINFOW;
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 AVISTREAMINFOW
{
    public uint fccType;
    public uint fccHandler;
    public uint dwFlags;
    public uint dwCaps;
    public ushort wPriority;
    public ushort wLanguage;
    public uint dwScale;
    public uint dwRate;
    public uint dwStart;
    public uint dwLength;
    public uint dwInitialFrames;
    public uint dwSuggestedBufferSize;
    public uint dwQuality;
    public uint dwSampleSize;
    public RECT rcFrame;
    public uint dwEditCount;
    public uint dwFormatChangeCount;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] public string szName;
}
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 AVISTREAMINFOW
    Public fccType As UInteger
    Public fccHandler As UInteger
    Public dwFlags As UInteger
    Public dwCaps As UInteger
    Public wPriority As UShort
    Public wLanguage As UShort
    Public dwScale As UInteger
    Public dwRate As UInteger
    Public dwStart As UInteger
    Public dwLength As UInteger
    Public dwInitialFrames As UInteger
    Public dwSuggestedBufferSize As UInteger
    Public dwQuality As UInteger
    Public dwSampleSize As UInteger
    Public rcFrame As RECT
    Public dwEditCount As UInteger
    Public dwFormatChangeCount As UInteger
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=64)> Public szName As String
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 AVISTREAMINFOW(ctypes.Structure):
    _fields_ = [
        ("fccType", wintypes.DWORD),
        ("fccHandler", wintypes.DWORD),
        ("dwFlags", wintypes.DWORD),
        ("dwCaps", wintypes.DWORD),
        ("wPriority", ctypes.c_ushort),
        ("wLanguage", ctypes.c_ushort),
        ("dwScale", wintypes.DWORD),
        ("dwRate", wintypes.DWORD),
        ("dwStart", wintypes.DWORD),
        ("dwLength", wintypes.DWORD),
        ("dwInitialFrames", wintypes.DWORD),
        ("dwSuggestedBufferSize", wintypes.DWORD),
        ("dwQuality", wintypes.DWORD),
        ("dwSampleSize", wintypes.DWORD),
        ("rcFrame", RECT),
        ("dwEditCount", wintypes.DWORD),
        ("dwFormatChangeCount", wintypes.DWORD),
        ("szName", ctypes.c_wchar * 64),
    ]
#[repr(C)]
pub struct RECT {
    pub left: i32,
    pub top: i32,
    pub right: i32,
    pub bottom: i32,
}

#[repr(C)]
pub struct AVISTREAMINFOW {
    pub fccType: u32,
    pub fccHandler: u32,
    pub dwFlags: u32,
    pub dwCaps: u32,
    pub wPriority: u16,
    pub wLanguage: u16,
    pub dwScale: u32,
    pub dwRate: u32,
    pub dwStart: u32,
    pub dwLength: u32,
    pub dwInitialFrames: u32,
    pub dwSuggestedBufferSize: u32,
    pub dwQuality: u32,
    pub dwSampleSize: u32,
    pub rcFrame: RECT,
    pub dwEditCount: u32,
    pub dwFormatChangeCount: u32,
    pub szName: [u16; 64],
}
import "golang.org/x/sys/windows"

type RECT struct {
	left int32
	top int32
	right int32
	bottom int32
}

type AVISTREAMINFOW struct {
	fccType uint32
	fccHandler uint32
	dwFlags uint32
	dwCaps uint32
	wPriority uint16
	wLanguage uint16
	dwScale uint32
	dwRate uint32
	dwStart uint32
	dwLength uint32
	dwInitialFrames uint32
	dwSuggestedBufferSize uint32
	dwQuality uint32
	dwSampleSize uint32
	rcFrame RECT
	dwEditCount uint32
	dwFormatChangeCount uint32
	szName [64]uint16
}
type
  RECT = record
    left: Integer;
    top: Integer;
    right: Integer;
    bottom: Integer;
  end;

  AVISTREAMINFOW = record
    fccType: DWORD;
    fccHandler: DWORD;
    dwFlags: DWORD;
    dwCaps: DWORD;
    wPriority: Word;
    wLanguage: Word;
    dwScale: DWORD;
    dwRate: DWORD;
    dwStart: DWORD;
    dwLength: DWORD;
    dwInitialFrames: DWORD;
    dwSuggestedBufferSize: DWORD;
    dwQuality: DWORD;
    dwSampleSize: DWORD;
    rcFrame: RECT;
    dwEditCount: DWORD;
    dwFormatChangeCount: DWORD;
    szName: array[0..63] of WideChar;
  end;
const RECT = extern struct {
    left: i32,
    top: i32,
    right: i32,
    bottom: i32,
};

const AVISTREAMINFOW = extern struct {
    fccType: u32,
    fccHandler: u32,
    dwFlags: u32,
    dwCaps: u32,
    wPriority: u16,
    wLanguage: u16,
    dwScale: u32,
    dwRate: u32,
    dwStart: u32,
    dwLength: u32,
    dwInitialFrames: u32,
    dwSuggestedBufferSize: u32,
    dwQuality: u32,
    dwSampleSize: u32,
    rcFrame: RECT,
    dwEditCount: u32,
    dwFormatChangeCount: u32,
    szName: [64]u16,
};
type
  RECT {.bycopy.} = object
    left: int32
    top: int32
    right: int32
    bottom: int32

  AVISTREAMINFOW {.bycopy.} = object
    fccType: uint32
    fccHandler: uint32
    dwFlags: uint32
    dwCaps: uint32
    wPriority: uint16
    wLanguage: uint16
    dwScale: uint32
    dwRate: uint32
    dwStart: uint32
    dwLength: uint32
    dwInitialFrames: uint32
    dwSuggestedBufferSize: uint32
    dwQuality: uint32
    dwSampleSize: uint32
    rcFrame: RECT
    dwEditCount: uint32
    dwFormatChangeCount: uint32
    szName: array[64, uint16]
struct RECT
{
    int left;
    int top;
    int right;
    int bottom;
}

struct AVISTREAMINFOW
{
    uint fccType;
    uint fccHandler;
    uint dwFlags;
    uint dwCaps;
    ushort wPriority;
    ushort wLanguage;
    uint dwScale;
    uint dwRate;
    uint dwStart;
    uint dwLength;
    uint dwInitialFrames;
    uint dwSuggestedBufferSize;
    uint dwQuality;
    uint dwSampleSize;
    RECT rcFrame;
    uint dwEditCount;
    uint dwFormatChangeCount;
    wchar[64] szName;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; AVISTREAMINFOW サイズ: 204 バイト(x64)
dim st, 51    ; 4byte整数×51(構造体サイズ 204 / 4 切り上げ)
; fccType : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; fccHandler : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwFlags : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwCaps : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; wPriority : WORD (+16, 2byte)  wpoke st,16,値  /  値 = wpeek(st,16)
; wLanguage : WORD (+18, 2byte)  wpoke st,18,値  /  値 = wpeek(st,18)
; dwScale : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; dwRate : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; dwStart : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; dwLength : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; dwInitialFrames : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; dwSuggestedBufferSize : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; dwQuality : DWORD (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; dwSampleSize : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; rcFrame : RECT (+52, 16byte)  varptr(st)+52 を基点に操作(16byte:入れ子/配列)
; dwEditCount : DWORD (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; dwFormatChangeCount : DWORD (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; szName : WCHAR (+76, 128byte)  varptr(st)+76 を基点に操作(128byte:入れ子/配列)
; ※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 AVISTREAMINFOW
    #field int fccType
    #field int fccHandler
    #field int dwFlags
    #field int dwCaps
    #field short wPriority
    #field short wLanguage
    #field int dwScale
    #field int dwRate
    #field int dwStart
    #field int dwLength
    #field int dwInitialFrames
    #field int dwSuggestedBufferSize
    #field int dwQuality
    #field int dwSampleSize
    #field RECT rcFrame
    #field int dwEditCount
    #field int dwFormatChangeCount
    #field wchar szName 64
#endstruct

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