ホーム › Media.Multimedia › AVIFILEINFOW
AVIFILEINFOW
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwMaxBytesPerSec | DWORD | 4 | +0 | +0 | ファイル全体の最大データレート。1秒あたりのバイト数を示す。 |
| dwFlags | DWORD | 4 | +4 | +4 | ファイルの属性を示すフラグ。AVIFILEINFO_HASINDEX等を示す。 |
| dwCaps | DWORD | 4 | +8 | +8 | ファイルの機能を示す能力フラグ。AVIFILECAPS_*を示す。 |
| dwStreams | DWORD | 4 | +12 | +12 | ファイルに含まれるストリーム数。 |
| dwSuggestedBufferSize | DWORD | 4 | +16 | +16 | 推奨される読み取りバッファサイズ。バイト単位で示す。 |
| dwWidth | DWORD | 4 | +20 | +20 | ビデオフレームの幅。ピクセル単位で示す。 |
| dwHeight | DWORD | 4 | +24 | +24 | ビデオフレームの高さ。ピクセル単位で示す。 |
| dwScale | DWORD | 4 | +28 | +28 | 時間単位の分母。dwRateとの比でフレームレートを示す。 |
| dwRate | DWORD | 4 | +32 | +32 | 時間単位の分子。dwScaleとの比でフレームレートを示す。 |
| dwLength | DWORD | 4 | +36 | +36 | ファイルの長さ。時間単位の数で示す。 |
| dwEditCount | DWORD | 4 | +40 | +40 | 編集操作が行われた回数。 |
| szFileType | WCHAR | 128 | +44 | +44 | ファイルタイプの説明文字列のUnicode表現。 |
各言語での定義
#include <windows.h>
// AVIFILEINFOW (x64 172 / x86 172 バイト)
typedef struct AVIFILEINFOW {
DWORD dwMaxBytesPerSec;
DWORD dwFlags;
DWORD dwCaps;
DWORD dwStreams;
DWORD dwSuggestedBufferSize;
DWORD dwWidth;
DWORD dwHeight;
DWORD dwScale;
DWORD dwRate;
DWORD dwLength;
DWORD dwEditCount;
WCHAR szFileType[64];
} AVIFILEINFOW;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct AVIFILEINFOW
{
public uint dwMaxBytesPerSec;
public uint dwFlags;
public uint dwCaps;
public uint dwStreams;
public uint dwSuggestedBufferSize;
public uint dwWidth;
public uint dwHeight;
public uint dwScale;
public uint dwRate;
public uint dwLength;
public uint dwEditCount;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] public string szFileType;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure AVIFILEINFOW
Public dwMaxBytesPerSec As UInteger
Public dwFlags As UInteger
Public dwCaps As UInteger
Public dwStreams As UInteger
Public dwSuggestedBufferSize As UInteger
Public dwWidth As UInteger
Public dwHeight As UInteger
Public dwScale As UInteger
Public dwRate As UInteger
Public dwLength As UInteger
Public dwEditCount As UInteger
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=64)> Public szFileType As String
End Structureimport ctypes
from ctypes import wintypes
class AVIFILEINFOW(ctypes.Structure):
_fields_ = [
("dwMaxBytesPerSec", wintypes.DWORD),
("dwFlags", wintypes.DWORD),
("dwCaps", wintypes.DWORD),
("dwStreams", wintypes.DWORD),
("dwSuggestedBufferSize", wintypes.DWORD),
("dwWidth", wintypes.DWORD),
("dwHeight", wintypes.DWORD),
("dwScale", wintypes.DWORD),
("dwRate", wintypes.DWORD),
("dwLength", wintypes.DWORD),
("dwEditCount", wintypes.DWORD),
("szFileType", ctypes.c_wchar * 64),
]#[repr(C)]
pub struct AVIFILEINFOW {
pub dwMaxBytesPerSec: u32,
pub dwFlags: u32,
pub dwCaps: u32,
pub dwStreams: u32,
pub dwSuggestedBufferSize: u32,
pub dwWidth: u32,
pub dwHeight: u32,
pub dwScale: u32,
pub dwRate: u32,
pub dwLength: u32,
pub dwEditCount: u32,
pub szFileType: [u16; 64],
}import "golang.org/x/sys/windows"
type AVIFILEINFOW struct {
dwMaxBytesPerSec uint32
dwFlags uint32
dwCaps uint32
dwStreams uint32
dwSuggestedBufferSize uint32
dwWidth uint32
dwHeight uint32
dwScale uint32
dwRate uint32
dwLength uint32
dwEditCount uint32
szFileType [64]uint16
}type
AVIFILEINFOW = record
dwMaxBytesPerSec: DWORD;
dwFlags: DWORD;
dwCaps: DWORD;
dwStreams: DWORD;
dwSuggestedBufferSize: DWORD;
dwWidth: DWORD;
dwHeight: DWORD;
dwScale: DWORD;
dwRate: DWORD;
dwLength: DWORD;
dwEditCount: DWORD;
szFileType: array[0..63] of WideChar;
end;const AVIFILEINFOW = extern struct {
dwMaxBytesPerSec: u32,
dwFlags: u32,
dwCaps: u32,
dwStreams: u32,
dwSuggestedBufferSize: u32,
dwWidth: u32,
dwHeight: u32,
dwScale: u32,
dwRate: u32,
dwLength: u32,
dwEditCount: u32,
szFileType: [64]u16,
};type
AVIFILEINFOW {.bycopy.} = object
dwMaxBytesPerSec: uint32
dwFlags: uint32
dwCaps: uint32
dwStreams: uint32
dwSuggestedBufferSize: uint32
dwWidth: uint32
dwHeight: uint32
dwScale: uint32
dwRate: uint32
dwLength: uint32
dwEditCount: uint32
szFileType: array[64, uint16]struct AVIFILEINFOW
{
uint dwMaxBytesPerSec;
uint dwFlags;
uint dwCaps;
uint dwStreams;
uint dwSuggestedBufferSize;
uint dwWidth;
uint dwHeight;
uint dwScale;
uint dwRate;
uint dwLength;
uint dwEditCount;
wchar[64] szFileType;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; AVIFILEINFOW サイズ: 172 バイト(x64)
dim st, 43 ; 4byte整数×43(構造体サイズ 172 / 4 切り上げ)
; dwMaxBytesPerSec : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwCaps : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dwStreams : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dwSuggestedBufferSize : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; dwWidth : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; dwHeight : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; dwScale : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; dwRate : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; dwLength : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; dwEditCount : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; szFileType : WCHAR (+44, 128byte) varptr(st)+44 を基点に操作(128byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global AVIFILEINFOW
#field int dwMaxBytesPerSec
#field int dwFlags
#field int dwCaps
#field int dwStreams
#field int dwSuggestedBufferSize
#field int dwWidth
#field int dwHeight
#field int dwScale
#field int dwRate
#field int dwLength
#field int dwEditCount
#field wchar szFileType 64
#endstruct
stdim st, AVIFILEINFOW ; NSTRUCT 変数を確保
st->dwMaxBytesPerSec = 100
mes "dwMaxBytesPerSec=" + st->dwMaxBytesPerSec