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 
109     /* -------------------- timed metadata tag -------------------- */
110     static constexpr const char TIMED_METADATA_SRC_TRACK_MIME[] =
111         "timed_metadata_src_track_mime";   ///< source track mime of timed metadata
112     static constexpr const char TIMED_METADATA_SRC_TRACK[] =
113         "timed_metadata_track_id";   ///< source track of timed metadata
114     static constexpr const char TIMED_METADATA_KEY[] = "timed_metadata_key";         ///< key of timed metadata
115     static constexpr const char TIMED_METADATA_LOCALE[] = "locale_timed_metadata";   ///< locale of timed metadata
116     static constexpr const char TIMED_METADATA_SETUP[] = "setup_of_timed_metadata";  ///< set up info of timed metadata
117 
118     /* -------------------- audio universal tag -------------------- */
119     static constexpr const char AUDIO_CHANNEL_COUNT[] = "channel_count"; ///< audio channel count
120     static constexpr const char AUDIO_CHANNEL_LAYOUT[] =
121         "channel_layout";                                            ///< @see AudioChannelLayout, stream channel layout
122     static constexpr const char AUDIO_SAMPLE_RATE[] = "sample_rate"; ///< sample rate
123     static constexpr const char AUDIO_SAMPLE_FORMAT[] = "audio_sample_format";        ///< @see AudioSampleFormat
124     static constexpr const char AUDIO_SAMPLE_PER_FRAME[] = "audio_samples_per_frame"; ///< sample per frame
125     static constexpr const char AUDIO_OUTPUT_CHANNELS[] = "audio.output.channels";    ///< sink output channel num
126     static constexpr const char AUDIO_OUTPUT_CHANNEL_LAYOUT[] =
127         "audio.output.channel.layout"; ///< @see AudioChannelLayout, sink output channel layout
128     static constexpr const char AUDIO_COMPRESSION_LEVEL[] = "audio_compression_level";         ///< compression level
129     static constexpr const char AUDIO_MAX_INPUT_SIZE[] = "audio.max.input.size";         ///< max input size
130     static constexpr const char AUDIO_MAX_OUTPUT_SIZE[] = "audio.max.output.size";       ///< max output size
131     static constexpr const char AUDIO_BITS_PER_CODED_SAMPLE[] = "bits_per_coded_sample"; ///< bits per coded sample
132     static constexpr const char AUDIO_BITS_PER_RAW_SAMPLE[] = "bits_per_raw_sample"; ///< bits per raw sample
133 
134     /* -------------------- audio specific tag -------------------- */
135     static constexpr const char AUDIO_MPEG_VERSION[] = "audio.mpeg.version"; ///< mpeg version
136     static constexpr const char AUDIO_MPEG_LAYER[] = "audio.mpeg.layer";     ///< mpeg layer
137 
138     static constexpr const char AUDIO_AAC_PROFILE[] = "audio.aac.profile";             ///< @see AudioAacProfile
139     static constexpr const char AUDIO_AAC_LEVEL[] = "audio.aac.level";                 ///< acc level
140     static constexpr const char AUDIO_AAC_STREAM_FORMAT[] = "audio.aac.stream.format"; ///< @see AudioAacStreamFormat
141     static constexpr const char AUDIO_AAC_IS_ADTS[] = "aac_is_adts";                   ///< acc format is adts
142     static constexpr const char AUDIO_VIVID_METADATA[] = "audio.vivid.metadata";       ///< audio vivid metadata
143     static constexpr const char AUDIO_OBJECT_NUMBER[] = "audio.object.number";         ///< audio object number
144     static constexpr const char AUDIO_AAC_SBR[] = "sbr";                               ///< Key for aac sbr
145     static constexpr const char AUDIO_FLAC_COMPLIANCE_LEVEL[] = "compliance_level";    ///< Key for compliance level
146     static constexpr const char AUDIO_VORBIS_IDENTIFICATION_HEADER[] =
147         "identification_header";                                              ///< Key for vorbis identification header
148     static constexpr const char AUDIO_VORBIS_SETUP_HEADER[] = "setup_header"; ///< Key for vorbis setup header
149     static constexpr const char OH_MD_KEY_AUDIO_OBJECT_NUMBER[] =
150         "audio_object_number_key"; ///< Key for audio object number
151     static constexpr const char OH_MD_KEY_AUDIO_VIVID_METADATA[] =
152         "audio_vivid_metadata_key"; ///< Key for audio vivid metadata
153     static constexpr const char AUDIO_SOUNDBED_CHANNELS_NUMBER[] =
154         "audio.soundbed.channels.number"; ///< Key for audio soundbed channels number
155     static constexpr const char AUDIO_HOA_ORDER[] =
156         "audio.hoa.order"; ///< Key for audio hoa order
157     /* -------------------- video universal tag -------------------- */
158     static constexpr const char VIDEO_WIDTH[] = "width";                               ///< video width
159     static constexpr const char VIDEO_HEIGHT[] = "height";                             ///< video height
160     static constexpr const char VIDEO_PIXEL_FORMAT[] = "pixel_format";                 ///< @see VideoPixelFormat
161     static constexpr const char VIDEO_FRAME_RATE[] = "frame_rate";                     ///< video frame rate
162     static constexpr const char VIDEO_SURFACE[] = "video.surface";                     ///< @see class Surface
163     static constexpr const char VIDEO_MAX_SURFACE_NUM[] = "video.max.surface_num";     ///< max video surface num
164     static constexpr const char VIDEO_CAPTURE_RATE[] = "capture_rate";                 ///< double, video capture rate
165     static constexpr const char VIDEO_BIT_STREAM_FORMAT[] = "video.bit.stream.format"; ///< @see VideoBitStreamFormat
166     static constexpr const char VIDEO_ROTATION[] = "rotation_angle";                   ///< @see VideoRotation
167     static constexpr const char VIDEO_ORIENTATION_TYPE[] = "video_orientation_type";   ///< @see VideoOrientation
168     static constexpr const char VIDEO_COLOR_PRIMARIES[] = "color_primaries";           ///< @see ColorPrimary
169     static constexpr const char VIDEO_COLOR_TRC[] = "transfer_characteristics";        ///< @see TransferCharacteristic
170     static constexpr const char VIDEO_COLOR_MATRIX_COEFF[] = "matrix_coefficients";    ///< @see MatrixCoefficient
171     static constexpr const char VIDEO_COLOR_RANGE[] = "range_flag";                    ///< bool, video color range
172     static constexpr const char VIDEO_IS_HDR_VIVID[] = "video_is_hdr_vivid";           ///< bool, video is hdr vivid
173     static constexpr const char VIDEO_STRIDE[] = "stride";                             ///< int32_t, video stride
174     static constexpr const char VIDEO_DISPLAY_WIDTH[] = "display_width";            ///< int32_t, video display width
175     static constexpr const char VIDEO_DISPLAY_HEIGHT[] = "display_height";          ///< int32_t, video display height
176     static constexpr const char VIDEO_PIC_WIDTH[] = "video_picture_width";          ///< int32_t, video picture width
177     static constexpr const char VIDEO_PIC_HEIGHT[] = "video_picture_height";        ///< int32_t, video picture height
178     static constexpr const char VIDEO_SAR[] = "video_sar";                             ///< double, sample aspect ratio
179     static constexpr const char VIDEO_FRAME_RATE_ADAPTIVE_MODE[] =
180         "frame_rate_adaptive_mode";                            ///< bool, video is framerate adaptive mode
181     static constexpr const char VIDEO_DELAY[] = "video_delay"; ///< video delay
182     static constexpr const char VIDEO_I_FRAME_INTERVAL[] = "i_frame_interval"; ///< Key for the interval of key frame.
183     static constexpr const char VIDEO_REQUEST_I_FRAME[] =
184         "req_i_frame"; ///<  Key for the request a I-Frame immediately.
185     static constexpr const char VIDEO_ENCODE_BITRATE_MODE[] =
186         "video_encode_bitrate_mode"; ///<  Key for video encode bitrate mode, see {link @VideoEncodeBitrateMode}
187     static constexpr const char VIDEO_ENCODE_QUALITY[] =
188         "quality"; ///<  key for the desired encoding quality,  this key is only supported for encoders that are
189                    ///<  configured in constant quality mode
190     static constexpr const char VIDEO_ENCODER_ENABLE_TEMPORAL_SCALABILITY[] =
191         "video_encoder_enable_temporal_scalability"; ///< bool, key for enable the temporal scalability mode,
192                                                      ///< true is enabled, false otherwise. The default value is false.
193                                                      ///< This is an optional key that applies only to video encoder. It
194                                                      ///< is used in configure.
195     static constexpr const char VIDEO_ENCODER_TEMPORAL_GOP_SIZE[] =
196         "video_encoder_temporal_gop_size"; ///< int32_t, key for describing the temporal group of picture size, It takes
197                                            ///< effect only when temporal level scale is enable. This is an optional key
198                                            ///< that applies only to video encoder. It is used in configure.
199     static constexpr const char VIDEO_ENCODER_TEMPORAL_GOP_REFERENCE_MODE[] =
200         "video_encoder_temporal_gop_reference_mode"; ///< int32_t, key for describing the reference mode in temporal
201                                                      ///< group of picture, see enum {@link TemporalGopReferenceMode}.It
202                                                      ///< takes effect only when temporal level sacle is enabled. This
203                                                      ///< is an optional key that applies only to video encoder. It is
204                                                      ///< used in configure.
205     static constexpr const char VIDEO_ENCODER_LTR_FRAME_COUNT[] =
206         "video_encoder_ltr_frame_count"; ///< int32_t, key for describing the count of used long-term reference frames,
207                                        ///< must be within the supported range. To get supported range, you should query
208                                        ///< wthether the capability is supported. This is an optional key that applies
209                                        ///< only to video encoder. It is used in configure.
210     static constexpr const char VIDEO_ENCODER_ENABLE_PARAMS_FEEDBACK[] =
211         "video_encoder_enable_params_feedback"; ///< bool, key for describing enable statistics params feedback with
212                                                 ///< frame, This is an optional key that applies only to video encoder.
213                                                 ///< It is used in configure.
214     static constexpr const char VIDEO_ENCODER_PER_FRAME_MARK_LTR[] =
215         "video_encoder_per_frame_mark_ltr"; ///< bool, key for describing mark this frame as a long term reference
216                                             ///< frame, true is mark, false otherwise. It takes effect only when the
217                                             ///< count of used long term reference frames is configured. This is an
218                                             ///< optional key that applies only to video encoder input loop. It takes
219                                             ///< effect immediately.
220     static constexpr const char VIDEO_ENCODER_PER_FRAME_USE_LTR[] =
221         "video_encoder_per_frame_use_ltr"; ///< int32_t, key for describing the long term reference frame poc referenced
222                                            ///< by this frame. This is an optional key that applies only to video
223                                            ///< encoder input loop. It takes effect immediately.
224     static constexpr const char VIDEO_PER_FRAME_IS_LTR[] =
225         "video_per_frame_is_ltr"; ///< bool, key for indicating this frame is a long-term reference frame, true is LTR,
226                                   ///< false otherwise. This is an optional key that applies only to video encoder
227                                   ///< output loop. It indicates the attribute of the frame.
228     static constexpr const char VIDEO_PER_FRAME_IS_SKIP[] =
229         "video_per_frame_is_skip"; ///< bool, key for indicating all macroblocks in this frame are skipped, only to
230                                    ///< video encoder input loop. It indicates the attribute of the frame.
231     static constexpr const char VIDEO_PER_FRAME_POC[] =
232         "video_per_frame_poc"; ///< int32_t, key for describing the frame poc. This is an optional key that applies only
233                                ///< to video encoder output loop. It indicates the attribute of the frame.
234     static constexpr const char VIDEO_CROP_TOP[] =
235         "video_crop_top"; ///< int32_t, describing the top-coordinate (y) of the crop rectangle. This is the top-most
236                           ///< row included in the crop frame, where row indices start at 0.
237     static constexpr const char VIDEO_CROP_BOTTOM[] =
238         "video_crop_bottom"; ///< int32_t, describing the bottom-coordinate (y) of the crop rectangle. This is the
239                              ///< bottom-most row included in the crop frame, where row indices start at 0.
240     static constexpr const char VIDEO_CROP_LEFT[] =
241         "video_crop_left"; ///<  int32_t, describing the left-coordinate (x) of the crop rectangle. This is the
242                            ///<  left-most column included in the crop frame, where column indices start at 0.
243     static constexpr const char VIDEO_CROP_RIGHT[] =
244         "video_crop_right"; ///<  int32_t, describing the right-coordinate (x) of the crop rectangle. This is the
245                             ///<  right-most column included in the crop frame, where column indices start at 0.
246     static constexpr const char VIDEO_SLICE_HEIGHT[] =
247         "video_slice_height"; ///< int32_t, describing the plane height of a multi-planar (YUV) video buffer
248                               ///< layout. Slice height (or plane height/vertical stride) is the number of rows that
249                               ///< must be skipped to get from the top of the Y plane to the top of the U plane in the
250                               ///< buffer. In essence the offset of the U plane is sliceHeight * stride. The height
251                               ///< of the U/V planes can be calculated based on the color format, though it is generally
252                               ///< undefined and depends on the device and release.
253     static constexpr const char VIDEO_ENABLE_LOW_LATENCY[] =
254         "video_enable_low_latency"; ///< bool, key to enable the low latency mode, true is enabled, false
255                                     ///< otherwise. If enabled, the video encoder or video decoder doesn't hold input
256                                     ///< and output data more than required by the codec standards. This is an optional
257                                     ///< key that applies only to video encoder or video decoder. It is used in
258                                     ///< configure.
259     static constexpr const char VIDEO_ENCODER_QP_MAX[] =
260         "video_encoder_qp_max"; ///< int32_t, key for describing the maximum quantization parameter allowed for video
261                                 ///< encoder. It is used in configure/setparameter or takes effect immediately with the
262                                 ///< frame.
263     static constexpr const char VIDEO_ENCODER_QP_MIN[] =
264         "video_encoder_qp_min"; ///< int32_t, key for describing the minimum quantization parameter allowed for video
265                                 ///< encoder. It is used in configure/setparameter or takes effect immediately with the
266                                 ///< frame.
267     static constexpr const char VIDEO_ENCODER_QP_START[] =
268         "video_encoder_qp_start"; ///< int32_t, key for describing the start quantization parameter allowed for video
269                                   ///< encoder. This is an optional key that applies only to video encoder input loop.
270     static constexpr const char VIDEO_ENCODER_ENABLE_SURFACE_INPUT_CALLBACK[] =
271         "video_encoder_enable_surface_input_callback"; ///< bool, the associated value is an bool (true or false): true
272                                                        ///< is enabled, false is closed.
273     static constexpr const char VIDEO_DECODER_RATE_UPPER_LIMIT[] =
274         "video_decoder_rate_upper_limit"; ///< int32_t, key for upper rate limit of video decoder performance.
275     static constexpr const char VIDEO_BUFFER_CAN_DROP[] =
276         "video_buffer_can_drop"; ///< bool, key to describe that encoded video buffer can be dropped or not befor
277                                  ///< sent to decoder in video playing.
278     static constexpr const char VIDEO_ENCODER_QP_AVERAGE[] =
279         "video_encoder_qp_average"; ///< int32_t, key for describing the video frame averge quantization parameter.
280                                     ///< This is a part of a video encoder statistics export feature. This value is
281                                     ///< emitted from video encoder for a video frame.
282     static constexpr const char VIDEO_ENCODER_MSE[] =
283         "video_encoder_mse"; ///< double, key for describing video frame mean squared error. This is a part of a video
284                              ///< encoder statistics export feature. This value is emitted from video encoder for a
285                              ///< video frame.
286     static constexpr const char VIDEO_ENCODER_FRAME_TEMPORAL_ID[] =
287         "video_encoder_frame_temporal_id"; ///< int32_t, key for describing the temporal ID of the frame when SVC is
288                                            ///< enabled. This value is emitted from video encoder for a video frame.
289     static constexpr const char VIDEO_ENCODER_PER_FRAME_DISCARD[] =
290         "video_encoder_per_frame_discard"; ///< bool, key for describing whether the current frame is not encoded.
291     static constexpr const char VIDEO_ENCODER_ENABLE_WATERMARK[] =
292         "video_encoder_enable_watermark"; ///< bool, key for enable the watermark image ability, To query supported,
293                                           ///< you should use the interface {@link GetCapability} of class
294                                           ///< AVCodecList. This is an optional key that applies only to video
295                                           ///< encoder. It is used in configure.
296     static constexpr const char VIDEO_COORDINATE_X[] =
297         "video_coordinate_x"; ///< int32_t, key for describing the x-coordinate of the watermark image.
298     static constexpr const char VIDEO_COORDINATE_Y[] =
299         "video_coordinate_y"; ///< int32_t, key for describing the y-coordinate of the watermark image.
300     static constexpr const char VIDEO_COORDINATE_W[] =
301         "video_coordinate_w"; ///< int32_t, key for describing the w-coordinate of the watermark image.
302     static constexpr const char VIDEO_COORDINATE_H[] =
303         "video_coordinate_h"; ///< int32_t, key for describing the h-coordinate of the watermark image.
304     static constexpr const char VIDEO_ENCODER_REPEAT_PREVIOUS_FRAME_AFTER[] =
305         "video_encoder_repeat_previous_frame_after"; ///< int32_t, key for describing applies only when configuring a
306                                                      ///< video encoder in surface mode. The time in microseconds after
307                                                      ///< which the frame previously submitted to the encoder will be
308                                                      ///< repeated (once) if no new frame became available since. It is
309                                                      ///< used in configure.
310     static constexpr const char VIDEO_ENCODER_REPEAT_PREVIOUS_MAX_COUNT[] =
311         "video_encoder_repeat_previous_max_count"; ///< int32_t, key for describing the frame previously
312                                                    ///< submitted to the encoder will be repeated (once) maximum count
313                                                    ///< if no new frame became available since. This key takes effect
314                                                    ///< only when {@link VIDEO_ENCODER_REPEAT_PREVIOUS_FRAME_AFTER} is
315                                                    ///< vaild. It is used in configure.
316     static constexpr const char VIDEO_DECODER_OUTPUT_COLOR_SPACE[] =
317         "video_decoder_output_colorspace"; ///< int32_t, Key for video color space of the video decoder output.
318                                            ///< See {@link OH_NativeBuffer_ColorSpace} for value, and only
319                                            ///< {@link OH_COLORSPACE_BT709_LIMIT} is valid. It is used in configure.
320     static constexpr const char VIDEO_DECODER_DESIRED_PRESENT_TIMESTAMP[] =
321         "video_decoder_desired_present_timestamp"; ///< int64_t, key for describing the desired present timestamp of
322                                                    ///< video decoder frame set by the caller. This is an optional key
323                                                    ///< that applies only to video decoder surface mode.
324 
325     /* -------------------- video specific tag -------------------- */
326     static constexpr const char VIDEO_H264_PROFILE[] = "video.h264.profile"; ///< @see VideoH264Profile
327     static constexpr const char VIDEO_H264_LEVEL[] = "video.h264.level";     ///< h264 level
328     static constexpr const char VIDEO_H265_PROFILE[] = "video.h265.profile"; ///< @see HEVCProfile
329     static constexpr const char VIDEO_H265_LEVEL[] = "video.h265.level";     ///< @see HEVCLevel
330     static constexpr const char VIDEO_CHROMA_LOCATION[] = "chroma_location"; ///< @see ChromaLocation
331 
332     /* -------------------- user specific tag -------------------- */
333     static constexpr const char USER_FRAME_PTS[] = "user.frame.pts"; ///< The user frame pts
334     static constexpr const char USER_TIME_SYNC_RESULT[] =
335         "user.time.sync.result"; ///< std::string : The time sync result
336     static constexpr const char USER_AV_SYNC_GROUP_INFO[] =
337         "user.av.sync.group.info"; ///< std::string : The av sync group info
338     static constexpr const char USER_SHARED_MEMORY_FD[] =
339         "user.shared.memory.fd";                                               ///< std::string : The shared memory fd
340     static constexpr const char USER_PUSH_DATA_TIME[] = "user.push.data.time"; ///< The user push data time
341 
342     /* -------------------- drm tag -------------------- */
343     static constexpr const char DRM_CENC_INFO[] = "drm_cenc_info"; ///< drm cenc info
344     static constexpr const char DRM_APP_NAME[] = "APP_NAME"; ///< drm app name
345     static constexpr const char DRM_INSTANCE_ID[] = "INSTANCE_ID"; ///< drm instance id
346     static constexpr const char DRM_DECRYPT_AVG_SIZE[] = "DECRYPT_AVG_SIZE"; ///< drm decrypt avg size
347     static constexpr const char DRM_DECRYPT_AVG_DURATION[] = "DECRYPT_AVG_DURATION"; ///< drm decrypt avg duration
348     static constexpr const char DRM_DECRYPT_MAX_SIZE[] = "DECRYPT_MAX_SIZE"; ///< drm decrypt max size
349     static constexpr const char DRM_DECRYPT_MAX_DURATION[] = "DECRYPT_MAX_DURATION"; ///< drm decrypt max duration
350     static constexpr const char DRM_DECRYPT_TIMES[] = "DECRYPT_TIMES"; ///< drm decrypt times
351     static constexpr const char DRM_ERROR_CODE[] = "ERROR_CODE"; ///< drm error code
352     static constexpr const char DRM_ERROR_MESG[] = "ERROR_MESG"; ///< drm error message
353 
354     /* -------------------- avcapability tag -------------------- */
355     static constexpr const char FEATURE_PROPERTY_VIDEO_ENCODER_MAX_LTR_FRAME_COUNT[] =
356         "feature_property_video_encoder_max_ltr_frame_count"; ///< int32_t, the key for querying the maximum long
357                                                             ///< term reference count
358 
359     /* -------------------- AVCodec tag -------------------- */
360     // Pid is int32_t and process name is string, to describe AVCodec's forward caller info.
361     // For example, camera recording, forward caller is camera.
362     static constexpr const char AV_CODEC_FORWARD_CALLER_PID[]           = "av_codec_forward_caller_pid";
363     static constexpr const char AV_CODEC_FORWARD_CALLER_UID[]           = "av_codec_forward_caller_uid";
364     static constexpr const char AV_CODEC_FORWARD_CALLER_PROCESS_NAME[]  = "av_codec_forward_caller_process_name";
365 
366     // Pid is int32_t and process name is string, to describe AVCodec's caller info.
367     // For example, camera recording, caller is media_service.
368     static constexpr const char AV_CODEC_CALLER_PID[]                   = "av_codec_caller_pid";
369     static constexpr const char AV_CODEC_CALLER_UID[]                   = "av_codec_caller_uid";
370     static constexpr const char AV_CODEC_CALLER_PROCESS_NAME[]          = "av_codec_caller_process_name";
371 /* -------------------- screen captrue tag -------------------- */
372     static constexpr const char SCREEN_CAPTURE_ERR_CODE[] = "errCode";
373     static constexpr const char SCREEN_CAPTURE_ERR_MSG[] = "errMsg";
374     static constexpr const char SCREEN_CAPTURE_DURATION[] = "captureDuration";
375     static constexpr const char SCREEN_CAPTURE_AV_TYPE[] = "avType";
376     static constexpr const char SCREEN_CAPTURE_DATA_TYPE[] = "dataType";
377     static constexpr const char SCREEN_CAPTURE_USER_AGREE[] = "userAgree";
378     static constexpr const char SCREEN_CAPTURE_REQURE_MIC[] = "requireMic";
379     static constexpr const char SCREEN_CAPTURE_ENABLE_MIC[] = "enableMic";
380     static constexpr const char SCREEN_CAPTURE_VIDEO_RESOLUTION[] = "videoResolution";
381     static constexpr const char SCREEN_CAPTURE_STOP_REASON[] = "stopReason";
382     static constexpr const char SCREEN_CAPTURE_START_LATENCY[] = "startLatency";
383 
384 /* -------------------- recorder tag -------------------- */
385     static constexpr const char RECORDER_ERR_CODE[] = "errCode";
386     static constexpr const char RECORDER_ERR_MSG[] = "errMsg";
387     static constexpr const char RECORDER_DURATION[] = "recordDuration";
388     static constexpr const char RECORDER_CONTAINER_MIME[] = "containerMime";
389     static constexpr const char RECORDER_VIDEO_MIME[] = "videoMime";
390     static constexpr const char RECORDER_VIDEO_RESOLUTION[] = "videoResolution";
391     static constexpr const char RECORDER_VIDEO_BITRATE[] = "videoBitrate";
392     static constexpr const char RECORDER_HDR_TYPE[] = "hdrType";
393     static constexpr const char RECORDER_AUDIO_MIME[] = "audioMime";
394     static constexpr const char RECORDER_AUDIO_SAMPLE_RATE[] = "audioSampleRate";
395     static constexpr const char RECORDER_AUDIO_CHANNEL_COUNT[] = "audioChannelCount";
396     static constexpr const char RECORDER_AUDIO_BITRATE[] = "audioBitrate";
397     static constexpr const char RECORDER_START_LATENCY[] = "startLatency";
398 
399     static constexpr const char SUBTITLE_TEXT[] = "subtitle_text";
400     static constexpr const char SUBTITLE_PTS[] = "subtitle_pts";
401     static constexpr const char SUBTITLE_DURATION[] = "subtitle_duration";
402 /* -------------------- av player tag -------------------- */
403     static constexpr const char AV_PLAYER_ERR_CODE[] = "av_player_errCode";
404     static constexpr const char AV_PLAYER_ERR_MSG[] = "av_player_errMsg";
405     static constexpr const char AV_PLAYER_PLAY_DURATION[] = "av_player_play_duration";
406     static constexpr const char AV_PLAYER_SOURCE_TYPE[] = "av_player_source_type";
407     static constexpr const char AV_PLAYER_AVG_DOWNLOAD_RATE[] = "av_player_avg_download_rate";
408     static constexpr const char AV_PLAYER_CONTAINER_MIME[] = "av_player_container_mime";
409     static constexpr const char AV_PLAYER_VIDEO_MIME[] = "av_player_video_mime";
410     static constexpr const char AV_PLAYER_VIDEO_RESOLUTION[] = "av_player_video_resolution";
411     static constexpr const char AV_PLAYER_VIDEO_FRAMERATE[] = "av_player_video_framerate";
412     static constexpr const char AV_PLAYER_VIDEO_BITDEPTH[] = "av_player_video_bitdepth";
413     static constexpr const char AV_PLAYER_VIDEO_BITRATE[] = "av_player_video_bitrate";
414     static constexpr const char AV_PLAYER_HDR_TYPE[] = "av_player_hdr_type";
415     static constexpr const char AV_PLAYER_AUDIO_MIME[] = "av_player_audio_mime";
416     static constexpr const char AV_PLAYER_AUDIO_BITRATE[] = "av_player_audio_bitrate";
417     static constexpr const char AV_PLAYER_IS_DRM_PROTECTED[] = "av_player_is_drm_protected";
418     static constexpr const char AV_PLAYER_START_LATENCY[] = "av_player_start_latency";
419     static constexpr const char AV_PLAYER_AVG_DOWNLOAD_SPEED[] = "av_player_avg_download_speed";
420     static constexpr const char AV_PLAYER_MAX_SEEK_LATENCY[] = "av_player_max_seek_latency";
421     static constexpr const char AV_PLAYER_MAX_ACCURATE_SEEK_LATENCY[] = "av_player_max_accurate_seek_latency";
422     static constexpr const char AV_PLAYER_LAG_TIMES[] = "av_player_lag_times";
423     static constexpr const char AV_PLAYER_MAX_LAG_DURATION[] = "av_player_max_lag_duration";
424     static constexpr const char AV_PLAYER_AVG_LAG_DURATION[] = "av_player_avg_lag_duration";
425     static constexpr const char AV_PLAYER_MAX_SURFACESWAP_LATENCY[] = "av_player_max_surfaceswap_latency";
426     static constexpr const char AV_PLAYER_DOWNLOAD_TOTAL_BITS[] = "av_player_total_download_bits";
427     static constexpr const char AV_PLAYER_DOWNLOAD_TIME_OUT[] = "av_player_download_time_out";
428 /* -------------------- av transcoder tag -------------------- */
429     static constexpr const char AV_TRANSCODER_ERR_CODE[] = "av_transcoder_errCode";
430     static constexpr const char AV_TRANSCODER_ERR_MSG[] = "av_transcoder_errMsg";
431     static constexpr const char AV_TRANSCODER_SOURCE_DURATION[] = "av_transcoder_source_duration";
432     static constexpr const char AV_TRANSCODER_TRANSCODER_DURATION[] = "av_transcoder_transcoder_duration";
433     static constexpr const char AV_TRANSCODER_SRC_FORMAT[] = "av_transcoder_src_format";
434     static constexpr const char AV_TRANSCODER_SRC_AUDIO_MIME[] = "av_transcoder_src_audio_mime";
435     static constexpr const char AV_TRANSCODER_SRC_VIDEO_MIME[] = "av_transcoder_src_video_mime";
436     static constexpr const char AV_TRANSCODER_SRC_VIDEO_FRAME_RATE[] = "av_transcoder_src_video_frame_rate";
437     static constexpr const char AV_TRANSCODER_SRC_VIDEO_BITRATE[] = "av_transcoder_src_video_bitrate";
438     static constexpr const char AV_TRANSCODER_SRC_HDR_TYPE[] = "av_transcoder_src_hdr_type";
439     static constexpr const char AV_TRANSCODER_SRC_AUDIO_SAMPLE_RATE[] = "av_transcoder_src_audio_sample_rate";
440     static constexpr const char AV_TRANSCODER_SRC_AUDIO_CHANNEL_COUNT[] = "av_transcoder_src_audio_channel_count";
441     static constexpr const char AV_TRANSCODER_SRC_AUDIO_BITRATE[] = "av_transcoder_src_audio_bitrate";
442     static constexpr const char AV_TRANSCODER_DST_FORMAT[] = "av_transcoder_dst_format";
443     static constexpr const char AV_TRANSCODER_DST_AUDIO_MIME[] = "av_transcoder_dst_audio_mime";
444     static constexpr const char AV_TRANSCODER_DST_VIDEO_MIME[] = "av_transcoder_dst_video_mime";
445     static constexpr const char AV_TRANSCODER_DST_VIDEO_FRAME_RATE[] = "av_transcoder_dst_video_frame_rate";
446     static constexpr const char AV_TRANSCODER_DST_VIDEO_BITRATE[] = "av_transcoder_dst_video_bitrate";
447     static constexpr const char AV_TRANSCODER_DST_HDR_TYPE[] = "av_transcoder_dst_hdr_type";
448     static constexpr const char AV_TRANSCODER_DST_AUDIO_SAMPLE_RATE[] = "av_transcoder_dst_audio_sample_rate";
449     static constexpr const char AV_TRANSCODER_DST_AUDIO_CHANNEL_COUNT[] = "av_transcoder_dst_audio_channel_count";
450     static constexpr const char AV_TRANSCODER_DST_AUDIO_BITRATE[] = "av_transcoder_dst_audio_bitrate";
451     static constexpr const char AV_TRANSCODER_VIDEO_DECODER_DURATION[] = "av_transcoder_video_decoder_duration";
452     static constexpr const char AV_TRANSCODER_VIDEO_ENCODER_DURATION[] = "av_transcoder_video_encoder_duration";
453     static constexpr const char AV_TRANSCODER_VIDEO_VPE_DURATION[] = "av_transcoder_video_vpe_duration";
454 /* -------------------- vrr tag -------------------- */
455     // int32_t, 1 is enabled, 0 is unabled
456     static constexpr const char VIDEO_DECODER_OUTPUT_ENABLE_VRR[] = "video_decoder_output_enable_vrr";
457 };
458 
459 using TagTypeCharSeq = const char *;
460 using TagType = std::string;
461 } // namespace Media
462 } // namespace OHOS
463 #endif // MEDIA_FOUNDATION_META_KEY_H
464