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 RENDEROBJECT_H 17 #define RENDEROBJECT_H 18 19 #include "base/render_base.h" 20 21 namespace OHOS { 22 namespace Media { 23 namespace Effect { 24 class RenderObject { 25 public: RenderObject()26 explicit RenderObject() : isReady_(false) {} ~RenderObject()27 virtual ~RenderObject() {} 28 29 virtual bool Init() = 0; 30 virtual bool Release() = 0; 31 IsReady()32 bool IsReady() const 33 { 34 return isReady_; 35 } 36 SetReady(bool flag)37 void SetReady(bool flag) 38 { 39 isReady_ = flag; 40 } 41 SetTag(const std::string & tag)42 void SetTag(const std::string &tag) 43 { 44 tag_ = tag; 45 } 46 GetTag()47 std::string GetTag() const 48 { 49 return tag_; 50 } 51 private: 52 bool isReady_; 53 std::string tag_; 54 }; 55 56 using RenderObjectPtr = std::shared_ptr<RenderObject>; 57 } // namespace Effect 58 } // namespace Media 59 } // namespace OHOS 60 #endif