ohos-media-sys 0.1.0

Raw Bindings to the media framework on OpenHarmony
Documentation
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
689
690
691
692
693
694
695
696
697
698
699
700
// automatically generated by rust-bindgen 0.71.1

#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(deprecated)]
#[cfg(feature = "api-11")]
#[allow(unused_imports)]
use crate::avbuffer::OH_AVBuffer;
#[allow(unused_imports)]
use crate::averrors::OH_AVErrCode;

/// Initialization of avscreeencapture
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
///
///
/// Available since API-level: 10
///
/// Version: 1.0
#[repr(C)]
pub struct OH_AVScreenCapture {
    _unused: [u8; 0],
}
/// Initialization of OH_AVScreenCapture_ContentFilter
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
///
///
/// Available since API-level: 12
///
/// Version: 1.0
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[repr(C)]
pub struct OH_AVScreenCapture_ContentFilter {
    _unused: [u8; 0],
}
impl OH_CaptureMode {
    pub const OH_CAPTURE_HOME_SCREEN: OH_CaptureMode = OH_CaptureMode(0);
    pub const OH_CAPTURE_SPECIFIED_SCREEN: OH_CaptureMode = OH_CaptureMode(1);
    pub const OH_CAPTURE_SPECIFIED_WINDOW: OH_CaptureMode = OH_CaptureMode(2);
    pub const OH_CAPTURE_INVAILD: OH_CaptureMode = OH_CaptureMode(-1);
}
#[repr(transparent)]
/// Enumerates screen capture mode.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
///
///
/// Available since API-level: 10
///
/// Version: 1.0
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct OH_CaptureMode(pub ::core::ffi::c_int);
impl OH_AudioCaptureSourceType {
    pub const OH_SOURCE_INVALID: OH_AudioCaptureSourceType = OH_AudioCaptureSourceType(-1);
    pub const OH_SOURCE_DEFAULT: OH_AudioCaptureSourceType = OH_AudioCaptureSourceType(0);
    pub const OH_MIC: OH_AudioCaptureSourceType = OH_AudioCaptureSourceType(1);
    pub const OH_ALL_PLAYBACK: OH_AudioCaptureSourceType = OH_AudioCaptureSourceType(2);
    pub const OH_APP_PLAYBACK: OH_AudioCaptureSourceType = OH_AudioCaptureSourceType(3);
}
#[repr(transparent)]
/// Enumerates audio cap source type.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
///
///
/// Available since API-level: 10
///
/// Version: 1.0
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct OH_AudioCaptureSourceType(pub ::core::ffi::c_int);
impl OH_AudioCodecFormat {
    pub const OH_AUDIO_DEFAULT: OH_AudioCodecFormat = OH_AudioCodecFormat(0);
    pub const OH_AAC_LC: OH_AudioCodecFormat = OH_AudioCodecFormat(3);
    pub const OH_AUDIO_CODEC_FORMAT_BUTT: OH_AudioCodecFormat = OH_AudioCodecFormat(4);
}
#[repr(transparent)]
/// Enumerates audio codec formats.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
///
///
/// Available since API-level: 10
///
/// Version: 1.0
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct OH_AudioCodecFormat(pub ::core::ffi::c_uint);
impl OH_VideoCodecFormat {
    pub const OH_VIDEO_DEFAULT: OH_VideoCodecFormat = OH_VideoCodecFormat(0);
    pub const OH_H264: OH_VideoCodecFormat = OH_VideoCodecFormat(2);
    pub const OH_H265: OH_VideoCodecFormat = OH_VideoCodecFormat(4);
    pub const OH_MPEG4: OH_VideoCodecFormat = OH_VideoCodecFormat(6);
    pub const OH_VP8: OH_VideoCodecFormat = OH_VideoCodecFormat(8);
    pub const OH_VP9: OH_VideoCodecFormat = OH_VideoCodecFormat(10);
    pub const OH_VIDEO_CODEC_FORMAT_BUTT: OH_VideoCodecFormat = OH_VideoCodecFormat(11);
}
#[repr(transparent)]
/// Enumerates video codec formats.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
///
///
/// Available since API-level: 10
///
/// Version: 1.0
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct OH_VideoCodecFormat(pub ::core::ffi::c_uint);
impl OH_DataType {
    pub const OH_ORIGINAL_STREAM: OH_DataType = OH_DataType(0);
    pub const OH_ENCODED_STREAM: OH_DataType = OH_DataType(1);
    pub const OH_CAPTURE_FILE: OH_DataType = OH_DataType(2);
    pub const OH_INVAILD: OH_DataType = OH_DataType(-1);
}
#[repr(transparent)]
/// Enumerates screen capture data type.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
///
///
/// Available since API-level: 10
///
/// Version: 1.0
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct OH_DataType(pub ::core::ffi::c_int);
impl OH_VideoSourceType {
    pub const OH_VIDEO_SOURCE_SURFACE_YUV: OH_VideoSourceType = OH_VideoSourceType(0);
    pub const OH_VIDEO_SOURCE_SURFACE_ES: OH_VideoSourceType = OH_VideoSourceType(1);
    pub const OH_VIDEO_SOURCE_SURFACE_RGBA: OH_VideoSourceType = OH_VideoSourceType(2);
    pub const OH_VIDEO_SOURCE_BUTT: OH_VideoSourceType = OH_VideoSourceType(3);
}
#[repr(transparent)]
/// Enumerates video source types.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
///
///
/// Available since API-level: 10
///
/// Version: 1.0
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct OH_VideoSourceType(pub ::core::ffi::c_uint);
impl OH_ContainerFormatType {
    pub const CFT_MPEG_4A: OH_ContainerFormatType = OH_ContainerFormatType(0);
    pub const CFT_MPEG_4: OH_ContainerFormatType = OH_ContainerFormatType(1);
}
#[repr(transparent)]
/// Enumerates the container format types.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
///
///
/// Available since API-level: 10
///
/// Version: 1.0
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct OH_ContainerFormatType(pub ::core::ffi::c_uint);
/// Audio capture info struct
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
///
///
/// Available since API-level: 10
///
/// Version: 1.0
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_AudioCaptureInfo {
    pub audioSampleRate: i32,
    pub audioChannels: i32,
    pub audioSource: OH_AudioCaptureSourceType,
}
/// Audio encoder info
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
///
///
/// Available since API-level: 10
///
/// Version: 1.0
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_AudioEncInfo {
    pub audioBitrate: i32,
    pub audioCodecformat: OH_AudioCodecFormat,
}
/// The audio info of avscreeencapture
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
///
///
/// Available since API-level: 10
///
/// Version: 1.0
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_AudioInfo {
    pub micCapInfo: OH_AudioCaptureInfo,
    pub innerCapInfo: OH_AudioCaptureInfo,
    pub audioEncInfo: OH_AudioEncInfo,
}
/// Video capture info
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
///
///
/// Available since API-level: 10
///
/// Version: 1.0
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_VideoCaptureInfo {
    pub displayId: u64,
    pub missionIDs: *mut i32,
    pub missionIDsLen: i32,
    pub videoFrameWidth: i32,
    pub videoFrameHeight: i32,
    pub videoSource: OH_VideoSourceType,
}
/// Videoc encoder info
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
///
///
/// Available since API-level: 10
///
/// Version: 1.0
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_VideoEncInfo {
    pub videoCodec: OH_VideoCodecFormat,
    pub videoBitrate: i32,
    pub videoFrameRate: i32,
}
/// Video info
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
///
///
/// Available since API-level: 10
///
/// Version: 1.0
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_VideoInfo {
    pub videoCapInfo: OH_VideoCaptureInfo,
    pub videoEncInfo: OH_VideoEncInfo,
}
/// Recorder file info
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
///
///
/// Available since API-level: 10
///
/// Version: 1.0
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_RecorderInfo {
    pub url: *mut ::core::ffi::c_char,
    pub urlLen: u32,
    pub fileFormat: OH_ContainerFormatType,
}
/// AV screeen capture config info
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
///
///
/// Available since API-level: 10
///
/// Version: 1.0
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_AVScreenCaptureConfig {
    pub captureMode: OH_CaptureMode,
    pub dataType: OH_DataType,
    pub audioInfo: OH_AudioInfo,
    pub videoInfo: OH_VideoInfo,
    pub recorderInfo: OH_RecorderInfo,
}
/// When an error occurs in the running of the OH_AVScreenCapture instance, the function pointer will be called
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
/// # Arguments
///
/// * `capture` - Pointer to an OH_AVScreenCapture instance
///
/// * `errorCode` - specific error code
///
///
/// Available since API-level: 10
///
/// Version: 1.0
pub type OH_AVScreenCaptureOnError =
    ::core::option::Option<unsafe extern "C" fn(capture: *mut OH_AVScreenCapture, errorCode: i32)>;
