ホーム › Media.KernelStreaming › KSPROPERTY_VIDEOCONTROL_ACTUAL_FRAME_RATE_S
KSPROPERTY_VIDEOCONTROL_ACTUAL_FRAME_RATE_S
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Property | KSIDENTIFIER | 8 | +0 | +0 | 対象プロパティを識別するKSIDENTIFIER。プロパティセットGUID・ID・フラグを保持する。 |
| StreamIndex | DWORD | 4 | +8 | +8 | 対象とするストリームのインデックス。 |
| RangeIndex | DWORD | 4 | +12 | +12 | 対象とするフレームレート範囲のインデックス。 |
| Dimensions | SIZE | 8 | +16 | +16 | 対象の映像サイズ(幅/高さ)を表すSIZE。 |
| CurrentActualFrameRate | LONGLONG | 8 | +24 | +24 | 現在の実フレームレートを100ナノ秒/フレーム単位で示す。 |
| CurrentMaxAvailableFrameRate | LONGLONG | 8 | +32 | +32 | 現在利用可能な最大フレームレートを100ナノ秒/フレーム単位で示す。 |
各言語での定義
#include <windows.h>
// KSIDENTIFIER (x64 8 / x86 8 バイト)
typedef struct KSIDENTIFIER {
_Anonymous_e__Union Anonymous;
} KSIDENTIFIER;
// SIZE (x64 8 / x86 8 バイト)
typedef struct SIZE {
INT cx;
INT cy;
} SIZE;
// KSPROPERTY_VIDEOCONTROL_ACTUAL_FRAME_RATE_S (x64 40 / x86 40 バイト)
typedef struct KSPROPERTY_VIDEOCONTROL_ACTUAL_FRAME_RATE_S {
KSIDENTIFIER Property;
DWORD StreamIndex;
DWORD RangeIndex;
SIZE Dimensions;
LONGLONG CurrentActualFrameRate;
LONGLONG CurrentMaxAvailableFrameRate;
} KSPROPERTY_VIDEOCONTROL_ACTUAL_FRAME_RATE_S;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KSIDENTIFIER
{
public _Anonymous_e__Union Anonymous;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SIZE
{
public int cx;
public int cy;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KSPROPERTY_VIDEOCONTROL_ACTUAL_FRAME_RATE_S
{
public KSIDENTIFIER Property;
public uint StreamIndex;
public uint RangeIndex;
public SIZE Dimensions;
public long CurrentActualFrameRate;
public long CurrentMaxAvailableFrameRate;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure KSIDENTIFIER
Public Anonymous As _Anonymous_e__Union
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SIZE
Public cx As Integer
Public cy As Integer
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure KSPROPERTY_VIDEOCONTROL_ACTUAL_FRAME_RATE_S
Public Property As KSIDENTIFIER
Public StreamIndex As UInteger
Public RangeIndex As UInteger
Public Dimensions As SIZE
Public CurrentActualFrameRate As Long
Public CurrentMaxAvailableFrameRate As Long
End Structureimport ctypes
from ctypes import wintypes
class KSIDENTIFIER(ctypes.Structure):
_fields_ = [
("Anonymous", _Anonymous_e__Union),
]
class SIZE(ctypes.Structure):
_fields_ = [
("cx", ctypes.c_int),
("cy", ctypes.c_int),
]
class KSPROPERTY_VIDEOCONTROL_ACTUAL_FRAME_RATE_S(ctypes.Structure):
_fields_ = [
("Property", KSIDENTIFIER),
("StreamIndex", wintypes.DWORD),
("RangeIndex", wintypes.DWORD),
("Dimensions", SIZE),
("CurrentActualFrameRate", ctypes.c_longlong),
("CurrentMaxAvailableFrameRate", ctypes.c_longlong),
]#[repr(C)]
pub struct KSIDENTIFIER {
pub Anonymous: _Anonymous_e__Union,
}
#[repr(C)]
pub struct SIZE {
pub cx: i32,
pub cy: i32,
}
#[repr(C)]
pub struct KSPROPERTY_VIDEOCONTROL_ACTUAL_FRAME_RATE_S {
pub Property: KSIDENTIFIER,
pub StreamIndex: u32,
pub RangeIndex: u32,
pub Dimensions: SIZE,
pub CurrentActualFrameRate: i64,
pub CurrentMaxAvailableFrameRate: i64,
}import "golang.org/x/sys/windows"
type KSIDENTIFIER struct {
Anonymous _Anonymous_e__Union
}
type SIZE struct {
cx int32
cy int32
}
type KSPROPERTY_VIDEOCONTROL_ACTUAL_FRAME_RATE_S struct {
Property KSIDENTIFIER
StreamIndex uint32
RangeIndex uint32
Dimensions SIZE
CurrentActualFrameRate int64
CurrentMaxAvailableFrameRate int64
}type
KSIDENTIFIER = record
Anonymous: _Anonymous_e__Union;
end;
SIZE = record
cx: Integer;
cy: Integer;
end;
KSPROPERTY_VIDEOCONTROL_ACTUAL_FRAME_RATE_S = record
Property: KSIDENTIFIER;
StreamIndex: DWORD;
RangeIndex: DWORD;
Dimensions: SIZE;
CurrentActualFrameRate: Int64;
CurrentMaxAvailableFrameRate: Int64;
end;const KSIDENTIFIER = extern struct {
Anonymous: _Anonymous_e__Union,
};
const SIZE = extern struct {
cx: i32,
cy: i32,
};
const KSPROPERTY_VIDEOCONTROL_ACTUAL_FRAME_RATE_S = extern struct {
Property: KSIDENTIFIER,
StreamIndex: u32,
RangeIndex: u32,
Dimensions: SIZE,
CurrentActualFrameRate: i64,
CurrentMaxAvailableFrameRate: i64,
};type
KSIDENTIFIER {.bycopy.} = object
Anonymous: _Anonymous_e__Union
SIZE {.bycopy.} = object
cx: int32
cy: int32
KSPROPERTY_VIDEOCONTROL_ACTUAL_FRAME_RATE_S {.bycopy.} = object
Property: KSIDENTIFIER
StreamIndex: uint32
RangeIndex: uint32
Dimensions: SIZE
CurrentActualFrameRate: int64
CurrentMaxAvailableFrameRate: int64struct KSIDENTIFIER
{
_Anonymous_e__Union Anonymous;
}
struct SIZE
{
int cx;
int cy;
}
struct KSPROPERTY_VIDEOCONTROL_ACTUAL_FRAME_RATE_S
{
KSIDENTIFIER Property;
uint StreamIndex;
uint RangeIndex;
SIZE Dimensions;
long CurrentActualFrameRate;
long CurrentMaxAvailableFrameRate;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; KSPROPERTY_VIDEOCONTROL_ACTUAL_FRAME_RATE_S サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; Property : KSIDENTIFIER (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; StreamIndex : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; RangeIndex : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; Dimensions : SIZE (+16, 8byte) varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; CurrentActualFrameRate : LONGLONG (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; CurrentMaxAvailableFrameRate : LONGLONG (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global KSIDENTIFIER
#field byte Anonymous 8
#endstruct
#defstruct global SIZE
#field int cx
#field int cy
#endstruct
#defstruct global KSPROPERTY_VIDEOCONTROL_ACTUAL_FRAME_RATE_S
#field KSIDENTIFIER Property
#field int StreamIndex
#field int RangeIndex
#field SIZE Dimensions
#field int64 CurrentActualFrameRate
#field int64 CurrentMaxAvailableFrameRate
#endstruct
stdim st, KSPROPERTY_VIDEOCONTROL_ACTUAL_FRAME_RATE_S ; NSTRUCT 変数を確保
st->StreamIndex = 100
mes "StreamIndex=" + st->StreamIndex