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

MFMPEG2DLNASINKSTATS

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

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

フィールド

フィールドサイズx64x86説明
cBytesWrittenULONGLONG8+0+0バイトストリームに書き込まれた総バイト数。
fPALBOOL4+8+8TRUE の場合、ビデオストリームは PAL 形式です。それ以外の場合、ビデオストリームは NTSC 形式です。
fccVideoDWORD4+12+12ビデオ形式を指定する FOURCC コード。
dwVideoWidthDWORD4+16+16ビデオフレームの幅 (ピクセル単位)。
dwVideoHeightDWORD4+20+20ビデオフレームの高さ (ピクセル単位)。
cVideoFramesReceivedULONGLONG8+24+24受信したビデオフレームの数。
cVideoFramesEncodedULONGLONG8+32+32エンコードされたビデオフレームの数。
cVideoFramesSkippedULONGLONG8+40+40スキップされたビデオフレームの数。
cBlackVideoFramesEncodedULONGLONG8+48+48エンコードされた黒フレームの数。
cVideoFramesDuplicatedULONGLONG8+56+56重複したビデオフレームの数。
cAudioSamplesPerSecDWORD4+64+64オーディオのサンプルレート (1 秒あたりのサンプル数)。
cAudioChannelsDWORD4+68+68オーディオチャンネルの数。
cAudioBytesReceivedULONGLONG8+72+72受信したオーディオデータの総量 (バイト単位)。
cAudioFramesEncodedULONGLONG8+80+80エンコードされたオーディオフレームの数。

公式ドキュメント

Digital Living Network Alliance (DLNA) メディアシンクのエンコード統計情報を格納します。

この構造体は MF_MP2DLNA_STATISTICS 属性で使用されます。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#include <windows.h>

