diff --git a/framework/algorithm/common/algorithm_video.cpp b/framework/algorithm/common/algorithm_video.cpp index c55c3bbf596500855143c9de87100c09d4bb5792..5671a62e92bf5cabaea8e1a15944a55ddf88f315 100644 --- a/framework/algorithm/common/algorithm_video.cpp +++ b/framework/algorithm/common/algorithm_video.cpp @@ -35,6 +35,12 @@ std::unordered_map(void)>> g_c { VIDEO_TYPE_DETAIL_ENHANCER, &DetailEnhancerVideoFwk::Create }, // Feature altorithm header creator end }; + +std::unordered_map> g_isSupporteds = { + // NOTE: Add feature altorithm IsSupported here + // Feature altorithm header isSupported begin + // Feature altorithm header isSupported end +}; } std::shared_ptr VpeVideo::Create(uint32_t type) @@ -47,6 +53,16 @@ std::shared_ptr VpeVideo::Create(uint32_t type) return it->second(); } +bool VpeVideo::IsSupported(uint32_t type, const Format& parameter) +{ + auto it = g_isSupporteds.find(type); + if (it == g_isSupporteds.end()) { + VPE_LOGE("Unsupported type: 0x%{public}x", type); + return false; + } + return it->second(parameter); +} + VPEAlgoErrCode VpeVideo::RegisterCallback([[maybe_unused]] const std::shared_ptr& callback) { return VPE_ALGO_ERR_OK; diff --git a/interfaces/inner_api/algorithm_video.h b/interfaces/inner_api/algorithm_video.h index 2a50c1c554b46dac1287f2257fe6bd5f87356308..046c7e5bb89a3085ec7f8043db06a752de97dbb4 100644 --- a/interfaces/inner_api/algorithm_video.h +++ b/interfaces/inner_api/algorithm_video.h @@ -40,6 +40,16 @@ public: */ static std::shared_ptr Create(uint32_t type); + /** + * @brief Query whether the feature altorithm is supported. + * @param type Use VIDEO_TYPE_XXX to specify the processing type. For details, see {@link VpeVideoType}. + * @param parameter The parameter of video processing. + * @return true if the feature altorithm is supported. false If the feature altorithm is unsupported. + * @since 5.1 + * @version 5.1 + */ + static bool IsSupported(uint32_t type, const Format& parameter); + /** * @brief Register callback object. * @param callback Callback object to be registered. For details, see {@link VpeVideoCallback}. diff --git a/interfaces/inner_api/algorithm_video_common.h b/interfaces/inner_api/algorithm_video_common.h index 7ce1e9472308b87365afe83e307c6c092ac3c178..8be75578a52f8e67f91fcc0a1e5b1ef73d10012b 100644 --- a/interfaces/inner_api/algorithm_video_common.h +++ b/interfaces/inner_api/algorithm_video_common.h @@ -56,6 +56,7 @@ enum VpeVideoType : uint32_t { * @version 5.1 */ VIDEO_TYPE_DETAIL_ENHANCER = 0x4, + VIDEO_TYPE_AIHDR_ENHANCER = 0x8, }; /**