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

DXVA_VideoSample

構造体
サイズx64: 32 バイト / x86: 24 バイト

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

フィールド

フィールドサイズx64x86説明
rtStartLONGLONG8+0+0サンプルの表示開始時刻(100ナノ秒単位)を示す。
rtEndLONGLONG8+8+8サンプルの表示終了時刻(100ナノ秒単位)を示す。
SampleFormatDXVA_SampleFormat4+16+16サンプルのフォーマット情報(インターレース種別等)を示す。
lpDDSSrcSurfacevoid*8/4+24+20入力ソースとなるDirectDrawサーフェスへのポインタである。

各言語での定義

#include <windows.h>

// DXVA_VideoSample  (x64 32 / x86 24 バイト)
typedef struct DXVA_VideoSample {
    LONGLONG rtStart;
    LONGLONG rtEnd;
    DXVA_SampleFormat SampleFormat;
    void* lpDDSSrcSurface;
} DXVA_VideoSample;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXVA_VideoSample
{
    public long rtStart;
    public long rtEnd;
    public int SampleFormat;
    public IntPtr lpDDSSrcSurface;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXVA_VideoSample
    Public rtStart As Long
    Public rtEnd As Long
    Public SampleFormat As Integer
    Public lpDDSSrcSurface As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class DXVA_VideoSample(ctypes.Structure):
    _fields_ = [
        ("rtStart", ctypes.c_longlong),
        ("rtEnd", ctypes.c_longlong),
        ("SampleFormat", ctypes.c_int),
        ("lpDDSSrcSurface", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct DXVA_VideoSample {
    pub rtStart: i64,
    pub rtEnd: i64,
    pub SampleFormat: i32,
    pub lpDDSSrcSurface: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type DXVA_VideoSample struct {
	rtStart int64
	rtEnd int64
	SampleFormat int32
	lpDDSSrcSurface uintptr
}
type
  DXVA_VideoSample = record
    rtStart: Int64;
    rtEnd: Int64;
    SampleFormat: Integer;
    lpDDSSrcSurface: Pointer;
  end;
const DXVA_VideoSample = extern struct {
    rtStart: i64,
    rtEnd: i64,
    SampleFormat: i32,
    lpDDSSrcSurface: ?*anyopaque,
};
type
  DXVA_VideoSample {.bycopy.} = object
    rtStart: int64
    rtEnd: int64
    SampleFormat: int32
    lpDDSSrcSurface: pointer
struct DXVA_VideoSample
{
    long rtStart;
    long rtEnd;
    int SampleFormat;
    void* lpDDSSrcSurface;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DXVA_VideoSample サイズ: 24 バイト(x86)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; rtStart : LONGLONG (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; rtEnd : LONGLONG (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; SampleFormat : DXVA_SampleFormat (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; lpDDSSrcSurface : void* (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DXVA_VideoSample サイズ: 32 バイト(x64)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; rtStart : LONGLONG (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; rtEnd : LONGLONG (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; SampleFormat : DXVA_SampleFormat (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; lpDDSSrcSurface : void* (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DXVA_VideoSample
    #field int64 rtStart
    #field int64 rtEnd
    #field int SampleFormat
    #field intptr lpDDSSrcSurface
#endstruct

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