ホーム › Media.KernelStreaming › KS_FRAMING_RANGE_WEIGHTED
KS_FRAMING_RANGE_WEIGHTED
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Range | KS_FRAMING_RANGE | 12 | +0 | +0 | フレームサイズ範囲(KS_FRAMING_RANGE)。最小/最大/刻みを含む。 |
| InPlaceWeight | DWORD | 4 | +12 | +12 | インプレース変換時の重み付け値。処理コストの指標。 |
| NotInPlaceWeight | DWORD | 4 | +16 | +16 | 非インプレース変換時の重み付け値。バッファ複製コストの指標。 |
各言語での定義
#include <windows.h>
// KS_FRAMING_RANGE (x64 12 / x86 12 バイト)
typedef struct KS_FRAMING_RANGE {
DWORD MinFrameSize;
DWORD MaxFrameSize;
DWORD Stepping;
} KS_FRAMING_RANGE;
// KS_FRAMING_RANGE_WEIGHTED (x64 20 / x86 20 バイト)
typedef struct KS_FRAMING_RANGE_WEIGHTED {
KS_FRAMING_RANGE Range;
DWORD InPlaceWeight;
DWORD NotInPlaceWeight;
} KS_FRAMING_RANGE_WEIGHTED;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KS_FRAMING_RANGE
{
public uint MinFrameSize;
public uint MaxFrameSize;
public uint Stepping;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KS_FRAMING_RANGE_WEIGHTED
{
public KS_FRAMING_RANGE Range;
public uint InPlaceWeight;
public uint NotInPlaceWeight;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure KS_FRAMING_RANGE
Public MinFrameSize As UInteger
Public MaxFrameSize As UInteger
Public Stepping As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure KS_FRAMING_RANGE_WEIGHTED
Public Range As KS_FRAMING_RANGE
Public InPlaceWeight As UInteger
Public NotInPlaceWeight As UInteger
End Structureimport ctypes
from ctypes import wintypes
class KS_FRAMING_RANGE(ctypes.Structure):
_fields_ = [
("MinFrameSize", wintypes.DWORD),
("MaxFrameSize", wintypes.DWORD),
("Stepping", wintypes.DWORD),
]
class KS_FRAMING_RANGE_WEIGHTED(ctypes.Structure):
_fields_ = [
("Range", KS_FRAMING_RANGE),
("InPlaceWeight", wintypes.DWORD),
("NotInPlaceWeight", wintypes.DWORD),
]#[repr(C)]
pub struct KS_FRAMING_RANGE {
pub MinFrameSize: u32,
pub MaxFrameSize: u32,
pub Stepping: u32,
}
#[repr(C)]
pub struct KS_FRAMING_RANGE_WEIGHTED {
pub Range: KS_FRAMING_RANGE,
pub InPlaceWeight: u32,
pub NotInPlaceWeight: u32,
}import "golang.org/x/sys/windows"
type KS_FRAMING_RANGE struct {
MinFrameSize uint32
MaxFrameSize uint32
Stepping uint32
}
type KS_FRAMING_RANGE_WEIGHTED struct {
Range KS_FRAMING_RANGE
InPlaceWeight uint32
NotInPlaceWeight uint32
}type
KS_FRAMING_RANGE = record
MinFrameSize: DWORD;
MaxFrameSize: DWORD;
Stepping: DWORD;
end;
KS_FRAMING_RANGE_WEIGHTED = record
Range: KS_FRAMING_RANGE;
InPlaceWeight: DWORD;
NotInPlaceWeight: DWORD;
end;const KS_FRAMING_RANGE = extern struct {
MinFrameSize: u32,
MaxFrameSize: u32,
Stepping: u32,
};
const KS_FRAMING_RANGE_WEIGHTED = extern struct {
Range: KS_FRAMING_RANGE,
InPlaceWeight: u32,
NotInPlaceWeight: u32,
};type
KS_FRAMING_RANGE {.bycopy.} = object
MinFrameSize: uint32
MaxFrameSize: uint32
Stepping: uint32
KS_FRAMING_RANGE_WEIGHTED {.bycopy.} = object
Range: KS_FRAMING_RANGE
InPlaceWeight: uint32
NotInPlaceWeight: uint32struct KS_FRAMING_RANGE
{
uint MinFrameSize;
uint MaxFrameSize;
uint Stepping;
}
struct KS_FRAMING_RANGE_WEIGHTED
{
KS_FRAMING_RANGE Range;
uint InPlaceWeight;
uint NotInPlaceWeight;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; KS_FRAMING_RANGE_WEIGHTED サイズ: 20 バイト(x64)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; Range : KS_FRAMING_RANGE (+0, 12byte) varptr(st)+0 を基点に操作(12byte:入れ子/配列)
; InPlaceWeight : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; NotInPlaceWeight : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global KS_FRAMING_RANGE
#field int MinFrameSize
#field int MaxFrameSize
#field int Stepping
#endstruct
#defstruct global KS_FRAMING_RANGE_WEIGHTED
#field KS_FRAMING_RANGE Range
#field int InPlaceWeight
#field int NotInPlaceWeight
#endstruct
stdim st, KS_FRAMING_RANGE_WEIGHTED ; NSTRUCT 変数を確保
st->InPlaceWeight = 100
mes "InPlaceWeight=" + st->InPlaceWeight