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_LIST_H
17 #define HISTREAMER_PLUGIN_LIST_H
18 
19 #include <vector>
20 #include <string>
21 #include <cstring>
22 #include "media_types.h"
23 
24 namespace OHOS {
25 namespace Media {
26 namespace Plugins {
27 struct PluginDescription {
28     std::string pluginName;
29     std::string packageName;
30     PluginType pluginType;
31     std::string cap;
32     int32_t rank;
33 };
34 
35 class PluginList {
36 public:
37     ~PluginList();
38     static PluginList &GetInstance();
39     std::vector<PluginDescription> GetAllPlugins();
40     std::vector<PluginDescription> GetPluginsByCap(PluginType pluginType, std::string needCap);
41     PluginDescription GetPluginByName(std::string name);
42     std::vector<PluginDescription> GetPluginsByType(PluginType pluginType);
43 private:
44     PluginList();
45 
46     void AddDataSourceStreamPlugins();
47     void AddFileFdSourcePlugins();
48     void AddFileSourcePlugins();
49     void AddHttpSourcePlugins();
50     void AddAacDemuxerPlugin();
51     void AddAmrDemuxerPlugin();
52     void AddAmrnbDemuxerPlugin();
53     void AddAmrwbDemuxerPlugin();
54     void AddApeDemuxerPlugin();
55     void AddAsfDemuxerPlugin();
56     void AddAsfoDemuxerPlugin();
57     void AddFlacDemuxerPlugin();
58     void AddFlvDemuxerPlugin();
59     void AddMatroskaDemuxerPlugin();
60     void AddMovDemuxerPlugin();
61     void AddMp3DemuxerPlugin();
62     void AddMpegDemuxerPlugin();
63     void AddMpegtsDemuxerPlugin();
64     void AddAviDemuxerPlugin();
65     void AddSrtDemuxerPlugin();
66     void AddWebvttDemuxerPlugin();
67     void AddOggDemuxerPlugin();
68     void AddWavDemuxerPlugin();
69     void AddFFmpegDemuxerPlugins();
70     void AddMpegAudioDecoderPlugin();
71     void AddAacAudioDecoderPlugin();
72     void AddFFmpegAudioDecodersPlugins();
73     void AddAudioVividDecodersPlugins();
74     void AddG711muAudioDecoderPlugins();
75     void AddLbvcAudioDecoderPlugins();
76     void AddOpusAudioDecoderPlugins();
77     void AddAudioServerSinkPlugins();
78     void AddFFmpegAudioEncodersPlugins();
79     void AddG711muAudioEncoderPlugins();
80     void AddLbvcAudioEncoderPlugins();
81     void AddOpusAudioEncoderPlugins();
82     void AddAmrwbAudioEncoderPlugins();
83     void AddAmrnbAudioEncoderPlugins();
84     void AddMp3AudioEncoderPlugins();
85     void AddFFmpegMuxerPlugins();
86     void AddAudioVendorAacEncodersPlugin();
87 
88     std::vector<PluginDescription> pluginDescriptionList_;
89 };
90 } // namespace Plugins
91 } // namespace Media
92 } // namespace OHOS
93 #endif // HISTREAMER_PLUGIN_LIST_H
94