ホーム › Graphics.Direct3D11 › D3D11_VIDEO_DECODER_BUFFER_DESC2
D3D11_VIDEO_DECODER_BUFFER_DESC2
構造体サイズ=各フィールドのバイト数(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列挙値。 |
| DataOffset | DWORD | 4 | +4 | +4 | バッファ内の有効データ開始位置のオフセット(バイト)。 |
| DataSize | DWORD | 4 | +8 | +8 | バッファ内の有効データのサイズ(バイト)。 |
| pIV | void* | 8/4 | +16 | +12 | 暗号化に使用する初期化ベクトルへのポインタ。暗号化なしの場合はNULL。 |
| IVSize | DWORD | 4 | +24 | +16 | pIVが指す初期化ベクトルのサイズ(バイト)。 |
| pSubSampleMappingBlock | D3D11_VIDEO_DECODER_SUB_SAMPLE_MAPPING_BLOCK* | 8/4 | +32 | +20 | サブサンプル暗号化マッピング配列へのポインタ。NULL可。 |
| SubSampleMappingCount | DWORD | 4 | +40 | +24 | pSubSampleMappingBlockが指す配列の要素数。 |
| cBlocksStripeEncrypted | DWORD | 4 | +44 | +28 | パターン暗号化におけるストライプ単位の暗号化ブロック数。 |
| cBlocksStripeClear | DWORD | 4 | +48 | +32 | パターン暗号化におけるストライプ単位の平文ブロック数。 |
各言語での定義
#include <windows.h>
// D3D11_VIDEO_DECODER_BUFFER_DESC2 (x64 56 / x86 36 バイト)
typedef struct D3D11_VIDEO_DECODER_BUFFER_DESC2 {
D3D11_VIDEO_DECODER_BUFFER_TYPE BufferType;
DWORD DataOffset;
DWORD DataSize;
void* pIV;
DWORD IVSize;
D3D11_VIDEO_DECODER_SUB_SAMPLE_MAPPING_BLOCK* pSubSampleMappingBlock;
DWORD SubSampleMappingCount;
DWORD cBlocksStripeEncrypted;
DWORD cBlocksStripeClear;
} D3D11_VIDEO_DECODER_BUFFER_DESC2;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D11_VIDEO_DECODER_BUFFER_DESC2
{
public int BufferType;
public uint DataOffset;
public uint DataSize;
public IntPtr pIV;
public uint IVSize;
public IntPtr pSubSampleMappingBlock;
public uint SubSampleMappingCount;
public uint cBlocksStripeEncrypted;
public uint cBlocksStripeClear;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D11_VIDEO_DECODER_BUFFER_DESC2
Public BufferType As Integer
Public DataOffset As UInteger
Public DataSize As UInteger
Public pIV As IntPtr
Public IVSize As UInteger
Public pSubSampleMappingBlock As IntPtr
Public SubSampleMappingCount As UInteger
Public cBlocksStripeEncrypted As UInteger
Public cBlocksStripeClear As UInteger
End Structureimport ctypes
from ctypes import wintypes
class D3D11_VIDEO_DECODER_BUFFER_DESC2(ctypes.Structure):
_fields_ = [
("BufferType", ctypes.c_int),
("DataOffset", wintypes.DWORD),
("DataSize", wintypes.DWORD),
("pIV", ctypes.c_void_p),
("IVSize", wintypes.DWORD),
("pSubSampleMappingBlock", ctypes.c_void_p),
("SubSampleMappingCount", wintypes.DWORD),
("cBlocksStripeEncrypted", wintypes.DWORD),
("cBlocksStripeClear", wintypes.DWORD),
]#[repr(C)]
pub struct D3D11_VIDEO_DECODER_BUFFER_DESC2 {
pub BufferType: i32,
pub DataOffset: u32,
pub DataSize: u32,
pub pIV: *mut core::ffi::c_void,
pub IVSize: u32,
pub pSubSampleMappingBlock: *mut core::ffi::c_void,
pub SubSampleMappingCount: u32,
pub cBlocksStripeEncrypted: u32,
pub cBlocksStripeClear: u32,
}import "golang.org/x/sys/windows"
type D3D11_VIDEO_DECODER_BUFFER_DESC2 struct {
BufferType int32
DataOffset uint32
DataSize uint32
pIV uintptr
IVSize uint32
pSubSampleMappingBlock uintptr
SubSampleMappingCount uint32
cBlocksStripeEncrypted uint32
cBlocksStripeClear uint32
}type
D3D11_VIDEO_DECODER_BUFFER_DESC2 = record
BufferType: Integer;
DataOffset: DWORD;
DataSize: DWORD;
pIV: Pointer;
IVSize: DWORD;
pSubSampleMappingBlock: Pointer;
SubSampleMappingCount: DWORD;
cBlocksStripeEncrypted: DWORD;
cBlocksStripeClear: DWORD;
end;const D3D11_VIDEO_DECODER_BUFFER_DESC2 = extern struct {
BufferType: i32,
DataOffset: u32,
DataSize: u32,
pIV: ?*anyopaque,
IVSize: u32,
pSubSampleMappingBlock: ?*anyopaque,
SubSampleMappingCount: u32,
cBlocksStripeEncrypted: u32,
cBlocksStripeClear: u32,
};type
D3D11_VIDEO_DECODER_BUFFER_DESC2 {.bycopy.} = object
BufferType: int32
DataOffset: uint32
DataSize: uint32
pIV: pointer
IVSize: uint32
pSubSampleMappingBlock: pointer
SubSampleMappingCount: uint32
cBlocksStripeEncrypted: uint32
cBlocksStripeClear: uint32struct D3D11_VIDEO_DECODER_BUFFER_DESC2
{
int BufferType;
uint DataOffset;
uint DataSize;
void* pIV;
uint IVSize;
void* pSubSampleMappingBlock;
uint SubSampleMappingCount;
uint cBlocksStripeEncrypted;
uint cBlocksStripeClear;
}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_DESC2 サイズ: 36 バイト(x86)
dim st, 9 ; 4byte整数×9(構造体サイズ 36 / 4 切り上げ)
; BufferType : D3D11_VIDEO_DECODER_BUFFER_TYPE (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; DataOffset : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; DataSize : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; pIV : void* (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; IVSize : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; pSubSampleMappingBlock : D3D11_VIDEO_DECODER_SUB_SAMPLE_MAPPING_BLOCK* (+20, 4byte) varptr(st)+20 を基点に操作(4byte:入れ子/配列)
; SubSampleMappingCount : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; cBlocksStripeEncrypted : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; cBlocksStripeClear : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D11_VIDEO_DECODER_BUFFER_DESC2 サイズ: 56 バイト(x64)
dim st, 14 ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; BufferType : D3D11_VIDEO_DECODER_BUFFER_TYPE (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; DataOffset : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; DataSize : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; pIV : void* (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; IVSize : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; pSubSampleMappingBlock : D3D11_VIDEO_DECODER_SUB_SAMPLE_MAPPING_BLOCK* (+32, 8byte) varptr(st)+32 を基点に操作(8byte:入れ子/配列)
; SubSampleMappingCount : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; cBlocksStripeEncrypted : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; cBlocksStripeClear : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3D11_VIDEO_DECODER_BUFFER_DESC2
#field int BufferType
#field int DataOffset
#field int DataSize
#field intptr pIV
#field int IVSize
#field intptr pSubSampleMappingBlock
#field int SubSampleMappingCount
#field int cBlocksStripeEncrypted
#field int cBlocksStripeClear
#endstruct
stdim st, D3D11_VIDEO_DECODER_BUFFER_DESC2 ; NSTRUCT 変数を確保
st->BufferType = 100
mes "BufferType=" + st->BufferType