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

BDA_PID_MAP

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

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

フィールド

フィールドサイズx64x86説明
MediaSampleContentMEDIA_SAMPLE_CONTENT4+0+0マッピングするメディアサンプルの内容を示すMEDIA_SAMPLE_CONTENT値。
ulcPIDsDWORD4+4+4aulPIDsに含まれるPIDの数を示す。
aulPIDsDWORD4+8+8マッピング対象のPIDを格納する配列。

各言語での定義

#include <windows.h>

// BDA_PID_MAP  (x64 12 / x86 12 バイト)
typedef struct BDA_PID_MAP {
    MEDIA_SAMPLE_CONTENT MediaSampleContent;
    DWORD ulcPIDs;
    DWORD aulPIDs[1];
} BDA_PID_MAP;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct BDA_PID_MAP
{
    public int MediaSampleContent;
    public uint ulcPIDs;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public uint[] aulPIDs;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure BDA_PID_MAP
    Public MediaSampleContent As Integer
    Public ulcPIDs As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public aulPIDs() As UInteger
End Structure
import ctypes
from ctypes import wintypes

class BDA_PID_MAP(ctypes.Structure):
    _fields_ = [
        ("MediaSampleContent", ctypes.c_int),
        ("ulcPIDs", wintypes.DWORD),
        ("aulPIDs", wintypes.DWORD * 1),
    ]
#[repr(C)]
pub struct BDA_PID_MAP {
    pub MediaSampleContent: i32,
    pub ulcPIDs: u32,
    pub aulPIDs: [u32; 1],
}
import "golang.org/x/sys/windows"

type BDA_PID_MAP struct {
	MediaSampleContent int32
	ulcPIDs uint32
	aulPIDs [1]uint32
}
type
  BDA_PID_MAP = record
    MediaSampleContent: Integer;
    ulcPIDs: DWORD;
    aulPIDs: array[0..0] of DWORD;
  end;
const BDA_PID_MAP = extern struct {
    MediaSampleContent: i32,
    ulcPIDs: u32,
    aulPIDs: [1]u32,
};
type
  BDA_PID_MAP {.bycopy.} = object
    MediaSampleContent: int32
    ulcPIDs: uint32
    aulPIDs: array[1, uint32]
struct BDA_PID_MAP
{
    int MediaSampleContent;
    uint ulcPIDs;
    uint[1] aulPIDs;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; BDA_PID_MAP サイズ: 12 バイト(x64)
dim st, 3    ; 4byte整数×3(構造体サイズ 12 / 4 切り上げ)
; MediaSampleContent : MEDIA_SAMPLE_CONTENT (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; ulcPIDs : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; aulPIDs : DWORD (+8, 4byte)  varptr(st)+8 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global BDA_PID_MAP
    #field int MediaSampleContent
    #field int ulcPIDs
    #field int aulPIDs 1
#endstruct

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