CAPTUREPARMS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwRequestMicroSecPerFrame | DWORD | 4 | +0 | +0 | 要求するフレーム レート (マイクロ秒単位)。既定値は 66667 で、1 秒あたり 15 フレームに相当します。 |
| fMakeUserHitOKToCapture | BOOL | 4 | +4 | +4 | ユーザー開始キャプチャ フラグ。このメンバーが TRUE の場合、AVICap はキャプチャの開始をユーザーに促すダイアログ ボックスを表示します。既定値は FALSE です。 |
| wPercentDropForError | DWORD | 4 | +8 | +8 | キャプチャ中に許容されるドロップ フレームの最大割合。値の範囲は 0 から 100 です。既定値は 10 です。 |
| fYield | BOOL | 4 | +12 | +12 | イールド フラグ。このメンバーが TRUE の場合、キャプチャ ウィンドウはステップ キャプチャおよびストリーミング キャプチャを実行するための独立したバックグラウンド スレッドを生成します。既定値は FALSE です。 このフラグを設定するアプリケーションは、再入の問題に対処する必要があります。キャプチャの実行中もアプリケーションのコントロールは無効化されないためです。 |
| dwIndexSize | DWORD | 4 | +16 | +16 | AVI ファイル内のインデックス エントリの最大数。値の範囲は 1800 から 324,000 です。0 を設定した場合は、既定値である 34,952 (32K フレームと、それに比例した数のオーディオ バッファー) が使用されます。 各ビデオ フレーム、または波形オーディオ データのバッファーは、1 つのインデックス エントリを使用します。このエントリの値によって、キャプチャできるフレーム数またはオーディオ バッファー数の上限が決まります。 |
| wChunkGranularity | DWORD | 4 | +20 | +20 | AVI ファイルの論理ブロック サイズ (バイト単位)。値が 0 の場合は、現在のセクター サイズが粒度として使用されます。 |
| fUsingDOSMemory | BOOL | 4 | +24 | +24 | Win32 アプリケーションでは使用されません。 |
| wNumVideoRequested | DWORD | 4 | +28 | +28 | 割り当てるビデオ バッファーの最大数。バッファーを配置するメモリ領域は fUsingDOSMemory で指定します。メモリが不足している場合、実際に割り当てられるバッファー数はこれより少なくなることがあります。 |
| fCaptureAudio | BOOL | 4 | +32 | +32 | オーディオ キャプチャ フラグ。このメンバーが TRUE の場合、ストリーミング キャプチャ中にオーディオがキャプチャされます。オーディオ ハードウェアがインストールされている場合は、これが既定値です。 |
| wNumAudioRequested | DWORD | 4 | +36 | +36 | 割り当てるオーディオ バッファーの最大数。バッファーの最大数は 10 です。 |
| vKeyAbort | DWORD | 4 | +40 | +40 | ストリーミング キャプチャを終了するために使用する仮想キー コード。既定値は VK_ESCAPE です。キャプチャ セッションを中止できるキーストロークを指定する前に、RegisterHotKey 関数を呼び出す必要があります。 CTRL (0x8000) および SHIFT (0x4000) のキー コードと論理 OR 演算子を使用することで、CTRL キーや SHIFT キーを含むキー コードの組み合わせを指定できます。 |
| fAbortLeftMouse | BOOL | 4 | +44 | +44 | マウスの左ボタンによる中止フラグ。このメンバーが TRUE の場合、マウスの左ボタンが押されるとストリーミング キャプチャが停止します。既定値は TRUE です。 |
| fAbortRightMouse | BOOL | 4 | +48 | +48 | マウスの右ボタンによる中止フラグ。このメンバーが TRUE の場合、マウスの右ボタンが押されるとストリーミング キャプチャが停止します。既定値は TRUE です。 |
| fLimitEnabled | BOOL | 4 | +52 | +52 | 時間制限の有効フラグ。このメンバーが TRUE の場合、wTimeLimit で指定した秒数が経過するとストリーミング キャプチャが停止します。既定値は FALSE です。 |
| wTimeLimit | DWORD | 4 | +56 | +56 | キャプチャの時間制限 (秒単位)。このパラメーターは fLimitEnabled が TRUE の場合にのみ使用されます。 |
| fMCIControl | BOOL | 4 | +60 | +60 | MCI デバイス キャプチャ フラグ。このメンバーが TRUE の場合、AVICap はストリーミング キャプチャ中に MCI 互換のビデオ ソースを制御します。MCI 互換のビデオ ソースには、VCR やレーザーディスクなどがあります。 |
| fStepMCIDevice | BOOL | 4 | +64 | +64 | MCI デバイス ステップ キャプチャ フラグ。このメンバーが TRUE の場合、MCI デバイスをビデオ ソースとして使用するステップ キャプチャが有効になります。FALSE の場合は、MCI デバイスを使用したリアルタイム キャプチャが有効になります。(fMCIControl が FALSE の場合、このメンバーは無視されます。) |
| dwMCIStartTime | DWORD | 4 | +68 | +68 | キャプチャ シーケンスにおける MCI デバイスの開始位置 (ミリ秒単位)。(fMCIControl が FALSE の場合、このメンバーは無視されます。) |
| dwMCIStopTime | DWORD | 4 | +72 | +72 | キャプチャ シーケンスにおける MCI デバイスの停止位置 (ミリ秒単位)。コンテンツ内のこの位置に達すると、キャプチャが終了し、MCI デバイスが停止します。(fMCIControl が FALSE の場合、このメンバーは無視されます。) |
| fStepCaptureAt2x | BOOL | 4 | +76 | +76 | 倍解像度ステップ キャプチャ フラグ。このメンバーが TRUE の場合、キャプチャ ハードウェアは指定された解像度の 2 倍でキャプチャします。(高さと幅の解像度が 2 倍になります。) ハードウェアがハードウェア ベースのデシメーションをサポートしておらず、RGB 形式でキャプチャする場合は、このオプションを有効にします。 |
| wStepCaptureAverageFrames | DWORD | 4 | +80 | +80 | 平均サンプルに基づいてフレームを作成する際に、フレームをサンプリングする回数。平均回数の一般的な値は 5 です。 |
| dwAudioBufferSize | DWORD | 4 | +84 | +84 | オーディオ バッファーのサイズ。既定値の 0 を使用した場合、各バッファーのサイズは 0.5 秒分のオーディオまたは 10K バイトのうち大きい方になります。 |
| fDisableWriteCache | BOOL | 4 | +88 | +88 | Win32 アプリケーションでは使用されません。 |
| AVStreamMaster | DWORD | 4 | +92 | +92 | AVI ファイルの書き込み時に、オーディオ ストリームがクロックを制御するかどうかを示します。このメンバーに AVSTREAMMASTER_AUDIO が設定されている場合、オーディオ ストリームがマスター ストリームと見なされ、ビデオ ストリームの長さがオーディオの長さに強制的に合わせられます。AVSTREAMMASTER_NONE が設定されている場合、オーディオ ストリームとビデオ ストリームの長さは異なっていてもかまいません。 |
公式ドキュメント
CAPTUREPARMS 構造体は、ストリーミング ビデオ キャプチャ処理を制御するパラメーターを格納します。この構造体は、キャプチャ レート、キャプチャ中に使用するバッファーの数、およびキャプチャの終了方法に影響するパラメーターの取得と設定に使用されます。
解説(Remarks)
現在のキャプチャ パラメーターを取得するには、WM_CAP_GET_SEQUENCE_SETUP メッセージまたは capCaptureGetSetup マクロを使用します。キャプチャ パラメーターを設定するには、WM_CAP_SET_SEQUENCE_SETUP メッセージまたは capCaptureSetSetup マクロを使用します。
現在のキャプチャ パラメーターを取得するには、WM_CAP_GET_SEQUENCE_SETUP メッセージまたは capCaptureGetSetup マクロを使用します。キャプチャ パラメーターを設定するには、WM_CAP_SET_SEQUENCE_SETUP メッセージまたは capCaptureSetSetup マクロを使用します。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#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