ホーム › Media.MediaFoundation › DXVACompBufferInfo
DXVACompBufferInfo
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| NumCompBuffers | DWORD | 4 | +0 | +0 | 確保が必要な圧縮バッファの数を示す。 |
| WidthToCreate | DWORD | 4 | +4 | +4 | 生成するバッファサーフェスの幅(ピクセル)を示す。 |
| HeightToCreate | DWORD | 4 | +8 | +8 | 生成するバッファサーフェスの高さ(ピクセル)を示す。 |
| BytesToAllocate | DWORD | 4 | +12 | +12 | バッファごとに確保すべきバイト数を示す。 |
| Usage | DWORD | 4 | +16 | +16 | バッファの用途を示すD3D使用法フラグである。 |
| Pool | D3DPOOL | 4 | +20 | +20 | バッファを配置するD3Dメモリプールを示す。 |
| Format | D3DFORMAT | 4 | +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 Structureimport 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: uint32struct 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