ホーム › Media.WindowsMediaFormat › WM_WRITER_STATISTICS
WM_WRITER_STATISTICS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| qwSampleCount | ULONGLONG | 8 | +0 | +0 | 書込み済みサンプルの総数。 |
| qwByteCount | ULONGLONG | 8 | +8 | +8 | 書込み済みデータの総バイト数。 |
| qwDroppedSampleCount | ULONGLONG | 8 | +16 | +16 | 脱落(ドロップ)したサンプルの総数。 |
| qwDroppedByteCount | ULONGLONG | 8 | +24 | +24 | 脱落したデータの総バイト数。 |
| dwCurrentBitrate | DWORD | 4 | +32 | +32 | 現在のビットレート(bps)。 |
| dwAverageBitrate | DWORD | 4 | +36 | +36 | 平均ビットレート(bps)。 |
| dwExpectedBitrate | DWORD | 4 | +40 | +40 | 期待されるビットレート(bps)。 |
| dwCurrentSampleRate | DWORD | 4 | +44 | +44 | 現在のサンプルレート(毎秒サンプル数)。 |
| dwAverageSampleRate | DWORD | 4 | +48 | +48 | 平均サンプルレート(毎秒サンプル数)。 |
| dwExpectedSampleRate | DWORD | 4 | +52 | +52 | 期待されるサンプルレート(毎秒サンプル数)。 |
各言語での定義
#include <windows.h>
// WM_WRITER_STATISTICS (x64 56 / x86 56 バイト)
typedef struct WM_WRITER_STATISTICS {
ULONGLONG qwSampleCount;
ULONGLONG qwByteCount;
ULONGLONG qwDroppedSampleCount;
ULONGLONG qwDroppedByteCount;
DWORD dwCurrentBitrate;
DWORD dwAverageBitrate;
DWORD dwExpectedBitrate;
DWORD dwCurrentSampleRate;
DWORD dwAverageSampleRate;
DWORD dwExpectedSampleRate;
} WM_WRITER_STATISTICS;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WM_WRITER_STATISTICS
{
public ulong qwSampleCount;
public ulong qwByteCount;
public ulong qwDroppedSampleCount;
public ulong qwDroppedByteCount;
public uint dwCurrentBitrate;
public uint dwAverageBitrate;
public uint dwExpectedBitrate;
public uint dwCurrentSampleRate;
public uint dwAverageSampleRate;
public uint dwExpectedSampleRate;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WM_WRITER_STATISTICS
Public qwSampleCount As ULong
Public qwByteCount As ULong
Public qwDroppedSampleCount As ULong
Public qwDroppedByteCount As ULong
Public dwCurrentBitrate As UInteger
Public dwAverageBitrate As UInteger
Public dwExpectedBitrate As UInteger
Public dwCurrentSampleRate As UInteger
Public dwAverageSampleRate As UInteger
Public dwExpectedSampleRate As UInteger
End Structureimport ctypes
from ctypes import wintypes
class WM_WRITER_STATISTICS(ctypes.Structure):
_fields_ = [
("qwSampleCount", ctypes.c_ulonglong),
("qwByteCount", ctypes.c_ulonglong),
("qwDroppedSampleCount", ctypes.c_ulonglong),
("qwDroppedByteCount", ctypes.c_ulonglong),
("dwCurrentBitrate", wintypes.DWORD),
("dwAverageBitrate", wintypes.DWORD),
("dwExpectedBitrate", wintypes.DWORD),
("dwCurrentSampleRate", wintypes.DWORD),
("dwAverageSampleRate", wintypes.DWORD),
("dwExpectedSampleRate", wintypes.DWORD),
]#[repr(C)]
pub struct WM_WRITER_STATISTICS {
pub qwSampleCount: u64,
pub qwByteCount: u64,
pub qwDroppedSampleCount: u64,
pub qwDroppedByteCount: u64,
pub dwCurrentBitrate: u32,
pub dwAverageBitrate: u32,
pub dwExpectedBitrate: u32,
pub dwCurrentSampleRate: u32,
pub dwAverageSampleRate: u32,
pub dwExpectedSampleRate: u32,
}import "golang.org/x/sys/windows"
type WM_WRITER_STATISTICS struct {
qwSampleCount uint64
qwByteCount uint64
qwDroppedSampleCount uint64
qwDroppedByteCount uint64
dwCurrentBitrate uint32
dwAverageBitrate uint32
dwExpectedBitrate uint32
dwCurrentSampleRate uint32
dwAverageSampleRate uint32
dwExpectedSampleRate uint32
}type
WM_WRITER_STATISTICS = record
qwSampleCount: UInt64;
qwByteCount: UInt64;
qwDroppedSampleCount: UInt64;
qwDroppedByteCount: UInt64;
dwCurrentBitrate: DWORD;
dwAverageBitrate: DWORD;
dwExpectedBitrate: DWORD;
dwCurrentSampleRate: DWORD;
dwAverageSampleRate: DWORD;
dwExpectedSampleRate: DWORD;
end;const WM_WRITER_STATISTICS = extern struct {
qwSampleCount: u64,
qwByteCount: u64,
qwDroppedSampleCount: u64,
qwDroppedByteCount: u64,
dwCurrentBitrate: u32,
dwAverageBitrate: u32,
dwExpectedBitrate: u32,
dwCurrentSampleRate: u32,
dwAverageSampleRate: u32,
dwExpectedSampleRate: u32,
};type
WM_WRITER_STATISTICS {.bycopy.} = object
qwSampleCount: uint64
qwByteCount: uint64
qwDroppedSampleCount: uint64
qwDroppedByteCount: uint64
dwCurrentBitrate: uint32
dwAverageBitrate: uint32
dwExpectedBitrate: uint32
dwCurrentSampleRate: uint32
dwAverageSampleRate: uint32
dwExpectedSampleRate: uint32struct WM_WRITER_STATISTICS
{
ulong qwSampleCount;
ulong qwByteCount;
ulong qwDroppedSampleCount;
ulong qwDroppedByteCount;
uint dwCurrentBitrate;
uint dwAverageBitrate;
uint dwExpectedBitrate;
uint dwCurrentSampleRate;
uint dwAverageSampleRate;
uint dwExpectedSampleRate;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WM_WRITER_STATISTICS サイズ: 56 バイト(x64)
dim st, 14 ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; qwSampleCount : ULONGLONG (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; qwByteCount : ULONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; qwDroppedSampleCount : ULONGLONG (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; qwDroppedByteCount : ULONGLONG (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; dwCurrentBitrate : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; dwAverageBitrate : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; dwExpectedBitrate : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; dwCurrentSampleRate : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; dwAverageSampleRate : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; dwExpectedSampleRate : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WM_WRITER_STATISTICS
#field int64 qwSampleCount
#field int64 qwByteCount
#field int64 qwDroppedSampleCount
#field int64 qwDroppedByteCount
#field int dwCurrentBitrate
#field int dwAverageBitrate
#field int dwExpectedBitrate
#field int dwCurrentSampleRate
#field int dwAverageSampleRate
#field int dwExpectedSampleRate
#endstruct
stdim st, WM_WRITER_STATISTICS ; NSTRUCT 変数を確保
st->qwSampleCount = 100
mes "qwSampleCount=" + st->qwSampleCount