ホーム › Media.KernelStreaming › KSPROPERTY_TIMECODE_S
KSPROPERTY_TIMECODE_S
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Property | KSIDENTIFIER | 8 | +0 | +0 | 対象プロパティを識別するKSIDENTIFIER。プロパティセットGUID・ID・フラグを保持する。 |
| TimecodeSamp | TIMECODE_SAMPLE | 24 | +8 | +8 | タイムコードのサンプル値を保持するTIMECODE_SAMPLE。 |
各言語での定義
#include <windows.h>
// KSIDENTIFIER (x64 8 / x86 8 バイト)
typedef struct KSIDENTIFIER {
_Anonymous_e__Union Anonymous;
} KSIDENTIFIER;
// TIMECODE (x64 8 / x86 8 バイト)
typedef struct TIMECODE {
_Anonymous_e__Struct Anonymous;
ULONGLONG qw;
} TIMECODE;
// TIMECODE_SAMPLE (x64 24 / x86 24 バイト)
typedef struct TIMECODE_SAMPLE {
LONGLONG qwTick;
TIMECODE timecode;
DWORD dwUser;
TIMECODE_SAMPLE_FLAGS dwFlags;
} TIMECODE_SAMPLE;
// KSPROPERTY_TIMECODE_S (x64 32 / x86 32 バイト)
typedef struct KSPROPERTY_TIMECODE_S {
KSIDENTIFIER Property;
TIMECODE_SAMPLE TimecodeSamp;
} KSPROPERTY_TIMECODE_S;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KSIDENTIFIER
{
public _Anonymous_e__Union Anonymous;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TIMECODE
{
public _Anonymous_e__Struct Anonymous;
public ulong qw;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TIMECODE_SAMPLE
{
public long qwTick;
public TIMECODE timecode;
public uint dwUser;
public uint dwFlags;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KSPROPERTY_TIMECODE_S
{
public KSIDENTIFIER Property;
public TIMECODE_SAMPLE TimecodeSamp;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure KSIDENTIFIER
Public Anonymous As _Anonymous_e__Union
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure TIMECODE
Public Anonymous As _Anonymous_e__Struct
Public qw As ULong
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure TIMECODE_SAMPLE
Public qwTick As Long
Public timecode As TIMECODE
Public dwUser As UInteger
Public dwFlags As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure KSPROPERTY_TIMECODE_S
Public Property As KSIDENTIFIER
Public TimecodeSamp As TIMECODE_SAMPLE
End Structureimport ctypes
from ctypes import wintypes
class KSIDENTIFIER(ctypes.Structure):
_fields_ = [
("Anonymous", _Anonymous_e__Union),
]
class TIMECODE(ctypes.Structure):
_fields_ = [
("Anonymous", _Anonymous_e__Struct),
("qw", ctypes.c_ulonglong),
]
class TIMECODE_SAMPLE(ctypes.Structure):
_fields_ = [
("qwTick", ctypes.c_longlong),
("timecode", TIMECODE),
("dwUser", wintypes.DWORD),
("dwFlags", wintypes.DWORD),
]
class KSPROPERTY_TIMECODE_S(ctypes.Structure):
_fields_ = [
("Property", KSIDENTIFIER),
("TimecodeSamp", TIMECODE_SAMPLE),
]#[repr(C)]
pub struct KSIDENTIFIER {
pub Anonymous: _Anonymous_e__Union,
}
#[repr(C)]
pub struct TIMECODE {
pub Anonymous: _Anonymous_e__Struct,
pub qw: u64,
}
#[repr(C)]
pub struct TIMECODE_SAMPLE {
pub qwTick: i64,
pub timecode: TIMECODE,
pub dwUser: u32,
pub dwFlags: u32,
}
#[repr(C)]
pub struct KSPROPERTY_TIMECODE_S {
pub Property: KSIDENTIFIER,
pub TimecodeSamp: TIMECODE_SAMPLE,
}import "golang.org/x/sys/windows"
type KSIDENTIFIER struct {
Anonymous _Anonymous_e__Union
}
type TIMECODE struct {
Anonymous _Anonymous_e__Struct
qw uint64
}
type TIMECODE_SAMPLE struct {
qwTick int64
timecode TIMECODE
dwUser uint32
dwFlags uint32
}
type KSPROPERTY_TIMECODE_S struct {
Property KSIDENTIFIER
TimecodeSamp TIMECODE_SAMPLE
}type
KSIDENTIFIER = record
Anonymous: _Anonymous_e__Union;
end;
TIMECODE = record
Anonymous: _Anonymous_e__Struct;
qw: UInt64;
end;
TIMECODE_SAMPLE = record
qwTick: Int64;
timecode: TIMECODE;
dwUser: DWORD;
dwFlags: DWORD;
end;
KSPROPERTY_TIMECODE_S = record
Property: KSIDENTIFIER;
TimecodeSamp: TIMECODE_SAMPLE;
end;const KSIDENTIFIER = extern struct {
Anonymous: _Anonymous_e__Union,
};
const TIMECODE = extern struct {
Anonymous: _Anonymous_e__Struct,
qw: u64,
};
const TIMECODE_SAMPLE = extern struct {
qwTick: i64,
timecode: TIMECODE,
dwUser: u32,
dwFlags: u32,
};
const KSPROPERTY_TIMECODE_S = extern struct {
Property: KSIDENTIFIER,
TimecodeSamp: TIMECODE_SAMPLE,
};type
KSIDENTIFIER {.bycopy.} = object
Anonymous: _Anonymous_e__Union
TIMECODE {.bycopy.} = object
Anonymous: _Anonymous_e__Struct
qw: uint64
TIMECODE_SAMPLE {.bycopy.} = object
qwTick: int64
timecode: TIMECODE
dwUser: uint32
dwFlags: uint32
KSPROPERTY_TIMECODE_S {.bycopy.} = object
Property: KSIDENTIFIER
TimecodeSamp: TIMECODE_SAMPLEstruct KSIDENTIFIER
{
_Anonymous_e__Union Anonymous;
}
struct TIMECODE
{
_Anonymous_e__Struct Anonymous;
ulong qw;
}
struct TIMECODE_SAMPLE
{
long qwTick;
TIMECODE timecode;
uint dwUser;
uint dwFlags;
}
struct KSPROPERTY_TIMECODE_S
{
KSIDENTIFIER Property;
TIMECODE_SAMPLE TimecodeSamp;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; KSPROPERTY_TIMECODE_S サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; Property : KSIDENTIFIER (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; TimecodeSamp : TIMECODE_SAMPLE (+8, 24byte) varptr(st)+8 を基点に操作(24byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global KSIDENTIFIER
#field byte Anonymous 8
#endstruct
#defstruct global TIMECODE_SAMPLE
#field int64 qwTick
#field byte timecode 8
#field int dwUser
#field int dwFlags
#endstruct
#defstruct global KSPROPERTY_TIMECODE_S
#field KSIDENTIFIER Property
#field TIMECODE_SAMPLE TimecodeSamp
#endstruct
stdim st, KSPROPERTY_TIMECODE_S ; NSTRUCT 変数を確保