• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-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 #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_HAS_AUXILIARY[] = "has_auxiliary";       ///< has auxiliary track in file
98     static constexpr const char MEDIA_COVER[] = "cover";                       ///< cover in file
99     static constexpr const char MEDIA_PROTOCOL_TYPE[] = "media.protocol.type"; ///< Source protocol type
100     static constexpr const char MEDIA_PROFILE[] = "codec_profile";             ///< codec profile, Compatible 4.0
101     static constexpr const char MEDIA_LEVEL[] = "codec_level";                 ///< codec level, Compatible 4.0
102     static constexpr const char MEDIA_TIME_STAMP[] = "timeStamp";              ///< time stamp
103     static constexpr const char MEDIA_END_OF_STREAM[] = "endOfStream";         ///< end of stream
104     static constexpr const char MEDIA_AVAILABLE_BITRATES[] = "available_bitRates";         ///< available bit ates
105     static constexpr const char MEDIA_EDITLIST[] = "use_editlist";             ///< use edit list
106     static constexpr const char MEDIA_ENABLE_MOOV_FRONT[] = "fast_start";      ///< set moov in front
107     static constexpr const char MEDIA_AIGC[] = "aigc";                         ///< AIGC info
108 
109     /* -------------------- buffer meta tag -------------------- */
110     static constexpr const char BUFFER_DECODING_TIMESTAMP[] = "decoding_timestamp";  ///< int64_t, decoding timestamp.
111     static constexpr const char BUFFER_DURATION[] = "buffer_duration";               ///< int64_t, buffer duration
112     static constexpr const char BUFFER_INDEX[] = "private_buffer_index";
113 
114     /* -------------------- timed metadata tag -------------------- */
115     static constexpr const char TIMED_METADATA_SRC_TRACK_MIME[] =
116         "timed_metadata_src_track_mime";   ///< source track mime of timed metadata
117     static constexpr const char TIMED_METADATA_SRC_TRACK[] =
118         "timed_metadata_track_id";   ///< source track of timed metadata
119     static constexpr const char TIMED_METADATA_KEY[] = "timed_metadata_key";         ///< key of timed metadata
120     static constexpr const char TIMED_METADATA_LOCALE[] = "locale_timed_metadata";   ///< locale of timed metadata
121     static constexpr const char TIMED_METADATA_SETUP[] = "setup_of_timed_metadata";  ///< set up info of timed metadata
122 
123     /* -------------------- auxiliary track tag -------------------- */
124     static constexpr const char REFERENCE_TRACK_IDS[] = "reference_track_ids";
125     static constexpr const char TRACK_REFERENCE_TYPE[] = "track_reference_type";
126     static constexpr const char TRACK_DESCRIPTION[] = "track_description";
127 
128     /* -------------------- audio universal tag -------------------- */
129     static constexpr const char AUDIO_CHANNEL_COUNT[] = "channel_count"; ///< audio channel count
130     static constexpr const char AUDIO_CHANNEL_LAYOUT[] =
131         "channel_layout";                                            ///< @see AudioChannelLayout, stream channel layout
132     static constexpr const char AUDIO_SAMPLE_RATE[] = "sample_rate"; ///< sample rate
133     static constexpr const char AUDIO_SAMPLE_FORMAT[] = "audio_sample_format";        ///< @see AudioSampleFormat
134     static constexpr const char AUDIO_RAW_SAMPLE_FORMAT[] = "audio.raw.sample.format";///< @see AudioSampleFormat
135     static constexpr const char AUDIO_SAMPLE_PER_FRAME[] = "audio_samples_per_frame"; ///< sample per frame
136     static constexpr const char AUDIO_OUTPUT_CHANNELS[] = "audio.output.channels";    ///< sink output channel num
137     static constexpr const char AUDIO_OUTPUT_CHANNEL_LAYOUT[] =
138         "audio.output.channel.layout"; ///< @see AudioChannelLayout, sink output channel layout
139     static constexpr const char AUDIO_COMPRESSION_LEVEL[] = "audio_compression_level";         ///< compression level
140     static constexpr const char AUDIO_MAX_INPUT_SIZE[] = "audio.max.input.size";         ///< max input size
141     static constexpr const char AUDIO_MAX_OUTPUT_SIZE[] = "audio.max.output.size";       ///< max output size
142     static constexpr const char AUDIO_BITS_PER_CODED_SAMPLE[] = "bits_per_coded_sample"; ///< bits per coded sample
143     static constexpr const char AUDIO_BITS_PER_RAW_SAMPLE[] = "bits_per_raw_sample"; ///< bits per raw sample
144     static constexpr const char AUDIO_BITRATE_MODE[] = "audio_bitrate_mode"; ///< @see AudioEncodeBitrateMode
145     static constexpr const char AUDIO_L2HC_VERSION[] = "audio_l2hc_version"; ///< int32_t, L2HC algo version
146 
147     /* -------------------- audio specific tag -------------------- */
148     static constexpr const char AUDIO_MPEG_VERSION[] = "audio.mpeg.version"; ///< mpeg version
149     static constexpr const char AUDIO_MPEG_LAYER[] = "audio.mpeg.layer";     ///< mpeg layer
150 
151     static constexpr const char AUDIO_AAC_PROFILE[] = "audio.aac.profile";             ///< @see AudioAacProfile
152     static constexpr const char AUDIO_AAC_LEVEL[] = "audio.aac.level";                 ///< acc level
153     static constexpr const char AUDIO_AAC_STREAM_FORMAT[] = "audio.aac.stream.format"; ///< @see AudioAacStreamFormat
154     static constexpr const char AUDIO_AAC_IS_ADTS[] = "aac_is_adts";                   ///< acc format is adts
155     static constexpr const char AUDIO_VIVID_METADATA[] = "audio.vivid.metadata";       ///< audio vivid metadata
156     static constexpr const char AUDIO_OBJECT_NUMBER[] = "audio.object.number";         ///< audio object number
157     static constexpr const char AUDIO_AAC_SBR[] = "sbr";                               ///< Key for aac sbr
158     static constexpr const char AUDIO_FLAC_COMPLIANCE_LEVEL[] = "compliance_level";    ///< Key for compliance level
159     static constexpr const char AUDIO_VORBIS_IDENTIFICATION_HEADER[] =
160         "identification_header";                                              ///< Key for vorbis identification header
161     static constexpr const char AUDIO_VORBIS_SETUP_HEADER[] = "setup_header"; ///< Key for vorbis setup header
162     static constexpr const char OH_MD_KEY_AUDIO_OBJECT_NUMBER[] =
163         "audio_object_number_key"; ///< Key for audio object number
164     static constexpr const char OH_MD_KEY_AUDIO_VIVID_METADATA[] =
165         "audio_vivid_metadata_key"; ///< Key for audio vivid metadata
166     static constexpr const char AUDIO_SOUNDBED_CHANNELS_NUMBER[] =
167         "audio.soundbed.channels.number"; ///< Key for audio soundbed channels number
168     static constexpr const char AUDIO_HOA_ORDER[] =
169         "audio.hoa.order"; ///< Key for audio hoa order
170     static constexpr const char AUDIO_ENCODE_PTS_MODE[] = "audio_encode_pts_mode";     ///< @see AudioEncodePtsMode
171     /* -------------------- video universal tag -------------------- */
172     static constexpr const char VIDEO_WIDTH[] = "width";                               ///< video width
173     static constexpr const char VIDEO_HEIGHT[] = "height";                             ///< video height
174     static constexpr const char VIDEO_PIXEL_FORMAT[] = "pixel_format";                 ///< @see VideoPixelFormat
175     static constexpr const char VIDEO_FRAME_RATE[] = "frame_rate";                     ///< video frame rate
176     static constexpr const char VIDEO_SURFACE[] = "video.surface";                     ///< @see class Surface
177     static constexpr const char VIDEO_MAX_SURFACE_NUM[] = "video.max.surface_num";     ///< max video surface num
178     static constexpr const char VIDEO_CAPTURE_RATE[] = "capture_rate";                 ///< double, video capture rate
179     static constexpr const char VIDEO_BIT_STREAM_FORMAT[] = "video.bit.stream.format"; ///< @see VideoBitStreamFormat
180     static constexpr const char VIDEO_ROTATION[] = "rotation_angle";                   ///< @see VideoRotation
181     static constexpr const char VIDEO_ORIENTATION_TYPE[] = "video_orientation_type";   ///< @see VideoOrientation
182     static constexpr const char VIDEO_COLOR_PRIMARIES[] = "color_primaries";           ///< @see ColorPrimary
183     static constexpr const char VIDEO_COLOR_TRC[] = "transfer_characteristics";        ///< @see TransferCharacteristic
184     static constexpr const char VIDEO_COLOR_MATRIX_COEFF[] = "matrix_coefficients";    ///< @see MatrixCoefficient
185     static constexpr const char VIDEO_COLOR_RANGE[] = "range_flag";                    ///< bool, video color range
186     static constexpr const char VIDEO_IS_HDR_VIVID[] = "video_is_hdr_vivid";           ///< bool, video is hdr vivid
187     static constexpr const char VIDEO_STRIDE[] = "stride";                             ///< int32_t, video stride
188     static constexpr const char VIDEO_DISPLAY_WIDTH[] = "display_width";            ///< int32_t, video display width
189     static constexpr const char VIDEO_DISPLAY_HEIGHT[] = "display_height";          ///< int32_t, video display height
190     static constexpr const char VIDEO_PIC_WIDTH[] = "video_picture_width";          ///< int32_t, video picture width
191     static constexpr const char VIDEO_PIC_HEIGHT[] = "video_picture_height";        ///< int32_t, video picture height
192     static constexpr const char VIDEO_SAR[] = "video_sar";                             ///< double, sample aspect ratio
193     static constexpr const char VIDEO_FRAME_RATE_ADAPTIVE_MODE[] =
194         "frame_rate_adaptive_mode";                            ///< bool, video is framerate adaptive mode
195     static constexpr const char VIDEO_DELAY[] = "video_delay"; ///< video delay
196     static constexpr const char VIDEO_I_FRAME_INTERVAL[] = "i_frame_interval"; ///< Key for the interval of key frame.
197     static constexpr const char VIDEO_REQUEST_I_FRAME[] =
198         "req_i_frame"; ///<  Key for the request a I-Frame immediately.
199     static constexpr const char VIDEO_ENCODE_BITRATE_MODE[] =
200         "video_encode_bitrate_mode"; ///<  Key for video encode bitrate mode, see {link @VideoEncodeBitrateMode}
201     static constexpr const char VIDEO_ENCODE_B_FRAME_GOP_MODE[] =
202         "video_encode_b_frame_gop_mode"; ///<  Key for video encode gop mode, see {link @VideoEncodeBFrameGopMode}
203     static constexpr const char VIDEO_ENCODE_SET_FRAME_PTS[] =
204         "video_encode_set_frame_pts"; ///<  Key for video encode set frame pts.
205     static constexpr const char VIDEO_SCENE_TYPE[] =
206         "video_scene_type"; ///<  Key for video encode carmera-recoder mode, see {link @VideoSceneType}
207     static constexpr const char VIDEO_ENCODER_ENABLE_B_FRAME[] =
208         "video_encoder_enable_b_frame"; ///<  bool,Key for video encode B-frame mode.
209     static constexpr const char VIDEO_ENCODER_MAX_B_FRAME[] =
210         "video_encoder_max_b_frame"; ///<  Key for video encode carmera-recoder mode, see {link @VideoSceneType}
211     static constexpr const char VIDEO_ENCODE_QUALITY[] =
212         "quality"; ///<  key for the desired encoding quality,  this key is only supported for encoders that are
213                    ///<  configured in constant quality mode
214     static constexpr const char VIDEO_ENCODER_ENABLE_TEMPORAL_SCALABILITY[] =
215         "video_encoder_enable_temporal_scalability"; ///< bool, key for enable the temporal scalability mode,
216                                                      ///< true is enabled, false otherwise. The default value is false.
217                                                      ///< This is an optional key that applies only to video encoder. It
218                                                      ///< is used in configure.
219     static constexpr const char VIDEO_ENCODER_TEMPORAL_GOP_SIZE[] =
220         "video_encoder_temporal_gop_size"; ///< int32_t, key for describing the temporal group of picture size, It takes
221                                            ///< effect only when temporal level scale is enable. This is an optional key
222                                            ///< that applies only to video encoder. It is used in configure.
223     static constexpr const char VIDEO_ENCODER_TEMPORAL_GOP_REFERENCE_MODE[] =
224         "video_encoder_temporal_gop_reference_mode"; ///< int32_t, key for describing the reference mode in temporal
225                                                      ///< group of picture, see enum {@link TemporalGopReferenceMode}.It
226                                                      ///< takes effect only when temporal level sacle is enabled. This
227                                                      ///< is an optional key that applies only to video encoder. It is
228                                                      ///< used in configure.
229     static constexpr const char VIDEO_ENCODER_LTR_FRAME_COUNT[] =
230         "video_encoder_ltr_frame_count"; ///< int32_t, key for describing the count of used long-term reference frames,
231                                        ///< must be within the supported range. To get supported range, you should query
232                                        ///< wthether the capability is supported. This is an optional key that applies
233                                        ///< only to video encoder. It is used in configure.
234     static constexpr const char VIDEO_ENCODER_ENABLE_PARAMS_FEEDBACK[] =
235         "video_encoder_enable_params_feedback"; ///< bool, key for describing enable statistics params feedback with
236                                                 ///< frame, This is an optional key that applies only to video encoder.
237                                                 ///< It is used in configure.
238     static constexpr const char VIDEO_ENCODER_PER_FRAME_MARK_LTR[] =
239         "video_encoder_per_frame_mark_ltr"; ///< bool, key for describing mark this frame as a long term reference
240                                             ///< frame, true is mark, false otherwise. It takes effect only when the
241                                             ///< count of used long term reference frames is configured. This is an
242                                             ///< optional key that applies only to video encoder input loop. It takes
243                                             ///< effect immediately.
244     static constexpr const char VIDEO_ENCODER_PER_FRAME_USE_LTR[] =
245         "video_encoder_per_frame_use_ltr"; ///< int32_t, key for describing the long term reference frame poc referenced
246                                            ///< by this frame. This is an optional key that applies only to video
247                                            ///< encoder input loop. It takes effect immediately.
248     static constexpr const char VIDEO_PER_FRAME_IS_LTR[] =
249         "video_per_frame_is_ltr"; ///< bool, key for indicating this frame is a long-term reference frame, true is LTR,
250                                   ///< false otherwise. This is an optional key that applies only to video encoder
251                                   ///< output loop. It indicates the attribute of the frame.
252     static constexpr const char VIDEO_PER_FRAME_IS_SKIP[] =
253         "video_per_frame_is_skip"; ///< bool, key for indicating all macroblocks in this frame are skipped, only to
254                                    ///< video encoder input loop. It indicates the attribute of the frame.
255     static constexpr const char VIDEO_PER_FRAME_POC[] =
256         "video_per_frame_poc"; ///< int32_t, key for describing the frame poc. This is an optional key that applies only
257                                ///< to video encoder output loop. It indicates the attribute of the frame.
258     static constexpr const char VIDEO_CROP_TOP[] =
259         "video_crop_top"; ///< int32_t, describing the top-coordinate (y) of the crop rectangle. This is the top-most
260                           ///< row included in the crop frame, where row indices start at 0.
261     static constexpr const char VIDEO_CROP_BOTTOM[] =
262         "video_crop_bottom"; ///< int32_t, describing the bottom-coordinate (y) of the crop rectangle. This is the
263                              ///< bottom-most row included in the crop frame, where row indices start at 0.
264     static constexpr const char VIDEO_CROP_LEFT[] =
265         "video_crop_left"; ///<  int32_t, describing the left-coordinate (x) of the crop rectangle. This is the
266                            ///<  left-most column included in the crop frame, where column indices start at 0.
267     static constexpr const char VIDEO_CROP_RIGHT[] =
268         "video_crop_right"; ///<  int32_t, describing the right-coordinate (x) of the crop rectangle. This is the
269                             ///<  right-most column included in the crop frame, where column indices start at 0.
270     static constexpr const char VIDEO_SLICE_HEIGHT[] =
271         "video_slice_height"; ///< int32_t, describing the plane height of a multi-planar (YUV) video buffer
272                               ///< layout. Slice height (or plane height/vertical stride) is the number of rows that
273                               ///< must be skipped to get from the top of the Y plane to the top of the U plane in the
274                               ///< buffer. In essence the offset of the U plane is sliceHeight * stride. The height
275                               ///< of the U/V planes can be calculated based on the color format, though it is generally
276                               ///< undefined and depends on the device and release.
277     static constexpr const char VIDEO_ENABLE_LOW_LATENCY[] =
278         "video_enable_low_latency"; ///< bool, key to enable the low latency mode, true is enabled, false
279                                     ///< otherwise. If enabled, the video encoder or video decoder doesn't hold input
280                                     ///< and output data more than required by the codec standards. This is an optional
281                                     ///< key that applies only to video encoder or video decoder. It is used in
282                                     ///< configure.
283     static constexpr const char VIDEO_ENCODER_QP_MAX[] =
284         "video_encoder_qp_max"; ///< int32_t, key for describing the maximum quantization parameter allowed for video
285                                 ///< encoder. It is used in configure/setparameter or takes effect immediately with the
286                                 ///< frame.
287     static constexpr const char VIDEO_ENCODER_QP_MIN[] =
288         "video_encoder_qp_min"; ///< int32_t, key for describing the minimum quantization parameter allowed for video
289                                 ///< encoder. It is used in configure/setparameter or takes effect immediately with the
290                                 ///< frame.
291     static constexpr const char VIDEO_ENCODER_QP_START[] =
292         "video_encoder_qp_start"; ///< int32_t, key for describing the start quantization parameter allowed for video
293                                   ///< encoder. This is an optional key that applies only to video encoder input loop.
294     static constexpr const char VIDEO_ENCODER_ROI_PARAMS[] =
295         "video_encoder_roi_params"; ///< string, key for video encoder roi params
296     static constexpr const char VIDEO_ENCODER_TARGET_QP[] =
297         "video_encoder_target_qp"; ///< int32_t, Key for video encoder target qp.
298     static constexpr const char VIDEO_ENCODER_OPERATING_RATE[] =
299         "video_encoder_operating_rate"; ///< double, Key for video encoder operating rate.
300     static constexpr const char VIDEO_ENCODER_ENABLE_SURFACE_INPUT_CALLBACK[] =
301         "video_encoder_enable_surface_input_callback"; ///< bool, the associated value is an bool (true or false): true
302                                                        ///< is enabled, false is closed.
303     static constexpr const char VIDEO_DECODER_RATE_UPPER_LIMIT[] =
304         "video_decoder_rate_upper_limit"; ///< int32_t, key for upper rate limit of video decoder performance.
305     static constexpr const char VIDEO_BUFFER_CAN_DROP[] =
306         "video_buffer_can_drop"; ///< bool, key to describe that encoded video buffer can be dropped or not befor
307                                  ///< sent to decoder in video playing.
308     static constexpr const char VIDEO_ENCODER_FRAME_I_RATIO[] =
309         "video_encoder_frame_I_ratio"; ///< int32_t, key for describing the percent ratio of I macroblock num in all
310                                        ///< macroblock num of this frame. This is a part of a video encoder statistics
311                                        ///< export feature. This value is emitted from video encoder for a video frame.
312     static constexpr const char VIDEO_ENCODER_FRAME_MADI[] =
313         "video_encoder_frame_madi"; ///< int32_t, key for describing frame madi. This is a part of a video encoder
314                                     ///< statistic sexport feature. This value is emitted from video encoder for a video
315                                     ///< frame.
316     static constexpr const char VIDEO_ENCODER_FRAME_MADP[] =
317         "video_encoder_frame_madp"; ///< int32_t, key for describing frame madp. This is a part of a video encoder
318                                     ///< statistics export feature. This value is emitted from video encoder for a video
319                                     ///< frame.
320     static constexpr const char VIDEO_ENCODER_SUM_MADI[] =
321         "video_encoder_sum_madi"; ///< int32_t, key for describing the sum of the previous 10 frame madi. This is a part
322                                   ///< of a video encoder statistics export feature. This value is emitted from video
323                                   ///< encoder for a video frame.
324     static constexpr const char VIDEO_ENCODER_REAL_BITRATE[] =
325         "video_encoder_real_bit_rate"; ///< int32_t, key for describing the real bit rate. This is a part of a video
326                                        ///< encoder statistics export feature. This value is emitted from video
327                                        ///< encoder for a video frame.
328     static constexpr const char VIDEO_ENCODER_FRAME_QP[] =
329         "video_encoder_frame_qp"; ///< int32_t, key for describing frame qp. This is a part of a video encoder
330                                   ///< statistics export feature. This value is emitted from video encoder for
331                                   ///< a video frame.
332     static constexpr const char VIDEO_ENCODER_QP_AVERAGE[] =
333         "video_encoder_qp_average"; ///< int32_t, key for describing the video frame averge quantization parameter.
334                                     ///< This is a part of a video encoder statistics export feature. This value is
335                                     ///< emitted from video encoder for a video frame.
336     static constexpr const char VIDEO_ENCODER_MSE[] =
337         "video_encoder_mse"; ///< double, key for describing video frame mean squared error. This is a part of a video
338                              ///< encoder statistics export feature. This value is emitted from video encoder for a
339                              ///< video frame.
340     static constexpr const char VIDEO_ENCODER_PER_FRAME_DISCARD[] =
341         "video_encoder_per_frame_discard"; ///< bool, key for describing whether the current frame is not encoded.
342     static constexpr const char VIDEO_ENCODER_ENABLE_WATERMARK[] =
343         "video_encoder_enable_watermark"; ///< bool, key for enable the watermark image ability, To query supported,
344                                           ///< you should use the interface {@link GetCapability} of class
345                                           ///< AVCodecList. This is an optional key that applies only to video
346                                           ///< encoder. It is used in configure.
347     static constexpr const char VIDEO_COORDINATE_X[] =
348         "video_coordinate_x"; ///< int32_t, key for describing the x-coordinate of the watermark image.
349     static constexpr const char VIDEO_COORDINATE_Y[] =
350         "video_coordinate_y"; ///< int32_t, key for describing the y-coordinate of the watermark image.
351     static constexpr const char VIDEO_COORDINATE_W[] =
352         "video_coordinate_w"; ///< int32_t, key for describing the w-coordinate of the watermark image.
353     static constexpr const char VIDEO_COORDINATE_H[] =
354         "video_coordinate_h"; ///< int32_t, key for describing the h-coordinate of the watermark image.
355     static constexpr const char VIDEO_ENCODER_REPEAT_PREVIOUS_FRAME_AFTER[] =
356         "video_encoder_repeat_previous_frame_after"; ///< int32_t, key for describing applies only when configuring a
357                                                      ///< video encoder in surface mode. The time in microseconds after
358                                                      ///< which the frame previously submitted to the encoder will be
359                                                      ///< repeated (once) if no new frame became available since. It is
360                                                      ///< used in configure.
361     static constexpr const char VIDEO_ENCODER_REPEAT_PREVIOUS_MAX_COUNT[] =
362         "video_encoder_repeat_previous_max_count"; ///< int32_t, key for describing the frame previously
363                                                    ///< submitted to the encoder will be repeated (once) maximum count
364                                                    ///< if no new frame became available since. This key takes effect
365                                                    ///< only when {@link VIDEO_ENCODER_REPEAT_PREVIOUS_FRAME_AFTER} is
366                                                    ///< vaild. It is used in configure.
367     static constexpr const char VIDEO_DECODER_OUTPUT_COLOR_SPACE[] =
368         "video_decoder_output_colorspace"; ///< int32_t, Key for video color space of the video decoder output.
369                                            ///< See {@link OH_NativeBuffer_ColorSpace} for value, and only
370                                            ///< {@link OH_COLORSPACE_BT709_LIMIT} is valid. It is used in configure.
371     static constexpr const char VIDEO_ENCODER_FRAME_TEMPORAL_ID[] =
372         "video_encoder_frame_temporal_id"; ///< int32_t, key for describing the temporal ID of the frame when SVC is
373                                            ///< enabled. This value is emitted from video encoder for a video frame.
374     static constexpr const char VIDEO_DECODER_DESIRED_PRESENT_TIMESTAMP[] =
375         "video_decoder_desired_present_timestamp"; ///< int64_t, key for describing the desired present timestamp of
376                                                    ///< video decoder frame set by the caller. This is an optional key
377                                                    ///< that applies only to video decoder surface mode.
378     static constexpr const char VIDEO_ENCODER_MAX_BITRATE[] = "max_bitrate"; ///< int64_t, Key for max bitrate
379     static constexpr const char VIDEO_ENCODER_SQR_FACTOR[] =
380         "sqr_factor"; ///< uint32_t, key for the desired encoding quality,
381                       ///< this key is only supported for encoders that
382                       ///< are configured in stable quality rate control mode.
383     static constexpr const char VIDEO_ENCODER_ENABLE_QP_MAP[] =
384         "video_encoder_enable_qp_map";  ///< bool, key for enable config frame qp map,
385                                         ///< true is enabled, false otherwise. The default value is false.
386                                         ///< This is an optional key that applies only to video encoder. It
387                                         ///< is used in configure.
388     static constexpr const char VIDEO_ENCODER_PER_FRAME_ABS_QP_MAP[] =
389         "video_encoder_frame_abs_block_qp";  ///< bool, Key for video encoder frame qp map type,
390                                              ///< true is abs qp, false is delta qp.
391                                              ///< The default value is false.
392     static constexpr const char VIDEO_ENCODER_PER_FRAME_QP_MAP[] =
393         "video_encoder_frame_block_qp"; ///< vector<uint8_t>, Key for video encoder frame qp map.
394 
395     static constexpr const char VIDEO_ENCODER_ENABLE_PTS_BASED_RATECONTROL[] =
396         "video_encoder_enable_pts_based_ratecontrol"; ///< int32_t, Key to enable Bitrate Control Based on
397                                                       ///< Presentation Time Stamp(PTS). This is an optional key that
398                                                       ///< applies only to video encoder, default is 0.
399                                                       ///< It is used in configure.
400     static constexpr const char VIDEO_DECODER_BLANK_FRAME_ON_SHUTDOWN[] =
401         "video_decoder_blank_frame_on_shutdown"; ///< bool, Key for specifying whether to output a blank frame
402                                                  ///< during video decoder shutdown. This is an optional key,
403                                                  ///< only used when configuring a video decoder in surface mode.
404                                                  ///< By default, this feature is disabled (0).
405     /* -------------------- video specific tag -------------------- */
406     static constexpr const char VIDEO_H264_PROFILE[] = "video.h264.profile"; ///< @see VideoH264Profile
407     static constexpr const char VIDEO_H264_LEVEL[] = "video.h264.level";     ///< h264 level
408     static constexpr const char VIDEO_H265_PROFILE[] = "video.h265.profile"; ///< @see HEVCProfile
409     static constexpr const char VIDEO_H265_LEVEL[] = "video.h265.level";     ///< @see HEVCLevel
410     static constexpr const char VIDEO_CHROMA_LOCATION[] = "chroma_location"; ///< @see ChromaLocation
411 
412     /* -------------------- user specific tag -------------------- */
413     static constexpr const char USER_FRAME_PTS[] = "user.frame.pts"; ///< The user frame pts
414     static constexpr const char USER_TIME_SYNC_RESULT[] =
415         "user.time.sync.result"; ///< std::string : The time sync result
416     static constexpr const char USER_AV_SYNC_GROUP_INFO[] =
417         "user.av.sync.group.info"; ///< std::string : The av sync group info
418     static constexpr const char USER_SHARED_MEMORY_FD[] =
419         "user.shared.memory.fd";                                               ///< std::string : The shared memory fd
420     static constexpr const char USER_PUSH_DATA_TIME[] = "user.push.data.time"; ///< The user push data time
421 
422     /* -------------------- drm tag -------------------- */
423     static constexpr const char DRM_CENC_INFO[] = "drm_cenc_info"; ///< drm cenc info
424     static constexpr const char DRM_APP_NAME[] = "APP_NAME"; ///< drm app name
425     static constexpr const char DRM_INSTANCE_ID[] = "INSTANCE_ID"; ///< drm instance id
426     static constexpr const char DRM_DECRYPT_AVG_SIZE[] = "DECRYPT_AVG_SIZE"; ///< drm decrypt avg size
427     static constexpr const char DRM_DECRYPT_AVG_DURATION[] = "DECRYPT_AVG_DURATION"; ///< drm decrypt avg duration
428     static constexpr const char DRM_DECRYPT_MAX_SIZE[] = "DECRYPT_MAX_SIZE"; ///< drm decrypt max size
429     static constexpr const char DRM_DECRYPT_MAX_DURATION[] = "DECRYPT_MAX_DURATION"; ///< drm decrypt max duration
430     static constexpr const char DRM_DECRYPT_TIMES[] = "DECRYPT_TIMES"; ///< drm decrypt times
431     static constexpr const char DRM_ERROR_CODE[] = "ERROR_CODE"; ///< drm error code
432     static constexpr const char DRM_ERROR_MESG[] = "ERROR_MESG"; ///< drm error message
433 
434     /* -------------------- avcapability tag -------------------- */
435     static constexpr const char FEATURE_PROPERTY_VIDEO_ENCODER_MAX_LTR_FRAME_COUNT[] =
436         "feature_property_video_encoder_max_ltr_frame_count"; ///< int32_t, the key for querying the maximum long
437                                                             ///< term reference count
438 
439     /* -------------------- AVCodec tag -------------------- */
440     // Pid is int32_t and process name is string, to describe AVCodec's forward caller info.
441     // For example, camera recording, forward caller is camera.
442     static constexpr const char AV_CODEC_FORWARD_CALLER_PID[]           = "av_codec_forward_caller_pid";
443     static constexpr const char AV_CODEC_FORWARD_CALLER_UID[]           = "av_codec_forward_caller_uid";
444     static constexpr const char AV_CODEC_FORWARD_CALLER_PROCESS_NAME[]  = "av_codec_forward_caller_process_name";
445 
446     // Pid is int32_t and process name is string, to describe AVCodec's caller info.
447     // For example, camera recording, caller is media_service.
448     static constexpr const char AV_CODEC_CALLER_PID[]                   = "av_codec_caller_pid";
449     static constexpr const char AV_CODEC_CALLER_UID[]                   = "av_codec_caller_uid";
450     static constexpr const char AV_CODEC_CALLER_PROCESS_NAME[]          = "av_codec_caller_process_name";
451     ///bool, Key for codec sync mode
452     static constexpr const char AV_CODEC_ENABLE_SYNC_MODE[] = "enable_sync_mode";
453 
454 /* -------------------- screen captrue tag -------------------- */
455     static constexpr const char SCREEN_CAPTURE_ERR_CODE[] = "errCode";
456     static constexpr const char SCREEN_CAPTURE_ERR_MSG[] = "errMsg";
457     static constexpr const char SCREEN_CAPTURE_DURATION[] = "captureDuration";
458     static constexpr const char SCREEN_CAPTURE_AV_TYPE[] = "avType";
459     static constexpr const char SCREEN_CAPTURE_DATA_TYPE[] = "dataType";
460     static constexpr const char SCREEN_CAPTURE_USER_AGREE[] = "userAgree";
461     static constexpr const char SCREEN_CAPTURE_REQURE_MIC[] = "requireMic";
462     static constexpr const char SCREEN_CAPTURE_ENABLE_MIC[] = "enableMic";
463     static constexpr const char SCREEN_CAPTURE_VIDEO_RESOLUTION[] = "videoResolution";
464     static constexpr const char SCREEN_CAPTURE_STOP_REASON[] = "stopReason";
465     static constexpr const char SCREEN_CAPTURE_START_LATENCY[] = "startLatency";
466 
467 /* -------------------- recorder tag -------------------- */
468     static constexpr const char RECORDER_ERR_CODE[] = "errCode";
469     static constexpr const char RECORDER_ERR_MSG[] = "errMsg";
470     static constexpr const char RECORDER_DURATION[] = "recordDuration";
471     static constexpr const char RECORDER_CONTAINER_MIME[] = "containerMime";
472     static constexpr const char RECORDER_VIDEO_MIME[] = "videoMime";
473     static constexpr const char RECORDER_VIDEO_RESOLUTION[] = "videoResolution";
474     static constexpr const char RECORDER_VIDEO_BITRATE[] = "videoBitrate";
475     static constexpr const char RECORDER_HDR_TYPE[] = "hdrType";
476     static constexpr const char RECORDER_AUDIO_MIME[] = "audioMime";
477     static constexpr const char RECORDER_AUDIO_SAMPLE_RATE[] = "audioSampleRate";
478     static constexpr const char RECORDER_AUDIO_CHANNEL_COUNT[] = "audioChannelCount";
479     static constexpr const char RECORDER_AUDIO_BITRATE[] = "audioBitrate";
480     static constexpr const char RECORDER_START_LATENCY[] = "startLatency";
481 
482     static constexpr const char SUBTITLE_TEXT[] = "subtitle_text";
483     static constexpr const char SUBTITLE_PTS[] = "subtitle_pts";
484     static constexpr const char SUBTITLE_DURATION[] = "subtitle_duration";
485 /* -------------------- av player tag -------------------- */
486     static constexpr const char AV_PLAYER_ERR_CODE[] = "av_player_errCode";
487     static constexpr const char AV_PLAYER_ERR_MSG[] = "av_player_errMsg";
488     static constexpr const char AV_PLAYER_PLAY_DURATION[] = "av_player_play_duration";
489     static constexpr const char AV_PLAYER_SOURCE_TYPE[] = "av_player_source_type";
490     static constexpr const char AV_PLAYER_AVG_DOWNLOAD_RATE[] = "av_player_avg_download_rate";
491     static constexpr const char AV_PLAYER_CONTAINER_MIME[] = "av_player_container_mime";
492     static constexpr const char AV_PLAYER_VIDEO_MIME[] = "av_player_video_mime";
493     static constexpr const char AV_PLAYER_VIDEO_RESOLUTION[] = "av_player_video_resolution";
494     static constexpr const char AV_PLAYER_VIDEO_FRAMERATE[] = "av_player_video_framerate";
495     static constexpr const char AV_PLAYER_VIDEO_BITDEPTH[] = "av_player_video_bitdepth";
496     static constexpr const char AV_PLAYER_VIDEO_BITRATE[] = "av_player_video_bitrate";
497     static constexpr const char AV_PLAYER_HDR_TYPE[] = "av_player_hdr_type";
498     static constexpr const char AV_PLAYER_AUDIO_MIME[] = "av_player_audio_mime";
499     static constexpr const char AV_PLAYER_AUDIO_BITRATE[] = "av_player_audio_bitrate";
500     static constexpr const char AV_PLAYER_IS_DRM_PROTECTED[] = "av_player_is_drm_protected";
501     static constexpr const char AV_PLAYER_START_LATENCY[] = "av_player_start_latency";
502     static constexpr const char AV_PLAYER_AVG_DOWNLOAD_SPEED[] = "av_player_avg_download_speed";
503     static constexpr const char AV_PLAYER_MAX_SEEK_LATENCY[] = "av_player_max_seek_latency";
504     static constexpr const char AV_PLAYER_MAX_ACCURATE_SEEK_LATENCY[] = "av_player_max_accurate_seek_latency";
505     static constexpr const char AV_PLAYER_LAG_TIMES[] = "av_player_lag_times";
506     static constexpr const char AV_PLAYER_MAX_LAG_DURATION[] = "av_player_max_lag_duration";
507     static constexpr const char AV_PLAYER_AVG_LAG_DURATION[] = "av_player_avg_lag_duration";
508     static constexpr const char AV_PLAYER_MAX_SURFACESWAP_LATENCY[] = "av_player_max_surfaceswap_latency";
509     static constexpr const char AV_PLAYER_DOWNLOAD_TOTAL_BITS[] = "av_player_total_download_bits";
510     static constexpr const char AV_PLAYER_DOWNLOAD_TIME_OUT[] = "av_player_download_time_out";
511 
512     static constexpr const char AV_PLAYER_SEI_PAYLOAD[] = "payload";
513     static constexpr const char AV_PLAYER_SEI_PAYLOAD_TYPE[] = "payloadType";
514     static constexpr const char AV_PLAYER_SEI_PLAYBACK_POSITION[] = "av_player_sei_playback_position";
515     static constexpr const char AV_PLAYER_SEI_PLAYBACK_GROUP[] = "av_player_sei_playback_group";
516 /* -------------------- av transcoder tag -------------------- */
517     static constexpr const char AV_TRANSCODER_ERR_CODE[] = "av_transcoder_errCode";
518     static constexpr const char AV_TRANSCODER_ERR_MSG[] = "av_transcoder_errMsg";
519     static constexpr const char AV_TRANSCODER_SOURCE_DURATION[] = "av_transcoder_source_duration";
520     static constexpr const char AV_TRANSCODER_TRANSCODER_DURATION[] = "av_transcoder_transcoder_duration";
521     static constexpr const char AV_TRANSCODER_SRC_FORMAT[] = "av_transcoder_src_format";
522     static constexpr const char AV_TRANSCODER_SRC_AUDIO_MIME[] = "av_transcoder_src_audio_mime";
523     static constexpr const char AV_TRANSCODER_SRC_VIDEO_MIME[] = "av_transcoder_src_video_mime";
524     static constexpr const char AV_TRANSCODER_SRC_VIDEO_FRAME_RATE[] = "av_transcoder_src_video_frame_rate";
525     static constexpr const char AV_TRANSCODER_SRC_VIDEO_BITRATE[] = "av_transcoder_src_video_bitrate";
526     static constexpr const char AV_TRANSCODER_SRC_HDR_TYPE[] = "av_transcoder_src_hdr_type";
527     static constexpr const char AV_TRANSCODER_SRC_AUDIO_SAMPLE_RATE[] = "av_transcoder_src_audio_sample_rate";
528     static constexpr const char AV_TRANSCODER_SRC_AUDIO_CHANNEL_COUNT[] = "av_transcoder_src_audio_channel_count";
529     static constexpr const char AV_TRANSCODER_SRC_AUDIO_BITRATE[] = "av_transcoder_src_audio_bitrate";
530     static constexpr const char AV_TRANSCODER_DST_FORMAT[] = "av_transcoder_dst_format";
531     static constexpr const char AV_TRANSCODER_DST_AUDIO_MIME[] = "av_transcoder_dst_audio_mime";
532     static constexpr const char AV_TRANSCODER_DST_VIDEO_MIME[] = "av_transcoder_dst_video_mime";
533     static constexpr const char AV_TRANSCODER_DST_VIDEO_FRAME_RATE[] = "av_transcoder_dst_video_frame_rate";
534     static constexpr const char AV_TRANSCODER_DST_VIDEO_BITRATE[] = "av_transcoder_dst_video_bitrate";
535     static constexpr const char AV_TRANSCODER_DST_HDR_TYPE[] = "av_transcoder_dst_hdr_type";
536     static constexpr const char AV_TRANSCODER_DST_COLOR_SPACE[] = "av_transcoder_dst_color_space";
537     static constexpr const char AV_TRANSCODER_ENABLE_B_FRAME[] = "av_transcoder_enable_b_frame_encoding";
538     static constexpr const char AV_TRANSCODER_DST_AUDIO_SAMPLE_RATE[] = "av_transcoder_dst_audio_sample_rate";
539     static constexpr const char AV_TRANSCODER_DST_AUDIO_CHANNEL_COUNT[] = "av_transcoder_dst_audio_channel_count";
540     static constexpr const char AV_TRANSCODER_DST_AUDIO_BITRATE[] = "av_transcoder_dst_audio_bitrate";
541     static constexpr const char AV_TRANSCODER_VIDEO_DECODER_DURATION[] = "av_transcoder_video_decoder_duration";
542     static constexpr const char AV_TRANSCODER_VIDEO_ENCODER_DURATION[] = "av_transcoder_video_encoder_duration";
543     static constexpr const char AV_TRANSCODER_VIDEO_VPE_DURATION[] = "av_transcoder_video_vpe_duration";
544 /* -------------------- vrr tag -------------------- */
545     // int32_t, 1 is enabled, 0 is unabled
546     static constexpr const char VIDEO_DECODER_OUTPUT_ENABLE_VRR[] = "video_decoder_output_enable_vrr";
547 /* ----------------- input err tag ----------------- */
548     static constexpr const char VIDEO_DECODER_INPUT_STREAM_ERROR[] = "video_decoder_input_stream_error";
549 };
550 
551 using TagTypeCharSeq = const char *;
552 using TagType = std::string;
553 } // namespace Media
554 } // namespace OHOS
555 #endif // MEDIA_FOUNDATION_META_KEY_H
556