ホーム › Media.MediaFoundation › MFCreateMFByteStreamWrapper
MFCreateMFByteStreamWrapper
関数既存のバイトストリームを包むラッパーを生成する。
シグネチャ
// MFPlat.dll
#include <windows.h>
HRESULT MFCreateMFByteStreamWrapper(
IMFByteStream* pStream,
IMFByteStream** ppStreamWrapper
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pStream | IMFByteStream* | in |
| ppStreamWrapper | IMFByteStream** | out |
戻り値の型: HRESULT
各言語での呼び出し定義
// MFPlat.dll
#include <windows.h>
HRESULT MFCreateMFByteStreamWrapper(
IMFByteStream* pStream,
IMFByteStream** ppStreamWrapper
);[DllImport("MFPlat.dll", ExactSpelling = true)]
static extern int MFCreateMFByteStreamWrapper(
IntPtr pStream, // IMFByteStream*
IntPtr ppStreamWrapper // IMFByteStream** out
);<DllImport("MFPlat.dll", ExactSpelling:=True)>
Public Shared Function MFCreateMFByteStreamWrapper(
pStream As IntPtr, ' IMFByteStream*
ppStreamWrapper As IntPtr ' IMFByteStream** out
) As Integer
End Function' pStream : IMFByteStream*
' ppStreamWrapper : IMFByteStream** out
Declare PtrSafe Function MFCreateMFByteStreamWrapper Lib "mfplat" ( _
ByVal pStream As LongPtr, _
ByVal ppStreamWrapper As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
MFCreateMFByteStreamWrapper = ctypes.windll.mfplat.MFCreateMFByteStreamWrapper
MFCreateMFByteStreamWrapper.restype = ctypes.c_int
MFCreateMFByteStreamWrapper.argtypes = [
ctypes.c_void_p, # pStream : IMFByteStream*
ctypes.c_void_p, # ppStreamWrapper : IMFByteStream** out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('MFPlat.dll')
MFCreateMFByteStreamWrapper = Fiddle::Function.new(
lib['MFCreateMFByteStreamWrapper'],
[
Fiddle::TYPE_VOIDP, # pStream : IMFByteStream*
Fiddle::TYPE_VOIDP, # ppStreamWrapper : IMFByteStream** out
],
Fiddle::TYPE_INT)#[link(name = "mfplat")]
extern "system" {
fn MFCreateMFByteStreamWrapper(
pStream: *mut core::ffi::c_void, // IMFByteStream*
ppStreamWrapper: *mut *mut core::ffi::c_void // IMFByteStream** out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("MFPlat.dll")]
public static extern int MFCreateMFByteStreamWrapper(IntPtr pStream, IntPtr ppStreamWrapper);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MFPlat_MFCreateMFByteStreamWrapper' -Namespace Win32 -PassThru
# $api::MFCreateMFByteStreamWrapper(pStream, ppStreamWrapper)#uselib "MFPlat.dll"
#func global MFCreateMFByteStreamWrapper "MFCreateMFByteStreamWrapper" sptr, sptr
; MFCreateMFByteStreamWrapper pStream, ppStreamWrapper ; 戻り値は stat
; pStream : IMFByteStream* -> "sptr"
; ppStreamWrapper : IMFByteStream** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "MFPlat.dll"
#cfunc global MFCreateMFByteStreamWrapper "MFCreateMFByteStreamWrapper" sptr, sptr
; res = MFCreateMFByteStreamWrapper(pStream, ppStreamWrapper)
; pStream : IMFByteStream* -> "sptr"
; ppStreamWrapper : IMFByteStream** out -> "sptr"; HRESULT MFCreateMFByteStreamWrapper(IMFByteStream* pStream, IMFByteStream** ppStreamWrapper)
#uselib "MFPlat.dll"
#cfunc global MFCreateMFByteStreamWrapper "MFCreateMFByteStreamWrapper" intptr, intptr
; res = MFCreateMFByteStreamWrapper(pStream, ppStreamWrapper)
; pStream : IMFByteStream* -> "intptr"
; ppStreamWrapper : IMFByteStream** out -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
mfplat = windows.NewLazySystemDLL("MFPlat.dll")
procMFCreateMFByteStreamWrapper = mfplat.NewProc("MFCreateMFByteStreamWrapper")
)
// pStream (IMFByteStream*), ppStreamWrapper (IMFByteStream** out)
r1, _, err := procMFCreateMFByteStreamWrapper.Call(
uintptr(pStream),
uintptr(ppStreamWrapper),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction MFCreateMFByteStreamWrapper(
pStream: Pointer; // IMFByteStream*
ppStreamWrapper: Pointer // IMFByteStream** out
): Integer; stdcall;
external 'MFPlat.dll' name 'MFCreateMFByteStreamWrapper';result := DllCall("MFPlat\MFCreateMFByteStreamWrapper"
, "Ptr", pStream ; IMFByteStream*
, "Ptr", ppStreamWrapper ; IMFByteStream** out
, "Int") ; return: HRESULT●MFCreateMFByteStreamWrapper(pStream, ppStreamWrapper) = DLL("MFPlat.dll", "int MFCreateMFByteStreamWrapper(void*, void*)")
# 呼び出し: MFCreateMFByteStreamWrapper(pStream, ppStreamWrapper)
# pStream : IMFByteStream* -> "void*"
# ppStreamWrapper : IMFByteStream** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。