ホーム › Media.MediaFoundation › DXVAHD_CUSTOM_RATE_DATA
DXVAHD_CUSTOM_RATE_DATA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| CustomRate | DXVAHD_RATIONAL | 8 | +0 | +0 | カスタム出力レートを有理数で示す。 |
| OutputFrames | DWORD | 4 | +8 | +8 | InputFramesOrFieldsに対して出力されるフレーム数を示す。 |
| InputInterlaced | BOOL | 4 | +12 | +12 | 入力がインターレースか否かを示す。TRUEでインターレース。 |
| InputFramesOrFields | DWORD | 4 | +16 | +16 | 入力フレーム数またはフィールド数を示す。 |
各言語での定義
#include <windows.h>
// DXVAHD_RATIONAL (x64 8 / x86 8 バイト)
typedef struct DXVAHD_RATIONAL {
DWORD Numerator;
DWORD Denominator;
} DXVAHD_RATIONAL;
// DXVAHD_CUSTOM_RATE_DATA (x64 20 / x86 20 バイト)
typedef struct DXVAHD_CUSTOM_RATE_DATA {
DXVAHD_RATIONAL CustomRate;
DWORD OutputFrames;
BOOL InputInterlaced;
DWORD InputFramesOrFields;
} DXVAHD_CUSTOM_RATE_DATA;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXVAHD_RATIONAL
{
public uint Numerator;
public uint Denominator;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXVAHD_CUSTOM_RATE_DATA
{
public DXVAHD_RATIONAL CustomRate;
public uint OutputFrames;
[MarshalAs(UnmanagedType.Bool)] public bool InputInterlaced;
public uint InputFramesOrFields;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXVAHD_RATIONAL
Public Numerator As UInteger
Public Denominator As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXVAHD_CUSTOM_RATE_DATA
Public CustomRate As DXVAHD_RATIONAL
Public OutputFrames As UInteger
<MarshalAs(UnmanagedType.Bool)> Public InputInterlaced As Boolean
Public InputFramesOrFields As UInteger
End Structureimport ctypes
from ctypes import wintypes
class DXVAHD_RATIONAL(ctypes.Structure):
_fields_ = [
("Numerator", wintypes.DWORD),
("Denominator", wintypes.DWORD),
]
class DXVAHD_CUSTOM_RATE_DATA(ctypes.Structure):
_fields_ = [
("CustomRate", DXVAHD_RATIONAL),
("OutputFrames", wintypes.DWORD),
("InputInterlaced", wintypes.BOOL),
("InputFramesOrFields", wintypes.DWORD),
]#[repr(C)]
pub struct DXVAHD_RATIONAL {
pub Numerator: u32,
pub Denominator: u32,
}
#[repr(C)]
pub struct DXVAHD_CUSTOM_RATE_DATA {
pub CustomRate: DXVAHD_RATIONAL,
pub OutputFrames: u32,
pub InputInterlaced: i32,
pub InputFramesOrFields: u32,
}import "golang.org/x/sys/windows"
type DXVAHD_RATIONAL struct {
Numerator uint32
Denominator uint32
}
type DXVAHD_CUSTOM_RATE_DATA struct {
CustomRate DXVAHD_RATIONAL
OutputFrames uint32
InputInterlaced int32
InputFramesOrFields uint32
}type
DXVAHD_RATIONAL = record
Numerator: DWORD;
Denominator: DWORD;
end;
DXVAHD_CUSTOM_RATE_DATA = record
CustomRate: DXVAHD_RATIONAL;
OutputFrames: DWORD;
InputInterlaced: BOOL;
InputFramesOrFields: DWORD;
end;const DXVAHD_RATIONAL = extern struct {
Numerator: u32,
Denominator: u32,
};
const DXVAHD_CUSTOM_RATE_DATA = extern struct {
CustomRate: DXVAHD_RATIONAL,
OutputFrames: u32,
InputInterlaced: i32,
InputFramesOrFields: u32,
};type
DXVAHD_RATIONAL {.bycopy.} = object
Numerator: uint32
Denominator: uint32
DXVAHD_CUSTOM_RATE_DATA {.bycopy.} = object
CustomRate: DXVAHD_RATIONAL
OutputFrames: uint32
InputInterlaced: int32
InputFramesOrFields: uint32struct DXVAHD_RATIONAL
{
uint Numerator;
uint Denominator;
}
struct DXVAHD_CUSTOM_RATE_DATA
{
DXVAHD_RATIONAL CustomRate;
uint OutputFrames;
int InputInterlaced;
uint InputFramesOrFields;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DXVAHD_CUSTOM_RATE_DATA サイズ: 20 バイト(x64)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; CustomRate : DXVAHD_RATIONAL (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; OutputFrames : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; InputInterlaced : BOOL (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; InputFramesOrFields : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global DXVAHD_RATIONAL
#field int Numerator
#field int Denominator
#endstruct
#defstruct global DXVAHD_CUSTOM_RATE_DATA
#field DXVAHD_RATIONAL CustomRate
#field int OutputFrames
#field bool InputInterlaced
#field int InputFramesOrFields
#endstruct
stdim st, DXVAHD_CUSTOM_RATE_DATA ; NSTRUCT 変数を確保
st->OutputFrames = 100
mes "OutputFrames=" + st->OutputFrames