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

InputQPSettings

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

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

フィールド

フィールドサイズx64x86説明
minBlockSizeDWORD4+0+0QPマップ対象ブロックの最小サイズ。
maxBlockSizeDWORD4+4+4QPマップ対象ブロックの最大サイズ。
stepsBlockSizeDWORD4+8+8ブロックサイズの刻み幅。
dataTypeeAVEncVideoQPMapElementDataType4+12+12QPマップ要素のデータ型を示すeAVEncVideoQPMapElementDataType列挙値。
minValueSHORT2+16+16QP値の最小値。
maxValueSHORT2+18+18QP値の最大値。
stepWORD2+20+20QP値の刻み幅。

各言語での定義

#include <windows.h>

// InputQPSettings  (x64 24 / x86 24 バイト)
typedef struct InputQPSettings {
    DWORD minBlockSize;
    DWORD maxBlockSize;
    DWORD stepsBlockSize;
    eAVEncVideoQPMapElementDataType dataType;
    SHORT minValue;
    SHORT maxValue;
    WORD step;
} InputQPSettings;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct InputQPSettings
{
    public uint minBlockSize;
    public uint maxBlockSize;
    public uint stepsBlockSize;
    public int dataType;
    public short minValue;
    public short maxValue;
    public ushort step;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure InputQPSettings
    Public minBlockSize As UInteger
    Public maxBlockSize As UInteger
    Public stepsBlockSize As UInteger
    Public dataType As Integer
    Public minValue As Short
    Public maxValue As Short
    Public step As UShort
End Structure
import ctypes
from ctypes import wintypes

class InputQPSettings(ctypes.Structure):
    _fields_ = [
        ("minBlockSize", wintypes.DWORD),
        ("maxBlockSize", wintypes.DWORD),
        ("stepsBlockSize", wintypes.DWORD),
        ("dataType", ctypes.c_int),
        ("minValue", ctypes.c_short),
        ("maxValue", ctypes.c_short),
        ("step", ctypes.c_ushort),
    ]
#[repr(C)]
pub struct InputQPSettings {
    pub minBlockSize: u32,
    pub maxBlockSize: u32,
    pub stepsBlockSize: u32,
    pub dataType: i32,
    pub minValue: i16,
    pub maxValue: i16,
    pub step: u16,
}
import "golang.org/x/sys/windows"

type InputQPSettings struct {
	minBlockSize uint32
	maxBlockSize uint32
	stepsBlockSize uint32
	dataType int32
	minValue int16
	maxValue int16
	step uint16
}
type
  InputQPSettings = record
    minBlockSize: DWORD;
    maxBlockSize: DWORD;
    stepsBlockSize: DWORD;
    dataType: Integer;
    minValue: Smallint;
    maxValue: Smallint;
    step: Word;
  end;
const InputQPSettings = extern struct {
    minBlockSize: u32,
    maxBlockSize: u32,
    stepsBlockSize: u32,
    dataType: i32,
    minValue: i16,
    maxValue: i16,
    step: u16,
};
type
  InputQPSettings {.bycopy.} = object
    minBlockSize: uint32
    maxBlockSize: uint32
    stepsBlockSize: uint32
    dataType: int32
    minValue: int16
    maxValue: int16
    step: uint16
struct InputQPSettings
{
    uint minBlockSize;
    uint maxBlockSize;
    uint stepsBlockSize;
    int dataType;
    short minValue;
    short maxValue;
    ushort step;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; InputQPSettings サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; minBlockSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; maxBlockSize : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; stepsBlockSize : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dataType : eAVEncVideoQPMapElementDataType (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; minValue : SHORT (+16, 2byte)  wpoke st,16,値  /  値 = wpeek(st,16)
; maxValue : SHORT (+18, 2byte)  wpoke st,18,値  /  値 = wpeek(st,18)
; step : WORD (+20, 2byte)  wpoke st,20,値  /  値 = wpeek(st,20)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global InputQPSettings
    #field int minBlockSize
    #field int maxBlockSize
    #field int stepsBlockSize
    #field int dataType
    #field short minValue
    #field short maxValue
    #field short step
#endstruct

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