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

AVISUPERINDEX

構造体
サイズx64: 16384 バイト / x86: 16384 バイトパッキング2

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

フィールド

フィールドサイズx64x86説明
fccDWORD4+0+0チャンクを識別するFourCCコード('indx')。
cbDWORD4+4+4インデックスデータのバイト数。
wLongsPerEntryWORD2+8+81エントリあたりのDWORD(4バイト)数。
bIndexSubTypeBYTE1+10+10インデックスのサブタイプを示す値。
bIndexTypeBYTE1+11+11インデックスの種類を示す値(スーパーインデックス)。
nEntriesInUseDWORD4+12+12使用中のエントリ数。
dwChunkIdDWORD4+16+16このインデックスが指すチャンクのID(FourCC)。
dwReservedDWORD12+20+20予約フィールド配列。将来の拡張用で通常は0。
aIndex_avisuperindex_entry16352+32+32スーパーインデックスエントリの可変長配列。下位インデックスを指す。

構造体: _avisuperindex_entry x64 16B / x86 16B

フィールドサイズx64x86
qwOffsetULONGLONG8+0+0
dwSizeDWORD4+8+8
dwDurationDWORD4+12+12

各言語での定義

#include <windows.h>

// AVISUPERINDEX  (x64 16384 / x86 16384 バイト)
#pragma pack(push, 2)
typedef struct AVISUPERINDEX {
    DWORD fcc;
    DWORD cb;
    WORD wLongsPerEntry;
    BYTE bIndexSubType;
    BYTE bIndexType;
    DWORD nEntriesInUse;
    DWORD dwChunkId;
    DWORD dwReserved[3];
    _avisuperindex_entry aIndex[1022];
} AVISUPERINDEX;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, Pack = 2, CharSet = CharSet.Unicode)]
public struct AVISUPERINDEX
{
    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 = 1022)] public _avisuperindex_entry[] aIndex;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, Pack:=2, CharSet:=CharSet.Unicode)>
Public Structure AVISUPERINDEX
    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:=1022)> Public aIndex() As _avisuperindex_entry
End Structure
import ctypes
from ctypes import wintypes

class AVISUPERINDEX(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),
        ("aIndex", _avisuperindex_entry * 1022),
    ]
#[repr(C, packed(2))]
pub struct AVISUPERINDEX {
    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 aIndex: [_avisuperindex_entry; 1022],
}
import "golang.org/x/sys/windows"

type AVISUPERINDEX struct {
	fcc uint32
	cb uint32
	wLongsPerEntry uint16
	bIndexSubType byte
	bIndexType byte
	nEntriesInUse uint32
	dwChunkId uint32
	dwReserved [3]uint32
	aIndex [1022]_avisuperindex_entry
}
type
  AVISUPERINDEX = packed record
    fcc: DWORD;
    cb: DWORD;
    wLongsPerEntry: Word;
    bIndexSubType: Byte;
    bIndexType: Byte;
    nEntriesInUse: DWORD;
    dwChunkId: DWORD;
    dwReserved: array[0..2] of DWORD;
    aIndex: array[0..1021] of _avisuperindex_entry;
  end;
const AVISUPERINDEX = extern struct {
    fcc: u32,
    cb: u32,
    wLongsPerEntry: u16,
    bIndexSubType: u8,
    bIndexType: u8,
    nEntriesInUse: u32,
    dwChunkId: u32,
    dwReserved: [3]u32,
    aIndex: [1022]_avisuperindex_entry,
};
type
  AVISUPERINDEX {.packed.} = object
    fcc: uint32
    cb: uint32
    wLongsPerEntry: uint16
    bIndexSubType: uint8
    bIndexType: uint8
    nEntriesInUse: uint32
    dwChunkId: uint32
    dwReserved: array[3, uint32]
    aIndex: array[1022, _avisuperindex_entry]
align(2)
struct AVISUPERINDEX
{
    uint fcc;
    uint cb;
    ushort wLongsPerEntry;
    ubyte bIndexSubType;
    ubyte bIndexType;
    uint nEntriesInUse;
    uint dwChunkId;
    uint[3] dwReserved;
    _avisuperindex_entry[1022] aIndex;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; AVISUPERINDEX サイズ: 16384 バイト(x64)
dim st, 4096    ; 4byte整数×4096(構造体サイズ 16384 / 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:入れ子/配列)
; aIndex : _avisuperindex_entry (+32, 16352byte)  varptr(st)+32 を基点に操作(16352byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global AVISUPERINDEX, 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 _avisuperindex_entry aIndex 1022
#endstruct

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