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

CAPDRIVERCAPS

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

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

フィールド

フィールドサイズx64x86説明
wDeviceIndexDWORD4+0+0ビデオキャプチャドライバのインデックス番号(0~9)。
fHasOverlayBOOL4+4+4オーバーレイ機能を持つ場合にTRUEとなる真偽値。
fHasDlgVideoSourceBOOL4+8+8ビデオソース設定ダイアログを持つ場合にTRUEとなる真偽値。
fHasDlgVideoFormatBOOL4+12+12ビデオフォーマット設定ダイアログを持つ場合にTRUEとなる真偽値。
fHasDlgVideoDisplayBOOL4+16+16ビデオ表示設定ダイアログを持つ場合にTRUEとなる真偽値。
fCaptureInitializedBOOL4+20+20キャプチャドライバが正常に初期化済みならTRUEとなる真偽値。
fDriverSuppliesPalettesBOOL4+24+24ドライバがパレットを提供できる場合にTRUEとなる真偽値。
hVideoInHANDLE8/4+32+28ビデオ入力チャネルのハンドル。未使用時はNULL。
hVideoOutHANDLE8/4+40+32ビデオ出力チャネルのハンドル。未使用時はNULL。
hVideoExtInHANDLE8/4+48+36外部ビデオ入力チャネルのハンドル。未使用時はNULL。
hVideoExtOutHANDLE8/4+56+40外部ビデオ出力チャネルのハンドル。未使用時はNULL。

各言語での定義

#include <windows.h>

