1 /* 2 * Copyright (C) 2023 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 PLUGINS_COMMON_LIBS_IMAGE_LIBEXTPLUGIN_INCLUDE_EXT_ENCODER_H_ 17 #define PLUGINS_COMMON_LIBS_IMAGE_LIBEXTPLUGIN_INCLUDE_EXT_ENCODER_H_ 18 19 #include <vector> 20 21 #include "abs_image_encoder.h" 22 #include "hilog/log.h" 23 #include "log_tags.h" 24 #include "plugin_class_base.h" 25 26 namespace OHOS { 27 namespace ImagePlugin { 28 class ExtEncoder : public AbsImageEncoder, public OHOS::MultimediaPlugin::PluginClassBase { 29 public: 30 ExtEncoder(); 31 ~ExtEncoder() override; 32 uint32_t StartEncode(OutputDataStream &outputStream, PlEncodeOptions &option) override; 33 uint32_t AddImage(Media::PixelMap &pixelMap) override; 34 uint32_t FinalizeEncode() override; 35 36 private: 37 DISALLOW_COPY_AND_MOVE(ExtEncoder); 38 OutputDataStream* output_ = nullptr; 39 PlEncodeOptions opts_; 40 Media::PixelMap* pixelmap_ = nullptr; 41 }; 42 } // namespace ImagePlugin 43 } // namespace OHOS 44 45 #endif // PLUGINS_COMMON_LIBS_IMAGE_LIBEXTPLUGIN_INCLUDE_EXT_ENCODER_H_ 46