ホーム › Media.WindowsMediaFormat › WMT_WEBSTREAM_FORMAT
WMT_WEBSTREAM_FORMAT
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | WORD | 2 | +0 | +0 | このフォーマット構造体のサイズをバイトで示す。 |
| cbSampleHeaderFixedData | WORD | 2 | +2 | +2 | サンプルヘッダの固定長部分のバイト数。 |
| wVersion | WORD | 2 | +4 | +4 | Webストリーム形式のバージョン番号。 |
| wReserved | WORD | 2 | +6 | +6 | 予約領域。使用しない。 |
各言語での定義
#include <windows.h>
// WMT_WEBSTREAM_FORMAT (x64 8 / x86 8 バイト)
typedef struct WMT_WEBSTREAM_FORMAT {
WORD cbSize;
WORD cbSampleHeaderFixedData;
WORD wVersion;
WORD wReserved;
} WMT_WEBSTREAM_FORMAT;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WMT_WEBSTREAM_FORMAT
{
public ushort cbSize;
public ushort cbSampleHeaderFixedData;
public ushort wVersion;
public ushort wReserved;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WMT_WEBSTREAM_FORMAT
Public cbSize As UShort
Public cbSampleHeaderFixedData As UShort
Public wVersion As UShort
Public wReserved As UShort
End Structureimport ctypes
from ctypes import wintypes
class WMT_WEBSTREAM_FORMAT(ctypes.Structure):
_fields_ = [
("cbSize", ctypes.c_ushort),
("cbSampleHeaderFixedData", ctypes.c_ushort),
("wVersion", ctypes.c_ushort),
("wReserved", ctypes.c_ushort),
]#[repr(C)]
pub struct WMT_WEBSTREAM_FORMAT {
pub cbSize: u16,
pub cbSampleHeaderFixedData: u16,
pub wVersion: u16,
pub wReserved: u16,
}import "golang.org/x/sys/windows"
type WMT_WEBSTREAM_FORMAT struct {
cbSize uint16
cbSampleHeaderFixedData uint16
wVersion uint16
wReserved uint16
}type
WMT_WEBSTREAM_FORMAT = record
cbSize: Word;
cbSampleHeaderFixedData: Word;
wVersion: Word;
wReserved: Word;
end;const WMT_WEBSTREAM_FORMAT = extern struct {
cbSize: u16,
cbSampleHeaderFixedData: u16,
wVersion: u16,
wReserved: u16,
};type
WMT_WEBSTREAM_FORMAT {.bycopy.} = object
cbSize: uint16
cbSampleHeaderFixedData: uint16
wVersion: uint16
wReserved: uint16struct WMT_WEBSTREAM_FORMAT
{
ushort cbSize;
ushort cbSampleHeaderFixedData;
ushort wVersion;
ushort wReserved;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WMT_WEBSTREAM_FORMAT サイズ: 8 バイト(x64)
dim st, 2 ; 4byte整数×2(構造体サイズ 8 / 4 切り上げ)
; cbSize : WORD (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; cbSampleHeaderFixedData : WORD (+2, 2byte) wpoke st,2,値 / 値 = wpeek(st,2)
; wVersion : WORD (+4, 2byte) wpoke st,4,値 / 値 = wpeek(st,4)
; wReserved : WORD (+6, 2byte) wpoke st,6,値 / 値 = wpeek(st,6)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WMT_WEBSTREAM_FORMAT
#field short cbSize
#field short cbSampleHeaderFixedData
#field short wVersion
#field short wReserved
#endstruct
stdim st, WMT_WEBSTREAM_FORMAT ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize