From 7ffd68a4b5169fd83d439d6f9838f88262b7168c Mon Sep 17 00:00:00 2001 From: zhouxubo Date: Wed, 7 May 2025 14:27:58 +0800 Subject: [PATCH 1/3] vpe add isSupported interface Signed-off-by: zhouxubo --- interfaces/inner_api/algorithm_video.h | 10 ++++++++++ interfaces/inner_api/algorithm_video_common.h | 1 + 2 files changed, 11 insertions(+) diff --git a/interfaces/inner_api/algorithm_video.h b/interfaces/inner_api/algorithm_video.h index 2a50c1c..046c7e5 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 7ce1e94..8be7557 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, }; /** -- Gitee From 80c53d20534ba78a70b4d9c87cd1b4d1d7561aca Mon Sep 17 00:00:00 2001 From: zhouxubo Date: Wed, 7 May 2025 14:52:33 +0800 Subject: [PATCH 2/3] vpe add isSupported interface Signed-off-by: zhouxubo --- framework/algorithm/common/algorithm_video.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/framework/algorithm/common/algorithm_video.cpp b/framework/algorithm/common/algorithm_video.cpp index c55c3bb..fef2a2d 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(); } +std::shared_ptr 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; -- Gitee From a314def1795a7aa0db4fe9cfaa1a72a8af9c9253 Mon Sep 17 00:00:00 2001 From: zhouxubo Date: Wed, 7 May 2025 15:00:25 +0800 Subject: [PATCH 3/3] vpe add isSupported interface Signed-off-by: zhouxubo --- framework/algorithm/common/algorithm_video.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/algorithm/common/algorithm_video.cpp b/framework/algorithm/common/algorithm_video.cpp index fef2a2d..5671a62 100644 --- a/framework/algorithm/common/algorithm_video.cpp +++ b/framework/algorithm/common/algorithm_video.cpp @@ -53,7 +53,7 @@ std::shared_ptr VpeVideo::Create(uint32_t type) return it->second(); } -std::shared_ptr VpeVideo::IsSupported(uint32_t type, const Format& parameter) +bool VpeVideo::IsSupported(uint32_t type, const Format& parameter) { auto it = g_isSupporteds.find(type); if (it == g_isSupporteds.end()) { -- Gitee