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

KS_VIDEO_STREAM_CONFIG_CAPS

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

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

フィールド

フィールドサイズx64x86説明
guidGUID16+0+0対応するフォーマット種別を識別するGUIDである。
VideoStandardDWORD4+16+16サポートする映像規格を示すビットマスクである。
InputSizeSIZE8+20+20入力映像の標準サイズを示す。
MinCroppingSizeSIZE8+28+28切り出し可能な最小サイズを示す。
MaxCroppingSizeSIZE8+36+36切り出し可能な最大サイズを示す。
CropGranularityXINT4+44+44切り出し幅の刻み幅(水平)を示す。
CropGranularityYINT4+48+48切り出し高さの刻み幅(垂直)を示す。
CropAlignXINT4+52+52切り出し位置の水平アライメントを示す。
CropAlignYINT4+56+56切り出し位置の垂直アライメントを示す。
MinOutputSizeSIZE8+60+60出力可能な最小サイズを示す。
MaxOutputSizeSIZE8+68+68出力可能な最大サイズを示す。
OutputGranularityXINT4+76+76出力幅の刻み幅(水平)を示す。
OutputGranularityYINT4+80+80出力高さの刻み幅(垂直)を示す。
StretchTapsXINT4+84+84水平拡大時のタップ数を示す。
StretchTapsYINT4+88+88垂直拡大時のタップ数を示す。
ShrinkTapsXINT4+92+92水平縮小時のタップ数を示す。
ShrinkTapsYINT4+96+96垂直縮小時のタップ数を示す。
MinFrameIntervalLONGLONG8+104+104最小フレーム間隔を100ナノ秒単位で示す。
MaxFrameIntervalLONGLONG8+112+112最大フレーム間隔を100ナノ秒単位で示す。
MinBitsPerSecondINT4+120+120サポートする最小ビットレートをビット/秒で示す。
MaxBitsPerSecondINT4+124+124サポートする最大ビットレートをビット/秒で示す。

各言語での定義

#include <windows.h>

// SIZE  (x64 8 / x86 8 バイト)
typedef struct SIZE {
    INT cx;
    INT cy;
} SIZE;

