WM_STREAM_PRIORITY_RECORD
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| wStreamNumber | WORD | 2 | +0 | +0 | ストリーム番号を格納する WORD です。 |
| fMandatory | BOOL | 4 | +2 | +2 | 指定されたストリームが必須かどうかを示すフラグです。必須のストリームは、優先順位リスト内での位置に関係なく破棄されません。 |
公式ドキュメント
[このページに関連する機能である Windows Media Format 11 SDK は、レガシー機能です。この機能は Source Reader および Sink Writer に置き換えられました。Source Reader と Sink Writer は Windows 10 および Windows 11 向けに最適化されています。Microsoft は、可能な場合は新しいコードで Windows Media Format 11 SDK ではなく Source Reader と Sink Writer を使用することを強く推奨します。また、レガシー API を使用している既存のコードについても、可能であれば新しい API を使用するように書き換えることを推奨します。]
WM_STREAM_PRIORITY_RECORD 構造体は、ストリーム番号を格納し、そのストリームの配信が必須かどうかを指定します。
解説(Remarks)
WM_STREAM_PRIORITY_RECORD は、IWMStreamPrioritization インターフェイスによって配列として使用されます。配列の各メンバーはストリームを指定し、配列内の要素番号が小さいほど、そのストリームの優先順位が高くなります。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// WM_STREAM_PRIORITY_RECORD (x64 6 / x86 6 バイト)
#pragma pack(push, 2)
typedef struct WM_STREAM_PRIORITY_RECORD {
WORD wStreamNumber;
BOOL fMandatory;
} WM_STREAM_PRIORITY_RECORD;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 2, CharSet = CharSet.Unicode)]
public struct WM_STREAM_PRIORITY_RECORD
{
public ushort wStreamNumber;
[MarshalAs(UnmanagedType.Bool)] public bool fMandatory;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=2, CharSet:=CharSet.Unicode)>
Public Structure WM_STREAM_PRIORITY_RECORD
Public wStreamNumber As UShort
<MarshalAs(UnmanagedType.Bool)> Public fMandatory As Boolean
End Structureimport ctypes
from ctypes import wintypes
class WM_STREAM_PRIORITY_RECORD(ctypes.Structure):
_pack_ = 2
_fields_ = [
("wStreamNumber", ctypes.c_ushort),
("fMandatory", wintypes.BOOL),
]#[repr(C, packed(2))]
pub struct WM_STREAM_PRIORITY_RECORD {
pub wStreamNumber: u16,
pub fMandatory: i32,
}import "golang.org/x/sys/windows"
type WM_STREAM_PRIORITY_RECORD struct {
wStreamNumber uint16
fMandatory int32
}type
WM_STREAM_PRIORITY_RECORD = packed record
wStreamNumber: Word;
fMandatory: BOOL;
end;const WM_STREAM_PRIORITY_RECORD = extern struct {
wStreamNumber: u16,
fMandatory: i32,
};type
WM_STREAM_PRIORITY_RECORD {.packed.} = object
wStreamNumber: uint16
fMandatory: int32align(2)
struct WM_STREAM_PRIORITY_RECORD
{
ushort wStreamNumber;
int fMandatory;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WM_STREAM_PRIORITY_RECORD サイズ: 6 バイト(x64)
dim st, 2 ; 4byte整数×2(構造体サイズ 6 / 4 切り上げ)
; wStreamNumber : WORD (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; fMandatory : BOOL (+2, 4byte) lpoke st,2,値 / 値 = lpeek(st,2)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WM_STREAM_PRIORITY_RECORD, pack=2
#field short wStreamNumber
#field bool fMandatory
#endstruct
stdim st, WM_STREAM_PRIORITY_RECORD ; NSTRUCT 変数を確保
st->wStreamNumber = 100
mes "wStreamNumber=" + st->wStreamNumber