qsv: Update SDK version to v2022.2.4

See release note
https://github.com/oneapi-src/oneVPL/releases/tag/v2022.2.0

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2738>
This commit is contained in:
Seungha Yang 2022-07-09 05:38:05 +09:00
parent 242401915f
commit 2b3f690355
42 changed files with 1732 additions and 249 deletions

View file

@ -24,4 +24,8 @@
#include "mfxsurfacepool.h"
#ifdef ONEVPL_EXPERIMENTAL
#include "mfxencodestats.h"
#endif
#endif /* __MFXDEFS_H__ */

View file

@ -29,10 +29,70 @@ typedef struct {
} mfxExtBuffer;
MFX_PACK_END()
#ifdef ONEVPL_EXPERIMENTAL
#define MFX_REFINTERFACE_VERSION MFX_STRUCT_VERSION(1, 0)
MFX_PACK_BEGIN_STRUCT_W_PTR()
/*! The structure respresents reference counted interface structure.
The memory is allocated and released by the implementation.
*/
typedef struct mfxRefInterface {
mfxHDL Context; /*!< The context of the container interface. User should not touch (change, set, null) this pointer. */
mfxStructVersion Version; /*!< The version of the structure. */
/*! @brief
Increments the internal reference counter of the container. The container is not destroyed until the container
is released using the mfxRefInterface::Release function.
mfxRefInterface::AddRef should be used each time a new link to the container is created
(for example, copy structure) for proper management.
@param[in] ref_interface Valid interface.
@return
MFX_ERR_NONE If no error. \n
MFX_ERR_NULL_PTR If interface is NULL. \n
MFX_ERR_INVALID_HANDLE If mfxRefInterface->Context is invalid (for example NULL). \n
MFX_ERR_UNKNOWN Any internal error.
*/
mfxStatus (MFX_CDECL *AddRef)(struct mfxRefInterface* ref_interface);
/*! @brief
Decrements the internal reference counter of the container. mfxRefInterface::Release should be called after using the
mfxRefInterface::AddRef function to add a container or when allocation logic requires it.
@param[in] ref_interface Valid interface.
@return
MFX_ERR_NONE If no error. \n
MFX_ERR_NULL_PTR If interface is NULL. \n
MFX_ERR_INVALID_HANDLE If mfxRefInterface->Context is invalid (for example NULL). \n
MFX_ERR_UNDEFINED_BEHAVIOR If Reference Counter of container is zero before call. \n
MFX_ERR_UNKNOWN Any internal error.
*/
mfxStatus (MFX_CDECL *Release)(struct mfxRefInterface* ref_interface);
/*! @brief
Returns current reference counter of mfxRefInterface structure.
@param[in] ref_interface Valid interface.
@param[out] counter Sets counter to the current reference counter value.
@return
MFX_ERR_NONE If no error. \n
MFX_ERR_NULL_PTR If interface or counter is NULL. \n
MFX_ERR_INVALID_HANDLE If mfxRefInterface->Context is invalid (for example NULL). \n
MFX_ERR_UNKNOWN Any internal error.
*/
mfxStatus (MFX_CDECL *GetRefCounter)(struct mfxRefInterface* ref_interface, mfxU32* counter);
mfxHDL reserved[4];
}mfxRefInterface;
MFX_PACK_END()
#endif
/* Library initialization and deinitialization */
/*!
This enumerator itemizes implementation types.
The implementation type is a bit ORed value of the base type and any decorative flags.
The implementation type is a bit OR'ed value of the base type and any decorative flags.
@note This enumerator is for legacy dispatcher compatibility only. The new dispatcher does not use it.
*/
typedef mfxI32 mfxIMPL;
@ -129,7 +189,8 @@ typedef struct _mfxSyncPoint *mfxSyncPoint;
/*! The GPUCopy enumerator controls usage of GPU accelerated copying between video and system memory in the legacy Intel(r) Media SDK components. */
enum {
MFX_GPUCOPY_DEFAULT = 0, /*!< Use default mode for the legacy Intel(r) Media SDK implementation. */
MFX_GPUCOPY_ON = 1, /*!< Enable GPU accelerated copying. */
MFX_GPUCOPY_ON = 1, /*!< The hint to enable GPU accelerated copying when it is supported by the library.
If the library doesn't support GPU accelerated copy the operation will be made by CPU. */
MFX_GPUCOPY_OFF = 2 /*!< Disable GPU accelerated copying. */
};
@ -141,7 +202,7 @@ MFX_PACK_BEGIN_STRUCT_W_PTR()
typedef struct {
mfxIMPL Implementation; /*!< Enumerator that indicates the desired legacy Intel(r) Media SDK implementation. */
mfxVersion Version; /*!< Structure which specifies minimum library version or zero, if not specified. */
mfxU16 ExternalThreads; /*!< Desired threading mode. Value 0 means internal threading, 1 external. */
mfxU16 ExternalThreads; /*!< Desired threading mode. Value 0 means internal threading, 1 - external. */
/*! @internal :unnamed(union) @endinternal */
union {
struct {
@ -156,7 +217,7 @@ typedef struct {
MFX_PACK_END()
enum {
MFX_EXTBUFF_THREADS_PARAM = MFX_MAKEFOURCC('T','H','D','P') /*!< mfxExtThreadsParam buffer ID */
MFX_EXTBUFF_THREADS_PARAM = MFX_MAKEFOURCC('T','H','D','P') /*!< mfxExtThreadsParam buffer ID. */
};
MFX_PACK_BEGIN_USUAL_STRUCT()
@ -200,6 +261,7 @@ enum {
MFX_PLATFORM_XEHP_SDV = 45, /*!< Code name XeHP SDV. */
MFX_PLATFORM_DG2 = 46, /*!< Code name DG2. */
MFX_PLATFORM_ATS_M = 46, /*!< Code name ATS-M, same media functionality as DG2. */
MFX_PLATFORM_ALDERLAKE_N = 55, /*!< Code name Alder Lake N. */
MFX_PLATFORM_KEEMBAY = 50, /*!< Code name Keem Bay. */
};
@ -287,7 +349,12 @@ typedef struct {
mfxU32 CodecID; /*!< Encoder ID in FourCC format. */
mfxU16 MaxcodecLevel; /*!< Maximum supported codec level. See the CodecProfile enumerator for possible values. */
mfxU16 BiDirectionalPrediction; /*!< Indicates B-frames support. */
#ifdef ONEVPL_EXPERIMENTAL
mfxU16 ReportedStats; /*!< Indicates what type of statistics can be reported: block/slice/tile/frame. */
mfxU16 reserved[6]; /*!< Reserved for future use. */
#else
mfxU16 reserved[7]; /*!< Reserved for future use. */
#endif
mfxU16 NumProfiles; /*!< Number of supported profiles. */
/*! This structure represents the codec profile description. */
struct encprofile {
@ -514,10 +581,21 @@ MFX_PACK_BEGIN_STRUCT_W_PTR()
*/
typedef struct {
mfxAccelerationMode AccelerationMode; /*!< Hardware acceleration stack to use. OS dependent parameter. Use VA for Linux*, DX* for Windows* or HDDL. */
#ifdef ONEVPL_EXPERIMENTAL
mfxU16 DeviceCopy; /*!< Enables or disables device's accelerated copying between device and
host. See the GPUCopy enumerator for a list of valid values.
This parameter is the equivalent of mfxInitParam::GPUCopy. */
mfxU16 reserved[2]; /*!< Reserved for future use. */
#else
mfxU16 reserved[3]; /*!< Reserved for future use. */
mfxU16 NumExtParam; /*!< The number of extra configuration structures attached to this structure. */
mfxExtBuffer **ExtParam; /*!< Points to an array of pointers to the extra configuration structures; see the ExtendedBufferID enumerator for a list of extended configurations. */
mfxU32 VendorImplID; /*!< Vendor specific number with given implementation ID. Represents the same field from mfxImplDescription. */
#endif
mfxU16 NumExtParam; /*!< The number of extra configuration structures attached to this
structure. */
mfxExtBuffer **ExtParam; /*!< Points to an array of pointers to the extra configuration structures;
see the ExtendedBufferID enumerator for a list of extended
configurations. */
mfxU32 VendorImplID; /*!< Vendor specific number with given implementation ID. Represents
the same field from mfxImplDescription. */
mfxU32 reserved2[3]; /*!< Reserved for future use. */
} mfxInitializationParam;
MFX_PACK_END()

View file

@ -8,7 +8,7 @@
#define __MFXDEFS_H__
#define MFX_VERSION_MAJOR 2
#define MFX_VERSION_MINOR 6
#define MFX_VERSION_MINOR 7
// MFX_VERSION - version of API that 'assumed' by build may be provided externally
// if it omitted then latest stable API derived from Major.Minor is assumed

View file

@ -0,0 +1,458 @@
/*############################################################################
# Copyright Intel Corporation
#
# SPDX-License-Identifier: MIT
############################################################################*/
#ifdef ONEVPL_EXPERIMENTAL
#ifndef __MFXENCODESTATS_H__
#define __MFXENCODESTATS_H__
#include "mfxcommon.h"
#include "mfxstructures.h"
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
/*!< The enum to specify memory layout for statistics. */
typedef enum {
MFX_ENCODESTATS_MEMORY_LAYOUT_DEFAULT = 0, /*!< The default memory layout for statistics. */
} mfxEncodeBlkStatsMemLayout;
/*!< The enum to specify mode to gather statistics. */
typedef enum {
MFX_ENCODESTATS_MODE_DEFAULT = 0, /*!< Encode mode is selected by the implementation. */
MFX_ENCODESTATS_MODE_ENCODE = 1, /*!< Full encode mode. */
} mfxEncodeStatsMode;
/*!< Flags to specify what statistics will be reported by the implementation. */
enum {
MFX_ENCODESTATS_LEVEL_BLK = 0x1, /*!< Block level statistics. */
MFX_ENCODESTATS_LEVEL_SLICE = 0x2, /*!< Slice level statistics. */
MFX_ENCODESTATS_LEVEL_TILE = 0x4, /*!< Tile level statistics. */
MFX_ENCODESTATS_LEVEL_FRAME = 0x8, /*!< Frame level statistics. */
};
MFX_PACK_BEGIN_USUAL_STRUCT()
/*!< Specifies H.265 CTU header. */
typedef struct {
union {
struct {
mfxU32 CUcountminus1 : 6; /*!< Number of CU per CTU. */
mfxU32 MaxDepth : 2; /*!< Max quad-tree depth of CU in CTU. */
mfxU32 reserved : 24;
} bitfields0;
mfxU32 dword0;
};
mfxU16 CurrXAddr; /*!< Horizontal address of CTU. */
mfxU16 CurrYAddr; /*!< Vertical address of CTU. */
mfxU32 reserved1;
} mfxCTUHeader;
MFX_PACK_END()
MFX_PACK_BEGIN_USUAL_STRUCT()
/*!< Specifies H.265 CU info. */
typedef struct {
union {
struct {
mfxU32 CU_Size : 2; /*!< indicates the CU size of the current CU. 0: 8x8 1: 16x16 2: 32x32 3: 64x64 */
mfxU32 CU_pred_mode : 1; /*!< indicates the prediction mode for the current CU. 0: intra 1: inter */
/*!
indicates the PU partition mode for the current CU.
0: 2Nx2N
1: 2NxN (inter)
2: Nx2N (inter)
3: NXN (intra only, CU Size=8x8 only. Luma Intra Mode indicates the intra prediction mode for 4x4_0. The additional prediction modes are overloaded on 4x4_1, 4x4_2, 4x4_3 below)
4: 2NxnT (inter only)
5: 2NxnB (inter only)
6: nLx2N (inter only)
7: nRx2N (inter only).
*/
mfxU32 CU_part_mode : 3;
mfxU32 InterPred_IDC_MV0 : 2; /*!< indicates the prediction direction for PU0 of the current CU. 0: L0 1: L1 2: Bi 3: reserved */
mfxU32 InterPred_IDC_MV1 : 2; /*!< indicates the prediction direction for PU1 of the current CU. 0: L0 1: L1 2: Bi 3: reserved */
/*!
Final explicit Luma Intra Mode 4x4_0 for NxN.
Valid values 0..34
Note: CU_part_mode==NxN.
*/
mfxU32 LumaIntraMode : 6;
/*!
indicates the final explicit Luma Intra Mode for the CU.
0: DM (use Luma mode, from block 0 if NxN)
1: reserved
2: Planar
3: Vertical
4: Horizontal
5: DC */
mfxU32 ChromaIntraMode : 3;
mfxU32 reserved : 13;
} bitfields0;
mfxU32 dword0;
};
union {
struct {
/*!
Final explicit Luma Intra Mode 4x4_1.
Valid values 0..34
Note: CU_part_mode==NxN.
*/
mfxU32 LumaIntraMode4x4_1 : 6;
/*!
Final explicit Luma Intra Mode 4x4_2.
Valid values 0..34
Note: CU_part_mode==NxN.
*/
mfxU32 LumaIntraMode4x4_2 : 6;
/*!
Final explicit Luma Intra Mode 4x4_3.
Valid values 0..34
Note: CU_part_mode==NxN.
*/
mfxU32 LumaIntraMode4x4_3 : 6;
mfxU32 reserved1 : 14;
} bitfields1;
mfxU32 dword1;
};
mfxI8 QP; // signed QP value
mfxU8 reserved2[3];
/*! distortion measure, approximation to SAD.
Will deviate significantly (pre, post reconstruction) and due to variation in algorithm.
*/
mfxU32 SAD;
/*!
These parameters indicate motion vectors that are associated with the PU0/PU1 winners
range [-2048.00..2047.75].
L0/PU0 - MV[0][0]
L0/PU1 - MV[0][1]
L1/PU0 - MV[1][0]
L1/PU1 - MV[1][1]
*/
mfxI16Pair MV[2][2];
union {
struct {
/*!
This parameter indicates the reference index associated with the MV X/Y
that is populated in the L0_MV0.X and L0_MV0.Y fields. */
mfxU32 L0_MV0_RefID : 4;
/*!
This parameter indicates the reference index associated with the MV X/Y
that is populated in the L0_MV1.X and L0_MV1.Y fields. */
mfxU32 L0_MV1_RefID : 4;
/*!
This parameter indicates the reference index associated with the MV X/Y
that is populated in the L1_MV0.X and L1_MV0.Y fields. */
mfxU32 L1_MV0_RefID : 4;
/*!
This parameter indicates the reference index associated with the MV X/Y
that is populated in the L1_MV1.X and L1_MV1.Y fields. */
mfxU32 L1_MV1_RefID : 4;
mfxU32 reserved3 : 16;
} bitfields8;
mfxU32 dword8;
};
mfxU32 reserved4[10]; /*< should be minimized! */
} mfxCUInfo;
MFX_PACK_END()
MFX_PACK_BEGIN_USUAL_STRUCT()
/*!< Specifies H.265 CTU. */
typedef struct {
mfxCTUHeader CtuHeader; /*!< H.265 CTU header. */
mfxCUInfo CuInfo[64]; /*!< Array of CU. */
mfxU32 reserved;
} mfxCTUInfo;
MFX_PACK_END()
MFX_PACK_BEGIN_USUAL_STRUCT()
/*!
The structure describes H.264 stats per MB.
*/
typedef struct {
union {
struct {
/*!
Together with @p IntraMbFlag this parameter specifies macroblock type according to the
ISO\*\/IEC\* 14496-10 with the following difference - it stores either intra or inter
values according to @p IntraMbFlag, but not intra after inter.
Values for P-slices are mapped to B-slice values. For example P_16x8 is coded with
B_FWD_16x8 value.
*/
mfxU32 MBType : 5;
/*!
This field specifies inter macroblock mode and is ignored for intra MB. It is derived from @p MbType and has next values:
@li 0 - 16x16 mode
@li 1 - 16x8 mode
@li 2 - 8x16 mode
@li 3 - 8x8 mode
*/
mfxU32 InterMBMode : 2;
/*!
This field specifies intra macroblock mode and is ignored for inter MB. It is derived from @p MbType and has next values:
@li 0 - 16x16 mode
@li 1 - 8x8 mode
@li 2 - 4x4 mode
@li 3 - PCM
*/
mfxU32 IntraMBMode : 2;
/*!
This flag specifies intra/inter MB type and has next values:
0 - Inter prediction MB type
1 - Intra prediction MB type
*/
mfxU32 IntraMBFlag : 1;
/*!
This field specifies subblock shapes for the current MB. Each block is described by 2 bits starting from lower bits for block 0.
@li 0 - 8x8
@li 1 - 8x4
@li 2 - 4x8
@li 3 - 4x4
*/
mfxU32 SubMBShapes : 8;
/*!
This field specifies prediction modes for the current MB partition blocks. Each block is described by 2 bits starting from lower bits for block 0.
@li 0 - Pred_L0
@li 1 - Pred_L1
@li 2 - BiPred
@li 3 - reserved
Only one prediction value for partition is reported, the rest values are set to zero. For example:
@li 16x16 Pred_L1 - 0x01 (only 2 lower bits are used)
@li 16x8 Pred_L1 / BiPred - 0x09 (1001b)
@li 8x16 BiPred / BiPred - 0x0a (1010b)
For P MBs this value is always zero.
*/
mfxU32 SubMBShapeMode : 8;
/*!
This value specifies chroma intra prediction mode.
@li 0 - DC
@li 1 - Horizontal
@li 2 - Vertical
@li 3 - Plane
*/
mfxU32 ChromaIntraPredMode : 2;
mfxU32 reserved : 4;
} bitfields0;
mfxU32 dword0;
} ;
/*!
Distortion measure, approximation to SAD.
Deviate significantly (pre, post reconstruction) and due to variation in algorithm.
*/
mfxU32 SAD;
mfxI8 Qp; /*!< MB QP. */
mfxU8 reserved1[3];
/*!
These values specify luma intra prediction modes for current MB. Each element of the array
corresponds to 8x8 block and each holds prediction modes for four 4x4 subblocks.
Four bits per mode, lowest bits for left top subblock.
All 16 prediction modes are always specified. For 8x8 case, block prediction mode is
populated to all subblocks of the 8x8 block. For 16x16 case - to all subblocks of the MB.
Prediction directions for 4x4 and 8x8 blocks:
@li 0 - Vertical
@li 1 - Horizontal
@li 2 - DC
@li 3 - Diagonal Down Left
@li 4 - Diagonal Down Right
@li 5 - Vertical Right
@li 6 - Horizontal Down
@li 7 - Vertical Left
@li 8 - Horizontal Up
Prediction directions for 16x16 blocks:
@li 0 - Vertical
@li 1 - Horizontal
@li 2 - DC
@li 3 - Plane
*/
mfxU16 LumaIntraMode[4];
mfxU32 reserved2;
} mfxMBInfo;
MFX_PACK_END()
/*!
The enum specifies block size.
*/
typedef enum {
MFX_BLOCK_4X4 = 0, /*!< 4x4 block size. */
MFX_BLOCK_16X16 = 1, /*!< 16x16 block size. */
} mfxBlockSize;
MFX_PACK_BEGIN_STRUCT_W_PTR()
/*!
The structure describes H.264 and H.265 stats per MB or CTUs.
*/
typedef struct {
union {
mfxU32 NumMB; /*!< Number of MBs per frame for H.264. */
mfxU32 NumCTU; /*!< number of CTUs per frame for H.265. */
};
union {
mfxCTUInfo *HEVCCTUArray; /*!< Array of CTU statistics. */
mfxMBInfo *AVCMBArray; /*!< Array of MB statistics. */
};
mfxU32 reserved[8];
} mfxEncodeBlkStats;
MFX_PACK_END()
MFX_PACK_BEGIN_STRUCT_W_L_TYPE()
/*!
The structure describes H.264/H.265 frame/slice/tile level statistics.
*/
typedef struct {
mfxF32 PSNRLuma; /*!< PSNR for LUMA samples. */
mfxF32 PSNRCb; /*!< PSNR for Chroma (Cb) samples. */
mfxF32 PSNRCr; /*!< PSNR for Chroma (Cr) samples. */
/*! distortion measure, approximation to SAD.
Will deviate significantly (pre, post reconstruction) and due to variation in algorithm.
*/
mfxU64 SADLuma;
mfxF32 Qp; /*< average frame QP, may have fractional part in case of MBQP. */
union {
mfxU32 NumMB; /*!< Number of MBs per frame for H.264. */
mfxU32 NumCTU; /*!< number of CTUs per frame for H.265. */
};
mfxBlockSize BlockSize; /*! For H.264 it is always 16x16 coresponding to MB size.
In H.265 it's normalized to 4x4, so for each CU we calculate number of 4x4 which belongs to the block. */
mfxU32 NumIntraBlock; /*! Number of intra blocks in the frame. The size of block is defined by BlockSize.
For H.265 it can be more than number of intra CU. */
mfxU32 NumInterBlock; /*! Number of inter blocks in the frame. The size of block is defined by BlockSize.
For H.265 it can be more than number of inter CU. */
mfxU32 NumSkippedBlock; /*! Number of skipped blocks in the frame. The size of block is defined by BlockSize.
For H.265 it can be more than number of skipped CU. */
mfxU32 reserved[8];
} mfxEncodeHighLevelStats;
MFX_PACK_END()
/*!
Alias for the structure to describe H.264 and H.265 frame level stats.
*/
typedef mfxEncodeHighLevelStats mfxEncodeFrameStats;
MFX_PACK_BEGIN_STRUCT_W_PTR()
/*!
The structure describes H.264 and H.265 stats per Slice or Tile.
*/
typedef struct {
mfxU32 NumElements; /*!< Number of Slices or Tiles per frame for H.264/H.265. */
mfxEncodeHighLevelStats *HighLevelStatsArray; /*!< Array of CTU statistics. */
mfxU32 reserved[8];
} mfxEncodeSliceStats;
MFX_PACK_END()
/*!
Alias for the structure to describe H.264 and H.265 tile level stats.
*/
typedef mfxEncodeSliceStats mfxEncodeTileStats;
#define MFX_ENCODESTATSCONTAINER_VERSION MFX_STRUCT_VERSION(1, 0)
MFX_PACK_BEGIN_STRUCT_W_PTR()
/*! The structure respresnts reference counted container for output after encoding operation which includes statistics
and synchronization primitive for compressed bitstream.
The memory is allocated and released by the library.
*/
typedef struct mfxEncodeStatsContainer {
mfxStructVersion Version; /*!< The version of the structure. */
mfxRefInterface RefInterface; /*! < Reference counting interface. */
/*! @brief
Guarantees readiness of the statistics after a function completes.
Instead of MFXVideoCORE_SyncOperation which leads to the synchronization of all output objects,
users may directly call the mfxEncodeStatsContainer::SynchronizeStatistics function to get output statistics.
@param[in] ref_interface Valid interface.
@param[out] wait Wait time in milliseconds.
@return
MFX_ERR_NONE If no error. \n
MFX_ERR_NULL_PTR If interface is NULL. \n
MFX_ERR_INVALID_HANDLE If any of container is not valid object . \n
MFX_WRN_IN_EXECUTION If the given timeout is expired and the container is not ready. \n
MFX_ERR_ABORTED If the specified asynchronous function aborted due to data dependency on a previous asynchronous function that did not complete. \n
MFX_ERR_UNKNOWN Any internal error.
*/
mfxStatus (MFX_CDECL *SynchronizeStatistics)(mfxRefInterface* ref_interface, mfxU32 wait);
/*! @brief
Guarantees readiness of associated compressed bitstream after a function completes.
Instead of MFXVideoCORE_SyncOperation which leads to the synchronization of all output objects,
users may directly call the mfxEncodeStatsContainer::SynchronizeStatistics function to get output bitstream.
@param[in] ref_interface Valid interface.
@param[out] wait Wait time in milliseconds.
@return
MFX_ERR_NONE If no error. \n
MFX_ERR_NULL_PTR If interface is NULL. \n
MFX_ERR_INVALID_HANDLE If any of container is not valid object . \n
MFX_WRN_IN_EXECUTION If the given timeout is expired and the container is not ready. \n
MFX_ERR_ABORTED If the specified asynchronous function aborted due to data dependency on a previous asynchronous function that did not complete. \n
MFX_ERR_UNKNOWN Any internal error.
*/
mfxStatus (MFX_CDECL *SynchronizeBitstream)(mfxRefInterface* ref_interface, mfxU32 wait);
mfxHDL reserved[4];
mfxU32 reserved1[2];
mfxU32 DisplayOrder; /*< To which frame number statistics belong. */
mfxEncodeBlkStatsMemLayout MemLayout; /*< Memory layout for statistics. */
mfxEncodeBlkStats *EncodeBlkStats; /*< Block level statistics. */
mfxEncodeSliceStats *EncodeSliceStats; /*< Slice level statistics. */
mfxEncodeTileStats *EncodeTileStats; /*< Tile level statistics. */
mfxEncodeFrameStats *EncodeFrameStats; /*< Frame level statistics. */
mfxU32 reserved2[8];
}mfxEncodeStatsContainer;
MFX_PACK_END()
MFX_PACK_BEGIN_STRUCT_W_PTR()
/*! The extension buffer which should be attached by application for mfxBitstream buffer before
encode operation. As result the encoder will allocate memory for statistics and fill appropriate structures.
*/
typedef struct {
mfxExtBuffer Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUFF_ENCODESTATS_BLK. */
mfxU16 EncodeStatsFlags; /*! What statistics is required: block/slice/tile/frame level or any combinations.
In case of slice or tile output statistics for one slice or tile will be availbale only.*/
mfxEncodeStatsMode Mode; /*!< What encoding mode should be used to gather statistics. */
mfxEncodeStatsContainer *EncodeStatsContainer; /*!< encode output, filled by the implementation. */
mfxU32 reserved[8];
} mfxExtEncodeStatsOutput;
MFX_PACK_END()
#ifdef __cplusplus
} // extern "C"
#endif
#endif
#endif

View file

@ -62,9 +62,9 @@ enum {
MFX_PACK_BEGIN_USUAL_STRUCT()
/*!
Specifies quantization tables. The application may specify up to 4 quantization tables. The encoder assigns an ID to each table.
That ID is equal to the table index in the Qm array. Table 0 is used for encoding of the Y component, table 1 for the U component, and table 2
That ID is equal to the table index in the Qm array. Table "0" is used for encoding of the Y component, table "1" for the U component, and table "2"
for the V component. The application may specify fewer tables than the number of components in the image. If two tables are specified,
then table 1 is used for both U and V components. If only one table is specified then it is used for all components in the image.
then table "1" is used for both U and V components. If only one table is specified then it is used for all components in the image.
The following table illustrates this behavior.
@internal
@ -94,8 +94,8 @@ MFX_PACK_END()
MFX_PACK_BEGIN_USUAL_STRUCT()
/*!
Specifies Huffman tables. The application may specify up to 2 quantization table pairs for baseline process. The encoder
assigns an ID to each table. That ID is equal to the table index in the DCTables and ACTables arrays. Table 0 is used for encoding of the Y component and
table 1 is used for encoding of the U and V component. The application may specify only one table, in which case the table will be used for all components in the image.
assigns an ID to each table. That ID is equal to the table index in the DCTables and ACTables arrays. Table "0" is used for encoding of the Y component and
table "1" is used for encoding of the U and V component. The application may specify only one table, in which case the table will be used for all components in the image.
The following table illustrates this behavior.
@internal

View file

@ -129,7 +129,7 @@ enum {
/*! RGB 24 bit planar layout (3 separate channels, 8-bits per sample each). This format should be mapped to D3DFMT_R8G8B8 or VA_FOURCC_RGBP. */
MFX_FOURCC_RGBP = MFX_MAKEFOURCC('R','G','B','P'),
MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_FOURCC_RGB3) = MFX_MAKEFOURCC('R','G','B','3'), /* Deprecated. */
MFX_FOURCC_RGB4 = MFX_MAKEFOURCC('R','G','B','4'), /*!< RGB4 (RGB32) color planes. BGRA is the order, B is 8 MSBs, then 8 bits for G channel, then R and A channels. */
MFX_FOURCC_RGB4 = MFX_MAKEFOURCC('R','G','B','4'), /*!< RGB4 (RGB32) color planes. BGRA is the order, 'B' is 8 MSBs, then 8 bits for 'G' channel, then 'R' and 'A' channels. */
/*!
Internal color format. The application should use the following functions to create a surface that corresponds to the Direct3D* version in use.
@ -149,10 +149,10 @@ enum {
MFX_FOURCC_P010 = MFX_MAKEFOURCC('P','0','1','0'), /*!< P010 color format. This is 10 bit per sample format with similar to NV12 layout. This format should be mapped to DXGI_FORMAT_P010. */
MFX_FOURCC_P016 = MFX_MAKEFOURCC('P','0','1','6'), /*!< P016 color format. This is 16 bit per sample format with similar to NV12 layout. This format should be mapped to DXGI_FORMAT_P016. */
MFX_FOURCC_P210 = MFX_MAKEFOURCC('P','2','1','0'), /*!< 10 bit per sample 4:2:2 color format with similar to NV12 layout. */
MFX_FOURCC_BGR4 = MFX_MAKEFOURCC('B','G','R','4'), /*!< RGBA color format. It is similar to MFX_FOURCC_RGB4 but with different order of channels. R is 8 MSBs, then 8 bits for G channel, then B and A channels. */
MFX_FOURCC_A2RGB10 = MFX_MAKEFOURCC('R','G','1','0'), /*!< 10 bits ARGB color format packed in 32 bits. A channel is two MSBs, then R, then G and then B channels. This format should be mapped to DXGI_FORMAT_R10G10B10A2_UNORM or D3DFMT_A2R10G10B10. */
MFX_FOURCC_ARGB16 = MFX_MAKEFOURCC('R','G','1','6'), /*!< 10 bits ARGB color format packed in 64 bits. A channel is 16 MSBs, then R, then G and then B channels. This format should be mapped to DXGI_FORMAT_R16G16B16A16_UINT or D3DFMT_A16B16G16R16 formats. */
MFX_FOURCC_ABGR16 = MFX_MAKEFOURCC('B','G','1','6'), /*!< 10 bits ABGR color format packed in 64 bits. A channel is 16 MSBs, then B, then G and then R channels. This format should be mapped to DXGI_FORMAT_R16G16B16A16_UINT or D3DFMT_A16B16G16R16 formats. */
MFX_FOURCC_BGR4 = MFX_MAKEFOURCC('B','G','R','4'), /*!< RGBA color format. It is similar to MFX_FOURCC_RGB4 but with different order of channels. 'R' is 8 MSBs, then 8 bits for 'G' channel, then 'B' and 'A' channels. */
MFX_FOURCC_A2RGB10 = MFX_MAKEFOURCC('R','G','1','0'), /*!< 10 bits ARGB color format packed in 32 bits. 'A' channel is two MSBs, then 'R', then 'G' and then 'B' channels. This format should be mapped to DXGI_FORMAT_R10G10B10A2_UNORM or D3DFMT_A2R10G10B10. */
MFX_FOURCC_ARGB16 = MFX_MAKEFOURCC('R','G','1','6'), /*!< 10 bits ARGB color format packed in 64 bits. 'A' channel is 16 MSBs, then 'R', then 'G' and then 'B' channels. This format should be mapped to DXGI_FORMAT_R16G16B16A16_UINT or D3DFMT_A16B16G16R16 formats. */
MFX_FOURCC_ABGR16 = MFX_MAKEFOURCC('B','G','1','6'), /*!< 10 bits ABGR color format packed in 64 bits. 'A' channel is 16 MSBs, then 'B', then 'G' and then 'R' channels. This format should be mapped to DXGI_FORMAT_R16G16B16A16_UINT or D3DFMT_A16B16G16R16 formats. */
MFX_FOURCC_R16 = MFX_MAKEFOURCC('R','1','6','U'), /*!< 16 bits single channel color format. This format should be mapped to DXGI_FORMAT_R16_TYPELESS or D3DFMT_R16F. */
MFX_FOURCC_AYUV = MFX_MAKEFOURCC('A','Y','U','V'), /*!< YUV 4:4:4, AYUV color format. This format should be mapped to DXGI_FORMAT_AYUV. */
MFX_FOURCC_AYUV_RGB4 = MFX_MAKEFOURCC('A','V','U','Y'), /*!< RGB4 stored in AYUV surface. This format should be mapped to DXGI_FORMAT_AYUV. */
@ -170,6 +170,10 @@ enum {
MFX_FOURCC_BGRA = MFX_FOURCC_RGB4, /*!< Alias for the RGB4 color format. */
/*! BGR 24 bit planar layout (3 separate channels, 8-bits per sample each). This format should be mapped to VA_FOURCC_BGRP. */
MFX_FOURCC_BGRP = MFX_MAKEFOURCC('B','G','R','P'),
#ifdef ONEVPL_EXPERIMENTAL
/*! 8bit per sample 4:4:4 format packed in 32 bits, X=unused/undefined, 'X' channel is 8 MSBs, then 'Y', then 'U', and then 'V' channels. This format should be mapped to VA_FOURCC_XYUV. */
MFX_FOURCC_XYUV = MFX_MAKEFOURCC('X','Y','U','V'),
#endif
};
/* PicStruct */
@ -353,9 +357,7 @@ typedef enum {
MFX_HANDLE_VA_CONTEXT_ID = 7, /*!< Pointer to VAContextID interface. It represents external VA context for Common Encryption usage model. */
MFX_HANDLE_CM_DEVICE = 8, /*!< Pointer to CmDevice interface ( Intel(r) C for Metal Runtime ). */
MFX_HANDLE_HDDLUNITE_WORKLOADCONTEXT = 9, /*!< Pointer to HddlUnite::WorkloadContext interface. */
#ifdef ONEVPL_EXPERIMENTAL
MFX_HANDLE_PXP_CONTEXT = 10, /*!< Pointer to PXP context for protected content support. */
#endif
} mfxHandleType;
/*! The mfxMemoryFlags enumerator specifies memory access mode. */
@ -571,6 +573,8 @@ typedef struct mfxFrameSurfaceInterface {
@attention This is callback function and intended to be called by
the library only.
@note The library calls this callback only when this surface is used as the output surface.
It is expected that the function is low-intrusive designed otherwise it may
impact performance.
@ -786,9 +790,9 @@ typedef struct {
all components are encoded in one scan. See the JPEG Scan Type enumerator for details. */
mfxU16 Interleaved;
/*! Specifies the image quality if the application does not specified quantization table.
The value is from 1 to 100 inclusive. 100 is the best quality. */
The value is from 1 to 100 inclusive. "100" is the best quality. */
mfxU16 Quality;
/*! Specifies the number of MCU in the restart interval. “0” means no restart interval. */
/*! Specifies the number of MCU in the restart interval. "0" means no restart interval. */
mfxU16 RestartInterval;
mfxU16 reserved5[10];
};
@ -1246,7 +1250,7 @@ MFX_PACK_END()
enum {
MFX_B_REF_UNKNOWN = 0, /*!< Default value, it is up to the encoder to use B-frames as reference. */
MFX_B_REF_OFF = 1, /*!< Do not use B-frames as reference. */
MFX_B_REF_PYRAMID = 2 /*!< Arrange B-frames in so-called “B pyramid” reference structure. */
MFX_B_REF_PYRAMID = 2 /*!< Arrange B-frames in so-called "B pyramid" reference structure. */
};
/*! The LookAheadDownSampling enumerator is used to control down sampling in look ahead bitrate control mode in AVC encoder. */
@ -1481,7 +1485,7 @@ enum {
enum {
MFX_P_REF_DEFAULT = 0, /*!< Allow encoder to decide. */
MFX_P_REF_SIMPLE = 1, /*!< Regular sliding window used for DPB removal process. */
MFX_P_REF_PYRAMID = 2 /*!< Let N be the max reference lists size. Encoder treats each Ns frame as a 'strong'
MFX_P_REF_PYRAMID = 2 /*!< Let N be the max reference list's size. Encoder treats each N's frame as a 'strong'
reference and the others as 'weak' references. The encoder uses a 'weak' reference only for
prediction of the next frame and removes it from DPB immediately after use. 'Strong' references are removed from
DPB by a sliding window. */
@ -2146,6 +2150,10 @@ enum {
the mfxEncodeCtrl structure for per-frame encoding configuration.
*/
MFX_EXTBUFF_UNIVERSAL_REFLIST_CTRL = MFX_EXTBUFF_AVC_REFLIST_CTRL,
/*!
See the mfxExtEncodeStats structure for details.
*/
MFX_EXTBUFF_ENCODESTATS = MFX_MAKEFOURCC('E','N','S','B'),
#endif
/*!
See the mfxExtVPP3DLut structure for more details.
@ -2161,7 +2169,7 @@ enum {
/* VPP Conf: Do not use certain algorithms */
MFX_PACK_BEGIN_STRUCT_W_PTR()
/*!
Tells the VPP not to use certain filters in pipeline. See Configurable VPP filters table for complete
Tells the VPP not to use certain filters in pipeline. See "Configurable VPP filters" table for complete
list of configurable filters. The user can attach this structure to the mfxVideoParam structure when initializing video processing.
*/
typedef struct {
@ -2392,7 +2400,7 @@ typedef struct {
};
};
MFX_DEPRECATED mfxU16 SceneChangeRate; /* Deprecated */
MFX_DEPRECATED mfxU16 RepeatedFrame; /* Deprecated */
mfxU16 RepeatedFrame; /*!< The flag signalizes that the frame is identical to the previous one. */
} mfxExtVppAuxData;
MFX_PACK_END()
@ -2706,7 +2714,7 @@ MFX_PACK_BEGIN_STRUCT_W_PTR()
@li Attaching a filter configuration structure directly to the mfxVideoParam structure.
In this method, adding filter ID to the mfxExtVPPDoUse structure is optional.
See Table Configurable VPP filters for complete list of
See Table "Configurable VPP filters" for complete list of
configurable filters, their IDs, and configuration structures.
The user can attach this structure to the mfxVideoParam structure when initializing video processing.
@ -2830,7 +2838,7 @@ enum {
MFX_PACK_BEGIN_USUAL_STRUCT()
/*!
Configures the HDR SEI message.
Handle the HDR SEI message.
If the application attaches this structure to the mfxEncodeCtrl structure
at runtime, the encoder inserts the HDR SEI message for the current frame and ignores InsertPayloadToggle.
@ -2840,6 +2848,12 @@ MFX_PACK_BEGIN_USUAL_STRUCT()
If the application attaches this structure for video processing, InsertPayloadToggle will be ignored.
If the application attaches this structure to the mfxFrameSurface1 structure at runtime
which will seed to the MFXVideoDECODE_DecodeFrameAsync() as surface_work parameter,
the decoder will parse the HDR SEI message if the bitstream include HDR SEI message per frame.
The parsed HDR SEI will be attached to the ExtendBuffer of surface_out parameter of MFXVideoDECODE_DecodeFrameAsync().
This function is support for HEVC only now.
Field semantics are defined in ITU-T* H.265 Annex D.
*/
typedef struct {
@ -2864,7 +2878,7 @@ MFX_PACK_END()
MFX_PACK_BEGIN_USUAL_STRUCT()
/*!
Configures the HDR SEI message.
Handle the HDR SEI message.
If the application attaches this structure to the mfxEncodeCtrl
structure at runtime, the encoder inserts the HDR SEI message for the current frame and ignores InsertPayloadToggle.
@ -2875,6 +2889,12 @@ MFX_PACK_BEGIN_USUAL_STRUCT()
If the application attaches this structure for video processing, InsertPayloadToggle will be ignored.
If the application attaches this structure to the mfxFrameSurface1 structure at runtime
which will seed to the MFXVideoDECODE_DecodeFrameAsync() as surface_work parameter,
the decoder will parse the HDR SEI message if the bitstream include HDR SEI message per frame.
The parsed HDR SEI will be attached to the ExtendBuffer of surface_out parameter of MFXVideoDECODE_DecodeFrameAsync().
This function is support for HEVC only now.
Field semantics are defined in ITU-T* H.265 Annex D.
*/
typedef struct {
@ -3324,7 +3344,7 @@ MFX_PACK_BEGIN_USUAL_STRUCT()
Specifies reference lists for the encoder. It may be used together with the mfxExtAVCRefListCtrl
structure to create customized reference lists. If both structures are used together, then the encoder takes reference lists from the
mfxExtAVCRefLists structure and modifies them according to the mfxExtAVCRefListCtrl instructions. In case of interlaced coding,
the first mfxExtAVCRefLists structure affects TOP field and the second BOTTOM field.
the first mfxExtAVCRefLists structure affects TOP field and the second - BOTTOM field.
@note Not all implementations of the encoder support this structure. The application must use the Query API function to determine if it is supported.
*/
@ -3490,7 +3510,7 @@ typedef struct {
For AVC, the valid range is 1 to 51.
For HEVC, the valid range is 1 to 51. Applications provided QP values should be valid. Otherwise invalid QP values may cause undefined behavior.
For HEVC, the valid range is 1 to 51. Application's provided QP values should be valid. Otherwise invalid QP values may cause undefined behavior.
MBQP map should be aligned for 16x16 block size. The alignment rule is (width +15 /16) && (height +15 /16).
For MPEG2, QP corresponds to quantizer_scale of the ISO*\/IEC* 13818-2 specification and has a valid range of 1 to 112.
@ -3645,7 +3665,6 @@ enum {
MFX_ERROR_SLICEHEADER = (1 << 2), /*!< Invalid/corrupted slice header. */
MFX_ERROR_SLICEDATA = (1 << 3), /*!< Invalid/corrupted slice data. */
MFX_ERROR_FRAME_GAP = (1 << 4), /*!< Missed frames. */
#ifdef ONEVPL_EXPERIMENTAL
MFX_ERROR_JPEG_APP0_MARKER = (1 << 5), /*!< Invalid/corrupted APP0 marker. */
MFX_ERROR_JPEG_APP1_MARKER = (1 << 6), /*!< Invalid/corrupted APP1 marker. */
MFX_ERROR_JPEG_APP2_MARKER = (1 << 7), /*!< Invalid/corrupted APP2 marker. */
@ -3667,7 +3686,6 @@ enum {
MFX_ERROR_JPEG_DRI_MARKER = (1 << 23), /*!< Invalid/corrupted DRI marker. */
MFX_ERROR_JPEG_SOS_MARKER = (1 << 24), /*!< Invalid/corrupted SOS marker. */
MFX_ERROR_JPEG_UNKNOWN_MARKER = (1 << 25), /*!< Unknown Marker. */
#endif
};
@ -3755,8 +3773,8 @@ typedef struct {
mfxU16 LumaLog2WeightDenom; /*!< Base 2 logarithm of the denominator for all luma weighting factors. Value must be in the range of 0 to 7, inclusive. */
mfxU16 ChromaLog2WeightDenom; /*!< Base 2 logarithm of the denominator for all chroma weighting factors. Value must be in the range of 0 to 7, inclusive. */
mfxU16 LumaWeightFlag[2][32]; /*!< LumaWeightFlag[L][R] equal to 1 specifies that the weighting factors for the luma component are specified for Rs entry of RefPicList L. */
mfxU16 ChromaWeightFlag[2][32]; /*!< ChromaWeightFlag[L][R] equal to 1 specifies that the weighting factors for the chroma component are specified for Rs entry of RefPicList L. */
mfxU16 LumaWeightFlag[2][32]; /*!< LumaWeightFlag[L][R] equal to 1 specifies that the weighting factors for the luma component are specified for R's entry of RefPicList L. */
mfxU16 ChromaWeightFlag[2][32]; /*!< ChromaWeightFlag[L][R] equal to 1 specifies that the weighting factors for the chroma component are specified for R's entry of RefPicList L. */
mfxI16 Weights[2][32][3][2]; /*!< The values of the weights and offsets used in the encoding processing. The value of Weights[i][j][k][m] is
interpreted as: i refers to reference picture list 0 or 1; j refers to reference list entry 0-31;
k refers to data for the luma component when it is 0, the Cb chroma component when it is 1 and
@ -3993,7 +4011,7 @@ typedef struct {
MFX_PACK_END()
/*! The ChromaSiting enumerator defines chroma location. Use bit-ORed values to specify the desired location. */
/*! The ChromaSiting enumerator defines chroma location. Use bit-OR'ed values to specify the desired location. */
enum {
MFX_CHROMA_SITING_UNKNOWN = 0x0000, /*!< Unspecified. */
MFX_CHROMA_SITING_VERTICAL_TOP = 0x0001, /*!< Chroma samples are co-sited vertically on the top with the luma samples. */
@ -4054,9 +4072,9 @@ MFX_PACK_BEGIN_USUAL_STRUCT()
*/
typedef struct {
mfxU16 FeatureEnabled; /*!< Indicates which features are enabled for the segment. See the SegmentFeature enumerator for values for this
option. Values from the enumerator can be bit-ORed. Support of a particular feature depends on underlying
option. Values from the enumerator can be bit-OR'ed. Support of a particular feature depends on underlying
hardware platform. Application can check which features are supported by calling Query. */
mfxI16 QIndexDelta; /*!< Quantization index delta for the segment. Ignored if MFX_VP9_SEGMENT_FEATURE_QINDEX isnt set in FeatureEnabled.
mfxI16 QIndexDelta; /*!< Quantization index delta for the segment. Ignored if MFX_VP9_SEGMENT_FEATURE_QINDEX isn't set in FeatureEnabled.
Valid range for this parameter is [-255, 255]. If QIndexDelta is out of this range, it will be ignored.
If QIndexDelta is within valid range, but sum of base quantization index and QIndexDelta is out of [0, 255],
QIndexDelta will be clamped. */
@ -4065,7 +4083,7 @@ typedef struct {
it will be ignored. If LoopFilterLevelDelta is within valid range, but sum of base loop filter level and
LoopFilterLevelDelta is out of [0, 63], LoopFilterLevelDelta will be clamped. */
mfxU16 ReferenceFrame; /*!< Reference frame for the segment. See VP9ReferenceFrame enumerator for values for this option. Ignored
if MFX_VP9_SEGMENT_FEATURE_REFERENCE isnt set in FeatureEnabled. */
if MFX_VP9_SEGMENT_FEATURE_REFERENCE isn't set in FeatureEnabled. */
mfxU16 reserved[12];
} mfxVP9SegmentParam;
MFX_PACK_END()
@ -4073,13 +4091,13 @@ MFX_PACK_END()
MFX_PACK_BEGIN_STRUCT_W_L_TYPE()
/*!
In the VP9 encoder it is possible to divide a frame into up to 8 segments and apply particular features (like delta for quantization index or for
loop filter level) on a per-segment basis. Uncompressed header of every frame indicates if segmentation is enabled for the current frame,
and (if segmentation enabled) contains full information about features applied to every segment. Every Mode info block of a coded
loop filter level) on a per-segment basis. "Uncompressed header" of every frame indicates if segmentation is enabled for the current frame,
and (if segmentation enabled) contains full information about features applied to every segment. Every "Mode info block" of a coded
frame has segment_id in the range of 0 to 7.
To enable Segmentation, the mfxExtVP9Segmentation structure with correct settings should be passed to the encoder. It can be attached to the
mfxVideoParam structure during initialization or the MFXVideoENCODE_Reset call (static configuration). If the mfxExtVP9Segmentation buffer isnt
attached during initialization, segmentation is disabled for static configuration. If the buffer isnt attached for the Reset call, the encoder
mfxVideoParam structure during initialization or the MFXVideoENCODE_Reset call (static configuration). If the mfxExtVP9Segmentation buffer isn't
attached during initialization, segmentation is disabled for static configuration. If the buffer isn't attached for the Reset call, the encoder
continues to use static configuration for segmentation which was the default before this Reset call. If the mfxExtVP9Segmentation buffer with
NumSegments=0 is provided during initialization or Reset call, segmentation becomes disabled for static configuration.
@ -4102,7 +4120,7 @@ typedef struct {
Entries with indexes bigger than NumSegments-1 are ignored. See the mfxVP9SegmentParam structure for
definitions of segment features and their parameters. */
mfxU16 SegmentIdBlockSize; /*!< Size of block (NxN) for segmentation map. See SegmentIdBlockSize enumerator for values for this
option. An encoded block that is bigger than SegmentIdBlockSize uses segment_id taken from its
option. An encoded block that is bigger than SegmentIdBlockSize uses segment_id taken from it's
top-left sub-block from the segmentation map. The application can check if a particular block size is
supported by calling Query. */
mfxU32 NumSegmentIdAlloc; /*!< Size of buffer allocated for segmentation map (in bytes). Application must assure that
@ -4129,7 +4147,7 @@ MFX_PACK_BEGIN_USUAL_STRUCT()
*/
typedef struct {
mfxU16 FrameRateScale; /*!< The ratio between the frame rates of the current temporal layer and the base layer. The library treats a particular
temporal layer as defined if it has FrameRateScale > 0. If the base layer is defined, it must have FrameRateScale = 1. FrameRateScale of each subsequent layer (if defined) must be a multiple of and greater than the
temporal layer as "defined" if it has FrameRateScale > 0. If the base layer is defined, it must have FrameRateScale = 1. FrameRateScale of each subsequent layer (if defined) must be a multiple of and greater than the
FrameRateScale value of previous layer. */
mfxU16 TargetKbps; /*!< Target bitrate for the current temporal layer. Ignored if RateControlMethod is CQP. If RateControlMethod is not CQP, the
application must provide TargetKbps for every defined temporal layer. TargetKbps of each subsequent layer (if defined)
@ -4140,17 +4158,17 @@ MFX_PACK_END()
MFX_PACK_BEGIN_USUAL_STRUCT()
/*!
API allows the encoding of VP9 bitstreams that contain several subset bitstreams that differ in frame rates, also called temporal layers.
API allows the encoding of VP9 bitstreams that contain several subset bitstreams that differ in frame rates, also called "temporal layers".
When decoding, each temporal layer can be extracted from the coded stream and decoded separately. The mfxExtVP9TemporalLayers structure
configures the temporal layers for the VP9 encoder. It can be attached to the mfxVideoParam structure during initialization or the
MFXVideoENCODE_Reset call. If the mfxExtVP9TemporalLayers buffer isnt attached during initialization, temporal scalability is disabled. If the buffer isnt attached for the Reset call, the encoder continues to use the temporal scalability configuration that was defined before the Reset call.
MFXVideoENCODE_Reset call. If the mfxExtVP9TemporalLayers buffer isn't attached during initialization, temporal scalability is disabled. If the buffer isn't attached for the Reset call, the encoder continues to use the temporal scalability configuration that was defined before the Reset call.
In the API, temporal layers are ordered by their frame rates in ascending order. Temporal layer 0 (having the lowest frame rate) is called the base layer.
Each subsequent temporal layer includes all previous layers.
The temporal scalability feature requires a minimum number of allocated reference
frames (controlled by the NumRefFrame parameter). If the NumRefFrame value set by the application isnt enough to build the reference structure for the requested
frames (controlled by the NumRefFrame parameter). If the NumRefFrame value set by the application isn't enough to build the reference structure for the requested
number of temporal layers, the library corrects the NumRefFrame value. The temporal layer structure is reset (re-started) after key-frames.
*/
typedef struct {
@ -4159,7 +4177,7 @@ typedef struct {
The array of temporal layers. Layer[0] specifies the base layer.
The library reads layers from the array when they are defined (FrameRateScale > 0).
All layers starting from first layer with FrameRateScale = 0 are ignored. The last layer that is not ignored is considered the highest layer.
All layers starting from first layer with FrameRateScale = 0 are ignored. The last layer that is not ignored is considered the "highest layer".
The frame rate of the highest layer is specified in the mfxVideoParam structure. Frame rates of lower layers are calculated using their FrameRateScale.
@ -4394,7 +4412,7 @@ typedef struct {
/*! Mask array. Every bit represents sub-device (or thread for CPU).
"1" means execution is allowed. "0" means that execution is prohibited on
this sub-device (or thread). Length of the array is equal to the:
"max_subdevices / 8" and rounded to the closest (from the right) integer.
"NumSubDevices / 8" and rounded to the closest (from the right) integer.
Bits order within each entry of the mask array is LSB: bit 0 holds data
for sub device with index 0 and bit 8 for sub device with index 8.
Index of sub device is defined by the mfxDeviceDescription structure. */
@ -4476,9 +4494,9 @@ MFX_PACK_BEGIN_USUAL_STRUCT()
*/
typedef struct {
mfxU16 FeatureEnabled; /*!< Indicates which features are enabled for the segment. See the AV1 SegmentFeature enumerator for values for
this option. Values from the enumerator can be bit-ORed. Support of a particular feature depends on underlying
this option. Values from the enumerator can be bit-OR'ed. Support of a particular feature depends on underlying
hardware platform. Application can check which features are supported by calling Query. */
mfxI16 AltQIndex; /*!< Quantization index delta for the segment. Ignored if MFX_AV1_SEGMENT_FEATURE_ALT_QINDEX isnt set in FeatureEnabled.
mfxI16 AltQIndex; /*!< Quantization index delta for the segment. Ignored if MFX_AV1_SEGMENT_FEATURE_ALT_QINDEX isn't set in FeatureEnabled.
Valid range for this parameter is [-255, 255]. If AltQIndex is out of this range, it will be ignored. If AltQIndex
is within valid range, but sum of base quantization index and AltQIndex is out of [0, 255], AltQIndex will be clamped. */
mfxU16 reserved[30];
@ -4488,12 +4506,12 @@ MFX_PACK_END()
MFX_PACK_BEGIN_STRUCT_W_PTR()
/*!
In the AV1 encoder it is possible to divide a frame into up to 8 segments and apply particular features (like delta for quantization index or for
loop filter level) on a per-segment basis. Uncompressed header of every frame indicates if segmentation is enabled for the current frame,
and (if segmentation enabled) contains full information about features applied to every segment. Every Mode info block of a coded
loop filter level) on a per-segment basis. "Uncompressed header" of every frame indicates if segmentation is enabled for the current frame,
and (if segmentation enabled) contains full information about features applied to every segment. Every "Mode info block" of a coded
frame has segment_id in the range of 0 to 7.
To enable Segmentation, the mfxExtAV1Segmentation structure with correct settings should be passed to the encoder. It can be attached to the
mfxVideoParam structure during initialization or the MFXVideoENCODE_Reset call (static configuration). If the mfxExtAV1Segmentation buffer isnt
attached during initialization, segmentation is disabled for static configuration. If the buffer isnt attached for the Reset call, the encoder
mfxVideoParam structure during initialization or the MFXVideoENCODE_Reset call (static configuration). If the mfxExtAV1Segmentation buffer isn't
attached during initialization, segmentation is disabled for static configuration. If the buffer isn't attached for the Reset call, the encoder
continues to use static configuration for segmentation which was the default before this Reset call. If the mfxExtAV1Segmentation buffer with
NumSegments=0 is provided during initialization or Reset call, segmentation becomes disabled for static configuration.
The buffer can be attached to the mfxEncodeCtrl structure during runtime (dynamic configuration). Dynamic configuration is applied to the
@ -4516,7 +4534,7 @@ typedef struct {
Entries with indexes bigger than NumSegments-1 are ignored. See the mfxAV1SegmentParam structure for
definitions of segment features and their parameters. */
mfxU16 SegmentIdBlockSize;/*!< Size of block (NxN) for segmentation map. See AV1 SegmentIdBlockSize enumerator for values for this
option. An encoded block that is bigger than AV1 SegmentIdBlockSize uses segment_id taken from its
option. An encoded block that is bigger than AV1 SegmentIdBlockSize uses segment_id taken from it's
top-left sub-block from the segmentation map. The application can check if a particular block size is
supported by calling Query. */
mfxU16 reserved2;
@ -4571,7 +4589,7 @@ typedef struct {
mfxAV1FilmGrainPoint PointCb[10]; /*!< The array of points for Cb component. */
mfxAV1FilmGrainPoint PointCr[10]; /*!< The array of points for Cr component. */
mfxU8 GrainScalingMinus8; /*!< The shift 8 applied to the values of the chroma component. The grain_scaling_minus_8 can take values of 0..3 and
mfxU8 GrainScalingMinus8; /*!< The shift - 8 applied to the values of the chroma component. The grain_scaling_minus_8 can take values of 0..3 and
determines the range and quantization step of the standard deviation of film grain.*/
mfxU8 ArCoeffLag; /*!< The number of auto-regressive coefficients for luma and chroma.*/
@ -4709,7 +4727,7 @@ MFX_PACK_BEGIN_USUAL_STRUCT()
/*! The structure is used for universal temporal layer description. */
typedef struct {
mfxU16 FrameRateScale; /*!< The ratio between the frame rates of the current temporal layer and the base layer. The library treats a particular
temporal layer as defined if it has FrameRateScale > 0. If the base layer is defined, it must have FrameRateScale = 1.
temporal layer as "defined" if it has FrameRateScale > 0. If the base layer is defined, it must have FrameRateScale = 1.
FrameRateScale of each subsequent layer (if defined) must be a multiple of and greater than the
FrameRateScale value of previous layer. */
mfxU16 reserved[3]; /*!< Reserved for future use. */

View file

@ -9,7 +9,106 @@
#include "mfxvideo.h"
class MFXVideoSession {
class MFXVideoSessionBase {
public:
virtual ~MFXVideoSessionBase() {}
virtual mfxStatus Init(mfxIMPL impl, mfxVersion* ver) = 0;
virtual mfxStatus InitEx(mfxInitParam par) = 0;
virtual mfxStatus Close(void) = 0;
virtual mfxStatus QueryIMPL(mfxIMPL* impl) = 0;
virtual mfxStatus QueryVersion(mfxVersion* version) = 0;
virtual mfxStatus JoinSession(mfxSession child_session) = 0;
virtual mfxStatus DisjoinSession() = 0;
virtual mfxStatus CloneSession(mfxSession* clone) = 0;
virtual mfxStatus SetPriority(mfxPriority priority) = 0;
virtual mfxStatus GetPriority(mfxPriority* priority) = 0;
virtual mfxStatus SetFrameAllocator(mfxFrameAllocator* allocator) = 0;
virtual mfxStatus SetHandle(mfxHandleType type, mfxHDL hdl) = 0;
virtual mfxStatus GetHandle(mfxHandleType type, mfxHDL* hdl) = 0;
virtual mfxStatus QueryPlatform(mfxPlatform* platform) = 0;
virtual mfxStatus SyncOperation(mfxSyncPoint syncp, mfxU32 wait) = 0;
virtual mfxStatus GetSurfaceForEncode(mfxFrameSurface1** output_surf) = 0;
virtual mfxStatus GetSurfaceForDecode(mfxFrameSurface1** output_surf) = 0;
virtual mfxStatus GetSurfaceForVPP(mfxFrameSurface1** output_surf) = 0;
virtual mfxStatus GetSurfaceForVPPOut(mfxFrameSurface1** output_surf) = 0;
virtual operator mfxSession(void) = 0;
};
class MFXVideoENCODEBase {
public:
virtual ~MFXVideoENCODEBase() {}
virtual mfxStatus Query(mfxVideoParam* in, mfxVideoParam* out) = 0;
virtual mfxStatus QueryIOSurf(mfxVideoParam* par, mfxFrameAllocRequest* request) = 0;
virtual mfxStatus Init(mfxVideoParam* par) = 0;
virtual mfxStatus Reset(mfxVideoParam* par) = 0;
virtual mfxStatus Close(void) = 0;
virtual mfxStatus GetVideoParam(mfxVideoParam* par) = 0;
virtual mfxStatus GetEncodeStat(mfxEncodeStat* stat) = 0;
virtual mfxStatus EncodeFrameAsync(mfxEncodeCtrl* ctrl,
mfxFrameSurface1* surface,
mfxBitstream* bs,
mfxSyncPoint* syncp) = 0;
virtual mfxStatus GetSurface(mfxFrameSurface1** output_surf) = 0;
};
class MFXVideoDECODEBase {
public:
virtual ~MFXVideoDECODEBase() {}
virtual mfxStatus Query(mfxVideoParam* in, mfxVideoParam* out) = 0;
virtual mfxStatus DecodeHeader(mfxBitstream* bs, mfxVideoParam* par) = 0;
virtual mfxStatus QueryIOSurf(mfxVideoParam* par, mfxFrameAllocRequest* request) = 0;
virtual mfxStatus Init(mfxVideoParam* par) = 0;
virtual mfxStatus Reset(mfxVideoParam* par) = 0;
virtual mfxStatus Close(void) = 0;
virtual mfxStatus GetVideoParam(mfxVideoParam* par) = 0;
virtual mfxStatus GetDecodeStat(mfxDecodeStat* stat) = 0;
virtual mfxStatus GetPayload(mfxU64* ts, mfxPayload* payload) = 0;
virtual mfxStatus SetSkipMode(mfxSkipMode mode) = 0;
virtual mfxStatus DecodeFrameAsync(mfxBitstream* bs,
mfxFrameSurface1* surface_work,
mfxFrameSurface1** surface_out,
mfxSyncPoint* syncp) = 0;
virtual mfxStatus GetSurface(mfxFrameSurface1** output_surf) = 0;
};
class MFXVideoVPPBase {
public:
virtual ~MFXVideoVPPBase() {}
virtual mfxStatus Query(mfxVideoParam* in, mfxVideoParam* out) = 0;
virtual mfxStatus QueryIOSurf(mfxVideoParam* par, mfxFrameAllocRequest request[2]) = 0;
virtual mfxStatus Init(mfxVideoParam* par) = 0;
virtual mfxStatus Reset(mfxVideoParam* par) = 0;
virtual mfxStatus Close(void) = 0;
virtual mfxStatus GetVideoParam(mfxVideoParam* par) = 0;
virtual mfxStatus GetVPPStat(mfxVPPStat* stat) = 0;
virtual mfxStatus RunFrameVPPAsync(mfxFrameSurface1* in,
mfxFrameSurface1* out,
mfxExtVppAuxData* aux,
mfxSyncPoint* syncp) = 0;
virtual mfxStatus GetSurfaceIn(mfxFrameSurface1** output_surf) = 0;
virtual mfxStatus GetSurfaceOut(mfxFrameSurface1** output_surf) = 0;
virtual mfxStatus ProcessFrameAsync(mfxFrameSurface1* in, mfxFrameSurface1** out) = 0;
};
class MFXVideoSession : public MFXVideoSessionBase {
public:
MFXVideoSession(void) {
m_session = (mfxSession)0;
@ -18,73 +117,73 @@ public:
Close();
}
virtual mfxStatus Init(mfxIMPL impl, mfxVersion *ver) {
virtual mfxStatus Init(mfxIMPL impl, mfxVersion *ver) override {
return MFXInit(impl, ver, &m_session);
}
virtual mfxStatus InitEx(mfxInitParam par) {
virtual mfxStatus InitEx(mfxInitParam par) override {
return MFXInitEx(par, &m_session);
}
virtual mfxStatus Close(void) {
virtual mfxStatus Close(void) override {
mfxStatus mfxRes;
mfxRes = MFXClose(m_session);
m_session = (mfxSession)0;
return mfxRes;
}
virtual mfxStatus QueryIMPL(mfxIMPL *impl) {
virtual mfxStatus QueryIMPL(mfxIMPL *impl) override {
return MFXQueryIMPL(m_session, impl);
}
virtual mfxStatus QueryVersion(mfxVersion *version) {
virtual mfxStatus QueryVersion(mfxVersion *version) override {
return MFXQueryVersion(m_session, version);
}
virtual mfxStatus JoinSession(mfxSession child_session) {
virtual mfxStatus JoinSession(mfxSession child_session) override {
return MFXJoinSession(m_session, child_session);
}
virtual mfxStatus DisjoinSession() {
virtual mfxStatus DisjoinSession() override {
return MFXDisjoinSession(m_session);
}
virtual mfxStatus CloneSession(mfxSession *clone) {
virtual mfxStatus CloneSession(mfxSession *clone) override {
return MFXCloneSession(m_session, clone);
}
virtual mfxStatus SetPriority(mfxPriority priority) {
virtual mfxStatus SetPriority(mfxPriority priority) override {
return MFXSetPriority(m_session, priority);
}
virtual mfxStatus GetPriority(mfxPriority *priority) {
virtual mfxStatus GetPriority(mfxPriority *priority) override {
return MFXGetPriority(m_session, priority);
}
virtual mfxStatus SetFrameAllocator(mfxFrameAllocator *allocator) {
virtual mfxStatus SetFrameAllocator(mfxFrameAllocator *allocator) override {
return MFXVideoCORE_SetFrameAllocator(m_session, allocator);
}
virtual mfxStatus SetHandle(mfxHandleType type, mfxHDL hdl) {
virtual mfxStatus SetHandle(mfxHandleType type, mfxHDL hdl) override {
return MFXVideoCORE_SetHandle(m_session, type, hdl);
}
virtual mfxStatus GetHandle(mfxHandleType type, mfxHDL *hdl) {
virtual mfxStatus GetHandle(mfxHandleType type, mfxHDL *hdl) override {
return MFXVideoCORE_GetHandle(m_session, type, hdl);
}
virtual mfxStatus QueryPlatform(mfxPlatform *platform) {
virtual mfxStatus QueryPlatform(mfxPlatform *platform) override {
return MFXVideoCORE_QueryPlatform(m_session, platform);
}
virtual mfxStatus SyncOperation(mfxSyncPoint syncp, mfxU32 wait) {
virtual mfxStatus SyncOperation(mfxSyncPoint syncp, mfxU32 wait) override {
return MFXVideoCORE_SyncOperation(m_session, syncp, wait);
}
virtual mfxStatus GetSurfaceForEncode(mfxFrameSurface1** output_surf) {
virtual mfxStatus GetSurfaceForEncode(mfxFrameSurface1** output_surf) override {
return MFXMemory_GetSurfaceForEncode(m_session, output_surf);
}
virtual mfxStatus GetSurfaceForDecode(mfxFrameSurface1** output_surf) {
virtual mfxStatus GetSurfaceForDecode(mfxFrameSurface1** output_surf) override {
return MFXMemory_GetSurfaceForDecode(m_session, output_surf);
}
virtual mfxStatus GetSurfaceForVPP (mfxFrameSurface1** output_surf) {
virtual mfxStatus GetSurfaceForVPP (mfxFrameSurface1** output_surf) override {
return MFXMemory_GetSurfaceForVPP (m_session, output_surf);
}
virtual mfxStatus GetSurfaceForVPPOut(mfxFrameSurface1** output_surf) {
virtual mfxStatus GetSurfaceForVPPOut(mfxFrameSurface1** output_surf) override {
return MFXMemory_GetSurfaceForVPPOut(m_session, output_surf);
}
virtual operator mfxSession(void) {
virtual operator mfxSession(void) override {
return m_session;
}
@ -95,7 +194,7 @@ private:
void operator=(MFXVideoSession &);
};
class MFXVideoENCODE {
class MFXVideoENCODE : public MFXVideoENCODEBase {
public:
explicit MFXVideoENCODE(mfxSession session) {
m_session = session;
@ -104,37 +203,37 @@ public:
Close();
}
virtual mfxStatus Query(mfxVideoParam *in, mfxVideoParam *out) {
virtual mfxStatus Query(mfxVideoParam *in, mfxVideoParam *out) override {
return MFXVideoENCODE_Query(m_session, in, out);
}
virtual mfxStatus QueryIOSurf(mfxVideoParam *par, mfxFrameAllocRequest *request) {
virtual mfxStatus QueryIOSurf(mfxVideoParam *par, mfxFrameAllocRequest *request) override {
return MFXVideoENCODE_QueryIOSurf(m_session, par, request);
}
virtual mfxStatus Init(mfxVideoParam *par) {
virtual mfxStatus Init(mfxVideoParam *par) override {
return MFXVideoENCODE_Init(m_session, par);
}
virtual mfxStatus Reset(mfxVideoParam *par) {
virtual mfxStatus Reset(mfxVideoParam *par) override {
return MFXVideoENCODE_Reset(m_session, par);
}
virtual mfxStatus Close(void) {
virtual mfxStatus Close(void) override {
return MFXVideoENCODE_Close(m_session);
}
virtual mfxStatus GetVideoParam(mfxVideoParam *par) {
virtual mfxStatus GetVideoParam(mfxVideoParam *par) override {
return MFXVideoENCODE_GetVideoParam(m_session, par);
}
virtual mfxStatus GetEncodeStat(mfxEncodeStat *stat) {
virtual mfxStatus GetEncodeStat(mfxEncodeStat *stat) override {
return MFXVideoENCODE_GetEncodeStat(m_session, stat);
}
virtual mfxStatus EncodeFrameAsync(mfxEncodeCtrl *ctrl,
mfxFrameSurface1 *surface,
mfxBitstream *bs,
mfxSyncPoint *syncp) {
mfxSyncPoint *syncp) override {
return MFXVideoENCODE_EncodeFrameAsync(m_session, ctrl, surface, bs, syncp);
}
virtual mfxStatus GetSurface(mfxFrameSurface1** output_surf) {
virtual mfxStatus GetSurface(mfxFrameSurface1** output_surf) override {
return MFXMemory_GetSurfaceForEncode(m_session, output_surf);
}
@ -142,7 +241,7 @@ protected:
mfxSession m_session; // (mfxSession) handle to the owning session
};
class MFXVideoDECODE {
class MFXVideoDECODE : public MFXVideoDECODEBase {
public:
explicit MFXVideoDECODE(mfxSession session) {
m_session = session;
@ -151,46 +250,46 @@ public:
Close();
}
virtual mfxStatus Query(mfxVideoParam *in, mfxVideoParam *out) {
virtual mfxStatus Query(mfxVideoParam *in, mfxVideoParam *out) override {
return MFXVideoDECODE_Query(m_session, in, out);
}
virtual mfxStatus DecodeHeader(mfxBitstream *bs, mfxVideoParam *par) {
virtual mfxStatus DecodeHeader(mfxBitstream *bs, mfxVideoParam *par) override {
return MFXVideoDECODE_DecodeHeader(m_session, bs, par);
}
virtual mfxStatus QueryIOSurf(mfxVideoParam *par, mfxFrameAllocRequest *request) {
virtual mfxStatus QueryIOSurf(mfxVideoParam *par, mfxFrameAllocRequest *request) override {
return MFXVideoDECODE_QueryIOSurf(m_session, par, request);
}
virtual mfxStatus Init(mfxVideoParam *par) {
virtual mfxStatus Init(mfxVideoParam *par) override {
return MFXVideoDECODE_Init(m_session, par);
}
virtual mfxStatus Reset(mfxVideoParam *par) {
virtual mfxStatus Reset(mfxVideoParam *par) override {
return MFXVideoDECODE_Reset(m_session, par);
}
virtual mfxStatus Close(void) {
virtual mfxStatus Close(void) override {
return MFXVideoDECODE_Close(m_session);
}
virtual mfxStatus GetVideoParam(mfxVideoParam *par) {
virtual mfxStatus GetVideoParam(mfxVideoParam *par) override {
return MFXVideoDECODE_GetVideoParam(m_session, par);
}
virtual mfxStatus GetDecodeStat(mfxDecodeStat *stat) {
virtual mfxStatus GetDecodeStat(mfxDecodeStat *stat) override {
return MFXVideoDECODE_GetDecodeStat(m_session, stat);
}
virtual mfxStatus GetPayload(mfxU64 *ts, mfxPayload *payload) {
virtual mfxStatus GetPayload(mfxU64 *ts, mfxPayload *payload) override {
return MFXVideoDECODE_GetPayload(m_session, ts, payload);
}
virtual mfxStatus SetSkipMode(mfxSkipMode mode) {
virtual mfxStatus SetSkipMode(mfxSkipMode mode) override {
return MFXVideoDECODE_SetSkipMode(m_session, mode);
}
virtual mfxStatus DecodeFrameAsync(mfxBitstream *bs,
mfxFrameSurface1 *surface_work,
mfxFrameSurface1 **surface_out,
mfxSyncPoint *syncp) {
mfxSyncPoint *syncp) override {
return MFXVideoDECODE_DecodeFrameAsync(m_session, bs, surface_work, surface_out, syncp);
}
virtual mfxStatus GetSurface(mfxFrameSurface1** output_surf) {
virtual mfxStatus GetSurface(mfxFrameSurface1** output_surf) override {
return MFXMemory_GetSurfaceForDecode(m_session, output_surf);
}
@ -198,7 +297,7 @@ protected:
mfxSession m_session; // (mfxSession) handle to the owning session
};
class MFXVideoVPP {
class MFXVideoVPP : public MFXVideoVPPBase {
public:
explicit MFXVideoVPP(mfxSession session) {
m_session = session;
@ -207,43 +306,43 @@ public:
Close();
}
virtual mfxStatus Query(mfxVideoParam *in, mfxVideoParam *out) {
virtual mfxStatus Query(mfxVideoParam *in, mfxVideoParam *out) override {
return MFXVideoVPP_Query(m_session, in, out);
}
virtual mfxStatus QueryIOSurf(mfxVideoParam *par, mfxFrameAllocRequest request[2]) {
virtual mfxStatus QueryIOSurf(mfxVideoParam *par, mfxFrameAllocRequest request[2]) override {
return MFXVideoVPP_QueryIOSurf(m_session, par, request);
}
virtual mfxStatus Init(mfxVideoParam *par) {
virtual mfxStatus Init(mfxVideoParam *par) override {
return MFXVideoVPP_Init(m_session, par);
}
virtual mfxStatus Reset(mfxVideoParam *par) {
virtual mfxStatus Reset(mfxVideoParam *par) override {
return MFXVideoVPP_Reset(m_session, par);
}
virtual mfxStatus Close(void) {
virtual mfxStatus Close(void) override {
return MFXVideoVPP_Close(m_session);
}
virtual mfxStatus GetVideoParam(mfxVideoParam *par) {
virtual mfxStatus GetVideoParam(mfxVideoParam *par) override {
return MFXVideoVPP_GetVideoParam(m_session, par);
}
virtual mfxStatus GetVPPStat(mfxVPPStat *stat) {
virtual mfxStatus GetVPPStat(mfxVPPStat *stat) override {
return MFXVideoVPP_GetVPPStat(m_session, stat);
}
virtual mfxStatus RunFrameVPPAsync(mfxFrameSurface1 *in,
mfxFrameSurface1 *out,
mfxExtVppAuxData *aux,
mfxSyncPoint *syncp) {
mfxSyncPoint *syncp) override {
return MFXVideoVPP_RunFrameVPPAsync(m_session, in, out, aux, syncp);
}
virtual mfxStatus GetSurfaceIn(mfxFrameSurface1** output_surf) {
virtual mfxStatus GetSurfaceIn(mfxFrameSurface1** output_surf) override {
return MFXMemory_GetSurfaceForVPP(m_session, output_surf);
}
virtual mfxStatus GetSurfaceOut(mfxFrameSurface1** output_surf) {
virtual mfxStatus GetSurfaceOut(mfxFrameSurface1** output_surf) override {
return MFXMemory_GetSurfaceForVPPOut(m_session, output_surf);
}
virtual mfxStatus ProcessFrameAsync(mfxFrameSurface1 *in, mfxFrameSurface1 **out) {
virtual mfxStatus ProcessFrameAsync(mfxFrameSurface1 *in, mfxFrameSurface1 **out) override {
return MFXVideoVPP_ProcessFrameAsync(m_session, in, out);
}

View file

@ -303,7 +303,7 @@ mfxStatus MFX_CDECL MFXMemory_GetSurfaceForDecode(mfxSession session, mfxFrameSu
@brief
Works in either of four modes:
@li If the @p in parameter is zero, the function returns the class configurability in the output structure. The output structure has a non-zero value in each field that the implementation can configure using Init.
@li If the @p in parameter is zero, the function returns the class configurability in the output structure. The application must set to zero the fields it wants to check for support. If the field is supported, function sets non-zero value to this field, otherwise it would be ignored. It indicates that the SDK implementation can configure the field with Init.
@li If the @p in parameter is non-zero, the function checks the validity of the fields in the input structure. Then the function returns the corrected values in
the output structure. If there is insufficient information to determine the validity or correction is impossible, the function zeroes the fields.

View file

@ -1,5 +1,5 @@
/*############################################################################
# Copyright (C) 2017-2020 Intel Corporation
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
############################################################################*/

View file

@ -1,5 +1,5 @@
/*############################################################################
# Copyright (C) 2017-2020 Intel Corporation
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
############################################################################*/
@ -120,7 +120,8 @@ public:
mfxStatus Init(mfxInitParam &par,
mfxInitializationParam &vplParam,
mfxU16 *pDeviceID,
char *dllName);
char *dllName,
bool bCloneSession = false);
mfxStatus Close();
inline void *getFunction(Function func) const {
@ -143,6 +144,23 @@ public:
return m_version;
}
inline void *getHandle() const {
return m_dlh.get();
}
inline const char *getLibPath() const {
return m_libToLoad.c_str();
}
// special operations to set session pointer and version from MFXCloneSession()
inline void setSession(const mfxSession session) {
m_session = session;
}
inline void setVersion(const mfxVersion version) {
m_version = version;
}
private:
std::shared_ptr<void> m_dlh;
mfxVersion m_version{};
@ -150,6 +168,7 @@ private:
mfxSession m_session = nullptr;
void *m_table[eFunctionsNum]{};
void *m_table2[eFunctionsNum2]{};
std::string m_libToLoad;
};
std::shared_ptr<void> make_dlopen(const char *filename, int flags) {
@ -162,7 +181,8 @@ std::shared_ptr<void> make_dlopen(const char *filename, int flags) {
mfxStatus LoaderCtx::Init(mfxInitParam &par,
mfxInitializationParam &vplParam,
mfxU16 *pDeviceID,
char *dllName) {
char *dllName,
bool bCloneSession) {
mfxStatus mfx_res = MFX_ERR_NONE;
std::vector<std::string> libs;
@ -191,8 +211,9 @@ mfxStatus LoaderCtx::Init(mfxInitParam &par,
if (dllName) {
// attempt to load only this DLL, fail if unsuccessful
std::string libToLoad(dllName);
libs.emplace_back(libToLoad);
// this may also be used later by MFXCloneSession()
m_libToLoad = dllName;
libs.emplace_back(m_libToLoad);
}
else {
mfxIMPL implType = MFX_IMPL_BASETYPE(par.Implementation);
@ -253,6 +274,12 @@ mfxStatus LoaderCtx::Init(mfxInitParam &par,
break;
}
if (bCloneSession == true) {
// success - exit loop since caller will create session with MFXCloneSession()
mfx_res = MFX_ERR_NONE;
break;
}
if (par.Version.Major >= 2) {
// for API >= 2.0 call MFXInitialize instead of MFXInitEx
mfx_res =
@ -366,6 +393,12 @@ mfxStatus MFXInitEx2(mfxVersion version,
par.NumExtParam = vplParam.NumExtParam;
par.ExtParam = (vplParam.NumExtParam ? vplParam.ExtParam : nullptr);
#ifdef ONEVPL_EXPERIMENTAL
// if GPUCopy is enabled via MFXSetConfigProperty(DeviceCopy), set corresponding
// flag in mfxInitParam for legacy RTs
par.GPUCopy = vplParam.DeviceCopy;
#endif
try {
std::unique_ptr<MFX::LoaderCtx> loader;
@ -642,16 +675,49 @@ mfxStatus MFXJoinSession(mfxSession session, mfxSession child_session) {
return (*proc)(loader->getSession(), child_loader->getSession());
}
static mfxStatus AllocateCloneLoader(MFX::LoaderCtx *parentLoader, MFX::LoaderCtx **cloneLoader) {
// initialization param structs are not used when bCloneSession == true
mfxInitParam par = {};
mfxInitializationParam vplParam = {};
mfxU16 deviceID = 0;
// initialization extBufs are not saved at this level
// the RT should save these when the parent session is created and may use
// them when creating the cloned session
par.NumExtParam = 0;
try {
std::unique_ptr<MFX::LoaderCtx> cl;
cl.reset(new MFX::LoaderCtx{});
mfxStatus mfx_res =
cl->Init(par, vplParam, &deviceID, (char *)parentLoader->getLibPath(), true);
if (MFX_ERR_NONE == mfx_res) {
*cloneLoader = cl.release();
}
else {
*cloneLoader = nullptr;
}
return mfx_res;
}
catch (...) {
return MFX_ERR_MEMORY_ALLOC;
}
}
mfxStatus MFXCloneSession(mfxSession session, mfxSession *clone) {
if (!session)
if (!session || !clone)
return MFX_ERR_INVALID_HANDLE;
MFX::LoaderCtx *loader = (MFX::LoaderCtx *)session;
mfxVersion version = loader->getVersion();
*clone = nullptr;
// initialize the clone session
// currently supported for 1.x API only
// for 2.x runtimes, need to use RT implementation (passthrough)
// for runtimes with 1.x API, call MFXInit followed by MFXJoinSession
// for runtimes with 2.x API, use RT implementation of MFXCloneSession (passthrough)
if (version.Major == 1) {
mfxStatus mfx_res = MFXInit(loader->getImpl(), &version, clone);
if (MFX_ERR_NONE != mfx_res) {
@ -666,6 +732,45 @@ mfxStatus MFXCloneSession(mfxSession session, mfxSession *clone) {
return mfx_res;
}
}
else if (version.Major == 2) {
MFX::LoaderCtx *loader = (MFX::LoaderCtx *)session;
// MFXCloneSession not included in function pointer search during init
// for bwd-compat, check for it here and fail gracefully if missing
void *libHandle = loader->getHandle();
auto proc = (decltype(MFXCloneSession) *)(dlsym(libHandle, "MFXCloneSession"));
if (!proc)
return MFX_ERR_UNSUPPORTED;
// allocate new dispatcher-level session object and copy
// state from parent session (function pointer tables, impl type, etc.)
MFX::LoaderCtx *cloneLoader;
mfxStatus mfx_res = AllocateCloneLoader(loader, &cloneLoader);
if (mfx_res != MFX_ERR_NONE)
return mfx_res;
// call RT implementation of MFXCloneSession
mfxSession cloneRT;
mfx_res = (*proc)(loader->getSession(), &cloneRT);
if (mfx_res != MFX_ERR_NONE || cloneRT == NULL) {
// RT call failed, delete cloned loader (no valid session created)
delete cloneLoader;
return MFX_ERR_UNSUPPORTED;
}
cloneLoader->setSession(cloneRT);
// get version of cloned session
mfxVersion cloneVersion = {};
mfx_res = MFXQueryVersion((mfxSession)cloneLoader, &cloneVersion);
cloneLoader->setVersion(cloneVersion);
if (mfx_res != MFX_ERR_NONE) {
MFXClose((mfxSession)cloneLoader);
return mfx_res;
}
*clone = (mfxSession)cloneLoader;
}
else {
return MFX_ERR_UNSUPPORTED;
}

View file

@ -1,5 +1,5 @@
/*############################################################################
# Copyright (C) 2017-2020 Intel Corporation
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
############################################################################*/

View file

@ -1,5 +1,5 @@
/*############################################################################
# Copyright (C) 2017-2020 Intel Corporation
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
############################################################################*/

View file

@ -104,9 +104,15 @@ mfxStatus MFXEnumImplementations(mfxLoader loader,
// load and query all libraries
if (loaderCtx->m_bNeedFullQuery) {
// if a session was already created in low-latency mode, unload all implementations
// before running full load and query
if (loaderCtx->m_bLowLatency && !loaderCtx->m_bNeedLowLatencyQuery) {
loaderCtx->UnloadAllLibraries();
}
sts = loaderCtx->FullLoadAndQuery();
if (sts)
return sts;
return MFX_ERR_NOT_FOUND;
}
// update list of valid libraries based on updated set of
@ -114,7 +120,7 @@ mfxStatus MFXEnumImplementations(mfxLoader loader,
if (loaderCtx->m_bNeedUpdateValidImpls) {
sts = loaderCtx->UpdateValidImplList();
if (sts)
return sts;
return MFX_ERR_NOT_FOUND;
}
sts = loaderCtx->QueryImpl(i, format, idesc);

View file

@ -170,7 +170,7 @@ enum PropRanges {
// must match eProp_TotalProps, is checked with static_assert in _config.cpp
// (should throw error at compile time if !=)
#define NUM_TOTAL_FILTER_PROPS 41
#define NUM_TOTAL_FILTER_PROPS 55
// typedef child structures for easier reading
typedef struct mfxDecoderDescription::decoder DecCodec;
@ -202,6 +202,7 @@ struct EncConfig {
mfxU32 CodecID;
mfxU16 MaxcodecLevel;
mfxU16 BiDirectionalPrediction;
mfxU16 ReportedStats;
mfxU32 Profile;
mfxResourceType MemHandleType;
mfxRange32U Width;
@ -240,6 +241,12 @@ struct SpecialConfig {
bool bIsSet_NumThread;
mfxU32 NumThread;
bool bIsSet_DeviceCopy;
mfxU16 DeviceCopy;
bool bIsSet_ExtBuffer;
std::vector<mfxExtBuffer *> ExtBuffers;
};
// config class implementation
@ -257,6 +264,9 @@ public:
// compare library caps vs. set of configuration filters
static mfxStatus ValidateConfig(const mfxImplDescription *libImplDesc,
const mfxImplementedFunctions *libImplFuncs,
#ifdef ONEVPL_EXPERIMENTAL
const mfxExtendedDeviceId *libImplExtDevID,
#endif
std::list<ConfigCtxVPL *> configCtxList,
LibType libType,
SpecialConfig *specialConfig);
@ -306,6 +316,12 @@ private:
static mfxStatus CheckPropString(const mfxChar *implString, const std::string filtString);
#ifdef ONEVPL_EXPERIMENTAL
static mfxStatus CheckPropsExtDevID(const mfxVariant cfgPropsAll[],
const mfxExtendedDeviceId *libImplExtDevID);
#endif
mfxVariant m_propVar[NUM_TOTAL_FILTER_PROPS];
// special containers for properties which are passed by pointer
@ -316,6 +332,40 @@ private:
std::string m_implKeywords;
std::string m_deviceIdStr;
std::string m_implFunctionName;
mfxU8 m_extDevLUID8U[8];
std::string m_extDevNameStr;
std::vector<mfxU8> m_extBuf;
__inline bool SetExtBuf(mfxExtBuffer *extBuf) {
if (!extBuf)
return false;
mfxU32 BufferSz = extBuf->BufferSz;
if (BufferSz > 0) {
m_extBuf.resize(BufferSz);
std::copy((mfxU8 *)extBuf, (mfxU8 *)extBuf + BufferSz, m_extBuf.begin());
return true;
}
return false;
}
__inline bool GetExtBuf(mfxExtBuffer **extBuf) {
if (!extBuf)
return false;
*extBuf = nullptr;
if (!m_extBuf.empty()) {
*extBuf = (mfxExtBuffer *)m_extBuf.data();
return true;
}
return false;
}
__inline void ClearExtBuf() {
m_extBuf.clear();
}
};
// MSDK compatibility loader implementation
@ -334,10 +384,24 @@ public:
static mfxStatus QueryAPIVersion(STRING_TYPE libNameFull, mfxVersion *msdkVersion);
#ifdef ONEVPL_EXPERIMENTAL
static mfxStatus QueryExtDeviceID(mfxExtendedDeviceId *extDeviceID,
mfxU32 adapterID,
mfxU16 deviceID,
mfxU64 luid);
#endif
// required by MFXCreateSession
mfxIMPL m_msdkAdapter;
mfxIMPL m_msdkAdapterD3D9;
mfxU16 m_deviceID;
mfxU64 m_luid;
#ifdef ONEVPL_EXPERIMENTAL
mfxExtendedDeviceId m_extDeviceID;
#endif
private:
// session management
mfxStatus OpenSession(mfxSession *session,
@ -350,6 +414,7 @@ private:
static mfxAccelerationMode CvtAccelType(mfxIMPL implType, mfxIMPL implMethod);
static mfxStatus GetDefaultAccelType(mfxU32 adapterID, mfxIMPL *implDefault, mfxU64 *luid);
static mfxStatus CheckD3D9Support(mfxU64 luid, STRING_TYPE libNameFull, mfxIMPL *implD3D9);
static mfxStatus GetRenderNodeDescription(mfxU32 adapterID, mfxU32 &vendorID, mfxU16 &deviceID);
// internal state variables
STRING_TYPE m_libNameFull;
@ -514,7 +579,8 @@ private:
mfxStatus SearchDirForLibs(STRING_TYPE searchDir,
std::list<LibInfo *> &libInfoList,
mfxU32 priority);
mfxU32 priority,
bool bLoadVPLOnly = false);
mfxU32 LoadAPIExports(LibInfo *libInfo, LibType libType);
mfxStatus ValidateAPIExports(VPLFunctionPtr *vplFuncTable, mfxVersion reportedVersion);
@ -525,6 +591,7 @@ private:
const std::vector<DXGI1DeviceInfo> &adapterInfo,
LibType libType);
mfxStatus LoadLibsFromSystemDir(LibType libType);
mfxStatus LoadLibsFromMultipleDirs(LibType libType);
LibInfo *AddSingleLibrary(STRING_TYPE libPath, LibType libType);
mfxStatus QuerySessionLowLatency(LibInfo *libInfo, mfxU32 adapterID, mfxVersion *ver);

View file

@ -21,7 +21,10 @@ ConfigCtxVPL::ConfigCtxVPL()
m_implLicense(),
m_implKeywords(),
m_deviceIdStr(),
m_implFunctionName() {
m_implFunctionName(),
m_extDevLUID8U(),
m_extDevNameStr(),
m_extBuf() {
// initially set Type = unset (invalid)
// if valid property string and value are passed in,
// this will be updated
@ -77,6 +80,7 @@ enum PropIdx {
ePropEnc_CodecID,
ePropEnc_MaxcodecLevel,
ePropEnc_BiDirectionalPrediction,
ePropEnc_ReportedStats,
ePropEnc_Profile,
ePropEnc_MemHandleType,
ePropEnc_Width,
@ -92,10 +96,25 @@ enum PropIdx {
ePropVPP_InFormat,
ePropVPP_OutFormat,
// settable config properties for mfxExtendedDeviceId
ePropExtDev_VendorID,
ePropExtDev_DeviceID,
ePropExtDev_PCIDomain,
ePropExtDev_PCIBus,
ePropExtDev_PCIDevice,
ePropExtDev_PCIFunction,
ePropExtDev_DeviceLUID,
ePropExtDev_LUIDDeviceNodeMask,
ePropExtDev_DRMRenderNodeNum,
ePropExtDev_DRMPrimaryNodeNum,
ePropExtDev_DeviceName,
// special properties not part of description struct
ePropSpecial_HandleType,
ePropSpecial_Handle,
ePropSpecial_NumThread,
ePropSpecial_DeviceCopy,
ePropSpecial_ExtBuffer,
ePropSpecial_DXGIAdapterIndex,
// functions which must report as implemented
@ -138,6 +157,7 @@ static const PropVariant PropIdxTab[] = {
{ "ePropEnc_CodecID", MFX_VARIANT_TYPE_U32 },
{ "ePropEnc_MaxcodecLevel", MFX_VARIANT_TYPE_U16 },
{ "ePropEnc_BiDirectionalPrediction", MFX_VARIANT_TYPE_U16 },
{ "ePropEnc_ReportedStats", MFX_VARIANT_TYPE_U16 },
{ "ePropEnc_Profile", MFX_VARIANT_TYPE_U32 },
{ "ePropEnc_MemHandleType", MFX_VARIANT_TYPE_U32 },
{ "ePropEnc_Width", MFX_VARIANT_TYPE_PTR },
@ -152,9 +172,23 @@ static const PropVariant PropIdxTab[] = {
{ "ePropVPP_InFormat", MFX_VARIANT_TYPE_U32 },
{ "ePropVPP_OutFormat", MFX_VARIANT_TYPE_U32 },
{ "ePropExtDev_VendorID", MFX_VARIANT_TYPE_U16 },
{ "ePropExtDev_DeviceID", MFX_VARIANT_TYPE_U16 },
{ "ePropExtDev_PCIDomain", MFX_VARIANT_TYPE_U32 },
{ "ePropExtDev_PCIBus", MFX_VARIANT_TYPE_U32 },
{ "ePropExtDev_PCIDevice", MFX_VARIANT_TYPE_U32 },
{ "ePropExtDev_PCIFunction", MFX_VARIANT_TYPE_U32 },
{ "ePropExtDev_DeviceLUID", MFX_VARIANT_TYPE_PTR },
{ "ePropExtDev_LUIDDeviceNodeMask", MFX_VARIANT_TYPE_U32 },
{ "ePropExtDev_DRMRenderNodeNum", MFX_VARIANT_TYPE_U32 },
{ "ePropExtDev_DRMPrimaryNodeNum", MFX_VARIANT_TYPE_U32 },
{ "ePropExtDev_DeviceName", MFX_VARIANT_TYPE_PTR },
{ "ePropSpecial_HandleType", MFX_VARIANT_TYPE_U32 },
{ "ePropSpecial_Handle", MFX_VARIANT_TYPE_PTR },
{ "ePropSpecial_NumThread", MFX_VARIANT_TYPE_U32 },
{ "ePropSpecial_DeviceCopy", MFX_VARIANT_TYPE_U16 },
{ "ePropSpecial_ExtBuffer", MFX_VARIANT_TYPE_PTR },
{ "ePropSpecial_DXGIAdapterIndex", MFX_VARIANT_TYPE_U32 },
{ "ePropFunc_FunctionName", MFX_VARIANT_TYPE_PTR },
@ -187,6 +221,11 @@ mfxStatus ConfigCtxVPL::ValidateAndSetProp(mfxI32 idx, mfxVariant value) {
return MFX_ERR_NULL_PTR;
}
// local ptr for copying from array
mfxU8 *pU8 = (mfxU8 *)(value.Data.Ptr);
mfxExtBuffer *extBuf = nullptr;
// save copy of data passed by pointer, into object of the appropriate type
switch (idx) {
case ePropDec_Width:
@ -236,6 +275,24 @@ mfxStatus ConfigCtxVPL::ValidateAndSetProp(mfxI32 idx, mfxVariant value) {
// no need to save Data.Ptr - parsed in main loop
m_implFunctionName = (char *)(value.Data.Ptr);
break;
case ePropExtDev_DeviceLUID:
for (mfxU32 j = 0; j < 8; j++)
m_extDevLUID8U[j] = pU8[j];
m_propVar[idx].Data.Ptr = &(m_extDevLUID8U[0]);
break;
case ePropExtDev_DeviceName:
m_extDevNameStr = (char *)(value.Data.Ptr);
m_propVar[idx].Data.Ptr = &(m_extDevNameStr);
break;
case ePropSpecial_ExtBuffer:
// Don't assume anything about the lifetime of input mfxExtBuffer in Data.Ptr
// Instead, we copy the full extBuf into a vector owned by ConfixCtxVPL and will pass this to MFXInitialize()
// if app calls MFXSetConfigFilterProperty('ExtBuffer') again with a different extBuf, the old copy will be overwritten
SetExtBuf((mfxExtBuffer *)(value.Data.Ptr));
if (GetExtBuf(&extBuf))
m_propVar[idx].Data.Ptr = extBuf;
break;
default:
break;
}
@ -318,6 +375,11 @@ mfxStatus ConfigCtxVPL::SetFilterPropertyEnc(std::list<std::string> &propParsedS
else if (nextProp == "BiDirectionalPrediction") {
return ValidateAndSetProp(ePropEnc_BiDirectionalPrediction, value);
}
#ifdef ONEVPL_EXPERIMENTAL
else if (nextProp == "ReportedStats") {
return ValidateAndSetProp(ePropEnc_ReportedStats, value);
}
#endif
else if (nextProp != "encprofile") {
return MFX_ERR_NOT_FOUND;
}
@ -431,6 +493,14 @@ mfxStatus ConfigCtxVPL::SetFilterProperty(const mfxU8 *name, mfxVariant value) {
else if (nextProp == "NumThread") {
return ValidateAndSetProp(ePropSpecial_NumThread, value);
}
#ifdef ONEVPL_EXPERIMENTAL
else if (nextProp == "DeviceCopy") {
return ValidateAndSetProp(ePropSpecial_DeviceCopy, value);
}
#endif
else if (nextProp == "ExtBuffer") {
return ValidateAndSetProp(ePropSpecial_ExtBuffer, value);
}
else if (nextProp == "DXGIAdapterIndex") {
#if defined(_WIN32) || defined(_WIN64)
// this property is only valid on Windows
@ -450,6 +520,47 @@ mfxStatus ConfigCtxVPL::SetFilterProperty(const mfxU8 *name, mfxVariant value) {
return MFX_ERR_NOT_FOUND;
}
#ifdef ONEVPL_EXPERIMENTAL
// extended device ID properties must begin with mfxExtendedDeviceId
if (nextProp == "mfxExtendedDeviceId") {
nextProp = GetNextProp(propParsedString);
if (nextProp == "VendorID") {
return ValidateAndSetProp(ePropExtDev_VendorID, value);
}
else if (nextProp == "DeviceID") {
return ValidateAndSetProp(ePropExtDev_DeviceID, value);
}
else if (nextProp == "PCIDomain") {
return ValidateAndSetProp(ePropExtDev_PCIDomain, value);
}
else if (nextProp == "PCIBus") {
return ValidateAndSetProp(ePropExtDev_PCIBus, value);
}
else if (nextProp == "PCIDevice") {
return ValidateAndSetProp(ePropExtDev_PCIDevice, value);
}
else if (nextProp == "PCIFunction") {
return ValidateAndSetProp(ePropExtDev_PCIFunction, value);
}
else if (nextProp == "DeviceLUID") {
return ValidateAndSetProp(ePropExtDev_DeviceLUID, value);
}
else if (nextProp == "LUIDDeviceNodeMask") {
return ValidateAndSetProp(ePropExtDev_LUIDDeviceNodeMask, value);
}
else if (nextProp == "DRMRenderNodeNum") {
return ValidateAndSetProp(ePropExtDev_DRMRenderNodeNum, value);
}
else if (nextProp == "DRMPrimaryNodeNum") {
return ValidateAndSetProp(ePropExtDev_DRMPrimaryNodeNum, value);
}
else if (nextProp == "DeviceName") {
return ValidateAndSetProp(ePropExtDev_DeviceName, value);
}
return MFX_ERR_NOT_FOUND;
}
#endif
// standard properties must begin with "mfxImplDescription"
if (nextProp != "mfxImplDescription") {
return MFX_ERR_NOT_FOUND;
@ -595,6 +706,17 @@ mfxStatus ConfigCtxVPL::GetFlatDescriptionsEnc(const mfxImplDescription *libImpl
EncProfile *encProfile = nullptr;
EncMemDesc *encMemDesc = nullptr;
#ifdef ONEVPL_EXPERIMENTAL
// ReportedStats was added with API 2.7 under ONEVPL_EXPERIMENTAL.
// When it is promoted to production API, MFX_ENCODERDESCRIPTION_VERSION should be bumped up
// and we should check mfxEncoderDescription.Version instead to know whether ReportedStats
// is a valid field (taken from reserved[] space).
// Until then, best we can do is to check the overall API version for this impl.
mfxVersion reqApiVersionReportedStats = {};
reqApiVersionReportedStats.Major = 2;
reqApiVersionReportedStats.Minor = 7;
#endif
while (codecIdx < libImplDesc->Enc.NumCodecs) {
EncConfig ec = {};
@ -602,6 +724,14 @@ mfxStatus ConfigCtxVPL::GetFlatDescriptionsEnc(const mfxImplDescription *libImpl
ec.CodecID = encCodec->CodecID;
ec.MaxcodecLevel = encCodec->MaxcodecLevel;
ec.BiDirectionalPrediction = encCodec->BiDirectionalPrediction;
#ifdef ONEVPL_EXPERIMENTAL
// see comment above about checking mfxEncoderDescription version once this is moved out
// of experimental API
if (libImplDesc->ApiVersion.Version >= reqApiVersionReportedStats.Version)
ec.ReportedStats = encCodec->ReportedStats;
#endif
CHECK_IDX(codecIdx, profileIdx, encCodec->NumProfiles);
encProfile = &(encCodec->Profiles[profileIdx]);
@ -872,6 +1002,14 @@ mfxStatus ConfigCtxVPL::CheckPropsEnc(const mfxVariant cfgPropsAll[],
isCompatible = false;
}
if (cfgPropsAll[ePropEnc_ReportedStats].Type != MFX_VARIANT_TYPE_UNSET) {
mfxU16 requestedStats = cfgPropsAll[ePropEnc_ReportedStats].Data.U16;
// ReportedStats is a logical OR of one or more flags: MFX_ENCODESTATS_LEVEL_xxx
if ((requestedStats & ec.ReportedStats) != requestedStats)
isCompatible = false;
}
if (isCompatible == true)
return MFX_ERR_NONE;
@ -926,6 +1064,81 @@ mfxStatus ConfigCtxVPL::CheckPropsVPP(const mfxVariant cfgPropsAll[],
return MFX_ERR_UNSUPPORTED;
}
#ifdef ONEVPL_EXPERIMENTAL
mfxStatus ConfigCtxVPL::CheckPropsExtDevID(const mfxVariant cfgPropsAll[],
const mfxExtendedDeviceId *libImplExtDevID) {
bool isCompatible = true;
// check if this implementation includes
// all of the required extended device ID properties
CHECK_PROP(ePropExtDev_VendorID, U16, libImplExtDevID->VendorID);
CHECK_PROP(ePropExtDev_DeviceID, U16, libImplExtDevID->DeviceID);
CHECK_PROP(ePropExtDev_PCIDomain, U32, libImplExtDevID->PCIDomain);
CHECK_PROP(ePropExtDev_PCIBus, U32, libImplExtDevID->PCIBus);
CHECK_PROP(ePropExtDev_PCIDevice, U32, libImplExtDevID->PCIDevice);
CHECK_PROP(ePropExtDev_PCIFunction, U32, libImplExtDevID->PCIFunction);
// check DeviceLUID, require LUIDValid == true
if (cfgPropsAll[ePropExtDev_DeviceLUID].Type != MFX_VARIANT_TYPE_UNSET) {
// LUID filter is passed as ptr to 8-byte array, which was saved in local copy
mfxU8 *pU8 = (mfxU8 *)(cfgPropsAll[ePropExtDev_DeviceLUID].Data.Ptr);
if (libImplExtDevID->LUIDValid) {
for (mfxU32 j = 0; j < 8; j++) {
if (pU8[j] != libImplExtDevID->DeviceLUID[j])
isCompatible = false;
}
}
else {
isCompatible = false;
}
}
// check LUIDDeviceNodeMask, require LUIDValid == true
if (cfgPropsAll[ePropExtDev_LUIDDeviceNodeMask].Type != MFX_VARIANT_TYPE_UNSET) {
if (libImplExtDevID->LUIDValid) {
CHECK_PROP(ePropExtDev_LUIDDeviceNodeMask, U32, libImplExtDevID->LUIDDeviceNodeMask);
}
else {
isCompatible = false;
}
}
// check DRMRenderNodeNum
if (cfgPropsAll[ePropExtDev_DRMRenderNodeNum].Type != MFX_VARIANT_TYPE_UNSET) {
if (libImplExtDevID->DRMRenderNodeNum != 0) {
CHECK_PROP(ePropExtDev_DRMRenderNodeNum, U32, libImplExtDevID->DRMRenderNodeNum);
}
else {
isCompatible = false;
}
}
// check DRMPrimaryNodeNum
if (cfgPropsAll[ePropExtDev_DRMPrimaryNodeNum].Type != MFX_VARIANT_TYPE_UNSET) {
if (libImplExtDevID->DRMRenderNodeNum != 0x7FFFFFFF) {
CHECK_PROP(ePropExtDev_DRMPrimaryNodeNum, U32, libImplExtDevID->DRMPrimaryNodeNum);
}
else {
isCompatible = false;
}
}
// check string: DeviceName (string match)
if (cfgPropsAll[ePropExtDev_DeviceName].Type != MFX_VARIANT_TYPE_UNSET) {
std::string filtName = *(std::string *)(cfgPropsAll[ePropExtDev_DeviceName].Data.Ptr);
std::string implName = libImplExtDevID->DeviceName;
if (filtName != implName)
isCompatible = false;
}
if (isCompatible == true)
return MFX_ERR_NONE;
return MFX_ERR_UNSUPPORTED;
}
#endif
// implString = string from implDesc - one or more comma-separated tokens
// filtString = string user is looking for - one or more comma-separated tokens
// we parse filtString into tokens, then check if all of them are present in implString
@ -952,13 +1165,17 @@ mfxStatus ConfigCtxVPL::CheckPropString(const mfxChar *implString, const std::st
mfxStatus ConfigCtxVPL::ValidateConfig(const mfxImplDescription *libImplDesc,
const mfxImplementedFunctions *libImplFuncs,
#ifdef ONEVPL_EXPERIMENTAL
const mfxExtendedDeviceId *libImplExtDevID,
#endif
std::list<ConfigCtxVPL *> configCtxList,
LibType libType,
SpecialConfig *specialConfig) {
mfxU32 idx;
bool decRequested = false;
bool encRequested = false;
bool vppRequested = false;
bool decRequested = false;
bool encRequested = false;
bool vppRequested = false;
bool extDevRequested = false;
bool bImplValid = true;
@ -984,6 +1201,10 @@ mfxStatus ConfigCtxVPL::ValidateConfig(const mfxImplDescription *libImplDesc,
bool bVerSetMajor = false;
bool bVerSetMinor = false;
// clear list of extension buffers
specialConfig->bIsSet_ExtBuffer = false;
specialConfig->ExtBuffers.clear();
// iterate through all filters and populate cfgPropsAll
auto it = configCtxList.begin();
@ -1017,6 +1238,8 @@ mfxStatus ConfigCtxVPL::ValidateConfig(const mfxImplDescription *libImplDesc,
encRequested = true;
else if (idx >= ePropVPP_FilterFourCC && idx <= ePropVPP_OutFormat)
vppRequested = true;
else if (idx >= ePropExtDev_VendorID && idx <= ePropExtDev_DeviceName)
extDevRequested = true;
}
// if already marked invalid, no need to check props again
@ -1026,6 +1249,17 @@ mfxStatus ConfigCtxVPL::ValidateConfig(const mfxImplDescription *libImplDesc,
if (CheckPropsGeneral(cfgPropsAll, libImplDesc))
bImplValid = false;
#ifdef ONEVPL_EXPERIMENTAL
if (extDevRequested) {
// fail if extDevID is not available (null) or if prop is not supported
if (!libImplExtDevID || CheckPropsExtDevID(cfgPropsAll, libImplExtDevID))
bImplValid = false;
}
#else
if (extDevRequested)
bImplValid = false;
#endif
// MSDK RT compatibility mode (1.x) does not provide Dec/Enc/VPP caps
// ignore these filters if set (do not use them to _exclude_ the library)
if (libType != LibTypeMSDK) {
@ -1058,6 +1292,11 @@ mfxStatus ConfigCtxVPL::ValidateConfig(const mfxImplDescription *libImplDesc,
specialConfig->bIsSet_NumThread = true;
}
if (cfgPropsAll[ePropSpecial_DeviceCopy].Type != MFX_VARIANT_TYPE_UNSET) {
specialConfig->DeviceCopy = cfgPropsAll[ePropSpecial_DeviceCopy].Data.U16;
specialConfig->bIsSet_DeviceCopy = true;
}
if (cfgPropsAll[ePropSpecial_DXGIAdapterIndex].Type != MFX_VARIANT_TYPE_UNSET) {
specialConfig->dxgiAdapterIdx =
(mfxU32)cfgPropsAll[ePropSpecial_DXGIAdapterIndex].Data.U32;
@ -1070,6 +1309,12 @@ mfxStatus ConfigCtxVPL::ValidateConfig(const mfxImplDescription *libImplDesc,
specialConfig->bIsSet_accelerationMode = true;
}
if (cfgPropsAll[ePropSpecial_ExtBuffer].Type != MFX_VARIANT_TYPE_UNSET) {
specialConfig->ExtBuffers.push_back(
(mfxExtBuffer *)cfgPropsAll[ePropSpecial_ExtBuffer].Data.Ptr);
specialConfig->bIsSet_ExtBuffer = true;
}
// special handling for API version which may be passed either as single U32 (Version)
// or two U16 (Major, Minor) which could come in separate cfg objects
if (cfgPropsAll[ePropMain_ApiVersion].Type != MFX_VARIANT_TYPE_UNSET) {
@ -1142,6 +1387,11 @@ bool ConfigCtxVPL::CheckLowLatencyConfig(std::list<ConfigCtxVPL *> configCtxList
// for purposes of low-latency enabling, we check the last (most recent) value of each filter
// property, in the case that multiple mfxConfig objects were created
// preferred usage is just to create one mfxConfig and set all of the required props in it
// Exception: there can be more than one ExtBuffer attached via multiple mfxConfig objects (API >= 2.7)
// clear list of extension buffers
specialConfig->bIsSet_ExtBuffer = false;
specialConfig->ExtBuffers.clear();
auto it = configCtxList.begin();
while (it != configCtxList.end()) {
@ -1155,6 +1405,12 @@ bool ConfigCtxVPL::CheckLowLatencyConfig(std::list<ConfigCtxVPL *> configCtxList
cfgPropsAll[idx].Type = config->m_propVar[idx].Type;
cfgPropsAll[idx].Data = config->m_propVar[idx].Data;
if (idx == ePropSpecial_ExtBuffer) {
specialConfig->ExtBuffers.push_back(
(mfxExtBuffer *)cfgPropsAll[ePropSpecial_ExtBuffer].Data.Ptr);
specialConfig->bIsSet_ExtBuffer = true;
}
}
}
@ -1228,6 +1484,17 @@ bool ConfigCtxVPL::CheckLowLatencyConfig(std::list<ConfigCtxVPL *> configCtxList
}
break;
case ePropSpecial_DeviceCopy:
if (cfgPropsAll[ePropSpecial_DeviceCopy].Type != MFX_VARIANT_TYPE_UNSET) {
specialConfig->DeviceCopy = cfgPropsAll[ePropSpecial_DeviceCopy].Data.U16;
specialConfig->bIsSet_DeviceCopy = true;
}
break;
case ePropSpecial_ExtBuffer:
// extBufs were already pushed into the overall list, above
break;
// will be passed to RT in MFXInitialize(), if unset will be 0
case ePropSpecial_DXGIAdapterIndex:
if (cfgPropsAll[idx].Type == MFX_VARIANT_TYPE_U32) {

View file

@ -61,6 +61,9 @@ LoaderCtxVPL::LoaderCtxVPL()
m_specialConfig.bIsSet_accelerationMode = false;
m_specialConfig.bIsSet_ApiVersion = false;
m_specialConfig.bIsSet_dxgiAdapterIdx = false;
m_specialConfig.bIsSet_NumThread = false;
m_specialConfig.bIsSet_DeviceCopy = false;
m_specialConfig.bIsSet_ExtBuffer = false;
// initial state
m_bLowLatency = false;
@ -96,7 +99,7 @@ mfxStatus LoaderCtxVPL::FullLoadAndQuery() {
// may be more than one implementation per library
sts = QueryLibraryCaps();
if (MFX_ERR_NONE != sts)
return sts;
return MFX_ERR_NOT_FOUND;
m_bNeedFullQuery = false;
m_bNeedUpdateValidImpls = true;
@ -139,11 +142,12 @@ mfxU32 LoaderCtxVPL::ParseEnvSearchPaths(const CHAR_TYPE *envVarName,
return (mfxU32)searchDirs.size();
}
#define NUM_LIB_PREFIXES 2
#define NUM_LIB_PREFIXES 3
mfxStatus LoaderCtxVPL::SearchDirForLibs(STRING_TYPE searchDir,
std::list<LibInfo *> &libInfoList,
mfxU32 priority) {
mfxU32 priority,
bool bLoadVPLOnly) {
// okay to call with empty searchDir
if (searchDir.empty())
return MFX_ERR_NONE;
@ -152,15 +156,30 @@ mfxStatus LoaderCtxVPL::SearchDirForLibs(STRING_TYPE searchDir,
HANDLE hTestFile = nullptr;
WIN32_FIND_DATAW testFileData;
DWORD err;
STRING_TYPE testFileName[NUM_LIB_PREFIXES] = { searchDir + MAKE_STRING("/libvpl*.dll"),
searchDir + MAKE_STRING("/libmfx*.dll") };
STRING_TYPE testFileName[NUM_LIB_PREFIXES] = {
searchDir + MAKE_STRING("/libvpl*.dll"),
#if defined _M_IX86
// 32-bit GPU RT names
searchDir + MAKE_STRING("/libmfx32-gen.dll"),
searchDir + MAKE_STRING("/libmfxhw32.dll")
#else
// 64-bit GPU RT names
searchDir + MAKE_STRING("/libmfx64-gen.dll"),
searchDir + MAKE_STRING("/libmfxhw64.dll")
#endif
};
CHAR_TYPE currDir[MAX_VPL_SEARCH_PATH] = L"";
if (GetCurrentDirectoryW(MAX_VPL_SEARCH_PATH, currDir))
SetCurrentDirectoryW(searchDir.c_str());
// skip search for MSDK runtime (last entry) if bLoadVPLOnly is set
mfxU32 numLibPrefixes = NUM_LIB_PREFIXES;
if (bLoadVPLOnly)
numLibPrefixes--;
// iterate over all candidate files in directory
for (mfxU32 i = 0; i < NUM_LIB_PREFIXES; i++) {
for (mfxU32 i = 0; i < numLibPrefixes; i++) {
hTestFile = FindFirstFileW(testFileName[i].c_str(), &testFileData);
if (hTestFile != INVALID_HANDLE_VALUE) {
do {
@ -223,7 +242,8 @@ mfxStatus LoaderCtxVPL::SearchDirForLibs(STRING_TYPE searchDir,
if (strstr(currFile->d_name, ".so")) {
// library names must begin with "libvpl*" or "libmfx*"
if ((strstr(currFile->d_name, "libvpl") != currFile->d_name) &&
(strstr(currFile->d_name, "libmfx") != currFile->d_name))
(strcmp(currFile->d_name, "libmfx-gen.so.1.2") != 0) &&
(strcmp(currFile->d_name, "libmfxhw64.so.1") != 0))
continue;
// special case: do not include dispatcher itself (libmfx.so*, libvpl.so*) or tracer library
@ -448,7 +468,7 @@ mfxStatus LoaderCtxVPL::BuildListOfCandidateLibs() {
it = searchDirList.begin();
while (it != searchDirList.end()) {
STRING_TYPE nextDir = (*it);
sts = SearchDirForLibs(nextDir, m_libInfoList, LIB_PRIORITY_01);
sts = SearchDirForLibs(nextDir, m_libInfoList, LIB_PRIORITY_01, true);
it++;
}
@ -745,6 +765,10 @@ mfxStatus LoaderCtxVPL::UnloadAllLibraries() {
it++;
}
m_implInfoList.clear();
m_libInfoList.clear();
m_implIdxNext = 0;
return MFX_ERR_NONE;
}
@ -1037,6 +1061,9 @@ mfxStatus LoaderCtxVPL::QueryLibraryCaps() {
for (mfxU32 i = 0; i < maxImplMSDK; i++) {
mfxImplDescription *implDesc = nullptr;
mfxImplementedFunctions *implFuncs = nullptr;
#ifdef ONEVPL_EXPERIMENTAL
mfxExtendedDeviceId *implExtDeviceID = nullptr;
#endif
LoaderCtxMSDK *msdkCtx = &(libInfo->msdkCtx[i]);
if (m_bLowLatency == false) {
@ -1057,6 +1084,16 @@ mfxStatus LoaderCtxVPL::QueryLibraryCaps() {
// this adapter (i) is not supported
continue;
}
#ifdef ONEVPL_EXPERIMENTAL
sts = LoaderCtxMSDK::QueryExtDeviceID(&(msdkCtx->m_extDeviceID),
i,
msdkCtx->m_deviceID,
msdkCtx->m_luid);
if (sts == MFX_ERR_NONE)
implExtDeviceID = &(msdkCtx->m_extDeviceID);
#endif
}
else {
// unknown API - unable to create session on any adapter
@ -1079,6 +1116,10 @@ mfxStatus LoaderCtxVPL::QueryLibraryCaps() {
// implemented function description, if available
implInfo->implFuncs = implFuncs;
#ifdef ONEVPL_EXPERIMENTAL
// extended device ID description, if available
implInfo->implExtDeviceID = implExtDeviceID;
#endif
// fill out mfxInitializationParam for use in CreateSession (MFXInitialize path)
memset(&(implInfo->vplParam), 0, sizeof(mfxInitializationParam));
@ -1121,11 +1162,6 @@ mfxStatus LoaderCtxVPL::QueryLibraryCaps() {
// update number of valid MSDK adapters
numImplMSDK++;
#ifdef __linux__
// currently only one adapter on Linux (avoid multiple copies)
break;
#endif
}
if (numImplMSDK == 0) {
@ -1139,6 +1175,9 @@ mfxStatus LoaderCtxVPL::QueryLibraryCaps() {
}
if (m_bLowLatency == false && !m_implInfoList.empty()) {
bool bD3D9Requested = (m_specialConfig.bIsSet_accelerationMode &&
m_specialConfig.accelerationMode == MFX_ACCEL_MODE_VIA_D3D9);
std::list<ImplInfo *>::iterator it2 = m_implInfoList.begin();
while (it2 != m_implInfoList.end()) {
ImplInfo *implInfo = (*it2);
@ -1150,21 +1189,38 @@ mfxStatus LoaderCtxVPL::QueryLibraryCaps() {
implInfo->adapterIdx = adapterIdx;
}
// per spec: if both VPL (HW) and MSDK are installed on the same system, only load
// the VPL library (mark MSDK as invalid)
// per spec: if both VPL (HW) and MSDK are installed for the same accelerator, only load
// the VPL implementation (mark MSDK as invalid)
// exception: if application requests D3D9, load MSDK if available
if (implInfo->libInfo->libType == LibTypeMSDK) {
mfxImplDescription *msdkImplDesc = (mfxImplDescription *)(implInfo->implDesc);
std::string msdkDeviceID = (msdkImplDesc ? msdkImplDesc->Dev.DeviceID : "");
// check if VPL impl also exists for this deviceID
auto vplIdx = std::find_if(
m_implInfoList.begin(),
m_implInfoList.end(),
[](const ImplInfo *t) {
[&](const ImplInfo *t) {
mfxImplDescription *implDesc = (mfxImplDescription *)(t->implDesc);
bool bMatchingDeviceID = false;
if (implDesc) {
std::string vplDeviceID = implDesc->Dev.DeviceID;
if (vplDeviceID == msdkDeviceID)
bMatchingDeviceID = true;
}
return (t->libInfo->libType == LibTypeVPL && implDesc != nullptr &&
implDesc->Impl == MFX_IMPL_TYPE_HARDWARE);
implDesc->Impl == MFX_IMPL_TYPE_HARDWARE && bMatchingDeviceID);
});
if (vplIdx != m_implInfoList.end())
if (vplIdx != m_implInfoList.end() && bD3D9Requested == false)
implInfo->validImplIdx = -1;
// avoid loading VPL RT via compatibility entrypoint
if (msdkImplDesc && msdkImplDesc->ApiVersion.Major == 1 &&
msdkImplDesc->ApiVersion.Minor == 255)
implInfo->validImplIdx = -1;
}
@ -1335,10 +1391,7 @@ mfxStatus LoaderCtxVPL::ReleaseImpl(mfxHDL idesc) {
mfxStatus LoaderCtxVPL::UpdateLowLatency() {
m_bLowLatency = false;
#if defined(_WIN32) || defined(_WIN64)
// only supported on Windows currently
m_bLowLatency = ConfigCtxVPL::CheckLowLatencyConfig(m_configCtxList, &m_specialConfig);
#endif
return MFX_ERR_NONE;
}
@ -1365,6 +1418,9 @@ mfxStatus LoaderCtxVPL::UpdateValidImplList(void) {
// compare caps from this library vs. config filters
sts = ConfigCtxVPL::ValidateConfig((mfxImplDescription *)implInfo->implDesc,
(mfxImplementedFunctions *)implInfo->implFuncs,
#ifdef ONEVPL_EXPERIMENTAL
(mfxExtendedDeviceId *)implInfo->implExtDeviceID,
#endif
m_configCtxList,
implInfo->libInfo->libType,
&m_specialConfig);
@ -1512,6 +1568,11 @@ mfxStatus LoaderCtxVPL::CreateSession(mfxU32 idx, mfxSession *session) {
if (m_specialConfig.bIsSet_accelerationMode)
implInfo->vplParam.AccelerationMode = m_specialConfig.accelerationMode;
#ifdef ONEVPL_EXPERIMENTAL
if (m_specialConfig.bIsSet_DeviceCopy)
implInfo->vplParam.DeviceCopy = m_specialConfig.DeviceCopy;
#endif
// in low latency mode there was no implementation filtering, so check here
// for minimum API version
if (m_bLowLatency && m_specialConfig.bIsSet_ApiVersion) {
@ -1552,6 +1613,13 @@ mfxStatus LoaderCtxVPL::CreateSession(mfxU32 idx, mfxSession *session) {
extBufs.push_back((mfxExtBuffer *)&extThreadsParam);
}
// add extBufs provided via mfxConfig filter property "ExtBuffer"
if (m_specialConfig.bIsSet_ExtBuffer) {
for (auto extBuf : m_specialConfig.ExtBuffers) {
extBufs.push_back((mfxExtBuffer *)extBuf);
}
}
// attach vector of extBufs to mfxInitializationParam
implInfo->vplParam.NumExtParam = static_cast<mfxU16>(extBufs.size());
implInfo->vplParam.ExtParam =

View file

@ -29,8 +29,10 @@
// MSDK - load from Driver Store, look only for libmfxhw64.dll (32)
// MSDK - fallback, load from %windir%\system32 or %windir%\syswow64
// remove this #ifdef if Linux path is implemented (avoid unused variable warnings)
#if defined(_WIN32) || defined(_WIN64)
// For Linux:
// VPL - load from system paths in LoadLibsFromMultipleDirs(), look only for libmfx-gen.so.1.2
// MSDK - load from system paths in LoadLibsFromMultipleDirs(), look only for libmfxhw64.so.1
// library names
static const CHAR_TYPE *libNameVPL = LIB_ONEVPL;
static const CHAR_TYPE *libNameMSDK = LIB_MSDK;
@ -38,7 +40,6 @@ static const CHAR_TYPE *libNameMSDK = LIB_MSDK;
// required exports
static const char *reqFuncVPL = "MFXInitialize";
static const char *reqFuncMSDK = "MFXInitEx";
#endif
LibInfo *LoaderCtxVPL::AddSingleLibrary(STRING_TYPE libPath, LibType libType) {
LibInfo *libInfo = nullptr;
@ -58,8 +59,19 @@ LibInfo *LoaderCtxVPL::AddSingleLibrary(STRING_TYPE libPath, LibType libType) {
if (!pProc)
return nullptr;
#else
// Linux - not supported
return nullptr;
// try to open library
void *hLib = dlopen(libPath.c_str(), RTLD_LOCAL | RTLD_NOW);
if (!hLib)
return nullptr;
// check for required entrypoint function
const char *reqFunc = (libType == LibTypeVPL ? reqFuncVPL : reqFuncMSDK);
VPLFunctionPtr pProc = (VPLFunctionPtr)dlsym(hLib, reqFunc);
dlclose(hLib);
// entrypoint function missing - invalid library
if (!pProc)
return nullptr;
#endif
// create new LibInfo and add to list
@ -184,6 +196,59 @@ mfxStatus LoaderCtxVPL::LoadLibsFromSystemDir(LibType libType) {
#endif
}
mfxStatus LoaderCtxVPL::LoadLibsFromMultipleDirs(LibType libType) {
#ifdef __linux__
// clang-format off
// standard paths for RT installation on Linux
std::vector<std::string> llSearchDir = {
"/usr/lib/x86_64-linux-gnu",
"/lib",
"/usr/lib",
"/lib64",
"/usr/lib64",
};
// clang-format on
const CHAR_TYPE *libName = nullptr;
if (libType == LibTypeVPL) {
libName = libNameVPL;
}
else if (libType == LibTypeMSDK) {
libName = libNameMSDK;
// additional search directories for MSDK
llSearchDir.push_back("/opt/intel/mediasdk/lib");
llSearchDir.push_back("/opt/intel/mediasdk/lib64");
}
else {
return MFX_ERR_UNSUPPORTED;
}
for (const auto &searchDir : llSearchDir) {
STRING_TYPE libPath;
libPath = searchDir;
libPath += "/";
libPath += libName;
// try to open library
LibInfo *libInfo = AddSingleLibrary(libPath, libType);
// if successful, add to list and return (stop at first success)
if (libInfo) {
m_libInfoList.push_back(libInfo);
return MFX_ERR_NONE;
}
}
return MFX_ERR_UNSUPPORTED;
#else
return MFX_ERR_UNSUPPORTED;
#endif
}
mfxStatus LoaderCtxVPL::LoadLibsLowLatency() {
DISP_LOG_FUNCTION(&m_dispLog);
@ -280,7 +345,53 @@ mfxStatus LoaderCtxVPL::LoadLibsLowLatency() {
return MFX_ERR_UNSUPPORTED;
#else
// Linux - not supported
mfxStatus sts = MFX_ERR_NONE;
// try loading VPL from Linux system directories
sts = LoadLibsFromMultipleDirs(LibTypeVPL);
if (sts == MFX_ERR_NONE) {
LibInfo *libInfo = m_libInfoList.back();
sts = LoadSingleLibrary(libInfo);
if (sts == MFX_ERR_NONE) {
LoadAPIExports(libInfo, LibTypeVPL);
m_bNeedLowLatencyQuery = false;
return MFX_ERR_NONE;
}
UnloadSingleLibrary(libInfo); // failed - unload and move to next location
}
// try loading MSDK from Linux system directories
sts = LoadLibsFromMultipleDirs(LibTypeMSDK);
if (sts == MFX_ERR_NONE) {
LibInfo *libInfo = m_libInfoList.back();
sts = LoadSingleLibrary(libInfo);
if (sts == MFX_ERR_NONE) {
mfxU32 numFunctions = LoadAPIExports(libInfo, LibTypeMSDK);
if (numFunctions == NumMSDKFunctions) {
mfxVariant var = {};
var.Type = MFX_VARIANT_TYPE_PTR;
var.Data.Ptr = (mfxHDL) "mfxhw64";
auto it = m_configCtxList.begin();
while (it != m_configCtxList.end()) {
ConfigCtxVPL *config = (*it);
sts = config->SetFilterProperty((const mfxU8 *)"mfxImplDescription.ImplName",
var);
if (sts != MFX_ERR_NONE)
return MFX_ERR_UNSUPPORTED;
it++;
}
m_bNeedLowLatencyQuery = false;
return MFX_ERR_NONE;
}
}
UnloadSingleLibrary(libInfo); // failed - unload and move to next location
}
return MFX_ERR_UNSUPPORTED;
#endif
}

View file

@ -102,10 +102,16 @@ static const mfxImplementedFunctions msdkImplFuncs = {
LoaderCtxMSDK::LoaderCtxMSDK()
: m_msdkAdapter(),
m_msdkAdapterD3D9(),
m_deviceID(0),
m_luid(0),
#ifdef ONEVPL_EXPERIMENTAL
m_extDeviceID(),
#endif
m_libNameFull(),
m_id(),
m_accelMode(),
m_loaderDeviceID(0) {}
m_loaderDeviceID(0) {
}
LoaderCtxMSDK::~LoaderCtxMSDK() {}
@ -241,6 +247,7 @@ mfxStatus LoaderCtxMSDK::QueryMSDKCaps(STRING_TYPE libNameFull,
mfxSession session = nullptr;
m_libNameFull = libNameFull;
m_deviceID = 0;
#ifdef __linux__
// require pthreads to be linked in for MSDK RT to load
@ -248,14 +255,22 @@ mfxStatus LoaderCtxMSDK::QueryMSDKCaps(STRING_TYPE libNameFull,
if (pthread_key_create(&pkey, NULL) == 0) {
pthread_key_delete(pkey);
}
mfxU32 vendorID = 0;
mfxU16 deviceID = 0;
sts = GetRenderNodeDescription(adapterID, vendorID, deviceID);
if (sts != MFX_ERR_NONE)
return MFX_ERR_UNSUPPORTED;
// on Linux read deviceID from the render node path
m_deviceID = deviceID;
#endif
// try HW session, default acceleration mode
mfxIMPL hwImpl = msdkImplTab[adapterID];
mfxIMPL implDefault = MFX_IMPL_UNSUPPORTED;
mfxU64 luid = 0;
sts = GetDefaultAccelType(adapterID, &implDefault, &luid);
sts = GetDefaultAccelType(adapterID, &implDefault, &m_luid);
if (sts != MFX_ERR_NONE)
return MFX_ERR_UNSUPPORTED;
@ -335,28 +350,30 @@ mfxStatus LoaderCtxMSDK::QueryMSDKCaps(STRING_TYPE libNameFull,
Dev->MediaAdapterType = MFX_MEDIA_UNKNOWN;
// query for underlying deviceID (requires API >= 1.19)
mfxU16 deviceID = 0x0000;
if (IsVersionSupported(MAKE_MFX_VERSION(1, 19), m_id.ApiVersion)) {
mfxPlatform platform = {};
// for Linux, we may already have the deviceID from parsing render node path earlier
if (m_deviceID == 0) {
if (IsVersionSupported(MAKE_MFX_VERSION(1, 19), m_id.ApiVersion)) {
mfxPlatform platform = {};
sts = MFXVideoCORE_QueryPlatform(session, &platform);
if (sts == MFX_ERR_NONE)
deviceID = platform.DeviceId;
sts = MFXVideoCORE_QueryPlatform(session, &platform);
if (sts == MFX_ERR_NONE)
m_deviceID = platform.DeviceId;
// mfxPlatform::MediaAdapterType was added in API 1.31
if (IsVersionSupported(MAKE_MFX_VERSION(1, 31), m_id.ApiVersion)) {
Dev->MediaAdapterType = platform.MediaAdapterType;
// mfxPlatform::MediaAdapterType was added in API 1.31
if (IsVersionSupported(MAKE_MFX_VERSION(1, 31), m_id.ApiVersion)) {
Dev->MediaAdapterType = platform.MediaAdapterType;
}
}
}
// if QueryPlatform did not return deviceID, we may have received
// it from the loader (MFXInitEx2)
if (deviceID == 0)
deviceID = m_loaderDeviceID;
if (m_deviceID == 0)
m_deviceID = m_loaderDeviceID;
// store DeviceID as "DevID" (hex) / "AdapterIdx" (dec) to match GPU RT
Dev->Version.Version = MFX_DEVICEDESCRIPTION_VERSION;
snprintf(Dev->DeviceID, sizeof(Dev->DeviceID), "%x/%d", deviceID, m_id.VendorImplID);
snprintf(Dev->DeviceID, sizeof(Dev->DeviceID), "%x/%d", m_deviceID, m_id.VendorImplID);
Dev->NumSubDevices = 0;
CloseSession(&session);
@ -366,7 +383,7 @@ mfxStatus LoaderCtxMSDK::QueryMSDKCaps(STRING_TYPE libNameFull,
mfxIMPL implD3D9;
m_msdkAdapterD3D9 = MFX_IMPL_UNSUPPORTED;
sts = CheckD3D9Support(luid, libNameFull, &implD3D9);
sts = CheckD3D9Support(m_luid, libNameFull, &implD3D9);
if (sts == MFX_ERR_NONE) {
m_msdkAdapterD3D9 = implD3D9;
@ -428,3 +445,108 @@ mfxStatus LoaderCtxMSDK::CheckD3D9Support(mfxU64 luid, STRING_TYPE libNameFull,
return MFX_ERR_UNSUPPORTED;
#endif
}
mfxStatus LoaderCtxMSDK::GetRenderNodeDescription(mfxU32 adapterID,
mfxU32 &vendorID,
mfxU16 &deviceID) {
vendorID = 0;
deviceID = 0;
#if defined(__linux__)
mfxU32 DRMRenderNodeNum = 128 + adapterID;
std::string nodeStr = std::to_string(DRMRenderNodeNum);
std::string vendorPath = "/sys/class/drm/renderD" + nodeStr + "/device/vendor";
std::string devPath = "/sys/class/drm/renderD" + nodeStr + "/device/device";
// check if vendor == 0x8086
FILE *vendorFile = fopen(vendorPath.c_str(), "r");
if (vendorFile) {
unsigned int u32 = 0;
int nRead = fscanf(vendorFile, "%x", &u32);
if (nRead == 1)
vendorID = (mfxU32)u32;
fclose(vendorFile);
}
if (vendorID != 0x8086)
return MFX_ERR_UNSUPPORTED;
// get deviceID for this node
FILE *devFile = fopen(devPath.c_str(), "r");
if (devFile) {
unsigned int u32 = 0;
int nRead = fscanf(devFile, "%x", &u32);
if (nRead == 1)
deviceID = (mfxU32)u32;
fclose(devFile);
}
if (deviceID == 0)
return MFX_ERR_UNSUPPORTED;
return MFX_ERR_NONE;
#else
return MFX_ERR_UNSUPPORTED;
#endif
}
// avoid confusing #ifdef indentation
// clang-format off
#ifdef ONEVPL_EXPERIMENTAL
mfxStatus LoaderCtxMSDK::QueryExtDeviceID(mfxExtendedDeviceId *extDeviceID,
mfxU32 adapterID,
mfxU16 deviceID,
mfxU64 luid) {
// fill extended device ID struct (API >= 2.6)
memset(extDeviceID, 0, sizeof(mfxExtendedDeviceId));
// common properties
extDeviceID->Version.Version = MFX_EXTENDEDDEVICEID_VERSION;
extDeviceID->VendorID = 0x8086;
extDeviceID->DeviceID = deviceID;
// default - no PCI info
// additional dependencies required to obtain these props
extDeviceID->PCIDomain = 0xFFFFFFFF;
extDeviceID->PCIBus = 0xFFFFFFFF;
extDeviceID->PCIDevice = 0xFFFFFFFF;
extDeviceID->PCIFunction = 0xFFFFFFFF;
// default - no LUID
extDeviceID->LUIDDeviceNodeMask = 0;
extDeviceID->LUIDValid = 0;
for (mfxU32 idx = 0; idx < 8; idx++)
extDeviceID->DeviceLUID[idx] = 0;
// default - no DRM node
extDeviceID->DRMRenderNodeNum = 0;
extDeviceID->DRMPrimaryNodeNum = 0x7FFFFFFF;
snprintf(extDeviceID->DeviceName, sizeof(extDeviceID->DeviceName), "%s", strImplName);
#if defined(_WIN32) || defined(_WIN64)
// fill in Windows-specific properties
if (luid) {
extDeviceID->LUIDDeviceNodeMask = 1;
extDeviceID->LUIDValid = 1;
// map 64-bit LUID into mfxU8[8]
mfxU64 luidArr = luid;
for (mfxU32 idx = 0; idx < 8; idx++) {
extDeviceID->DeviceLUID[idx] = mfxU8((luidArr)&0xFF);
luidArr >>= 8;
}
}
#elif defined(__linux__)
extDeviceID->DRMPrimaryNodeNum = adapterID;
extDeviceID->DRMRenderNodeNum = 128 + adapterID;
#endif
return MFX_ERR_NONE;
}
#endif // ONEVPL_EXPERIMENTAL
// clang-format on

View file

@ -1,5 +1,5 @@
/*############################################################################
# Copyright (C) 2012-2020 Intel Corporation
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
############################################################################*/
@ -534,6 +534,12 @@ mfxStatus MFXInitEx2(mfxVersion version,
break;
}
#ifdef ONEVPL_EXPERIMENTAL
// if GPUCopy is enabled via MFXSetConfigProperty(DeviceCopy), set corresponding
// flag in mfxInitParam for legacy RTs
par.GPUCopy = vplParam.DeviceCopy;
#endif
// also pass extBuf array (if any) to MFXInitEx for 1.x API
par.NumExtParam = vplParam.NumExtParam;
par.ExtParam = (vplParam.NumExtParam ? vplParam.ExtParam : nullptr);
@ -750,18 +756,77 @@ mfxStatus MFXJoinSession(mfxSession session, mfxSession child_session) {
} // mfxStatus MFXJoinSession(mfxSession session, mfxSession child_session)
static mfxStatus AllocateCloneHandle(MFX_DISP_HANDLE *parentHandle, MFX_DISP_HANDLE **cloneHandle) {
MFX_DISP_HANDLE *ph = parentHandle;
MFX_DISP_HANDLE *ch = nullptr;
if (!ph || !ph->hModule)
return MFX_ERR_NULL_PTR;
// get full path to the DLL of the parent session
wchar_t dllName[MFX::msdk_disp_path_len];
DWORD nSize = GetModuleFileNameW((HMODULE)(ph->hModule), dllName, msdk_disp_path_len);
if (nSize == 0 || nSize == msdk_disp_path_len)
return MFX_ERR_UNSUPPORTED;
try {
// requested version matches original session
ch = new MFX_DISP_HANDLE(ph->apiVersion);
}
catch (...) {
return MFX_ERR_MEMORY_ALLOC;
}
// initialization param structs are not used when bCloneSession == true
mfxInitParam par = {};
mfxInitializationParam vplParam = {};
// initialization extBufs are not saved at this level
// the RT should save these when the parent session is created and may use
// them when creating the cloned session
par.NumExtParam = 0;
// load the selected DLL, fill out function pointer tables and other state
mfxStatus sts = ch->LoadSelectedDLL(dllName,
ph->implType,
ph->impl,
ph->implInterface,
par,
vplParam,
true);
// unload the failed DLL
if (sts) {
ch->Close();
delete ch;
return MFX_ERR_UNSUPPORTED;
}
else {
ch->storageID = MFX::MFX_UNKNOWN_KEY;
}
*cloneHandle = ch;
return MFX_ERR_NONE;
}
mfxStatus MFXCloneSession(mfxSession session, mfxSession *clone) {
mfxStatus mfxRes = MFX_ERR_INVALID_HANDLE;
MFX_DISP_HANDLE *pHandle = (MFX_DISP_HANDLE *)session;
mfxVersion apiVersion;
mfxIMPL impl;
if (!clone)
return MFX_ERR_NULL_PTR;
*clone = NULL;
// check error(s)
if (pHandle) {
// initialize the clone session
// currently supported for 1.x API only
// for 2.x runtimes, need to use RT implementation (passthrough)
apiVersion = pHandle->apiVersion;
// for runtimes with 1.x API, call MFXInit followed by MFXJoinSession
// for runtimes with 2.x API, use RT implementation of MFXCloneSession (passthrough)
apiVersion = pHandle->actualApiVersion;
if (apiVersion.Major == 1) {
impl = pHandle->impl | pHandle->implInterface;
mfxRes = MFXInit(impl, &apiVersion, clone);
@ -777,6 +842,43 @@ mfxStatus MFXCloneSession(mfxSession session, mfxSession *clone) {
return mfxRes;
}
}
else if (apiVersion.Major == 2) {
int tableIndex = eMFXCloneSession;
mfxFunctionPointer pFunc;
pFunc = pHandle->callTable[tableIndex];
if (!pFunc)
return MFX_ERR_UNSUPPORTED;
// allocate new dispatcher-level session object and initialize state
// (function pointer tables, impl type, etc.)
MFX_DISP_HANDLE *cloneHandle;
mfxRes = AllocateCloneHandle(pHandle, &cloneHandle);
if (mfxRes != MFX_ERR_NONE)
return mfxRes;
// call RT implementation of MFXCloneSession
mfxSession cloneRT;
mfxRes = (*(mfxStatus(MFX_CDECL *)(mfxSession, mfxSession *))pFunc)(pHandle->session,
&cloneRT);
if (mfxRes != MFX_ERR_NONE || cloneRT == NULL) {
// RT call failed, delete cloned session
delete cloneHandle;
return MFX_ERR_UNSUPPORTED;
}
cloneHandle->session = cloneRT;
// get version of cloned session
mfxVersion cloneVersion = {};
mfxRes = MFXQueryVersion((mfxSession)cloneHandle, &cloneVersion);
if (mfxRes != MFX_ERR_NONE) {
MFXClose(cloneHandle);
return MFX_ERR_UNSUPPORTED;
}
cloneHandle->actualApiVersion = cloneVersion;
*clone = (mfxSession)cloneHandle;
}
else {
return MFX_ERR_UNSUPPORTED;
}

View file

@ -1,5 +1,5 @@
/*############################################################################
# Copyright (C) 2012-2020 Intel Corporation
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
############################################################################*/

View file

@ -1,5 +1,5 @@
/*############################################################################
# Copyright (C) 2012-2020 Intel Corporation
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
############################################################################*/

View file

@ -1,5 +1,5 @@
/*############################################################################
# Copyright (C) 2012-2020 Intel Corporation
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
############################################################################*/
@ -69,7 +69,8 @@ mfxStatus MFX_DISP_HANDLE::LoadSelectedDLL(const wchar_t *pPath,
mfxIMPL reqImpl,
mfxIMPL reqImplInterface,
mfxInitParam &par,
mfxInitializationParam &vplParam) {
mfxInitializationParam &vplParam,
bool bCloneSession) {
mfxStatus mfxRes = MFX_ERR_NONE;
// check error(s)
@ -89,18 +90,6 @@ mfxStatus MFX_DISP_HANDLE::LoadSelectedDLL(const wchar_t *pPath,
loadStatus = MFX_ERR_ABORTED;
return loadStatus;
}
// only mfxExtThreadsParam is allowed
if (par.NumExtParam) {
if ((par.NumExtParam > 1) || !par.ExtParam) {
loadStatus = MFX_ERR_ABORTED;
return loadStatus;
}
if ((par.ExtParam[0]->BufferId != MFX_EXTBUFF_THREADS_PARAM) ||
(par.ExtParam[0]->BufferSz != sizeof(mfxExtThreadsParam))) {
loadStatus = MFX_ERR_ABORTED;
return loadStatus;
}
}
// close the handle before initialization
Close();
@ -183,6 +172,11 @@ mfxStatus MFX_DISP_HANDLE::LoadSelectedDLL(const wchar_t *pPath,
}
}
if (bCloneSession == true) {
loadStatus = mfxRes;
return mfxRes;
}
// initialize the loaded DLL
if (MFX_ERR_NONE == mfxRes) {
mfxVersion version(apiVersion);

View file

@ -1,5 +1,5 @@
/*############################################################################
# Copyright (C) 2012-2020 Intel Corporation
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
############################################################################*/
@ -122,7 +122,8 @@ struct MFX_DISP_HANDLE : public _mfxSession {
mfxIMPL impl,
mfxIMPL implInterface,
mfxInitParam &par,
mfxInitializationParam &vplParam);
mfxInitializationParam &vplParam,
bool bCloneSession = false);
// Unload the library's module
mfxStatus UnLoadSelectedDLL(void);

View file

@ -1,5 +1,5 @@
/*############################################################################
# Copyright (C) 2013-2020 Intel Corporation
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
############################################################################*/

View file

@ -1,5 +1,5 @@
/*############################################################################
# Copyright (C) 2012-2020 Intel Corporation
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
############################################################################*/
@ -294,9 +294,9 @@ IMsgHandler *ETWHandlerFactory::GetSink(const wchar_t *sguid) {
ETWHandlerFactory::~ETWHandlerFactory() {
for
each(_storage_type::value_type val in m_storage) {
delete val.second;
}
each (_storage_type::value_type val in m_storage) {
delete val.second;
}
}
class EventRegistrator : public IMsgHandler {

View file

@ -1,5 +1,5 @@
/*############################################################################
# Copyright (C) 2012-2020 Intel Corporation
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
############################################################################*/

View file

@ -1,5 +1,5 @@
/*############################################################################
# Copyright (C) 2012-2020 Intel Corporation
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
############################################################################*/

View file

@ -1,22 +1,8 @@
// Copyright (c) 2019-2020 Intel Corporation
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
/*############################################################################
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
############################################################################*/
#ifndef DISPATCHER_WINDOWS_MFX_DRIVER_STORE_LOADER_H_
#define DISPATCHER_WINDOWS_MFX_DRIVER_STORE_LOADER_H_

View file

@ -1,5 +1,5 @@
/*############################################################################
# Copyright (C) 2012-2020 Intel Corporation
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
############################################################################*/

View file

@ -1,5 +1,5 @@
/*############################################################################
# Copyright (C) 2012-2020 Intel Corporation
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
############################################################################*/

View file

@ -1,5 +1,5 @@
/*############################################################################
# Copyright (C) 2012-2020 Intel Corporation
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
############################################################################*/

View file

@ -1,5 +1,5 @@
/*############################################################################
# Copyright (C) 2012-2020 Intel Corporation
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
############################################################################*/

View file

@ -1,5 +1,5 @@
/*############################################################################
# Copyright (C) 2012-2020 Intel Corporation
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
############################################################################*/

View file

@ -1,5 +1,5 @@
/*############################################################################
# Copyright (C) 2012-2020 Intel Corporation
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
############################################################################*/

View file

@ -1,5 +1,5 @@
/*############################################################################
# Copyright (C) 2012-2020 Intel Corporation
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
############################################################################*/

View file

@ -1,5 +1,5 @@
/*############################################################################
# Copyright (C) 2013-2020 Intel Corporation
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
############################################################################*/

View file

@ -1,5 +1,5 @@
/*############################################################################
# Copyright (C) 2013-2020 Intel Corporation
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
############################################################################*/

View file

@ -1,5 +1,5 @@
/*############################################################################
# Copyright (C) 2012-2020 Intel Corporation
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
############################################################################*/
@ -45,13 +45,12 @@ bool WinRegKey::Open(HKEY hRootKey, const wchar_t *pSubKey, REGSAM samDesired) {
lRes = RegOpenKeyExW(hRootKey, pSubKey, 0, samDesired, &hTemp);
if (ERROR_SUCCESS != lRes) {
DISPATCHER_LOG_OPERATION(SetLastError(lRes));
TRACE_WINREG_ERROR(
"Opening key \"%s\\%S\" : RegOpenKeyExW()==0x%x\n",
(HKEY_LOCAL_MACHINE == hRootKey)
? ("HKEY_LOCAL_MACHINE")
: (HKEY_CURRENT_USER == hRootKey) ? ("HKEY_CURRENT_USER") : "UNSUPPORTED_KEY",
pSubKey,
GetLastError());
TRACE_WINREG_ERROR("Opening key \"%s\\%S\" : RegOpenKeyExW()==0x%x\n",
(HKEY_LOCAL_MACHINE == hRootKey) ? ("HKEY_LOCAL_MACHINE")
: (HKEY_CURRENT_USER == hRootKey) ? ("HKEY_CURRENT_USER")
: "UNSUPPORTED_KEY",
pSubKey,
GetLastError());
return false;
}

View file

@ -1,5 +1,5 @@
/*############################################################################
# Copyright (C) 2012-2020 Intel Corporation
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
############################################################################*/

View file

@ -1,5 +1,5 @@
/*############################################################################
# Copyright (C) 2017-2020 Intel Corporation
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
############################################################################*/

View file

@ -2,8 +2,8 @@
#define VER_FILEVERSION @API_VERSION_MAJOR@,@API_VERSION_MINOR@,0,0
#define VER_FILEVERSION_STR "@API_VERSION_MAJOR@.@API_VERSION_MINOR@.0.0\0"
#define VER_PRODUCTVERSION @oneVPL_VERSION_MAJOR@,@oneVPL_VERSION_MINOR@,0,0
#define VER_PRODUCTVERSION_STR "@oneVPL_VERSION_MAJOR@.@oneVPL_VERSION_MINOR@\0"
#define VER_PRODUCTVERSION @CMAKE_PROJECT_VERSION_MAJOR@,@CMAKE_PROJECT_VERSION_MINOR@,0,0
#define VER_PRODUCTVERSION_STR "@CMAKE_PROJECT_VERSION_MAJOR@.@CMAKE_PROJECT_VERSION_MINOR@\0"
VS_VERSION_INFO VERSIONINFO
FILEVERSION VER_FILEVERSION

View file

@ -24,9 +24,7 @@ vpl_sources = [
'dispatcher/vpl/mfx_dispatcher_vpl.cpp',
]
libmfx_extra_args = [
'-DONEVPL_EXPERIMENTAL'
]
libmfx_extra_args = []
libmfx_extra_deps = []
libmfx_sources = vpl_sources