Win32 API 日本語リファレンス
ホームMedia.MediaFoundation › MFCreatePresentationDescriptorFromASFProfile

MFCreatePresentationDescriptorFromASFProfile

関数
ASFプロファイルからプレゼンテーション記述子を生成する。
DLLMF.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

// MF.dll
#include <windows.h>

HRESULT MFCreatePresentationDescriptorFromASFProfile(
    IMFASFProfile* pIProfile,
    IMFPresentationDescriptor** ppIPD
);

パラメーター

名前方向
pIProfileIMFASFProfile*in
ppIPDIMFPresentationDescriptor**out

戻り値の型: HRESULT

各言語での呼び出し定義

// MF.dll
#include <windows.h>

HRESULT MFCreatePresentationDescriptorFromASFProfile(
    IMFASFProfile* pIProfile,
    IMFPresentationDescriptor** ppIPD
);
[DllImport("MF.dll", ExactSpelling = true)]
static extern int MFCreatePresentationDescriptorFromASFProfile(
    IntPtr pIProfile,   // IMFASFProfile*
    IntPtr ppIPD   // IMFPresentationDescriptor** out
);
<DllImport("MF.dll", ExactSpelling:=True)>
Public Shared Function MFCreatePresentationDescriptorFromASFProfile(
    pIProfile As IntPtr,   ' IMFASFProfile*
    ppIPD As IntPtr   ' IMFPresentationDescriptor** out
) As Integer
End Function
' pIProfile : IMFASFProfile*
' ppIPD : IMFPresentationDescriptor** out
Declare PtrSafe Function MFCreatePresentationDescriptorFromASFProfile Lib "mf" ( _
    ByVal pIProfile As LongPtr, _
    ByVal ppIPD As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

MFCreatePresentationDescriptorFromASFProfile = ctypes.windll.mf.MFCreatePresentationDescriptorFromASFProfile
MFCreatePresentationDescriptorFromASFProfile.restype = ctypes.c_int
MFCreatePresentationDescriptorFromASFProfile.argtypes = [
    ctypes.c_void_p,  # pIProfile : IMFASFProfile*
    ctypes.c_void_p,  # ppIPD : IMFPresentationDescriptor** out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('MF.dll')
MFCreatePresentationDescriptorFromASFProfile = Fiddle::Function.new(
  lib['MFCreatePresentationDescriptorFromASFProfile'],
  [
    Fiddle::TYPE_VOIDP,  # pIProfile : IMFASFProfile*
    Fiddle::TYPE_VOIDP,  # ppIPD : IMFPresentationDescriptor** out
  ],
  Fiddle::TYPE_INT)
#[link(name = "mf")]
extern "system" {
    fn MFCreatePresentationDescriptorFromASFProfile(
        pIProfile: *mut core::ffi::c_void,  // IMFASFProfile*
        ppIPD: *mut *mut core::ffi::c_void  // IMFPresentationDescriptor** out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("MF.dll")]
public static extern int MFCreatePresentationDescriptorFromASFProfile(IntPtr pIProfile, IntPtr ppIPD);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MF_MFCreatePresentationDescriptorFromASFProfile' -Namespace Win32 -PassThru
# $api::MFCreatePresentationDescriptorFromASFProfile(pIProfile, ppIPD)
#uselib "MF.dll"
#func global MFCreatePresentationDescriptorFromASFProfile "MFCreatePresentationDescriptorFromASFProfile" sptr, sptr
; MFCreatePresentationDescriptorFromASFProfile pIProfile, ppIPD   ; 戻り値は stat
; pIProfile : IMFASFProfile* -> "sptr"
; ppIPD : IMFPresentationDescriptor** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "MF.dll"
#cfunc global MFCreatePresentationDescriptorFromASFProfile "MFCreatePresentationDescriptorFromASFProfile" sptr, sptr
; res = MFCreatePresentationDescriptorFromASFProfile(pIProfile, ppIPD)
; pIProfile : IMFASFProfile* -> "sptr"
; ppIPD : IMFPresentationDescriptor** out -> "sptr"
; HRESULT MFCreatePresentationDescriptorFromASFProfile(IMFASFProfile* pIProfile, IMFPresentationDescriptor** ppIPD)
#uselib "MF.dll"
#cfunc global MFCreatePresentationDescriptorFromASFProfile "MFCreatePresentationDescriptorFromASFProfile" intptr, intptr
; res = MFCreatePresentationDescriptorFromASFProfile(pIProfile, ppIPD)
; pIProfile : IMFASFProfile* -> "intptr"
; ppIPD : IMFPresentationDescriptor** out -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	mf = windows.NewLazySystemDLL("MF.dll")
	procMFCreatePresentationDescriptorFromASFProfile = mf.NewProc("MFCreatePresentationDescriptorFromASFProfile")
)

// pIProfile (IMFASFProfile*), ppIPD (IMFPresentationDescriptor** out)
r1, _, err := procMFCreatePresentationDescriptorFromASFProfile.Call(
	uintptr(pIProfile),
	uintptr(ppIPD),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function MFCreatePresentationDescriptorFromASFProfile(
  pIProfile: Pointer;   // IMFASFProfile*
  ppIPD: Pointer   // IMFPresentationDescriptor** out
): Integer; stdcall;
  external 'MF.dll' name 'MFCreatePresentationDescriptorFromASFProfile';
result := DllCall("MF\MFCreatePresentationDescriptorFromASFProfile"
    , "Ptr", pIProfile   ; IMFASFProfile*
    , "Ptr", ppIPD   ; IMFPresentationDescriptor** out
    , "Int")   ; return: HRESULT
●MFCreatePresentationDescriptorFromASFProfile(pIProfile, ppIPD) = DLL("MF.dll", "int MFCreatePresentationDescriptorFromASFProfile(void*, void*)")
# 呼び出し: MFCreatePresentationDescriptorFromASFProfile(pIProfile, ppIPD)
# pIProfile : IMFASFProfile* -> "void*"
# ppIPD : IMFPresentationDescriptor** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。