Win32 API 日本語リファレンス
ホームGraphics.Direct3D11 › D3D11_VIDEO_DECODER_BUFFER_DESC

D3D11_VIDEO_DECODER_BUFFER_DESC

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

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

フィールド

フィールドサイズx64x86説明
BufferTypeD3D11_VIDEO_DECODER_BUFFER_TYPE4+0+0バッファの種類を示すD3D11_VIDEO_DECODER_BUFFER_TYPE列挙値。
BufferIndexDWORD4+4+4予約済み。0に設定する。
DataOffsetDWORD4+8+8バッファ内の有効データ開始位置のオフセット(バイト)。
DataSizeDWORD4+12+12バッファ内の有効データのサイズ(バイト)。
FirstMBaddressDWORD4+16+16このバッファが扱う最初のマクロブロックのアドレス。
NumMBsInBufferDWORD4+20+20このバッファに含まれるマクロブロックの数。
WidthDWORD4+24+24予約済み。0に設定する。
HeightDWORD4+28+28予約済み。0に設定する。
StrideDWORD4+32+32予約済み。0に設定する。
ReservedBitsDWORD4+36+36予約済み。0に設定する。
pIVvoid*8/4+40+40暗号化に使用する初期化ベクトルへのポインタ。暗号化なしの場合はNULL。
IVSizeDWORD4+48+44pIVが指す初期化ベクトルのサイズ(バイト)。
PartialEncryptionBOOL4+52+48バッファが部分的に暗号化されているか。TRUEで部分暗号化。
EncryptedBlockInfoD3D11_ENCRYPTED_BLOCK_INFO12+56+52部分暗号化時の暗号化ブロック情報を示すD3D11_ENCRYPTED_BLOCK_INFO。

各言語での定義

#include <windows.h>

// D3D11_ENCRYPTED_BLOCK_INFO  (x64 12 / x86 12 バイト)
typedef struct D3D11_ENCRYPTED_BLOCK_INFO {
    DWORD NumEncryptedBytesAtBeginning;
    DWORD NumBytesInSkipPattern;
    DWORD NumBytesInEncryptPattern;
} D3D11_ENCRYPTED_BLOCK_INFO;