// MFMPEG2DLNASINKSTATS  (x64 88 / x86 88 バイト)
typedef struct MFMPEG2DLNASINKSTATS {
    ULONGLONG cBytesWritten;
    BOOL fPAL;
    DWORD fccVideo;
    DWORD dwVideoWidth;
    DWORD dwVideoHeight;
    ULONGLONG cVideoFramesReceived;
    ULONGLONG cVideoFramesEncoded;
    ULONGLONG cVideoFramesSkipped;
    ULONGLONG cBlackVideoFramesEncoded;
    ULONGLONG cVideoFramesDuplicated;
    DWORD cAudioSamplesPerSec;
    DWORD cAudioChannels;
    ULONGLONG cAudioBytesReceived;
    ULONGLONG cAudioFramesEncoded;
} MFMPEG2DLNASINKSTATS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MFMPEG2DLNASINKSTATS
{
    public ulong cBytesWritten;
    [MarshalAs(UnmanagedType.Bool)] public bool fPAL;
    public uint fccVideo;
    public uint dwVideoWidth;
    public uint dwVideoHeight;
    public ulong cVideoFramesReceived;
    public ulong cVideoFramesEncoded;
    public ulong cVideoFramesSkipped;
    public ulong cBlackVideoFramesEncoded;
    public ulong cVideoFramesDuplicated;
    public uint cAudioSamplesPerSec;
    public uint cAudioChannels;
    public ulong cAudioBytesReceived;
    public ulong cAudioFramesEncoded;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MFMPEG2DLNASINKSTATS
    Public cBytesWritten As ULong
    <MarshalAs(UnmanagedType.Bool)> Public fPAL As Boolean
    Public fccVideo As UInteger
    Public dwVideoWidth As UInteger
    Public dwVideoHeight As UInteger
    Public cVideoFramesReceived As ULong
    Public cVideoFramesEncoded As ULong
    Public cVideoFramesSkipped As ULong
    Public cBlackVideoFramesEncoded As ULong
    Public cVideoFramesDuplicated As ULong
    Public cAudioSamplesPerSec As UInteger
    Public cAudioChannels As UInteger
    Public cAudioBytesReceived As ULong
    Public cAudioFramesEncoded As ULong
End Structure
import ctypes
from ctypes import wintypes

class MFMPEG2DLNASINKSTATS(ctypes.Structure):
    _fields_ = [
        ("cBytesWritten", ctypes.c_ulonglong),
        ("fPAL", wintypes.BOOL),
        ("fccVideo", wintypes.DWORD),
        ("dwVideoWidth", wintypes.DWORD),
        ("dwVideoHeight", wintypes.DWORD),
        ("cVideoFramesReceived", ctypes.c_ulonglong),
        ("cVideoFramesEncoded", ctypes.c_ulonglong),
        ("cVideoFramesSkipped", ctypes.c_ulonglong),
        ("cBlackVideoFramesEncoded", ctypes.c_ulonglong),
        ("cVideoFramesDuplicated", ctypes.c_ulonglong),
        ("cAudioSamplesPerSec", wintypes.DWORD),
        ("cAudioChannels", wintypes.DWORD),
        ("cAudioBytesReceived", ctypes.c_ulonglong),
        ("cAudioFramesEncoded", ctypes.c_ulonglong),
    ]
#[repr(C)]
pub struct MFMPEG2DLNASINKSTATS {
    pub cBytesWritten: u64,
    pub fPAL: i32,
    pub fccVideo: u32,
    pub dwVideoWidth: u32,
    pub dwVideoHeight: u32,
    pub cVideoFramesReceived: u64,
    pub cVideoFramesEncoded: u64,
    pub cVideoFramesSkipped: u64,
    pub cBlackVideoFramesEncoded: u64,
    pub cVideoFramesDuplicated: u64,
    pub cAudioSamplesPerSec: u32,
    pub cAudioChannels: u32,
    pub cAudioBytesReceived: u64,
    pub cAudioFramesEncoded: u64,
}
import "golang.org/x/sys/windows"

type MFMPEG2DLNASINKSTATS struct {
	cBytesWritten uint64
	fPAL int32
	fccVideo uint32
	dwVideoWidth uint32
	dwVideoHeight uint32
	cVideoFramesReceived uint64
	cVideoFramesEncoded uint64
	cVideoFramesSkipped uint64
	cBlackVideoFramesEncoded uint64
	cVideoFramesDuplicated uint64
	cAudioSamplesPerSec uint32
	cAudioChannels uint32
	cAudioBytesReceived uint64
	cAudioFramesEncoded uint64
}
type
  MFMPEG2DLNASINKSTATS = record
    cBytesWritten: UInt64;
    fPAL: BOOL;
    fccVideo: DWORD;
    dwVideoWidth: DWORD;
    dwVideoHeight: DWORD;
    cVideoFramesReceived: UInt64;
    cVideoFramesEncoded: UInt64;
    cVideoFramesSkipped: UInt64;
    cBlackVideoFramesEncoded: UInt64;
    cVideoFramesDuplicated: UInt64;
    cAudioSamplesPerSec: DWORD;
    cAudioChannels: DWORD;
    cAudioBytesReceived: UInt64;
    cAudioFramesEncoded: UInt64;
  end;
const MFMPEG2DLNASINKSTATS = extern struct {
    cBytesWritten: u64,
    fPAL: i32,
    fccVideo: u32,
    dwVideoWidth: u32,
    dwVideoHeight: u32,
    cVideoFramesReceived: u64,
    cVideoFramesEncoded: u64,
    cVideoFramesSkipped: u64,
    cBlackVideoFramesEncoded: u64,
    cVideoFramesDuplicated: u64,
    cAudioSamplesPerSec: u32,
    cAudioChannels: u32,
    cAudioBytesReceived: u64,
    cAudioFramesEncoded: u64,
};
type
  MFMPEG2DLNASINKSTATS {.bycopy.} = object
    cBytesWritten: uint64
    fPAL: int32
    fccVideo: uint32
    dwVideoWidth: uint32
    dwVideoHeight: uint32
    cVideoFramesReceived: uint64
    cVideoFramesEncoded: uint64
    cVideoFramesSkipped: uint64
    cBlackVideoFramesEncoded: uint64
    cVideoFramesDuplicated: uint64
    cAudioSamplesPerSec: uint32
    cAudioChannels: uint32
    cAudioBytesReceived: uint64
    cAudioFramesEncoded: uint64
struct MFMPEG2DLNASINKSTATS
{
    ulong cBytesWritten;
    int fPAL;
    uint fccVideo;
    uint dwVideoWidth;
    uint dwVideoHeight;
    ulong cVideoFramesReceived;
    ulong cVideoFramesEncoded;
    ulong cVideoFramesSkipped;
    ulong cBlackVideoFramesEncoded;
    ulong cVideoFramesDuplicated;
    uint cAudioSamplesPerSec;
    uint cAudioChannels;
    ulong cAudioBytesReceived;
    ulong cAudioFramesEncoded;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MFMPEG2DLNASINKSTATS サイズ: 88 バイト(x64)
dim st, 22    ; 4byte整数×22(構造体サイズ 88 / 4 切り上げ)
; cBytesWritten : ULONGLONG (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; fPAL : BOOL (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; fccVideo : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; dwVideoWidth : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; dwVideoHeight : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; cVideoFramesReceived : ULONGLONG (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; cVideoFramesEncoded : ULONGLONG (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; cVideoFramesSkipped : ULONGLONG (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; cBlackVideoFramesEncoded : ULONGLONG (+48, 8byte)  qpoke st,48,値 / qpeek(st,48)  ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; cVideoFramesDuplicated : ULONGLONG (+56, 8byte)  qpoke st,56,値 / qpeek(st,56)  ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; cAudioSamplesPerSec : DWORD (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; cAudioChannels : DWORD (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; cAudioBytesReceived : ULONGLONG (+72, 8byte)  qpoke st,72,値 / qpeek(st,72)  ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; cAudioFramesEncoded : ULONGLONG (+80, 8byte)  qpoke st,80,値 / qpeek(st,80)  ※IronHSPのみ。3.7/3.8は lpoke st,80,下位 : lpoke st,84,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MFMPEG2DLNASINKSTATS
    #field int64 cBytesWritten
    #field bool fPAL
    #field int fccVideo
    #field int dwVideoWidth
    #field int dwVideoHeight
    #field int64 cVideoFramesReceived
    #field int64 cVideoFramesEncoded
    #field int64 cVideoFramesSkipped
    #field int64 cBlackVideoFramesEncoded
    #field int64 cVideoFramesDuplicated
    #field int cAudioSamplesPerSec
    #field int cAudioChannels
    #field int64 cAudioBytesReceived
    #field int64 cAudioFramesEncoded
#endstruct

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