1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
// automatically generated by rust-bindgen 0.71.1
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(deprecated)]
use crate::avcodec_base::OH_BitrateMode;
#[allow(unused_imports)]
use crate::averrors::OH_AVErrCode;
#[cfg(feature = "api-12")]
use crate::avformat::OH_AVFormat;
/// Forward declaration of OH_AVCapability.
///
///
/// Available since API-level: 10
#[repr(C)]
pub struct OH_AVCapability {
_unused: [u8; 0],
}
/// Range contain min and max value
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.CodecBase
///
/// Available since API-level: 10
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_AVRange {
pub minVal: i32,
pub maxVal: i32,
}
impl OH_AVCodecCategory {
pub const HARDWARE: OH_AVCodecCategory = OH_AVCodecCategory(0);
pub const SOFTWARE: OH_AVCodecCategory = OH_AVCodecCategory(1);
}
#[repr(transparent)]
/// The codec category
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.CodecBase
///
/// Available since API-level: 10
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct OH_AVCodecCategory(pub ::core::ffi::c_uint);
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl OH_AVCapabilityFeature {
/// Feature for codec supports temporal scalability. It is only used in video encoder.
pub const VIDEO_ENCODER_TEMPORAL_SCALABILITY: OH_AVCapabilityFeature =
OH_AVCapabilityFeature(0);
/// Feature for codec supports long-term reference. It is only used in video encoder.
pub const VIDEO_ENCODER_LONG_TERM_REFERENCE: OH_AVCapabilityFeature = OH_AVCapabilityFeature(1);
/// Feature for codec supports low latency. It is only used in video decoder.
pub const VIDEO_LOW_LATENCY: OH_AVCapabilityFeature = OH_AVCapabilityFeature(2);
/// Feature for codec supports B-frame encoding. It is only used in video encoder.
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub const VIDEO_ENCODER_B_FRAME: OH_AVCapabilityFeature = OH_AVCapabilityFeature(7);
}
#[repr(transparent)]
/// The enum of optional features that can be used in specific codec seenarios.
///
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.CodecBase
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct OH_AVCapabilityFeature(pub ::core::ffi::c_uint);
extern "C" {
/// Get a system-recommended codec's capability.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.CodecBase
/// # Arguments
///
/// * `mime` - Mime type
///
/// * `isEncoder` - True for encoder, false for decoder
///
/// # Returns
///
/// * Returns a capability instance if an existing codec matches,
/// if the specified mime type doesn't match any existing codec, returns NULL.
///
/// Available since API-level: 10
pub fn OH_AVCodec_GetCapability(
mime: *const ::core::ffi::c_char,
isEncoder: bool,
) -> *mut OH_AVCapability;
/// Get a codec's capability within the specified category. By specifying the category,
/// the matched codec is limited to either hardware codecs or software codecs.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.CodecBase
/// # Arguments
///
/// * `mime` - Mime type
///
/// * `isEncoder` - True for encoder, false for decoder
///
/// * `category` - The codec category
///
/// # Returns
///
/// * Returns a capability instance if an existing codec matches,
/// if the specified mime type doesn't match any existing codec, returns NULL
///
/// Available since API-level: 10
pub fn OH_AVCodec_GetCapabilityByCategory(
mime: *const ::core::ffi::c_char,
isEncoder: bool,
category: OH_AVCodecCategory,
) -> *mut OH_AVCapability;
/// Check if the capability instance is describing a hardware codec.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.CodecBase
/// # Arguments
///
/// * `capability` - Codec capability pointer
///
/// # Returns
///
/// * Returns true if the capability instance is describing a hardware codec,
/// false if the capability instance is describing a software codec
///
/// Available since API-level: 10
pub fn OH_AVCapability_IsHardware(capability: *mut OH_AVCapability) -> bool;
/// Get the codec name.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.CodecBase
/// # Arguments
///
/// * `capability` - Codec capability pointer
///
/// # Returns
///
/// * Returns codec name string
///
/// Available since API-level: 10
pub fn OH_AVCapability_GetName(capability: *mut OH_AVCapability) -> *const ::core::ffi::c_char;
/// Get the supported max instance number of the codec.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.CodecBase
/// # Arguments
///
/// * `capability` - Codec capability pointer
///
/// # Returns
///
/// * Returns the max supported codec instance number
///
/// Available since API-level: 10
pub fn OH_AVCapability_GetMaxSupportedInstances(capability: *mut OH_AVCapability) -> i32;
/// Get the encoder's supported bitrate range.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.CodecBase
/// # Arguments
///
/// * `capability` - Encoder capability pointer. If a decoder capability pointer is given,
/// undefined behavior occurs
///
/// * `bitrateRange` - Output parameter. Encoder bitrate range
///
/// # Returns
///
/// * Returns AV_ERR_OK if the execution is successful,
/// otherwise returns a specific error code, refer to [`OH_AVErrCode`]
/// [`AV_ERR_INVALID_VAL`], the capability is invalid, or the bitrateRange is nullptr.
///
/// Available since API-level: 10
pub fn OH_AVCapability_GetEncoderBitrateRange(
capability: *mut OH_AVCapability,
bitrateRange: *mut OH_AVRange,
) -> OH_AVErrCode;
/// Check if the encoder supports the specific bitrate mode.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.CodecBase
/// # Arguments
///
/// * `capability` - Encoder capability pointer. If a decoder capability pointer is given,
/// undefined behavior occurs
///
/// * `bitrateMode` - Bitrate mode
///
/// # Returns
///
/// * Returns true if the bitrate mode is supported, false if the bitrate mode is not supported
///
/// Available since API-level: 10
pub fn OH_AVCapability_IsEncoderBitrateModeSupported(
capability: *mut OH_AVCapability,
bitrateMode: OH_BitrateMode,
) -> bool;
/// Get the encoder's supported quality range.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.CodecBase
/// # Arguments
///
/// * `capability` - Encoder capability pointer. If a decoder capability pointer is given,
/// undefined behavior occurs
///
/// * `qualityRange` - Output parameter. Encoder quality range
///
/// # Returns
///
/// * Returns AV_ERR_OK if the execution is successful,
/// otherwise returns a specific error code, refer to [`OH_AVErrCode`]
/// [`AV_ERR_INVALID_VAL`], the capability is invalid, or the qualityRange is nullptr.
///
/// Available since API-level: 10
pub fn OH_AVCapability_GetEncoderQualityRange(
capability: *mut OH_AVCapability,
qualityRange: *mut OH_AVRange,
) -> OH_AVErrCode;
/// Get the encoder's supported encoder complexity range.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.CodecBase
/// # Arguments
///
/// * `capability` - Encoder capability pointer. If a decoder capability pointer is given,
/// undefined behavior occurs
///
/// * `complexityRange` - Output parameter. Encoder complexity range
///
/// # Returns
///
/// * Returns AV_ERR_OK if the execution is successful,
/// otherwise returns a specific error code, refer to [`OH_AVErrCode`]
/// [`AV_ERR_INVALID_VAL`], the capability is invalid, or the complexityRange is nullptr.
///
/// Available since API-level: 10
pub fn OH_AVCapability_GetEncoderComplexityRange(
capability: *mut OH_AVCapability,
complexityRange: *mut OH_AVRange,
) -> OH_AVErrCode;
/// Get the audio codec's supported sample rates.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.CodecBase
/// # Arguments
///
/// * `capability` - Audio codec capability pointer. If a video codec capability pointer is given,
/// undefined behavior occurs
///
/// * `sampleRates` - Output parameter. A pointer to the sample rates array
///
/// * `sampleRateNum` - Output parameter. The element number of the sample rates array
///
/// # Returns
///
/// * Returns AV_ERR_OK if the execution is successful,
/// otherwise returns a specific error code, refer to [`OH_AVErrCode`]
/// [`AV_ERR_INVALID_VAL`], the capability is invalid, the sampleRates is nullptr, or sampleRateNum is nullptr.
/// [`AV_ERR_UNKNOWN`], unknown error.
/// [`AV_ERR_NO_MEMORY`], internal use memory malloc failed.
///
/// Available since API-level: 10
pub fn OH_AVCapability_GetAudioSupportedSampleRates(
capability: *mut OH_AVCapability,
sampleRates: *mut *const i32,
sampleRateNum: *mut u32,
) -> OH_AVErrCode;
/// Get the audio codec's supported sample rate ranges.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.CodecBase
/// # Arguments
///
/// * `capability` - Audio codec capability pointer. Do not give a video codec capability pointer
///
/// * `sampleRateRanges` - Output parameter. A pointer to the sample rate ranges array
///
/// * `rangesNum` - Output parameter. The element number of the sample rate ranges array
///
/// # Returns
///
/// * Returns AV_ERR_OK if the execution is successful,
/// otherwise returns a specific error code, refer to [`OH_AVErrCode`]
/// [`AV_ERR_INVALID_VAL`], the capability is invalid, the sampleRateRanges is nullptr, or rangesNum is nullptr.
/// [`AV_ERR_UNKNOWN`], unknown error.
/// [`AV_ERR_NO_MEMORY`], internal use memory malloc failed.
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub fn OH_AVCapability_GetAudioSupportedSampleRateRanges(
capability: *mut OH_AVCapability,
sampleRateRanges: *mut *mut OH_AVRange,
rangesNum: *mut u32,
) -> OH_AVErrCode;
/// Get the audio codec's supported audio channel count range.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.CodecBase
/// # Arguments
///
/// * `capability` - Audio codec capability pointer. If a video codec capability pointer is given,
/// undefined behavior occurs
///
/// * `channelCountRange` - Output parameter. Audio channel count range
///
/// # Returns
///
/// * Returns AV_ERR_OK if the execution is successful,
/// otherwise returns a specific error code, refer to [`OH_AVErrCode`]
/// [`AV_ERR_INVALID_VAL`], the capability is invalid, or the channelCountRange is nullptr.
///
/// Available since API-level: 10
pub fn OH_AVCapability_GetAudioChannelCountRange(
capability: *mut OH_AVCapability,
channelCountRange: *mut OH_AVRange,
) -> OH_AVErrCode;
/// Get the video codec's supported video width alignment.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.CodecBase
/// # Arguments
///
/// * `capability` - Video codec capability pointer. If an audio codec capability pointer is given,
/// undefined behavior occurs
///
/// * `widthAlignment` - Output parameter. Video width alignment
///
/// # Returns
///
/// * Returns AV_ERR_OK if the execution is successful,
/// otherwise returns a specific error code, refer to [`OH_AVErrCode`]
/// [`AV_ERR_INVALID_VAL`], the capability is invalid, or the widthAlignment is nullptr.
///
/// Available since API-level: 10
pub fn OH_AVCapability_GetVideoWidthAlignment(
capability: *mut OH_AVCapability,
widthAlignment: *mut i32,
) -> OH_AVErrCode;
/// Get the video codec's supported video height alignment.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.CodecBase
/// # Arguments
///
/// * `capability` - Video codec capability pointer. If an audio codec capability pointer is given,
/// undefined behavior occurs
///
/// * `heightAlignment` - Output parameter. Video height alignment
///
/// # Returns
///
/// * Returns AV_ERR_OK if the execution is successful,
/// otherwise returns a specific error code, refer to [`OH_AVErrCode`]
/// [`AV_ERR_INVALID_VAL`], the capability is invalid, or the heightAlignment is nullptr.
///
/// Available since API-level: 10
pub fn OH_AVCapability_GetVideoHeightAlignment(
capability: *mut OH_AVCapability,
heightAlignment: *mut i32,
) -> OH_AVErrCode;
/// Get the video codec's supported video width range for a specific height.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.CodecBase
/// # Arguments
///
/// * `capability` - video codec capability pointer. If an audio codec capability pointer is given,
/// undefined behavior occurs
///
/// * `height` - Vertical pixel number of the video
///
/// * `widthRange` - Output parameter. Video width range
///
/// # Returns
///
/// * Returns AV_ERR_OK if the execution is successful,
/// otherwise returns a specific error code, refer to [`OH_AVErrCode`]
/// [`AV_ERR_INVALID_VAL`], the capability is invalid, the height is not within the supported range
/// obtained through [`OH_AVCapability_GetVideoHeightRange`], or the widthRange is nullptr.
///
/// Available since API-level: 10
pub fn OH_AVCapability_GetVideoWidthRangeForHeight(
capability: *mut OH_AVCapability,
height: i32,
widthRange: *mut OH_AVRange,
) -> OH_AVErrCode;
/// Get the video codec's supported video height range for a specific width.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.CodecBase
/// # Arguments
///
/// * `capability` - Video codec capability pointer. If an audio codec capability pointer is given,
/// undefined behavior occurs
///
/// * `width` - Horizontal pixel number of the video
///
/// * `heightRange` - Output parameter. Video height range
///
/// # Returns
///
/// * Returns AV_ERR_OK if the execution is successful,
/// otherwise returns a specific error code, refer to [`OH_AVErrCode`]
/// [`AV_ERR_INVALID_VAL`], the capability is invalid, the width is not within the supported range
/// obtained through [`OH_AVCapability_GetVideoWidthRange`], or the heightRange is nullptr.
///
/// Available since API-level: 10
pub fn OH_AVCapability_GetVideoHeightRangeForWidth(
capability: *mut OH_AVCapability,
width: i32,
heightRange: *mut OH_AVRange,
) -> OH_AVErrCode;
/// Get the video codec's supported video width range.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.CodecBase
/// # Arguments
///
/// * `capability` - Video codec capability pointer. If an audio codec capability pointer is given,
/// undefined behavior occurs
///
/// * `widthRange` - Output parameter. Video width range
///
/// # Returns
///
/// * Returns AV_ERR_OK if the execution is successful,
/// otherwise returns a specific error code, refer to [`OH_AVErrCode`]
/// [`AV_ERR_INVALID_VAL`], the capability is invalid, or the widthRange is nullptr.
///
/// Available since API-level: 10
pub fn OH_AVCapability_GetVideoWidthRange(
capability: *mut OH_AVCapability,
widthRange: *mut OH_AVRange,
) -> OH_AVErrCode;
/// Get the video codec's supported video height range.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.CodecBase
/// # Arguments
///
/// * `capability` - Video codec capability pointer. If an audio codec capability pointer is given,
/// undefined behavior occurs
///
/// * `heightRange` - Output parameter. Video height range
///
/// # Returns
///
/// * Returns AV_ERR_OK if the execution is successful,
/// otherwise returns a specific error code, refer to [`OH_AVErrCode`]
/// [`AV_ERR_INVALID_VAL`], the capability is invalid, or the heightRange is nullptr.
///
/// Available since API-level: 10
pub fn OH_AVCapability_GetVideoHeightRange(
capability: *mut OH_AVCapability,
heightRange: *mut OH_AVRange,
) -> OH_AVErrCode;
/// Check if the video codec supports the specific video size.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.CodecBase
/// # Arguments
///
/// * `capability` - Video codec capability pointer. If an audio codec capability pointer is given,
/// undefined behavior occurs
///
/// * `width` - Horizontal pixel number of the video
///
/// * `height` - Vertical pixel number of the video
///
/// # Returns
///
/// * Returns true if the video size is supported, false if the video size is not supported
///
/// Available since API-level: 10
pub fn OH_AVCapability_IsVideoSizeSupported(
capability: *mut OH_AVCapability,
width: i32,
height: i32,
) -> bool;
/// Get the video codec's supported video frame rate range.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.CodecBase
/// # Arguments
///
/// * `capability` - Video codec capability pointer. If an audio codec capability pointer is given,
/// undefined behavior occurs
///
/// * `frameRateRange` - Output parameter. Video frame rate range
///
/// # Returns
///
/// * Returns AV_ERR_OK if the execution is successful,
/// otherwise returns a specific error code, refer to [`OH_AVErrCode`]
/// [`AV_ERR_INVALID_VAL`], the capability is invalid, or the frameRateRange is nullptr.
///
/// Available since API-level: 10
pub fn OH_AVCapability_GetVideoFrameRateRange(
capability: *mut OH_AVCapability,
frameRateRange: *mut OH_AVRange,
) -> OH_AVErrCode;
/// Get the Video codec's supported video frame rate range for a specified video size.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.CodecBase
/// # Arguments
///
/// * `capability` - Video codec capability pointer. If an audio codec capability pointer is given,
/// undefined behavior occurs
///
/// * `width` - Horizontal pixel number of the video
///
/// * `height` - Vertical pixel number of the video
///
/// * `frameRateRange` - Output parameter. Frame rate range
///
/// # Returns
///
/// * Returns AV_ERR_OK if the execution is successful,
/// otherwise returns a specific error code, refer to [`OH_AVErrCode`]
/// [`AV_ERR_INVALID_VAL`], the capability is invalid, the combination of width and height is
/// not supported, or the frameRateRange is nullptr.
///
/// Available since API-level: 10
pub fn OH_AVCapability_GetVideoFrameRateRangeForSize(
capability: *mut OH_AVCapability,
width: i32,
height: i32,
frameRateRange: *mut OH_AVRange,
) -> OH_AVErrCode;
/// Check if the video codec supports the specific combination of video size and frame rate.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.CodecBase
/// # Arguments
///
/// * `capability` - Video codec capability pointer. If an audio codec capability pointer is given,
/// undefined behavior occurs
///
/// * `width` - Horizontal pixel number of the video
///
/// * `height` - Vertical pixel number of the video
///
/// * `frameRate` - Frame number per second
///
/// # Returns
///
/// * Returns true if the combination of video size and frame rate is supported,
/// false if it is not supported
///
/// Available since API-level: 10
pub fn OH_AVCapability_AreVideoSizeAndFrameRateSupported(
capability: *mut OH_AVCapability,
width: i32,
height: i32,
frameRate: i32,
) -> bool;
/// Get the video codec's supported video pixel format.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.CodecBase
/// # Arguments
///
/// * `capability` - Video codec capability pointer. If an audio codec capability pointer is given,
/// undefined behavior occurs
///
/// * `pixelFormats` - Output parameter. A pointer to the video pixel format array
///
/// * `pixelFormatNum` - Output parameter. The element number of the pixel format array
///
/// # Returns
///
/// * Returns AV_ERR_OK if the execution is successful,
/// otherwise returns a specific error code, refer to [`OH_AVErrCode`]
/// [`AV_ERR_INVALID_VAL`], the capability is invalid, the pixelFormats is nullptr,
/// or the pixelFormatNum is nullptr.
/// [`AV_ERR_UNKNOWN`], unknown error.
/// [`AV_ERR_NO_MEMORY`], internal use memory malloc failed.
///
/// Available since API-level: 10
pub fn OH_AVCapability_GetVideoSupportedPixelFormats(
capability: *mut OH_AVCapability,
pixelFormats: *mut *const i32,
pixelFormatNum: *mut u32,
) -> OH_AVErrCode;
/// Get the codec's supported profiles.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.CodecBase
/// # Arguments
///
/// * `capability` - Codec capability pointer
///
/// * `profiles` - Output parameter. A pointer to the profile array
///
/// * `profileNum` - Output parameter. The element number of the profile array
///
/// # Returns
///
/// * Returns AV_ERR_OK if the execution is successful,
/// otherwise returns a specific error code, refer to [`OH_AVErrCode`]
/// [`AV_ERR_INVALID_VAL`], the capability is invalid, the profiles is nullptr, or the profileNum is nullptr.
/// [`AV_ERR_UNKNOWN`], unknown error.
/// [`AV_ERR_NO_MEMORY`], internal use memory malloc failed.
///
/// Available since API-level: 10
pub fn OH_AVCapability_GetSupportedProfiles(
capability: *mut OH_AVCapability,
profiles: *mut *const i32,
profileNum: *mut u32,
) -> OH_AVErrCode;
/// Get codec's supported levels for a specific profile.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.CodecBase
/// # Arguments
///
/// * `capability` - Codec capability pointer
///
/// * `profile` - Codec profile
///
/// * `levels` - Output parameter. A pointer to the level array
///
/// * `levelNum` - Output parameter. The element number of the level array
///
/// # Returns
///
/// * Returns AV_ERR_OK if the execution is successful,
/// otherwise returns a specific error code, refer to [`OH_AVErrCode`]
/// [`AV_ERR_INVALID_VAL`], the capability is invalid, the profile is not within the supported profile array
/// obtained through [`OH_AVCapability_GetSupportedProfiles`], the levels is nullptr, or the levelNum is nullptr.
/// [`AV_ERR_UNKNOWN`], unknown error.
/// [`AV_ERR_NO_MEMORY`], internal use memory malloc failed.
///
/// Available since API-level: 10
pub fn OH_AVCapability_GetSupportedLevelsForProfile(
capability: *mut OH_AVCapability,
profile: i32,
levels: *mut *const i32,
levelNum: *mut u32,
) -> OH_AVErrCode;
/// Check if the codec supports the specific combination of the profile and level.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.CodecBase
/// # Arguments
///
/// * `capability` - Codec capability pointer
///
/// * `profile` - Codec profile
///
/// * `level` - Codec level
///
/// # Returns
///
/// * Returns true if the combination of profile and level is supported,
/// false if it is not supported
///
/// Available since API-level: 10
pub fn OH_AVCapability_AreProfileAndLevelSupported(
capability: *mut OH_AVCapability,
profile: i32,
level: i32,
) -> bool;
/// Check if the codec supports the specified feature.
///
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.CodecBase
/// # Arguments
///
/// * `capability` - Codec capability pointer
///
/// * `feature` - Feature enum, refer to [`OH_AVCapabilityFeature`] for details
///
/// # Returns
///
/// * Returns true if the feature is supported, false if it is not supported
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_AVCapability_IsFeatureSupported(
capability: *mut OH_AVCapability,
feature: OH_AVCapabilityFeature,
) -> bool;
/// Get the properties of the specified feature. It should be noted that the life cycle of the OH_AVFormat
/// instance pointed to by the return value * needs to be manually released by the caller.
///
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.CodecBase
/// # Arguments
///
/// * `capability` - Codec capability pointer
///
/// * `feature` - Feature enum, refer to [`OH_AVCapabilityFeature`] for details
///
/// # Returns
///
/// * Returns a pointer to an OH_AVFormat instance
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_AVCapability_GetFeatureProperties(
capability: *mut OH_AVCapability,
feature: OH_AVCapabilityFeature,
) -> *mut OH_AVFormat;
}