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