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

MFGetUncompressedVideoFormat

関数
MFVIDEOFORMATから非圧縮ビデオのFOURCC形式を取得する。
DLLMFPlat.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

DWORD MFGetUncompressedVideoFormat(
    const MFVIDEOFORMAT* pVideoFormat
);

パラメーター

名前方向
pVideoFormatMFVIDEOFORMAT*in

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD MFGetUncompressedVideoFormat(
    const MFVIDEOFORMAT* pVideoFormat
);
[DllImport("MFPlat.dll", ExactSpelling = true)]
static extern uint MFGetUncompressedVideoFormat(
    IntPtr pVideoFormat   // MFVIDEOFORMAT*
);
<DllImport("MFPlat.dll", ExactSpelling:=True)>
Public Shared Function MFGetUncompressedVideoFormat(
    pVideoFormat As IntPtr   ' MFVIDEOFORMAT*
) As UInteger
End Function
' pVideoFormat : MFVIDEOFORMAT*
Declare PtrSafe Function MFGetUncompressedVideoFormat Lib "mfplat" ( _
    ByVal pVideoFormat As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

MFGetUncompressedVideoFormat = ctypes.windll.mfplat.MFGetUncompressedVideoFormat
MFGetUncompressedVideoFormat.restype = wintypes.DWORD
MFGetUncompressedVideoFormat.argtypes = [
    ctypes.c_void_p,  # pVideoFormat : MFVIDEOFORMAT*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('MFPlat.dll')
MFGetUncompressedVideoFormat = Fiddle::Function.new(
  lib['MFGetUncompressedVideoFormat'],
  [
    Fiddle::TYPE_VOIDP,  # pVideoFormat : MFVIDEOFORMAT*
  ],
  -Fiddle::TYPE_INT)
#[link(name = "mfplat")]
extern "system" {
    fn MFGetUncompressedVideoFormat(
        pVideoFormat: *const MFVIDEOFORMAT  // MFVIDEOFORMAT*
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("MFPlat.dll")]
public static extern uint MFGetUncompressedVideoFormat(IntPtr pVideoFormat);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MFPlat_MFGetUncompressedVideoFormat' -Namespace Win32 -PassThru
# $api::MFGetUncompressedVideoFormat(pVideoFormat)
#uselib "MFPlat.dll"
#func global MFGetUncompressedVideoFormat "MFGetUncompressedVideoFormat" sptr
; MFGetUncompressedVideoFormat varptr(pVideoFormat)   ; 戻り値は stat
; pVideoFormat : MFVIDEOFORMAT* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "MFPlat.dll"
#cfunc global MFGetUncompressedVideoFormat "MFGetUncompressedVideoFormat" var
; res = MFGetUncompressedVideoFormat(pVideoFormat)
; pVideoFormat : MFVIDEOFORMAT* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; DWORD MFGetUncompressedVideoFormat(MFVIDEOFORMAT* pVideoFormat)
#uselib "MFPlat.dll"
#cfunc global MFGetUncompressedVideoFormat "MFGetUncompressedVideoFormat" var
; res = MFGetUncompressedVideoFormat(pVideoFormat)
; pVideoFormat : MFVIDEOFORMAT* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	mfplat = windows.NewLazySystemDLL("MFPlat.dll")
	procMFGetUncompressedVideoFormat = mfplat.NewProc("MFGetUncompressedVideoFormat")
)

// pVideoFormat (MFVIDEOFORMAT*)
r1, _, err := procMFGetUncompressedVideoFormat.Call(
	uintptr(pVideoFormat),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function MFGetUncompressedVideoFormat(
  pVideoFormat: Pointer   // MFVIDEOFORMAT*
): DWORD; stdcall;
  external 'MFPlat.dll' name 'MFGetUncompressedVideoFormat';
result := DllCall("MFPlat\MFGetUncompressedVideoFormat"
    , "Ptr", pVideoFormat   ; MFVIDEOFORMAT*
    , "UInt")   ; return: DWORD
●MFGetUncompressedVideoFormat(pVideoFormat) = DLL("MFPlat.dll", "dword MFGetUncompressedVideoFormat(void*)")
# 呼び出し: MFGetUncompressedVideoFormat(pVideoFormat)
# pVideoFormat : MFVIDEOFORMAT* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。