ホーム › Media.Multimedia › AVIStreamReadData
AVIStreamReadData
関数AVIストリームから追加ヘッダーデータを読み込む。
シグネチャ
// AVIFIL32.dll
#include <windows.h>
HRESULT AVIStreamReadData(
IAVIStream* pavi,
DWORD fcc,
void* lp, // optional
INT* lpcb
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| pavi | IAVIStream* | in | 対象のIAVIStreamインタフェースへのポインタ。 |
| fcc | DWORD | in | 読み出すデータチャンクのFOURCC識別子。 |
| lp | void* | outoptional | 読み出したデータを受け取るバッファへのポインタ。 |
| lpcb | INT* | inout | バッファサイズの指定および読み出しバイト数を受け取るINTへのポインタ。 |
戻り値の型: HRESULT
各言語での呼び出し定義
// AVIFIL32.dll
#include <windows.h>
HRESULT AVIStreamReadData(
IAVIStream* pavi,
DWORD fcc,
void* lp, // optional
INT* lpcb
);[DllImport("AVIFIL32.dll", ExactSpelling = true)]
static extern int AVIStreamReadData(
IntPtr pavi, // IAVIStream*
uint fcc, // DWORD
IntPtr lp, // void* optional, out
ref int lpcb // INT* in/out
);<DllImport("AVIFIL32.dll", ExactSpelling:=True)>
Public Shared Function AVIStreamReadData(
pavi As IntPtr, ' IAVIStream*
fcc As UInteger, ' DWORD
lp As IntPtr, ' void* optional, out
ByRef lpcb As Integer ' INT* in/out
) As Integer
End Function' pavi : IAVIStream*
' fcc : DWORD
' lp : void* optional, out
' lpcb : INT* in/out
Declare PtrSafe Function AVIStreamReadData Lib "avifil32" ( _
ByVal pavi As LongPtr, _
ByVal fcc As Long, _
ByVal lp As LongPtr, _
ByRef lpcb As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
AVIStreamReadData = ctypes.windll.avifil32.AVIStreamReadData
AVIStreamReadData.restype = ctypes.c_int
AVIStreamReadData.argtypes = [
ctypes.c_void_p, # pavi : IAVIStream*
wintypes.DWORD, # fcc : DWORD
ctypes.POINTER(None), # lp : void* optional, out
ctypes.POINTER(ctypes.c_int), # lpcb : INT* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('AVIFIL32.dll')
AVIStreamReadData = Fiddle::Function.new(
lib['AVIStreamReadData'],
[
Fiddle::TYPE_VOIDP, # pavi : IAVIStream*
-Fiddle::TYPE_INT, # fcc : DWORD
Fiddle::TYPE_VOIDP, # lp : void* optional, out
Fiddle::TYPE_VOIDP, # lpcb : INT* in/out
],
Fiddle::TYPE_INT)#[link(name = "avifil32")]
extern "system" {
fn AVIStreamReadData(
pavi: *mut core::ffi::c_void, // IAVIStream*
fcc: u32, // DWORD
lp: *mut (), // void* optional, out
lpcb: *mut i32 // INT* in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("AVIFIL32.dll")]
public static extern int AVIStreamReadData(IntPtr pavi, uint fcc, IntPtr lp, ref int lpcb);
"@
$api = Add-Type -MemberDefinition $sig -Name 'AVIFIL32_AVIStreamReadData' -Namespace Win32 -PassThru
# $api::AVIStreamReadData(pavi, fcc, lp, lpcb)#uselib "AVIFIL32.dll"
#func global AVIStreamReadData "AVIStreamReadData" sptr, sptr, sptr, sptr
; AVIStreamReadData pavi, fcc, lp, varptr(lpcb) ; 戻り値は stat
; pavi : IAVIStream* -> "sptr"
; fcc : DWORD -> "sptr"
; lp : void* optional, out -> "sptr"
; lpcb : INT* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "AVIFIL32.dll" #cfunc global AVIStreamReadData "AVIStreamReadData" sptr, int, sptr, var ; res = AVIStreamReadData(pavi, fcc, lp, lpcb) ; pavi : IAVIStream* -> "sptr" ; fcc : DWORD -> "int" ; lp : void* optional, out -> "sptr" ; lpcb : INT* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "AVIFIL32.dll" #cfunc global AVIStreamReadData "AVIStreamReadData" sptr, int, sptr, sptr ; res = AVIStreamReadData(pavi, fcc, lp, varptr(lpcb)) ; pavi : IAVIStream* -> "sptr" ; fcc : DWORD -> "int" ; lp : void* optional, out -> "sptr" ; lpcb : INT* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT AVIStreamReadData(IAVIStream* pavi, DWORD fcc, void* lp, INT* lpcb) #uselib "AVIFIL32.dll" #cfunc global AVIStreamReadData "AVIStreamReadData" intptr, int, intptr, var ; res = AVIStreamReadData(pavi, fcc, lp, lpcb) ; pavi : IAVIStream* -> "intptr" ; fcc : DWORD -> "int" ; lp : void* optional, out -> "intptr" ; lpcb : INT* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT AVIStreamReadData(IAVIStream* pavi, DWORD fcc, void* lp, INT* lpcb) #uselib "AVIFIL32.dll" #cfunc global AVIStreamReadData "AVIStreamReadData" intptr, int, intptr, intptr ; res = AVIStreamReadData(pavi, fcc, lp, varptr(lpcb)) ; pavi : IAVIStream* -> "intptr" ; fcc : DWORD -> "int" ; lp : void* optional, out -> "intptr" ; lpcb : INT* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
avifil32 = windows.NewLazySystemDLL("AVIFIL32.dll")
procAVIStreamReadData = avifil32.NewProc("AVIStreamReadData")
)
// pavi (IAVIStream*), fcc (DWORD), lp (void* optional, out), lpcb (INT* in/out)
r1, _, err := procAVIStreamReadData.Call(
uintptr(pavi),
uintptr(fcc),
uintptr(lp),
uintptr(lpcb),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction AVIStreamReadData(
pavi: Pointer; // IAVIStream*
fcc: DWORD; // DWORD
lp: Pointer; // void* optional, out
lpcb: Pointer // INT* in/out
): Integer; stdcall;
external 'AVIFIL32.dll' name 'AVIStreamReadData';result := DllCall("AVIFIL32\AVIStreamReadData"
, "Ptr", pavi ; IAVIStream*
, "UInt", fcc ; DWORD
, "Ptr", lp ; void* optional, out
, "Ptr", lpcb ; INT* in/out
, "Int") ; return: HRESULT●AVIStreamReadData(pavi, fcc, lp, lpcb) = DLL("AVIFIL32.dll", "int AVIStreamReadData(void*, dword, void*, void*)")
# 呼び出し: AVIStreamReadData(pavi, fcc, lp, lpcb)
# pavi : IAVIStream* -> "void*"
# fcc : DWORD -> "dword"
# lp : void* optional, out -> "void*"
# lpcb : INT* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。