ホーム › Media.Multimedia › CAPTUREPARMS
CAPTUREPARMS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwRequestMicroSecPerFrame | DWORD | 4 | +0 | +0 | フレーム間隔の要求値をマイクロ秒で指定する。 |
| fMakeUserHitOKToCapture | BOOL | 4 | +4 | +4 | キャプチャ開始前にユーザのOK確認を求めるならTRUE。 |
| wPercentDropForError | DWORD | 4 | +8 | +8 | 許容するフレーム脱落率を百分率で指定する。超過でエラー扱い。 |
| fYield | BOOL | 4 | +12 | +12 | キャプチャ中に別スレッドを生成して制御を譲るならTRUE。 |
| dwIndexSize | DWORD | 4 | +16 | +16 | AVIインデックスの最大エントリ数を指定する。 |
| wChunkGranularity | DWORD | 4 | +20 | +20 | ファイルチャンクのアラインメント単位をバイトで指定する。0で既定値。 |
| fUsingDOSMemory | BOOL | 4 | +24 | +24 | DOSメモリを使用するか(旧仕様)。通常はFALSE。 |
| wNumVideoRequested | DWORD | 4 | +28 | +28 | 要求する映像バッファ数。実際の確保数は調整される場合がある。 |
| fCaptureAudio | BOOL | 4 | +32 | +32 | 音声も同時にキャプチャするならTRUE。 |
| wNumAudioRequested | DWORD | 4 | +36 | +36 | 要求する音声バッファ数。 |
| vKeyAbort | DWORD | 4 | +40 | +40 | キャプチャを中断する仮想キーコード。 |
| fAbortLeftMouse | BOOL | 4 | +44 | +44 | マウス左ボタンでキャプチャを中断するならTRUE。 |
| fAbortRightMouse | BOOL | 4 | +48 | +48 | マウス右ボタンでキャプチャを中断するならTRUE。 |
| fLimitEnabled | BOOL | 4 | +52 | +52 | 時間制限によるキャプチャ自動停止を有効にするならTRUE。 |
| wTimeLimit | DWORD | 4 | +56 | +56 | fLimitEnabled有効時のキャプチャ時間上限を秒で指定する。 |
| fMCIControl | BOOL | 4 | +60 | +60 | MCI対応ビデオ機器を制御してキャプチャするならTRUE。 |
| fStepMCIDevice | BOOL | 4 | +64 | +64 | MCI機器をステップ制御してフレーム単位取得するならTRUE。 |
| dwMCIStartTime | DWORD | 4 | +68 | +68 | MCI制御時のキャプチャ開始位置をミリ秒で指定する。 |
| dwMCIStopTime | DWORD | 4 | +72 | +72 | MCI制御時のキャプチャ終了位置をミリ秒で指定する。 |
| fStepCaptureAt2x | BOOL | 4 | +76 | +76 | 解像度2倍でステップキャプチャするならTRUE。 |
| wStepCaptureAverageFrames | DWORD | 4 | +80 | +80 | ステップキャプチャ時に平均化するフレーム数。ノイズ低減に使う。 |
| dwAudioBufferSize | DWORD | 4 | +84 | +84 | 音声バッファのサイズをバイトで指定する。0で既定値。 |
| fDisableWriteCache | BOOL | 4 | +88 | +88 | ディスク書込みキャッシュを無効化するならTRUE。 |
| AVStreamMaster | DWORD | 4 | +92 | +92 | 音声と映像の同期で基準とするストリームを示す(AVSTREAMMASTER_AUDIO等)。 |
各言語での定義
#include <windows.h>
// CAPTUREPARMS (x64 96 / x86 96 バイト)
typedef struct CAPTUREPARMS {
DWORD dwRequestMicroSecPerFrame;
BOOL fMakeUserHitOKToCapture;
DWORD wPercentDropForError;
BOOL fYield;
DWORD dwIndexSize;
DWORD wChunkGranularity;
BOOL fUsingDOSMemory;
DWORD wNumVideoRequested;
BOOL fCaptureAudio;
DWORD wNumAudioRequested;
DWORD vKeyAbort;
BOOL fAbortLeftMouse;
BOOL fAbortRightMouse;
BOOL fLimitEnabled;
DWORD wTimeLimit;
BOOL fMCIControl;
BOOL fStepMCIDevice;
DWORD dwMCIStartTime;
DWORD dwMCIStopTime;
BOOL fStepCaptureAt2x;
DWORD wStepCaptureAverageFrames;
DWORD dwAudioBufferSize;
BOOL fDisableWriteCache;
DWORD AVStreamMaster;
} CAPTUREPARMS;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CAPTUREPARMS
{
public uint dwRequestMicroSecPerFrame;
[MarshalAs(UnmanagedType.Bool)] public bool fMakeUserHitOKToCapture;
public uint wPercentDropForError;
[MarshalAs(UnmanagedType.Bool)] public bool fYield;
public uint dwIndexSize;
public uint wChunkGranularity;
[MarshalAs(UnmanagedType.Bool)] public bool fUsingDOSMemory;
public uint wNumVideoRequested;
[MarshalAs(UnmanagedType.Bool)] public bool fCaptureAudio;
public uint wNumAudioRequested;
public uint vKeyAbort;
[MarshalAs(UnmanagedType.Bool)] public bool fAbortLeftMouse;
[MarshalAs(UnmanagedType.Bool)] public bool fAbortRightMouse;
[MarshalAs(UnmanagedType.Bool)] public bool fLimitEnabled;
public uint wTimeLimit;
[MarshalAs(UnmanagedType.Bool)] public bool fMCIControl;
[MarshalAs(UnmanagedType.Bool)] public bool fStepMCIDevice;
public uint dwMCIStartTime;
public uint dwMCIStopTime;
[MarshalAs(UnmanagedType.Bool)] public bool fStepCaptureAt2x;
public uint wStepCaptureAverageFrames;
public uint dwAudioBufferSize;
[MarshalAs(UnmanagedType.Bool)] public bool fDisableWriteCache;
public uint AVStreamMaster;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CAPTUREPARMS
Public dwRequestMicroSecPerFrame As UInteger
<MarshalAs(UnmanagedType.Bool)> Public fMakeUserHitOKToCapture As Boolean
Public wPercentDropForError As UInteger
<MarshalAs(UnmanagedType.Bool)> Public fYield As Boolean
Public dwIndexSize As UInteger
Public wChunkGranularity As UInteger
<MarshalAs(UnmanagedType.Bool)> Public fUsingDOSMemory As Boolean
Public wNumVideoRequested As UInteger
<MarshalAs(UnmanagedType.Bool)> Public fCaptureAudio As Boolean
Public wNumAudioRequested As UInteger
Public vKeyAbort As UInteger
<MarshalAs(UnmanagedType.Bool)> Public fAbortLeftMouse As Boolean
<MarshalAs(UnmanagedType.Bool)> Public fAbortRightMouse As Boolean
<MarshalAs(UnmanagedType.Bool)> Public fLimitEnabled As Boolean
Public wTimeLimit As UInteger
<MarshalAs(UnmanagedType.Bool)> Public fMCIControl As Boolean
<MarshalAs(UnmanagedType.Bool)> Public fStepMCIDevice As Boolean
Public dwMCIStartTime As UInteger
Public dwMCIStopTime As UInteger
<MarshalAs(UnmanagedType.Bool)> Public fStepCaptureAt2x As Boolean
Public wStepCaptureAverageFrames As UInteger
Public dwAudioBufferSize As UInteger
<MarshalAs(UnmanagedType.Bool)> Public fDisableWriteCache As Boolean
Public AVStreamMaster As UInteger
End Structureimport ctypes
from ctypes import wintypes
class CAPTUREPARMS(ctypes.Structure):
_fields_ = [
("dwRequestMicroSecPerFrame", wintypes.DWORD),
("fMakeUserHitOKToCapture", wintypes.BOOL),
("wPercentDropForError", wintypes.DWORD),
("fYield", wintypes.BOOL),
("dwIndexSize", wintypes.DWORD),
("wChunkGranularity", wintypes.DWORD),
("fUsingDOSMemory", wintypes.BOOL),
("wNumVideoRequested", wintypes.DWORD),
("fCaptureAudio", wintypes.BOOL),
("wNumAudioRequested", wintypes.DWORD),
("vKeyAbort", wintypes.DWORD),
("fAbortLeftMouse", wintypes.BOOL),
("fAbortRightMouse", wintypes.BOOL),
("fLimitEnabled", wintypes.BOOL),
("wTimeLimit", wintypes.DWORD),
("fMCIControl", wintypes.BOOL),
("fStepMCIDevice", wintypes.BOOL),
("dwMCIStartTime", wintypes.DWORD),
("dwMCIStopTime", wintypes.DWORD),
("fStepCaptureAt2x", wintypes.BOOL),
("wStepCaptureAverageFrames", wintypes.DWORD),
("dwAudioBufferSize", wintypes.DWORD),
("fDisableWriteCache", wintypes.BOOL),
("AVStreamMaster", wintypes.DWORD),
]#[repr(C)]
pub struct CAPTUREPARMS {
pub dwRequestMicroSecPerFrame: u32,
pub fMakeUserHitOKToCapture: i32,
pub wPercentDropForError: u32,
pub fYield: i32,
pub dwIndexSize: u32,
pub wChunkGranularity: u32,
pub fUsingDOSMemory: i32,
pub wNumVideoRequested: u32,
pub fCaptureAudio: i32,
pub wNumAudioRequested: u32,
pub vKeyAbort: u32,
pub fAbortLeftMouse: i32,
pub fAbortRightMouse: i32,
pub fLimitEnabled: i32,
pub wTimeLimit: u32,
pub fMCIControl: i32,
pub fStepMCIDevice: i32,
pub dwMCIStartTime: u32,
pub dwMCIStopTime: u32,
pub fStepCaptureAt2x: i32,
pub wStepCaptureAverageFrames: u32,
pub dwAudioBufferSize: u32,
pub fDisableWriteCache: i32,
pub AVStreamMaster: u32,
}import "golang.org/x/sys/windows"
type CAPTUREPARMS struct {
dwRequestMicroSecPerFrame uint32
fMakeUserHitOKToCapture int32
wPercentDropForError uint32
fYield int32
dwIndexSize uint32
wChunkGranularity uint32
fUsingDOSMemory int32
wNumVideoRequested uint32
fCaptureAudio int32
wNumAudioRequested uint32
vKeyAbort uint32
fAbortLeftMouse int32
fAbortRightMouse int32
fLimitEnabled int32
wTimeLimit uint32
fMCIControl int32
fStepMCIDevice int32
dwMCIStartTime uint32
dwMCIStopTime uint32
fStepCaptureAt2x int32
wStepCaptureAverageFrames uint32
dwAudioBufferSize uint32
fDisableWriteCache int32
AVStreamMaster uint32
}type
CAPTUREPARMS = record
dwRequestMicroSecPerFrame: DWORD;
fMakeUserHitOKToCapture: BOOL;
wPercentDropForError: DWORD;
fYield: BOOL;
dwIndexSize: DWORD;
wChunkGranularity: DWORD;
fUsingDOSMemory: BOOL;
wNumVideoRequested: DWORD;
fCaptureAudio: BOOL;
wNumAudioRequested: DWORD;
vKeyAbort: DWORD;
fAbortLeftMouse: BOOL;
fAbortRightMouse: BOOL;
fLimitEnabled: BOOL;
wTimeLimit: DWORD;
fMCIControl: BOOL;
fStepMCIDevice: BOOL;
dwMCIStartTime: DWORD;
dwMCIStopTime: DWORD;
fStepCaptureAt2x: BOOL;
wStepCaptureAverageFrames: DWORD;
dwAudioBufferSize: DWORD;
fDisableWriteCache: BOOL;
AVStreamMaster: DWORD;
end;const CAPTUREPARMS = extern struct {
dwRequestMicroSecPerFrame: u32,
fMakeUserHitOKToCapture: i32,
wPercentDropForError: u32,
fYield: i32,
dwIndexSize: u32,
wChunkGranularity: u32,
fUsingDOSMemory: i32,
wNumVideoRequested: u32,
fCaptureAudio: i32,
wNumAudioRequested: u32,
vKeyAbort: u32,
fAbortLeftMouse: i32,
fAbortRightMouse: i32,
fLimitEnabled: i32,
wTimeLimit: u32,
fMCIControl: i32,
fStepMCIDevice: i32,
dwMCIStartTime: u32,
dwMCIStopTime: u32,
fStepCaptureAt2x: i32,
wStepCaptureAverageFrames: u32,
dwAudioBufferSize: u32,
fDisableWriteCache: i32,
AVStreamMaster: u32,
};type
CAPTUREPARMS {.bycopy.} = object
dwRequestMicroSecPerFrame: uint32
fMakeUserHitOKToCapture: int32
wPercentDropForError: uint32
fYield: int32
dwIndexSize: uint32
wChunkGranularity: uint32
fUsingDOSMemory: int32
wNumVideoRequested: uint32
fCaptureAudio: int32
wNumAudioRequested: uint32
vKeyAbort: uint32
fAbortLeftMouse: int32
fAbortRightMouse: int32
fLimitEnabled: int32
wTimeLimit: uint32
fMCIControl: int32
fStepMCIDevice: int32
dwMCIStartTime: uint32
dwMCIStopTime: uint32
fStepCaptureAt2x: int32
wStepCaptureAverageFrames: uint32
dwAudioBufferSize: uint32
fDisableWriteCache: int32
AVStreamMaster: uint32struct CAPTUREPARMS
{
uint dwRequestMicroSecPerFrame;
int fMakeUserHitOKToCapture;
uint wPercentDropForError;
int fYield;
uint dwIndexSize;
uint wChunkGranularity;
int fUsingDOSMemory;
uint wNumVideoRequested;
int fCaptureAudio;
uint wNumAudioRequested;
uint vKeyAbort;
int fAbortLeftMouse;
int fAbortRightMouse;
int fLimitEnabled;
uint wTimeLimit;
int fMCIControl;
int fStepMCIDevice;
uint dwMCIStartTime;
uint dwMCIStopTime;
int fStepCaptureAt2x;
uint wStepCaptureAverageFrames;
uint dwAudioBufferSize;
int fDisableWriteCache;
uint AVStreamMaster;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CAPTUREPARMS サイズ: 96 バイト(x64)
dim st, 24 ; 4byte整数×24(構造体サイズ 96 / 4 切り上げ)
; dwRequestMicroSecPerFrame : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; fMakeUserHitOKToCapture : BOOL (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; wPercentDropForError : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; fYield : BOOL (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dwIndexSize : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; wChunkGranularity : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; fUsingDOSMemory : BOOL (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; wNumVideoRequested : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; fCaptureAudio : BOOL (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; wNumAudioRequested : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; vKeyAbort : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; fAbortLeftMouse : BOOL (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; fAbortRightMouse : BOOL (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; fLimitEnabled : BOOL (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; wTimeLimit : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; fMCIControl : BOOL (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; fStepMCIDevice : BOOL (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; dwMCIStartTime : DWORD (+68, 4byte) st.17 = 値 / 値 = st.17 (lpoke/lpeek も可)
; dwMCIStopTime : DWORD (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; fStepCaptureAt2x : BOOL (+76, 4byte) st.19 = 値 / 値 = st.19 (lpoke/lpeek も可)
; wStepCaptureAverageFrames : DWORD (+80, 4byte) st.20 = 値 / 値 = st.20 (lpoke/lpeek も可)
; dwAudioBufferSize : DWORD (+84, 4byte) st.21 = 値 / 値 = st.21 (lpoke/lpeek も可)
; fDisableWriteCache : BOOL (+88, 4byte) st.22 = 値 / 値 = st.22 (lpoke/lpeek も可)
; AVStreamMaster : DWORD (+92, 4byte) st.23 = 値 / 値 = st.23 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global CAPTUREPARMS
#field int dwRequestMicroSecPerFrame
#field bool fMakeUserHitOKToCapture
#field int wPercentDropForError
#field bool fYield
#field int dwIndexSize
#field int wChunkGranularity
#field bool fUsingDOSMemory
#field int wNumVideoRequested
#field bool fCaptureAudio
#field int wNumAudioRequested
#field int vKeyAbort
#field bool fAbortLeftMouse
#field bool fAbortRightMouse
#field bool fLimitEnabled
#field int wTimeLimit
#field bool fMCIControl
#field bool fStepMCIDevice
#field int dwMCIStartTime
#field int dwMCIStopTime
#field bool fStepCaptureAt2x
#field int wStepCaptureAverageFrames
#field int dwAudioBufferSize
#field bool fDisableWriteCache
#field int AVStreamMaster
#endstruct
stdim st, CAPTUREPARMS ; NSTRUCT 変数を確保
st->dwRequestMicroSecPerFrame = 100
mes "dwRequestMicroSecPerFrame=" + st->dwRequestMicroSecPerFrame