// KS_VIDEO_STREAM_CONFIG_CAPS  (x64 128 / x86 128 バイト)
typedef struct KS_VIDEO_STREAM_CONFIG_CAPS {
    GUID guid;
    DWORD VideoStandard;
    SIZE InputSize;
    SIZE MinCroppingSize;
    SIZE MaxCroppingSize;
    INT CropGranularityX;
    INT CropGranularityY;
    INT CropAlignX;
    INT CropAlignY;
    SIZE MinOutputSize;
    SIZE MaxOutputSize;
    INT OutputGranularityX;
    INT OutputGranularityY;
    INT StretchTapsX;
    INT StretchTapsY;
    INT ShrinkTapsX;
    INT ShrinkTapsY;
    LONGLONG MinFrameInterval;
    LONGLONG MaxFrameInterval;
    INT MinBitsPerSecond;
    INT MaxBitsPerSecond;
} KS_VIDEO_STREAM_CONFIG_CAPS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SIZE
{
    public int cx;
    public int cy;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KS_VIDEO_STREAM_CONFIG_CAPS
{
    public Guid guid;
    public uint VideoStandard;
    public SIZE InputSize;
    public SIZE MinCroppingSize;
    public SIZE MaxCroppingSize;
    public int CropGranularityX;
    public int CropGranularityY;
    public int CropAlignX;
    public int CropAlignY;
    public SIZE MinOutputSize;
    public SIZE MaxOutputSize;
    public int OutputGranularityX;
    public int OutputGranularityY;
    public int StretchTapsX;
    public int StretchTapsY;
    public int ShrinkTapsX;
    public int ShrinkTapsY;
    public long MinFrameInterval;
    public long MaxFrameInterval;
    public int MinBitsPerSecond;
    public int MaxBitsPerSecond;
}
Imports System.Runtime.InteropServices

<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 KS_VIDEO_STREAM_CONFIG_CAPS
    Public guid As Guid
    Public VideoStandard As UInteger
    Public InputSize As SIZE
    Public MinCroppingSize As SIZE
    Public MaxCroppingSize As SIZE
    Public CropGranularityX As Integer
    Public CropGranularityY As Integer
    Public CropAlignX As Integer
    Public CropAlignY As Integer
    Public MinOutputSize As SIZE
    Public MaxOutputSize As SIZE
    Public OutputGranularityX As Integer
    Public OutputGranularityY As Integer
    Public StretchTapsX As Integer
    Public StretchTapsY As Integer
    Public ShrinkTapsX As Integer
    Public ShrinkTapsY As Integer
    Public MinFrameInterval As Long
    Public MaxFrameInterval As Long
    Public MinBitsPerSecond As Integer
    Public MaxBitsPerSecond As Integer
End Structure
import ctypes
from ctypes import wintypes

class SIZE(ctypes.Structure):
    _fields_ = [
        ("cx", ctypes.c_int),
        ("cy", ctypes.c_int),
    ]

class KS_VIDEO_STREAM_CONFIG_CAPS(ctypes.Structure):
    _fields_ = [
        ("guid", GUID),
        ("VideoStandard", wintypes.DWORD),
        ("InputSize", SIZE),
        ("MinCroppingSize", SIZE),
        ("MaxCroppingSize", SIZE),
        ("CropGranularityX", ctypes.c_int),
        ("CropGranularityY", ctypes.c_int),
        ("CropAlignX", ctypes.c_int),
        ("CropAlignY", ctypes.c_int),
        ("MinOutputSize", SIZE),
        ("MaxOutputSize", SIZE),
        ("OutputGranularityX", ctypes.c_int),
        ("OutputGranularityY", ctypes.c_int),
        ("StretchTapsX", ctypes.c_int),
        ("StretchTapsY", ctypes.c_int),
        ("ShrinkTapsX", ctypes.c_int),
        ("ShrinkTapsY", ctypes.c_int),
        ("MinFrameInterval", ctypes.c_longlong),
        ("MaxFrameInterval", ctypes.c_longlong),
        ("MinBitsPerSecond", ctypes.c_int),
        ("MaxBitsPerSecond", ctypes.c_int),
    ]
#[repr(C)]
pub struct SIZE {
    pub cx: i32,
    pub cy: i32,
}

#[repr(C)]
pub struct KS_VIDEO_STREAM_CONFIG_CAPS {
    pub guid: GUID,
    pub VideoStandard: u32,
    pub InputSize: SIZE,
    pub MinCroppingSize: SIZE,
    pub MaxCroppingSize: SIZE,
    pub CropGranularityX: i32,
    pub CropGranularityY: i32,
    pub CropAlignX: i32,
    pub CropAlignY: i32,
    pub MinOutputSize: SIZE,
    pub MaxOutputSize: SIZE,
    pub OutputGranularityX: i32,
    pub OutputGranularityY: i32,
    pub StretchTapsX: i32,
    pub StretchTapsY: i32,
    pub ShrinkTapsX: i32,
    pub ShrinkTapsY: i32,
    pub MinFrameInterval: i64,
    pub MaxFrameInterval: i64,
    pub MinBitsPerSecond: i32,
    pub MaxBitsPerSecond: i32,
}
import "golang.org/x/sys/windows"

type SIZE struct {
	cx int32
	cy int32
}

type KS_VIDEO_STREAM_CONFIG_CAPS struct {
	guid windows.GUID
	VideoStandard uint32
	InputSize SIZE
	MinCroppingSize SIZE
	MaxCroppingSize SIZE
	CropGranularityX int32
	CropGranularityY int32
	CropAlignX int32
	CropAlignY int32
	MinOutputSize SIZE
	MaxOutputSize SIZE
	OutputGranularityX int32
	OutputGranularityY int32
	StretchTapsX int32
	StretchTapsY int32
	ShrinkTapsX int32
	ShrinkTapsY int32
	MinFrameInterval int64
	MaxFrameInterval int64
	MinBitsPerSecond int32
	MaxBitsPerSecond int32
}
type
  SIZE = record
    cx: Integer;
    cy: Integer;
  end;

  KS_VIDEO_STREAM_CONFIG_CAPS = record
    guid: TGUID;
    VideoStandard: DWORD;
    InputSize: SIZE;
    MinCroppingSize: SIZE;
    MaxCroppingSize: SIZE;
    CropGranularityX: Integer;
    CropGranularityY: Integer;
    CropAlignX: Integer;
    CropAlignY: Integer;
    MinOutputSize: SIZE;
    MaxOutputSize: SIZE;
    OutputGranularityX: Integer;
    OutputGranularityY: Integer;
    StretchTapsX: Integer;
    StretchTapsY: Integer;
    ShrinkTapsX: Integer;
    ShrinkTapsY: Integer;
    MinFrameInterval: Int64;
    MaxFrameInterval: Int64;
    MinBitsPerSecond: Integer;
    MaxBitsPerSecond: Integer;
  end;
const SIZE = extern struct {
    cx: i32,
    cy: i32,
};

const KS_VIDEO_STREAM_CONFIG_CAPS = extern struct {
    guid: GUID,
    VideoStandard: u32,
    InputSize: SIZE,
    MinCroppingSize: SIZE,
    MaxCroppingSize: SIZE,
    CropGranularityX: i32,
    CropGranularityY: i32,
    CropAlignX: i32,
    CropAlignY: i32,
    MinOutputSize: SIZE,
    MaxOutputSize: SIZE,
    OutputGranularityX: i32,
    OutputGranularityY: i32,
    StretchTapsX: i32,
    StretchTapsY: i32,
    ShrinkTapsX: i32,
    ShrinkTapsY: i32,
    MinFrameInterval: i64,
    MaxFrameInterval: i64,
    MinBitsPerSecond: i32,
    MaxBitsPerSecond: i32,
};
type
  SIZE {.bycopy.} = object
    cx: int32
    cy: int32

  KS_VIDEO_STREAM_CONFIG_CAPS {.bycopy.} = object
    guid: GUID
    VideoStandard: uint32
    InputSize: SIZE
    MinCroppingSize: SIZE
    MaxCroppingSize: SIZE
    CropGranularityX: int32
    CropGranularityY: int32
    CropAlignX: int32
    CropAlignY: int32
    MinOutputSize: SIZE
    MaxOutputSize: SIZE
    OutputGranularityX: int32
    OutputGranularityY: int32
    StretchTapsX: int32
    StretchTapsY: int32
    ShrinkTapsX: int32
    ShrinkTapsY: int32
    MinFrameInterval: int64
    MaxFrameInterval: int64
    MinBitsPerSecond: int32
    MaxBitsPerSecond: int32
struct SIZE
{
    int cx;
    int cy;
}

struct KS_VIDEO_STREAM_CONFIG_CAPS
{
    GUID guid;
    uint VideoStandard;
    SIZE InputSize;
    SIZE MinCroppingSize;
    SIZE MaxCroppingSize;
    int CropGranularityX;
    int CropGranularityY;
    int CropAlignX;
    int CropAlignY;
    SIZE MinOutputSize;
    SIZE MaxOutputSize;
    int OutputGranularityX;
    int OutputGranularityY;
    int StretchTapsX;
    int StretchTapsY;
    int ShrinkTapsX;
    int ShrinkTapsY;
    long MinFrameInterval;
    long MaxFrameInterval;
    int MinBitsPerSecond;
    int MaxBitsPerSecond;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; KS_VIDEO_STREAM_CONFIG_CAPS サイズ: 128 バイト(x64)
dim st, 32    ; 4byte整数×32(構造体サイズ 128 / 4 切り上げ)
; guid : GUID (+0, 16byte)  varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; VideoStandard : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; InputSize : SIZE (+20, 8byte)  varptr(st)+20 を基点に操作(8byte:入れ子/配列)
; MinCroppingSize : SIZE (+28, 8byte)  varptr(st)+28 を基点に操作(8byte:入れ子/配列)
; MaxCroppingSize : SIZE (+36, 8byte)  varptr(st)+36 を基点に操作(8byte:入れ子/配列)
; CropGranularityX : INT (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; CropGranularityY : INT (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; CropAlignX : INT (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; CropAlignY : INT (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; MinOutputSize : SIZE (+60, 8byte)  varptr(st)+60 を基点に操作(8byte:入れ子/配列)
; MaxOutputSize : SIZE (+68, 8byte)  varptr(st)+68 を基点に操作(8byte:入れ子/配列)
; OutputGranularityX : INT (+76, 4byte)  st.19 = 値  /  値 = st.19   (lpoke/lpeek も可)
; OutputGranularityY : INT (+80, 4byte)  st.20 = 値  /  値 = st.20   (lpoke/lpeek も可)
; StretchTapsX : INT (+84, 4byte)  st.21 = 値  /  値 = st.21   (lpoke/lpeek も可)
; StretchTapsY : INT (+88, 4byte)  st.22 = 値  /  値 = st.22   (lpoke/lpeek も可)
; ShrinkTapsX : INT (+92, 4byte)  st.23 = 値  /  値 = st.23   (lpoke/lpeek も可)
; ShrinkTapsY : INT (+96, 4byte)  st.24 = 値  /  値 = st.24   (lpoke/lpeek も可)
; MinFrameInterval : LONGLONG (+104, 8byte)  qpoke st,104,値 / qpeek(st,104)  ※IronHSPのみ。3.7/3.8は lpoke st,104,下位 : lpoke st,108,上位
; MaxFrameInterval : LONGLONG (+112, 8byte)  qpoke st,112,値 / qpeek(st,112)  ※IronHSPのみ。3.7/3.8は lpoke st,112,下位 : lpoke st,116,上位
; MinBitsPerSecond : INT (+120, 4byte)  st.30 = 値  /  値 = st.30   (lpoke/lpeek も可)
; MaxBitsPerSecond : INT (+124, 4byte)  st.31 = 値  /  値 = st.31   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
    #field int Data1
    #field short Data2
    #field short Data3
    #field byte Data4 8
#endstruct

#defstruct global SIZE
    #field int cx
    #field int cy
#endstruct

#defstruct global KS_VIDEO_STREAM_CONFIG_CAPS
    #field GUID guid
    #field int VideoStandard
    #field SIZE InputSize
    #field SIZE MinCroppingSize
    #field SIZE MaxCroppingSize
    #field int CropGranularityX
    #field int CropGranularityY
    #field int CropAlignX
    #field int CropAlignY
    #field SIZE MinOutputSize
    #field SIZE MaxOutputSize
    #field int OutputGranularityX
    #field int OutputGranularityY
    #field int StretchTapsX
    #field int StretchTapsY
    #field int ShrinkTapsX
    #field int ShrinkTapsY
    #field int64 MinFrameInterval
    #field int64 MaxFrameInterval
    #field int MinBitsPerSecond
    #field int MaxBitsPerSecond
#endstruct

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