/// When audio buffer is available during the operation of OH_AVScreenCapture, the function pointer will
/// be called.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
/// # Arguments
///
/// * `capture` - Pointer to an OH_AVScreenCapture instance
///
/// * `isReady` - Information describing whether audio buffer is available
///
/// * `type` - Information describing the audio source type
///
///
/// Available since API-level: 10
///
/// Version: 1.0
pub type OH_AVScreenCaptureOnAudioBufferAvailable = ::core::option::Option<
    unsafe extern "C" fn(
        capture: *mut OH_AVScreenCapture,
        isReady: bool,
        type_: OH_AudioCaptureSourceType,
    ),
>;
/// When video buffer is available during the operation of OH_AVScreenCapture, the function pointer will
/// be called.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
/// # Arguments
///
/// * `capture` - Pointer to an OH_AVScreenCapture instance
///
/// * `isReady` - Information describing whether video buffer is available
///
///
/// Available since API-level: 10
///
/// Version: 1.0
pub type OH_AVScreenCaptureOnVideoBufferAvailable =
    ::core::option::Option<unsafe extern "C" fn(capture: *mut OH_AVScreenCapture, isReady: bool)>;
/// A collection of all callback function pointers in OH_AVScreenCapture. Register an instance of this
/// structure to the OH_AVScreenCapture instance, and process the information reported through the callback to ensure the
/// normal operation of OH_AVScreenCapture.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
/// # Arguments
///
/// * `onError` - Monitor OH_AVScreenCapture operation errors, refer to [`OH_AVScreenCaptureOnError`]
///
/// * `onAudioBufferAvailable` - Monitor audio buffer, refer to [`OH_AVScreenCaptureOnAudioBufferAvailable`]
///
/// * `onVideoBufferAvailable` - Monitor video buffer, refer to [`OH_AVScreenCaptureOnVideoBufferAvailable`]
///
///
/// Available since API-level: 10
///
/// Version: 1.0
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_AVScreenCaptureCallback {
    pub onError: OH_AVScreenCaptureOnError,
    pub onAudioBufferAvailable: OH_AVScreenCaptureOnAudioBufferAvailable,
    pub onVideoBufferAvailable: OH_AVScreenCaptureOnVideoBufferAvailable,
}
/// avscreeencapture rect info
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
///
///
/// Available since API-level: 10
///
/// Version: 1.0
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Rect {
    pub x: i32,
    pub y: i32,
    pub width: i32,
    pub height: i32,
}
/// Audiobuffer struct info
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
///
///
/// Available since API-level: 10
///
/// Version: 1.0
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_AudioBuffer {
    pub buf: *mut u8,
    pub size: i32,
    pub timestamp: i64,
    pub type_: OH_AudioCaptureSourceType,
}
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl OH_AVScreenCaptureStateCode {
    pub const OH_SCREEN_CAPTURE_STATE_STARTED: OH_AVScreenCaptureStateCode =
        OH_AVScreenCaptureStateCode(0);
    pub const OH_SCREEN_CAPTURE_STATE_CANCELED: OH_AVScreenCaptureStateCode =
        OH_AVScreenCaptureStateCode(1);
    pub const OH_SCREEN_CAPTURE_STATE_STOPPED_BY_USER: OH_AVScreenCaptureStateCode =
        OH_AVScreenCaptureStateCode(2);
    pub const OH_SCREEN_CAPTURE_STATE_INTERRUPTED_BY_OTHER: OH_AVScreenCaptureStateCode =
        OH_AVScreenCaptureStateCode(3);
    pub const OH_SCREEN_CAPTURE_STATE_STOPPED_BY_CALL: OH_AVScreenCaptureStateCode =
        OH_AVScreenCaptureStateCode(4);
    pub const OH_SCREEN_CAPTURE_STATE_MIC_UNAVAILABLE: OH_AVScreenCaptureStateCode =
        OH_AVScreenCaptureStateCode(5);
    pub const OH_SCREEN_CAPTURE_STATE_MIC_MUTED_BY_USER: OH_AVScreenCaptureStateCode =
        OH_AVScreenCaptureStateCode(6);
    pub const OH_SCREEN_CAPTURE_STATE_MIC_UNMUTED_BY_USER: OH_AVScreenCaptureStateCode =
        OH_AVScreenCaptureStateCode(7);
    pub const OH_SCREEN_CAPTURE_STATE_ENTER_PRIVATE_SCENE: OH_AVScreenCaptureStateCode =
        OH_AVScreenCaptureStateCode(8);
    pub const OH_SCREEN_CAPTURE_STATE_EXIT_PRIVATE_SCENE: OH_AVScreenCaptureStateCode =
        OH_AVScreenCaptureStateCode(9);
    pub const OH_SCREEN_CAPTURE_STATE_STOPPED_BY_USER_SWITCHES: OH_AVScreenCaptureStateCode =
        OH_AVScreenCaptureStateCode(10);
}
#[repr(transparent)]
/// Enumerates screen capture state code.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
///
///
/// Available since API-level: 12
///
/// Version: 1.0
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct OH_AVScreenCaptureStateCode(pub ::core::ffi::c_uint);
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl OH_AVScreenCaptureBufferType {
    pub const OH_SCREEN_CAPTURE_BUFFERTYPE_VIDEO: OH_AVScreenCaptureBufferType =
        OH_AVScreenCaptureBufferType(0);
    pub const OH_SCREEN_CAPTURE_BUFFERTYPE_AUDIO_INNER: OH_AVScreenCaptureBufferType =
        OH_AVScreenCaptureBufferType(1);
    pub const OH_SCREEN_CAPTURE_BUFFERTYPE_AUDIO_MIC: OH_AVScreenCaptureBufferType =
        OH_AVScreenCaptureBufferType(2);
}
#[repr(transparent)]
/// Enumerates screen capture buffer type.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
///
///
/// Available since API-level: 12
///
/// Version: 1.0
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct OH_AVScreenCaptureBufferType(pub ::core::ffi::c_uint);
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl OH_AVScreenCaptureFilterableAudioContent {
    pub const OH_SCREEN_CAPTURE_NOTIFICATION_AUDIO: OH_AVScreenCaptureFilterableAudioContent =
        OH_AVScreenCaptureFilterableAudioContent(0);
    pub const OH_SCREEN_CAPTURE_CURRENT_APP_AUDIO: OH_AVScreenCaptureFilterableAudioContent =
        OH_AVScreenCaptureFilterableAudioContent(1);
}
#[repr(transparent)]
/// Enumerates screen capture buffer type.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
///
///
/// Available since API-level: 12
///
/// Version: 1.0
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct OH_AVScreenCaptureFilterableAudioContent(pub ::core::ffi::c_uint);
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
impl OH_AVScreenCaptureContentChangedEvent_Enum {
    pub const OH_SCREEN_CAPTURE_CONTENT_HIDE: OH_AVScreenCaptureContentChangedEvent_Enum =
        OH_AVScreenCaptureContentChangedEvent_Enum(0);
    pub const OH_SCREEN_CAPTURE_CONTENT_VISIBLE: OH_AVScreenCaptureContentChangedEvent_Enum =
        OH_AVScreenCaptureContentChangedEvent_Enum(1);
    pub const OH_SCREEN_CAPTURE_CONTENT_UNAVAILABLE: OH_AVScreenCaptureContentChangedEvent_Enum =
        OH_AVScreenCaptureContentChangedEvent_Enum(2);
}
#[repr(transparent)]
/// Enumerates screen capture content state.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
///
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct OH_AVScreenCaptureContentChangedEvent_Enum(pub ::core::ffi::c_uint);
/// Enumerates screen capture content state.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
///
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub use self::OH_AVScreenCaptureContentChangedEvent_Enum as OH_AVScreenCaptureContentChangedEvent;
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
impl OH_AVScreenCapture_FillMode {
    /// Keep the original image aspect ratio to match the target
    /// image size. If the ratio is inconsistent, there may be black edges.
    pub const OH_SCREENCAPTURE_FILLMODE_ASPECT_SCALE_FIT: OH_AVScreenCapture_FillMode =
        OH_AVScreenCapture_FillMode(0);
    /// The image is stretched to match the target output size.
    /// If the ratios are inconsistent, the image will be deformed.
    pub const OH_SCREENCAPTURE_FILLMODE_SCALE_TO_FILL: OH_AVScreenCapture_FillMode =
        OH_AVScreenCapture_FillMode(1);
}
#[repr(transparent)]
/// content fill mode.
///
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct OH_AVScreenCapture_FillMode(pub ::core::ffi::c_uint);
/// When state of OH_AVScreenCapture is changed, the function pointer will be called.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
/// # Arguments
///
/// * `capture` - Pointer to an OH_AVScreenCapture instance
///
/// * `stateCode` - Information describing current state, see [`OH_AVScreenCaptureStateCode`]
///
/// * `userData` - Pointer to user specific data
///
///
/// Available since API-level: 12
///
/// Version: 1.0
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub type OH_AVScreenCapture_OnStateChange = ::core::option::Option<
    unsafe extern "C" fn(
        capture: *mut OH_AVScreenCapture,
        stateCode: OH_AVScreenCaptureStateCode,
        userData: *mut ::core::ffi::c_void,
    ),
