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

KSCAMERA_PROFILE_MEDIAINFO

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

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

フィールド

フィールドサイズx64x86説明
Resolution_Resolution_e__Struct8+0+0メディアの解像度を表す無名構造体(幅/高さ)。
MaxFrameRate_MaxFrameRate_e__Struct8+8+8対応する最大フレームレートを表す無名構造体(分子/分母)。
FlagsULONGLONG8+16+16メディア情報の属性を示す64ビットフラグ。
Data0DWORD4+24+24プロファイル固有の追加データ0。
Data1DWORD4+28+28プロファイル固有の追加データ1。
Data2DWORD4+32+32プロファイル固有の追加データ2。
Data3DWORD4+36+36プロファイル固有の追加データ3。

構造体: _Resolution_e__Struct x64 8B / x86 8B

フィールドサイズx64x86
XDWORD4+0+0
YDWORD4+4+4

構造体: _MaxFrameRate_e__Struct x64 8B / x86 8B

フィールドサイズx64x86
NumeratorDWORD4+0+0
DenominatorDWORD4+4+4

各言語での定義

#include <windows.h>

// KSCAMERA_PROFILE_MEDIAINFO  (x64 40 / x86 40 バイト)
typedef struct KSCAMERA_PROFILE_MEDIAINFO {
    _Resolution_e__Struct Resolution;
    _MaxFrameRate_e__Struct MaxFrameRate;
    ULONGLONG Flags;
    DWORD Data0;
    DWORD Data1;
    DWORD Data2;
    DWORD Data3;
} KSCAMERA_PROFILE_MEDIAINFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KSCAMERA_PROFILE_MEDIAINFO
{
    public _Resolution_e__Struct Resolution;
    public _MaxFrameRate_e__Struct MaxFrameRate;
    public ulong Flags;
    public uint Data0;
    public uint Data1;
    public uint Data2;
    public uint Data3;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure KSCAMERA_PROFILE_MEDIAINFO
    Public Resolution As _Resolution_e__Struct
    Public MaxFrameRate As _MaxFrameRate_e__Struct
    Public Flags As ULong
    Public Data0 As UInteger
    Public Data1 As UInteger
    Public Data2 As UInteger
    Public Data3 As UInteger
End Structure
import ctypes
from ctypes import wintypes

class KSCAMERA_PROFILE_MEDIAINFO(ctypes.Structure):
    _fields_ = [
        ("Resolution", _Resolution_e__Struct),
        ("MaxFrameRate", _MaxFrameRate_e__Struct),
        ("Flags", ctypes.c_ulonglong),
        ("Data0", wintypes.DWORD),
        ("Data1", wintypes.DWORD),
        ("Data2", wintypes.DWORD),
        ("Data3", wintypes.DWORD),
    ]
#[repr(C)]
pub struct KSCAMERA_PROFILE_MEDIAINFO {
    pub Resolution: _Resolution_e__Struct,
    pub MaxFrameRate: _MaxFrameRate_e__Struct,
    pub Flags: u64,
    pub Data0: u32,
    pub Data1: u32,
    pub Data2: u32,
    pub Data3: u32,
}
import "golang.org/x/sys/windows"

type KSCAMERA_PROFILE_MEDIAINFO struct {
	Resolution _Resolution_e__Struct
	MaxFrameRate _MaxFrameRate_e__Struct
	Flags uint64
	Data0 uint32
	Data1 uint32
	Data2 uint32
	Data3 uint32
}
type
  KSCAMERA_PROFILE_MEDIAINFO = record
    Resolution: _Resolution_e__Struct;
    MaxFrameRate: _MaxFrameRate_e__Struct;
    Flags: UInt64;
    Data0: DWORD;
    Data1: DWORD;
    Data2: DWORD;
    Data3: DWORD;
  end;
const KSCAMERA_PROFILE_MEDIAINFO = extern struct {
    Resolution: _Resolution_e__Struct,
    MaxFrameRate: _MaxFrameRate_e__Struct,
    Flags: u64,
    Data0: u32,
    Data1: u32,
    Data2: u32,
    Data3: u32,
};
type
  KSCAMERA_PROFILE_MEDIAINFO {.bycopy.} = object
    Resolution: _Resolution_e__Struct
    MaxFrameRate: _MaxFrameRate_e__Struct
    Flags: uint64
    Data0: uint32
    Data1: uint32
    Data2: uint32
    Data3: uint32
struct KSCAMERA_PROFILE_MEDIAINFO
{
    _Resolution_e__Struct Resolution;
    _MaxFrameRate_e__Struct MaxFrameRate;
    ulong Flags;
    uint Data0;
    uint Data1;
    uint Data2;
    uint Data3;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; KSCAMERA_PROFILE_MEDIAINFO サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; Resolution : _Resolution_e__Struct (+0, 8byte)  varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; MaxFrameRate : _MaxFrameRate_e__Struct (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; Flags : ULONGLONG (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; Data0 : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; Data1 : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; Data2 : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; Data3 : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global KSCAMERA_PROFILE_MEDIAINFO
    #field _Resolution_e__Struct Resolution
    #field _MaxFrameRate_e__Struct MaxFrameRate
    #field int64 Flags
    #field int Data0
    #field int Data1
    #field int Data2
    #field int Data3
#endstruct

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