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

WM_WRITER_STATISTICS_EX

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

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

フィールド

フィールドサイズx64x86説明
dwBitratePlusOverheadDWORD4+0+0オーバーヘッドを含めた実効ビットレート(bps)。
dwCurrentSampleDropRateInQueueDWORD4+4+4キュー段階での現在のサンプル脱落率。
dwCurrentSampleDropRateInCodecDWORD4+8+8コーデック段階での現在のサンプル脱落率。
dwCurrentSampleDropRateInMultiplexerDWORD4+12+12多重化段階での現在のサンプル脱落率。
dwTotalSampleDropsInQueueDWORD4+16+16キュー段階での累計サンプル脱落数。
dwTotalSampleDropsInCodecDWORD4+20+20コーデック段階での累計サンプル脱落数。
dwTotalSampleDropsInMultiplexerDWORD4+24+24多重化段階での累計サンプル脱落数。

各言語での定義

#include <windows.h>

// WM_WRITER_STATISTICS_EX  (x64 28 / x86 28 バイト)
typedef struct WM_WRITER_STATISTICS_EX {
    DWORD dwBitratePlusOverhead;
    DWORD dwCurrentSampleDropRateInQueue;
    DWORD dwCurrentSampleDropRateInCodec;
    DWORD dwCurrentSampleDropRateInMultiplexer;
    DWORD dwTotalSampleDropsInQueue;
    DWORD dwTotalSampleDropsInCodec;
    DWORD dwTotalSampleDropsInMultiplexer;
} WM_WRITER_STATISTICS_EX;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WM_WRITER_STATISTICS_EX
{
    public uint dwBitratePlusOverhead;
    public uint dwCurrentSampleDropRateInQueue;
    public uint dwCurrentSampleDropRateInCodec;
    public uint dwCurrentSampleDropRateInMultiplexer;
    public uint dwTotalSampleDropsInQueue;
    public uint dwTotalSampleDropsInCodec;
    public uint dwTotalSampleDropsInMultiplexer;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WM_WRITER_STATISTICS_EX
    Public dwBitratePlusOverhead As UInteger
    Public dwCurrentSampleDropRateInQueue As UInteger
    Public dwCurrentSampleDropRateInCodec As UInteger
    Public dwCurrentSampleDropRateInMultiplexer As UInteger
    Public dwTotalSampleDropsInQueue As UInteger
    Public dwTotalSampleDropsInCodec As UInteger
    Public dwTotalSampleDropsInMultiplexer As UInteger
End Structure
import ctypes
from ctypes import wintypes

class WM_WRITER_STATISTICS_EX(ctypes.Structure):
    _fields_ = [
        ("dwBitratePlusOverhead", wintypes.DWORD),
        ("dwCurrentSampleDropRateInQueue", wintypes.DWORD),
        ("dwCurrentSampleDropRateInCodec", wintypes.DWORD),
        ("dwCurrentSampleDropRateInMultiplexer", wintypes.DWORD),
        ("dwTotalSampleDropsInQueue", wintypes.DWORD),
        ("dwTotalSampleDropsInCodec", wintypes.DWORD),
        ("dwTotalSampleDropsInMultiplexer", wintypes.DWORD),
    ]
#[repr(C)]
pub struct WM_WRITER_STATISTICS_EX {
    pub dwBitratePlusOverhead: u32,
    pub dwCurrentSampleDropRateInQueue: u32,
    pub dwCurrentSampleDropRateInCodec: u32,
    pub dwCurrentSampleDropRateInMultiplexer: u32,
    pub dwTotalSampleDropsInQueue: u32,
    pub dwTotalSampleDropsInCodec: u32,
    pub dwTotalSampleDropsInMultiplexer: u32,
}
import "golang.org/x/sys/windows"

type WM_WRITER_STATISTICS_EX struct {
	dwBitratePlusOverhead uint32
	dwCurrentSampleDropRateInQueue uint32
	dwCurrentSampleDropRateInCodec uint32
	dwCurrentSampleDropRateInMultiplexer uint32
	dwTotalSampleDropsInQueue uint32
	dwTotalSampleDropsInCodec uint32
	dwTotalSampleDropsInMultiplexer uint32
}
type
  WM_WRITER_STATISTICS_EX = record
    dwBitratePlusOverhead: DWORD;
    dwCurrentSampleDropRateInQueue: DWORD;
    dwCurrentSampleDropRateInCodec: DWORD;
    dwCurrentSampleDropRateInMultiplexer: DWORD;
    dwTotalSampleDropsInQueue: DWORD;
    dwTotalSampleDropsInCodec: DWORD;
    dwTotalSampleDropsInMultiplexer: DWORD;
  end;
const WM_WRITER_STATISTICS_EX = extern struct {
    dwBitratePlusOverhead: u32,
    dwCurrentSampleDropRateInQueue: u32,
    dwCurrentSampleDropRateInCodec: u32,
    dwCurrentSampleDropRateInMultiplexer: u32,
    dwTotalSampleDropsInQueue: u32,
    dwTotalSampleDropsInCodec: u32,
    dwTotalSampleDropsInMultiplexer: u32,
};
type
  WM_WRITER_STATISTICS_EX {.bycopy.} = object
    dwBitratePlusOverhead: uint32
    dwCurrentSampleDropRateInQueue: uint32
    dwCurrentSampleDropRateInCodec: uint32
    dwCurrentSampleDropRateInMultiplexer: uint32
    dwTotalSampleDropsInQueue: uint32
    dwTotalSampleDropsInCodec: uint32
    dwTotalSampleDropsInMultiplexer: uint32
struct WM_WRITER_STATISTICS_EX
{
    uint dwBitratePlusOverhead;
    uint dwCurrentSampleDropRateInQueue;
    uint dwCurrentSampleDropRateInCodec;
    uint dwCurrentSampleDropRateInMultiplexer;
    uint dwTotalSampleDropsInQueue;
    uint dwTotalSampleDropsInCodec;
    uint dwTotalSampleDropsInMultiplexer;
}

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_EX サイズ: 28 バイト(x64)
dim st, 7    ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; dwBitratePlusOverhead : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwCurrentSampleDropRateInQueue : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwCurrentSampleDropRateInCodec : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwCurrentSampleDropRateInMultiplexer : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; dwTotalSampleDropsInQueue : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; dwTotalSampleDropsInCodec : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; dwTotalSampleDropsInMultiplexer : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WM_WRITER_STATISTICS_EX
    #field int dwBitratePlusOverhead
    #field int dwCurrentSampleDropRateInQueue
    #field int dwCurrentSampleDropRateInCodec
    #field int dwCurrentSampleDropRateInMultiplexer
    #field int dwTotalSampleDropsInQueue
    #field int dwTotalSampleDropsInCodec
    #field int dwTotalSampleDropsInMultiplexer
#endstruct

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