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