• 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 #ifndef AVCODEC_INFO_H
17 #define AVCODEC_INFO_H
18 
19 #include <cstdint>
20 #include <memory>
21 #include <vector>
22 #include "av_common.h"
23 #include "nocopyable.h"
24 #include "avcodec_audio_common.h"
25 
26 namespace OHOS {
27 namespace MediaAVCodec {
28 /**
29  * @brief AVCodec Type
30  *
31  * @since 3.1
32  * @version 4.0
33  */
34 enum AVCodecType : int32_t {
35     AVCODEC_TYPE_NONE = -1,
36     AVCODEC_TYPE_VIDEO_ENCODER = 0,
37     AVCODEC_TYPE_VIDEO_DECODER,
38     AVCODEC_TYPE_AUDIO_ENCODER,
39     AVCODEC_TYPE_AUDIO_DECODER,
40 };
41 
42 /**
43  * @brief AVCodec Category
44  *
45  * @since 3.1
46  * @version 4.0
47  */
48 enum class AVCodecCategory : int32_t {
49     AVCODEC_NONE = -1,
50     AVCODEC_HARDWARE = 0,
51     AVCODEC_SOFTWARE,
52 };
53 
54 /**
55  * @brief Range contain min and max value
56  *
57  * @since 3.1
58  * @version 4.0
59  */
60 struct Range {
61     int32_t minVal;
62     int32_t maxVal;
RangeRange63     Range() : minVal(0), maxVal(0) {}
RangeRange64     Range(const int32_t &min, const int32_t &max)
65     {
66         if (min <= max) {
67             this->minVal = min;
68             this->maxVal = max;
69         } else {
70             this->minVal = 0;
71             this->maxVal = 0;
72         }
73     }
74 
CreateRange75     Range Create(const int32_t &min, const int32_t &max)
76     {
77         return Range(min, max);
78     }
79 
IntersectRange80     Range Intersect(const int32_t &min, const int32_t &max)
81     {
82         int32_t minCmp = this->minVal > min ? this->minVal : min;
83         int32_t maxCmp = this->maxVal < max ? this->maxVal : max;
84         return this->Create(minCmp, maxCmp);
85     }
86 
IntersectRange87     Range Intersect(const Range &range)
88     {
89         int32_t minCmp = this->minVal > range.minVal ? this->minVal : range.minVal;
90         int32_t maxCmp = this->maxVal < range.maxVal ? this->maxVal : range.maxVal;
91         return this->Create(minCmp, maxCmp);
92     }
93 };
94 
95 /**
96  * @brief ImgSize contain width and height
97  *
98  * @since 3.1
99  * @version 4.0
100  */
101 struct ImgSize {
102     int32_t width;
103     int32_t height;
104 
ImgSizeImgSize105     ImgSize() : width(0), height(0) {}
106 
ImgSizeImgSize107     ImgSize(const int32_t &width, const int32_t &height)
108     {
109         this->width = width;
110         this->height = height;
111     }
112 
113     bool operator<(const ImgSize &p) const
114     {
115         return (width < p.width) || (width == p.width && height < p.height);
116     }
117 };
118 
119 /**
120  * @brief Capability Data struct of Codec, parser from config file
121  *
122  * @since 3.1
123  * @version 4.0
124  */
125 struct CapabilityData {
126     std::string codecName = "";
127     int32_t codecType = AVCODEC_TYPE_NONE;
128     std::string mimeType = "";
129     bool isVendor = false;
130     int32_t maxInstance = 0;
131     Range bitrate;
132     Range channels;
133     Range complexity;
134     ImgSize alignment;
135     Range width;
136     Range height;
137     Range frameRate;
138     Range encodeQuality;
139     Range blockPerFrame;
140     Range blockPerSecond;
141     ImgSize blockSize;
142     std::vector<int32_t> sampleRate;
143     std::vector<int32_t> pixFormat;
144     std::vector<int32_t> bitDepth;
145     std::vector<int32_t> profiles;
146     std::vector<int32_t> bitrateMode;
147     std::map<int32_t, std::vector<int32_t>> profileLevelsMap;
148     std::map<ImgSize, Range> measuredFrameRate;
149     bool supportSwapWidthHeight = false;
150 };
151 
152 struct LevelParams {
153     int32_t maxBlockPerFrame = 0;
154     int32_t maxBlockPerSecond = 0;
155     int32_t maxFrameRate = 0;
156     int32_t maxWidth = 0;
157     int32_t maxHeight = 0;
LevelParamsLevelParams158     LevelParams(const int32_t &blockPerSecond, const int32_t &blockPerFrame, const int32_t &frameRate,
159                 const int32_t &width, const int32_t height)
160     {
161         this->maxBlockPerFrame = blockPerFrame;
162         this->maxBlockPerSecond = blockPerSecond;
163         this->maxFrameRate = frameRate;
164         this->maxWidth = width;
165         this->maxHeight = height;
166     }
LevelParamsLevelParams167     LevelParams(const int32_t &blockPerSecond, const int32_t &blockPerFrame)
168     {
169         this->maxBlockPerFrame = blockPerFrame;
170         this->maxBlockPerSecond = blockPerSecond;
171     }
172 };
173 
174 class __attribute__((visibility("default"))) AVCodecInfo {
175 public:
176     explicit AVCodecInfo(CapabilityData *capabilityData);
177     ~AVCodecInfo();
178 
179     /**
180      * @brief Get name of this codec, used to create the codec instance.
181      * @return Returns codec name.
182      * @since 3.1
183      * @version 4.0
184      */
185     std::string GetName();
186 
187     /**
188      * @brief Get type of this codec
189      * @return Returns codec type, see {@link AVCodecType}
190      * @since 3.1
191      * @version 4.0
192      */
193     AVCodecType GetType();
194 
195     /**
196      * @brief Get mime type of this codec
197      * @return Returns codec mime type, see {@link CodecMimeType}
198      * @since 3.1
199      * @version 4.0
200      */
201     std::string GetMimeType();
202 
203     /**
204      * @brief Check whether the codec is accelerated by hardware.
205      * @return Returns true if the codec is hardware accelerated; false otherwise.
206      * @since 3.1
207      * @version 4.0
208      */
209     bool IsHardwareAccelerated();
210 
211     /**
212      * @brief Check whether the codec is accelerated by hardware.
213      * @return Returns true if the codec is hardware accelerated; false otherwise.
214      * @since 3.1
215      * @version 4.0
216      */
217     int32_t GetMaxSupportedInstances();
218 
219     /**
220      * @brief Check whether the codec is software implemented only.
221      * @return Returns true if the codec is software implemented only; false otherwise.
222      * @since 3.1
223      * @version 4.0
224      */
225     bool IsSoftwareOnly();
226 
227     /**
228      * @brief Check whether the codec is provided by vendor.
229      * @return Returns true if the codec is provided by vendor; false otherwise.
230      * @since 3.1
231      * @version 4.0
232      */
233     bool IsVendor();
234 
235     /**
236      * @brief Get supported codec profile number.
237      * @return Returns an array of supported codec profile number. For details, see {@link AACProfile}.
238      * @since 3.1
239      * @version 4.0
240      */
241     std::map<int32_t, std::vector<int32_t>> GetSupportedLevelsForProfile();
242 private:
243     CapabilityData *data_;
244 };
245 
246 class __attribute__((visibility("default"))) VideoCaps {
247 public:
248     explicit VideoCaps(CapabilityData *capabilityData);
249     ~VideoCaps();
250 
251     /**
252      * @brief Get codec information,  such as the codec name, codec type,
253      * whether hardware acceleration is supported, whether only software is supported,
254      * and whether the codec is provided by the vendor.
255      * @return Returns the pointer of {@link AVCodecInfo}.
256      * @since 3.1
257      * @version 4.0
258      */
259     std::shared_ptr<AVCodecInfo> GetCodecInfo();
260 
261     /**
262      * @brief Get supported bitrate range.
263      * @return Returns the range of supported bitrates.
264      * @since 3.1
265      * @version 4.0
266      */
267     Range GetSupportedBitrate();
268 
269     /**
270      * @brief Get supported video raw formats.
271      * @return Returns an array of supported formats. For Details, see {@link VideoPixelFormat}.
272      * @since 3.1
273      * @version 4.0
274      */
275     std::vector<int32_t> GetSupportedFormats();
276 
277     /**
278      * @brief Get supported alignment of video height, only used for video codecs.
279      * @return Returns the supported alignment of video height (in pixels).
280      * @since 3.1
281      * @version 4.0
282      */
283     int32_t GetSupportedHeightAlignment();
284 
285     /**
286      * @brief Get supported alignment of video width, only used for video codecs.
287      * @return Returns the supported alignment of video width (in pixels).
288      * @since 3.1
289      * @version 4.0
290      */
291     int32_t GetSupportedWidthAlignment();
292 
293     /**
294      * @brief Get supported width range of video.
295      * @return Returns the supported width range of video.
296      * @since 3.1
297      * @version 4.0
298      */
299     Range GetSupportedWidth();
300 
301     /**
302      * @brief Get supported height range of video.
303      * @return Returns the supported height range of video.
304      * @since 3.1
305      * @version 4.0
306      */
307     Range GetSupportedHeight();
308 
309     /**
310      * @brief Get supported profiles of this codec.
311      * @return Returns an array of supported profiles:
312      * returns {@link H263Profile} array if codec is h263,
313      * returns {@link AVCProfile} array if codec is h264,
314      * returns {@link HEVCProfile} array if codec is h265,
315      * returns {@link MPEG2Profile} array if codec is mpeg2,
316      * returns {@link MPEG4Profile} array if codec is mpeg4,
317      * returns {@link VP8Profile} array if codec is vp8.
318      * @since 3.1
319      * @version 4.0
320      */
321     std::vector<int32_t> GetSupportedProfiles();
322 
323     /**
324      * @brief Get supported codec level array.
325      * @return Returns an array of supported codec level number.
326      * @since 3.1
327      * @version 4.0
328      */
329     std::vector<int32_t> GetSupportedLevels();
330 
331     /**
332      * @brief Get supported video encode quality Range.
333      * @return Returns an array of supported video encode quality Range.
334      * @since 3.1
335      * @version 4.0
336      */
337     Range GetSupportedEncodeQuality();
338 
339     /**
340      * @brief Check whether the width and height is supported.
341      * @param width Indicates the specified video width (in pixels).
342      * @param height Indicates the specified video height (in pixels).
343      * @return Returns true if the codec supports {@link width} * {@link height} size video, false otherwise.
344      * @since 3.1
345      * @version 4.0
346      */
347     bool IsSizeSupported(int32_t width, int32_t height);
348 
349     /**
350      * @brief Get supported frameRate.
351      * @return Returns the supported frameRate range of video.
352      * @since 3.1
353      * @version 4.0
354      */
355     Range GetSupportedFrameRate();
356 
357     /**
358      * @brief Get supported frameRate range for the specified width and height.
359      * @param width Indicates the specified video width (in pixels).
360      * @param height Indicates the specified video height (in pixels).
361      * @return Returns the supported frameRate range for the specified width and height.
362      * @since 3.1
363      * @version 4.0
364      */
365     Range GetSupportedFrameRatesFor(int32_t width, int32_t height);
366 
367     /**
368      * @brief Check whether the size and frameRate is supported.
369      * @param width Indicates the specified video width (in pixels).
370      * @param height Indicates the specified video height (in pixels).
371      * @param frameRate Indicates the specified video frameRate.
372      * @return Returns true if the codec supports the specified size and frameRate; false otherwise.
373      * @since 3.1
374      * @version 4.0
375      */
376     bool IsSizeAndRateSupported(int32_t width, int32_t height, double frameRate);
377 
378     /**
379      * @brief Get preferred frameRate range for the specified width and height,
380      * these framerates can be reach the performance.
381      * @param width Indicates the specified video width (in pixels).
382      * @param height Indicates the specified video height (in pixels).
383      * @return Returns preferred frameRate range for the specified width and height.
384      * @since 3.1
385      * @version 4.0
386      */
387     Range GetPreferredFrameRate(int32_t width, int32_t height);
388 
389     /**
390      * @brief Get supported encode bitrate mode.
391      * @return Returns an array of supported encode bitrate mode. For details, see {@link VideoEncodeBitrateMode}.
392      * @since 3.1
393      * @version 4.0
394      */
395     std::vector<int32_t> GetSupportedBitrateMode();
396 
397     /**
398      * @brief Get supported encode qualit range.
399      * @return Returns supported encode qualit range.
400      * @since 3.1
401      * @version 4.0
402      */
403     Range GetSupportedQuality();
404 
405     /**
406      * @brief Get supported encode complexity range.
407      * @return Returns supported encode complexity range.
408      * @since 3.1
409      * @version 4.0
410      */
411     Range GetSupportedComplexity();
412 
413     /**
414      * @brief Check video encoder wether support request key frame dynamicly.
415      * @return Returns true if support, false not support.
416      * @since 3.1
417      * @version 4.0
418      */
419     bool IsSupportDynamicIframe();
420 
421     Range GetVideoHeightRangeForWidth(int32_t width);
422     Range GetVideoWidthRangeForHeight(int32_t height);
423 
424 private:
425     CapabilityData *data_;
426     int32_t blockWidth_;
427     int32_t blockHeight_;
428     Range horizontalBlockRange_;
429     Range verticalBlockRange_;
430     Range blockPerFrameRange_;
431     Range blockPerSecondRange_;
432     Range widthRange_;
433     Range heightRange_;
434     Range frameRateRange_;
435     void InitParams();
436     void UpdateParams();
437     void LoadLevelParams();
438     void LoadAVCLevelParams();
439     void LoadMPEGLevelParams(const std::string &mime);
440     ImgSize MatchClosestSize(const ImgSize &imgSize);
441     int32_t DivCeil(const int32_t &dividend, const int32_t &divisor);
442     Range DivRange(const Range &range, const int32_t &divisor);
443     void UpdateBlockParams(const int32_t &blockWidth, const int32_t &blockHeight, Range &blockPerFrameRange,
444                            Range &blockPerSecondRange);
445 };
446 
447 constexpr uint32_t MAX_MAP_SIZE = 20;
448 
449 class __attribute__((visibility("default"))) AudioCaps {
450 public:
451     explicit AudioCaps(CapabilityData *capabilityData);
452     ~AudioCaps();
453 
454     /**
455      * @brief Get codec information,  such as the codec name, codec type,
456      * whether hardware acceleration is supported, whether only software is supported,
457      * and whether the codec is provided by the vendor.
458      * @return Returns the pointer of {@link AVCodecInfo}
459      * @since 3.1
460      * @version 4.0
461      */
462     std::shared_ptr<AVCodecInfo> GetCodecInfo();
463 
464     /**
465      * @brief Get supported bitrate range.
466      * @return Returns the range of supported bitrates.
467      * @since 3.1
468      * @version 4.0
469      */
470     Range GetSupportedBitrate();
471 
472     /**
473      * @brief Get supported channel range.
474      * @return Returns the range of supported channel.
475      * @since 3.1
476      * @version 4.0
477      */
478     Range GetSupportedChannel();
479 
480     /**
481      * @brief Get supported audio raw format range.
482      * @return Returns the range of supported audio raw format. For details, see {@link AudioSampleFormat}.
483      * @since 3.1
484      * @version 4.0
485      */
486     std::vector<int32_t> GetSupportedFormats();
487 
488     /**
489      * @brief Get supported audio samplerates.
490      * @return Returns an array of supported samplerates.
491      * @since 3.1
492      * @version 4.0
493      */
494     std::vector<int32_t> GetSupportedSampleRates();
495 
496     /**
497      * @brief Get supported codec profile number.
498      * @return Returns an array of supported codec profile number. For details, see {@link AACProfile}.
499      * @since 3.1
500      * @version 4.0
501      */
502     std::vector<int32_t> GetSupportedProfiles();
503 
504     /**
505      * @brief Get supported codec level array.
506      * @return Returns an array of supported codec level number.
507      * @since 3.1
508      * @version 4.0
509      */
510     std::vector<int32_t> GetSupportedLevels();
511 
512     /**
513      * @brief Get supported encode complexity range.
514      * @return Returns supported encode complexity range.
515      * @since 3.1
516      * @version 4.0
517      */
518     Range GetSupportedComplexity();
519 
520 private:
521     CapabilityData *data_;
522 };
523 
524 /**
525  * @brief Enumerates the codec mime type.
526  */
527 class CodecMimeType {
528 public:
529     static constexpr std::string_view VIDEO_H263 = "video/h263";
530     static constexpr std::string_view VIDEO_AVC = "video/avc";
531     static constexpr std::string_view VIDEO_MPEG2 = "video/mpeg2";
532     static constexpr std::string_view VIDEO_HEVC = "video/hevc";
533     static constexpr std::string_view VIDEO_MPEG4 = "video/mp4v-es";
534     static constexpr std::string_view VIDEO_VP8 = "video/x-vnd.on2.vp8";
535     static constexpr std::string_view VIDEO_VP9 = "video/x-vnd.on2.vp9";
536     static constexpr std::string_view AUDIO_AMR_NB = "audio/3gpp";
537     static constexpr std::string_view AUDIO_AMR_WB = "audio/amr-wb";
538     static constexpr std::string_view AUDIO_MPEG = "audio/mpeg";
539     static constexpr std::string_view AUDIO_AAC = "audio/mp4a-latm";
540     static constexpr std::string_view AUDIO_VORBIS = "audio/vorbis";
541     static constexpr std::string_view AUDIO_OPUS = "audio/opus";
542     static constexpr std::string_view AUDIO_FLAC = "audio/flac";
543     static constexpr std::string_view AUDIO_RAW = "audio/raw";
544     static constexpr std::string_view IMAGE_JPG = "image/jpeg";
545     static constexpr std::string_view IMAGE_PNG = "image/png";
546     static constexpr std::string_view IMAGE_BMP = "image/bmp";
547 };
548 
549 /**
550  * @brief AVC Profile
551  *
552  * @since 3.1
553  * @version 4.0
554  */
555 enum AVCProfile : int32_t {
556     AVC_PROFILE_BASELINE = 0,
557     AVC_PROFILE_CONSTRAINED_BASELINE = 1,
558     AVC_PROFILE_CONSTRAINED_HIGH = 2,
559     AVC_PROFILE_EXTENDED = 3,
560     AVC_PROFILE_HIGH = 4,
561     AVC_PROFILE_HIGH_10 = 5,
562     AVC_PROFILE_HIGH_422 = 6,
563     AVC_PROFILE_HIGH_444 = 7,
564     AVC_PROFILE_MAIN = 8,
565 };
566 
567 /**
568  * @brief HEVC Profile
569  *
570  * @since 3.1
571  * @version 4.0
572  */
573 enum HEVCProfile : int32_t {
574     HEVC_PROFILE_MAIN = 0,
575     HEVC_PROFILE_MAIN_10 = 1,
576     HEVC_PROFILE_MAIN_STILL = 2,
577     HEVC_PROFILE_MAIN_10_HDR10 = 3,
578     HEVC_PROFILE_MAIN_10_HDR10_PLUS = 4,
579 };
580 
581 /**
582  * @brief MPEG2 Profile
583  *
584  * @since 3.1
585  * @version 4.0
586  */
587 enum MPEG2Profile : int32_t {
588     MPEG2_PROFILE_422 = 0,
589     MPEG2_PROFILE_HIGH = 1,
590     MPEG2_PROFILE_MAIN = 2,
591     MPEG2_PROFILE_SNR = 3,
592     MPEG2_PROFILE_SIMPLE = 4,
593     MPEG2_PROFILE_SPATIAL = 5,
594 };
595 
596 /**
597  * @brief MPEG4 Profile
598  *
599  * @since 3.1
600  * @version 4.0
601  */
602 enum MPEG4Profile : int32_t {
603     MPEG4_PROFILE_ADVANCED_CODING = 0,
604     MPEG4_PROFILE_ADVANCED_CORE = 1,
605     MPEG4_PROFILE_ADVANCED_REAL_TIME = 2,
606     MPEG4_PROFILE_ADVANCED_SCALABLE = 3,
607     MPEG4_PROFILE_ADVANCED_SIMPLE = 4,
608     MPEG4_PROFILE_BASIC_ANIMATED = 5,
609     MPEG4_PROFILE_CORE = 6,
610     MPEG4_PROFILE_CORE_SCALABLE = 7,
611     MPEG4_PROFILE_HYBRID = 8,
612     MPEG4_PROFILE_MAIN = 9,
613     MPEG4_PROFILE_NBIT = 10,
614     MPEG4_PROFILE_SCALABLE_TEXTURE = 11,
615     MPEG4_PROFILE_SIMPLE = 12,
616     MPEG4_PROFILE_SIMPLE_FBA = 13,
617     MPEG4_PROFILE_SIMPLE_FACE = 14,
618     MPEG4_PROFILE_SIMPLE_SCALABLE = 15,
619 };
620 
621 /**
622  * @brief H263 Profile
623  *
624  * @since 3.1
625  * @version 4.0
626  */
627 enum H263Profile : int32_t {
628     H263_PROFILE_BACKWARD_COMPATIBLE = 0,
629     H263_PROFILE_BASELINE = 1,
630     H263_PROFILE_H320_CODING = 2,
631     H263_PROFILE_HIGH_COMPRESSION = 3,
632     H263_PROFILE_HIGH_LATENCY = 4,
633     H263_PROFILE_ISW_V2 = 5,
634     H263_PROFILE_ISW_V3 = 6,
635     H263_PROFILE_INTERLACE = 7,
636     H263_PROFILE_INTERNET = 8,
637 };
638 
639 /**
640  * @brief
641  *
642  * @since 3.1
643  * @version 4.0
644  */
645 enum VP8Profile : int32_t {
646     VP8_PROFILE_MAIN = 0,
647 };
648 
649 /**
650  * @brief
651  *
652  * @since 3.1
653  * @version 4.0
654  */
655 enum AVCLevel : int32_t {
656     AVC_LEVEL_1 = 0,
657     AVC_LEVEL_1b = 1,
658     AVC_LEVEL_11 = 2,
659     AVC_LEVEL_12 = 3,
660     AVC_LEVEL_13 = 4,
661     AVC_LEVEL_2 = 5,
662     AVC_LEVEL_21 = 6,
663     AVC_LEVEL_22 = 7,
664     AVC_LEVEL_3 = 8,
665     AVC_LEVEL_31 = 9,
666     AVC_LEVEL_32 = 10,
667     AVC_LEVEL_4 = 11,
668     AVC_LEVEL_41 = 12,
669     AVC_LEVEL_42 = 13,
670     AVC_LEVEL_5 = 14,
671     AVC_LEVEL_51 = 15,
672 };
673 
674 /**
675  * @brief
676  *
677  * @since 3.1
678  * @version 4.0
679  */
680 enum HEVCLevel : int32_t {
681     HEVC_LEVEL_1 = 0,
682     HEVC_LEVEL_2 = 1,
683     HEVC_LEVEL_21 = 2,
684     HEVC_LEVEL_3 = 3,
685     HEVC_LEVEL_31 = 4,
686     HEVC_LEVEL_4 = 5,
687     HEVC_LEVEL_41 = 6,
688     HEVC_LEVEL_5 = 7,
689     HEVC_LEVEL_51 = 8,
690     HEVC_LEVEL_52 = 9,
691     HEVC_LEVEL_6 = 10,
692     HEVC_LEVEL_61 = 11,
693     HEVC_LEVEL_62 = 12,
694 };
695 
696 /**
697  * @brief
698  *
699  * @since 3.1
700  * @version 4.0
701  */
702 enum MPEG2Level : int32_t {
703     MPEG2_LEVEL_LL = 0,
704     MPEG2_LEVEL_ML = 1,
705     MPEG2_LEVEL_H14 = 2,
706     MPEG2_LEVEL_HL = 3,
707 };
708 
709 /**
710  * @brief
711  *
712  * @since 3.1
713  * @version 4.0
714  */
715 enum MPEG4Level : int32_t {
716     MPEG4_LEVEL_0 = 0,
717     MPEG4_LEVEL_0B = 1,
718     MPEG4_LEVEL_1 = 2,
719     MPEG4_LEVEL_2 = 3,
720     MPEG4_LEVEL_3 = 4,
721     MPEG4_LEVEL_4 = 5,
722     MPEG4_LEVEL_4A = 6,
723     MPEG4_LEVEL_5 = 7,
724 };
725 
726 /**
727  * @brief
728  *
729  * @since 3.1
730  * @version 4.0
731  */
732 enum VideoEncodeBitrateMode : int32_t {
733     /**
734      * constant bit rate mode.
735      */
736     CBR = 0,
737     /**
738      * variable bit rate mode.
739      */
740     VBR = 1,
741     /**
742      * constant quality mode.
743      */
744     CQ = 2,
745 };
746 } // namespace MediaAVCodec
747 } // namespace OHOS
748 #endif // AVCODEC_INFO_H