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

DXVACompBufferInfo

構造体
サイズx64: 28 バイト / x86: 28 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
NumCompBuffersDWORD4+0+0確保が必要な圧縮バッファの数を示す。
WidthToCreateDWORD4+4+4生成するバッファサーフェスの幅(ピクセル)を示す。
HeightToCreateDWORD4+8+8生成するバッファサーフェスの高さ(ピクセル)を示す。
BytesToAllocateDWORD4+12+12バッファごとに確保すべきバイト数を示す。
UsageDWORD4+16+16バッファの用途を示すD3D使用法フラグである。
PoolD3DPOOL4+20+20バッファを配置するD3Dメモリプールを示す。
FormatD3DFORMAT4+24+24バッファサーフェスのD3Dフォーマットを示す。

各言語での定義

#include <windows.h>

// DXVACompBufferInfo  (x64 28 / x86 28 バイト)
typedef struct DXVACompBufferInfo {
    DWORD NumCompBuffers;
    DWORD WidthToCreate;
    DWORD HeightToCreate;
    DWORD BytesToAllocate;
    DWORD Usage;
    D3DPOOL Pool;
    D3DFORMAT Format;
} DXVACompBufferInfo;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXVACompBufferInfo
{
    public uint NumCompBuffers;
    public uint WidthToCreate;
    public uint HeightToCreate;
    public uint BytesToAllocate;
    public uint Usage;
    public int Pool;
    public uint Format;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXVACompBufferInfo
    Public NumCompBuffers As UInteger
    Public WidthToCreate As UInteger
    Public HeightToCreate As UInteger
    Public BytesToAllocate As UInteger
    Public Usage As UInteger
    Public Pool As Integer
    Public Format As UInteger
End Structure
import ctypes
from ctypes import wintypes

class DXVACompBufferInfo(ctypes.Structure):
    _fields_ = [
        ("NumCompBuffers", wintypes.DWORD),
        ("WidthToCreate", wintypes.DWORD),
        ("HeightToCreate", wintypes.DWORD),
        ("BytesToAllocate", wintypes.DWORD),
        ("Usage", wintypes.DWORD),
        ("Pool", ctypes.c_int),
        ("Format", wintypes.DWORD),
    ]
#[repr(C)]
pub struct DXVACompBufferInfo {
    pub NumCompBuffers: u32,
    pub WidthToCreate: u32,
    pub HeightToCreate: u32,
    pub BytesToAllocate: u32,
    pub Usage: u32,
    pub Pool: i32,
    pub Format: u32,
}
import "golang.org/x/sys/windows"

type DXVACompBufferInfo struct {
	NumCompBuffers uint32
	WidthToCreate uint32
	HeightToCreate uint32
	BytesToAllocate uint32
	Usage uint32
	Pool int32
	Format uint32
}
type
  DXVACompBufferInfo = record
    NumCompBuffers: DWORD;
    WidthToCreate: DWORD;
    HeightToCreate: DWORD;
    BytesToAllocate: DWORD;
    Usage: DWORD;
    Pool: Integer;
    Format: DWORD;
  end;
const DXVACompBufferInfo = extern struct {
    NumCompBuffers: u32,
    WidthToCreate: u32,
    HeightToCreate: u32,
    BytesToAllocate: u32,
    Usage: u32,
    Pool: i32,
    Format: u32,
};
type
  DXVACompBufferInfo {.bycopy.} = object
    NumCompBuffers: uint32
    WidthToCreate: uint32
    HeightToCreate: uint32
    BytesToAllocate: uint32
    Usage: uint32
    Pool: int32
    Format: uint32
struct DXVACompBufferInfo
{
    uint NumCompBuffers;
    uint WidthToCreate;
    uint HeightToCreate;
    uint BytesToAllocate;
    uint Usage;
    int Pool;
    uint Format;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DXVACompBufferInfo サイズ: 28 バイト(x64)
dim st, 7    ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; NumCompBuffers : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; WidthToCreate : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; HeightToCreate : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; BytesToAllocate : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; Usage : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; Pool : D3DPOOL (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; Format : D3DFORMAT (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DXVACompBufferInfo
    #field int NumCompBuffers
    #field int WidthToCreate
    #field int HeightToCreate
    #field int BytesToAllocate
    #field int Usage
    #field int Pool
    #field int Format
#endstruct

stdim st, DXVACompBufferInfo        ; NSTRUCT 変数を確保
st->NumCompBuffers = 100
mes "NumCompBuffers=" + st->NumCompBuffers