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

ICSeqCompressFrameStart

関数
連続フレーム圧縮の開始準備を行う。
DLLMSVFW32.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

BOOL ICSeqCompressFrameStart(
    COMPVARS* pc,
    BITMAPINFO* lpbiIn
);

パラメーター

名前方向説明
pcCOMPVARS*in圧縮用の情報で初期化された COMPVARS 構造体へのポインター。
lpbiInBITMAPINFO*in圧縮するデータの形式。

戻り値の型: BOOL

公式ドキュメント

ICSeqCompressFrameStart 関数は、ICSeqCompressFrame 関数を使用してフレームのシーケンスを圧縮するためのリソースを初期化します。

戻り値

成功した場合は TRUE、それ以外の場合は FALSE を返します。

解説(Remarks)

この関数は COMPVARS 構造体を使用して指定したコンプレッサーの設定を提供し、COMPVARSlKey メンバーで指定されたレートでキーフレームを挿入します。COMPVARS の該当するメンバーを使用して、シーケンスのデータレートとキーフレームの頻度の値を指定できます。

ICSeqCompressFrameStartICSeqCompressFrame、および ICSeqCompressFrameEnd 関数を使用すると、フレームのシーケンスを指定したデータレートおよびキーフレーム数に圧縮できます。

圧縮が完了したら、ICCompressorFree 関数を使用して COMPVARS で指定したリソースを解放します。

COMPVARS は、この関数を使用する前に初期化しておく必要があります。構造体を手動で初期化することも、ICCompressorChoose 関数を使用してユーザーにコンプレッサーを指定させ COMPVARS 構造体を初期化させることもできます。

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

各言語での呼び出し定義

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

BOOL ICSeqCompressFrameStart(
    COMPVARS* pc,
    BITMAPINFO* lpbiIn
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("MSVFW32.dll", ExactSpelling = true)]
static extern bool ICSeqCompressFrameStart(
    IntPtr pc,   // COMPVARS*
    IntPtr lpbiIn   // BITMAPINFO*
);
<DllImport("MSVFW32.dll", ExactSpelling:=True)>
Public Shared Function ICSeqCompressFrameStart(
    pc As IntPtr,   ' COMPVARS*
    lpbiIn As IntPtr   ' BITMAPINFO*
) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function
' pc : COMPVARS*
' lpbiIn : BITMAPINFO*
Declare PtrSafe Function ICSeqCompressFrameStart Lib "msvfw32" ( _
    ByVal pc As LongPtr, _
    ByVal lpbiIn As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ICSeqCompressFrameStart = ctypes.windll.msvfw32.ICSeqCompressFrameStart
ICSeqCompressFrameStart.restype = wintypes.BOOL
ICSeqCompressFrameStart.argtypes = [
    ctypes.c_void_p,  # pc : COMPVARS*
    ctypes.c_void_p,  # lpbiIn : BITMAPINFO*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	msvfw32 = windows.NewLazySystemDLL("MSVFW32.dll")
	procICSeqCompressFrameStart = msvfw32.NewProc("ICSeqCompressFrameStart")
)

// pc (COMPVARS*), lpbiIn (BITMAPINFO*)
r1, _, err := procICSeqCompressFrameStart.Call(
	uintptr(pc),
	uintptr(lpbiIn),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function ICSeqCompressFrameStart(
  pc: Pointer;   // COMPVARS*
  lpbiIn: Pointer   // BITMAPINFO*
): BOOL; stdcall;
  external 'MSVFW32.dll' name 'ICSeqCompressFrameStart';
result := DllCall("MSVFW32\ICSeqCompressFrameStart"
    , "Ptr", pc   ; COMPVARS*
    , "Ptr", lpbiIn   ; BITMAPINFO*
    , "Int")   ; return: BOOL
●ICSeqCompressFrameStart(pc, lpbiIn) = DLL("MSVFW32.dll", "bool ICSeqCompressFrameStart(void*, void*)")
# 呼び出し: ICSeqCompressFrameStart(pc, lpbiIn)
# pc : COMPVARS* -> "void*"
# lpbiIn : BITMAPINFO* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
const std = @import("std");

extern "msvfw32" fn ICSeqCompressFrameStart(
    pc: [*c]COMPVARS, // COMPVARS*
    lpbiIn: [*c]BITMAPINFO // BITMAPINFO*
) callconv(std.os.windows.WINAPI) i32;
proc ICSeqCompressFrameStart(
    pc: ptr COMPVARS,  # COMPVARS*
    lpbiIn: ptr BITMAPINFO  # BITMAPINFO*
): int32 {.importc: "ICSeqCompressFrameStart", stdcall, dynlib: "MSVFW32.dll".}
pragma(lib, "msvfw32");
extern(Windows)
int ICSeqCompressFrameStart(
    COMPVARS* pc,   // COMPVARS*
    BITMAPINFO* lpbiIn   // BITMAPINFO*
);
ccall((:ICSeqCompressFrameStart, "MSVFW32.dll"), stdcall, Int32,
      (Ptr{COMPVARS}, Ptr{BITMAPINFO}),
      pc, lpbiIn)
# pc : COMPVARS* -> Ptr{COMPVARS}
# lpbiIn : BITMAPINFO* -> Ptr{BITMAPINFO}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t ICSeqCompressFrameStart(
    void* pc,
    void* lpbiIn);
]]
local msvfw32 = ffi.load("msvfw32")
-- msvfw32.ICSeqCompressFrameStart(pc, lpbiIn)
-- pc : COMPVARS*
-- lpbiIn : BITMAPINFO*
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('MSVFW32.dll');
const ICSeqCompressFrameStart = lib.func('__stdcall', 'ICSeqCompressFrameStart', 'int32_t', ['void *', 'void *']);
// ICSeqCompressFrameStart(pc, lpbiIn)
// pc : COMPVARS* -> 'void *'
// lpbiIn : BITMAPINFO* -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("MSVFW32.dll", {
  ICSeqCompressFrameStart: { parameters: ["pointer", "pointer"], result: "i32" },
});
// lib.symbols.ICSeqCompressFrameStart(pc, lpbiIn)
// pc : COMPVARS* -> "pointer"
// lpbiIn : BITMAPINFO* -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t ICSeqCompressFrameStart(
    void* pc,
    void* lpbiIn);
