ホーム › Media.MediaFoundation › DXVA_VideoSample2
DXVA_VideoSample2
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| rtStart | LONGLONG | 8 | +0 | +0 | サンプルの表示開始時刻(100ナノ秒単位)を示す。 |
| rtEnd | LONGLONG | 8 | +8 | +8 | サンプルの表示終了時刻(100ナノ秒単位)を示す。 |
| SampleFormat | DWORD | 4 | +16 | +16 | サンプルのフォーマット情報(インターレース種別等)を示す。 |
| SampleFlags | DWORD | 4 | +20 | +20 | サンプルの付加属性を示すフラグである。 |
| lpDDSSrcSurface | void* | 8/4 | +24 | +24 | 入力ソースとなるDirectDrawサーフェスへのポインタである。 |
| rcSrc | RECT | 16 | +32 | +28 | ソースサーフェス上で処理対象とする矩形領域である。 |
| rcDst | RECT | 16 | +48 | +44 | 出力先での配置矩形領域である。 |
| Palette | DXVA_AYUVsample2 | 64 | +64 | +60 | サブピクチャ等に用いるAYUVパレット情報である。 |
各言語での定義
#include <windows.h>
// RECT (x64 16 / x86 16 バイト)
typedef struct RECT {
INT left;
INT top;
INT right;
INT bottom;
} RECT;
// DXVA_AYUVsample2 (x64 4 / x86 4 バイト)
typedef struct DXVA_AYUVsample2 {
BYTE bCrValue;
BYTE bCbValue;
BYTE bY_Value;
BYTE bSampleAlpha8;
} DXVA_AYUVsample2;
// DXVA_VideoSample2 (x64 128 / x86 128 バイト)
typedef struct DXVA_VideoSample2 {
LONGLONG rtStart;
LONGLONG rtEnd;
DWORD SampleFormat;
DWORD SampleFlags;
void* lpDDSSrcSurface;
RECT rcSrc;
RECT rcDst;
DXVA_AYUVsample2 Palette[16];
} DXVA_VideoSample2;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RECT
{
public int left;
public int top;
public int right;
public int bottom;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXVA_AYUVsample2
{
public byte bCrValue;
public byte bCbValue;
public byte bY_Value;
public byte bSampleAlpha8;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXVA_VideoSample2
{
public long rtStart;
public long rtEnd;
public uint SampleFormat;
public uint SampleFlags;
public IntPtr lpDDSSrcSurface;
public RECT rcSrc;
public RECT rcDst;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public DXVA_AYUVsample2[] Palette;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RECT
Public left As Integer
Public top As Integer
Public right As Integer
Public bottom As Integer
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXVA_AYUVsample2
Public bCrValue As Byte
Public bCbValue As Byte
Public bY_Value As Byte
Public bSampleAlpha8 As Byte
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXVA_VideoSample2
Public rtStart As Long
Public rtEnd As Long
Public SampleFormat As UInteger
Public SampleFlags As UInteger
Public lpDDSSrcSurface As IntPtr
Public rcSrc As RECT
Public rcDst As RECT
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public Palette() As DXVA_AYUVsample2
End Structureimport ctypes
from ctypes import wintypes
class RECT(ctypes.Structure):
_fields_ = [
("left", ctypes.c_int),
("top", ctypes.c_int),
("right", ctypes.c_int),
("bottom", ctypes.c_int),
]
class DXVA_AYUVsample2(ctypes.Structure):
_fields_ = [
("bCrValue", ctypes.c_ubyte),
("bCbValue", ctypes.c_ubyte),
("bY_Value", ctypes.c_ubyte),
("bSampleAlpha8", ctypes.c_ubyte),
]
class DXVA_VideoSample2(ctypes.Structure):
_fields_ = [
("rtStart", ctypes.c_longlong),
("rtEnd", ctypes.c_longlong),
("SampleFormat", wintypes.DWORD),
("SampleFlags", wintypes.DWORD),
("lpDDSSrcSurface", ctypes.c_void_p),
("rcSrc", RECT),
("rcDst", RECT),
("Palette", DXVA_AYUVsample2 * 16),
]#[repr(C)]
pub struct RECT {
pub left: i32,
pub top: i32,
pub right: i32,
pub bottom: i32,
}
#[repr(C)]
pub struct DXVA_AYUVsample2 {
pub bCrValue: u8,
pub bCbValue: u8,
pub bY_Value: u8,
pub bSampleAlpha8: u8,
}
#[repr(C)]
pub struct DXVA_VideoSample2 {
pub rtStart: i64,
pub rtEnd: i64,
pub SampleFormat: u32,
pub SampleFlags: u32,
pub lpDDSSrcSurface: *mut core::ffi::c_void,
pub rcSrc: RECT,
pub rcDst: RECT,
pub Palette: [DXVA_AYUVsample2; 16],
}import "golang.org/x/sys/windows"
type RECT struct {
left int32
top int32
right int32
bottom int32
}
type DXVA_AYUVsample2 struct {
bCrValue byte
bCbValue byte
bY_Value byte
bSampleAlpha8 byte
}
type DXVA_VideoSample2 struct {
rtStart int64
rtEnd int64
SampleFormat uint32
SampleFlags uint32
lpDDSSrcSurface uintptr
rcSrc RECT
rcDst RECT
Palette [16]DXVA_AYUVsample2
}type
RECT = record
left: Integer;
top: Integer;
right: Integer;
bottom: Integer;
end;
DXVA_AYUVsample2 = record
bCrValue: Byte;
bCbValue: Byte;
bY_Value: Byte;
bSampleAlpha8: Byte;
end;
DXVA_VideoSample2 = record
rtStart: Int64;
rtEnd: Int64;
SampleFormat: DWORD;
SampleFlags: DWORD;
lpDDSSrcSurface: Pointer;
rcSrc: RECT;
rcDst: RECT;
Palette: array[0..15] of DXVA_AYUVsample2;
end;const RECT = extern struct {
left: i32,
top: i32,
right: i32,
bottom: i32,
};
const DXVA_AYUVsample2 = extern struct {
bCrValue: u8,
bCbValue: u8,
bY_Value: u8,
bSampleAlpha8: u8,
};
const DXVA_VideoSample2 = extern struct {
rtStart: i64,
rtEnd: i64,
SampleFormat: u32,
SampleFlags: u32,
lpDDSSrcSurface: ?*anyopaque,
rcSrc: RECT,
rcDst: RECT,
Palette: [16]DXVA_AYUVsample2,
};type
RECT {.bycopy.} = object
left: int32
top: int32
right: int32
bottom: int32
DXVA_AYUVsample2 {.bycopy.} = object
bCrValue: uint8
bCbValue: uint8
bY_Value: uint8
bSampleAlpha8: uint8
DXVA_VideoSample2 {.bycopy.} = object
rtStart: int64
rtEnd: int64
SampleFormat: uint32
SampleFlags: uint32
lpDDSSrcSurface: pointer
rcSrc: RECT
rcDst: RECT
Palette: array[16, DXVA_AYUVsample2]struct RECT
{
int left;
int top;
int right;
int bottom;
}
struct DXVA_AYUVsample2
{
ubyte bCrValue;
ubyte bCbValue;
ubyte bY_Value;
ubyte bSampleAlpha8;
}
struct DXVA_VideoSample2
{
long rtStart;
long rtEnd;
uint SampleFormat;
uint SampleFlags;
void* lpDDSSrcSurface;
RECT rcSrc;
RECT rcDst;
DXVA_AYUVsample2[16] Palette;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DXVA_VideoSample2 サイズ: 128 バイト(x86)
dim st, 32 ; 4byte整数×32(構造体サイズ 128 / 4 切り上げ)
; rtStart : LONGLONG (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; rtEnd : LONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; SampleFormat : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; SampleFlags : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; lpDDSSrcSurface : void* (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; rcSrc : RECT (+28, 16byte) varptr(st)+28 を基点に操作(16byte:入れ子/配列)
; rcDst : RECT (+44, 16byte) varptr(st)+44 を基点に操作(16byte:入れ子/配列)
; Palette : DXVA_AYUVsample2 (+60, 64byte) varptr(st)+60 を基点に操作(64byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DXVA_VideoSample2 サイズ: 128 バイト(x64)
dim st, 32 ; 4byte整数×32(構造体サイズ 128 / 4 切り上げ)
; rtStart : LONGLONG (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; rtEnd : LONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; SampleFormat : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; SampleFlags : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; lpDDSSrcSurface : void* (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; rcSrc : RECT (+32, 16byte) varptr(st)+32 を基点に操作(16byte:入れ子/配列)
; rcDst : RECT (+48, 16byte) varptr(st)+48 を基点に操作(16byte:入れ子/配列)
; Palette : DXVA_AYUVsample2 (+64, 64byte) varptr(st)+64 を基点に操作(64byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global RECT
#field int left
#field int top
#field int right
#field int bottom
#endstruct
#defstruct global DXVA_AYUVsample2
#field byte bCrValue
#field byte bCbValue
#field byte bY_Value
#field byte bSampleAlpha8
#endstruct
#defstruct global DXVA_VideoSample2
#field int64 rtStart
#field int64 rtEnd
#field int SampleFormat
#field int SampleFlags
#field intptr lpDDSSrcSurface
#field RECT rcSrc
#field RECT rcDst
#field DXVA_AYUVsample2 Palette 16
#endstruct
stdim st, DXVA_VideoSample2 ; NSTRUCT 変数を確保
st->rtStart = 100
mes "rtStart=" + st->rtStart