• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 MEDIA_FOUNDATION_META_KEY_H
17 #define MEDIA_FOUNDATION_META_KEY_H
18 
19 #include "meta/any.h"
20 
21 namespace OHOS {
22 namespace Media {
23 class Tag {
24 public:
25     /* -------------------- regular tag -------------------- */
26     static constexpr const char REGULAR_TRACK_ID[] = "track_index"; ///< track id
27     static constexpr const char REQUIRED_IN_BUFFER_CNT[] =
28         "max_input_buffer_count"; ///< required buffer count of plugin; read only tag
29     static constexpr const char REQUIRED_IN_BUFFER_SIZE[] =
30         "max_input_size"; ///< required buffer size of plugin; read only tag
31     static constexpr const char REQUIRED_OUT_BUFFER_CNT[] =
32         "max_output_buffer_count"; ///< required buffer count of plugin; read only tag
33     static constexpr const char REQUIRED_OUT_BUFFER_SIZE[] =
34         "regular.required.out.buffer.size"; ///< required buffer size of plugin; read only tag
35     static constexpr const char BUFFER_ALLOCATOR[] =
36         "regular.buffer.allocator";                                          ///< Allocator, allocator to alloc buffers
37     static constexpr const char BUFFERING_SIZE[] = "regular.buffering.size"; ///< download buffer size
38     static constexpr const char WATERLINE_HIGH[] = "regular.waterline.high"; ///< high waterline
39     static constexpr const char WATERLINE_LOW[] = "regular.waterline.low";   ///< low waterline
40     static constexpr const char SRC_INPUT_TYPE[] = "regular.src.input.type"; ///< SrcInputType
41     static constexpr const char APP_TOKEN_ID[] = "regular.app.token.id";     ///< app token id
42     static constexpr const char APP_FULL_TOKEN_ID[] = "regular.app.full.token.id"; ///< app full token id
43     static constexpr const char APP_UID[] = "regular.app.uid";                     ///< app uid
44     static constexpr const char APP_PID[] = "regular.app.pid";                     ///< app pid
45     static constexpr const char AUDIO_RENDER_INFO[] =
46         "regular.audio.render.info"; ///< AudioRenderInfo, audio render info
47     static constexpr const char AUDIO_INTERRUPT_MODE[] =
48         "regular.audio.interrupt.mode";                            ///< AudioInterruptMode, audio interrupt mode
49     static constexpr const char VIDEO_SCALE_TYPE[] = "scale_type"; ///< VideoScaleType, video scale type
50     static constexpr const char INPUT_MEMORY_TYPE[] = "regular.input.memory.type";   ///< MemoryType
51     static constexpr const char OUTPUT_MEMORY_TYPE[] = "regular.output.memory.type"; ///< MemoryType
52     static constexpr const char PROCESS_NAME[] = "process_name";                     ///< string, process name
53     static constexpr const char AUDIO_RENDER_SET_FLAG[] =
54         "regular.audio.render.set.flag"; ///< bool, audio render set flag
55     /* -------------------- media tag -------------------- */
56     static constexpr const char MIME_TYPE[] = "codec_mime";            ///< @see MimeType
57     static constexpr const char MEDIA_CODEC_NAME[] = "codec_name";     ///< codec name
58     static constexpr const char MEDIA_TITLE[] = "title";               ///< title
59     static constexpr const char MEDIA_ARTIST[] = "artist";             ///< artist
60     static constexpr const char MEDIA_LYRICIST[] = "media.lyricist";   ///< lyricist
61     static constexpr const char MEDIA_ALBUM[] = "album";               ///< album
62     static constexpr const char MEDIA_ALBUM_ARTIST[] = "album_artist"; ///< album artist
63     static constexpr const char MEDIA_DATE[] = "date";                 ///< media date, format:YYYY-MM-DD
64     static constexpr const char MEDIA_COMMENT[] = "comment";           ///< comment
65     static constexpr const char MEDIA_GENRE[] = "genre";               ///< genre
66     static constexpr const char MEDIA_COPYRIGHT[] = "copyright";       ///< copyright
67     static constexpr const char MEDIA_LANGUAGE[] = "language";         ///< language
68     static constexpr const char MEDIA_DESCRIPTION[] = "description";   ///< description
69     static constexpr const char MEDIA_LYRICS[] = "lyrics";             ///< lyrics
70     static constexpr const char MEDIA_AUTHOR[] = "author";             ///< authoe
71     static constexpr const char MEDIA_COMPOSER[] = "composer";         ///< composer
72     static constexpr const char MEDIA_CREATION_TIME[] =
73         "creation_time"; ///< creation time, string as YYYY-MM-DD HH:MM:SS.XXX or now
74     static constexpr const char MEDIA_LATITUDE[] = "latitude";         ///< latitude, float
75     static constexpr const char MEDIA_LONGITUDE[] = "longitude";       ///< longitude, float
76     static constexpr const char MEDIA_DURATION[] = "duration";         ///< duration based on {@link HST_TIME_BASE}
77     static constexpr const char MEDIA_FILE_SIZE[] = "media.file.size"; ///< file size
78     static constexpr const char MEDIA_BITRATE[] = "bitrate";           ///< bite rate
79     static constexpr const char MEDIA_FILE_URI[] = "media.file.uri";   ///< file uri
80     static constexpr const char MEDIA_CODEC_CONFIG[] =
81         "codec_config"; ///< codec config. e.g. AudioSpecificConfig for mp4
82     static constexpr const char MEDIA_CODEC_MODE[] = "media.codec.mode"; ///< codec mode.
83     static constexpr const char MEDIA_POSITION[] = "media.position";     ///< The byte position within media stream/file
84     static constexpr const char MEDIA_START_TIME[] = "track_start_time"; ///< The start time of one track
85     static constexpr const char MEDIA_CONTAINER_START_TIME[] = "start_time"; ///< int64_t, The start time of container
86     static constexpr const char MEDIA_SEEKABLE[] = "media.seekable"; ///< enum Seekable: Seekable status of the media
87     static constexpr const char MEDIA_PLAYBACK_SPEED[] = "media.playback.speed"; ///< double, playback speed
88     static constexpr const char MEDIA_TYPE[] =
89         "track_type"; ///< enum MediaType: Audio Video Subtitle... int32_t, see {link @MediaTrackType}
90     static constexpr const char MEDIA_TRACK_COUNT[] = "track_count";           ///< track count in file
91     static constexpr const char MEDIA_FILE_TYPE[] = "file_type";               ///< @see FileType, track type
92     static constexpr const char MEDIA_STREAM_TYPE[] = "media.stream.type";     ///< stream type of track data
93     static constexpr const char MEDIA_HAS_VIDEO[] = "has_video";               ///< has video track in file
94     static constexpr const char MEDIA_HAS_AUDIO[] = "has_audio";               ///< has audio track in file
95     static constexpr const char MEDIA_HAS_SUBTITLE[] = "has_subtitle";         ///< has subtitle track in file
96     static constexpr const char MEDIA_HAS_TIMEDMETA[] = "has_timed_meta";      ///< has timed metadata track in file
97     static constexpr const char MEDIA_COVER[] = "cover";                       ///< cover in file
98     static constexpr const char MEDIA_PROTOCOL_TYPE[] = "media.protocol.type"; ///< Source protocol type
99     static constexpr const char MEDIA_PROFILE[] = "codec_profile";             ///< codec profile, Compatible 4.0
100     static constexpr const char MEDIA_LEVEL[] = "codec_level";                 ///< codec level, Compatible 4.0
101     static constexpr const char MEDIA_TIME_STAMP[] = "timeStamp";              ///< time stamp
102     static constexpr const char MEDIA_END_OF_STREAM[] = "endOfStream";         ///< end of stream
103     static constexpr const char MEDIA_AVAILABLE_BITRATES[] = "available_bitRates";         ///< available bit ates
104 
105     /* -------------------- buffer meta tag -------------------- */
106     static constexpr const char BUFFER_DECODING_TIMESTAMP[] = "decoding_timestamp";  ///< int64_t, decoding timestamp.
107     static constexpr const char BUFFER_DURATION[] = "buffer_duration";               ///< int64_t, buffer duration
108     static constexpr const char BUFFER_INDEX[] = "private_buffer_index";
109 
110     /* -------------------- timed metadata tag -------------------- */
111     static constexpr const char TIMED_METADATA_SRC_TRACK_MIME[] =
112         "timed_metadata_src_track_mime";   ///< source track mime of timed metadata
113     static constexpr const char TIMED_METADATA_SRC_TRACK[] =
114         "timed_metadata_track_id";   ///< source track of timed metadata
115     static constexpr const char TIMED_METADATA_KEY[] = "timed_metadata_key";         ///< key of timed metadata
116     static constexpr const char TIMED_METADATA_LOCALE[] = "locale_timed_metadata";   ///< locale of timed metadata
117     static constexpr const char TIMED_METADATA_SETUP[] = "setup_of_timed_metadata";  ///< set up info of timed metadata
118 
119     /* -------------------- audio universal tag -------------------- */
120     static constexpr const char AUDIO_CHANNEL_COUNT[] = "channel_count"; ///< audio channel count
121     static constexpr const char AUDIO_CHANNEL_LAYOUT[] =
122         "channel_layout";                                            ///< @see AudioChannelLayout, stream channel layout
123     static constexpr const char AUDIO_SAMPLE_RATE[] = "sample_rate"; ///< sample rate
124     static constexpr const char AUDIO_SAMPLE_FORMAT[] = "audio_sample_format";        ///< @see AudioSampleFormat
125     static constexpr const char AUDIO_RAW_SAMPLE_FORMAT[] = "audio.raw.sample.format";///< @see AudioSampleFormat
126     static constexpr const char AUDIO_SAMPLE_PER_FRAME[] = "audio_samples_per_frame"; ///< sample per frame
127     static constexpr const char AUDIO_OUTPUT_CHANNELS[] = "audio.output.channels";    ///< sink output channel num
128     static constexpr const char AUDIO_OUTPUT_CHANNEL_LAYOUT[] =
129         "audio.output.channel.layout"; ///< @see AudioChannelLayout, sink output channel layout
130     static constexpr const char AUDIO_COMPRESSION_LEVEL[] = "audio_compression_level";         ///< compression level
131     static constexpr const char AUDIO_MAX_INPUT_SIZE[] = "audio.max.input.size";         ///< max input size
132     static constexpr const char AUDIO_MAX_OUTPUT_SIZE[] = "audio.max.output.size";       ///< max output size
133     static constexpr const char AUDIO_BITS_PER_CODED_SAMPLE[] = "bits_per_coded_sample"; ///< bits per coded sample
134     static constexpr const char AUDIO_BITS_PER_RAW_SAMPLE[] = "bits_per_raw_sample"; ///< bits per raw sample
135 
136     /* -------------------- audio specific tag -------------------- */
137     static constexpr const char AUDIO_MPEG_VERSION[] = "audio.mpeg.version"; ///< mpeg version
138     static constexpr const char AUDIO_MPEG_LAYER[] = "audio.mpeg.layer";     ///< mpeg layer
139 
140     static constexpr const char AUDIO_AAC_PROFILE[] = "audio.aac.profile";             ///< @see AudioAacProfile
141     static constexpr const char AUDIO_AAC_LEVEL[] = "audio.aac.level";                 ///< acc level
142     static constexpr const char AUDIO_AAC_STREAM_FORMAT[] = "audio.aac.stream.format"; ///< @see AudioAacStreamFormat
143     static constexpr const char AUDIO_AAC_IS_ADTS[] = "aac_is_adts";                   ///< acc format is adts
144     static constexpr const char AUDIO_VIVID_METADATA[] = "audio.vivid.metadata";       ///< audio vivid metadata
145     static constexpr const char AUDIO_OBJECT_NUMBER[] = "audio.object.number";         ///< audio object number
146     static constexpr const char AUDIO_AAC_SBR[] = "sbr";                               ///< Key for aac sbr
147     static constexpr const char AUDIO_FLAC_COMPLIANCE_LEVEL[] = "compliance_level";    ///< Key for compliance level
148     static constexpr const char AUDIO_VORBIS_IDENTIFICATION_HEADER[] =
149         "identification_header";                                              ///< Key for vorbis identification header
150     static constexpr const char AUDIO_VORBIS_SETUP_HEADER[] = "setup_header"; ///< Key for vorbis setup header
151     static constexpr const char OH_MD_KEY_AUDIO_OBJECT_NUMBER[] =
152         "audio_object_number_key"; ///< Key for audio object number
153     static constexpr const char OH_MD_KEY_AUDIO_VIVID_METADATA[] =
154         "audio_vivid_metadata_key"; ///< Key for audio vivid metadata
155     static constexpr const char AUDIO_SOUNDBED_CHANNELS_NUMBER[] =
156         "audio.soundbed.channels.number"; ///< Key for audio soundbed channels number
157     static constexpr const char AUDIO_HOA_ORDER[] =
158         "audio.hoa.order"; ///< Key for audio hoa order
159     static constexpr const char AUDIO_ENCODE_PTS_MODE[] = "audio_encode_pts_mode";     ///< @see AudioEncodePtsMode
160     /* -------------------- video universal tag -------------------- */
161     static constexpr const char VIDEO_WIDTH[] = "width";                               ///< video width
162     static constexpr const char VIDEO_HEIGHT[] = "height";                             ///< video height
163     static constexpr const char VIDEO_PIXEL_FORMAT[] = "pixel_format";                 ///< @see VideoPixelFormat
164     static constexpr const char VIDEO_FRAME_RATE[] = "frame_rate";                     ///< video frame rate
165     static constexpr const char VIDEO_SURFACE[] = "video.surface";                     ///< @see class Surface
166     static constexpr const char VIDEO_MAX_SURFACE_NUM[] = "video.max.surface_num";     ///< max video surface num
167     static constexpr const char VIDEO_CAPTURE_RATE[] = "capture_rate";                 ///< double, video capture rate
168     static constexpr const char VIDEO_BIT_STREAM_FORMAT[] = "video.bit.stream.format"; ///< @see VideoBitStreamFormat
169     static constexpr const char VIDEO_ROTATION[] = "rotation_angle";                   ///< @see VideoRotation
170     static constexpr const char VIDEO_ORIENTATION_TYPE[] = "video_orientation_type";   ///< @see VideoOrientation
171     static constexpr const char VIDEO_COLOR_PRIMARIES[] = "color_primaries";           ///< @see ColorPrimary
172     static constexpr const char VIDEO_COLOR_TRC[] = "transfer_characteristics";        ///< @see TransferCharacteristic
173     static constexpr const char VIDEO_COLOR_MATRIX_COEFF[] = "matrix_coefficients";    ///< @see MatrixCoefficient
174     static constexpr const char VIDEO_COLOR_RANGE[] = "range_flag";                    ///< bool, video color range
175     static constexpr const char VIDEO_IS_HDR_VIVID[] = "video_is_hdr_vivid";           ///< bool, video is hdr vivid
176     static constexpr const char VIDEO_STRIDE[] = "stride";                             ///< int32_t, video stride
177     static constexpr const char VIDEO_DISPLAY_WIDTH[] = "display_width";            ///< int32_t, video display width
178     static constexpr const char VIDEO_DISPLAY_HEIGHT[] = "display_height";          ///< int32_t, video display height
179     static constexpr const char VIDEO_PIC_WIDTH[] = "video_picture_width";          ///< int32_t, video picture width
180     static constexpr const char VIDEO_PIC_HEIGHT[] = "video_picture_height";        ///< int32_t, video picture height
181     static constexpr const char VIDEO_SAR[] = "video_sar";                             ///< double, sample aspect ratio
182     static constexpr const char VIDEO_FRAME_RATE_ADAPTIVE_MODE[] =
183         "frame_rate_adaptive_mode";                            ///< bool, video is framerate adaptive mode
184     static constexpr const char VIDEO_DELAY[] = "video_delay"; ///< video delay
185     static constexpr const char VIDEO_I_FRAME_INTERVAL[] = "i_frame_interval"; ///< Key for the interval of key frame.
186     static constexpr const char VIDEO_REQUEST_I_FRAME[] =
187         "req_i_frame"; ///<  Key for the request a I-Frame immediately.
188     static constexpr const char VIDEO_ENCODE_BITRATE_MODE[] =
189         "video_encode_bitrate_mode"; ///<  Key for video encode bitrate mode, see {link @VideoEncodeBitrateMode}
190     static constexpr const char VIDEO_ENCODE_QUALITY[] =
191         "quality"; ///<  key for the desired encoding quality,  this key is only supported for encoders that are
192                    ///<  configured in constant quality mode
193     static constexpr const char VIDEO_ENCODER_ENABLE_TEMPORAL_SCALABILITY[] =
194         "video_encoder_enable_temporal_scalability"; ///< bool, key for enable the temporal scalability mode,
195                                                      ///< true is enabled, false otherwise. The default value is false.
196                                                      ///< This is an optional key that applies only to video encoder. It
197                                                      ///< is used in configure.
198     static constexpr const char VIDEO_ENCODER_TEMPORAL_GOP_SIZE[] =
199         "video_encoder_temporal_gop_size"; ///< int32_t, key for describing the temporal group of picture size, It takes
200                                            ///< effect only when temporal level scale is enable. This is an optional key
201                                            ///< that applies only to video encoder. It is used in configure.
202     static constexpr const char VIDEO_ENCODER_TEMPORAL_GOP_REFERENCE_MODE[] =
203         "video_encoder_temporal_gop_reference_mode"; ///< int32_t, key for describing the reference mode in temporal
204                                                      ///< group of picture, see enum {@link TemporalGopReferenceMode}.It
205                                                      ///< takes effect only when temporal level sacle is enabled. This
206                                                      ///< is an optional key that applies only to video encoder. It is
207                                                      ///< used in configure.
208     static constexpr const char VIDEO_ENCODER_LTR_FRAME_COUNT[] =
209         "video_encoder_ltr_frame_count"; ///< int32_t, key for describing the count of used long-term reference frames,
210                                        ///< must be within the supported range. To get supported range, you should query
211                                        ///< wthether the capability is supported. This is an optional key that applies
212                                        ///< only to video encoder. It is used in configure.
213     static constexpr const char VIDEO_ENCODER_ENABLE_PARAMS_FEEDBACK[] =
214         "video_encoder_enable_params_feedback"; ///< bool, key for describing enable statistics params feedback with
215                                                 ///< frame, This is an optional key that applies only to video encoder.
216                                                 ///< It is used in configure.
217     static constexpr const char VIDEO_ENCODER_PER_FRAME_MARK_LTR[] =
218         "video_encoder_per_frame_mark_ltr"; ///< bool, key for describing mark this frame as a long term reference
219                                             ///< frame, true is mark, false otherwise. It takes effect only when the
220                                             ///< count of used long term reference frames is configured. This is an
221                                             ///< optional key that applies only to video encoder input loop. It takes
222                                             ///< effect immediately.
223     static constexpr const char VIDEO_ENCODER_PER_FRAME_USE_LTR[] =
224         "video_encoder_per_frame_use_ltr"; ///< int32_t, key for describing the long term reference frame poc referenced
225                                            ///< by this frame. This is an optional key that applies only to video
226                                            ///< encoder input loop. It takes effect immediately.
227     static constexpr const char VIDEO_PER_FRAME_IS_LTR[] =
228         "video_per_frame_is_ltr"; ///< bool, key for indicating this frame is a long-term reference frame, true is LTR,
229                                   ///< false otherwise. This is an optional key that applies only to video encoder
230                                   ///< output loop. It indicates the attribute of the frame.
231     static constexpr const char VIDEO_PER_FRAME_IS_SKIP[] =
232         "video_per_frame_is_skip"; ///< bool, key for indicating all macroblocks in this frame are skipped, only to
233                                    ///< video encoder input loop. It indicates the attribute of the frame.
234     static constexpr const char VIDEO_PER_FRAME_POC[] =
235         "video_per_frame_poc"; ///< int32_t, key for describing the frame poc. This is an optional key that applies only
236                                ///< to video encoder output loop. It indicates the attribute of the frame.
237     static constexpr const char VIDEO_CROP_TOP[] =
238         "video_crop_top"; ///< int32_t, describing the top-coordinate (y) of the crop rectangle. This is the top-most
239                           ///< row included in the crop frame, where row indices start at 0.
240     static constexpr const char VIDEO_CROP_BOTTOM[] =
241         "video_crop_bottom"; ///< int32_t, describing the bottom-coordinate (y) of the crop rectangle. This is the
242                              ///< bottom-most row included in the crop frame, where row indices start at 0.
243     static constexpr const char VIDEO_CROP_LEFT[] =
244         "video_crop_left"; ///<  int32_t, describing the left-coordinate (x) of the crop rectangle. This is the
245                            ///<  left-most column included in the crop frame, where column indices start at 0.
246     static constexpr const char VIDEO_CROP_RIGHT[] =
247         "video_crop_right"; ///<  int32_t, describing the right-coordinate (x) of the crop rectangle. This is the
248                             ///<  right-most column included in the crop frame, where column indices start at 0.
249     static constexpr const char VIDEO_SLICE_HEIGHT[] =
250         "video_slice_height"; ///< int32_t, describing the plane height of a multi-planar (YUV) video buffer
251                               ///< layout. Slice height (or plane height/vertical stride) is the number of rows that
252                               ///< must be skipped to get from the top of the Y plane to the top of the U plane in the
253                               ///< buffer. In essence the offset of the U plane is sliceHeight * stride. The height
254                               ///< of the U/V planes can be calculated based on the color format, though it is generally
255                               ///< undefined and depends on the device and release.
256     static constexpr const char VIDEO_ENABLE_LOW_LATENCY[] =
257         "video_enable_low_latency"; ///< bool, key to enable the low latency mode, true is enabled, false
258                                     ///< otherwise. If enabled, the video encoder or video decoder doesn't hold input
259                                     ///< and output data more than required by the codec standards. This is an optional
260                                     ///< key that applies only to video encoder or video decoder. It is used in
261                                     ///< configure.
262     static constexpr const char VIDEO_ENCODER_QP_MAX[] =
263         "video_encoder_qp_max"; ///< int32_t, key for describing the maximum quantization parameter allowed for video
264                                 ///< encoder. It is used in configure/setparameter or takes effect immediately with the
265                                 ///< frame.
266     static constexpr const char VIDEO_ENCODER_QP_MIN[] =
267         "video_encoder_qp_min"; ///< int32_t, key for describing the minimum quantization parameter allowed for video
268                                 ///< encoder. It is used in configure/setparameter or takes effect immediately with the
269                                 ///< frame.
270     static constexpr const char VIDEO_ENCODER_QP_START[] =
271         "video_encoder_qp_start"; ///< int32_t, key for describing the start quantization parameter allowed for video
272                                   ///< encoder. This is an optional key that applies only to video encoder input loop.
273     static constexpr const char VIDEO_ENCODER_ENABLE_SURFACE_INPUT_CALLBACK[] =
274         "video_encoder_enable_surface_input_callback"; ///< bool, the associated value is an bool (true or false): true
275                                                        ///< is enabled, false is closed.
276     static constexpr const char VIDEO_DECODER_RATE_UPPER_LIMIT[] =
277         "video_decoder_rate_upper_limit"; ///< int32_t, key for upper rate limit of video decoder performance.
278     static constexpr const char VIDEO_BUFFER_CAN_DROP[] =
279         "video_buffer_can_drop"; ///< bool, key to describe that encoded video buffer can be dropped or not befor
280                                  ///< sent to decoder in video playing.
281     static constexpr const char VIDEO_ENCODER_FRAME_I_RATIO[] =
282         "video_encoder_frame_I_ratio"; ///< int32_t, key for describing the percent ratio of I macroblock num in all
283                                        ///< macroblock num of this frame. This is a part of a video encoder statistics
284                                        ///< export feature. This value is emitted from video encoder for a video frame.
285     static constexpr const char VIDEO_ENCODER_FRAME_MADI[] =
286         "video_encoder_frame_madi"; ///< int32_t, key for describing frame madi. This is a part of a video encoder
287                                     ///< statistic sexport feature. This value is emitted from video encoder for a video
288                                     ///< frame.
289     static constexpr const char VIDEO_ENCODER_FRAME_MADP[] =
290         "video_encoder_frame_madp"; ///< int32_t, key for describing frame madp. This is a part of a video encoder
291                                     ///< statistics export feature. This value is emitted from video encoder for a video
292                                     ///< frame.
293     static constexpr const char VIDEO_ENCODER_SUM_MADI[] =
294         "video_encoder_sum_madi"; ///< int32_t, key for describing the sum of the previous 10 frame madi. This is a part
295                                   ///< of a video encoder statistics export feature. This value is emitted from video
296                                   ///< encoder for a video frame.
297     static constexpr const char VIDEO_ENCODER_REAL_BITRATE[] =
298         "video_encoder_real_bit_rate"; ///< int32_t, key for describing the real bit rate. This is a part of a video
299                                        ///< encoder statistics export feature. This value is emitted from video
300                                        ///< encoder for a video frame.
301     static constexpr const char VIDEO_ENCODER_FRAME_QP[] =
302         "video_encoder_frame_qp"; ///< int32_t, key for describing frame qp. This is a part of a video encoder
303                                   ///< statistics export feature. This value is emitted from video encoder for
304                                   ///< a video frame.
305     static constexpr const char VIDEO_ENCODER_QP_AVERAGE[] =
306         "video_encoder_qp_average"; ///< int32_t, key for describing the video frame averge quantization parameter.
307                                     ///< This is a part of a video encoder statistics export feature. This value is
308                                     ///< emitted from video encoder for a video frame.
309     static constexpr const char VIDEO_ENCODER_MSE[] =
310         "video_encoder_mse"; ///< double, key for describing video frame mean squared error. This is a part of a video
311                              ///< encoder statistics export feature. This value is emitted from video encoder for a
312                              ///< video frame.
313     static constexpr const char VIDEO_ENCODER_PER_FRAME_DISCARD[] =
314         "video_encoder_per_frame_discard"; ///< bool, key for describing whether the current frame is not encoded.
315     static constexpr const char VIDEO_ENCODER_ENABLE_WATERMARK[] =
316         "video_encoder_enable_watermark"; ///< bool, key for enable the watermark image ability, To query supported,
317                                           ///< you should use the interface {@link GetCapability} of class
318                                           ///< AVCodecList. This is an optional key that applies only to video
319                                           ///< encoder. It is used in configure.
320     static constexpr const char VIDEO_COORDINATE_X[] =
321         "video_coordinate_x"; ///< int32_t, key for describing the x-coordinate of the watermark image.
322     static constexpr const char VIDEO_COORDINATE_Y[] =
323         "video_coordinate_y"; ///< int32_t, key for describing the y-coordinate of the watermark image.
324     static constexpr const char VIDEO_COORDINATE_W[] =
325         "video_coordinate_w"; ///< int32_t, key for describing the w-coordinate of the watermark image.
326     static constexpr const char VIDEO_COORDINATE_H[] =
327         "video_coordinate_h"; ///< int32_t, key for describing the h-coordinate of the watermark image.
328     static constexpr const char VIDEO_ENCODER_REPEAT_PREVIOUS_FRAME_AFTER[] =
329         "video_encoder_repeat_previous_frame_after"; ///< int32_t, key for describing applies only when configuring a
330                                                      ///< video encoder in surface mode. The time in microseconds after
331                                                      ///< which the frame previously submitted to the encoder will be
332                                                      ///< repeated (once) if no new frame became available since. It is
333                                                      ///< used in configure.
334     static constexpr const char VIDEO_ENCODER_REPEAT_PREVIOUS_MAX_COUNT[] =
335         "video_encoder_repeat_previous_max_count"; ///< int32_t, key for describing the frame previously
336                                                    ///< submitted to the encoder will be repeated (once) maximum count
337                                                    ///< if no new frame became available since. This key takes effect
338                                                    ///< only when {@link VIDEO_ENCODER_REPEAT_PREVIOUS_FRAME_AFTER} is
339                                                    ///< vaild. It is used in configure.
340     static constexpr const char VIDEO_DECODER_OUTPUT_COLOR_SPACE[] =
341         "video_decoder_output_colorspace"; ///< int32_t, Key for video color space of the video decoder output.
342                                            ///< See {@link OH_NativeBuffer_ColorSpace} for value, and only
343                                            ///< {@link OH_COLORSPACE_BT709_LIMIT} is valid. It is used in configure.
344     static constexpr const char VIDEO_ENCODER_FRAME_TEMPORAL_ID[] =
345         "video_encoder_frame_temporal_id"; ///< int32_t, key for describing the temporal ID of the frame when SVC is
346                                            ///< enabled. This value is emitted from video encoder for a video frame.
347     static constexpr const char VIDEO_DECODER_DESIRED_PRESENT_TIMESTAMP[] =
348         "video_decoder_desired_present_timestamp"; ///< int64_t, key for describing the desired present timestamp of
349                                                    ///< video decoder frame set by the caller. This is an optional key
350                                                    ///< that applies only to video decoder surface mode.
351     static constexpr const char VIDEO_ENCODER_MAX_BITRATE[] = "max_bitrate"; ///< int64_t, Key for max bitrate
352     static constexpr const char VIDEO_ENCODER_SQR_FACTOR[] =
353         "sqr_factor"; ///< uint32_t, key for the desired encoding quality,
354                       ///< this key is only supported for encoders that
355                       ///< are configured in stable quality rate control mode.
356     /* -------------------- video specific tag -------------------- */
357     static constexpr const char VIDEO_H264_PROFILE[] = "video.h264.profile"; ///< @see VideoH264Profile
358     static constexpr const char VIDEO_H264_LEVEL[] = "video.h264.level";     ///< h264 level
359     static constexpr const char VIDEO_H265_PROFILE[] = "video.h265.profile"; ///< @see HEVCProfile
360     static constexpr const char VIDEO_H265_LEVEL[] = "video.h265.level";     ///< @see HEVCLevel
361     static constexpr const char VIDEO_CHROMA_LOCATION[] = "chroma_location"; ///< @see ChromaLocation
362 
363     /* -------------------- user specific tag -------------------- */
364     static constexpr const char USER_FRAME_PTS[] = "user.frame.pts"; ///< The user frame pts
365     static constexpr const char USER_TIME_SYNC_RESULT[] =
366         "user.time.sync.result"; ///< std::string : The time sync result
367     static constexpr const char USER_AV_SYNC_GROUP_INFO[] =
368         "user.av.sync.group.info"; ///< std::string : The av sync group info
369     static constexpr const char USER_SHARED_MEMORY_FD[] =
370         "user.shared.memory.fd";                                               ///< std::string : The shared memory fd
371     static constexpr const char USER_PUSH_DATA_TIME[] = "user.push.data.time"; ///< The user push data time
372 
373     /* -------------------- drm tag -------------------- */
374     static constexpr const char DRM_CENC_INFO[] = "drm_cenc_info"; ///< drm cenc info
375     static constexpr const char DRM_APP_NAME[] = "APP_NAME"; ///< drm app name
376     static constexpr const char DRM_INSTANCE_ID[] = "INSTANCE_ID"; ///< drm instance id
377     static constexpr const char DRM_DECRYPT_AVG_SIZE[] = "DECRYPT_AVG_SIZE"; ///< drm decrypt avg size
378     static constexpr const char DRM_DECRYPT_AVG_DURATION[] = "DECRYPT_AVG_DURATION"; ///< drm decrypt avg duration
379     static constexpr const char DRM_DECRYPT_MAX_SIZE[] = "DECRYPT_MAX_SIZE"; ///< drm decrypt max size
380     static constexpr const char DRM_DECRYPT_MAX_DURATION[] = "DECRYPT_MAX_DURATION"; ///< drm decrypt max duration
381     static constexpr const char DRM_DECRYPT_TIMES[] = "DECRYPT_TIMES"; ///< drm decrypt times
382     static constexpr const char DRM_ERROR_CODE[] = "ERROR_CODE"; ///< drm error code
383     static constexpr const char DRM_ERROR_MESG[] = "ERROR_MESG"; ///< drm error message
384 
385     /* -------------------- avcapability tag -------------------- */
386     static constexpr const char FEATURE_PROPERTY_VIDEO_ENCODER_MAX_LTR_FRAME_COUNT[] =
387         "feature_property_video_encoder_max_ltr_frame_count"; ///< int32_t, the key for querying the maximum long
388                                                             ///< term reference count
389 
390     /* -------------------- AVCodec tag -------------------- */
391     // Pid is int32_t and process name is string, to describe AVCodec's forward caller info.
392     // For example, camera recording, forward caller is camera.
393     static constexpr const char AV_CODEC_FORWARD_CALLER_PID[]           = "av_codec_forward_caller_pid";
394     static constexpr const char AV_CODEC_FORWARD_CALLER_UID[]           = "av_codec_forward_caller_uid";
395     static constexpr const char AV_CODEC_FORWARD_CALLER_PROCESS_NAME[]  = "av_codec_forward_caller_process_name";
396 
397     // Pid is int32_t and process name is string, to describe AVCodec's caller info.
398     // For example, camera recording, caller is media_service.
399     static constexpr const char AV_CODEC_CALLER_PID[]                   = "av_codec_caller_pid";
400     static constexpr const char AV_CODEC_CALLER_UID[]                   = "av_codec_caller_uid";
401     static constexpr const char AV_CODEC_CALLER_PROCESS_NAME[]          = "av_codec_caller_process_name";
402 /* -------------------- screen captrue tag -------------------- */
403     static constexpr const char SCREEN_CAPTURE_ERR_CODE[] = "errCode";
404     static constexpr const char SCREEN_CAPTURE_ERR_MSG[] = "errMsg";
405     static constexpr const char SCREEN_CAPTURE_DURATION[] = "captureDuration";
406     static constexpr const char SCREEN_CAPTURE_AV_TYPE[] = "avType";
407     static constexpr const char SCREEN_CAPTURE_DATA_TYPE[] = "dataType";
408     static constexpr const char SCREEN_CAPTURE_USER_AGREE[] = "userAgree";
409     static constexpr const char SCREEN_CAPTURE_REQURE_MIC[] = "requireMic";
410     static constexpr const char SCREEN_CAPTURE_ENABLE_MIC[] = "enableMic";
411     static constexpr const char SCREEN_CAPTURE_VIDEO_RESOLUTION[] = "videoResolution";
412     static constexpr const char SCREEN_CAPTURE_STOP_REASON[] = "stopReason";
413     static constexpr const char SCREEN_CAPTURE_START_LATENCY[] = "startLatency";
414 
415 /* -------------------- recorder tag -------------------- */
416     static constexpr const char RECORDER_ERR_CODE[] = "errCode";
417     static constexpr const char RECORDER_ERR_MSG[] = "errMsg";
418     static constexpr const char RECORDER_DURATION[] = "recordDuration";
419     static constexpr const char RECORDER_CONTAINER_MIME[] = "containerMime";
420     static constexpr const char RECORDER_VIDEO_MIME[] = "videoMime";
421     static constexpr const char RECORDER_VIDEO_RESOLUTION[] = "videoResolution";
422     static constexpr const char RECORDER_VIDEO_BITRATE[] = "videoBitrate";
423     static constexpr const char RECORDER_HDR_TYPE[] = "hdrType";
424     static constexpr const char RECORDER_AUDIO_MIME[] = "audioMime";
425     static constexpr const char RECORDER_AUDIO_SAMPLE_RATE[] = "audioSampleRate";
426     static constexpr const char RECORDER_AUDIO_CHANNEL_COUNT[] = "audioChannelCount";
427     static constexpr const char RECORDER_AUDIO_BITRATE[] = "audioBitrate";
428     static constexpr const char RECORDER_START_LATENCY[] = "startLatency";
429 
430     static constexpr const char SUBTITLE_TEXT[] = "subtitle_text";
431     static constexpr const char SUBTITLE_PTS[] = "subtitle_pts";
432     static constexpr const char SUBTITLE_DURATION[] = "subtitle_duration";
433 /* -------------------- av player tag -------------------- */
434     static constexpr const char AV_PLAYER_ERR_CODE[] = "av_player_errCode";
435     static constexpr const char AV_PLAYER_ERR_MSG[] = "av_player_errMsg";
436     static constexpr const char AV_PLAYER_PLAY_DURATION[] = "av_player_play_duration";
437     static constexpr const char AV_PLAYER_SOURCE_TYPE[] = "av_player_source_type";
438     static constexpr const char AV_PLAYER_AVG_DOWNLOAD_RATE[] = "av_player_avg_download_rate";
439     static constexpr const char AV_PLAYER_CONTAINER_MIME[] = "av_player_container_mime";
440     static constexpr const char AV_PLAYER_VIDEO_MIME[] = "av_player_video_mime";
441     static constexpr const char AV_PLAYER_VIDEO_RESOLUTION[] = "av_player_video_resolution";
442     static constexpr const char AV_PLAYER_VIDEO_FRAMERATE[] = "av_player_video_framerate";
443     static constexpr const char AV_PLAYER_VIDEO_BITDEPTH[] = "av_player_video_bitdepth";
444     static constexpr const char AV_PLAYER_VIDEO_BITRATE[] = "av_player_video_bitrate";
445     static constexpr const char AV_PLAYER_HDR_TYPE[] = "av_player_hdr_type";
446     static constexpr const char AV_PLAYER_AUDIO_MIME[] = "av_player_audio_mime";
447     static constexpr const char AV_PLAYER_AUDIO_BITRATE[] = "av_player_audio_bitrate";
448     static constexpr const char AV_PLAYER_IS_DRM_PROTECTED[] = "av_player_is_drm_protected";
449     static constexpr const char AV_PLAYER_START_LATENCY[] = "av_player_start_latency";
450     static constexpr const char AV_PLAYER_AVG_DOWNLOAD_SPEED[] = "av_player_avg_download_speed";
451     static constexpr const char AV_PLAYER_MAX_SEEK_LATENCY[] = "av_player_max_seek_latency";
452     static constexpr const char AV_PLAYER_MAX_ACCURATE_SEEK_LATENCY[] = "av_player_max_accurate_seek_latency";
453     static constexpr const char AV_PLAYER_LAG_TIMES[] = "av_player_lag_times";
454     static constexpr const char AV_PLAYER_MAX_LAG_DURATION[] = "av_player_max_lag_duration";
455     static constexpr const char AV_PLAYER_AVG_LAG_DURATION[] = "av_player_avg_lag_duration";
456     static constexpr const char AV_PLAYER_MAX_SURFACESWAP_LATENCY[] = "av_player_max_surfaceswap_latency";
457     static constexpr const char AV_PLAYER_DOWNLOAD_TOTAL_BITS[] = "av_player_total_download_bits";
458     static constexpr const char AV_PLAYER_DOWNLOAD_TIME_OUT[] = "av_player_download_time_out";
459 
460     static constexpr const char AV_PLAYER_SEI_PAYLOAD[] = "payload";
461     static constexpr const char AV_PLAYER_SEI_PAYLOAD_TYPE[] = "payloadType";
462     static constexpr const char AV_PLAYER_SEI_PLAYBACK_POSITION[] = "av_player_sei_playback_position";
463     static constexpr const char AV_PLAYER_SEI_PLAYBACK_GROUP[] = "av_player_sei_playback_group";
464 /* -------------------- av transcoder tag -------------------- */
465     static constexpr const char AV_TRANSCODER_ERR_CODE[] = "av_transcoder_errCode";
466     static constexpr const char AV_TRANSCODER_ERR_MSG[] = "av_transcoder_errMsg";
467     static constexpr const char AV_TRANSCODER_SOURCE_DURATION[] = "av_transcoder_source_duration";
468     static constexpr const char AV_TRANSCODER_TRANSCODER_DURATION[] = "av_transcoder_transcoder_duration";
469     static constexpr const char AV_TRANSCODER_SRC_FORMAT[] = "av_transcoder_src_format";
470     static constexpr const char AV_TRANSCODER_SRC_AUDIO_MIME[] = "av_transcoder_src_audio_mime";
471     static constexpr const char AV_TRANSCODER_SRC_VIDEO_MIME[] = "av_transcoder_src_video_mime";
472     static constexpr const char AV_TRANSCODER_SRC_VIDEO_FRAME_RATE[] = "av_transcoder_src_video_frame_rate";
473     static constexpr const char AV_TRANSCODER_SRC_VIDEO_BITRATE[] = "av_transcoder_src_video_bitrate";
474     static constexpr const char AV_TRANSCODER_SRC_HDR_TYPE[] = "av_transcoder_src_hdr_type";
475     static constexpr const char AV_TRANSCODER_SRC_AUDIO_SAMPLE_RATE[] = "av_transcoder_src_audio_sample_rate";
476     static constexpr const char AV_TRANSCODER_SRC_AUDIO_CHANNEL_COUNT[] = "av_transcoder_src_audio_channel_count";
477     static constexpr const char AV_TRANSCODER_SRC_AUDIO_BITRATE[] = "av_transcoder_src_audio_bitrate";
478     static constexpr const char AV_TRANSCODER_DST_FORMAT[] = "av_transcoder_dst_format";
479     static constexpr const char AV_TRANSCODER_DST_AUDIO_MIME[] = "av_transcoder_dst_audio_mime";
480     static constexpr const char AV_TRANSCODER_DST_VIDEO_MIME[] = "av_transcoder_dst_video_mime";
481     static constexpr const char AV_TRANSCODER_DST_VIDEO_FRAME_RATE[] = "av_transcoder_dst_video_frame_rate";
482     static constexpr const char AV_TRANSCODER_DST_VIDEO_BITRATE[] = "av_transcoder_dst_video_bitrate";
483     static constexpr const char AV_TRANSCODER_DST_HDR_TYPE[] = "av_transcoder_dst_hdr_type";
484     static constexpr const char AV_TRANSCODER_DST_AUDIO_SAMPLE_RATE[] = "av_transcoder_dst_audio_sample_rate";
485     static constexpr const char AV_TRANSCODER_DST_AUDIO_CHANNEL_COUNT[] = "av_transcoder_dst_audio_channel_count";
486     static constexpr const char AV_TRANSCODER_DST_AUDIO_BITRATE[] = "av_transcoder_dst_audio_bitrate";
487     static constexpr const char AV_TRANSCODER_VIDEO_DECODER_DURATION[] = "av_transcoder_video_decoder_duration";
488     static constexpr const char AV_TRANSCODER_VIDEO_ENCODER_DURATION[] = "av_transcoder_video_encoder_duration";
489     static constexpr const char AV_TRANSCODER_VIDEO_VPE_DURATION[] = "av_transcoder_video_vpe_duration";
490 /* -------------------- vrr tag -------------------- */
491     // int32_t, 1 is enabled, 0 is unabled
492     static constexpr const char VIDEO_DECODER_OUTPUT_ENABLE_VRR[] = "video_decoder_output_enable_vrr";
493 };
494 
495 using TagTypeCharSeq = const char *;
496 using TagType = std::string;
497 } // namespace Media
498 } // namespace OHOS
499 #endif // MEDIA_FOUNDATION_META_KEY_H
500