• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# native_avcapability.h
2
3## Overview
4
5The file declares the native APIs used to query the codec capability.
6
7**File to include**: <multimedia/player_framework/native_avcapability.h>
8
9**Library**: libnative_media_codecbase.so
10
11**System capability**: SystemCapability.Multimedia.Media.CodecBase
12
13**Since**: 10
14
15**Related module**: [AVCapability](capi-avcapability.md)
16
17## Summary
18
19### Structs
20
21| Name| typedef Keyword| Description|
22| -- | -- | -- |
23| [OH_AVRange](capi-avcapability-oh-avrange.md) | OH_AVRange | Describes the value range, which contains the minimum value and maximum value.|
24| [OH_AVCapability](capi-avcapability-oh-avcapability.md) | OH_AVCapability | Describes a native object for the OH_AVCapability interface.|
25
26### Enums
27
28| Name| typedef Keyword| Description|
29| -- | -- | -- |
30| [OH_AVCodecCategory](#oh_avcodeccategory) | OH_AVCodecCategory | Enumerates the codec categories.|
31| [OH_AVCapabilityFeature](#oh_avcapabilityfeature) | OH_AVCapabilityFeature | Enumerates the optional features that can be used in specific codec scenarios.|
32
33### Functions
34
35| Name| Description|
36| -- | -- |
37| [OH_AVCapability *OH_AVCodec_GetCapability(const char *mime, bool isEncoder)](#oh_avcodec_getcapability) | Obtains the codec capability recommended by the system.|
38| [OH_AVCapability *OH_AVCodec_GetCapabilityByCategory(const char *mime, bool isEncoder, OH_AVCodecCategory category)](#oh_avcodec_getcapabilitybycategory) | Obtains the codec capability by category, which can be a hardware codec or software codec.|
39| [bool OH_AVCapability_IsHardware(OH_AVCapability *capability)](#oh_avcapability_ishardware) | Checks whether a codec capability instance describes a hardware codec.|
40| [const char *OH_AVCapability_GetName(OH_AVCapability *capability)](#oh_avcapability_getname) | Obtains the codec name.|
41| [int32_t OH_AVCapability_GetMaxSupportedInstances(OH_AVCapability *capability)](#oh_avcapability_getmaxsupportedinstances) | Obtains the maximum number of codec instances supported by a codec.|
42| [OH_AVErrCode OH_AVCapability_GetEncoderBitrateRange(OH_AVCapability *capability, OH_AVRange *bitrateRange)](#oh_avcapability_getencoderbitraterange) | Obtains the bit rate range supported by an encoder.|
43| [bool OH_AVCapability_IsEncoderBitrateModeSupported(OH_AVCapability *capability, OH_BitrateMode bitrateMode)](#oh_avcapability_isencoderbitratemodesupported) | Checks whether an encoder supports a specific bit rate mode.|
44| [OH_AVErrCode OH_AVCapability_GetEncoderQualityRange(OH_AVCapability *capability, OH_AVRange *qualityRange)](#oh_avcapability_getencoderqualityrange) | Obtains the quality range supported by an encoder.|
45| [OH_AVErrCode OH_AVCapability_GetEncoderComplexityRange(OH_AVCapability *capability, OH_AVRange *complexityRange)](#oh_avcapability_getencodercomplexityrange) | Obtains the complexity range supported by an encoder.|
46| [OH_AVErrCode OH_AVCapability_GetAudioSupportedSampleRates(OH_AVCapability *capability, const int32_t **sampleRates, uint32_t *sampleRateNum)](#oh_avcapability_getaudiosupportedsamplerates) | Obtains the sample rates supported by an audio codec.|
47| [OH_AVErrCode OH_AVCapability_GetAudioChannelCountRange(OH_AVCapability *capability, OH_AVRange *channelCountRange)](#oh_avcapability_getaudiochannelcountrange) | Obtains the count range of audio channels supported by an audio codec.|
48| [OH_AVErrCode OH_AVCapability_GetVideoWidthAlignment(OH_AVCapability *capability, int32_t *widthAlignment)](#oh_avcapability_getvideowidthalignment) | Obtains the video width alignment supported by a video codec.|
49| [OH_AVErrCode OH_AVCapability_GetVideoHeightAlignment(OH_AVCapability *capability, int32_t *heightAlignment)](#oh_avcapability_getvideoheightalignment) | Obtains the video height alignment supported by a video codec.|
50| [OH_AVErrCode OH_AVCapability_GetVideoWidthRangeForHeight(OH_AVCapability *capability, int32_t height, OH_AVRange *widthRange)](#oh_avcapability_getvideowidthrangeforheight) | Obtains the video width range supported by a video codec based on a given height.|
51| [OH_AVErrCode OH_AVCapability_GetVideoHeightRangeForWidth(OH_AVCapability *capability, int32_t width, OH_AVRange *heightRange)](#oh_avcapability_getvideoheightrangeforwidth) | Obtains the video height range supported by a video codec based on a given width.|
52| [OH_AVErrCode OH_AVCapability_GetVideoWidthRange(OH_AVCapability *capability, OH_AVRange *widthRange)](#oh_avcapability_getvideowidthrange) | Obtains the video width range supported by a video codec.|
53| [OH_AVErrCode OH_AVCapability_GetVideoHeightRange(OH_AVCapability *capability, OH_AVRange *heightRange)](#oh_avcapability_getvideoheightrange) | Obtains the video height range supported by a video codec.|
54| [bool OH_AVCapability_IsVideoSizeSupported(OH_AVCapability *capability, int32_t width, int32_t height)](#oh_avcapability_isvideosizesupported) | Checks whether a video codec supports a specific video size.|
55| [OH_AVErrCode OH_AVCapability_GetVideoFrameRateRange(OH_AVCapability *capability, OH_AVRange *frameRateRange)](#oh_avcapability_getvideoframeraterange) | Obtains the video frame rate range supported by a video codec.|
56| [OH_AVErrCode OH_AVCapability_GetVideoFrameRateRangeForSize(OH_AVCapability *capability, int32_t width, int32_t height, OH_AVRange *frameRateRange)](#oh_avcapability_getvideoframeraterangeforsize) | Obtains the video frame rate range supported by a video codec based on a given video size.|
57| [bool OH_AVCapability_AreVideoSizeAndFrameRateSupported(OH_AVCapability *capability, int32_t width, int32_t height, int32_t frameRate)](#oh_avcapability_arevideosizeandframeratesupported) | Checks whether a video codec supports the combination of a video size and frame rate.|
58| [OH_AVErrCode OH_AVCapability_GetVideoSupportedPixelFormats(OH_AVCapability *capability, const int32_t **pixelFormats, uint32_t *pixelFormatNum)](#oh_avcapability_getvideosupportedpixelformats) | Obtains the video pixel formats supported by a video codec.|
59| [OH_AVErrCode OH_AVCapability_GetSupportedProfiles(OH_AVCapability *capability, const int32_t **profiles, uint32_t *profileNum)](#oh_avcapability_getsupportedprofiles) | Obtains the profiles supported by a codec.|
60| [OH_AVErrCode OH_AVCapability_GetSupportedLevelsForProfile(OH_AVCapability *capability, int32_t profile, const int32_t **levels, uint32_t *levelNum)](#oh_avcapability_getsupportedlevelsforprofile) | Obtains the codec levels supported by a profile.|
61| [bool OH_AVCapability_AreProfileAndLevelSupported(OH_AVCapability *capability, int32_t profile, int32_t level)](#oh_avcapability_areprofileandlevelsupported) | Checks whether a codec supports the combination of a profile and level.|
62| [bool OH_AVCapability_IsFeatureSupported(OH_AVCapability *capability, OH_AVCapabilityFeature feature)](#oh_avcapability_isfeaturesupported) | Checks whether a codec supports a feature.|
63| [OH_AVFormat *OH_AVCapability_GetFeatureProperties(OH_AVCapability *capability, OH_AVCapabilityFeature feature)](#oh_avcapability_getfeatureproperties) | Obtains the properties of a feature. You must manually release the OH_AVFormat instance in the return value.|
64
65## Enum Description
66
67### OH_AVCodecCategory
68
69```
70enum OH_AVCodecCategory
71```
72
73**Description**
74
75Enumerates the codec categories.
76
77**System capability**: SystemCapability.Multimedia.Media.CodecBase
78
79**Since**: 10
80
81| Value| Description|
82| -- | -- |
83| HARDWARE = 0 | Hardware codec.|
84| SOFTWARE | Software codec.|
85
86### OH_AVCapabilityFeature
87
88```
89enum OH_AVCapabilityFeature
90```
91
92**Description**
93
94Enumerates the optional features that can be used in specific codec scenarios.
95
96**System capability**: SystemCapability.Multimedia.Media.CodecBase
97
98**Since**: 12
99
100| Value| Description|
101| -- | -- |
102| VIDEO_ENCODER_TEMPORAL_SCALABILITY = 0 | Temporal scalability feature, which is available only in video encoding scenarios.|
103| VIDEO_ENCODER_LONG_TERM_REFERENCE = 1 | Long-term reference frame feature, which is available only in video encoding scenarios.|
104| VIDEO_LOW_LATENCY = 2 | Low latency feature, which is available in video encoding and decoding scenarios.|
105
106
107## Function Description
108
109### OH_AVCodec_GetCapability()
110
111```
112OH_AVCapability *OH_AVCodec_GetCapability(const char *mime, bool isEncoder)
113```
114
115**Description**
116
117Obtains the codec capability recommended by the system.
118
119**System capability**: SystemCapability.Multimedia.Media.CodecBase
120
121**Since**: 10
122
123
124**Parameters**
125
126| Name| Description|
127| -- | -- |
128| const char *mime | Pointer to a string that describes the MIME type. For details, see [AVCODEC_MIME_TYPE](_codec_base.md#variables).|
129| bool isEncoder | Whether the instance is an encoder. The value **true** means an encoder and **false** means a decoder.|
130
131**Returns**
132
133| Type| Description|
134| -- | -- |
135| [OH_AVCapability](capi-avcapability-oh-avcapability.md) * | Pointer to the codec capability instance. If no existing codec matches, NULL is returned.|
136
137### OH_AVCodec_GetCapabilityByCategory()
138
139```
140OH_AVCapability *OH_AVCodec_GetCapabilityByCategory(const char *mime, bool isEncoder, OH_AVCodecCategory category)
141```
142
143**Description**
144
145Obtains the codec capability by category, which can be a hardware codec or software codec.
146
147**System capability**: SystemCapability.Multimedia.Media.CodecBase
148
149**Since**: 10
150
151
152**Parameters**
153
154| Name| Description|
155| -- | -- |
156| const char *mime | Pointer to a string that describes the MIME type. For details, see [AVCODEC_MIME_TYPE](_codec_base.md#variables).|
157| bool isEncoder | Whether the instance is an encoder. The value **true** means an encoder and **false** means a decoder.|
158| [OH_AVCodecCategory](#oh_avcodeccategory) category | Codec category.|
159
160**Returns**
161
162| Type| Description|
163| -- | -- |
164| [OH_AVCapability](capi-avcapability-oh-avcapability.md) * | Pointer to the codec capability instance. If no existing codec matches, NULL is returned.|
165
166### OH_AVCapability_IsHardware()
167
168```
169bool OH_AVCapability_IsHardware(OH_AVCapability *capability)
170```
171
172**Description**
173
174Checks whether a codec capability instance describes a hardware codec.
175
176**System capability**: SystemCapability.Multimedia.Media.CodecBase
177
178**Since**: 10
179
180
181**Parameters**
182
183| Name| Description|
184| -- | -- |
185| [OH_AVCapability](capi-avcapability-oh-avcapability.md) *capability | Pointer to the codec capability.|
186
187**Returns**
188
189| Type| Description|
190| -- | -- |
191| bool | Check result for whether the codec capability instance describes a hardware codec. **true** if it describes a hardware codec, **false** otherwise.|
192
193### OH_AVCapability_GetName()
194
195```
196const char *OH_AVCapability_GetName(OH_AVCapability *capability)
197```
198
199**Description**
200
201Obtains the codec name.
202
203**System capability**: SystemCapability.Multimedia.Media.CodecBase
204
205**Since**: 10
206
207
208**Parameters**
209
210| Name| Description|
211| -- | -- |
212| [OH_AVCapability](capi-avcapability-oh-avcapability.md) *capability | Pointer to the codec capability.|
213
214**Returns**
215
216| Type| Description|
217| -- | -- |
218| const char * | Codec name string.|
219
220### OH_AVCapability_GetMaxSupportedInstances()
221
222```
223int32_t OH_AVCapability_GetMaxSupportedInstances(OH_AVCapability *capability)
224```
225
226**Description**
227
228Obtains the maximum number of codec instances supported by a codec.
229
230**System capability**: SystemCapability.Multimedia.Media.CodecBase
231
232**Since**: 10
233
234
235**Parameters**
236
237| Name| Description|
238| -- | -- |
239| [OH_AVCapability](capi-avcapability-oh-avcapability.md) *capability | Pointer to the codec capability.|
240
241**Returns**
242
243| Type| Description|
244| -- | -- |
245| int32_t | Maximum number of codec instances supported.|
246
247### OH_AVCapability_GetEncoderBitrateRange()
248
249```
250OH_AVErrCode OH_AVCapability_GetEncoderBitrateRange(OH_AVCapability *capability, OH_AVRange *bitrateRange)
251```
252
253**Description**
254
255Obtains the bit rate range supported by an encoder.
256
257**System capability**: SystemCapability.Multimedia.Media.CodecBase
258
259**Since**: 10
260
261
262**Parameters**
263
264| Name| Description|
265| -- | -- |
266| [OH_AVCapability](capi-avcapability-oh-avcapability.md) *capability | Pointer to the encoder capability. If a pointer to the decoder capability is provided, undefined behavior occurs.|
267| [OH_AVRange](capi-avcapability-oh-avrange.md) *bitrateRange |  Pointer to the bit rate range supported.|
268
269**Returns**
270
271| Type| Description|
272| -- | -- |
273| [OH_AVErrCode](_core.md#oh_averrcode-1) | **AV_ERR_OK**: The operation is successful.<br> **AV_ERR_INVALID_VAL**: The capability instance is invalid or the pointer to the bit rate range is null.|
274
275### OH_AVCapability_IsEncoderBitrateModeSupported()
276
277```
278bool OH_AVCapability_IsEncoderBitrateModeSupported(OH_AVCapability *capability, OH_BitrateMode bitrateMode)
279```
280
281**Description**
282
283Checks whether an encoder supports a specific bit rate mode.
284
285**System capability**: SystemCapability.Multimedia.Media.CodecBase
286
287**Since**: 10
288
289
290**Parameters**
291
292| Name| Description|
293| -- | -- |
294| [OH_AVCapability](capi-avcapability-oh-avcapability.md) *capability | Pointer to the encoder capability. If a pointer to the decoder capability is provided, undefined behavior occurs.|
295| [OH_BitrateMode](_codec_base.md#oh_bitratemode-1) bitrateMode | Bit rate mode.|
296
297**Returns**
298
299| Type| Description|
300| -- | -- |
301| bool | Check result for the support of the bit rate mode. **true** if supported, **false** otherwise.|
302
303### OH_AVCapability_GetEncoderQualityRange()
304
305```
306OH_AVErrCode OH_AVCapability_GetEncoderQualityRange(OH_AVCapability *capability, OH_AVRange *qualityRange)
307```
308
309**Description**
310
311Obtains the quality range supported by an encoder.
312
313**System capability**: SystemCapability.Multimedia.Media.CodecBase
314
315**Since**: 10
316
317
318**Parameters**
319
320| Name| Description|
321| -- | -- |
322| [OH_AVCapability](capi-avcapability-oh-avcapability.md) *capability | Pointer to the encoder capability. If a pointer to the decoder capability is provided, undefined behavior occurs.|
323| [OH_AVRange](capi-avcapability-oh-avrange.md) *qualityRange |  Pointer to the quality range supported.|
324
325**Returns**
326
327| Type| Description|
328| -- | -- |
329| [OH_AVErrCode](_core.md#oh_averrcode-1) | **AV_ERR_OK**: The operation is successful.<br> **AV_ERR_INVALID_VAL**: The capability instance is invalid or the pointer to the quality range is null.|
330
331### OH_AVCapability_GetEncoderComplexityRange()
332
333```
334OH_AVErrCode OH_AVCapability_GetEncoderComplexityRange(OH_AVCapability *capability, OH_AVRange *complexityRange)
335```
336
337**Description**
338
339Obtains the complexity range supported by an encoder.
340
341**System capability**: SystemCapability.Multimedia.Media.CodecBase
342
343**Since**: 10
344
345
346**Parameters**
347
348| Name| Description|
349| -- | -- |
350| [OH_AVCapability](capi-avcapability-oh-avcapability.md) *capability | Pointer to the encoder capability. If a pointer to the decoder capability is provided, undefined behavior occurs.|
351| [OH_AVRange](capi-avcapability-oh-avrange.md) *complexityRange |  Pointer to the complexity range supported.|
352
353**Returns**
354
355| Type| Description|
356| -- | -- |
357| [OH_AVErrCode](_core.md#oh_averrcode-1) | **AV_ERR_OK**: The operation is successful.<br> **AV_ERR_INVALID_VAL**: The capability instance is invalid or the pointer to the complexity range is null.|
358
359### OH_AVCapability_GetAudioSupportedSampleRates()
360
361```
362OH_AVErrCode OH_AVCapability_GetAudioSupportedSampleRates(OH_AVCapability *capability, const int32_t **sampleRates,uint32_t *sampleRateNum)
363```
364
365**Description**
366
367Obtains the sample rates supported by an audio codec.
368
369**System capability**: SystemCapability.Multimedia.Media.CodecBase
370
371**Since**: 10
372
373
374**Parameters**
375
376| Name| Description|
377| -- | -- |
378| [OH_AVCapability](capi-avcapability-oh-avcapability.md) *capability | Pointer to the audio codec capability. If a pointer to the video codec capability is provided, undefined behavior occurs.|
379| const int32_t **sampleRates |  Double pointer to the sample rate array.|
380| uint32_t *sampleRateNum |  Pointer to the number of elements in the array.|
381
382**Returns**
383
384| Type| Description|
385| -- | -- |
386| [OH_AVErrCode](_core.md#oh_averrcode-1) | **AV_ERR_OK**: The operation is successful.<br> **AV_ERR_INVALID_VAL**: The capability instance is invalid, the pointer to the sample rate array is null, or the pointer to the number of elements in the array is null.<br> **AV_ERR_UNKNOWN**: An unknown error occurs.<br> **AV_ERR_NO_MEMORY**: Internal memory allocation failed.|
387
388### OH_AVCapability_GetAudioChannelCountRange()
389
390```
391OH_AVErrCode OH_AVCapability_GetAudioChannelCountRange(OH_AVCapability *capability, OH_AVRange *channelCountRange)
392```
393
394**Description**
395
396Obtains the count range of audio channels supported by an audio codec.
397
398**System capability**: SystemCapability.Multimedia.Media.CodecBase
399
400**Since**: 10
401
402
403**Parameters**
404
405| Name| Description|
406| -- | -- |
407| [OH_AVCapability](capi-avcapability-oh-avcapability.md) *capability | Pointer to the audio codec capability. If a pointer to the video codec capability is provided, undefined behavior occurs.|
408| [OH_AVRange](capi-avcapability-oh-avrange.md) *channelCountRange |  Pointer to the count range of audio channels supported.|
409
410**Returns**
411
412| Type| Description|
413| -- | -- |
414| [OH_AVErrCode](_core.md#oh_averrcode-1) | **AV_ERR_OK**: The operation is successful.<br> **AV_ERR_INVALID_VAL**: The capability instance is invalid or the pointer to the count range of audio channels is null.|
415
416### OH_AVCapability_GetVideoWidthAlignment()
417
418```
419OH_AVErrCode OH_AVCapability_GetVideoWidthAlignment(OH_AVCapability *capability, int32_t *widthAlignment)
420```
421
422**Description**
423
424Obtains the video width alignment supported by a video codec.
425
426**System capability**: SystemCapability.Multimedia.Media.CodecBase
427
428**Since**: 10
429
430
431**Parameters**
432
433| Name| Description|
434| -- | -- |
435| [OH_AVCapability](capi-avcapability-oh-avcapability.md) *capability | Pointer to the video codec capability. If a pointer to the audio codec capability is provided, undefined behavior occurs.|
436| int32_t *widthAlignment |  Pointer to the video width alignment supported.|
437
438**Returns**
439
440| Type| Description|
441| -- | -- |
442| [OH_AVErrCode](_core.md#oh_averrcode-1) | **AV_ERR_OK**: The operation is successful.<br> **AV_ERR_INVALID_VAL**: The capability instance is invalid or the pointer to the video width alignment is null.|
443
444### OH_AVCapability_GetVideoHeightAlignment()
445
446```
447OH_AVErrCode OH_AVCapability_GetVideoHeightAlignment(OH_AVCapability *capability, int32_t *heightAlignment)
448```
449
450**Description**
451
452Obtains the video height alignment supported by a video codec.
453
454**System capability**: SystemCapability.Multimedia.Media.CodecBase
455
456**Since**: 10
457
458
459**Parameters**
460
461| Name| Description|
462| -- | -- |
463| [OH_AVCapability](capi-avcapability-oh-avcapability.md) *capability | Pointer to the video codec capability. If a pointer to the audio codec capability is provided, undefined behavior occurs.|
464| int32_t *heightAlignment |  Pointer to the video height alignment supported.|
465
466**Returns**
467
468| Type| Description|
469| -- | -- |
470| [OH_AVErrCode](_core.md#oh_averrcode-1) | **AV_ERR_OK**: The operation is successful.<br> **AV_ERR_INVALID_VAL**: The capability instance is invalid or the pointer to the video height alignment is null.|
471
472### OH_AVCapability_GetVideoWidthRangeForHeight()
473
474```
475OH_AVErrCode OH_AVCapability_GetVideoWidthRangeForHeight(OH_AVCapability *capability, int32_t height,OH_AVRange *widthRange)
476```
477
478**Description**
479
480Obtains the video width range supported by a video codec based on a given height.
481
482**System capability**: SystemCapability.Multimedia.Media.CodecBase
483
484**Since**: 10
485
486
487**Parameters**
488
489| Name| Description|
490| -- | -- |
491| [OH_AVCapability](capi-avcapability-oh-avcapability.md) *capability | Pointer to the video codec capability. If a pointer to the audio codec capability is provided, undefined behavior occurs.|
492| int32_t height | Number of vertical video pixels.|
493| [OH_AVRange](capi-avcapability-oh-avrange.md) *widthRange |  Pointer to the video width range supported.|
494
495**Returns**
496
497| Type| Description|
498| -- | -- |
499| [OH_AVErrCode](_core.md#oh_averrcode-1) | **AV_ERR_OK**: The operation is successful.<br> **AV_ERR_INVALID_VAL**: The capability instance is invalid, the height is not within the supported height range obtained through [OH_AVCapability_GetVideoHeightRange](#oh_avcapability_getvideoheightrange), or the pointer to the width range is null.|
500
501### OH_AVCapability_GetVideoHeightRangeForWidth()
502
503```
504OH_AVErrCode OH_AVCapability_GetVideoHeightRangeForWidth(OH_AVCapability *capability, int32_t width,OH_AVRange *heightRange)
505```
506
507**Description**
508
509Obtains the video height range supported by a video codec based on a given width.
510
511**System capability**: SystemCapability.Multimedia.Media.CodecBase
512
513**Since**: 10
514
515
516**Parameters**
517
518| Name| Description|
519| -- | -- |
520| [OH_AVCapability](capi-avcapability-oh-avcapability.md) *capability | Pointer to the video codec capability. If a pointer to the audio codec capability is provided, undefined behavior occurs.|
521| int32_t width | Number of horizontal video pixels.|
522| [OH_AVRange](capi-avcapability-oh-avrange.md) *heightRange |  Pointer to the video height range supported.|
523
524**Returns**
525
526| Type| Description|
527| -- | -- |
528| [OH_AVErrCode](_core.md#oh_averrcode-1) | **AV_ERR_OK**: The operation is successful.<br> **AV_ERR_INVALID_VAL**: The capability instance is invalid, the width is not within the supported width range obtained through [OH_AVCapability_GetVideoWidthRange](#oh_avcapability_getvideowidthrange), or the pointer to the height range is null.|
529
530### OH_AVCapability_GetVideoWidthRange()
531
532```
533OH_AVErrCode OH_AVCapability_GetVideoWidthRange(OH_AVCapability *capability, OH_AVRange *widthRange)
534```
535
536**Description**
537
538Obtains the video width range supported by a video codec.
539
540**System capability**: SystemCapability.Multimedia.Media.CodecBase
541
542**Since**: 10
543
544
545**Parameters**
546
547| Name| Description|
548| -- | -- |
549| [OH_AVCapability](capi-avcapability-oh-avcapability.md) *capability | Pointer to the video codec capability. If a pointer to the audio codec capability is provided, undefined behavior occurs.|
550| [OH_AVRange](capi-avcapability-oh-avrange.md) *widthRange |  Pointer to the video width range supported.|
551
552**Returns**
553
554| Type| Description|
555| -- | -- |
556| [OH_AVErrCode](_core.md#oh_averrcode-1) | **AV_ERR_OK**: The operation is successful.<br> **AV_ERR_INVALID_VAL**: The capability instance is invalid or the pointer to the video width range is null.|
557
558### OH_AVCapability_GetVideoHeightRange()
559
560```
561OH_AVErrCode OH_AVCapability_GetVideoHeightRange(OH_AVCapability *capability, OH_AVRange *heightRange)
562```
563
564**Description**
565
566Obtains the video height range supported by a video codec.
567
568**System capability**: SystemCapability.Multimedia.Media.CodecBase
569
570**Since**: 10
571
572
573**Parameters**
574
575| Name| Description|
576| -- | -- |
577| [OH_AVCapability](capi-avcapability-oh-avcapability.md) *capability | Pointer to the video codec capability. If a pointer to the audio codec capability is provided, undefined behavior occurs.|
578| [OH_AVRange](capi-avcapability-oh-avrange.md) *heightRange |  Pointer to the video height range supported.|
579
580**Returns**
581
582| Type| Description|
583| -- | -- |
584| [OH_AVErrCode](_core.md#oh_averrcode-1) | **AV_ERR_OK**: The operation is successful.<br> **AV_ERR_INVALID_VAL**: The capability instance is invalid or the pointer to the video height range is null.|
585
586### OH_AVCapability_IsVideoSizeSupported()
587
588```
589bool OH_AVCapability_IsVideoSizeSupported(OH_AVCapability *capability, int32_t width, int32_t height)
590```
591
592**Description**
593
594Checks whether a video codec supports a specific video size.
595
596**System capability**: SystemCapability.Multimedia.Media.CodecBase
597
598**Since**: 10
599
600
601**Parameters**
602
603| Name| Description|
604| -- | -- |
605| [OH_AVCapability](capi-avcapability-oh-avcapability.md) *capability | Pointer to the video codec capability. If a pointer to the audio codec capability is provided, undefined behavior occurs.|
606| int32_t width | Number of horizontal video pixels.|
607| int32_t height | Number of vertical video pixels.|
608
609**Returns**
610
611| Type| Description|
612| -- | -- |
613| bool | Check result for the support of the video size. **true** if supported, **false** otherwise.|
614
615### OH_AVCapability_GetVideoFrameRateRange()
616
617```
618OH_AVErrCode OH_AVCapability_GetVideoFrameRateRange(OH_AVCapability *capability, OH_AVRange *frameRateRange)
619```
620
621**Description**
622
623Obtains the video frame rate range supported by a video codec.
624
625**System capability**: SystemCapability.Multimedia.Media.CodecBase
626
627**Since**: 10
628
629
630**Parameters**
631
632| Name| Description|
633| -- | -- |
634| [OH_AVCapability](capi-avcapability-oh-avcapability.md) *capability | Pointer to the video codec capability. If a pointer to the audio codec capability is provided, undefined behavior occurs.|
635| [OH_AVRange](capi-avcapability-oh-avrange.md) *frameRateRange |  Pointer to the video frame rate range supported.|
636
637**Returns**
638
639| Type| Description|
640| -- | -- |
641| [OH_AVErrCode](_core.md#oh_averrcode-1) | **AV_ERR_OK**: The operation is successful.<br> **AV_ERR_INVALID_VAL**: The capability instance is invalid or the pointer to the video frame rate range is null.|
642
643### OH_AVCapability_GetVideoFrameRateRangeForSize()
644
645```
646OH_AVErrCode OH_AVCapability_GetVideoFrameRateRangeForSize(OH_AVCapability *capability, int32_t width, int32_t height,OH_AVRange *frameRateRange)
647```
648
649**Description**
650
651Obtains the video frame rate range supported by a video codec based on a given video size.
652
653**System capability**: SystemCapability.Multimedia.Media.CodecBase
654
655**Since**: 10
656
657
658**Parameters**
659
660| Name| Description|
661| -- | -- |
662| [OH_AVCapability](capi-avcapability-oh-avcapability.md) *capability | Pointer to the video codec capability. If a pointer to the audio codec capability is provided, undefined behavior occurs.|
663| int32_t width | Number of horizontal video pixels.|
664| int32_t height | Number of vertical video pixels.|
665| [OH_AVRange](capi-avcapability-oh-avrange.md) *frameRateRange |  Pointer to the video frame rate range supported.|
666
667**Returns**
668
669| Type| Description|
670| -- | -- |
671| [OH_AVErrCode](_core.md#oh_averrcode-1) | **AV_ERR_OK**: The operation is successful.<br> **AV_ERR_INVALID_VAL**: The capability instance is invalid, the combination of the width and height is not supported, or the pointer to the frame rate range is null.|
672
673### OH_AVCapability_AreVideoSizeAndFrameRateSupported()
674
675```
676bool OH_AVCapability_AreVideoSizeAndFrameRateSupported(OH_AVCapability *capability, int32_t width, int32_t height,int32_t frameRate)
677```
678
679**Description**
680
681Checks whether a video codec supports the combination of a video size and frame rate.
682
683**System capability**: SystemCapability.Multimedia.Media.CodecBase
684
685**Since**: 10
686
687
688**Parameters**
689
690| Name| Description|
691| -- | -- |
692| [OH_AVCapability](capi-avcapability-oh-avcapability.md) *capability | Pointer to the video codec capability. If a pointer to the audio codec capability is provided, undefined behavior occurs.|
693| int32_t width | Number of horizontal video pixels.|
694| int32_t height | Number of vertical video pixels.|
695| int32_t frameRate | Number of frames per second.|
696
697**Returns**
698
699| Type| Description|
700| -- | -- |
701| bool | Check result for the support of the combination of the video size and frame rate. **true** if supported, **false** otherwise.|
702
703### OH_AVCapability_GetVideoSupportedPixelFormats()
704
705```
706OH_AVErrCode OH_AVCapability_GetVideoSupportedPixelFormats(OH_AVCapability *capability, const int32_t **pixelFormats,uint32_t *pixelFormatNum)
707```
708
709**Description**
710
711Obtains the video pixel formats supported by a video codec.
712
713**System capability**: SystemCapability.Multimedia.Media.CodecBase
714
715**Since**: 10
716
717
718**Parameters**
719
720| Name| Description|
721| -- | -- |
722| [OH_AVCapability](capi-avcapability-oh-avcapability.md) *capability | Pointer to the video codec capability. If a pointer to the audio codec capability is provided, undefined behavior occurs.|
723| const int32_t **pixelFormats |  Double pointer to the video pixel format array.|
724| uint32_t *pixelFormatNum |  Pointer to the number of elements in the array.|
725
726**Returns**
727
728| Type| Description|
729| -- | -- |
730| [OH_AVErrCode](_core.md#oh_averrcode-1) | **AV_ERR_OK**: The operation is successful.<br> **AV_ERR_INVALID_VAL**: The capability instance is invalid, the pointer to the video pixel format array is null, or the pointer to the number of elements in the array is null.<br> **AV_ERR_UNKNOWN**: An unknown error occurs.<br> **AV_ERR_NO_MEMORY**: Internal memory allocation failed.|
731
732### OH_AVCapability_GetSupportedProfiles()
733
734```
735OH_AVErrCode OH_AVCapability_GetSupportedProfiles(OH_AVCapability *capability, const int32_t **profiles,uint32_t *profileNum)
736```
737
738**Description**
739
740Obtains the profiles supported by a codec.
741
742**System capability**: SystemCapability.Multimedia.Media.CodecBase
743
744**Since**: 10
745
746
747**Parameters**
748
749| Name| Description|
750| -- | -- |
751| [OH_AVCapability](capi-avcapability-oh-avcapability.md) *capability | Pointer to the codec capability.|
752| const int32_t **profiles |  Double pointer to the profile array.|
753| uint32_t *profileNum |  Pointer to the number of profiles in the array.|
754
755**Returns**
756
757| Type| Description|
758| -- | -- |
759| [OH_AVErrCode](_core.md#oh_averrcode-1) | **AV_ERR_OK**: The operation is successful.<br> **AV_ERR_INVALID_VAL**: The capability instance is invalid, the pointer to the profile array is null, or the pointer to the number of elements in the array is null.<br> **AV_ERR_UNKNOWN**: An unknown error occurs.<br> **AV_ERR_NO_MEMORY**: Internal memory allocation failed.|
760
761### OH_AVCapability_GetSupportedLevelsForProfile()
762
763```
764OH_AVErrCode OH_AVCapability_GetSupportedLevelsForProfile(OH_AVCapability *capability, int32_t profile,const int32_t **levels, uint32_t *levelNum)
765```
766
767**Description**
768
769Obtains the codec levels supported by a profile.
770
771**System capability**: SystemCapability.Multimedia.Media.CodecBase
772
773**Since**: 10
774
775
776**Parameters**
777
778| Name| Description|
779| -- | -- |
780| [OH_AVCapability](capi-avcapability-oh-avcapability.md) *capability | Pointer to the codec capability.|
781| int32_t profile | Codec profile.|
782| const int32_t **levels |  Double pointer to the codec level array.|
783| uint32_t *levelNum |  Pointer to the number of elements in the array.|
784
785**Returns**
786
787| Type| Description|
788| -- | -- |
789| [OH_AVErrCode](_core.md#oh_averrcode-1) | **AV_ERR_OK**: The operation is successful.<br> **AV_ERR_INVALID_VAL**: The capability instance is invalid, the level is not in the supported level array obtained through [OH_AVCapability_GetSupportedProfiles](#oh_avcapability_getsupportedprofiles), the pointer to the level array is null, or the pointer to the number of elements in the array is null.<br> **AV_ERR_UNKNOWN**: An unknown error occurs.<br> **AV_ERR_NO_MEMORY**: Internal memory allocation failed.|
790
791### OH_AVCapability_AreProfileAndLevelSupported()
792
793```
794bool OH_AVCapability_AreProfileAndLevelSupported(OH_AVCapability *capability, int32_t profile, int32_t level)
795```
796
797**Description**
798
799Checks whether a codec supports the combination of a profile and level.
800
801**System capability**: SystemCapability.Multimedia.Media.CodecBase
802
803**Since**: 10
804
805
806**Parameters**
807
808| Name| Description|
809| -- | -- |
810| [OH_AVCapability](capi-avcapability-oh-avcapability.md) *capability | Pointer to the codec capability.|
811| int32_t profile | Codec profile.|
812| int32_t level | Level of the codec.|
813
814**Returns**
815
816| Type| Description|
817| -- | -- |
818| bool | Check result for the support of the combination of the profile and level. **true** if supported, **false** otherwise.|
819
820### OH_AVCapability_IsFeatureSupported()
821
822```
823bool OH_AVCapability_IsFeatureSupported(OH_AVCapability *capability, OH_AVCapabilityFeature feature)
824```
825
826**Description**
827
828Checks whether a codec supports a feature.
829
830**System capability**: SystemCapability.Multimedia.Media.CodecBase
831
832**Since**: 12
833
834
835**Parameters**
836
837| Name| Description|
838| -- | -- |
839| [OH_AVCapability](capi-avcapability-oh-avcapability.md) *capability | Pointer to the codec capability.|
840| [OH_AVCapabilityFeature](#oh_avcapabilityfeature) feature | Codec feature.|
841
842**Returns**
843
844| Type| Description|
845| -- | -- |
846| bool | Check result for the feature. **true** if supported, **false** otherwise.|
847
848### OH_AVCapability_GetFeatureProperties()
849
850```
851OH_AVFormat *OH_AVCapability_GetFeatureProperties(OH_AVCapability *capability, OH_AVCapabilityFeature feature)
852```
853
854**Description**
855
856Obtains the properties of a feature. You must manually release the OH_AVFormat instance in the return value.
857
858**System capability**: SystemCapability.Multimedia.Media.CodecBase
859
860**Since**: 12
861
862
863**Parameters**
864
865| Name| Description|
866| -- | -- |
867| [OH_AVCapability](capi-avcapability-oh-avcapability.md) *capability | Pointer to the codec capability.|
868| [OH_AVCapabilityFeature](#oh_avcapabilityfeature) feature | Codec feature.|
869
870**Returns**
871
872| Type| Description|
873| -- | -- |
874| [OH_AVFormat](_core.md#oh_avformat) * | Pointer to an OH_AVFormat instance.|
875