ホーム › Graphics.Direct3D11 › D3D11_VIDEO_DECODER_BUFFER_DESC
D3D11_VIDEO_DECODER_BUFFER_DESC
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| BufferType | D3D11_VIDEO_DECODER_BUFFER_TYPE | 4 | +0 | +0 | バッファーの種類。D3D11_VIDEO_DECODER_BUFFER_TYPE 列挙型のメンバーとして指定します。 |
| BufferIndex | DWORD | 4 | +4 | +4 | 予約済みです。 |
| DataOffset | DWORD | 4 | +8 | +8 | バッファーの先頭から対象データまでのオフセット (バイト単位)。この値は 0 でなければなりません。 |
| DataSize | DWORD | 4 | +12 | +12 | バッファ内の有効データのサイズ(バイト)。 |
| FirstMBaddress | DWORD | 4 | +16 | +16 | バッファー内の最初のマクロブロックのマクロブロックアドレス。マクロブロックアドレスはラスタースキャン順で指定します。 |
| NumMBsInBuffer | DWORD | 4 | +20 | +20 | バッファー内のデータのマクロブロック数。この数にはスキップされたマクロブロックも含まれます。 |
| Width | DWORD | 4 | +24 | +24 | 予約済みです。0 に設定します。 |
| Height | DWORD | 4 | +28 | +28 | 予約済みです。0 に設定します。 |
| Stride | DWORD | 4 | +32 | +32 | 予約済みです。0 に設定します。 |
| ReservedBits | DWORD | 4 | +36 | +36 | 予約済みです。0 に設定します。 |
| pIV | void* | 8/4 | +40 | +40 | 暗号化されたデータの初期化ベクター (IV) を格納するバッファーへのポインター。デコードバッファーに暗号化されたデータが含まれない場合は、このメンバーに NULL を設定します。 |
| IVSize | DWORD | 4 | +48 | +44 | pIV パラメーターで指定したバッファーのサイズ。pIV が NULL の場合は、このメンバーに 0 を設定します。 |
| PartialEncryption | BOOL | 4 | +52 | +48 | TRUE の場合、ビデオサーフェスは部分的に暗号化されています。 |
| EncryptedBlockInfo | D3D11_ENCRYPTED_BLOCK_INFO | 12 | +56 | +52 | サーフェスのどのバイトが暗号化されているかを指定する D3D11_ENCRYPTED_BLOCK_INFO 構造体。 |
公式ドキュメント
デコード用の圧縮バッファーについて説明します。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#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 Structureimport 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_INFOstruct 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