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

DXVA2_DecodeBufferDesc

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

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

フィールド

フィールドサイズx64x86説明
CompressedBufferTypeDWORD4+0+0圧縮バッファの種別を示す値。ピクチャパラメータやビットストリーム等。
BufferIndexDWORD4+4+4バッファのインデックス。
DataOffsetDWORD4+8+8バッファ内の有効データ開始オフセット(バイト)。
DataSizeDWORD4+12+12有効データのバイトサイズ。
FirstMBaddressDWORD4+16+16バッファ内の最初のマクロブロックアドレス。
NumMBsInBufferDWORD4+20+20バッファに含まれるマクロブロック数。
WidthDWORD4+24+24バッファが表す領域の幅(ピクセル)。
HeightDWORD4+28+28バッファが表す領域の高さ(ピクセル)。
StrideDWORD4+32+32バッファの行あたりのバイト数(ストライド)。
ReservedBitsDWORD4+36+36予約ビット。0を設定する。
pvPVPStatevoid*8/4+40+40保護ビデオパス(PVP)状態データへのポインタ。NULL可。

各言語での定義

#include <windows.h>

// DXVA2_DecodeBufferDesc  (x64 48 / x86 44 バイト)
typedef struct DXVA2_DecodeBufferDesc {
    DWORD CompressedBufferType;
    DWORD BufferIndex;
    DWORD DataOffset;
    DWORD DataSize;
    DWORD FirstMBaddress;
    DWORD NumMBsInBuffer;
    DWORD Width;
    DWORD Height;
    DWORD Stride;
    DWORD ReservedBits;
    void* pvPVPState;
} DXVA2_DecodeBufferDesc;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXVA2_DecodeBufferDesc
{
    public uint CompressedBufferType;
    public uint BufferIndex;
    public uint DataOffset;
    public uint DataSize;
    public uint FirstMBaddress;
    public uint NumMBsInBuffer;
    public uint Width;
    public uint Height;
    public uint Stride;
    public uint ReservedBits;
    public IntPtr pvPVPState;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXVA2_DecodeBufferDesc
    Public CompressedBufferType As UInteger
    Public BufferIndex As UInteger
    Public DataOffset As UInteger
    Public DataSize As UInteger
    Public FirstMBaddress As UInteger
    Public NumMBsInBuffer As UInteger
    Public Width As UInteger
    Public Height As UInteger
    Public Stride As UInteger
    Public ReservedBits As UInteger
    Public pvPVPState As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class DXVA2_DecodeBufferDesc(ctypes.Structure):
    _fields_ = [
        ("CompressedBufferType", wintypes.DWORD),
        ("BufferIndex", wintypes.DWORD),
        ("DataOffset", wintypes.DWORD),
        ("DataSize", wintypes.DWORD),
        ("FirstMBaddress", wintypes.DWORD),
        ("NumMBsInBuffer", wintypes.DWORD),
        ("Width", wintypes.DWORD),
        ("Height", wintypes.DWORD),
        ("Stride", wintypes.DWORD),
        ("ReservedBits", wintypes.DWORD),
        ("pvPVPState", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct DXVA2_DecodeBufferDesc {
    pub CompressedBufferType: u32,
    pub BufferIndex: u32,
    pub DataOffset: u32,
    pub DataSize: u32,
    pub FirstMBaddress: u32,
    pub NumMBsInBuffer: u32,
    pub Width: u32,
    pub Height: u32,
    pub Stride: u32,
    pub ReservedBits: u32,
    pub pvPVPState: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type DXVA2_DecodeBufferDesc struct {
	CompressedBufferType uint32
	BufferIndex uint32
	DataOffset uint32
	DataSize uint32
	FirstMBaddress uint32
	NumMBsInBuffer uint32
	Width uint32
	Height uint32
	Stride uint32
	ReservedBits uint32
	pvPVPState uintptr
}
type
  DXVA2_DecodeBufferDesc = record
    CompressedBufferType: DWORD;
    BufferIndex: DWORD;
    DataOffset: DWORD;
    DataSize: DWORD;
    FirstMBaddress: DWORD;
    NumMBsInBuffer: DWORD;
    Width: DWORD;
    Height: DWORD;
    Stride: DWORD;
    ReservedBits: DWORD;
    pvPVPState: Pointer;
  end;
const DXVA2_DecodeBufferDesc = extern struct {
    CompressedBufferType: u32,
    BufferIndex: u32,
    DataOffset: u32,
    DataSize: u32,
    FirstMBaddress: u32,
    NumMBsInBuffer: u32,
    Width: u32,
    Height: u32,
    Stride: u32,
    ReservedBits: u32,
    pvPVPState: ?*anyopaque,
};
type
  DXVA2_DecodeBufferDesc {.bycopy.} = object
    CompressedBufferType: uint32
    BufferIndex: uint32
    DataOffset: uint32
    DataSize: uint32
    FirstMBaddress: uint32
    NumMBsInBuffer: uint32
    Width: uint32
    Height: uint32
    Stride: uint32
    ReservedBits: uint32
    pvPVPState: pointer
struct DXVA2_DecodeBufferDesc
{
    uint CompressedBufferType;
    uint BufferIndex;
    uint DataOffset;
    uint DataSize;
    uint FirstMBaddress;
    uint NumMBsInBuffer;
    uint Width;
    uint Height;
    uint Stride;
    uint ReservedBits;
    void* pvPVPState;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DXVA2_DecodeBufferDesc サイズ: 44 バイト(x86)
dim st, 11    ; 4byte整数×11(構造体サイズ 44 / 4 切り上げ)
; CompressedBufferType : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; BufferIndex : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; DataOffset : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; DataSize : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; FirstMBaddress : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; NumMBsInBuffer : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; Width : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; Height : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; Stride : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; ReservedBits : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; pvPVPState : void* (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DXVA2_DecodeBufferDesc サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; CompressedBufferType : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; BufferIndex : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; DataOffset : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; DataSize : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; FirstMBaddress : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; NumMBsInBuffer : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; Width : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; Height : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; Stride : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; ReservedBits : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; pvPVPState : void* (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DXVA2_DecodeBufferDesc
    #field int CompressedBufferType
    #field int BufferIndex
    #field int DataOffset
    #field int DataSize
    #field int FirstMBaddress
    #field int NumMBsInBuffer
    #field int Width
    #field int Height
    #field int Stride
    #field int ReservedBits
    #field intptr pvPVPState
#endstruct

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