1 /* 2 * Copyright (C) 2025 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 /** 17 * @addtogroup AVMetadataExtractor 18 * @{ 19 * 20 * @brief Provides APIs of metadata capability for Media Source. 21 * 22 * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 23 * @since 16 24 */ 25 26 /** 27 * @file avmetadata_extractor_base.h 28 * 29 * @brief Defines the structure and enumeration for AVMetadataExtractor. 30 * 31 * @kit MediaKit 32 * @library libavmetadata_extractor.so 33 * @since 16 34 */ 35 36 #ifndef MULTIMEDIA_PLAYER_FRAMEWORK_NATIVE_AVMETADATA_EXTRACTOR_BASE_H 37 #define MULTIMEDIA_PLAYER_FRAMEWORK_NATIVE_AVMETADATA_EXTRACTOR_BASE_H 38 39 #include <stdint.h> 40 41 #include "native_avformat.h" 42 43 #ifdef __cplusplus 44 extern "C" { 45 #endif 46 47 /** 48 * @brief Key to get the album title of the media source, value type is const char*. 49 * 50 * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 51 * @since 16 52 */ 53 static const char* OH_AVMETADATA_EXTRACTOR_ALBUM = "album"; 54 55 /** 56 * @brief Key to get the album performer or artist associated, value type is const char*. 57 * 58 * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 59 * @since 16 60 */ 61 static const char* OH_AVMETADATA_EXTRACTOR_ALBUM_ARTIST = "albumArtist"; 62 63 /** 64 * @brief Key to get the artist name, value type is const char*. 65 * 66 * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 67 * @since 16 68 */ 69 static const char* OH_AVMETADATA_EXTRACTOR_ARTIST = "artist"; 70 71 /** 72 * @brief Key to get the author name, value type is const char*. 73 * 74 * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 75 * @since 16 76 */ 77 static const char* OH_AVMETADATA_EXTRACTOR_AUTHOR = "author"; 78 79 /** 80 * @brief Key to get the created time of the media source, value type is const char*. 81 * 82 * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 83 * @since 16 84 */ 85 static const char* OH_AVMETADATA_EXTRACTOR_DATE_TIME = "dateTime"; 86 87 /** 88 * @brief Key to get the created or modified time with the specific date format, value type is const char*. 89 * 90 * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 91 * @since 16 92 */ 93 static const char* OH_AVMETADATA_EXTRACTOR_DATE_TIME_FORMAT = "dateTimeFormat"; 94 95 /** 96 * @brief Key to get the composer of the media source, value type is const char*. 97 * 98 * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 99 * @since 16 100 */ 101 static const char* OH_AVMETADATA_EXTRACTOR_COMPOSER = "composer"; 102 103 /** 104 * @brief Key to get the playback duration of the media source, value type is int64_t, value unit is millisecond (ms). 105 * 106 * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 107 * @since 16 108 */ 109 static const char* OH_AVMETADATA_EXTRACTOR_DURATION = "duration"; 110 111 /** 112 * @brief Key to get the content type or genre, value type is const char*. 113 * 114 * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 115 * @since 16 116 */ 117 static const char* OH_AVMETADATA_EXTRACTOR_GENRE = "genre"; 118 119 /** 120 * @brief Key to get the value whether the media resource contains audio content, 121 * value type is int32_t. 1 means true and 0 means false. 122 * 123 * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 124 * @since 16 125 */ 126 static const char* OH_AVMETADATA_EXTRACTOR_HAS_AUDIO = "hasAudio"; 127 128 /** 129 * @brief Key to get the value whether the media resource contains video content, 130 * value type is int32_t. 1 means true and 0 means false. 131 * 132 * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 133 * @since 16 134 */ 135 static const char* OH_AVMETADATA_EXTRACTOR_HAS_VIDEO = "hasVideo"; 136 137 /** 138 * @brief Key to get the mime type of the media source, value type is const char*. 139 * Some example mime types include: "video/mp4", "audio/mp4", "audio/amr-wb". 140 * 141 * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 142 * @since 16 143 */ 144 static const char* OH_AVMETADATA_EXTRACTOR_MIME_TYPE = "mimeType"; 145 146 /** 147 * @brief Key to get the number of tracks, value type is int32_t. 148 * 149 * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 150 * @since 16 151 */ 152 static const char* OH_AVMETADATA_EXTRACTOR_TRACK_COUNT = "trackCount"; 153 154 /** 155 * @brief Key to get the audio sample rate, value type is int32_t. 156 * 157 * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 158 * @since 16 159 */ 160 static const char* OH_AVMETADATA_EXTRACTOR_SAMPLE_RATE = "sampleRate"; 161 162 /** 163 * @brief Key to get the media source title, value type is const char*. 164 * 165 * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 166 * @since 16 167 */ 168 static const char* OH_AVMETADATA_EXTRACTOR_TITLE = "title"; 169 170 /** 171 * @brief Key to get the video height if the media contains video, value type is int32_t. 172 * 173 * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 174 * @since 16 175 */ 176 static const char* OH_AVMETADATA_EXTRACTOR_VIDEO_HEIGHT = "videoHeight"; 177 178 /** 179 * @brief Key to get the video width if the media contains video, value type is int32_t. 180 * 181 * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 182 * @since 16 183 */ 184 static const char* OH_AVMETADATA_EXTRACTOR_VIDEO_WIDTH = "videoWidth"; 185 186 /** 187 * @brief Key to get the video rotation angle, value type is int32_t. 188 * 189 * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 190 * @since 16 191 */ 192 static const char* OH_AVMETADATA_EXTRACTOR_VIDEO_ORIENTATION = "videoOrientation"; 193 194 /** 195 * @brief Key to get the information whether the video is HDR video, value type is int32_t. 196 * For details of the value, see {@link OH_Core_HdrType} defined in {@link media_types.h}. 197 * 198 * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 199 * @since 16 200 */ 201 static const char* OH_AVMETADATA_EXTRACTOR_VIDEO_IS_HDR_VIVID = "hdrType"; 202 203 /** 204 * @brief Key to get the latitude value in the geographical location, value type is float. 205 * 206 * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 207 * @since 16 208 */ 209 static const char* OH_AVMETADATA_EXTRACTOR_LOCATION_LATITUDE = "latitude"; 210 211 /** 212 * @brief Key to get the longitude value in the geographical location, value type is float. 213 * 214 * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 215 * @since 16 216 */ 217 static const char* OH_AVMETADATA_EXTRACTOR_LOCATION_LONGITUDE = "longitude"; 218 219 #ifdef __cplusplus 220 } 221 #endif 222 #endif // MULTIMEDIA_PLAYER_FRAMEWORK_NATIVE_AVMETADATA_EXTRACTOR_BASE_H