1 /** 2 * This file has no copyright assigned and is placed in the Public Domain. 3 * This file is part of the mingw-w64 runtime package. 4 * No warranty is given; refer to the file DISCLAIMER.PD within this package. 5 */ 6 #ifndef _INC_OPMAPI 7 #define _INC_OPMAPI 8 9 #include <dxva2api.h> 10 11 #if (_WIN32_WINNT >= 0x0600) 12 13 #define OPM_OMAC_SIZE 16 14 #define OPM_CONFIGURE_SETTING_DATA_SIZE 4056 15 #define OPM_REQUESTED_INFORMATION_SIZE 4076 16 #define OPM_ENCRYPTED_INITIALIZATION_PARAMETERS_SIZE 256 17 #define OPM_GET_INFORMATION_PARAMETERS_SIZE 4056 18 #define OPM_HDCP_KEY_SELECTION_VECTOR_SIZE 5 19 #define OPM_128_BIT_RANDOM_NUMBER_SIZE 16 20 21 #define OPM_CGMSA_OFF 0x00 22 #define OPM_CGMSA_COPY_FREELY 0x01 23 #define OPM_CGMSA_COPY_NO_MORE 0x02 24 #define OPM_CGMSA_COPY_ONE_GENERATION 0x03 25 #define OPM_CGMSA_COPY_NEVER 0x04 26 #define OPM_CGMSA_REDISTRIBUTION_CONTROL_REQUIRED 0x08 27 28 #define OPM_PROTECTION_STANDARD_OTHER 0x80000000 29 #define OPM_PROTECTION_STANDARD_NONE 0x00000000 30 #define OPM_PROTECTION_STANDARD_IEC61880_525I 0x00000001 31 #define OPM_PROTECTION_STANDARD_IEC61880_2_525I 0x00000002 32 #define OPM_PROTECTION_STANDARD_IEC62375_625P 0x00000004 33 #define OPM_PROTECTION_STANDARD_EIA608B_525 0x00000008 34 #define OPM_PROTECTION_STANDARD_EN300294_625I 0x00000010 35 #define OPM_PROTECTION_STANDARD_CEA805A_TYPEA_525P 0x00000020 36 #define OPM_PROTECTION_STANDARD_CEA805A_TYPEA_750P 0x00000040 37 #define OPM_PROTECTION_STANDARD_CEA805A_TYPEA_1125I 0x00000080 38 #define OPM_PROTECTION_STANDARD_CEA805A_TYPEB_525P 0x00000100 39 #define OPM_PROTECTION_STANDARD_CEA805A_TYPEB_750P 0x00000200 40 #define OPM_PROTECTION_STANDARD_CEA805A_TYPEB_1125I 0x00000400 41 #define OPM_PROTECTION_STANDARD_ARIBTRB15_525I 0x00000800 42 #define OPM_PROTECTION_STANDARD_ARIBTRB15_525P 0x00001000 43 #define OPM_PROTECTION_STANDARD_ARIBTRB15_750P 0x00002000 44 #define OPM_PROTECTION_STANDARD_ARIBTRB15_1125I 0x00004000 45 46 #ifdef __cplusplus 47 extern "C" { 48 #endif 49 50 typedef enum _OPM_VIDEO_OUTPUT_SEMANTICS { 51 OPM_VOS_COPP_SEMANTICS = 0, 52 OPM_VOS_OPM_SEMANTICS = 1 53 } OPM_VIDEO_OUTPUT_SEMANTICS; 54 55 typedef enum _OPM_ACP_PROTECTION_LEVEL { 56 OPM_ACP_OFF = 0, 57 OPM_ACP_LEVEL_ONE = 1, 58 OPM_ACP_LEVEL_TWO = 2, 59 OPM_ACP_LEVEL_THREE = 3, 60 OPM_ACP_FORCE_ULONG = 0x7fffffff 61 } OPM_ACP_PROTECTION_LEVEL; 62 63 typedef enum _OPM_DPCP_PROTECTION_LEVEL { 64 OPM_DPCP_OFF = 0, 65 OPM_DPCP_ON = 1, 66 OPM_DPCP_FORCE_ULONG = 0x7fffffff 67 } OPM_DPCP_PROTECTION_LEVEL; 68 69 typedef enum _OPM_HDCP_PROTECTION_LEVEL { 70 OPM_HDCP_OFF = 0, 71 OPM_HDCP_ON = 1, 72 OPM_HDCP_FORCE_ULONG = 0x7fffffff 73 } OPM_HDCP_PROTECTION_LEVEL; 74 75 typedef enum _OPM_IMAGE_ASPECT_RATIO_EN300294 { 76 OPM_ASPECT_RATIO_EN300294_FULL_FORMAT_4_BY_3 = 0, 77 OPM_ASPECT_RATIO_EN300294_BOX_14_BY_9_CENTER = 1, 78 OPM_ASPECT_RATIO_EN300294_BOX_14_BY_9_TOP = 2, 79 OPM_ASPECT_RATIO_EN300294_BOX_16_BY_9_CENTER = 3, 80 OPM_ASPECT_RATIO_EN300294_BOX_16_BY_9_TOP = 4, 81 OPM_ASPECT_RATIO_EN300294_BOX_GT_16_BY_9_CENTER = 5, 82 OPM_ASPECT_RATIO_EN300294_FULL_FORMAT_4_BY_3_PROTECTED_CENTER = 6, 83 OPM_ASPECT_RATIO_EN300294_FULL_FORMAT_16_BY_9_ANAMORPHIC = 7, 84 OPM_ASPECT_RATIO_FORCE_ULONG = 0x7FFFFFFF 85 } OPM_IMAGE_ASPECT_RATIO_EN300294; 86 87 typedef struct _OPM_OMAC { 88 BYTE abOMAC[OPM_OMAC_SIZE]; 89 } OPM_OMAC; 90 91 typedef struct _OPM_REQUESTED_INFORMATION { 92 OPM_OMAC omac; 93 ULONG cbRequestedInformationSize; 94 BYTE abRequestedInformation[OPM_REQUESTED_INFORMATION_SIZE]; 95 } OPM_REQUESTED_INFORMATION; 96 97 typedef struct _OPM_ENCRYPTED_INITIALIZATION_PARAMETERS { 98 BYTE abEncryptedInitializationParameters[OPM_ENCRYPTED_INITIALIZATION_PARAMETERS_SIZE]; 99 } OPM_ENCRYPTED_INITIALIZATION_PARAMETERS; 100 101 typedef struct _OPM_RANDOM_NUMBER { 102 BYTE abRandomNumber[OPM_128_BIT_RANDOM_NUMBER_SIZE]; 103 } OPM_RANDOM_NUMBER; 104 105 typedef struct _OPM_GET_INFO_PARAMETERS { 106 OPM_OMAC omac; 107 OPM_RANDOM_NUMBER rnRandomNumber; 108 GUID guidInformation; 109 ULONG ulSequenceNumber; 110 ULONG cbParametersSize; 111 BYTE abParameters[OPM_GET_INFORMATION_PARAMETERS_SIZE]; 112 } OPM_GET_INFO_PARAMETERS; 113 114 typedef struct _OPM_COPP_COMPATIBLE_GET_INFO_PARAMETERS { 115 OPM_RANDOM_NUMBER rnRandomNumber; 116 GUID guidInformation; 117 ULONG ulSequenceNumber; 118 ULONG cbParametersSize; 119 BYTE abParameters[OPM_GET_INFORMATION_PARAMETERS_SIZE]; 120 } OPM_COPP_COMPATIBLE_GET_INFO_PARAMETERS; 121 122 typedef struct _OPM_ACP_AND_CGMSA_SIGNALING { 123 OPM_RANDOM_NUMBER rnRandomNumber; 124 ULONG ulStatusFlags; 125 ULONG ulAvailableTVProtectionStandards; 126 ULONG ulActiveTVProtectionStandard; 127 ULONG ulReserved; 128 ULONG ulAspectRatioValidMask1; 129 ULONG ulAspectRatioData1; 130 ULONG ulAspectRatioValidMask2; 131 ULONG ulAspectRatioData2; 132 ULONG ulAspectRatioValidMask3; 133 ULONG ulAspectRatioData3; 134 ULONG ulReserved2[4]; 135 ULONG ulReserved3[4]; 136 } OPM_ACP_AND_CGMSA_SIGNALING; 137 138 typedef struct _OPM_ACTUAL_OUTPUT_FORMAT { 139 OPM_RANDOM_NUMBER rnRandomNumber; 140 ULONG ulStatusFlags; 141 ULONG ulDisplayWidth; 142 ULONG ulDisplayHeight; 143 DXVA2_SampleFormat dsfSampleInterleaveFormat; 144 D3DFORMAT d3dFormat; 145 ULONG ulFrequencyNumerator; 146 ULONG ulFrequencyDenominator; 147 } OPM_ACTUAL_OUTPUT_FORMAT; 148 149 typedef struct _OPM_CONFIGURE_PARAMETERS { 150 OPM_OMAC omac; 151 GUID guidSetting; 152 ULONG ulSequenceNumber; 153 ULONG cbParametersSize; 154 BYTE abParameters[OPM_CONFIGURE_SETTING_DATA_SIZE]; 155 } OPM_CONFIGURE_PARAMETERS; 156 157 typedef struct _OPM_HDCP_KEY_SELECTION_VECTOR { 158 BYTE abKeySelectionVector[OPM_HDCP_KEY_SELECTION_VECTOR_SIZE]; 159 } OPM_HDCP_KEY_SELECTION_VECTOR; 160 161 #define OPM_HDCP_FLAG_NONE 0x00 162 #define OPM_HDCP_FLAG_REPEATER 0x01 163 164 typedef struct _OPM_CONNECTED_HDCP_DEVICE_INFORMATION { 165 OPM_RANDOM_NUMBER rnRandomNumber; 166 ULONG ulStatusFlags; 167 ULONG ulHDCPFlags; 168 OPM_HDCP_KEY_SELECTION_VECTOR ksvB; 169 BYTE Reserved[11]; 170 BYTE Reserved2[16]; 171 BYTE Reserved3[16]; 172 } OPM_CONNECTED_HDCP_DEVICE_INFORMATION; 173 174 typedef struct _OPM_OUTPUT_ID_DATA { 175 OPM_RANDOM_NUMBER rnRandomNumber; 176 ULONG ulStatusFlags; 177 UINT64 OutputId; 178 } OPM_OUTPUT_ID_DATA; 179 180 typedef struct _OPM_SET_ACP_AND_CGMSA_SIGNALING_PARAMETERS { 181 ULONG ulNewTVProtectionStandard; 182 ULONG ulAspectRatioChangeMask1; 183 ULONG ulAspectRatioData1; 184 ULONG ulAspectRatioChangeMask2; 185 ULONG ulAspectRatioData2; 186 ULONG ulAspectRatioChangeMask3; 187 ULONG ulAspectRatioData3; 188 ULONG ulReserved[4]; 189 ULONG ulReserved2[4]; 190 ULONG ulReserved3; 191 } OPM_SET_ACP_AND_CGMSA_SIGNALING_PARAMETERS; 192 193 typedef struct _OPM_SET_HDCP_SRM_PARAMETERS { 194 ULONG ulSRMVersion; 195 } OPM_SET_HDCP_SRM_PARAMETERS; 196 197 typedef struct _OPM_SET_PROTECTION_LEVEL_PARAMETERS { 198 ULONG ulProtectionType; 199 ULONG ulProtectionLevel; 200 ULONG Reserved; 201 ULONG Reserved2; 202 } OPM_SET_PROTECTION_LEVEL_PARAMETERS; 203 204 typedef struct _OPM_STANDARD_INFORMATION { 205 OPM_RANDOM_NUMBER rnRandomNumber; 206 ULONG ulStatusFlags; 207 ULONG ulInformation; 208 ULONG ulReserved; 209 ULONG ulReserved2; 210 } OPM_STANDARD_INFORMATION; 211 212 #ifdef __cplusplus 213 } 214 #endif 215 216 #undef INTERFACE 217 #define INTERFACE IOPMVideoOutput 218 DECLARE_INTERFACE_(IOPMVideoOutput,IUnknown) 219 { 220 BEGIN_INTERFACE 221 222 /* IUnknown methods */ 223 STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE; 224 STDMETHOD_(ULONG, AddRef)(THIS) PURE; 225 STDMETHOD_(ULONG, Release)(THIS) PURE; 226 227 /* IOPMVideoOutput methods */ 228 STDMETHOD_(HRESULT,Configure)(THIS_ const OPM_CONFIGURE_PARAMETERS *pParameters,ULONG ulAdditionalParametersSize,const BYTE *pbAdditionalParameters) PURE; 229 STDMETHOD_(HRESULT,COPPCompatibleGetInformation)(THIS_ const OPM_COPP_COMPATIBLE_GET_INFO_PARAMETERS *pParameters,OPM_REQUESTED_INFORMATION *pRequestedInformation) PURE; 230 STDMETHOD_(HRESULT,FinishInitialization)(THIS_ const OPM_ENCRYPTED_INITIALIZATION_PARAMETERS *pParameters) PURE; 231 STDMETHOD_(HRESULT,GetInformation)(THIS_ const OPM_GET_INFO_PARAMETERS *pParameters,OPM_REQUESTED_INFORMATION *pRequestedInformation) PURE; 232 STDMETHOD_(HRESULT,StartInitialization)(THIS_ OPM_RANDOM_NUMBER *prnRandomNumber,BYTE **ppbCertificate,ULONG *pulCertificateLength) PURE; 233 234 END_INTERFACE 235 }; 236 #ifdef COBJMACROS 237 #define IOPMVideoOutput_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) 238 #define IOPMVideoOutput_AddRef(This) (This)->lpVtbl->AddRef(This) 239 #define IOPMVideoOutput_Release(This) (This)->lpVtbl->Release(This) 240 #define IOPMVideoOutput_Configure(This,pParameters,ulAdditionalParametersSize,pbAdditionalParameters) (This)->lpVtbl->Configure(This,pParameters,ulAdditionalParametersSize,pbAdditionalParameters) 241 #define IOPMVideoOutput_COPPCompatibleGetInformation(This,pParameters,pRequestedInformation) (This)->lpVtbl->COPPCompatibleGetInformation(This,pParameters,pRequestedInformation) 242 #define IOPMVideoOutput_FinishInitialization(This,pParameters) (This)->lpVtbl->FinishInitialization(This,pParameters) 243 #define IOPMVideoOutput_GetInformation(This,pParameters,pRequestedInformation) (This)->lpVtbl->GetInformation(This,pParameters,pRequestedInformation) 244 #define IOPMVideoOutput_StartInitialization(This,prnRandomNumber,ppbCertificate,pulCertificateLength) (This)->lpVtbl->StartInitialization(This,prnRandomNumber,ppbCertificate,pulCertificateLength) 245 #endif /*COBJMACROS*/ 246 247 #ifdef __cplusplus 248 extern "C" { 249 #endif 250 251 HRESULT WINAPI OPMGetVideoOutputsFromHMONITOR( 252 HMONITOR hMonitor, 253 OPM_VIDEO_OUTPUT_SEMANTICS vos, 254 ULONG *pulNumVideoOutputs, 255 IOPMVideoOutput ***pppOPMVideoOutputArray 256 ); 257 258 HRESULT WINAPI OPMGetVideoOutputsFromIDirect3DDevice9Object( 259 IDirect3DDevice9 *pDirect3DDevice9, 260 OPM_VIDEO_OUTPUT_SEMANTICS vos, 261 ULONG *pulNumVideoOutputs, 262 IOPMVideoOutput ***pppOPMVideoOutputArray 263 ); 264 #ifdef __cplusplus 265 } 266 #endif 267 268 #endif /*(_WIN32_WINNT >= 0x0600)*/ 269 270 #endif /*_INC_OPMAPI*/ 271 272