1fa7767c5Sopenharmony_ci/*
2fa7767c5Sopenharmony_ci * Copyright (c) 2023-2023 Huawei Device Co., Ltd.
3fa7767c5Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4fa7767c5Sopenharmony_ci * you may not use this file except in compliance with the License.
5fa7767c5Sopenharmony_ci * You may obtain a copy of the License at
6fa7767c5Sopenharmony_ci *
7fa7767c5Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8fa7767c5Sopenharmony_ci *
9fa7767c5Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10fa7767c5Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11fa7767c5Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12fa7767c5Sopenharmony_ci * See the License for the specific language governing permissions and
13fa7767c5Sopenharmony_ci * limitations under the License.
14fa7767c5Sopenharmony_ci */
15fa7767c5Sopenharmony_ci
16fa7767c5Sopenharmony_ci#ifndef HISTREAMER_PLUGIN_INFO_H
17fa7767c5Sopenharmony_ci#define HISTREAMER_PLUGIN_INFO_H
18fa7767c5Sopenharmony_ci
19fa7767c5Sopenharmony_ci#include "meta/meta.h"
20fa7767c5Sopenharmony_ci#include "plugin_caps.h"
21fa7767c5Sopenharmony_ci#include "plugin_definition.h"
22fa7767c5Sopenharmony_ci
23fa7767c5Sopenharmony_cinamespace OHOS {
24fa7767c5Sopenharmony_cinamespace Media {
25fa7767c5Sopenharmony_cinamespace Plugins {
26fa7767c5Sopenharmony_ci/**
27fa7767c5Sopenharmony_ci * PluginInfo, which describes static information for a plugin, including basic plugin information,
28fa7767c5Sopenharmony_ci * such as the type, name, rank, and input and output capabilities.
29fa7767c5Sopenharmony_ci *
30fa7767c5Sopenharmony_ci * Different types of plugins have their own extra information,
31fa7767c5Sopenharmony_ci * which is described in the "extra" field in the form of key-value.
32fa7767c5Sopenharmony_ci *
33fa7767c5Sopenharmony_ci * Note that the type, name, rating, and extra information describes the plugin as a whole;
34fa7767c5Sopenharmony_ci *
35fa7767c5Sopenharmony_ci * Typically, plugin have inputs and outputs, those capabilities are described by inCaps and outCaps.
36fa7767c5Sopenharmony_ci * (The Source plugin has only output capability, and the Sink plugin has only input capability.)
37fa7767c5Sopenharmony_ci * The input/output capability describes the data processing capability by mime-type.
38fa7767c5Sopenharmony_ci * To describe mime-type more closely, a detailed tag may be attached to the mime-type.
39fa7767c5Sopenharmony_ci *
40fa7767c5Sopenharmony_ci */
41fa7767c5Sopenharmony_cistruct PluginInfo {
42fa7767c5Sopenharmony_ci    uint32_t apiVersion;
43fa7767c5Sopenharmony_ci    PluginType pluginType;
44fa7767c5Sopenharmony_ci    std::string name;
45fa7767c5Sopenharmony_ci    std::string description;
46fa7767c5Sopenharmony_ci    uint32_t rank;
47fa7767c5Sopenharmony_ci    CapabilitySet inCaps;
48fa7767c5Sopenharmony_ci    CapabilitySet outCaps;
49fa7767c5Sopenharmony_ci    std::map<std::string, Any> extra;
50fa7767c5Sopenharmony_ci};
51fa7767c5Sopenharmony_ci
52fa7767c5Sopenharmony_cistruct MediaInfoHelper {
53fa7767c5Sopenharmony_ci    Meta globalMeta;
54fa7767c5Sopenharmony_ci    std::vector<Meta> trackMeta;
55fa7767c5Sopenharmony_ci};
56fa7767c5Sopenharmony_ci
57fa7767c5Sopenharmony_ci/**
58fa7767c5Sopenharmony_ci * @brief MediaInfo is a facilitate unified display of the relevant technical and
59fa7767c5Sopenharmony_ci * tag data for video and audio files.
60fa7767c5Sopenharmony_ci *
61fa7767c5Sopenharmony_ci * MediaInfo reveals information such as:
62fa7767c5Sopenharmony_ci *   - General: artist, album, author, copyright, date, duration, etc.
63fa7767c5Sopenharmony_ci *   - Tracks: such as codec, channel, bitrate, etc.
64fa7767c5Sopenharmony_ci * @see Tag
65fa7767c5Sopenharmony_ci *
66fa7767c5Sopenharmony_ci * @since 1.0
67fa7767c5Sopenharmony_ci * @version 1.0
68fa7767c5Sopenharmony_ci */
69fa7767c5Sopenharmony_cistruct MediaInfo {
70fa7767c5Sopenharmony_ci    Meta general;             ///< General information
71fa7767c5Sopenharmony_ci    std::vector<Meta> tracks; ///< Media tracks, include audio, video and text
72fa7767c5Sopenharmony_ci};
73fa7767c5Sopenharmony_ci
74fa7767c5Sopenharmony_ci/**
75fa7767c5Sopenharmony_ci * Extra information about the plugin.
76fa7767c5Sopenharmony_ci * Describes the protocol types supported by the Source plugin for playback.
77fa7767c5Sopenharmony_ci */
78fa7767c5Sopenharmony_ci#define PLUGIN_INFO_EXTRA_PROTOCOL          "protocol"  // NOLINT: macro constant
79fa7767c5Sopenharmony_ci
80fa7767c5Sopenharmony_ci/**
81fa7767c5Sopenharmony_ci * Extra information about the plugin.
82fa7767c5Sopenharmony_ci * Describes the input source types supported by the Source plugin for record.
83fa7767c5Sopenharmony_ci */
84fa7767c5Sopenharmony_ci#define PLUGIN_INFO_EXTRA_INPUT_TYPE        "inputType"  // NOLINT: macro constant
85fa7767c5Sopenharmony_ci
86fa7767c5Sopenharmony_ci/**
87fa7767c5Sopenharmony_ci * Extra information about the plugin.
88fa7767c5Sopenharmony_ci * Describes the output types supported by the OutputSink plugin.
89fa7767c5Sopenharmony_ci */
90fa7767c5Sopenharmony_ci#define PLUGIN_INFO_EXTRA_OUTPUT_TYPE        "outputType"  // NOLINT: macro constant
91fa7767c5Sopenharmony_ci
92fa7767c5Sopenharmony_ci/**
93fa7767c5Sopenharmony_ci * Extra information about the plugin.
94fa7767c5Sopenharmony_ci * Describes the extensions supported by the Demuxer plugin.
95fa7767c5Sopenharmony_ci */
96fa7767c5Sopenharmony_ci#define PLUGIN_INFO_EXTRA_EXTENSIONS        "extensions" // NOLINT: macro constant
97fa7767c5Sopenharmony_ci
98fa7767c5Sopenharmony_ci/**
99fa7767c5Sopenharmony_ci * Extra information about the plugin.
100fa7767c5Sopenharmony_ci * Describes the CodecMode supported by the Codec plugin.
101fa7767c5Sopenharmony_ci *
102fa7767c5Sopenharmony_ci * ValueType: enum Plugins::CodecMode
103fa7767c5Sopenharmony_ci */
104fa7767c5Sopenharmony_ci#define PLUGIN_INFO_EXTRA_CODEC_MODE        "codec_mode" // NOLINT: macro constant
105fa7767c5Sopenharmony_ci} // namespace Plugins
106fa7767c5Sopenharmony_ci} // namespace Media
107fa7767c5Sopenharmony_ci} // namespace OHOS
108fa7767c5Sopenharmony_ci#endif // HISTREAMER_PLUGIN_INFO_H
109