1 /*############################################################################ 2 # Copyright Intel Corporation 3 # 4 # SPDX-License-Identifier: MIT 5 ############################################################################*/ 6 7 #ifndef __MFXCOMMON_H__ 8 #define __MFXCOMMON_H__ 9 #include "mfxdefs.h" 10 11 #if !defined (__GNUC__) 12 #pragma warning(disable: 4201) 13 #endif 14 15 #ifdef __cplusplus 16 extern "C" 17 { 18 #endif /* __cplusplus */ 19 20 #define MFX_MAKEFOURCC(A,B,C,D) ((((int)A))+(((int)B)<<8)+(((int)C)<<16)+(((int)D)<<24)) 21 22 /* Extended Configuration Header Structure */ 23 MFX_PACK_BEGIN_USUAL_STRUCT() 24 /*! The common header definition for external buffers and video 25 processing hints. */ 26 typedef struct { 27 mfxU32 BufferId; /*!< Identifier of the buffer content. See the ExtendedBufferID enumerator for a complete list of extended buffers. */ 28 mfxU32 BufferSz; /*!< Size of the buffer. */ 29 } mfxExtBuffer; 30 MFX_PACK_END() 31 32 /* Library initialization and deinitialization */ 33 /*! 34 This enumerator itemizes implementation types. 35 The implementation type is a bit OR’ed value of the base type and any decorative flags. 36 @note This enumerator is for legacy dispatcher compatibility only. The new dispatcher does not use it. 37 */ 38 typedef mfxI32 mfxIMPL; 39 /*! 40 The application can use the macro MFX_IMPL_BASETYPE(x) to obtain the base implementation type. 41 */ 42 #define MFX_IMPL_BASETYPE(x) (0x00ff & (x)) 43 44 enum { 45 MFX_IMPL_AUTO = 0x0000, /*!< Auto Selection/In or Not Supported/Out. */ 46 MFX_IMPL_SOFTWARE = 0x0001, /*!< Pure software implementation. */ 47 MFX_IMPL_HARDWARE = 0x0002, /*!< Hardware accelerated implementation (default device). */ 48 MFX_IMPL_AUTO_ANY = 0x0003, /*!< Auto selection of any hardware/software implementation. */ 49 MFX_IMPL_HARDWARE_ANY = 0x0004, /*!< Auto selection of any hardware implementation. */ 50 MFX_IMPL_HARDWARE2 = 0x0005, /*!< Hardware accelerated implementation (2nd device). */ 51 MFX_IMPL_HARDWARE3 = 0x0006, /*!< Hardware accelerated implementation (3rd device). */ 52 MFX_IMPL_HARDWARE4 = 0x0007, /*!< Hardware accelerated implementation (4th device). */ 53 MFX_IMPL_RUNTIME = 0x0008, /*!< This value cannot be used for session initialization. It may be returned by the MFXQueryIMPL 54 function to show that the session has been initialized in run-time mode. */ 55 MFX_IMPL_VIA_ANY = 0x0100, /*!< Hardware acceleration can go through any supported OS infrastructure. This is the default value. The default value 56 is used by the legacy Intel(r) Media SDK if none of the MFX_IMPL_VIA_xxx flags are specified by the application. */ 57 MFX_IMPL_VIA_D3D9 = 0x0200, /*!< Hardware acceleration goes through the Microsoft* Direct3D* 9 infrastructure. */ 58 MFX_IMPL_VIA_D3D11 = 0x0300, /*!< Hardware acceleration goes through the Microsoft* Direct3D* 11 infrastructure. */ 59 MFX_IMPL_VIA_VAAPI = 0x0400, /*!< Hardware acceleration goes through the Linux* VA-API infrastructure. */ 60 MFX_IMPL_VIA_HDDLUNITE = 0x0500, /*!< Hardware acceleration goes through the HDDL* Unite*. */ 61 62 MFX_IMPL_UNSUPPORTED = 0x0000 /*!< One of the MFXQueryIMPL returns. */ 63 }; 64 65 /* Version Info */ 66 MFX_PACK_BEGIN_USUAL_STRUCT() 67 /*! The mfxVersion union describes the version of the implementation.*/ 68 typedef union { 69 /*! @brief Structure with Major and Minor fields. */ 70 /*! @struct Anonymous */ 71 struct { 72 /*! @{ 73 @name Major and Minor fields 74 Anonymous structure with Major and Minor fields. 75 */ 76 mfxU16 Minor; /*!< Minor number of the implementation. */ 77 mfxU16 Major; /*!< Major number of the implementation. */ 78 /*! @} */ 79 }; 80 mfxU32 Version; /*!< Implementation version number. */ 81 } mfxVersion; 82 MFX_PACK_END() 83 84 /*! The mfxPriority enumerator describes the session priority. */ 85 typedef enum 86 { 87 MFX_PRIORITY_LOW = 0, /*!< Low priority: the session operation halts when high priority tasks are executing and more than 75% of the CPU is being used for normal priority tasks.*/ 88 MFX_PRIORITY_NORMAL = 1, /*!< Normal priority: the session operation is halted if there are high priority tasks.*/ 89 MFX_PRIORITY_HIGH = 2 /*!< High priority: the session operation blocks other lower priority session operations.*/ 90 91 } mfxPriority; 92 93 typedef struct _mfxEncryptedData mfxEncryptedData; 94 MFX_PACK_BEGIN_STRUCT_W_L_TYPE() 95 /*! Defines the buffer that holds compressed video data. */ 96 typedef struct { 97 /*! @internal :unnamed(union) @endinternal */ 98 union { 99 struct { 100 mfxEncryptedData* EncryptedData; /*!< Reserved and must be zero. */ 101 mfxExtBuffer **ExtParam; /*!< Array of extended buffers for additional bitstream configuration. See the ExtendedBufferID enumerator for a complete list of extended buffers. */ 102 mfxU16 NumExtParam; /*!< The number of extended buffers attached to this structure. */ 103 mfxU32 CodecId; /*!< Specifies the codec format identifier in the FourCC code. See the CodecFormatFourCC enumerator for details. This optional parameter is required for the simplified decode initialization. */ 104 105 }; 106 mfxU32 reserved[6]; 107 }; 108 /*! Decode time stamp of the compressed bitstream in units of 90KHz. A value of MFX_TIMESTAMP_UNKNOWN indicates that there is no time stamp. 109 110 This value is calculated by the encoder from the presentation time stamp provided by the application in the mfxFrameSurface1 structure and 111 from the frame rate provided by the application during the encoder initialization. */ 112 mfxI64 DecodeTimeStamp; 113 mfxU64 TimeStamp; /*!< Time stamp of the compressed bitstream in units of 90KHz. A value of MFX_TIMESTAMP_UNKNOWN indicates that there is no time stamp. */ 114 mfxU8* Data; /*!< Bitstream buffer pointer, 32-bytes aligned. */ 115 mfxU32 DataOffset; /*!< Next reading or writing position in the bitstream buffer. */ 116 mfxU32 DataLength; /*!< Size of the actual bitstream data in bytes. */ 117 mfxU32 MaxLength; /*!< Allocated bitstream buffer size in bytes. */ 118 119 mfxU16 PicStruct; /*!< Type of the picture in the bitstream. Output parameter. */ 120 mfxU16 FrameType; /*!< Frame type of the picture in the bitstream. Output parameter. */ 121 mfxU16 DataFlag; /*!< Indicates additional bitstream properties. See the BitstreamDataFlag enumerator for details. */ 122 mfxU16 reserved2; /*!< Reserved for future use. */ 123 } mfxBitstream; 124 MFX_PACK_END() 125 126 /*! Synchronization point object handle. */ 127 typedef struct _mfxSyncPoint *mfxSyncPoint; 128 129 /*! The GPUCopy enumerator controls usage of GPU accelerated copying between video and system memory in the legacy Intel(r) Media SDK components. */ 130 enum { 131 MFX_GPUCOPY_DEFAULT = 0, /*!< Use default mode for the legacy Intel(r) Media SDK implementation. */ 132 MFX_GPUCOPY_ON = 1, /*!< Enable GPU accelerated copying. */ 133 MFX_GPUCOPY_OFF = 2 /*!< Disable GPU accelerated copying. */ 134 }; 135 136 MFX_PACK_BEGIN_STRUCT_W_PTR() 137 /*! Specifies advanced initialization parameters. 138 A zero value in any of the fields indicates that the corresponding field 139 is not explicitly specified. 140 */ 141 typedef struct { 142 mfxIMPL Implementation; /*!< Enumerator that indicates the desired legacy Intel(r) Media SDK implementation. */ 143 mfxVersion Version; /*!< Structure which specifies minimum library version or zero, if not specified. */ 144 mfxU16 ExternalThreads; /*!< Desired threading mode. Value 0 means internal threading, 1 – external. */ 145 /*! @internal :unnamed(union) @endinternal */ 146 union { 147 struct { 148 mfxExtBuffer **ExtParam; /*!< Points to an array of pointers to the extra configuration structures; see the ExtendedBufferID enumerator for a list of extended configurations. */ 149 mfxU16 NumExtParam; /*!< The number of extra configuration structures attached to this structure. */ 150 }; 151 mfxU16 reserved2[5]; 152 }; 153 mfxU16 GPUCopy; /*!< Enables or disables GPU accelerated copying between video and system memory in legacy Intel(r) Media SDK components. See the GPUCopy enumerator for a list of valid values. */ 154 mfxU16 reserved[21]; 155 } mfxInitParam; 156 MFX_PACK_END() 157 158 enum { 159 MFX_EXTBUFF_THREADS_PARAM = MFX_MAKEFOURCC('T','H','D','P') /*!< mfxExtThreadsParam buffer ID */ 160 }; 161 162 MFX_PACK_BEGIN_USUAL_STRUCT() 163 /*! Specifies options for threads created by this session. Attached to the 164 mfxInitParam structure during legacy Intel(r) Media SDK session initialization 165 or to mfxInitializationParam by the dispatcher in MFXCreateSession function. */ 166 typedef struct { 167 mfxExtBuffer Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUFF_THREADS_PARAM. */ 168 169 mfxU16 NumThread; /*!< The number of threads. */ 170 mfxI32 SchedulingType; /*!< Scheduling policy for all threads.*/ 171 mfxI32 Priority; /*!< Priority for all threads. */ 172 mfxU16 reserved[55]; /*!< Reserved for future use. */ 173 } mfxExtThreadsParam; 174 MFX_PACK_END() 175 176 /*! The PlatformCodeName enumerator itemizes product code names for platforms. 177 For details about Intel code names, see ark.intel.com. */ 178 enum { 179 MFX_PLATFORM_UNKNOWN = 0, /*!< Unknown platform. */ 180 MFX_PLATFORM_SANDYBRIDGE = 1, /*!< Intel(r) microarchitecture code name Sandy Bridge. */ 181 MFX_PLATFORM_IVYBRIDGE = 2, /*!< Intel(r) microarchitecture code name Ivy Bridge. */ 182 MFX_PLATFORM_HASWELL = 3, /*!< Code name Haswell. */ 183 MFX_PLATFORM_BAYTRAIL = 4, /*!< Code name Bay Trail. */ 184 MFX_PLATFORM_BROADWELL = 5, /*!< Intel(r) microarchitecture code name Broadwell. */ 185 MFX_PLATFORM_CHERRYTRAIL = 6, /*!< Code name Cherry Trail. */ 186 MFX_PLATFORM_SKYLAKE = 7, /*!< Intel(r) microarchitecture code name Skylake. */ 187 MFX_PLATFORM_APOLLOLAKE = 8, /*!< Code name Apollo Lake. */ 188 MFX_PLATFORM_KABYLAKE = 9, /*!< Code name Kaby Lake. */ 189 MFX_PLATFORM_GEMINILAKE = 10, /*!< Code name Gemini Lake. */ 190 MFX_PLATFORM_COFFEELAKE = 11, /*!< Code name Coffee Lake. */ 191 MFX_PLATFORM_CANNONLAKE = 20, /*!< Code name Cannon Lake. */ 192 MFX_PLATFORM_ICELAKE = 30, /*!< Code name Ice Lake. */ 193 MFX_PLATFORM_JASPERLAKE = 32, /*!< Code name Jasper Lake. */ 194 MFX_PLATFORM_ELKHARTLAKE = 33, /*!< Code name Elkhart Lake. */ 195 MFX_PLATFORM_TIGERLAKE = 40, /*!< Code name Tiger Lake. */ 196 MFX_PLATFORM_ROCKETLAKE = 42, /*!< Code name Rocket Lake. */ 197 MFX_PLATFORM_ALDERLAKE_S = 43, /*!< Code name Alder Lake S. */ 198 MFX_PLATFORM_ALDERLAKE_P = 44, /*!< Code name Alder Lake P. */ 199 MFX_PLATFORM_ARCTICSOUND_P = 45, 200 MFX_PLATFORM_XEHP_SDV = 45, /*!< Code name XeHP SDV. */ 201 MFX_PLATFORM_DG2 = 46, /*!< Code name DG2. */ 202 MFX_PLATFORM_ATS_M = 46, /*!< Code name ATS-M, same media functionality as DG2. */ 203 MFX_PLATFORM_KEEMBAY = 50, /*!< Code name Keem Bay. */ 204 }; 205 206 /*! The mfxMediaAdapterType enumerator itemizes types of graphics adapters. */ 207 typedef enum 208 { 209 MFX_MEDIA_UNKNOWN = 0xffff, /*!< Unknown type. */ 210 MFX_MEDIA_INTEGRATED = 0, /*!< Integrated graphics adapter. */ 211 MFX_MEDIA_DISCRETE = 1 /*!< Discrete graphics adapter. */ 212 } mfxMediaAdapterType; 213 214 MFX_PACK_BEGIN_USUAL_STRUCT() 215 /*! Contains information about hardware platform for the Legacy mode. */ 216 typedef struct { 217 mfxU16 CodeName; /*!< Microarchitecture code name. See the PlatformCodeName enumerator for a list of possible values. */ 218 mfxU16 DeviceId; /*!< Unique identifier of graphics device. */ 219 mfxU16 MediaAdapterType; /*!< Description of graphics adapter type. See the mfxMediaAdapterType enumerator for a list of possible values. */ 220 mfxU16 reserved[13]; /*!< Reserved for future use. */ 221 } mfxPlatform; 222 MFX_PACK_END() 223 224 225 /* The mfxResourceType enumerator specifies types of different native data frames and buffers. */ 226 typedef enum { 227 MFX_RESOURCE_SYSTEM_SURFACE = 1, /*!< System memory. */ 228 MFX_RESOURCE_VA_SURFACE_PTR = 2, /*!< Pointer to VA surface index. */ 229 MFX_RESOURCE_VA_SURFACE = MFX_RESOURCE_VA_SURFACE_PTR, /*!< Pointer to VA surface index. */ 230 MFX_RESOURCE_VA_BUFFER_PTR = 3, /*!< Pointer to VA buffer index. */ 231 MFX_RESOURCE_VA_BUFFER = MFX_RESOURCE_VA_BUFFER_PTR, /*!< Pointer to VA buffer index. */ 232 MFX_RESOURCE_DX9_SURFACE = 4, /*!< IDirect3DSurface9. */ 233 MFX_RESOURCE_DX11_TEXTURE = 5, /*!< ID3D11Texture2D. */ 234 MFX_RESOURCE_DX12_RESOURCE = 6, /*!< ID3D12Resource. */ 235 MFX_RESOURCE_DMA_RESOURCE = 7, /*!< DMA resource. */ 236 MFX_RESOURCE_HDDLUNITE_REMOTE_MEMORY = 8, /*!< HDDL Unite Remote memory handle. */ 237 } mfxResourceType; 238 239 /*! Maximum allowed length of the implementation name. */ 240 #define MFX_IMPL_NAME_LEN 32 241 /*! Maximum allowed length of the implementation name. */ 242 #define MFX_STRFIELD_LEN 128 243 244 #define MFX_DECODERDESCRIPTION_VERSION MFX_STRUCT_VERSION(1, 0) 245 246 MFX_PACK_BEGIN_STRUCT_W_PTR() 247 /*! The mfxDecoderDescription structure represents the description of a decoder. */ 248 typedef struct { 249 mfxStructVersion Version; /*!< Version of the structure. */ 250 mfxU16 reserved[7]; /*!< Reserved for future use. */ 251 mfxU16 NumCodecs; /*!< Number of supported decoders. */ 252 /*! This structure represents the decoder description. */ 253 struct decoder { 254 mfxU32 CodecID; /*!< Decoder ID in FourCC format. */ 255 mfxU16 reserved[8]; /*!< Reserved for future use. */ 256 mfxU16 MaxcodecLevel; /*!< Maximum supported codec level. See the CodecProfile enumerator for possible values. */ 257 mfxU16 NumProfiles; /*!< Number of supported profiles. */ 258 /*! This structure represents the codec profile description. */ 259 struct decprofile { 260 mfxU32 Profile; /*!< Profile ID. See the CodecProfile enumerator for possible values.*/ 261 mfxU16 reserved[7]; /*!< Reserved for future use. */ 262 mfxU16 NumMemTypes; /*!< Number of supported memory types. */ 263 /*! This structure represents the underlying details of the memory type. */ 264 struct decmemdesc { 265 mfxResourceType MemHandleType; /*!< Memory handle type. */ 266 mfxRange32U Width; /*!< Range of supported image widths. */ 267 mfxRange32U Height; /*!< Range of supported image heights. */ 268 mfxU16 reserved[7]; /*!< Reserved for future use. */ 269 mfxU16 NumColorFormats; /*!< Number of supported output color formats. */ 270 mfxU32* ColorFormats; /*!< Pointer to the array of supported output color formats (in FOURCC). */ 271 } * MemDesc; /*!< Pointer to the array of memory types. */ 272 } * Profiles; /*!< Pointer to the array of profiles supported by the codec. */ 273 } * Codecs; /*!< Pointer to the array of decoders. */ 274 } mfxDecoderDescription; 275 MFX_PACK_END() 276 277 #define MFX_ENCODERDESCRIPTION_VERSION MFX_STRUCT_VERSION(1, 0) 278 279 MFX_PACK_BEGIN_STRUCT_W_PTR() 280 /*! This structure represents an encoder description. */ 281 typedef struct { 282 mfxStructVersion Version; /*!< Version of the structure. */ 283 mfxU16 reserved[7]; /*!< Reserved for future use. */ 284 mfxU16 NumCodecs; /*!< Number of supported encoders. */ 285 /*! This structure represents encoder description. */ 286 struct encoder { 287 mfxU32 CodecID; /*!< Encoder ID in FourCC format. */ 288 mfxU16 MaxcodecLevel; /*!< Maximum supported codec level. See the CodecProfile enumerator for possible values. */ 289 mfxU16 BiDirectionalPrediction; /*!< Indicates B-frames support. */ 290 mfxU16 reserved[7]; /*!< Reserved for future use. */ 291 mfxU16 NumProfiles; /*!< Number of supported profiles. */ 292 /*! This structure represents the codec profile description. */ 293 struct encprofile { 294 mfxU32 Profile; /*!< Profile ID. See the CodecProfile enumerator for possible values.*/ 295 mfxU16 reserved[7]; /*!< Reserved for future use. */ 296 mfxU16 NumMemTypes; /*!< Number of supported memory types. */ 297 /*! This structure represents the underlying details of the memory type. */ 298 struct encmemdesc { 299 mfxResourceType MemHandleType; /*!< Memory handle type. */ 300 mfxRange32U Width; /*!< Range of supported image widths. */ 301 mfxRange32U Height; /*!< Range of supported image heights. */ 302 mfxU16 reserved[7]; /*!< Reserved for future use. */ 303 mfxU16 NumColorFormats; /*!< Number of supported input color formats. */ 304 mfxU32* ColorFormats; /*!< Pointer to the array of supported input color formats (in FOURCC). */ 305 } * MemDesc; /*!< Pointer to the array of memory types. */ 306 } * Profiles; /*!< Pointer to the array of profiles supported by the codec. */ 307 } * Codecs; /*!< Pointer to the array of encoders. */ 308 } mfxEncoderDescription; 309 MFX_PACK_END() 310 311 #define MFX_VPPDESCRIPTION_VERSION MFX_STRUCT_VERSION(1, 0) 312 313 MFX_PACK_BEGIN_STRUCT_W_PTR() 314 /*! This structure represents VPP description. */ 315 typedef struct { 316 mfxStructVersion Version; /*!< Version of the structure. */ 317 mfxU16 reserved[7]; /*!< Reserved for future use. */ 318 mfxU16 NumFilters; /*!< Number of supported VPP filters. */ 319 /*! This structure represents the VPP filters description. */ 320 struct filter { 321 mfxU32 FilterFourCC; /*!< Filter ID in FourCC format. */ 322 mfxU16 MaxDelayInFrames; /*!< Introduced output delay in frames. */ 323 mfxU16 reserved[7]; /*!< Reserved for future use. */ 324 mfxU16 NumMemTypes; /*!< Number of supported memory types. */ 325 /*! This structure represents the underlying details of the memory type. */ 326 struct memdesc { 327 mfxResourceType MemHandleType; /*!< Memory handle type. */ 328 mfxRange32U Width; /*!< Range of supported image widths. */ 329 mfxRange32U Height; /*!< Range of supported image heights. */ 330 mfxU16 reserved[7]; /*!< Reserved for future use. */ 331 mfxU16 NumInFormats; /*!< Number of supported input color formats. */ 332 /*! This structure represents the input color format description. */ 333 struct format { 334 mfxU32 InFormat; /*!< Input color in FourCC format. */ 335 mfxU16 reserved[5]; /*!< Reserved for future use. */ 336 mfxU16 NumOutFormat; /*!< Number of supported output color formats. */ 337 mfxU32* OutFormats; /*!< Pointer to the array of supported output color formats (in FOURCC). */ 338 } * Formats; /*!< Pointer to the array of supported formats. */ 339 } * MemDesc; /*!< Pointer to the array of memory types. */ 340 } * Filters; /*!< Pointer to the array of supported filters. */ 341 } mfxVPPDescription; 342 MFX_PACK_END() 343 344 /*! The current version of mfxDeviceDescription structure. */ 345 #define MFX_DEVICEDESCRIPTION_VERSION MFX_STRUCT_VERSION(1, 1) 346 347 MFX_PACK_BEGIN_STRUCT_W_PTR() 348 /*! This structure represents device description. */ 349 typedef struct { 350 mfxStructVersion Version; /*!< Version of the structure. */ 351 mfxU16 reserved[6]; /*!< reserved for future use. */ 352 mfxU16 MediaAdapterType; /*!< Graphics adapter type. See the mfxMediaAdapterType enumerator for a list of possible values. */ 353 mfxChar DeviceID[MFX_STRFIELD_LEN]; /*!< Null terminated string with device ID. */ 354 mfxU16 NumSubDevices; /*!< Number of available uniform sub-devices. Pure software implementation can report 0. */ 355 /*! This structure represents sub-device description. */ 356 struct subdevices { 357 mfxU32 Index; /*!< Index of the sub-device, started from 0 and increased by 1.*/ 358 mfxChar SubDeviceID[MFX_STRFIELD_LEN]; /*!< Null terminated string with unique sub-device ID, mapped to the system ID. */ 359 mfxU32 reserved[7]; /*!< reserved for future use. */ 360 } * SubDevices; /*!< Pointer to the array of available sub-devices. */ 361 } mfxDeviceDescription; 362 MFX_PACK_END() 363 364 /*! This enum itemizes implementation type. */ 365 typedef enum { 366 MFX_IMPL_TYPE_SOFTWARE = 0x0001, /*!< Pure Software Implementation. */ 367 MFX_IMPL_TYPE_HARDWARE = 0x0002, /*!< Hardware Accelerated Implementation. */ 368 } mfxImplType; 369 370 /*! This enum itemizes hardware acceleration stack to use. */ 371 typedef enum { 372 MFX_ACCEL_MODE_NA = 0, /*!< Hardware acceleration is not applicable. */ 373 MFX_ACCEL_MODE_VIA_D3D9 = 0x0200, /*!< Hardware acceleration goes through the Microsoft* Direct3D9* infrastructure. */ 374 MFX_ACCEL_MODE_VIA_D3D11 = 0x0300, /*!< Hardware acceleration goes through the Microsoft* Direct3D11* infrastructure. */ 375 MFX_ACCEL_MODE_VIA_VAAPI = 0x0400, /*!< Hardware acceleration goes through the Linux* VA-API infrastructure. */ 376 MFX_ACCEL_MODE_VIA_VAAPI_DRM_RENDER_NODE = MFX_ACCEL_MODE_VIA_VAAPI, /*!< Hardware acceleration goes through the Linux* VA-API infrastructure with DRM RENDER MODE as default acceleration access point. */ 377 MFX_ACCEL_MODE_VIA_VAAPI_DRM_MODESET = 0x0401, /*!< Hardware acceleration goes through the Linux* VA-API infrastructure with DRM MODESET as default acceleration access point. */ 378 MFX_ACCEL_MODE_VIA_VAAPI_GLX = 0x0402, /*! Hardware acceleration goes through the Linux* VA-API infrastructure with OpenGL Extension to the X Window System 379 as default acceleration access point. */ 380 MFX_ACCEL_MODE_VIA_VAAPI_X11 = 0x0403, /*!< Hardware acceleration goes through the Linux* VA-API infrastructure with X11 as default acceleration access point. */ 381 MFX_ACCEL_MODE_VIA_VAAPI_WAYLAND = 0x0404, /*!< Hardware acceleration goes through the Linux* VA-API infrastructure with Wayland as default acceleration access point. */ 382 MFX_ACCEL_MODE_VIA_HDDLUNITE = 0x0500, /*!< Hardware acceleration goes through the HDDL* Unite*. */ 383 } mfxAccelerationMode; 384 385 #define MFX_ACCELERATIONMODESCRIPTION_VERSION MFX_STRUCT_VERSION(1, 0) 386 387 MFX_PACK_BEGIN_STRUCT_W_PTR() 388 /*! This structure represents acceleration modes description. */ 389 typedef struct { 390 mfxStructVersion Version; /*!< Version of the structure. */ 391 mfxU16 reserved[2]; /*!< reserved for future use. */ 392 mfxU16 NumAccelerationModes; /*!< Number of supported acceleration modes. */ 393 mfxAccelerationMode* Mode; /*!< Pointer to the array of supported acceleration modes. */ 394 } mfxAccelerationModeDescription; 395 MFX_PACK_END() 396 397 /*! Specifies the surface pool allocation policies. */ 398 typedef enum { 399 /*! Recommends to limit max pool size by sum of requested surfaces asked by components. */ 400 MFX_ALLOCATION_OPTIMAL = 0, 401 402 /*! Dynamic allocation with no limit. */ 403 MFX_ALLOCATION_UNLIMITED = 1, 404 405 /*! Max pool size is limited by NumberToPreAllocate + DeltaToAllocateOnTheFly. */ 406 MFX_ALLOCATION_LIMITED = 2, 407 408 } mfxPoolAllocationPolicy; 409 410 /*! The current version of mfxPoolPolicyDescription structure. */ 411 #define MFX_POOLPOLICYDESCRIPTION_VERSION MFX_STRUCT_VERSION(1, 0) 412 413 MFX_PACK_BEGIN_STRUCT_W_PTR() 414 /*! This structure represents pool policy description. */ 415 typedef struct { 416 mfxStructVersion Version; /*!< Version of the structure. */ 417 mfxU16 reserved[2]; /*!< reserved for future use. */ 418 mfxU16 NumPoolPolicies; /*!< Number of supported pool policies. */ 419 mfxPoolAllocationPolicy* Policy; /*!< Pointer to the array of supported pool policies. */ 420 } mfxPoolPolicyDescription; 421 MFX_PACK_END() 422 423 /*! The current version of mfxImplDescription structure. */ 424 #define MFX_IMPLDESCRIPTION_VERSION MFX_STRUCT_VERSION(1, 2) 425 426 MFX_PACK_BEGIN_STRUCT_W_PTR() 427 /*! This structure represents the implementation description. */ 428 typedef struct { 429 mfxStructVersion Version; /*!< Version of the structure. */ 430 mfxImplType Impl; /*!< Impl type: software/hardware. */ 431 mfxAccelerationMode AccelerationMode; /*!< Default Hardware acceleration stack to use. OS dependent parameter. Use VA for Linux* and DX* for Windows*. */ 432 mfxVersion ApiVersion; /*!< Supported API version. */ 433 mfxChar ImplName[MFX_IMPL_NAME_LEN]; /*!< Null-terminated string with implementation name given by vendor. */ 434 mfxChar License[MFX_STRFIELD_LEN]; /*!< Null-terminated string with comma-separated list of license names of the implementation. */ 435 mfxChar Keywords[MFX_STRFIELD_LEN]; /*!< Null-terminated string with comma-separated list of keywords specific to this implementation that dispatcher can search for. */ 436 mfxU32 VendorID; /*!< Standard vendor ID 0x8086 - Intel. */ 437 mfxU32 VendorImplID; /*!< Vendor specific number with given implementation ID. */ 438 mfxDeviceDescription Dev; /*!< Supported device. */ 439 mfxDecoderDescription Dec; /*!< Decoder configuration. */ 440 mfxEncoderDescription Enc; /*!< Encoder configuration. */ 441 mfxVPPDescription VPP; /*!< VPP configuration. */ 442 union 443 { 444 mfxAccelerationModeDescription AccelerationModeDescription; /*!< Supported acceleration modes. */ 445 mfxU32 reserved3[4]; 446 }; 447 mfxPoolPolicyDescription PoolPolicies; /*!< Supported surface pool polices. */ 448 mfxU32 reserved[8]; /*!< Reserved for future use. */ 449 mfxU32 NumExtParam; /*!< Number of extension buffers. Reserved for future use. Must be 0. */ 450 union { 451 mfxExtBuffer **ExtParam; /*!< Array of extension buffers. */ 452 mfxU64 Reserved2; /*!< Reserved for future use. */ 453 } ExtParams; /*!< Extension buffers. Reserved for future. */ 454 } mfxImplDescription; 455 MFX_PACK_END() 456 457 MFX_PACK_BEGIN_STRUCT_W_PTR() 458 /*! This structure represents the list of names of implemented functions. */ 459 typedef struct { 460 mfxU16 NumFunctions; /*!< Number of function names in the FunctionsName array. */ 461 mfxChar** FunctionsName; /*!< Array of the null-terminated strings. Each string contains name of the implemented function. */ 462 } mfxImplementedFunctions; 463 MFX_PACK_END() 464 465 #ifdef ONEVPL_EXPERIMENTAL 466 467 #define MFX_EXTENDEDDEVICEID_VERSION MFX_STRUCT_VERSION(1, 0) 468 469 MFX_PACK_BEGIN_USUAL_STRUCT() 470 /*! Specifies variouse physical device properties for device matching and identification outside of oneVPL. */ 471 typedef struct { 472 mfxStructVersion Version; /*!< Version of the structure. */ 473 mfxU16 VendorID; /*!< PCI vendor ID. */ 474 mfxU16 DeviceID; /*!< PCI device ID. */ 475 mfxU32 PCIDomain; /*!< PCI bus domain. Equals to '0' if OS doesn't support it or 476 has sequential numbering of buses accross domains. */ 477 mfxU32 PCIBus; /*!< The number of the bus that the physical device is located on. */ 478 mfxU32 PCIDevice; /*!< The index of the physical device on the bus. */ 479 mfxU32 PCIFunction; /*!< The function number of the device on the physical device. */ 480 mfxU8 DeviceLUID[8]; /*!< LUID of DXGI adapter. */ 481 mfxU32 LUIDDeviceNodeMask; /*!< Bitfield identifying the node within a linked 482 device adapter corresponding to the device. */ 483 mfxU32 LUIDValid; /*!< Boolean value that will be 1 if DeviceLUID contains a valid LUID 484 and LUIDDeviceNodeMask contains a valid node mask, 485 and 0 if they do not. */ 486 mfxU32 DRMRenderNodeNum; /*!< Number of the DRM render node from the path /dev/dri/RenderD<num>. 487 Value equals to 0 means that this field doesn't contain valid DRM Render 488 Node number.*/ 489 mfxU32 DRMPrimaryNodeNum; /*!< Number of the DRM primary node from the path /dev/dri/card<num>. 490 Value equals to 0x7FFFFFFF means that this field doesn't contain valid DRM Primary 491 Node number.*/ 492 mfxU8 reserved1[20]; /*!< Reserved for future use. */ 493 mfxChar DeviceName[MFX_STRFIELD_LEN]; /*!< Null-terminated string in utf-8 with the name of the device. */ 494 } mfxExtendedDeviceId; 495 MFX_PACK_END() 496 497 #endif 498 499 /* The mfxImplCapsDeliveryFormat enumerator specifies delivery format of the implementation capability. */ 500 typedef enum { 501 MFX_IMPLCAPS_IMPLDESCSTRUCTURE = 1, /*!< Deliver capabilities as mfxImplDescription structure. */ 502 MFX_IMPLCAPS_IMPLEMENTEDFUNCTIONS = 2, /*!< Deliver capabilities as mfxImplementedFunctions structure. */ 503 MFX_IMPLCAPS_IMPLPATH = 3, /*!< Deliver pointer to the null-terminated string with the path to the 504 implementation. String is delivered in a form of buffer of 505 mfxChar type. */ 506 #ifdef ONEVPL_EXPERIMENTAL 507 MFX_IMPLCAPS_DEVICE_ID_EXTENDED = 4 /*!< Deliver extended device ID information as mfxExtendedDeviceId 508 structure.*/ 509 #endif 510 } mfxImplCapsDeliveryFormat; 511 512 MFX_PACK_BEGIN_STRUCT_W_PTR() 513 /*! Specifies initialization parameters for API version starting from 2.0. 514 */ 515 typedef struct { 516 mfxAccelerationMode AccelerationMode; /*!< Hardware acceleration stack to use. OS dependent parameter. Use VA for Linux*, DX* for Windows* or HDDL. */ 517 mfxU16 reserved[3]; /*!< Reserved for future use. */ 518 mfxU16 NumExtParam; /*!< The number of extra configuration structures attached to this structure. */ 519 mfxExtBuffer **ExtParam; /*!< Points to an array of pointers to the extra configuration structures; see the ExtendedBufferID enumerator for a list of extended configurations. */ 520 mfxU32 VendorImplID; /*!< Vendor specific number with given implementation ID. Represents the same field from mfxImplDescription. */ 521 mfxU32 reserved2[3]; /*!< Reserved for future use. */ 522 } mfxInitializationParam; 523 MFX_PACK_END() 524 525 #ifdef __cplusplus 526 } 527 #endif /* __cplusplus */ 528 529 #endif 530 531