ホーム › Graphics.Direct3D11 › D3D11_VIDEO_DECODER_DESC
D3D11_VIDEO_DECODER_DESC
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Guid | GUID | 16 | +0 | +0 | 使用するビデオデコードプロファイルを識別するGUID。コーデック/プロファイルを指定する。 |
| SampleWidth | DWORD | 4 | +16 | +16 | デコード対象サンプル(フレーム)の幅(ピクセル)。 |
| SampleHeight | DWORD | 4 | +20 | +20 | デコード対象サンプル(フレーム)の高さ(ピクセル)。 |
| OutputFormat | DXGI_FORMAT | 4 | +24 | +24 | デコード出力サーフェスのDXGIフォーマット。 |
各言語での定義
#include <windows.h>
// D3D11_VIDEO_DECODER_DESC (x64 28 / x86 28 バイト)
typedef struct D3D11_VIDEO_DECODER_DESC {
GUID Guid;
DWORD SampleWidth;
DWORD SampleHeight;
DXGI_FORMAT OutputFormat;
} D3D11_VIDEO_DECODER_DESC;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D11_VIDEO_DECODER_DESC
{
public Guid Guid;
public uint SampleWidth;
public uint SampleHeight;
public int OutputFormat;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D11_VIDEO_DECODER_DESC
Public Guid As Guid
Public SampleWidth As UInteger
Public SampleHeight As UInteger
Public OutputFormat As Integer
End Structureimport ctypes
from ctypes import wintypes
class D3D11_VIDEO_DECODER_DESC(ctypes.Structure):
_fields_ = [
("Guid", GUID),
("SampleWidth", wintypes.DWORD),
("SampleHeight", wintypes.DWORD),
("OutputFormat", ctypes.c_int),
]#[repr(C)]
pub struct D3D11_VIDEO_DECODER_DESC {
pub Guid: GUID,
pub SampleWidth: u32,
pub SampleHeight: u32,
pub OutputFormat: i32,
}import "golang.org/x/sys/windows"
type D3D11_VIDEO_DECODER_DESC struct {
Guid windows.GUID
SampleWidth uint32
SampleHeight uint32
OutputFormat int32
}type
D3D11_VIDEO_DECODER_DESC = record
Guid: TGUID;
SampleWidth: DWORD;
SampleHeight: DWORD;
OutputFormat: Integer;
end;const D3D11_VIDEO_DECODER_DESC = extern struct {
Guid: GUID,
SampleWidth: u32,
SampleHeight: u32,
OutputFormat: i32,
};type
D3D11_VIDEO_DECODER_DESC {.bycopy.} = object
Guid: GUID
SampleWidth: uint32
SampleHeight: uint32
OutputFormat: int32struct D3D11_VIDEO_DECODER_DESC
{
GUID Guid;
uint SampleWidth;
uint SampleHeight;
int OutputFormat;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D11_VIDEO_DECODER_DESC サイズ: 28 バイト(x64)
dim st, 7 ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; Guid : GUID (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; SampleWidth : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; SampleHeight : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; OutputFormat : DXGI_FORMAT (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
#field int Data1
#field short Data2
#field short Data3
#field byte Data4 8
#endstruct
#defstruct global D3D11_VIDEO_DECODER_DESC
#field GUID Guid
#field int SampleWidth
#field int SampleHeight
#field int OutputFormat
#endstruct
stdim st, D3D11_VIDEO_DECODER_DESC ; NSTRUCT 変数を確保
st->SampleWidth = 100
mes "SampleWidth=" + st->SampleWidth