• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 /**
17  * @addtogroup CodecBase
18  * @{
19  *
20  * @brief The CodecBase module provides variables, properties, and functions
21  * for audio and video muxer, demuxer, and basic encoding and decoding functions.
22  *
23  * @syscap SystemCapability.Multimedia.Media.CodecBase
24  * @since 9
25  */
26 
27 /**
28  * @file native_avcodec_base.h
29  *
30  * @brief Declare the Native API used for audio and video muxer,
31  * demuxer and basic encoding and decoding functions.
32  * @kit AVCodecKit
33  * @library libnative_media_codecbase.so
34  * @syscap SystemCapability.Multimedia.Media.CodecBase
35  * @since 9
36  */
37 
38 #ifndef NATIVE_AVCODEC_BASE_H
39 #define NATIVE_AVCODEC_BASE_H
40 
41 #include <stdint.h>
42 #include <stdio.h>
43 #include "native_avbuffer.h"
44 #include "native_avmemory.h"
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 /**
51  * @brief Forward declaration of OHNativeWindow.
52  *
53  * @since 9
54  */
55 typedef struct NativeWindow OHNativeWindow;
56 /**
57  * @brief Forward declaration of OH_AVCodec.
58  *
59  * @since 9
60  */
61 typedef struct OH_AVCodec OH_AVCodec;
62 
63 /**
64  * @brief When an error occurs in the running of the OH_AVCodec instance, the function pointer will be called
65  * to report specific error information.
66  *
67  * @syscap SystemCapability.Multimedia.Media.CodecBase
68  * @param codec OH_AVCodec instance
69  * @param errorCode specific error code
70  * @param userData User specific data
71  * @since 9
72  */
73 typedef void (*OH_AVCodecOnError)(OH_AVCodec *codec, int32_t errorCode, void *userData);
74 
75 /**
76  * @brief When the output stream changes, the function pointer will be called to report the new stream description
77  * information. It should be noted that the life cycle of the OH_AVFormat pointer
78  * is only valid when the function pointer is called, and it is forbidden to continue to access after the call ends.
79  *
80  * @syscap SystemCapability.Multimedia.Media.CodecBase
81  * @param codec OH_AVCodec instance
82  * @param format New output stream description information
83  * @param userData User specific data
84  * @since 9
85  */
86 typedef void (*OH_AVCodecOnStreamChanged)(OH_AVCodec *codec, OH_AVFormat *format, void *userData);
87 
88 /**
89  * @brief When OH_AVCodec needs new input data during the running process,
90  * the function pointer will be called and carry an available Buffer to fill in the new input data.
91  *
92  * @syscap SystemCapability.Multimedia.Media.CodecBase
93  * @param codec OH_AVCodec instance
94  * @param index The index corresponding to the newly available input buffer.
95  * @param data New available input buffer.
96  * @param userData User specific data
97  * @deprecated since 11
98  * @useinstead OH_AVCodecOnNeedInputBuffer
99  * @since 9
100  */
101 typedef void (*OH_AVCodecOnNeedInputData)(OH_AVCodec *codec, uint32_t index, OH_AVMemory *data, void *userData);
102 
103 /**
104  * @brief When new output data is generated during the operation of OH_AVCodec, the function pointer will be
105  * called and carry a Buffer containing the new output data. It should be noted that the life cycle of the
106  * OH_AVCodecBufferAttr pointer is only valid when the function pointer is called. , which prohibits continued
107  * access after the call ends.
108  *
109  * @syscap SystemCapability.Multimedia.Media.CodecBase
110  * @param codec OH_AVCodec instance
111  * @param index The index corresponding to the new output Buffer.
112  * @param data Buffer containing the new output data
113  * @param attr The description of the new output Buffer, please refer to {@link OH_AVCodecBufferAttr}
114  * @param userData specified data
115  * @deprecated since 11
116  * @useinstead OH_AVCodecOnNewOutputBuffer
117  * @since 9
118  */
119 typedef void (*OH_AVCodecOnNewOutputData)(OH_AVCodec *codec, uint32_t index, OH_AVMemory *data,
120                                           OH_AVCodecBufferAttr *attr, void *userData);
121 
122 /**
123  * @brief When OH_AVCodec needs new input data during the running process,
124  * the function pointer will be called and carry an available Buffer to fill in the new input data.
125  *
126  * @syscap SystemCapability.Multimedia.Media.CodecBase
127  * @param codec OH_AVCodec instance
128  * @param index The index corresponding to the newly available input buffer.
129  * @param buffer New available input buffer.
130  * @param userData User specific data
131  * @since 11
132  */
133 typedef void (*OH_AVCodecOnNeedInputBuffer)(OH_AVCodec *codec, uint32_t index, OH_AVBuffer *buffer, void *userData);
134 
135 /**
136  * @brief When new output data is generated during the operation of OH_AVCodec, the function pointer will be
137  * called and carry a Buffer containing the new output data.
138  *
139  * @syscap SystemCapability.Multimedia.Media.CodecBase
140  * @param codec OH_AVCodec instance
141  * @param index The index corresponding to the new output Buffer.
142  * @param buffer Buffer containing the new output buffer.
143  * @param userData specified data
144  * @since 11
145  */
146 typedef void (*OH_AVCodecOnNewOutputBuffer)(OH_AVCodec *codec, uint32_t index, OH_AVBuffer *buffer, void *userData);
147 
148 /**
149  * @brief A collection of all asynchronous callback function pointers in OH_AVCodec. Register an instance of this
150  * structure to the OH_AVCodec instance, and process the information reported through the callback to ensure the
151  * normal operation of OH_AVCodec.
152  *
153  * @syscap SystemCapability.Multimedia.Media.CodecBase
154  * @param onError Monitor OH_AVCodec operation errors, refer to {@link OH_AVCodecOnError}
155  * @param onStreamChanged Monitor codec stream information, refer to {@link OH_AVCodecOnStreamChanged}
156  * @param onNeedInputData Monitoring codec requires input data, refer to {@link OH_AVCodecOnNeedInputData}
157  * @param onNeedOutputData Monitor codec to generate output data, refer to {@link OH_AVCodecOnNewOutputData}
158  * @deprecated since 11
159  * @useinstead OH_AVCodecCallback
160  * @since 9
161  */
162 typedef struct OH_AVCodecAsyncCallback {
163     OH_AVCodecOnError onError;
164     OH_AVCodecOnStreamChanged onStreamChanged;
165     OH_AVCodecOnNeedInputData onNeedInputData;
166     OH_AVCodecOnNewOutputData onNeedOutputData;
167 } OH_AVCodecAsyncCallback;
168 
169 /**
170  * @brief A collection of all asynchronous callback function pointers in OH_AVCodec. Register an instance of this
171  * structure to the OH_AVCodec instance, and process the information reported through the callback to ensure the
172  * normal operation of OH_AVCodec.
173  *
174  * @syscap SystemCapability.Multimedia.Media.CodecBase
175  * @param onError Monitor OH_AVCodec operation errors, refer to {@link OH_AVCodecOnError}
176  * @param onStreamChanged Monitor codec stream information, refer to {@link OH_AVCodecOnStreamChanged}
177  * @param onNeedInputBuffer Monitoring codec requires input buffer, refer to {@link OH_AVCodecOnNeedInputBuffer}
178  * @param onNewOutputBuffer Monitor codec to generate output buffer, refer to {@link OH_AVCodecOnNewOutputBuffer}
179  * @since 11
180  */
181 typedef struct OH_AVCodecCallback {
182     OH_AVCodecOnError onError;
183     OH_AVCodecOnStreamChanged onStreamChanged;
184     OH_AVCodecOnNeedInputBuffer onNeedInputBuffer;
185     OH_AVCodecOnNewOutputBuffer onNewOutputBuffer;
186 } OH_AVCodecCallback;
187 
188 /**
189  * @brief the function pointer will be called to get sequence media data.
190  * @syscap SystemCapability.Multimedia.Media.CodecBase
191  * @param data    OH_AVBuffer buffer to fill
192  * @param length   expected to read size;
193  * @param pos    current read offset
194  * @return  Actual size of data read to the buffer.
195  * @since 12
196  */
197 typedef int32_t (*OH_AVDataSourceReadAt)(OH_AVBuffer *data, int32_t length, int64_t pos);
198 
199 /**
200  * @brief User customized data source.
201  * @syscap SystemCapability.Multimedia.Media.CodecBase
202  * @since 12
203  */
204 typedef struct OH_AVDataSource {
205     /**
206      * Total size of the data source.
207      */
208     int64_t size;
209     /**
210      * Callback interface for reading data from datasource.
211      */
212     OH_AVDataSourceReadAt readAt;
213 } OH_AVDataSource;
214 
215 /**
216  * @brief Enumerates the mime types of video avc codec.
217  *
218  * @syscap SystemCapability.Multimedia.Media.CodecBase
219  * @since 9
220  */
221 extern const char *OH_AVCODEC_MIMETYPE_VIDEO_AVC;
222 /**
223  * @brief Enumerates the mime types of audio aac codec.
224  *
225  * @syscap SystemCapability.Multimedia.Media.CodecBase
226  * @since 9
227  */
228 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_AAC;
229 
230 /**
231  * @brief Enumerates the mime types of audio flac codec.
232  *
233  * @syscap SystemCapability.Multimedia.Media.CodecBase
234  * @since 10
235  */
236 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_FLAC;
237 /**
238  * @brief Enumerates the mime types of audio vorbis codec.
239  *
240  * @syscap SystemCapability.Multimedia.Media.CodecBase
241  * @since 10
242  */
243 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_VORBIS;
244 /**
245  * @brief Enumerates the mime types of audio mp3 codec.
246  *
247  * @syscap SystemCapability.Multimedia.Media.CodecBase
248  * @since 10
249  */
250 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_MPEG;
251 /**
252  * @brief Enumerates the mime types of video hevc codec.
253  *
254  * @syscap SystemCapability.Multimedia.Media.CodecBase
255  * @since 10
256  */
257 extern const char *OH_AVCODEC_MIMETYPE_VIDEO_HEVC;
258 
259 /**
260  * @brief Enumerates the mime types of video mpeg4 muxer.
261  *
262  * @syscap SystemCapability.Multimedia.Media.CodecBase
263  * @deprecated since 11
264  * @since 10
265  */
266 extern const char *OH_AVCODEC_MIMETYPE_VIDEO_MPEG4;
267 
268 /**
269  * @brief Enumerates the mime types of cover jpg muxer.
270  *
271  * @syscap SystemCapability.Multimedia.Media.CodecBase
272  * @since 10
273  */
274 extern const char *OH_AVCODEC_MIMETYPE_IMAGE_JPG;
275 /**
276  * @brief Enumerates the mime types of cover png muxer.
277  *
278  * @syscap SystemCapability.Multimedia.Media.CodecBase
279  * @since 10
280  */
281 extern const char *OH_AVCODEC_MIMETYPE_IMAGE_PNG;
282 /**
283  * @brief Enumerates the mime types of cover bmp muxer.
284  *
285  * @syscap SystemCapability.Multimedia.Media.CodecBase
286  * @since 10
287  */
288 extern const char *OH_AVCODEC_MIMETYPE_IMAGE_BMP;
289 
290 /**
291  * @brief Enumerates the mime types of audio vivid codec.
292  *
293  * @syscap SystemCapability.Multimedia.Media.CodecBase
294  * @since 11
295  */
296 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_VIVID;
297 /**
298  * @brief Enumerates the mime types of audio amrnb codec.
299  *
300  * @syscap SystemCapability.Multimedia.Media.CodecBase
301  * @since 11
302  */
303 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_AMR_NB;
304 /**
305  * @brief Enumerates the mime types of audio amrwb codec.
306  *
307  * @syscap SystemCapability.Multimedia.Media.CodecBase
308  * @since 11
309  */
310 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_AMR_WB;
311 /**
312  * @brief Enumerates the mime types of audio opus codec.
313  *
314  * @syscap SystemCapability.Multimedia.Media.CodecBase
315  * @since 11
316  */
317 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_OPUS;
318 /**
319  * @brief Enumerates the mime types of audio g711mu codec.
320  *
321  * @syscap SystemCapability.Multimedia.Media.CodecBase
322  * @since 11
323  */
324 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_G711MU;
325 
326 /**
327  * @brief Enumerates the mime type of audio ape codec.
328  *
329  * @syscap SystemCapability.Multimedia.Media.CodecBase
330  * @since 12
331  */
332 extern const char *OH_AVCODEC_MIMETYPE_AUDIO_APE;
333 
334 /**
335  * @brief Enumerates the MIME type of versatile video coding.
336  *
337  * @syscap SystemCapability.Multimedia.Media.CodecBase
338  * @since 12
339  */
340 extern const char *OH_AVCODEC_MIMETYPE_VIDEO_VVC;
341 
342 /**
343  * @brief Enumerates the mime type of subtitle srt.
344  *
345  * @syscap SystemCapability.Multimedia.Media.CodecBase
346  * @since 12
347  */
348 extern const char *OH_AVCODEC_MIMETYPE_SUBTITLE_SRT;
349 
350 /**
351  * @brief Enumerates the mime type of subtitle webvtt.
352  *
353  * @syscap SystemCapability.Multimedia.Media.CodecBase
354  * @since 12
355  */
356 extern const char *OH_AVCODEC_MIMETYPE_SUBTITLE_WEBVTT;
357 
358 /**
359  * @brief Key for timeStamp in surface's extraData, value type is int64_t.
360  *
361  * @syscap SystemCapability.Multimedia.Media.CodecBase
362  * @deprecated since 14
363  * @since 9
364  */
365 extern const char *OH_ED_KEY_TIME_STAMP;
366 /**
367  * @brief Key for endOfStream in surface's extraData, value type is bool.
368  *
369  * @syscap SystemCapability.Multimedia.Media.CodecBase
370  * @deprecated since 14
371  * @since 9
372  */
373 extern const char *OH_ED_KEY_EOS;
374 
375 /**
376  * @brief Key for track type, value type is int32_t, see {@link OH_MediaType}.
377  *
378  * @syscap SystemCapability.Multimedia.Media.CodecBase
379  * @since 9
380  */
381 extern const char *OH_MD_KEY_TRACK_TYPE;
382 /**
383  * @brief Key for codec mime type, value type is string.
384  *
385  * @syscap SystemCapability.Multimedia.Media.CodecBase
386  * @since 9
387  */
388 extern const char *OH_MD_KEY_CODEC_MIME;
389 /**
390  * @brief Key for file duration in microseconds, value type is int64_t.
391  *
392  * @syscap SystemCapability.Multimedia.Media.CodecBase
393  * @since 9
394  */
395 extern const char *OH_MD_KEY_DURATION;
396 /**
397  * @brief Key for bitrate, value type is int64_t.
398  *
399  * @syscap SystemCapability.Multimedia.Media.CodecBase
400  * @since 9
401  */
402 extern const char *OH_MD_KEY_BITRATE;
403 /**
404  * @brief Key for max input size, value type is int32_t.
405  *
406  * @syscap SystemCapability.Multimedia.Media.CodecBase
407  * @since 9
408  */
409 extern const char *OH_MD_KEY_MAX_INPUT_SIZE;
410 /**
411  * @brief Key for video width, value type is int32_t.
412  *
413  * @syscap SystemCapability.Multimedia.Media.CodecBase
414  * @since 9
415  */
416 extern const char *OH_MD_KEY_WIDTH;
417 /**
418  * @brief Key for video height, value type is int32_t.
419  *
420  * @syscap SystemCapability.Multimedia.Media.CodecBase
421  * @since 9
422  */
423 extern const char *OH_MD_KEY_HEIGHT;
424 /**
425  * @brief Key for video pixel format, value type is int32_t, see {@link OH_AVPixelFormat}.
426  *
427  * @syscap SystemCapability.Multimedia.Media.CodecBase
428  * @since 9
429  */
430 extern const char *OH_MD_KEY_PIXEL_FORMAT;
431 /**
432  * @brief key for audio raw format, value type is int32_t , see {@link OH_BitsPerSample}.
433  *
434  * @syscap SystemCapability.Multimedia.Media.CodecBase
435  * @since 9
436  */
437 extern const char *OH_MD_KEY_AUDIO_SAMPLE_FORMAT;
438 /**
439  * @brief Key for video frame rate, value type is double.
440  *
441  * @syscap SystemCapability.Multimedia.Media.CodecBase
442  * @since 9
443  */
444 extern const char *OH_MD_KEY_FRAME_RATE;
445 /**
446  * @brief video encode bitrate mode, the value type is int32_t, see {@link OH_VideoEncodeBitrateMode}.
447  *
448  * @syscap SystemCapability.Multimedia.Media.CodecBase
449  * @since 9
450  */
451 extern const char *OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE;
452 /**
453  * @brief encode profile, the value type is int32_t. see {@link OH_AVCProfile}, {@link OH_HEVCProfile},
454  * {@link OH_AACProfile}.
455  *
456  * @syscap SystemCapability.Multimedia.Media.CodecBase
457  * @since 9
458  */
459 extern const char *OH_MD_KEY_PROFILE;
460 /**
461  * @brief Key for audio channel count, value type is int32_t.
462  *
463  * @syscap SystemCapability.Multimedia.Media.CodecBase
464  * @since 9
465  */
466 extern const char *OH_MD_KEY_AUD_CHANNEL_COUNT;
467 /**
468  * @brief Key for audio sample rate, value type is int32_t.
469  *
470  * @syscap SystemCapability.Multimedia.Media.CodecBase
471  * @since 9
472  */
473 extern const char *OH_MD_KEY_AUD_SAMPLE_RATE;
474 /**
475  * @brief Key for the interval of key frame. value type is int32_t, the unit is milliseconds. A negative value means no
476  * key frames are requested after the first frame. A zero value means a stream containing all key frames is requested.
477  *
478  * @syscap SystemCapability.Multimedia.Media.CodecBase
479  * @since 9
480  */
481 extern const char *OH_MD_KEY_I_FRAME_INTERVAL;
482 /**
483  * @brief Key of the surface rotation angle. value type is int32_t: should be {0, 90, 180, 270}, default is 0.
484  *
485  * @syscap SystemCapability.Multimedia.Media.CodecBase
486  * @since 9
487  */
488 extern const char *OH_MD_KEY_ROTATION;
489 
490 /**
491  * @brief Key for video YUV value range flag, value type is bool, true for full range, false for limited range.
492  *
493  * @syscap SystemCapability.Multimedia.Media.CodecBase
494  * @since 10
495  */
496 extern const char *OH_MD_KEY_RANGE_FLAG;
497 /**
498  * @brief Key for video color primaries, value type is int32_t, see {@link OH_ColorPrimary}.
499  *
500  * @syscap SystemCapability.Multimedia.Media.CodecBase
501  * @since 10
502  */
503 extern const char *OH_MD_KEY_COLOR_PRIMARIES;
504 /**
505  * @brief Key for video transfer characteristics, value type is int32_t, see {@link OH_TransferCharacteristic}.
506  *
507  * @syscap SystemCapability.Multimedia.Media.CodecBase
508  * @since 10
509  */
510 extern const char *OH_MD_KEY_TRANSFER_CHARACTERISTICS;
511 /**
512  * @brief Key for video matrix coefficients, value type is int32_t, see {@link OH_MatrixCoefficient}.
513  *
514  * @syscap SystemCapability.Multimedia.Media.CodecBase
515  * @since 10
516  */
517 extern const char *OH_MD_KEY_MATRIX_COEFFICIENTS;
518 /**
519  * @brief Key for the request an I-Frame immediately, value type is bool.
520  *
521  * @syscap SystemCapability.Multimedia.Media.CodecBase
522  * @since 10
523  */
524 extern const char *OH_MD_KEY_REQUEST_I_FRAME;
525 /**
526  * @brief Key for the desired encoding quality, value type is int32_t, this key is only.
527  * supported for encoders that are configured in constant quality mode.
528  *
529  * @syscap SystemCapability.Multimedia.Media.CodecBase
530  * @since 10
531  */
532 extern const char *OH_MD_KEY_QUALITY;
533 /**
534  * @brief Key of the codec specific data. value type is a uint8_t pointer.
535  *
536  * @syscap SystemCapability.Multimedia.Media.CodecBase
537  * @since 10
538  */
539 extern const char *OH_MD_KEY_CODEC_CONFIG;
540 /**
541  * @brief source format Key for title, value type is string.
542  *
543  * @syscap SystemCapability.Multimedia.Media.CodecBase
544  * @since 10
545  */
546 extern const char *OH_MD_KEY_TITLE;
547 /**
548  * @brief source format Key for artist, value type is string.
549  *
550  * @syscap SystemCapability.Multimedia.Media.CodecBase
551  * @since 10
552  */
553 extern const char *OH_MD_KEY_ARTIST;
554 /**
555  * @brief source format Key for album, value type is string.
556  *
557  * @syscap SystemCapability.Multimedia.Media.CodecBase
558  * @since 10
559  */
560 extern const char *OH_MD_KEY_ALBUM;
561 /**
562  * @brief source format Key for album artist, value type is string.
563  *
564  * @syscap SystemCapability.Multimedia.Media.CodecBase
565  * @since 10
566  */
567 extern const char *OH_MD_KEY_ALBUM_ARTIST;
568 /**
569  * @brief source format Key for date, value type is string.
570  *
571  * @syscap SystemCapability.Multimedia.Media.CodecBase
572  * @since 10
573  */
574 extern const char *OH_MD_KEY_DATE;
575 /**
576  * @brief source format Key for comment, value type is string.
577  *
578  * @syscap SystemCapability.Multimedia.Media.CodecBase
579  * @since 10
580  */
581 extern const char *OH_MD_KEY_COMMENT;
582 /**
583  * @brief source format Key for genre, value type is string.
584  *
585  * @syscap SystemCapability.Multimedia.Media.CodecBase
586  * @since 10
587  */
588 extern const char *OH_MD_KEY_GENRE;
589 /**
590  * @brief source format Key for copyright, value type is string.
591  *
592  * @syscap SystemCapability.Multimedia.Media.CodecBase
593  * @since 10
594  */
595 extern const char *OH_MD_KEY_COPYRIGHT;
596 /**
597  * @brief source format Key for language, value type is string.
598  *
599  * @syscap SystemCapability.Multimedia.Media.CodecBase
600  * @since 10
601  */
602 extern const char *OH_MD_KEY_LANGUAGE;
603 /**
604  * @brief source format Key for description, value type is string.
605  *
606  * @syscap SystemCapability.Multimedia.Media.CodecBase
607  * @since 10
608  */
609 extern const char *OH_MD_KEY_DESCRIPTION;
610 /**
611  * @brief source format Key for lyrics, value type is string.
612  *
613  * @syscap SystemCapability.Multimedia.Media.CodecBase
614  * @since 10
615  */
616 extern const char *OH_MD_KEY_LYRICS;
617 /**
618  * @brief source format Key for track count, value type is int32_t.
619  *
620  * @syscap SystemCapability.Multimedia.Media.CodecBase
621  * @since 10
622  */
623 extern const char *OH_MD_KEY_TRACK_COUNT;
624 /**
625  * @brief Key for the desired encoding channel layout, value type is int64_t, this key is only supported for encoders.
626  *
627  * @syscap SystemCapability.Multimedia.Media.CodecBase
628  * @since 10
629  */
630 extern const char *OH_MD_KEY_CHANNEL_LAYOUT;
631 /**
632  * @brief Key for bits per coded sample, value type is int32_t, supported for flac encoder,
633  * see {@link OH_BitsPerSample}.
634  *
635  * @syscap SystemCapability.Multimedia.Media.CodecBase
636  * @since 10
637  */
638 extern const char *OH_MD_KEY_BITS_PER_CODED_SAMPLE;
639 /**
640  * @brief Key for the aac format, value type is int32_t, supported for aac decoder.
641  *
642  * @syscap SystemCapability.Multimedia.Media.CodecBase
643  * @since 10
644  */
645 extern const char *OH_MD_KEY_AAC_IS_ADTS;
646 /**
647  * @brief Key for aac sbr mode, value type is int32_t, supported for aac encoder.
648  *
649  * @syscap SystemCapability.Multimedia.Media.CodecBase
650  * @since 10
651  */
652 extern const char *OH_MD_KEY_SBR;
653 /**
654  * @brief Key for flac compliance level, value type is int32_t.
655  *
656  * @syscap SystemCapability.Multimedia.Media.CodecBase
657  * @since 10
658  */
659 extern const char *OH_MD_KEY_COMPLIANCE_LEVEL;
660 /**
661  * @brief Key for vorbis identification header, value type is a uint8_t pointer, supported only for vorbis decoder.
662  *
663  * @syscap SystemCapability.Multimedia.Media.CodecBase
664  * @since 10
665  */
666 extern const char *OH_MD_KEY_IDENTIFICATION_HEADER;
667 /**
668  * @brief Key for vorbis setup header, value type is a uint8_t pointer, supported only for vorbis decoder.
669  *
670  * @syscap SystemCapability.Multimedia.Media.CodecBase
671  * @since 10
672  */
673 extern const char *OH_MD_KEY_SETUP_HEADER;
674 /**
675  * @brief Key for video scale type, value type is int32_t, see {@link OH_ScalingMode}.
676  *
677  * @syscap SystemCapability.Multimedia.Media.CodecBase
678  * @deprecated since 14
679  * @useinstead OH_NativeWindow_NativeWindowSetScalingModeV2
680  * @since 10
681  */
682 extern const char *OH_MD_KEY_SCALING_MODE;
683 /**
684  * @brief Key for max input buffer count, value type is int32_t.
685  *
686  * @syscap SystemCapability.Multimedia.Media.CodecBase
687  * @since 10
688  */
689 extern const char *OH_MD_MAX_INPUT_BUFFER_COUNT;
690 /**
691  * @brief Key for max output buffer count, value type is int32_t.
692  *
693  * @syscap SystemCapability.Multimedia.Media.CodecBase
694  * @since 10
695  */
696 extern const char *OH_MD_MAX_OUTPUT_BUFFER_COUNT;
697 
698 /**
699  * @brief Key for audio codec compression level, value type is int32_t.
700  *
701  * @syscap SystemCapability.Multimedia.Media.CodecBase
702  * @since 11
703  */
704 extern const char *OH_MD_KEY_AUDIO_COMPRESSION_LEVEL;
705 /**
706  * @brief Key of the video is hdr vivid. value type is bool.
707  *
708  * @syscap SystemCapability.Multimedia.Media.CodecBase
709  * @since 11
710  */
711 extern const char *OH_MD_KEY_VIDEO_IS_HDR_VIVID;
712 /**
713  * @brief Key for number of audio objects. value type is int32_t.
714  *
715  * @syscap SystemCapability.Multimedia.Media.CodecBase
716  * @since 11
717  */
718 extern const char *OH_MD_KEY_AUDIO_OBJECT_NUMBER;
719 /**
720  * @brief Key for meta data of audio vivid. value type is a uint8_t pointer.
721  *
722  * @syscap SystemCapability.Multimedia.Media.CodecBase
723  * @since 11
724  */
725 extern const char *OH_MD_KEY_AUDIO_VIVID_METADATA;
726 
727 /**
728  * @brief Key for querying the maximum long-term reference count of video encoder, value type is int32_t.
729  * You should query the count through interface {@link OH_AVCapability_GetFeatureProperties}
730  * with enum {@link VIDEO_ENCODER_LONG_TERM_REFERENCE}.
731  *
732  * @syscap SystemCapability.Multimedia.Media.CodecBase
733  * @since 12
734  */
735 extern const char *OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_COUNT;
736 /**
737  * @brief Key for enable the temporal scalability mode, value type is int32_t (0 or 1): 1 is enabled, 0 otherwise.
738  * The default value is 0. To query supported, you should use the interface {@link OH_AVCapability_IsFeatureSupported}
739  * with enum {@link VIDEO_ENCODER_TEMPORAL_SCALABILITY}. This is an optional key that applies only to video encoder.
740  * It is used in configure.
741  *
742  * @syscap SystemCapability.Multimedia.Media.CodecBase
743  * @since 12
744  */
745 extern const char *OH_MD_KEY_VIDEO_ENCODER_ENABLE_TEMPORAL_SCALABILITY;
746 /**
747  * @brief Key for describing the temporal group of picture size, value type is int32_t. It takes effect only when
748  * temporal level scale is enable. This is an optional key that applies only to video encoder. It is used in configure.
749  *
750  * @syscap SystemCapability.Multimedia.Media.CodecBase
751  * @since 12
752  */
753 extern const char *OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_SIZE;
754 /**
755  * @brief Key for describing the reference mode in temporal group of picture, value type is int32_t, see enum
756  * {@link OH_TemporalGopReferenceMode}. It takes effect only when temporal level sacle is enabled.
757  * This is an optional key that applies only to video encoder. It is used in configure.
758  *
759  * @syscap SystemCapability.Multimedia.Media.CodecBase
760  * @since 12
761  */
762 extern const char *OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_REFERENCE_MODE;
763 /**
764  * @brief Key for describing the count of used long-term reference frames, value type is int32_t, must be within the
765  * supported range. To get supported range, you should query wthether the capability is supported through the interface
766  * {@link OH_AVCapability_GetFeatureProperties} with enum {@link VIDEO_ENCODER_LONG_TERM_REFERENCE}, otherwise, not set
767  * the key. This is an optional key that applies only to video encoder. It is used in configure.
768  *
769  * @syscap SystemCapability.Multimedia.Media.CodecBase
770  * @since 12
771  */
772 extern const char *OH_MD_KEY_VIDEO_ENCODER_LTR_FRAME_COUNT;
773 /**
774  * @brief Key for describing mark this frame as a long term reference frame, value type is int32_t (0 or 1): 1 is mark,
775  * 0 otherwise. It takes effect only when the number of used long term reference frames is configured. This is an
776  * optional key that applies only to video encoder input loop. It takes effect immediately.
777  *
778  * @syscap SystemCapability.Multimedia.Media.CodecBase
779  * @since 12
780  */
781 extern const char *OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_MARK_LTR;
782 /**
783  * @brief Key for describing the long term reference frame poc referenced by this frame, value type is int32_t. This is
784  * an optional key that applies only to video encoder input loop. It takes effect immediately.
785  *
786  * @syscap SystemCapability.Multimedia.Media.CodecBase
787  * @since 12
788  */
789 extern const char *OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_USE_LTR;
790 /**
791  * @brief Key for indicating this frame is a long-term reference frame, value type is int32_t (0 or 1): 1 is LTR,
792  * 0 otherwise. This is an optional key that applies only to video encoder output loop.
793  * It indicates the attribute of the frame.
794  *
795  * @syscap SystemCapability.Multimedia.Media.CodecBase
796  * @since 12
797  */
798 extern const char *OH_MD_KEY_VIDEO_PER_FRAME_IS_LTR;
799 /**
800  * @brief Key for describing the frame poc, value type is int32_t. This is an optional key that applies only to video
801  * encoder output loop. It indicates the attribute of the frame.
802  *
803  * @syscap SystemCapability.Multimedia.Media.CodecBase
804  * @since 12
805  */
806 extern const char *OH_MD_KEY_VIDEO_PER_FRAME_POC;
807 /**
808  * @brief Key for describing the top-coordinate (y) of the crop rectangle, value type is int32_t. This is the top-most
809  * row included in the crop frame, where row indices start at 0.
810  *
811  * @syscap SystemCapability.Multimedia.Media.CodecBase
812  * @since 12
813  */
814 extern const char *OH_MD_KEY_VIDEO_CROP_TOP;
815 /**
816  * @brief Key for describing the bottom-coordinate (y) of the crop rectangle, value type is int32_t. This is the
817  * bottom-most row included in the crop frame, where row indices start at 0.
818  *
819  * @syscap SystemCapability.Multimedia.Media.CodecBase
820  * @since 12
821  */
822 extern const char *OH_MD_KEY_VIDEO_CROP_BOTTOM;
823 /**
824  * @brief Key for describing the left-coordinate (x) of the crop rectangle, value type is int32_t.
825  * This is the left-most column included in the crop frame, where column indices start at 0.
826  *
827  * @syscap SystemCapability.Multimedia.Media.CodecBase
828  * @since 12
829  */
830 extern const char *OH_MD_KEY_VIDEO_CROP_LEFT;
831 /**
832  * @brief Key for describing the right-coordinate (x) of the crop rectangle, value type is int32_t. This is the
833  * right-most column included in the crop frame, where column indices start at 0.
834  *
835  * @syscap SystemCapability.Multimedia.Media.CodecBase
836  * @since 12
837  */
838 extern const char *OH_MD_KEY_VIDEO_CROP_RIGHT;
839 /**
840  * @brief Key for describing the stride of the video buffer layout, value type is int32_t. Stride (or row increment) is
841  * the difference between the index of a pixel and that of the pixel directly underneath. For YUV 420 formats, the
842  * stride corresponds to the Y plane; the stride of the U and V planes can be calculated based on the color format,
843  * though it is generally undefined and depends on the device and release.
844  *
845  * @syscap SystemCapability.Multimedia.Media.CodecBase
846  * @since 12
847  */
848 extern const char *OH_MD_KEY_VIDEO_STRIDE;
849 /**
850  * @brief Key for describing the plane height of a multi-planar (YUV) video buffer layout, value type is int32_t.
851  * Slice height (or plane height/vertical stride) is the number of rows that must be skipped to get from
852  * the top of the Y plane to the top of the U plane in the buffer. In essence the offset of the U plane
853  * is sliceHeight * stride. The height of the U/V planes can be calculated based on the color format,
854  * though it is generally undefined and depends on the device and release.
855  *
856  * @syscap SystemCapability.Multimedia.Media.CodecBase
857  * @since 12
858  */
859 extern const char *OH_MD_KEY_VIDEO_SLICE_HEIGHT;
860 /**
861  * @brief Key for describing the valid picture width of the video, value type is int32_t.
862  * Get the value from an OH_AVFormat instance, which obtained by calling {@link OH_VideoDecoder_GetOutputDescription}
863  * or {@link OH_AVCodecOnStreamChanged}.
864  *
865  * @syscap SystemCapability.Multimedia.Media.CodecBase
866  * @since 12
867  */
868 extern const char *OH_MD_KEY_VIDEO_PIC_WIDTH;
869 /**
870  * @brief Key for describing the valid picture height of the video, value type is int32_t.
871  * Get the value from an OH_AVFormat instance, which obtained by calling {@link OH_VideoDecoder_GetOutputDescription}
872  * or {@link OH_AVCodecOnStreamChanged}.
873  *
874  * @syscap SystemCapability.Multimedia.Media.CodecBase
875  * @since 12
876  */
877 extern const char *OH_MD_KEY_VIDEO_PIC_HEIGHT;
878 /**
879  * @brief Key to enable the low latency mode, value type is int32_t (0 or 1):1 is enabled, 0 otherwise.
880  * If enabled, the video encoder or video decoder doesn't hold input and output data more than required by
881  * the codec standards. This is an optional key that applies only to video encoder or video decoder.
882  * It is used in configure.
883  *
884  * @syscap SystemCapability.Multimedia.Media.CodecBase
885  * @since 12
886  */
887 extern const char *OH_MD_KEY_VIDEO_ENABLE_LOW_LATENCY;
888 /**
889  * @brief Key for describing the maximum quantization parameter allowed for video encoder, value type is int32_t.
890  * It is used in configure/setparameter or takes effect immediately with the frame.
891  *
892  * @syscap SystemCapability.Multimedia.Media.CodecBase
893  * @since 12
894  */
895 extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_MAX;
896 /**
897  * @brief Key for describing the minimum quantization parameter allowed for video encoder, value type is int32_t.
898  * It is used in configure/setparameter or takes effect immediately with the frame.
899  *
900  * @syscap SystemCapability.Multimedia.Media.CodecBase
901  * @since 12
902  */
903 extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_MIN;
904 /**
905  * @brief Key for describing the video frame averge quantization parameter, value type is int32_t.
906  * This is a part of a video encoder statistics export feature. This value is emitted from video encoder for a video
907  * frame.
908  *
909  * @syscap SystemCapability.Multimedia.Media.CodecBase
910  * @since 12
911  */
912 extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_AVERAGE;
913 /**
914  * @brief Key for describing video frame mean squared error, value type is double.
915  * This is a part of a video encoder statistics export feature. This value is emitted from video encoder for a video
916  * frame.
917  *
918  * @syscap SystemCapability.Multimedia.Media.CodecBase
919  * @since 12
920  */
921 extern const char *OH_MD_KEY_VIDEO_ENCODER_MSE;
922 /**
923  * @brief Key for decoding timestamp of the buffer in microseconds, value type is int64_t.
924  *
925  * @syscap SystemCapability.Multimedia.Media.CodecBase
926  * @since 12
927  */
928 extern const char *OH_MD_KEY_DECODING_TIMESTAMP;
929 /**
930  * @brief Key for duration of the buffer in microseconds, value type is int64_t.
931  *
932  * @syscap SystemCapability.Multimedia.Media.CodecBase
933  * @since 12
934  */
935 extern const char *OH_MD_KEY_BUFFER_DURATION;
936 /**
937  * @brief Key for sample aspect ratio, value type is double.
938  *
939  * @syscap SystemCapability.Multimedia.Media.CodecBase
940  * @since 12
941  */
942 extern const char *OH_MD_KEY_VIDEO_SAR;
943 /**
944  * @brief Key for start time of file, value type is int64_t.
945  *
946  * @syscap SystemCapability.Multimedia.Media.CodecBase
947  * @since 12
948  */
949 extern const char *OH_MD_KEY_START_TIME;
950 /**
951  * @brief Key for start time of track, value type is int64_t.
952  *
953  * @syscap SystemCapability.Multimedia.Media.CodecBase
954  * @since 12
955  */
956 extern const char *OH_MD_KEY_TRACK_START_TIME;
957 /**
958  * @brief Key for setting the output color space of video decoder. The value type is int32_t.
959  * The supported value is {@link OH_COLORSPACE_BT709_LIMIT}, see {@link OH_NativeBuffer_ColorSpace}. It is used in
960  * {@link OH_VideoDecoder_Configure}. If the color space conversion capability is supported and this key is configured,
961  * the video decoder will automatically transcode an HDR Vivid video to an SDR video with color space BT709.
962  * If color space conversion capability is not supported, {@link OH_VideoDecoder_Configure} returns
963  * {@link AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION}.
964  * If the input video is not an HDR vivid video, an error {@link AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION} will
965  * be reported by callback function {@link OH_AVCodecOnError}.
966  *
967  * @syscap SystemCapability.Multimedia.Media.CodecBase
968  * @since 12
969  */
970 extern const char *OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACE;
971 /**
972  * @brief Key for describing if enable VRR or not, value type is int32_t (0 or 1): 1 is enabled, 0 otherwise.
973  * This is an optional key that applies only to video decoder. It is used in configure.
974  *
975  * @syscap SystemCapability.Multimedia.Media.CodecBase
976  * @since 15
977  */
978 extern const char *OH_MD_KEY_VIDEO_DECODER_OUTPUT_ENABLE_VRR;
979 
980 /**
981  * @brief Key for creation timestamp of a media file, value type is string.
982  *
983  * @syscap SystemCapability.Multimedia.Media.CodecBase
984  * @since 14
985  */
986 extern const char *OH_MD_KEY_CREATION_TIME;
987 
988 /**
989  * @brief Media type.
990  *
991  * @syscap SystemCapability.Multimedia.Media.CodecBase
992  * @since 9
993  */
994 typedef enum OH_MediaType {
995     /* track is audio. */
996     MEDIA_TYPE_AUD = 0,
997     /* track is video. */
998     MEDIA_TYPE_VID = 1,
999     /** track is subtitle.
1000      * @since 12
1001      */
1002     MEDIA_TYPE_SUBTITLE = 2,
1003 } OH_MediaType;
1004 
1005 /**
1006  * @brief AAC Profile
1007  *
1008  * @syscap SystemCapability.Multimedia.Media.CodecBase
1009  * @since 9
1010  */
1011 typedef enum OH_AACProfile {
1012     AAC_PROFILE_LC = 0,
1013     /**
1014      * High-Efficiency AAC profile, contain the audio object types: AAC LC, SBR
1015      * @since 14
1016      */
1017     AAC_PROFILE_HE = 3,
1018     /**
1019      * High-Efficiency AAC v2 profile, contain the audio object types: AAC LC, SBR, PS
1020      * @since 14
1021      */
1022     AAC_PROFILE_HE_V2 = 4,
1023 } OH_AACProfile;
1024 
1025 /**
1026  * @brief AVC Profile
1027  *
1028  * @syscap SystemCapability.Multimedia.Media.CodecBase
1029  * @since 9
1030  */
1031 typedef enum OH_AVCProfile {
1032     AVC_PROFILE_BASELINE = 0,
1033     AVC_PROFILE_HIGH = 4,
1034     AVC_PROFILE_MAIN = 8,
1035 } OH_AVCProfile;
1036 
1037 /**
1038  * @brief HEVC Profile
1039  *
1040  * @syscap SystemCapability.Multimedia.Media.CodecBase
1041  * @since 10
1042  */
1043 typedef enum OH_HEVCProfile {
1044     HEVC_PROFILE_MAIN = 0,
1045     HEVC_PROFILE_MAIN_10 = 1,
1046     HEVC_PROFILE_MAIN_STILL = 2,
1047     /**
1048      * @deprecated since 14
1049      */
1050     HEVC_PROFILE_MAIN_10_HDR10 = 3,
1051     /**
1052      * @deprecated since 14
1053      */
1054     HEVC_PROFILE_MAIN_10_HDR10_PLUS = 4,
1055 } OH_HEVCProfile;
1056 
1057 /**
1058  * @brief Profile: A specified subset of the syntax of VVC.
1059  *
1060  * @syscap SystemCapability.Multimedia.Media.CodecBase
1061  * @since 15
1062  */
1063 typedef enum OH_VVCProfile {
1064     /** Main 10 profile */
1065     VVC_PROFILE_MAIN_10 = 1,
1066     /** Main 12 profile */
1067     VVC_PROFILE_MAIN_12 = 2,
1068     /** Main 12 Intra profile */
1069     VVC_PROFILE_MAIN_12_INTRA = 10,
1070     /** Multilayer Main 10 profile */
1071     VVC_PROFILE_MULTI_MAIN_10 = 17,
1072     /** Main 10 4:4:4 profile */
1073     VVC_PROFILE_MAIN_10_444 = 33,
1074     /** Main 12 4:4:4 profile */
1075     VVC_PROFILE_MAIN_12_444 = 34,
1076     /** Main 16 4:4:4 profile */
1077     VVC_PROFILE_MAIN_16_444 = 36,
1078     /** Main 12 4:4:4 Intra profile */
1079     VVC_PROFILE_MAIN_12_444_INTRA = 42,
1080     /** Main 16 4:4:4 Intra profile */
1081     VVC_PROFILE_MAIN_16_444_INTRA = 44,
1082     /** Multilayer Main 10 4:4:4 profile */
1083     VVC_PROFILE_MULTI_MAIN_10_444 = 49,
1084     /** Main 10 Still Picture profile */
1085     VVC_PROFILE_MAIN_10_STILL = 65,
1086     /** Main 12 Still Picture profile */
1087     VVC_PROFILE_MAIN_12_STILL = 66,
1088     /** Main 10 4:4:4 Still Picture profile */
1089     VVC_PROFILE_MAIN_10_444_STILL = 97,
1090     /** Main 12 4:4:4 Still Picture profile */
1091     VVC_PROFILE_MAIN_12_444_STILL = 98,
1092     /** Main 16 4:4:4 Still Picture profile */
1093     VVC_PROFILE_MAIN_16_444_STILL = 100,
1094 } OH_VVCProfile;
1095 
1096 /**
1097  * @brief Enumerates the muxer output file format
1098  *
1099  * @syscap SystemCapability.Multimedia.Media.CodecBase
1100  * @since 10
1101  */
1102 typedef enum OH_AVOutputFormat {
1103     AV_OUTPUT_FORMAT_DEFAULT = 0,
1104     AV_OUTPUT_FORMAT_MPEG_4 = 2,
1105     AV_OUTPUT_FORMAT_M4A = 6,
1106     /**
1107      * The muxer output amr file format.
1108      * @since 12
1109      */
1110     AV_OUTPUT_FORMAT_AMR = 8,
1111     /**
1112      * The muxer output mp3 file format.
1113      * @since 12
1114      */
1115     AV_OUTPUT_FORMAT_MP3 = 9,
1116     /**
1117      * The muxer output wav file format.
1118      * @since 12
1119      */
1120     AV_OUTPUT_FORMAT_WAV = 10,
1121 } OH_AVOutputFormat;
1122 
1123 /**
1124  * @brief Seek Mode
1125  *
1126  * @syscap SystemCapability.Multimedia.Media.CodecBase
1127  * @since 10
1128  */
1129 typedef enum OH_AVSeekMode {
1130     /* seek to sync sample after the time */
1131     SEEK_MODE_NEXT_SYNC = 0,
1132     /* seek to sync sample before the time */
1133     SEEK_MODE_PREVIOUS_SYNC,
1134     /* seek to sync sample closest to time */
1135     SEEK_MODE_CLOSEST_SYNC,
1136 } OH_AVSeekMode;
1137 
1138 /**
1139  * @brief Scaling Mode
1140  *
1141  * @syscap SystemCapability.Multimedia.Media.CodecBase
1142  * @deprecated since 14
1143  * @useinstead OHScalingModeV2
1144  * @since 10
1145  */
1146 typedef enum OH_ScalingMode {
1147     /**
1148      * @deprecated since 14
1149      * @useinstead OH_SCALING_MODE_SCALE_TO_WINDOW_V2
1150      */
1151     SCALING_MODE_SCALE_TO_WINDOW = 1,
1152     /**
1153      * @deprecated since 14
1154      * @useinstead OH_SCALING_MODE_SCALE_CROP_V2
1155      */
1156     SCALING_MODE_SCALE_CROP = 2,
1157 } OH_ScalingMode;
1158 
1159 /**
1160  * @brief enum Audio Bits Per Coded Sample
1161  *
1162  * @syscap SystemCapability.Multimedia.Media.CodecBase
1163  * @since 10
1164  */
1165 typedef enum OH_BitsPerSample {
1166     SAMPLE_U8 = 0,
1167     SAMPLE_S16LE = 1,
1168     SAMPLE_S24LE = 2,
1169     SAMPLE_S32LE = 3,
1170     SAMPLE_F32LE = 4,
1171     SAMPLE_U8P = 5,
1172     SAMPLE_S16P = 6,
1173     SAMPLE_S24P = 7,
1174     SAMPLE_S32P = 8,
1175     SAMPLE_F32P = 9,
1176     INVALID_WIDTH = -1
1177 } OH_BitsPerSample;
1178 
1179 /**
1180  * @brief Color Primary
1181  *
1182  * @syscap SystemCapability.Multimedia.Media.CodecBase
1183  * @since 10
1184  */
1185 typedef enum OH_ColorPrimary {
1186     COLOR_PRIMARY_BT709 = 1,
1187     COLOR_PRIMARY_UNSPECIFIED = 2,
1188     COLOR_PRIMARY_BT470_M = 4,
1189     COLOR_PRIMARY_BT601_625 = 5,
1190     COLOR_PRIMARY_BT601_525 = 6,
1191     COLOR_PRIMARY_SMPTE_ST240 = 7,
1192     COLOR_PRIMARY_GENERIC_FILM = 8,
1193     COLOR_PRIMARY_BT2020 = 9,
1194     COLOR_PRIMARY_SMPTE_ST428 = 10,
1195     COLOR_PRIMARY_P3DCI = 11,
1196     COLOR_PRIMARY_P3D65 = 12,
1197 } OH_ColorPrimary;
1198 
1199 /**
1200  * @brief Transfer Characteristic
1201  *
1202  * @syscap SystemCapability.Multimedia.Media.CodecBase
1203  * @since 10
1204  */
1205 typedef enum OH_TransferCharacteristic {
1206     TRANSFER_CHARACTERISTIC_BT709 = 1,
1207     TRANSFER_CHARACTERISTIC_UNSPECIFIED = 2,
1208     TRANSFER_CHARACTERISTIC_GAMMA_2_2 = 4,
1209     TRANSFER_CHARACTERISTIC_GAMMA_2_8 = 5,
1210     TRANSFER_CHARACTERISTIC_BT601 = 6,
1211     TRANSFER_CHARACTERISTIC_SMPTE_ST240 = 7,
1212     TRANSFER_CHARACTERISTIC_LINEAR = 8,
1213     TRANSFER_CHARACTERISTIC_LOG = 9,
1214     TRANSFER_CHARACTERISTIC_LOG_SQRT = 10,
1215     TRANSFER_CHARACTERISTIC_IEC_61966_2_4 = 11,
1216     TRANSFER_CHARACTERISTIC_BT1361 = 12,
1217     TRANSFER_CHARACTERISTIC_IEC_61966_2_1 = 13,
1218     TRANSFER_CHARACTERISTIC_BT2020_10BIT = 14,
1219     TRANSFER_CHARACTERISTIC_BT2020_12BIT = 15,
1220     TRANSFER_CHARACTERISTIC_PQ = 16,
1221     TRANSFER_CHARACTERISTIC_SMPTE_ST428 = 17,
1222     TRANSFER_CHARACTERISTIC_HLG = 18,
1223 } OH_TransferCharacteristic;
1224 
1225 /**
1226  * @brief Matrix Coefficient
1227  *
1228  * @syscap SystemCapability.Multimedia.Media.CodecBase
1229  * @since 10
1230  */
1231 typedef enum OH_MatrixCoefficient {
1232     MATRIX_COEFFICIENT_IDENTITY = 0,
1233     MATRIX_COEFFICIENT_BT709 = 1,
1234     MATRIX_COEFFICIENT_UNSPECIFIED = 2,
1235     MATRIX_COEFFICIENT_FCC = 4,
1236     MATRIX_COEFFICIENT_BT601_625 = 5,
1237     MATRIX_COEFFICIENT_BT601_525 = 6,
1238     MATRIX_COEFFICIENT_SMPTE_ST240 = 7,
1239     MATRIX_COEFFICIENT_YCGCO = 8,
1240     MATRIX_COEFFICIENT_BT2020_NCL = 9,
1241     MATRIX_COEFFICIENT_BT2020_CL = 10,
1242     MATRIX_COEFFICIENT_SMPTE_ST2085 = 11,
1243     MATRIX_COEFFICIENT_CHROMATICITY_NCL = 12,
1244     MATRIX_COEFFICIENT_CHROMATICITY_CL = 13,
1245     MATRIX_COEFFICIENT_ICTCP = 14,
1246 } OH_MatrixCoefficient;
1247 
1248 /**
1249  * @brief AVC Level.
1250  *
1251  * @syscap SystemCapability.Multimedia.Media.CodecBase
1252  * @since 12
1253  */
1254 typedef enum OH_AVCLevel {
1255     AVC_LEVEL_1 = 0,
1256     AVC_LEVEL_1b = 1,
1257     AVC_LEVEL_11 = 2,
1258     AVC_LEVEL_12 = 3,
1259     AVC_LEVEL_13 = 4,
1260     AVC_LEVEL_2 = 5,
1261     AVC_LEVEL_21 = 6,
1262     AVC_LEVEL_22 = 7,
1263     AVC_LEVEL_3 = 8,
1264     AVC_LEVEL_31 = 9,
1265     AVC_LEVEL_32 = 10,
1266     AVC_LEVEL_4 = 11,
1267     AVC_LEVEL_41 = 12,
1268     AVC_LEVEL_42 = 13,
1269     AVC_LEVEL_5 = 14,
1270     AVC_LEVEL_51 = 15,
1271     AVC_LEVEL_52 = 16,
1272     AVC_LEVEL_6 = 17,
1273     AVC_LEVEL_61 = 18,
1274     AVC_LEVEL_62 = 19,
1275 } OH_AVCLevel;
1276 
1277 /**
1278  * @brief HEVC Level.
1279  *
1280  * @syscap SystemCapability.Multimedia.Media.CodecBase
1281  * @since 12
1282  */
1283 typedef enum OH_HEVCLevel {
1284     HEVC_LEVEL_1 = 0,
1285     HEVC_LEVEL_2 = 1,
1286     HEVC_LEVEL_21 = 2,
1287     HEVC_LEVEL_3 = 3,
1288     HEVC_LEVEL_31 = 4,
1289     HEVC_LEVEL_4 = 5,
1290     HEVC_LEVEL_41 = 6,
1291     HEVC_LEVEL_5 = 7,
1292     HEVC_LEVEL_51 = 8,
1293     HEVC_LEVEL_52 = 9,
1294     HEVC_LEVEL_6 = 10,
1295     HEVC_LEVEL_61 = 11,
1296     HEVC_LEVEL_62 = 12,
1297 } OH_HEVCLevel;
1298 
1299 /**
1300  * @brief VVC Level: A defined set of constraints on the values that may be taken by the syntax elements and variables
1301  * of VVC, or the value of a transform coefficient prior to scaling.
1302  *
1303  * @syscap SystemCapability.Multimedia.Media.CodecBase
1304  * @since 15
1305  */
1306 typedef enum OH_VVCLevel {
1307     /** VVC level 1.0 */
1308     VVC_LEVEL_1 = 16,
1309     /** VVC level 2.0 */
1310     VVC_LEVEL_2 = 32,
1311     /** VVC level 2.1 */
1312     VVC_LEVEL_21 = 35,
1313     /** VVC level 3.0 */
1314     VVC_LEVEL_3 = 48,
1315     /** VVC level 3.1 */
1316     VVC_LEVEL_31 = 51,
1317     /** VVC level 4.0 */
1318     VVC_LEVEL_4 = 64,
1319     /** VVC level 4.1 */
1320     VVC_LEVEL_41 = 67,
1321     /** VVC level 5.0 */
1322     VVC_LEVEL_5 = 80,
1323     /** VVC level 5.1 */
1324     VVC_LEVEL_51 = 83,
1325     /** VVC level 5.2 */
1326     VVC_LEVEL_52 = 86,
1327     /** VVC level 6.0 */
1328     VVC_LEVEL_6 = 96,
1329     /** VVC level 6.1 */
1330     VVC_LEVEL_61 = 99,
1331     /** VVC level 6.2 */
1332     VVC_LEVEL_62 = 102,
1333     /** VVC level 6.3 */
1334     VVC_LEVEL_63 = 105,
1335     /** VVC level 15.5 */
1336     VVC_LEVEL_155 = 255,
1337 } OH_VVCLevel;
1338 
1339 /**
1340  * @brief The reference mode in temporal group of picture.
1341  *
1342  * @syscap SystemCapability.Multimedia.Media.CodecBase
1343  * @since 12
1344  */
1345 typedef enum OH_TemporalGopReferenceMode {
1346     /** Refer to latest short-term reference frame. */
1347     ADJACENT_REFERENCE = 0,
1348     /** Refer to latest long-term reference frame. */
1349     JUMP_REFERENCE = 1,
1350     /** Uniformly scaled reference structure, which has even distribution of video frames after drop the highest
1351      *  enhance layer. The temporal group of pictures must be power of 2. */
1352     UNIFORMLY_SCALED_REFERENCE = 2,
1353 } OH_TemporalGopReferenceMode;
1354 
1355 /**
1356  * @brief The bitrate mode of encoder.
1357  *
1358  * Change the location of the header file, since 14.
1359  *
1360  * @syscap SystemCapability.Multimedia.Media.CodecBase
1361  * @since 10
1362  */
1363 typedef enum OH_BitrateMode {
1364     /** Constant Bit rate mode. */
1365     BITRATE_MODE_CBR = 0,
1366     /** Variable Bit rate mode. */
1367     BITRATE_MODE_VBR = 1,
1368     /** Constant Quality mode. */
1369     BITRATE_MODE_CQ = 2
1370 } OH_BitrateMode;
1371 
1372 #ifdef __cplusplus
1373 }
1374 #endif
1375 
1376 #endif // NATIVE_AVCODEC_BASE_H
1377 /** @} */