ホーム › Media.DirectShow › AVIMETAINDEX
AVIMETAINDEX
構造体サイズ=各フィールドのバイト数(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)。 |
| dwReserved | DWORD | 12 | +20 | +20 | 予約フィールド配列。将来の拡張用で通常は0。 |
| adwIndex | DWORD | 4 | +32 | +32 | 汎用インデックスデータの可変長配列。先頭要素を起点とする。 |
各言語での定義
#include <windows.h>
// AVIMETAINDEX (x64 36 / x86 36 バイト)
#pragma pack(push, 2)
typedef struct AVIMETAINDEX {
DWORD fcc;
DWORD cb;
WORD wLongsPerEntry;
BYTE bIndexSubType;
BYTE bIndexType;
DWORD nEntriesInUse;
DWORD dwChunkId;
DWORD dwReserved[3];
DWORD adwIndex[1];
} AVIMETAINDEX;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 2, CharSet = CharSet.Unicode)]
public struct AVIMETAINDEX
{
public uint fcc;
public uint cb;
public ushort wLongsPerEntry;
public byte bIndexSubType;
public byte bIndexType;
public uint nEntriesInUse;
public uint dwChunkId;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public uint[] dwReserved;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public uint[] adwIndex;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=2, CharSet:=CharSet.Unicode)>
Public Structure AVIMETAINDEX
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
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=3)> Public dwReserved() As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public adwIndex() As UInteger
End Structureimport ctypes
from ctypes import wintypes
class AVIMETAINDEX(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),
("dwReserved", wintypes.DWORD * 3),
("adwIndex", wintypes.DWORD * 1),
]#[repr(C, packed(2))]
pub struct AVIMETAINDEX {
pub fcc: u32,
pub cb: u32,
pub wLongsPerEntry: u16,
pub bIndexSubType: u8,
pub bIndexType: u8,
pub nEntriesInUse: u32,
pub dwChunkId: u32,
pub dwReserved: [u32; 3],
pub adwIndex: [u32; 1],
}import "golang.org/x/sys/windows"
type AVIMETAINDEX struct {
fcc uint32
cb uint32
wLongsPerEntry uint16
bIndexSubType byte
bIndexType byte
nEntriesInUse uint32
dwChunkId uint32
dwReserved [3]uint32
adwIndex [1]uint32
}type
AVIMETAINDEX = packed record
fcc: DWORD;
cb: DWORD;
wLongsPerEntry: Word;
bIndexSubType: Byte;
bIndexType: Byte;
nEntriesInUse: DWORD;
dwChunkId: DWORD;
dwReserved: array[0..2] of DWORD;
adwIndex: array[0..0] of DWORD;
end;const AVIMETAINDEX = extern struct {
fcc: u32,
cb: u32,
wLongsPerEntry: u16,
bIndexSubType: u8,
bIndexType: u8,
nEntriesInUse: u32,
dwChunkId: u32,
dwReserved: [3]u32,
adwIndex: [1]u32,
};type
AVIMETAINDEX {.packed.} = object
fcc: uint32
cb: uint32
wLongsPerEntry: uint16
bIndexSubType: uint8
bIndexType: uint8
nEntriesInUse: uint32
dwChunkId: uint32
dwReserved: array[3, uint32]
adwIndex: array[1, uint32]align(2)
struct AVIMETAINDEX
{
uint fcc;
uint cb;
ushort wLongsPerEntry;
ubyte bIndexSubType;
ubyte bIndexType;
uint nEntriesInUse;
uint dwChunkId;
uint[3] dwReserved;
uint[1] adwIndex;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; AVIMETAINDEX サイズ: 36 バイト(x64)
dim st, 9 ; 4byte整数×9(構造体サイズ 36 / 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 も可)
; dwReserved : DWORD (+20, 12byte) varptr(st)+20 を基点に操作(12byte:入れ子/配列)
; adwIndex : DWORD (+32, 4byte) varptr(st)+32 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global AVIMETAINDEX, pack=2
#field int fcc
#field int cb
#field short wLongsPerEntry
#field byte bIndexSubType
#field byte bIndexType
#field int nEntriesInUse
#field int dwChunkId
#field int dwReserved 3
#field int adwIndex 1
#endstruct
stdim st, AVIMETAINDEX ; NSTRUCT 変数を確保
st->fcc = 100
mes "fcc=" + st->fcc