ホーム › Media.DirectShow › DXVA2SW_CALLBACKS
DXVA2SW_CALLBACKS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Size | DWORD | 4 | +0 | +0 | コールバック構造体のバイトサイズ。バージョン検証に使う。 |
| GetVideoProcessorRenderTargetCount | PDXVA2SW_GETVIDEOPROCESSORRENDERTARGETCOUNT | 8/4 | +8 | +4 | 対応レンダーターゲット数を取得するコールバック関数。 |
| GetVideoProcessorRenderTargets | PDXVA2SW_GETVIDEOPROCESSORRENDERTARGETS | 8/4 | +16 | +8 | 対応レンダーターゲット一覧を取得するコールバック関数。 |
| GetVideoProcessorCaps | PDXVA2SW_GETVIDEOPROCESSORCAPS | 8/4 | +24 | +12 | ビデオプロセッサ能力を取得するコールバック関数。 |
| GetVideoProcessorSubStreamFormatCount | PDXVA2SW_GETVIDEOPROCESSORSUBSTREAMFORMATCOUNT | 8/4 | +32 | +16 | 対応サブストリーム形式数を取得するコールバック関数。 |
| GetVideoProcessorSubStreamFormats | PDXVA2SW_GETVIDEOPROCESSORSUBSTREAMFORMATS | 8/4 | +40 | +20 | 対応サブストリーム形式一覧を取得するコールバック関数。 |
| GetProcAmpRange | PDXVA2SW_GETPROCAMPRANGE | 8/4 | +48 | +24 | ProcAmp調整値の範囲を取得するコールバック関数。 |
| GetFilterPropertyRange | PDXVA2SW_GETFILTERPROPERTYRANGE | 8/4 | +56 | +28 | フィルタプロパティの範囲を取得するコールバック関数。 |
| CreateVideoProcessDevice | PDXVA2SW_CREATEVIDEOPROCESSDEVICE | 8/4 | +64 | +32 | ビデオ処理デバイスを生成するコールバック関数。 |
| DestroyVideoProcessDevice | PDXVA2SW_DESTROYVIDEOPROCESSDEVICE | 8/4 | +72 | +36 | ビデオ処理デバイスを破棄するコールバック関数。 |
| VideoProcessBeginFrame | PDXVA2SW_VIDEOPROCESSBEGINFRAME | 8/4 | +80 | +40 | フレーム処理開始を通知するコールバック関数。 |
| VideoProcessEndFrame | PDXVA2SW_VIDEOPROCESSENDFRAME | 8/4 | +88 | +44 | フレーム処理終了を通知するコールバック関数。 |
| VideoProcessSetRenderTarget | PDXVA2SW_VIDEOPROCESSSETRENDERTARGET | 8/4 | +96 | +48 | レンダーターゲットを設定するコールバック関数。 |
| VideoProcessBlt | PDXVA2SW_VIDEOPROCESSBLT | 8/4 | +104 | +52 | ビデオ処理転送(Blt)を実行するコールバック関数。 |
各言語での定義
#include <windows.h>
// DXVA2SW_CALLBACKS (x64 112 / x86 56 バイト)
typedef struct DXVA2SW_CALLBACKS {
DWORD Size;
PDXVA2SW_GETVIDEOPROCESSORRENDERTARGETCOUNT GetVideoProcessorRenderTargetCount;
PDXVA2SW_GETVIDEOPROCESSORRENDERTARGETS GetVideoProcessorRenderTargets;
PDXVA2SW_GETVIDEOPROCESSORCAPS GetVideoProcessorCaps;
PDXVA2SW_GETVIDEOPROCESSORSUBSTREAMFORMATCOUNT GetVideoProcessorSubStreamFormatCount;
PDXVA2SW_GETVIDEOPROCESSORSUBSTREAMFORMATS GetVideoProcessorSubStreamFormats;
PDXVA2SW_GETPROCAMPRANGE GetProcAmpRange;
PDXVA2SW_GETFILTERPROPERTYRANGE GetFilterPropertyRange;
PDXVA2SW_CREATEVIDEOPROCESSDEVICE CreateVideoProcessDevice;
PDXVA2SW_DESTROYVIDEOPROCESSDEVICE DestroyVideoProcessDevice;
PDXVA2SW_VIDEOPROCESSBEGINFRAME VideoProcessBeginFrame;
PDXVA2SW_VIDEOPROCESSENDFRAME VideoProcessEndFrame;
PDXVA2SW_VIDEOPROCESSSETRENDERTARGET VideoProcessSetRenderTarget;
PDXVA2SW_VIDEOPROCESSBLT VideoProcessBlt;
} DXVA2SW_CALLBACKS;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXVA2SW_CALLBACKS
{
public uint Size;
public IntPtr GetVideoProcessorRenderTargetCount;
public IntPtr GetVideoProcessorRenderTargets;
public IntPtr GetVideoProcessorCaps;
public IntPtr GetVideoProcessorSubStreamFormatCount;
public IntPtr GetVideoProcessorSubStreamFormats;
public IntPtr GetProcAmpRange;
public IntPtr GetFilterPropertyRange;
public IntPtr CreateVideoProcessDevice;
public IntPtr DestroyVideoProcessDevice;
public IntPtr VideoProcessBeginFrame;
public IntPtr VideoProcessEndFrame;
public IntPtr VideoProcessSetRenderTarget;
public IntPtr VideoProcessBlt;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXVA2SW_CALLBACKS
Public Size As UInteger
Public GetVideoProcessorRenderTargetCount As IntPtr
Public GetVideoProcessorRenderTargets As IntPtr
Public GetVideoProcessorCaps As IntPtr
Public GetVideoProcessorSubStreamFormatCount As IntPtr
Public GetVideoProcessorSubStreamFormats As IntPtr
Public GetProcAmpRange As IntPtr
Public GetFilterPropertyRange As IntPtr
Public CreateVideoProcessDevice As IntPtr
Public DestroyVideoProcessDevice As IntPtr
Public VideoProcessBeginFrame As IntPtr
Public VideoProcessEndFrame As IntPtr
Public VideoProcessSetRenderTarget As IntPtr
Public VideoProcessBlt As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class DXVA2SW_CALLBACKS(ctypes.Structure):
_fields_ = [
("Size", wintypes.DWORD),
("GetVideoProcessorRenderTargetCount", ctypes.c_void_p),
("GetVideoProcessorRenderTargets", ctypes.c_void_p),
("GetVideoProcessorCaps", ctypes.c_void_p),
("GetVideoProcessorSubStreamFormatCount", ctypes.c_void_p),
("GetVideoProcessorSubStreamFormats", ctypes.c_void_p),
("GetProcAmpRange", ctypes.c_void_p),
("GetFilterPropertyRange", ctypes.c_void_p),
("CreateVideoProcessDevice", ctypes.c_void_p),
("DestroyVideoProcessDevice", ctypes.c_void_p),
("VideoProcessBeginFrame", ctypes.c_void_p),
("VideoProcessEndFrame", ctypes.c_void_p),
("VideoProcessSetRenderTarget", ctypes.c_void_p),
("VideoProcessBlt", ctypes.c_void_p),
]#[repr(C)]
pub struct DXVA2SW_CALLBACKS {
pub Size: u32,
pub GetVideoProcessorRenderTargetCount: *mut core::ffi::c_void,
pub GetVideoProcessorRenderTargets: *mut core::ffi::c_void,
pub GetVideoProcessorCaps: *mut core::ffi::c_void,
pub GetVideoProcessorSubStreamFormatCount: *mut core::ffi::c_void,
pub GetVideoProcessorSubStreamFormats: *mut core::ffi::c_void,
pub GetProcAmpRange: *mut core::ffi::c_void,
pub GetFilterPropertyRange: *mut core::ffi::c_void,
pub CreateVideoProcessDevice: *mut core::ffi::c_void,
pub DestroyVideoProcessDevice: *mut core::ffi::c_void,
pub VideoProcessBeginFrame: *mut core::ffi::c_void,
pub VideoProcessEndFrame: *mut core::ffi::c_void,
pub VideoProcessSetRenderTarget: *mut core::ffi::c_void,
pub VideoProcessBlt: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type DXVA2SW_CALLBACKS struct {
Size uint32
GetVideoProcessorRenderTargetCount uintptr
GetVideoProcessorRenderTargets uintptr
GetVideoProcessorCaps uintptr
GetVideoProcessorSubStreamFormatCount uintptr
GetVideoProcessorSubStreamFormats uintptr
GetProcAmpRange uintptr
GetFilterPropertyRange uintptr
CreateVideoProcessDevice uintptr
DestroyVideoProcessDevice uintptr
VideoProcessBeginFrame uintptr
VideoProcessEndFrame uintptr
VideoProcessSetRenderTarget uintptr
VideoProcessBlt uintptr
}type
DXVA2SW_CALLBACKS = record
Size: DWORD;
GetVideoProcessorRenderTargetCount: Pointer;
GetVideoProcessorRenderTargets: Pointer;
GetVideoProcessorCaps: Pointer;
GetVideoProcessorSubStreamFormatCount: Pointer;
GetVideoProcessorSubStreamFormats: Pointer;
GetProcAmpRange: Pointer;
GetFilterPropertyRange: Pointer;
CreateVideoProcessDevice: Pointer;
DestroyVideoProcessDevice: Pointer;
VideoProcessBeginFrame: Pointer;
VideoProcessEndFrame: Pointer;
VideoProcessSetRenderTarget: Pointer;
VideoProcessBlt: Pointer;
end;const DXVA2SW_CALLBACKS = extern struct {
Size: u32,
GetVideoProcessorRenderTargetCount: ?*anyopaque,
GetVideoProcessorRenderTargets: ?*anyopaque,
GetVideoProcessorCaps: ?*anyopaque,
GetVideoProcessorSubStreamFormatCount: ?*anyopaque,
GetVideoProcessorSubStreamFormats: ?*anyopaque,
GetProcAmpRange: ?*anyopaque,
GetFilterPropertyRange: ?*anyopaque,
CreateVideoProcessDevice: ?*anyopaque,
DestroyVideoProcessDevice: ?*anyopaque,
VideoProcessBeginFrame: ?*anyopaque,
VideoProcessEndFrame: ?*anyopaque,
VideoProcessSetRenderTarget: ?*anyopaque,
VideoProcessBlt: ?*anyopaque,
};type
DXVA2SW_CALLBACKS {.bycopy.} = object
Size: uint32
GetVideoProcessorRenderTargetCount: pointer
GetVideoProcessorRenderTargets: pointer
GetVideoProcessorCaps: pointer
GetVideoProcessorSubStreamFormatCount: pointer
GetVideoProcessorSubStreamFormats: pointer
GetProcAmpRange: pointer
GetFilterPropertyRange: pointer
CreateVideoProcessDevice: pointer
DestroyVideoProcessDevice: pointer
VideoProcessBeginFrame: pointer
VideoProcessEndFrame: pointer
VideoProcessSetRenderTarget: pointer
VideoProcessBlt: pointerstruct DXVA2SW_CALLBACKS
{
uint Size;
void* GetVideoProcessorRenderTargetCount;
void* GetVideoProcessorRenderTargets;
void* GetVideoProcessorCaps;
void* GetVideoProcessorSubStreamFormatCount;
void* GetVideoProcessorSubStreamFormats;
void* GetProcAmpRange;
void* GetFilterPropertyRange;
void* CreateVideoProcessDevice;
void* DestroyVideoProcessDevice;
void* VideoProcessBeginFrame;
void* VideoProcessEndFrame;
void* VideoProcessSetRenderTarget;
void* VideoProcessBlt;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DXVA2SW_CALLBACKS サイズ: 56 バイト(x86)
dim st, 14 ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; Size : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; GetVideoProcessorRenderTargetCount : PDXVA2SW_GETVIDEOPROCESSORRENDERTARGETCOUNT (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; GetVideoProcessorRenderTargets : PDXVA2SW_GETVIDEOPROCESSORRENDERTARGETS (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; GetVideoProcessorCaps : PDXVA2SW_GETVIDEOPROCESSORCAPS (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; GetVideoProcessorSubStreamFormatCount : PDXVA2SW_GETVIDEOPROCESSORSUBSTREAMFORMATCOUNT (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; GetVideoProcessorSubStreamFormats : PDXVA2SW_GETVIDEOPROCESSORSUBSTREAMFORMATS (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; GetProcAmpRange : PDXVA2SW_GETPROCAMPRANGE (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; GetFilterPropertyRange : PDXVA2SW_GETFILTERPROPERTYRANGE (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; CreateVideoProcessDevice : PDXVA2SW_CREATEVIDEOPROCESSDEVICE (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; DestroyVideoProcessDevice : PDXVA2SW_DESTROYVIDEOPROCESSDEVICE (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; VideoProcessBeginFrame : PDXVA2SW_VIDEOPROCESSBEGINFRAME (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; VideoProcessEndFrame : PDXVA2SW_VIDEOPROCESSENDFRAME (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; VideoProcessSetRenderTarget : PDXVA2SW_VIDEOPROCESSSETRENDERTARGET (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; VideoProcessBlt : PDXVA2SW_VIDEOPROCESSBLT (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DXVA2SW_CALLBACKS サイズ: 112 バイト(x64)
dim st, 28 ; 4byte整数×28(構造体サイズ 112 / 4 切り上げ)
; Size : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; GetVideoProcessorRenderTargetCount : PDXVA2SW_GETVIDEOPROCESSORRENDERTARGETCOUNT (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; GetVideoProcessorRenderTargets : PDXVA2SW_GETVIDEOPROCESSORRENDERTARGETS (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; GetVideoProcessorCaps : PDXVA2SW_GETVIDEOPROCESSORCAPS (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; GetVideoProcessorSubStreamFormatCount : PDXVA2SW_GETVIDEOPROCESSORSUBSTREAMFORMATCOUNT (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; GetVideoProcessorSubStreamFormats : PDXVA2SW_GETVIDEOPROCESSORSUBSTREAMFORMATS (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; GetProcAmpRange : PDXVA2SW_GETPROCAMPRANGE (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; GetFilterPropertyRange : PDXVA2SW_GETFILTERPROPERTYRANGE (+56, 8byte) qpoke st,56,値 / qpeek(st,56) ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; CreateVideoProcessDevice : PDXVA2SW_CREATEVIDEOPROCESSDEVICE (+64, 8byte) qpoke st,64,値 / qpeek(st,64) ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; DestroyVideoProcessDevice : PDXVA2SW_DESTROYVIDEOPROCESSDEVICE (+72, 8byte) qpoke st,72,値 / qpeek(st,72) ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; VideoProcessBeginFrame : PDXVA2SW_VIDEOPROCESSBEGINFRAME (+80, 8byte) qpoke st,80,値 / qpeek(st,80) ※IronHSPのみ。3.7/3.8は lpoke st,80,下位 : lpoke st,84,上位
; VideoProcessEndFrame : PDXVA2SW_VIDEOPROCESSENDFRAME (+88, 8byte) qpoke st,88,値 / qpeek(st,88) ※IronHSPのみ。3.7/3.8は lpoke st,88,下位 : lpoke st,92,上位
; VideoProcessSetRenderTarget : PDXVA2SW_VIDEOPROCESSSETRENDERTARGET (+96, 8byte) qpoke st,96,値 / qpeek(st,96) ※IronHSPのみ。3.7/3.8は lpoke st,96,下位 : lpoke st,100,上位
; VideoProcessBlt : PDXVA2SW_VIDEOPROCESSBLT (+104, 8byte) qpoke st,104,値 / qpeek(st,104) ※IronHSPのみ。3.7/3.8は lpoke st,104,下位 : lpoke st,108,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DXVA2SW_CALLBACKS
#field int Size
#field intptr GetVideoProcessorRenderTargetCount
#field intptr GetVideoProcessorRenderTargets
#field intptr GetVideoProcessorCaps
#field intptr GetVideoProcessorSubStreamFormatCount
#field intptr GetVideoProcessorSubStreamFormats
#field intptr GetProcAmpRange
#field intptr GetFilterPropertyRange
#field intptr CreateVideoProcessDevice
#field intptr DestroyVideoProcessDevice
#field intptr VideoProcessBeginFrame
#field intptr VideoProcessEndFrame
#field intptr VideoProcessSetRenderTarget
#field intptr VideoProcessBlt
#endstruct
stdim st, DXVA2SW_CALLBACKS ; NSTRUCT 変数を確保
st->Size = 100
mes "Size=" + st->Size