ホーム › Media.Multimedia › CAPSTATUS
CAPSTATUS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| uiImageWidth | DWORD | 4 | +0 | +0 | 現在のキャプチャ画像の幅をピクセル単位で示す。 |
| uiImageHeight | DWORD | 4 | +4 | +4 | 現在のキャプチャ画像の高さをピクセル単位で示す。 |
| fLiveWindow | BOOL | 4 | +8 | +8 | ライブプレビュー表示中ならTRUEとなる真偽値。 |
| fOverlayWindow | BOOL | 4 | +12 | +12 | オーバーレイ表示中ならTRUEとなる真偽値。 |
| fScale | BOOL | 4 | +16 | +16 | プレビュー画像をウィンドウに合わせて拡縮中ならTRUEとなる真偽値。 |
| ptScroll | POINT | 8 | +20 | +20 | クライアント領域内でビデオを表示する起点座標(POINT)。 |
| fUsingDefaultPalette | BOOL | 4 | +28 | +28 | 既定のパレットを使用中ならTRUEとなる真偽値。 |
| fAudioHardware | BOOL | 4 | +32 | +32 | 音声キャプチャ用ハードウェアが存在するならTRUEとなる真偽値。 |
| fCapFileExists | BOOL | 4 | +36 | +36 | キャプチャ先ファイルが既に存在するならTRUEとなる真偽値。 |
| dwCurrentVideoFrame | DWORD | 4 | +40 | +40 | これまでにキャプチャした映像フレーム数。 |
| dwCurrentVideoFramesDropped | DWORD | 4 | +44 | +44 | キャプチャ中に脱落(ドロップ)した映像フレーム数。 |
| dwCurrentWaveSamples | DWORD | 4 | +48 | +48 | これまでにキャプチャした音声サンプル数。 |
| dwCurrentTimeElapsedMS | DWORD | 4 | +52 | +52 | キャプチャ開始からの経過時間をミリ秒で示す。 |
| hPalCurrent | HPALETTE | 8/4 | +56 | +56 | 現在使用中のパレットのハンドル(HPALETTE)。 |
| fCapturingNow | BOOL | 4 | +64 | +60 | 現在キャプチャ実行中ならTRUEとなる真偽値。 |
| dwReturn | DWORD | 4 | +68 | +64 | キャプチャ終了時のエラーコードを返す。 |
| wNumVideoAllocated | DWORD | 4 | +72 | +68 | 確保された映像バッファの数。 |
| wNumAudioAllocated | DWORD | 4 | +76 | +72 | 確保された音声バッファの数。 |
各言語での定義
#include <windows.h>
// POINT (x64 8 / x86 8 バイト)
typedef struct POINT {
INT x;
INT y;
} POINT;
// CAPSTATUS (x64 80 / x86 76 バイト)
typedef struct CAPSTATUS {
DWORD uiImageWidth;
DWORD uiImageHeight;
BOOL fLiveWindow;
BOOL fOverlayWindow;
BOOL fScale;
POINT ptScroll;
BOOL fUsingDefaultPalette;
BOOL fAudioHardware;
BOOL fCapFileExists;
DWORD dwCurrentVideoFrame;
DWORD dwCurrentVideoFramesDropped;
DWORD dwCurrentWaveSamples;
DWORD dwCurrentTimeElapsedMS;
HPALETTE hPalCurrent;
BOOL fCapturingNow;
DWORD dwReturn;
DWORD wNumVideoAllocated;
DWORD wNumAudioAllocated;
} CAPSTATUS;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct POINT
{
public int x;
public int y;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CAPSTATUS
{
public uint uiImageWidth;
public uint uiImageHeight;
[MarshalAs(UnmanagedType.Bool)] public bool fLiveWindow;
[MarshalAs(UnmanagedType.Bool)] public bool fOverlayWindow;
[MarshalAs(UnmanagedType.Bool)] public bool fScale;
public POINT ptScroll;
[MarshalAs(UnmanagedType.Bool)] public bool fUsingDefaultPalette;
[MarshalAs(UnmanagedType.Bool)] public bool fAudioHardware;
[MarshalAs(UnmanagedType.Bool)] public bool fCapFileExists;
public uint dwCurrentVideoFrame;
public uint dwCurrentVideoFramesDropped;
public uint dwCurrentWaveSamples;
public uint dwCurrentTimeElapsedMS;
public IntPtr hPalCurrent;
[MarshalAs(UnmanagedType.Bool)] public bool fCapturingNow;
public uint dwReturn;
public uint wNumVideoAllocated;
public uint wNumAudioAllocated;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure POINT
Public x As Integer
Public y As Integer
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CAPSTATUS
Public uiImageWidth As UInteger
Public uiImageHeight As UInteger
<MarshalAs(UnmanagedType.Bool)> Public fLiveWindow As Boolean
<MarshalAs(UnmanagedType.Bool)> Public fOverlayWindow As Boolean
<MarshalAs(UnmanagedType.Bool)> Public fScale As Boolean
Public ptScroll As POINT
<MarshalAs(UnmanagedType.Bool)> Public fUsingDefaultPalette As Boolean
<MarshalAs(UnmanagedType.Bool)> Public fAudioHardware As Boolean
<MarshalAs(UnmanagedType.Bool)> Public fCapFileExists As Boolean
Public dwCurrentVideoFrame As UInteger
Public dwCurrentVideoFramesDropped As UInteger
Public dwCurrentWaveSamples As UInteger
Public dwCurrentTimeElapsedMS As UInteger
Public hPalCurrent As IntPtr
<MarshalAs(UnmanagedType.Bool)> Public fCapturingNow As Boolean
Public dwReturn As UInteger
Public wNumVideoAllocated As UInteger
Public wNumAudioAllocated As UInteger
End Structureimport ctypes
from ctypes import wintypes
class POINT(ctypes.Structure):
_fields_ = [
("x", ctypes.c_int),
("y", ctypes.c_int),
]
class CAPSTATUS(ctypes.Structure):
_fields_ = [
("uiImageWidth", wintypes.DWORD),
("uiImageHeight", wintypes.DWORD),
("fLiveWindow", wintypes.BOOL),
("fOverlayWindow", wintypes.BOOL),
("fScale", wintypes.BOOL),
("ptScroll", POINT),
("fUsingDefaultPalette", wintypes.BOOL),
("fAudioHardware", wintypes.BOOL),
("fCapFileExists", wintypes.BOOL),
("dwCurrentVideoFrame", wintypes.DWORD),
("dwCurrentVideoFramesDropped", wintypes.DWORD),
("dwCurrentWaveSamples", wintypes.DWORD),
("dwCurrentTimeElapsedMS", wintypes.DWORD),
("hPalCurrent", ctypes.c_void_p),
("fCapturingNow", wintypes.BOOL),
("dwReturn", wintypes.DWORD),
("wNumVideoAllocated", wintypes.DWORD),
("wNumAudioAllocated", wintypes.DWORD),
]#[repr(C)]
pub struct POINT {
pub x: i32,
pub y: i32,
}
#[repr(C)]
pub struct CAPSTATUS {
pub uiImageWidth: u32,
pub uiImageHeight: u32,
pub fLiveWindow: i32,
pub fOverlayWindow: i32,
pub fScale: i32,
pub ptScroll: POINT,
pub fUsingDefaultPalette: i32,
pub fAudioHardware: i32,
pub fCapFileExists: i32,
pub dwCurrentVideoFrame: u32,
pub dwCurrentVideoFramesDropped: u32,
pub dwCurrentWaveSamples: u32,
pub dwCurrentTimeElapsedMS: u32,
pub hPalCurrent: *mut core::ffi::c_void,
pub fCapturingNow: i32,
pub dwReturn: u32,
pub wNumVideoAllocated: u32,
pub wNumAudioAllocated: u32,
}import "golang.org/x/sys/windows"
type POINT struct {
x int32
y int32
}
type CAPSTATUS struct {
uiImageWidth uint32
uiImageHeight uint32
fLiveWindow int32
fOverlayWindow int32
fScale int32
ptScroll POINT
fUsingDefaultPalette int32
fAudioHardware int32
fCapFileExists int32
dwCurrentVideoFrame uint32
dwCurrentVideoFramesDropped uint32
dwCurrentWaveSamples uint32
dwCurrentTimeElapsedMS uint32
hPalCurrent uintptr
fCapturingNow int32
dwReturn uint32
wNumVideoAllocated uint32
wNumAudioAllocated uint32
}type
POINT = record
x: Integer;
y: Integer;
end;
CAPSTATUS = record
uiImageWidth: DWORD;
uiImageHeight: DWORD;
fLiveWindow: BOOL;
fOverlayWindow: BOOL;
fScale: BOOL;
ptScroll: POINT;
fUsingDefaultPalette: BOOL;
fAudioHardware: BOOL;
fCapFileExists: BOOL;
dwCurrentVideoFrame: DWORD;
dwCurrentVideoFramesDropped: DWORD;
dwCurrentWaveSamples: DWORD;
dwCurrentTimeElapsedMS: DWORD;
hPalCurrent: Pointer;
fCapturingNow: BOOL;
dwReturn: DWORD;
wNumVideoAllocated: DWORD;
wNumAudioAllocated: DWORD;
end;const POINT = extern struct {
x: i32,
y: i32,
};
const CAPSTATUS = extern struct {
uiImageWidth: u32,
uiImageHeight: u32,
fLiveWindow: i32,
fOverlayWindow: i32,
fScale: i32,
ptScroll: POINT,
fUsingDefaultPalette: i32,
fAudioHardware: i32,
fCapFileExists: i32,
dwCurrentVideoFrame: u32,
dwCurrentVideoFramesDropped: u32,
dwCurrentWaveSamples: u32,
dwCurrentTimeElapsedMS: u32,
hPalCurrent: ?*anyopaque,
fCapturingNow: i32,
dwReturn: u32,
wNumVideoAllocated: u32,
wNumAudioAllocated: u32,
};type
POINT {.bycopy.} = object
x: int32
y: int32
CAPSTATUS {.bycopy.} = object
uiImageWidth: uint32
uiImageHeight: uint32
fLiveWindow: int32
fOverlayWindow: int32
fScale: int32
ptScroll: POINT
fUsingDefaultPalette: int32
fAudioHardware: int32
fCapFileExists: int32
dwCurrentVideoFrame: uint32
dwCurrentVideoFramesDropped: uint32
dwCurrentWaveSamples: uint32
dwCurrentTimeElapsedMS: uint32
hPalCurrent: pointer
fCapturingNow: int32
dwReturn: uint32
wNumVideoAllocated: uint32
wNumAudioAllocated: uint32struct POINT
{
int x;
int y;
}
struct CAPSTATUS
{
uint uiImageWidth;
uint uiImageHeight;
int fLiveWindow;
int fOverlayWindow;
int fScale;
POINT ptScroll;
int fUsingDefaultPalette;
int fAudioHardware;
int fCapFileExists;
uint dwCurrentVideoFrame;
uint dwCurrentVideoFramesDropped;
uint dwCurrentWaveSamples;
uint dwCurrentTimeElapsedMS;
void* hPalCurrent;
int fCapturingNow;
uint dwReturn;
uint wNumVideoAllocated;
uint wNumAudioAllocated;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; CAPSTATUS サイズ: 76 バイト(x86)
dim st, 19 ; 4byte整数×19(構造体サイズ 76 / 4 切り上げ)
; uiImageWidth : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; uiImageHeight : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; fLiveWindow : BOOL (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; fOverlayWindow : BOOL (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; fScale : BOOL (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ptScroll : POINT (+20, 8byte) varptr(st)+20 を基点に操作(8byte:入れ子/配列)
; fUsingDefaultPalette : BOOL (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; fAudioHardware : BOOL (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; fCapFileExists : BOOL (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; dwCurrentVideoFrame : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; dwCurrentVideoFramesDropped : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; dwCurrentWaveSamples : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; dwCurrentTimeElapsedMS : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; hPalCurrent : HPALETTE (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; fCapturingNow : BOOL (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; dwReturn : DWORD (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; wNumVideoAllocated : DWORD (+68, 4byte) st.17 = 値 / 値 = st.17 (lpoke/lpeek も可)
; wNumAudioAllocated : DWORD (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CAPSTATUS サイズ: 80 バイト(x64)
dim st, 20 ; 4byte整数×20(構造体サイズ 80 / 4 切り上げ)
; uiImageWidth : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; uiImageHeight : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; fLiveWindow : BOOL (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; fOverlayWindow : BOOL (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; fScale : BOOL (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ptScroll : POINT (+20, 8byte) varptr(st)+20 を基点に操作(8byte:入れ子/配列)
; fUsingDefaultPalette : BOOL (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; fAudioHardware : BOOL (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; fCapFileExists : BOOL (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; dwCurrentVideoFrame : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; dwCurrentVideoFramesDropped : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; dwCurrentWaveSamples : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; dwCurrentTimeElapsedMS : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; hPalCurrent : HPALETTE (+56, 8byte) qpoke st,56,値 / qpeek(st,56) ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; fCapturingNow : BOOL (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; dwReturn : DWORD (+68, 4byte) st.17 = 値 / 値 = st.17 (lpoke/lpeek も可)
; wNumVideoAllocated : DWORD (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; wNumAudioAllocated : DWORD (+76, 4byte) st.19 = 値 / 値 = st.19 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global POINT
#field int x
#field int y
#endstruct
#defstruct global CAPSTATUS
#field int uiImageWidth
#field int uiImageHeight
#field bool fLiveWindow
#field bool fOverlayWindow
#field bool fScale
#field POINT ptScroll
#field bool fUsingDefaultPalette
#field bool fAudioHardware
#field bool fCapFileExists
#field int dwCurrentVideoFrame
#field int dwCurrentVideoFramesDropped
#field int dwCurrentWaveSamples
#field int dwCurrentTimeElapsedMS
#field intptr hPalCurrent
#field bool fCapturingNow
#field int dwReturn
#field int wNumVideoAllocated
#field int wNumAudioAllocated
#endstruct
stdim st, CAPSTATUS ; NSTRUCT 変数を確保
st->uiImageWidth = 100
mes "uiImageWidth=" + st->uiImageWidth