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