1 /* 2 * Copyright (C) 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 MEDIA_DESCRIPTION_H 17 #define MEDIA_DESCRIPTION_H 18 19 #include "meta/format.h" 20 21 namespace OHOS { 22 namespace Media { 23 /** 24 * @brief Provides the uniform container for storing the media description. 25 */ 26 using MediaDescription = Format; 27 28 /** 29 * @brief Provides the key's definition for MediaDescription. 30 */ 31 namespace MediaDescriptionKey { 32 /** 33 * Key for track index, value type is uint32_t 34 */ 35 static constexpr std::string_view MD_KEY_TRACK_INDEX = "track_index"; 36 37 /** 38 * Key for track type, value type is uint8_t, see {link @MediaTrackType} 39 */ 40 static constexpr std::string_view MD_KEY_TRACK_TYPE = "track_type"; 41 42 /** 43 * Key for codec mime type, value type is string 44 */ 45 static constexpr std::string_view MD_KEY_CODEC_MIME = "codec_mime"; 46 47 /** 48 * Key for duration, value type is int64_t 49 */ 50 static constexpr std::string_view MD_KEY_DURATION = "duration"; 51 52 /** 53 * Key for bitrate, value type is uint32_t 54 */ 55 static constexpr std::string_view MD_KEY_BITRATE = "bitrate"; 56 57 /** 58 * Key for max input size, value type is uint32_t 59 */ 60 static constexpr std::string_view MD_KEY_MAX_INPUT_SIZE = "max_input_size"; 61 62 /** 63 * Key for video width, value type is uint32_t 64 */ 65 static constexpr std::string_view MD_KEY_WIDTH = "width"; 66 67 /** 68 * Key for video height, value type is uint32_t 69 */ 70 static constexpr std::string_view MD_KEY_HEIGHT = "height"; 71 72 /** 73 * Key for video pixelformat, value type is int32_t, see {link @MediaPixelFormat} 74 */ 75 static constexpr std::string_view MD_KEY_PIXEL_FORMAT = "pixel_format"; 76 77 /** 78 * Key for video frame rate, value type is double. 79 */ 80 static constexpr std::string_view MD_KEY_FRAME_RATE = "frame_rate"; 81 82 /** 83 * Key for video capture rate, value type is double 84 */ 85 static constexpr std::string_view MD_KEY_CAPTURE_RATE = "capture_rate"; 86 87 /** 88 * Key for the interval of key frame. value type is int32_t, the unit is milliseconds. 89 * A negative value means no key frames are requested after the first frame. A zero 90 * value means a stream containing all key frames is requested. 91 */ 92 static constexpr std::string_view MD_KEY_I_FRAME_INTERVAL = "i_frame_interval"; 93 94 /** 95 * Key for the request a I-Frame immediately. value type is boolean 96 */ 97 static constexpr std::string_view MD_KEY_REQUEST_I_FRAME = "req_i_frame"; 98 99 /** 100 * Key for audio channel count, value type is uint32_t 101 */ 102 static constexpr std::string_view MD_KEY_CHANNEL_COUNT = "channel_count"; 103 104 /** 105 * Key for audio sample rate, value type is uint32_t 106 */ 107 static constexpr std::string_view MD_KEY_SAMPLE_RATE = "sample_rate"; 108 109 /** 110 * Key for track count in the container, value type is uint32_t 111 */ 112 static constexpr std::string_view MD_KEY_TRACK_COUNT = "track_count"; 113 114 /** 115 * Key for container format type, value type is string 116 */ 117 static constexpr std::string_view MD_KEY_CONTAINER_FORMAT = "container_format"; 118 119 /** 120 * custom key prefix, media service will pass through to HAL. 121 */ 122 static constexpr std::string_view MD_KEY_CUSTOM_PREFIX = "vendor.custom"; 123 124 /** 125 * Key for language, value type is string 126 */ 127 static constexpr std::string_view MD_KEY_LANGUAGE = "language"; 128 }; 129 } // namespace Media 130 } // namespace OHOS 131 #endif // MEDIA_DESCRIPTION_H 132