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