Skip to content

Commit

Permalink
Add API for property-based query
Browse files Browse the repository at this point in the history
Add the new API MFXQueryImplsProperties for property-based query.
And add the new structure mfxQueryProperty for the API.
  • Loading branch information
jinyuan-dev authored and gfxVPLsdm committed Feb 1, 2025
1 parent a0d58b4 commit 8b4f6c6
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
10 changes: 10 additions & 0 deletions api/vpl/mfxcommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,16 @@ typedef struct {
} mfxInitializationParam;
MFX_PACK_END()

#ifdef ONEVPL_EXPERIMENTAL
MFX_PACK_BEGIN_STRUCT_W_PTR()
/*! Represents a name/value pair to indicate requested properties. For use with MFXQueryImplsProperties() */
typedef struct {
mfxU8* PropName; /*!< Property name string to indicate the requested Property. */
mfxVariant PropVar; /*!< Property value corresponding to the property name. */
} mfxQueryProperty;
MFX_PACK_END()
#endif

#ifdef __cplusplus
}
#endif /* __cplusplus */
Expand Down
4 changes: 4 additions & 0 deletions api/vpl/mfxdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ typedef enum {
MFX_VARIANT_TYPE_F64 = MFX_DATA_TYPE_F64, /*!< 64-bit double precision floating point. */
MFX_VARIANT_TYPE_PTR = MFX_DATA_TYPE_PTR, /*!< Generic type pointer. */
MFX_VARIANT_TYPE_FP16 = MFX_DATA_TYPE_FP16, /*!< 16-bit half precision floating point. */

#ifdef ONEVPL_EXPERIMENTAL
MFX_VARIANT_TYPE_QUERY = 1000, /*!< May be added to other datatype to skip filtering, or used alone for query-only properties */
#endif
} mfxVariantType;

MFX_PACK_BEGIN_STRUCT_W_PTR()
Expand Down
5 changes: 5 additions & 0 deletions api/vpl/mfxdispatcherprefixedfunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,9 @@

#define MFXVideoVPP_ProcessFrameAsync disp_MFXVideoVPP_ProcessFrameAsync

// API 2.15 functions
#ifdef ONEVPL_EXPERIMENTAL
#define MFXQueryImplsProperties disp_MFXQueryImplsProperties
#endif

#endif
22 changes: 21 additions & 1 deletion api/vpl/mfximplcaps.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ mfxHDL* MFX_CDECL MFXQueryImplsDescription(mfxImplCapsDeliveryFormat format, mfx

/*!
@brief
Destroys the handle allocated by the MFXQueryImplsDescription function.
Destroys the handle allocated by the MFXQueryImplsDescription function or the MFXQueryImplsProperties function.
Implementation must remember which handles are released. Once the last handle is released, this function must release memory
allocated for the array of handles.
Expand All @@ -46,6 +46,26 @@ mfxHDL* MFX_CDECL MFXQueryImplsDescription(mfxImplCapsDeliveryFormat format, mfx
*/
mfxStatus MFX_CDECL MFXReleaseImplDescription(mfxHDL hdl);

#ifdef ONEVPL_EXPERIMENTAL
/*!
@brief
Delivers implementation capabilities for configured properties.
The returned capability report will be sparsely filled out, with only properties available which
were set via MFXSetConfigFilterProperty().
@param[in] properties Array of property name/value pairs indicating which properties to populate in the capability report.
@param[in] num_properties Number of property name/value pairs.
@param[out] num_impls Number of the implementations.
@return
Array of handles to the capability report or NULL in case of NULL properties pointer or zero num_properties or NULL num_impls pointer.
Length of array is equal to num_impls.
@since This function is available since API version 2.15.
*/
mfxHDL* MFX_CDECL MFXQueryImplsProperties(mfxQueryProperty** properties, mfxU32 num_properties, mfxU32* num_impls);
#endif


#ifdef __cplusplus
} // extern "C"
Expand Down

0 comments on commit 8b4f6c6

Please sign in to comment.