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

MFCreateMuxStreamAttributes

関数
複数の属性を多重化したストリーム属性を生成する。
DLLMFPlat.dll呼出規約winapi対応OSWindows 10 以降

シグネチャ

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

HRESULT MFCreateMuxStreamAttributes(
    IMFCollection* pAttributesToMux,
    IMFAttributes** ppMuxAttribs
);

パラメーター

名前方向説明
pAttributesToMuxIMFCollection*in各多重化サブストリームの IMFAttributes を格納したコレクションです。
ppMuxAttribsIMFAttributes**out多重化されたサブストリームの属性を格納した IMFAttributes です。

戻り値の型: HRESULT

公式ドキュメント

多重化されたサブストリームの内容を記述する IMFAttributes を作成します。

戻り値

この関数は HRESULT を返します。戻り値には、以下の表に示すものが含まれますが、これらに限定されません。

戻り値コード 説明
S_OK
メソッドは成功しました。
E_INVALIDARG
pAttributesToMux パラメーターが null です。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での呼び出し定義

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

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

MFCreateMuxStreamAttributes = ctypes.windll.mfplat.MFCreateMuxStreamAttributes
MFCreateMuxStreamAttributes.restype = ctypes.c_int
MFCreateMuxStreamAttributes.argtypes = [
    ctypes.c_void_p,  # pAttributesToMux : IMFCollection*
    ctypes.c_void_p,  # ppMuxAttribs : IMFAttributes** out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	mfplat = windows.NewLazySystemDLL("MFPlat.dll")
	procMFCreateMuxStreamAttributes = mfplat.NewProc("MFCreateMuxStreamAttributes")
)

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

extern "mfplat" fn MFCreateMuxStreamAttributes(
    pAttributesToMux: ?*anyopaque, // IMFCollection*
    ppMuxAttribs: ?*anyopaque // IMFAttributes** out
) callconv(std.os.windows.WINAPI) i32;
proc MFCreateMuxStreamAttributes(
    pAttributesToMux: pointer,  # IMFCollection*
    ppMuxAttribs: pointer  # IMFAttributes** out
): int32 {.importc: "MFCreateMuxStreamAttributes", stdcall, dynlib: "MFPlat.dll".}
pragma(lib, "mfplat");
extern(Windows)
int MFCreateMuxStreamAttributes(
    void* pAttributesToMux,   // IMFCollection*
    void* ppMuxAttribs   // IMFAttributes** out
);
ccall((:MFCreateMuxStreamAttributes, "MFPlat.dll"), stdcall, Int32,
      (Ptr{Cvoid}, Ptr{Cvoid}),
      pAttributesToMux, ppMuxAttribs)
# pAttributesToMux : IMFCollection* -> Ptr{Cvoid}
# ppMuxAttribs : IMFAttributes** out -> Ptr{Cvoid}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t MFCreateMuxStreamAttributes(
    void* pAttributesToMux,
    void* ppMuxAttribs);
]]
local mfplat = ffi.load("mfplat")
-- mfplat.MFCreateMuxStreamAttributes(pAttributesToMux, ppMuxAttribs)
-- pAttributesToMux : IMFCollection*
-- ppMuxAttribs : IMFAttributes** out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('MFPlat.dll');
const MFCreateMuxStreamAttributes = lib.func('__stdcall', 'MFCreateMuxStreamAttributes', 'int32_t', ['void *', 'void *']);
// MFCreateMuxStreamAttributes(pAttributesToMux, ppMuxAttribs)
// pAttributesToMux : IMFCollection* -> 'void *'
// ppMuxAttribs : IMFAttributes** out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("MFPlat.dll", {
  MFCreateMuxStreamAttributes: { parameters: ["pointer", "pointer"], result: "i32" },
});
// lib.symbols.MFCreateMuxStreamAttributes(pAttributesToMux, ppMuxAttribs)
// pAttributesToMux : IMFCollection* -> "pointer"
// ppMuxAttribs : IMFAttributes** out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t MFCreateMuxStreamAttributes(
    void* pAttributesToMux,
    void* ppMuxAttribs);
C, "MFPlat.dll");
// $ffi->MFCreateMuxStreamAttributes(pAttributesToMux, ppMuxAttribs);
// pAttributesToMux : IMFCollection*
// ppMuxAttribs : IMFAttributes** out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Mfplat extends StdCallLibrary {
    Mfplat INSTANCE = Native.load("mfplat", Mfplat.class);
    int MFCreateMuxStreamAttributes(
        Pointer pAttributesToMux,   // IMFCollection*
        Pointer ppMuxAttribs   // IMFAttributes** out
    );
}
@[Link("mfplat")]
lib LibMFPlat
  fun MFCreateMuxStreamAttributes = MFCreateMuxStreamAttributes(
    pAttributesToMux : Void*,   # IMFCollection*
    ppMuxAttribs : Void*   # IMFAttributes** out
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef MFCreateMuxStreamAttributesNative = Int32 Function(Pointer<Void>, Pointer<Void>);
typedef MFCreateMuxStreamAttributesDart = int Function(Pointer<Void>, Pointer<Void>);
final MFCreateMuxStreamAttributes = DynamicLibrary.open('MFPlat.dll')
    .lookupFunction<MFCreateMuxStreamAttributesNative, MFCreateMuxStreamAttributesDart>('MFCreateMuxStreamAttributes');
// pAttributesToMux : IMFCollection* -> Pointer<Void>
// ppMuxAttribs : IMFAttributes** out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function MFCreateMuxStreamAttributes(
  pAttributesToMux: Pointer;   // IMFCollection*
  ppMuxAttribs: Pointer   // IMFAttributes** out
): Integer; stdcall;
  external 'MFPlat.dll' name 'MFCreateMuxStreamAttributes';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "MFCreateMuxStreamAttributes"
  c_MFCreateMuxStreamAttributes :: Ptr () -> Ptr () -> IO Int32
-- pAttributesToMux : IMFCollection* -> Ptr ()
-- ppMuxAttribs : IMFAttributes** out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let mfcreatemuxstreamattributes =
  foreign "MFCreateMuxStreamAttributes"
    ((ptr void) @-> (ptr void) @-> returning int32_t)
(* pAttributesToMux : IMFCollection* -> (ptr void) *)
(* ppMuxAttribs : IMFAttributes** out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library mfplat (t "MFPlat.dll"))
(cffi:use-foreign-library mfplat)

(cffi:defcfun ("MFCreateMuxStreamAttributes" mfcreate-mux-stream-attributes :convention :stdcall) :int32
  (p-attributes-to-mux :pointer)   ; IMFCollection*
  (pp-mux-attribs :pointer))   ; IMFAttributes** out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $MFCreateMuxStreamAttributes = Win32::API::More->new('MFPlat',
    'int MFCreateMuxStreamAttributes(LPVOID pAttributesToMux, LPVOID ppMuxAttribs)');
# my $ret = $MFCreateMuxStreamAttributes->Call($pAttributesToMux, $ppMuxAttribs);
# pAttributesToMux : IMFCollection* -> LPVOID
# ppMuxAttribs : IMFAttributes** out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型