ホーム › Media.MediaFoundation › MFCreateVideoSampleAllocatorEx
MFCreateVideoSampleAllocatorEx
関数ハードウェア対応のビデオサンプルアロケーターを生成する。
シグネチャ
// MFPlat.dll
#include <windows.h>
HRESULT MFCreateVideoSampleAllocatorEx(
const GUID* riid,
void** ppSampleAllocator
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| riid | GUID* | in | 要求するサンプルアロケータインターフェイスの識別子 GUID への参照。 |
| ppSampleAllocator | void** | out | 生成されたビデオサンプルアロケータを受け取る出力ポインタ。riid に対応する型で返る。 |
戻り値の型: HRESULT
各言語での呼び出し定義
// MFPlat.dll
#include <windows.h>
HRESULT MFCreateVideoSampleAllocatorEx(
const GUID* riid,
void** ppSampleAllocator
);[DllImport("MFPlat.dll", ExactSpelling = true)]
static extern int MFCreateVideoSampleAllocatorEx(
ref Guid riid, // GUID*
IntPtr ppSampleAllocator // void** out
);<DllImport("MFPlat.dll", ExactSpelling:=True)>
Public Shared Function MFCreateVideoSampleAllocatorEx(
ByRef riid As Guid, ' GUID*
ppSampleAllocator As IntPtr ' void** out
) As Integer
End Function' riid : GUID*
' ppSampleAllocator : void** out
Declare PtrSafe Function MFCreateVideoSampleAllocatorEx Lib "mfplat" ( _
ByVal riid As LongPtr, _
ByVal ppSampleAllocator As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
MFCreateVideoSampleAllocatorEx = ctypes.windll.mfplat.MFCreateVideoSampleAllocatorEx
MFCreateVideoSampleAllocatorEx.restype = ctypes.c_int
MFCreateVideoSampleAllocatorEx.argtypes = [
ctypes.c_void_p, # riid : GUID*
ctypes.c_void_p, # ppSampleAllocator : void** out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('MFPlat.dll')
MFCreateVideoSampleAllocatorEx = Fiddle::Function.new(
lib['MFCreateVideoSampleAllocatorEx'],
[
Fiddle::TYPE_VOIDP, # riid : GUID*
Fiddle::TYPE_VOIDP, # ppSampleAllocator : void** out
],
Fiddle::TYPE_INT)#[link(name = "mfplat")]
extern "system" {
fn MFCreateVideoSampleAllocatorEx(
riid: *const GUID, // GUID*
ppSampleAllocator: *mut *mut () // void** out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("MFPlat.dll")]
public static extern int MFCreateVideoSampleAllocatorEx(ref Guid riid, IntPtr ppSampleAllocator);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MFPlat_MFCreateVideoSampleAllocatorEx' -Namespace Win32 -PassThru
# $api::MFCreateVideoSampleAllocatorEx(riid, ppSampleAllocator)#uselib "MFPlat.dll"
#func global MFCreateVideoSampleAllocatorEx "MFCreateVideoSampleAllocatorEx" sptr, sptr
; MFCreateVideoSampleAllocatorEx varptr(riid), ppSampleAllocator ; 戻り値は stat
; riid : GUID* -> "sptr"
; ppSampleAllocator : void** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "MFPlat.dll" #cfunc global MFCreateVideoSampleAllocatorEx "MFCreateVideoSampleAllocatorEx" var, sptr ; res = MFCreateVideoSampleAllocatorEx(riid, ppSampleAllocator) ; riid : GUID* -> "var" ; ppSampleAllocator : void** out -> "sptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "MFPlat.dll" #cfunc global MFCreateVideoSampleAllocatorEx "MFCreateVideoSampleAllocatorEx" sptr, sptr ; res = MFCreateVideoSampleAllocatorEx(varptr(riid), ppSampleAllocator) ; riid : GUID* -> "sptr" ; ppSampleAllocator : void** out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT MFCreateVideoSampleAllocatorEx(GUID* riid, void** ppSampleAllocator) #uselib "MFPlat.dll" #cfunc global MFCreateVideoSampleAllocatorEx "MFCreateVideoSampleAllocatorEx" var, intptr ; res = MFCreateVideoSampleAllocatorEx(riid, ppSampleAllocator) ; riid : GUID* -> "var" ; ppSampleAllocator : void** out -> "intptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT MFCreateVideoSampleAllocatorEx(GUID* riid, void** ppSampleAllocator) #uselib "MFPlat.dll" #cfunc global MFCreateVideoSampleAllocatorEx "MFCreateVideoSampleAllocatorEx" intptr, intptr ; res = MFCreateVideoSampleAllocatorEx(varptr(riid), ppSampleAllocator) ; riid : GUID* -> "intptr" ; ppSampleAllocator : void** out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
mfplat = windows.NewLazySystemDLL("MFPlat.dll")
procMFCreateVideoSampleAllocatorEx = mfplat.NewProc("MFCreateVideoSampleAllocatorEx")
)
// riid (GUID*), ppSampleAllocator (void** out)
r1, _, err := procMFCreateVideoSampleAllocatorEx.Call(
uintptr(riid),
uintptr(ppSampleAllocator),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction MFCreateVideoSampleAllocatorEx(
riid: PGUID; // GUID*
ppSampleAllocator: Pointer // void** out
): Integer; stdcall;
external 'MFPlat.dll' name 'MFCreateVideoSampleAllocatorEx';result := DllCall("MFPlat\MFCreateVideoSampleAllocatorEx"
, "Ptr", riid ; GUID*
, "Ptr", ppSampleAllocator ; void** out
, "Int") ; return: HRESULT●MFCreateVideoSampleAllocatorEx(riid, ppSampleAllocator) = DLL("MFPlat.dll", "int MFCreateVideoSampleAllocatorEx(void*, void*)")
# 呼び出し: MFCreateVideoSampleAllocatorEx(riid, ppSampleAllocator)
# riid : GUID* -> "void*"
# ppSampleAllocator : void** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。