>;
/// When an error occurs in the running of the OH_AVScreenCapture instance, the function pointer will be called
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
/// # Arguments
///
/// * `capture` - Pointer to an OH_AVScreenCapture instance
///
/// * `errorCode` - specific error code
///
/// * `userData` - Pointer to user specific data
///
///
/// Available since API-level: 12
///
/// Version: 1.0
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub type OH_AVScreenCapture_OnError = ::core::option::Option<
    unsafe extern "C" fn(
        capture: *mut OH_AVScreenCapture,
        errorCode: i32,
        userData: *mut ::core::ffi::c_void,
    ),
>;
/// When data is ready from the OH_AVScreenCapture instance, the function pointer will be called
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
/// # Arguments
///
/// * `capture` - Pointer to an OH_AVScreenCapture instance
///
/// * `buffer` - Pointer to a buffer containing media data
///
/// * `bufferType` - Data type of the buffer, see [`OH_AVScreenCaptureBufferType`]
///
/// * `timestamp` - Timestamp of the buffer
///
/// * `userData` - Pointer to user specific data
///
///
/// Available since API-level: 12
///
/// Version: 1.0
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub type OH_AVScreenCapture_OnBufferAvailable = ::core::option::Option<
    unsafe extern "C" fn(
        capture: *mut OH_AVScreenCapture,
        buffer: *mut OH_AVBuffer,
        bufferType: OH_AVScreenCaptureBufferType,
        timestamp: i64,
        userData: *mut ::core::ffi::c_void,
    ),
