1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef AIHDR_ENHANCER_FWK_H 17 #define AIHDR_ENHANCER_FWK_H 18 19 #include <atomic> 20 #include <memory> 21 #include <optional> 22 23 #include "aihdr_enhancer.h" 24 #include "aihdr_enhancer_base.h" 25 #include "extension_base.h" 26 27 namespace OHOS { 28 namespace Media { 29 namespace VideoProcessingEngine { 30 class AihdrEnhancerFwk : public AihdrEnhancer { 31 public: 32 AihdrEnhancerFwk(); 33 ~AihdrEnhancerFwk(); 34 VPEAlgoErrCode SetParameter(const int& parameter) override; 35 VPEAlgoErrCode GetParameter(int& parameter) const override; 36 VPEAlgoErrCode Process(const sptr<SurfaceBuffer>& input) override; 37 38 private: 39 VPEAlgoErrCode Init(const sptr<SurfaceBuffer>& input); 40 41 std::shared_ptr<AihdrEnhancerBase> impl_ { nullptr }; 42 int parameter_{}; 43 std::atomic<bool> initialized_ { false }; 44 Extension::ExtensionInfo extensionInfo_; 45 }; 46 } // namespace VideoProcessingEngine 47 } // namespace Media 48 } // namespace OHOS 49 50 #endif // AIHDR_ENHANCER_FWK_H 51