1 /*
2  * Copyright (c) 2024-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 HISTREAMER_PLUGIN_MANAGER_V_H
17 #define HISTREAMER_PLUGIN_MANAGER_V_H
18 
19 #include <vector>
20 #include "cached_plugin_package.h"
21 
22 namespace OHOS {
23 namespace Media {
24 namespace Plugins {
25 
26 class PluginManagerV2 {
27 public:
28     PluginManagerV2(const PluginManagerV2&) = delete;
29     PluginManagerV2 operator=(const PluginManagerV2&) = delete;
30     ~PluginManagerV2() = default;
Instance()31     static PluginManagerV2& Instance()
32     {
33         static PluginManagerV2 impl;
34         return impl;
35     }
36     std::shared_ptr<PluginBase> CreatePluginByMime(PluginType pluginType, std::string mime);
37     std::shared_ptr<PluginBase> CreatePluginByName(std::string name);
38     std::string SnifferPlugin(PluginType pluginType, std::shared_ptr<DataSource> dataSource);
39 
40 private:
41     PluginManagerV2();
42     std::shared_ptr<CachedPluginPackage> cachedPluginPackage_;
43 };
44 } // namespace Plugins
45 } // namespace Media
46 } // namespace OHOS
47 #endif // HISTREAMER_PLUGIN_PACKAGE_H
48