// D3D11_VIDEO_DECODER_BUFFER_DESC  (x64 72 / x86 64 バイト)
typedef struct D3D11_VIDEO_DECODER_BUFFER_DESC {
    D3D11_VIDEO_DECODER_BUFFER_TYPE BufferType;
    DWORD BufferIndex;
    DWORD DataOffset;
    DWORD DataSize;
    DWORD FirstMBaddress;
    DWORD NumMBsInBuffer;
    DWORD Width;
    DWORD Height;
    DWORD Stride;
    DWORD ReservedBits;
    void* pIV;
    DWORD IVSize;
    BOOL PartialEncryption;
    D3D11_ENCRYPTED_BLOCK_INFO EncryptedBlockInfo;
} D3D11_VIDEO_DECODER_BUFFER_DESC;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D11_ENCRYPTED_BLOCK_INFO
{
    public uint NumEncryptedBytesAtBeginning;
    public uint NumBytesInSkipPattern;
    public uint NumBytesInEncryptPattern;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D11_VIDEO_DECODER_BUFFER_DESC
{
    public int BufferType;
    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 pIV;
    public uint IVSize;
    [MarshalAs(UnmanagedType.Bool)] public bool PartialEncryption;
    public D3D11_ENCRYPTED_BLOCK_INFO EncryptedBlockInfo;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D11_ENCRYPTED_BLOCK_INFO
    Public NumEncryptedBytesAtBeginning As UInteger
    Public NumBytesInSkipPattern As UInteger
    Public NumBytesInEncryptPattern As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D11_VIDEO_DECODER_BUFFER_DESC
    Public BufferType As Integer
    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 pIV As IntPtr
    Public IVSize As UInteger
    <MarshalAs(UnmanagedType.Bool)> Public PartialEncryption As Boolean
    Public EncryptedBlockInfo As D3D11_ENCRYPTED_BLOCK_INFO
End Structure
import ctypes
from ctypes import wintypes

class D3D11_ENCRYPTED_BLOCK_INFO(ctypes.Structure):
    _fields_ = [
        ("NumEncryptedBytesAtBeginning", wintypes.DWORD),
        ("NumBytesInSkipPattern", wintypes.DWORD),
        ("NumBytesInEncryptPattern", wintypes.DWORD),
    ]

class D3D11_VIDEO_DECODER_BUFFER_DESC(ctypes.Structure):
    _fields_ = [
        ("BufferType", ctypes.c_int),
        ("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),
        ("pIV", ctypes.c_void_p),
        ("IVSize", wintypes.DWORD),
        ("PartialEncryption", wintypes.BOOL),
        ("EncryptedBlockInfo", D3D11_ENCRYPTED_BLOCK_INFO),
    ]
#[repr(C)]
pub struct D3D11_ENCRYPTED_BLOCK_INFO {
    pub NumEncryptedBytesAtBeginning: u32,
    pub NumBytesInSkipPattern: u32,
    pub NumBytesInEncryptPattern: u32,
}

#[repr(C)]
pub struct D3D11_VIDEO_DECODER_BUFFER_DESC {
    pub BufferType: i32,
    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 pIV: *mut core::ffi::c_void,
    pub IVSize: u32,
    pub PartialEncryption: i32,
    pub EncryptedBlockInfo: D3D11_ENCRYPTED_BLOCK_INFO,
}
import "golang.org/x/sys/windows"

type D3D11_ENCRYPTED_BLOCK_INFO struct {
	NumEncryptedBytesAtBeginning uint32
	NumBytesInSkipPattern uint32
	NumBytesInEncryptPattern uint32
}

type D3D11_VIDEO_DECODER_BUFFER_DESC struct {
	BufferType int32
	BufferIndex uint32
	DataOffset uint32
	DataSize uint32
	FirstMBaddress uint32
	NumMBsInBuffer uint32
	Width uint32
	Height uint32
	Stride uint32
	ReservedBits uint32
	pIV uintptr
	IVSize uint32
	PartialEncryption int32
	EncryptedBlockInfo D3D11_ENCRYPTED_BLOCK_INFO
}
type
  D3D11_ENCRYPTED_BLOCK_INFO = record
    NumEncryptedBytesAtBeginning: DWORD;
    NumBytesInSkipPattern: DWORD;
    NumBytesInEncryptPattern: DWORD;
  end;

  D3D11_VIDEO_DECODER_BUFFER_DESC = record
    BufferType: Integer;
    BufferIndex: DWORD;
    DataOffset: DWORD;
    DataSize: DWORD;
    FirstMBaddress: DWORD;
    NumMBsInBuffer: DWORD;
    Width: DWORD;
    Height: DWORD;
    Stride: DWORD;
    ReservedBits: DWORD;
    pIV: Pointer;
    IVSize: DWORD;
    PartialEncryption: BOOL;
    EncryptedBlockInfo: D3D11_ENCRYPTED_BLOCK_INFO;
  end;
const D3D11_ENCRYPTED_BLOCK_INFO = extern struct {
    NumEncryptedBytesAtBeginning: u32,
    NumBytesInSkipPattern: u32,
    NumBytesInEncryptPattern: u32,
};

const D3D11_VIDEO_DECODER_BUFFER_DESC = extern struct {
    BufferType: i32,
    BufferIndex: u32,
    DataOffset: u32,
    DataSize: u32,
    FirstMBaddress: u32,
    NumMBsInBuffer: u32,
    Width: u32,
    Height: u32,
    Stride: u32,
    ReservedBits: u32,
    pIV: ?*anyopaque,
    IVSize: u32,
    PartialEncryption: i32,
    EncryptedBlockInfo: D3D11_ENCRYPTED_BLOCK_INFO,
};
type
  D3D11_ENCRYPTED_BLOCK_INFO {.bycopy.} = object
    NumEncryptedBytesAtBeginning: uint32
    NumBytesInSkipPattern: uint32
    NumBytesInEncryptPattern: uint32

  D3D11_VIDEO_DECODER_BUFFER_DESC {.bycopy.} = object
    BufferType: int32
    BufferIndex: uint32
    DataOffset: uint32
    DataSize: uint32
    FirstMBaddress: uint32
    NumMBsInBuffer: uint32
    Width: uint32
    Height: uint32
    Stride: uint32
    ReservedBits: uint32
    pIV: pointer
    IVSize: uint32
    PartialEncryption: int32
    EncryptedBlockInfo: D3D11_ENCRYPTED_BLOCK_INFO
struct D3D11_ENCRYPTED_BLOCK_INFO
{
    uint NumEncryptedBytesAtBeginning;
    uint NumBytesInSkipPattern;
    uint NumBytesInEncryptPattern;
}

struct D3D11_VIDEO_DECODER_BUFFER_DESC
{
    int BufferType;
    uint BufferIndex;
    uint DataOffset;
    uint DataSize;
    uint FirstMBaddress;
    uint NumMBsInBuffer;
    uint Width;
    uint Height;
    uint Stride;
    uint ReservedBits;
    void* pIV;
    uint IVSize;
    int PartialEncryption;
    D3D11_ENCRYPTED_BLOCK_INFO EncryptedBlockInfo;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; D3D11_VIDEO_DECODER_BUFFER_DESC サイズ: 64 バイト(x86)
dim st, 16    ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; BufferType : D3D11_VIDEO_DECODER_BUFFER_TYPE (+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 も可)
; pIV : void* (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; IVSize : DWORD (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; PartialEncryption : BOOL (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; EncryptedBlockInfo : D3D11_ENCRYPTED_BLOCK_INFO (+52, 12byte)  varptr(st)+52 を基点に操作(12byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D11_VIDEO_DECODER_BUFFER_DESC サイズ: 72 バイト(x64)
dim st, 18    ; 4byte整数×18(構造体サイズ 72 / 4 切り上げ)
; BufferType : D3D11_VIDEO_DECODER_BUFFER_TYPE (+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 も可)
; pIV : void* (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; IVSize : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; PartialEncryption : BOOL (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; EncryptedBlockInfo : D3D11_ENCRYPTED_BLOCK_INFO (+56, 12byte)  varptr(st)+56 を基点に操作(12byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global D3D11_ENCRYPTED_BLOCK_INFO
    #field int NumEncryptedBytesAtBeginning
    #field int NumBytesInSkipPattern
    #field int NumBytesInEncryptPattern
#endstruct

#defstruct global D3D11_VIDEO_DECODER_BUFFER_DESC
    #field int BufferType
    #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 pIV
    #field int IVSize
    #field bool PartialEncryption
    #field D3D11_ENCRYPTED_BLOCK_INFO EncryptedBlockInfo
#endstruct

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