ホーム › Media.DirectShow › AVIFIELDINDEX
AVIFIELDINDEX
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| fcc | DWORD | 4 | +0 | +0 | チャンクを識別するFourCCコード。 |
| cb | DWORD | 4 | +4 | +4 | インデックスデータのバイト数。 |
| wLongsPerEntry | WORD | 2 | +8 | +8 | 1エントリあたりのDWORD(4バイト)数。 |
| bIndexSubType | BYTE | 1 | +10 | +10 | インデックスのサブタイプを示す値。 |
| bIndexType | BYTE | 1 | +11 | +11 | インデックスの種類を示す値(フィールドインデックス)。 |
| nEntriesInUse | DWORD | 4 | +12 | +12 | 使用中のエントリ数。 |
| dwChunkId | DWORD | 4 | +16 | +16 | このインデックスが指すチャンクのID(FourCC)。 |
| qwBaseOffset | ULONGLONG | 8 | +20 | +20 | エントリオフセットの基準となる絶対ファイルオフセット。 |
| dwReserved3 | DWORD | 4 | +28 | +28 | 予約フィールド。将来の拡張用で通常は0。 |
| aIndex | _avifieldindex_entry | 12 | +32 | +32 | フィールドインデックスエントリの可変長配列。先頭要素を起点とする。 |
構造体: _avifieldindex_entry x64 12B / x86 12B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| dwOffset | DWORD | 4 | +0 | +0 |
| dwSize | DWORD | 4 | +4 | +4 |
| dwOffsetField2 | DWORD | 4 | +8 | +8 |
各言語での定義
#include <windows.h>
// AVIFIELDINDEX (x64 44 / x86 44 バイト)
#pragma pack(push, 2)
typedef struct AVIFIELDINDEX {
DWORD fcc;
DWORD cb;
WORD wLongsPerEntry;
BYTE bIndexSubType;
BYTE bIndexType;
DWORD nEntriesInUse;
DWORD dwChunkId;
ULONGLONG qwBaseOffset;
DWORD dwReserved3;
_avifieldindex_entry aIndex[1];
} AVIFIELDINDEX;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 2, CharSet = CharSet.Unicode)]
public struct AVIFIELDINDEX
{
public uint fcc;
public uint cb;
public ushort wLongsPerEntry;
public byte bIndexSubType;
public byte bIndexType;
public uint nEntriesInUse;
public uint dwChunkId;
public ulong qwBaseOffset;
public uint dwReserved3;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public _avifieldindex_entry[] aIndex;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=2, CharSet:=CharSet.Unicode)>
Public Structure AVIFIELDINDEX
Public fcc As UInteger
Public cb As UInteger
Public wLongsPerEntry As UShort
Public bIndexSubType As Byte
Public bIndexType As Byte
Public nEntriesInUse As UInteger
Public dwChunkId As UInteger
Public qwBaseOffset As ULong
Public dwReserved3 As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public aIndex() As _avifieldindex_entry
End Structureimport ctypes
from ctypes import wintypes
class AVIFIELDINDEX(ctypes.Structure):
_pack_ = 2
_fields_ = [
("fcc", wintypes.DWORD),
("cb", wintypes.DWORD),
("wLongsPerEntry", ctypes.c_ushort),
("bIndexSubType", ctypes.c_ubyte),
("bIndexType", ctypes.c_ubyte),
("nEntriesInUse", wintypes.DWORD),
("dwChunkId", wintypes.DWORD),
("qwBaseOffset", ctypes.c_ulonglong),
("dwReserved3", wintypes.DWORD),
("aIndex", _avifieldindex_entry * 1),
]#[repr(C, packed(2))]
pub struct AVIFIELDINDEX {
pub fcc: u32,
pub cb: u32,
pub wLongsPerEntry: u16,
pub bIndexSubType: u8,
pub bIndexType: u8,
pub nEntriesInUse: u32,
pub dwChunkId: u32,
pub qwBaseOffset: u64,
pub dwReserved3: u32,
pub aIndex: [_avifieldindex_entry; 1],
}import "golang.org/x/sys/windows"
type AVIFIELDINDEX struct {
fcc uint32
cb uint32
wLongsPerEntry uint16
bIndexSubType byte
bIndexType byte
nEntriesInUse uint32
dwChunkId uint32
qwBaseOffset uint64
dwReserved3 uint32
aIndex [1]_avifieldindex_entry
}type
AVIFIELDINDEX = packed record
fcc: DWORD;
cb: DWORD;
wLongsPerEntry: Word;
bIndexSubType: Byte;
bIndexType: Byte;
nEntriesInUse: DWORD;
dwChunkId: DWORD;
qwBaseOffset: UInt64;
dwReserved3: DWORD;
aIndex: array[0..0] of _avifieldindex_entry;
end;const AVIFIELDINDEX = extern struct {
fcc: u32,
cb: u32,
wLongsPerEntry: u16,
bIndexSubType: u8,
bIndexType: u8,
nEntriesInUse: u32,
dwChunkId: u32,
qwBaseOffset: u64,
dwReserved3: u32,
aIndex: [1]_avifieldindex_entry,
};type
AVIFIELDINDEX {.packed.} = object
fcc: uint32
cb: uint32
wLongsPerEntry: uint16
bIndexSubType: uint8
bIndexType: uint8
nEntriesInUse: uint32
dwChunkId: uint32
qwBaseOffset: uint64
dwReserved3: uint32
aIndex: array[1, _avifieldindex_entry]align(2)
struct AVIFIELDINDEX
{
uint fcc;
uint cb;
ushort wLongsPerEntry;
ubyte bIndexSubType;
ubyte bIndexType;
uint nEntriesInUse;
uint dwChunkId;
ulong qwBaseOffset;
uint dwReserved3;
_avifieldindex_entry[1] aIndex;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; AVIFIELDINDEX サイズ: 44 バイト(x64)
dim st, 11 ; 4byte整数×11(構造体サイズ 44 / 4 切り上げ)
; fcc : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; cb : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; wLongsPerEntry : WORD (+8, 2byte) wpoke st,8,値 / 値 = wpeek(st,8)
; bIndexSubType : BYTE (+10, 1byte) poke st,10,値 / 値 = peek(st,10)
; bIndexType : BYTE (+11, 1byte) poke st,11,値 / 値 = peek(st,11)
; nEntriesInUse : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dwChunkId : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; qwBaseOffset : ULONGLONG (+20, 8byte) qpoke st,20,値 / qpeek(st,20) ※IronHSPのみ。3.7/3.8は lpoke st,20,下位 : lpoke st,24,上位
; dwReserved3 : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; aIndex : _avifieldindex_entry (+32, 12byte) varptr(st)+32 を基点に操作(12byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global AVIFIELDINDEX, pack=2
#field int fcc
#field int cb
#field short wLongsPerEntry
#field byte bIndexSubType
#field byte bIndexType
#field int nEntriesInUse
#field int dwChunkId
#field int64 qwBaseOffset
#field int dwReserved3
#field _avifieldindex_entry aIndex 1
#endstruct
stdim st, AVIFIELDINDEX ; NSTRUCT 変数を確保
st->fcc = 100
mes "fcc=" + st->fcc