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

OPM_SET_ACP_AND_CGMSA_SIGNALING_PARAMETERS

構造体
サイズx64: 64 バイト / x86: 64 バイトパッキング1

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

フィールド

フィールドサイズx64x86説明
ulNewTVProtectionStandardDWORD4+0+0新たに設定するTV保護規格を示す値。
ulAspectRatioChangeMask1DWORD4+4+4アスペクト比データ1の変更対象ビットを示すマスク。
ulAspectRatioData1DWORD4+8+8設定するアスペクト比シグナリングデータ1。
ulAspectRatioChangeMask2DWORD4+12+12アスペクト比データ2の変更対象ビットを示すマスク。
ulAspectRatioData2DWORD4+16+16設定するアスペクト比シグナリングデータ2。
ulAspectRatioChangeMask3DWORD4+20+20アスペクト比データ3の変更対象ビットを示すマスク。
ulAspectRatioData3DWORD4+24+24設定するアスペクト比シグナリングデータ3。
ulReservedDWORD16+28+28予約領域。0を設定する。
ulReserved2DWORD16+44+44予約領域。0を設定する。
ulReserved3DWORD4+60+60予約領域。0を設定する。

各言語での定義

#include <windows.h>

// OPM_SET_ACP_AND_CGMSA_SIGNALING_PARAMETERS  (x64 64 / x86 64 バイト)
#pragma pack(push, 1)
typedef struct OPM_SET_ACP_AND_CGMSA_SIGNALING_PARAMETERS {
    DWORD ulNewTVProtectionStandard;
    DWORD ulAspectRatioChangeMask1;
    DWORD ulAspectRatioData1;
    DWORD ulAspectRatioChangeMask2;
    DWORD ulAspectRatioData2;
    DWORD ulAspectRatioChangeMask3;
    DWORD ulAspectRatioData3;
    DWORD ulReserved[4];
    DWORD ulReserved2[4];
    DWORD ulReserved3;
} OPM_SET_ACP_AND_CGMSA_SIGNALING_PARAMETERS;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct OPM_SET_ACP_AND_CGMSA_SIGNALING_PARAMETERS
{
    public uint ulNewTVProtectionStandard;
    public uint ulAspectRatioChangeMask1;
    public uint ulAspectRatioData1;
    public uint ulAspectRatioChangeMask2;
    public uint ulAspectRatioData2;
    public uint ulAspectRatioChangeMask3;
    public uint ulAspectRatioData3;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public uint[] ulReserved;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public uint[] ulReserved2;
    public uint ulReserved3;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure OPM_SET_ACP_AND_CGMSA_SIGNALING_PARAMETERS
    Public ulNewTVProtectionStandard As UInteger
    Public ulAspectRatioChangeMask1 As UInteger
    Public ulAspectRatioData1 As UInteger
    Public ulAspectRatioChangeMask2 As UInteger
    Public ulAspectRatioData2 As UInteger
    Public ulAspectRatioChangeMask3 As UInteger
    Public ulAspectRatioData3 As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=4)> Public ulReserved() As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=4)> Public ulReserved2() As UInteger
    Public ulReserved3 As UInteger
End Structure
import ctypes
from ctypes import wintypes

class OPM_SET_ACP_AND_CGMSA_SIGNALING_PARAMETERS(ctypes.Structure):
    _pack_ = 1
    _fields_ = [
        ("ulNewTVProtectionStandard", wintypes.DWORD),
        ("ulAspectRatioChangeMask1", wintypes.DWORD),
        ("ulAspectRatioData1", wintypes.DWORD),
        ("ulAspectRatioChangeMask2", wintypes.DWORD),
        ("ulAspectRatioData2", wintypes.DWORD),
        ("ulAspectRatioChangeMask3", wintypes.DWORD),
        ("ulAspectRatioData3", wintypes.DWORD),
        ("ulReserved", wintypes.DWORD * 4),
        ("ulReserved2", wintypes.DWORD * 4),
        ("ulReserved3", wintypes.DWORD),
    ]
#[repr(C, packed(1))]
pub struct OPM_SET_ACP_AND_CGMSA_SIGNALING_PARAMETERS {
    pub ulNewTVProtectionStandard: u32,
    pub ulAspectRatioChangeMask1: u32,
    pub ulAspectRatioData1: u32,
    pub ulAspectRatioChangeMask2: u32,
    pub ulAspectRatioData2: u32,
    pub ulAspectRatioChangeMask3: u32,
    pub ulAspectRatioData3: u32,
    pub ulReserved: [u32; 4],
    pub ulReserved2: [u32; 4],
    pub ulReserved3: u32,
}
import "golang.org/x/sys/windows"

type OPM_SET_ACP_AND_CGMSA_SIGNALING_PARAMETERS struct {
	ulNewTVProtectionStandard uint32
	ulAspectRatioChangeMask1 uint32
	ulAspectRatioData1 uint32
	ulAspectRatioChangeMask2 uint32
	ulAspectRatioData2 uint32
	ulAspectRatioChangeMask3 uint32
	ulAspectRatioData3 uint32
	ulReserved [4]uint32
	ulReserved2 [4]uint32
	ulReserved3 uint32
}
type
  OPM_SET_ACP_AND_CGMSA_SIGNALING_PARAMETERS = packed record
    ulNewTVProtectionStandard: DWORD;
    ulAspectRatioChangeMask1: DWORD;
    ulAspectRatioData1: DWORD;
    ulAspectRatioChangeMask2: DWORD;
    ulAspectRatioData2: DWORD;
    ulAspectRatioChangeMask3: DWORD;
    ulAspectRatioData3: DWORD;
    ulReserved: array[0..3] of DWORD;
    ulReserved2: array[0..3] of DWORD;
    ulReserved3: DWORD;
  end;
const OPM_SET_ACP_AND_CGMSA_SIGNALING_PARAMETERS = extern struct {
    ulNewTVProtectionStandard: u32,
    ulAspectRatioChangeMask1: u32,
    ulAspectRatioData1: u32,
    ulAspectRatioChangeMask2: u32,
    ulAspectRatioData2: u32,
    ulAspectRatioChangeMask3: u32,
    ulAspectRatioData3: u32,
    ulReserved: [4]u32,
    ulReserved2: [4]u32,
    ulReserved3: u32,
};
type
  OPM_SET_ACP_AND_CGMSA_SIGNALING_PARAMETERS {.packed.} = object
    ulNewTVProtectionStandard: uint32
    ulAspectRatioChangeMask1: uint32
    ulAspectRatioData1: uint32
    ulAspectRatioChangeMask2: uint32
    ulAspectRatioData2: uint32
    ulAspectRatioChangeMask3: uint32
    ulAspectRatioData3: uint32
    ulReserved: array[4, uint32]
    ulReserved2: array[4, uint32]
    ulReserved3: uint32
align(1)
struct OPM_SET_ACP_AND_CGMSA_SIGNALING_PARAMETERS
{
    uint ulNewTVProtectionStandard;
    uint ulAspectRatioChangeMask1;
    uint ulAspectRatioData1;
    uint ulAspectRatioChangeMask2;
    uint ulAspectRatioData2;
    uint ulAspectRatioChangeMask3;
    uint ulAspectRatioData3;
    uint[4] ulReserved;
    uint[4] ulReserved2;
    uint ulReserved3;
}

HSP用 定義

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

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

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