1 /* 2 * Copyright (c) 2023-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 #if defined(VIDEO_SUPPORT) 16 17 #ifndef HISTREAMER_PLUGIN_PLUGINS_CODEC_MANAGER_H 18 #define HISTREAMER_PLUGIN_PLUGINS_CODEC_MANAGER_H 19 20 #include "plugin/interface/codec_plugin.h" 21 22 namespace OHOS { 23 namespace Media { 24 namespace Plugin { 25 namespace CodecAdapter { 26 struct CodecCapability { 27 PluginType pluginType; ///< plugin type, For details, @see PluginType. 28 std::string pluginMime; ///< plugin mime 29 std::string name; ///< plugin name 30 CapabilitySet inCaps{}; ///< Plug-in input capability, For details, @see Capability. 31 CapabilitySet outCaps{}; ///< Plug-in output capability, For details, @see Capability. 32 }; 33 34 class CodecManager { 35 public: 36 virtual ~CodecManager() = default; 37 38 virtual int32_t CreateComponent(const Plugin::Any& component, uint32_t& id, const std::string& name, 39 const Plugin::Any& appData, const Plugin::Any& callbacks) = 0; 40 41 virtual int32_t DestroyComponent(const Plugin::Any& component, uint32_t id) = 0; 42 43 virtual Status RegisterCodecPlugins(const std::shared_ptr<OHOS::Media::Plugin::Register>& reg) = 0; 44 45 virtual Status UnRegisterCodecPlugins() = 0; 46 }; 47 } // namespace CodecAdapter 48 } // namespace Plugin 49 } // namespace Media 50 } // namespace OHOS 51 #endif // HISTREAMER_PLUGIN_PLUGINS_CODEC_MANAGER_H 52 #endif