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

SBE2_STREAM_DESC

構造体
サイズx64: 16 バイト / x86: 16 バイト

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

フィールド

フィールドサイズx64x86説明
VersionDWORD4+0+0ストリーム記述子の構造体バージョン。
StreamIdDWORD4+4+4ストリームを識別するID。
DefaultDWORD4+8+8既定のストリームか否かを示す値。
ReservedDWORD4+12+12予約フィールド。将来の拡張用で通常は0。

各言語での定義

#include <windows.h>

// SBE2_STREAM_DESC  (x64 16 / x86 16 バイト)
typedef struct SBE2_STREAM_DESC {
    DWORD Version;
    DWORD StreamId;
    DWORD Default;
    DWORD Reserved;
} SBE2_STREAM_DESC;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SBE2_STREAM_DESC
{
    public uint Version;
    public uint StreamId;
    public uint Default;
    public uint Reserved;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SBE2_STREAM_DESC
    Public Version As UInteger
    Public StreamId As UInteger
    Public Default As UInteger
    Public Reserved As UInteger
End Structure
import ctypes
from ctypes import wintypes

class SBE2_STREAM_DESC(ctypes.Structure):
    _fields_ = [
        ("Version", wintypes.DWORD),
        ("StreamId", wintypes.DWORD),
        ("Default", wintypes.DWORD),
        ("Reserved", wintypes.DWORD),
    ]
#[repr(C)]
pub struct SBE2_STREAM_DESC {
    pub Version: u32,
    pub StreamId: u32,
    pub Default: u32,
    pub Reserved: u32,
}
import "golang.org/x/sys/windows"

type SBE2_STREAM_DESC struct {
	Version uint32
	StreamId uint32
	Default uint32
	Reserved uint32
}
type
  SBE2_STREAM_DESC = record
    Version: DWORD;
    StreamId: DWORD;
    Default: DWORD;
    Reserved: DWORD;
  end;
const SBE2_STREAM_DESC = extern struct {
    Version: u32,
    StreamId: u32,
    Default: u32,
    Reserved: u32,
};
type
  SBE2_STREAM_DESC {.bycopy.} = object
    Version: uint32
    StreamId: uint32
    Default: uint32
    Reserved: uint32
struct SBE2_STREAM_DESC
{
    uint Version;
    uint StreamId;
    uint Default;
    uint Reserved;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SBE2_STREAM_DESC サイズ: 16 バイト(x64)
dim st, 4    ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; Version : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; StreamId : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; Default : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; Reserved : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SBE2_STREAM_DESC
    #field int Version
    #field int StreamId
    #field int Default
    #field int Reserved
#endstruct

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