>;
/// When one of the display devices start being captured, the function pointer will be called
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
/// # Arguments
///
/// * `capture` - Pointer to an OH_AVScreenCapture instance
///
/// * `displayId` - Id of the display device that being captured
///
/// * `userData` - Pointer to user specific data
///
///
/// Available since API-level: 15
#[cfg(feature = "api-15")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
pub type OH_AVScreenCapture_OnDisplaySelected = ::core::option::Option<
    unsafe extern "C" fn(
        capture: *mut OH_AVScreenCapture,
        displayId: u64,
        userData: *mut ::core::ffi::c_void,
    ),
>;
/// Initialization of OH_AVScreenCapture_CaptureStrategy
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
///
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
#[repr(C)]
pub struct OH_AVScreenCapture_CaptureStrategy {
    _unused: [u8; 0],
}
/// When Capture Content info changes, the function will be called to notify user
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
/// # Arguments
///
/// {OH_AVScreenCapture*} capture Pointer to an OH_AVScreenCapture instance
///
/// {OH_AVScreenCaptureContentChangedEvent} event enum for content change event
///
/// {OH_Rect*} area capture content rect position
///
/// { void*} userData Pointer to user specific data
///
///
/// Available since API-level: 20
///
/// Version: 1.0
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub type OH_AVScreenCapture_OnCaptureContentChanged = ::core::option::Option<
    unsafe extern "C" fn(
        capture: *mut OH_AVScreenCapture,
        event: OH_AVScreenCaptureContentChangedEvent,
        area: *mut OH_Rect,
        userData: *mut ::core::ffi::c_void,
    ),
>;
/// Initialization of OH_AVScreenCapture_UserSelectionInfo
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
///
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
#[repr(C)]
pub struct OH_AVScreenCapture_UserSelectionInfo {
    _unused: [u8; 0],
}
/// When the user selects parameters in the authorization interface (selection interface),
/// the function interface returns the parameters to the application.
///
/// Required System Capabilities: SystemCapability.Multimedia.Media.AVScreenCapture
/// # Arguments
///
/// {OH_AVScreenCapture*} capture Pointer to an OH_AVScreenCapture instance
///
/// {OH_AVScreenCapture_UserSelectionInfo*} selections The recording parameter information
/// selected by the user on the authorization interface
///
/// {void*} userData Pointer to user specific data
///
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub type OH_AVScreenCapture_OnUserSelected = ::core::option::Option<
    unsafe extern "C" fn(
        capture: *mut OH_AVScreenCapture,
        selections: *mut OH_AVScreenCapture_UserSelectionInfo,
        userData: *mut ::core::ffi::c_void,
    ),
>;