1 /*
2  * Copyright (c) 2021-2021 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_INFO_H
17 #define HISTREAMER_PLUGIN_INFO_H
18 
19 #include "plugin/common/plugin_tags.h"
20 #include "plugin/common/plugin_caps.h"
21 #include "plugin/interface/plugin_definition.h"
22 
23 namespace OHOS {
24 namespace Media {
25 namespace Plugin {
26 /**
27  * PluginInfo, which describes static information for a plugin, including basic plugin information,
28  * such as the type, name, rank, and input and output capabilities.
29  *
30  * Different types of plugins have their own extra information,
31  * which is described in the "extra" field in the form of key-value.
32  *
33  * Note that the type, name, rating, and extra information describes the plugin as a whole;
34  *
35  * Typically, plugin have inputs and outputs, those capabilities are described by inCaps and outCaps.
36  * (The Source plugin has only output capability, and the Sink plugin has only input capability.)
37  * The input/output capability describes the data processing capability by mime-type.
38  * To describe mime-type more closely, a detailed tag may be attached to the mime-type.
39  *
40  */
41 struct PluginInfo {
42     uint32_t apiVersion;
43     PluginType pluginType;
44     std::string name;
45     std::string description;
46     uint32_t rank;
47     CapabilitySet inCaps;
48     CapabilitySet outCaps;
49     std::map<std::string, ValueType> extra;
50 };
51 
52 /**
53  * Extra information about the plugin.
54  * Describes the protocol types supported by the Source plugin for playback.
55  */
56 #define PLUGIN_INFO_EXTRA_PROTOCOL          "protocol"  // NOLINT: macro constant
57 
58 /**
59  * Extra information about the plugin.
60  * Describes the input source types supported by the Source plugin for record.
61  */
62 #define PLUGIN_INFO_EXTRA_INPUT_TYPE        "inputType"  // NOLINT: macro constant
63 
64 /**
65  * Extra information about the plugin.
66  * Describes the output types supported by the OutputSink plugin.
67  */
68 #define PLUGIN_INFO_EXTRA_OUTPUT_TYPE        "outputType"  // NOLINT: macro constant
69 
70 /**
71  * Extra information about the plugin.
72  * Describes the extensions supported by the Demuxer plugin.
73  */
74 #define PLUGIN_INFO_EXTRA_EXTENSIONS        "extensions" // NOLINT: macro constant
75 
76 /**
77  * Extra information about the plugin.
78  * Describes the CodecMode supported by the Codec plugin.
79  *
80  * ValueType: enum Plugin::CodecMode
81  */
82 #define PLUGIN_INFO_EXTRA_CODEC_MODE        "codec_mode" // NOLINT: macro constant
83 } // namespace Plugin
84 } // namespace Media
85 } // namespace OHOS
86 #endif // HISTREAMER_PLUGIN_INFO_H
87