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 IMAGE_EFFECT_RENDER_STRATEGY_H 17 #define IMAGE_EFFECT_RENDER_STRATEGY_H 18 19 #include "effect_buffer.h" 20 #include "capability.h" 21 22 namespace OHOS { 23 namespace Media { 24 namespace Effect { 25 class RenderStrategy { 26 public: 27 RenderStrategy() = default; 28 ~RenderStrategy() = default; 29 30 void Init(const std::shared_ptr<EffectBuffer> &src, const std::shared_ptr<EffectBuffer> &dst); 31 32 EffectBuffer *ChooseBestOutput(EffectBuffer *buffer, std::shared_ptr<MemNegotiatedCap> &memNegotiatedCap); 33 34 EffectBuffer *GetInput(); 35 36 EffectBuffer *GetOutput(); 37 38 void Deinit(); 39 private: 40 std::shared_ptr<EffectBuffer> src_ = nullptr; 41 std::shared_ptr<EffectBuffer> dst_ = nullptr; 42 }; 43 } // namespace Effect 44 } // namespace Media 45 } // namespace OHOS 46 #endif // IMAGE_EFFECT_RENDER_STRATEGY_H