// CAPDRIVERCAPS  (x64 64 / x86 44 バイト)
typedef struct CAPDRIVERCAPS {
    DWORD wDeviceIndex;
    BOOL fHasOverlay;
    BOOL fHasDlgVideoSource;
    BOOL fHasDlgVideoFormat;
    BOOL fHasDlgVideoDisplay;
    BOOL fCaptureInitialized;
    BOOL fDriverSuppliesPalettes;
    HANDLE hVideoIn;
    HANDLE hVideoOut;
    HANDLE hVideoExtIn;
    HANDLE hVideoExtOut;
} CAPDRIVERCAPS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CAPDRIVERCAPS
{
    public uint wDeviceIndex;
    [MarshalAs(UnmanagedType.Bool)] public bool fHasOverlay;
    [MarshalAs(UnmanagedType.Bool)] public bool fHasDlgVideoSource;
    [MarshalAs(UnmanagedType.Bool)] public bool fHasDlgVideoFormat;
    [MarshalAs(UnmanagedType.Bool)] public bool fHasDlgVideoDisplay;
    [MarshalAs(UnmanagedType.Bool)] public bool fCaptureInitialized;
    [MarshalAs(UnmanagedType.Bool)] public bool fDriverSuppliesPalettes;
    public IntPtr hVideoIn;
    public IntPtr hVideoOut;
    public IntPtr hVideoExtIn;
    public IntPtr hVideoExtOut;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CAPDRIVERCAPS
    Public wDeviceIndex As UInteger
    <MarshalAs(UnmanagedType.Bool)> Public fHasOverlay As Boolean
    <MarshalAs(UnmanagedType.Bool)> Public fHasDlgVideoSource As Boolean
    <MarshalAs(UnmanagedType.Bool)> Public fHasDlgVideoFormat As Boolean
    <MarshalAs(UnmanagedType.Bool)> Public fHasDlgVideoDisplay As Boolean
    <MarshalAs(UnmanagedType.Bool)> Public fCaptureInitialized As Boolean
    <MarshalAs(UnmanagedType.Bool)> Public fDriverSuppliesPalettes As Boolean
    Public hVideoIn As IntPtr
    Public hVideoOut As IntPtr
    Public hVideoExtIn As IntPtr
    Public hVideoExtOut As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class CAPDRIVERCAPS(ctypes.Structure):
    _fields_ = [
        ("wDeviceIndex", wintypes.DWORD),
        ("fHasOverlay", wintypes.BOOL),
        ("fHasDlgVideoSource", wintypes.BOOL),
        ("fHasDlgVideoFormat", wintypes.BOOL),
        ("fHasDlgVideoDisplay", wintypes.BOOL),
        ("fCaptureInitialized", wintypes.BOOL),
        ("fDriverSuppliesPalettes", wintypes.BOOL),
        ("hVideoIn", ctypes.c_void_p),
        ("hVideoOut", ctypes.c_void_p),
        ("hVideoExtIn", ctypes.c_void_p),
        ("hVideoExtOut", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct CAPDRIVERCAPS {
    pub wDeviceIndex: u32,
    pub fHasOverlay: i32,
    pub fHasDlgVideoSource: i32,
    pub fHasDlgVideoFormat: i32,
    pub fHasDlgVideoDisplay: i32,
    pub fCaptureInitialized: i32,
    pub fDriverSuppliesPalettes: i32,
    pub hVideoIn: *mut core::ffi::c_void,
    pub hVideoOut: *mut core::ffi::c_void,
    pub hVideoExtIn: *mut core::ffi::c_void,
    pub hVideoExtOut: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type CAPDRIVERCAPS struct {
	wDeviceIndex uint32
	fHasOverlay int32
	fHasDlgVideoSource int32
	fHasDlgVideoFormat int32
	fHasDlgVideoDisplay int32
	fCaptureInitialized int32
	fDriverSuppliesPalettes int32
	hVideoIn uintptr
	hVideoOut uintptr
	hVideoExtIn uintptr
	hVideoExtOut uintptr
}
type
  CAPDRIVERCAPS = record
    wDeviceIndex: DWORD;
    fHasOverlay: BOOL;
    fHasDlgVideoSource: BOOL;
    fHasDlgVideoFormat: BOOL;
    fHasDlgVideoDisplay: BOOL;
    fCaptureInitialized: BOOL;
    fDriverSuppliesPalettes: BOOL;
    hVideoIn: Pointer;
    hVideoOut: Pointer;
    hVideoExtIn: Pointer;
    hVideoExtOut: Pointer;
  end;
const CAPDRIVERCAPS = extern struct {
    wDeviceIndex: u32,
    fHasOverlay: i32,
    fHasDlgVideoSource: i32,
    fHasDlgVideoFormat: i32,
    fHasDlgVideoDisplay: i32,
    fCaptureInitialized: i32,
    fDriverSuppliesPalettes: i32,
    hVideoIn: ?*anyopaque,
    hVideoOut: ?*anyopaque,
    hVideoExtIn: ?*anyopaque,
    hVideoExtOut: ?*anyopaque,
};
type
  CAPDRIVERCAPS {.bycopy.} = object
    wDeviceIndex: uint32
    fHasOverlay: int32
    fHasDlgVideoSource: int32
    fHasDlgVideoFormat: int32
    fHasDlgVideoDisplay: int32
    fCaptureInitialized: int32
    fDriverSuppliesPalettes: int32
    hVideoIn: pointer
    hVideoOut: pointer
    hVideoExtIn: pointer
    hVideoExtOut: pointer
struct CAPDRIVERCAPS
{
    uint wDeviceIndex;
    int fHasOverlay;
    int fHasDlgVideoSource;
    int fHasDlgVideoFormat;
    int fHasDlgVideoDisplay;
    int fCaptureInitialized;
    int fDriverSuppliesPalettes;
    void* hVideoIn;
    void* hVideoOut;
    void* hVideoExtIn;
    void* hVideoExtOut;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; CAPDRIVERCAPS サイズ: 44 バイト(x86)
dim st, 11    ; 4byte整数×11(構造体サイズ 44 / 4 切り上げ)
; wDeviceIndex : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; fHasOverlay : BOOL (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; fHasDlgVideoSource : BOOL (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; fHasDlgVideoFormat : BOOL (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; fHasDlgVideoDisplay : BOOL (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; fCaptureInitialized : BOOL (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; fDriverSuppliesPalettes : BOOL (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; hVideoIn : HANDLE (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; hVideoOut : HANDLE (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; hVideoExtIn : HANDLE (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; hVideoExtOut : HANDLE (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CAPDRIVERCAPS サイズ: 64 バイト(x64)
dim st, 16    ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; wDeviceIndex : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; fHasOverlay : BOOL (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; fHasDlgVideoSource : BOOL (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; fHasDlgVideoFormat : BOOL (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; fHasDlgVideoDisplay : BOOL (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; fCaptureInitialized : BOOL (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; fDriverSuppliesPalettes : BOOL (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; hVideoIn : HANDLE (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; hVideoOut : HANDLE (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; hVideoExtIn : HANDLE (+48, 8byte)  qpoke st,48,値 / qpeek(st,48)  ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; hVideoExtOut : HANDLE (+56, 8byte)  qpoke st,56,値 / qpeek(st,56)  ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global CAPDRIVERCAPS
    #field int wDeviceIndex
    #field bool fHasOverlay
    #field bool fHasDlgVideoSource
    #field bool fHasDlgVideoFormat
    #field bool fHasDlgVideoDisplay
    #field bool fCaptureInitialized
    #field bool fDriverSuppliesPalettes
    #field intptr hVideoIn
    #field intptr hVideoOut
    #field intptr hVideoExtIn
    #field intptr hVideoExtOut
#endstruct

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