C, "MSVFW32.dll");
// $ffi->ICSeqCompressFrameStart(pc, lpbiIn);
// pc : COMPVARS*
// lpbiIn : BITMAPINFO*
// 構造体/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 Msvfw32 extends StdCallLibrary {
    Msvfw32 INSTANCE = Native.load("msvfw32", Msvfw32.class);
    boolean ICSeqCompressFrameStart(
        Pointer pc,   // COMPVARS*
        Pointer lpbiIn   // BITMAPINFO*
    );
}
@[Link("msvfw32")]
lib LibMSVFW32
  fun ICSeqCompressFrameStart = ICSeqCompressFrameStart(
    pc : COMPVARS*,   # COMPVARS*
    lpbiIn : BITMAPINFO*   # BITMAPINFO*
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef ICSeqCompressFrameStartNative = Int32 Function(Pointer<Void>, Pointer<Void>);
typedef ICSeqCompressFrameStartDart = int Function(Pointer<Void>, Pointer<Void>);
final ICSeqCompressFrameStart = DynamicLibrary.open('MSVFW32.dll')
    .lookupFunction<ICSeqCompressFrameStartNative, ICSeqCompressFrameStartDart>('ICSeqCompressFrameStart');
// pc : COMPVARS* -> Pointer<Void>
// lpbiIn : BITMAPINFO* -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function ICSeqCompressFrameStart(
  pc: Pointer;   // COMPVARS*
  lpbiIn: Pointer   // BITMAPINFO*
): BOOL; stdcall;
  external 'MSVFW32.dll' name 'ICSeqCompressFrameStart';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "ICSeqCompressFrameStart"
  c_ICSeqCompressFrameStart :: Ptr () -> Ptr () -> IO CInt
-- pc : COMPVARS* -> Ptr ()
-- lpbiIn : BITMAPINFO* -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let icseqcompressframestart =
  foreign "ICSeqCompressFrameStart"
    ((ptr void) @-> (ptr void) @-> returning int32_t)
(* pc : COMPVARS* -> (ptr void) *)
(* lpbiIn : BITMAPINFO* -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library msvfw32 (t "MSVFW32.dll"))
(cffi:use-foreign-library msvfw32)

(cffi:defcfun ("ICSeqCompressFrameStart" icseq-compress-frame-start :convention :stdcall) :int32
  (pc :pointer)   ; COMPVARS*
  (lpbi-in :pointer))   ; BITMAPINFO*
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $ICSeqCompressFrameStart = Win32::API::More->new('MSVFW32',
    'BOOL ICSeqCompressFrameStart(LPVOID pc, LPVOID lpbiIn)');
# my $ret = $ICSeqCompressFrameStart->Call($pc, $lpbiIn);
# pc : COMPVARS* -> LPVOID
# lpbiIn : BITMAPINFO* -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型