Skip to main content

ohos_media_sys/avtranscoder_base/
avtranscoder_base_ffi.rs

1// automatically generated by rust-bindgen 0.71.1
2
3#![allow(non_upper_case_globals)]
4#![allow(non_camel_case_types)]
5#![allow(non_snake_case)]
6#![allow(deprecated)]
7#[allow(unused_imports)]
8use crate::averrors::OH_AVErrCode;
9
10/// definiton of avtranscoder
11///
12/// Available since API-level: 20
13#[cfg(feature = "api-20")]
14#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
15#[repr(C)]
16pub struct OH_AVTranscoder {
17    _unused: [u8; 0],
18}
19/// definiton of avtranscoder config
20///
21/// Available since API-level: 20
22#[cfg(feature = "api-20")]
23#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
24#[repr(C)]
25pub struct OH_AVTranscoder_Config {
26    _unused: [u8; 0],
27}
28#[cfg(feature = "api-20")]
29#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
30impl OH_AVTranscoder_State {
31    /// prepared states
32    pub const AVTRANSCODER_PREPARED: OH_AVTranscoder_State = OH_AVTranscoder_State(1);
33    /// started states
34    pub const AVTRANSCODER_STARTED: OH_AVTranscoder_State = OH_AVTranscoder_State(2);
35    /// paused states
36    pub const AVTRANSCODER_PAUSED: OH_AVTranscoder_State = OH_AVTranscoder_State(3);
37    /// cancelled states
38    pub const AVTRANSCODER_CANCELLED: OH_AVTranscoder_State = OH_AVTranscoder_State(4);
39    /// completed states
40    pub const AVTRANSCODER_COMPLETED: OH_AVTranscoder_State = OH_AVTranscoder_State(5);
41}
42#[repr(transparent)]
43/// Transcoder States
44///
45/// Available since API-level: 20
46#[cfg(feature = "api-20")]
47#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
48#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
49pub struct OH_AVTranscoder_State(pub ::core::ffi::c_uint);
50/// Called when the state changed of current transcoding.
51/// # Arguments
52///
53/// {OH_AVTranscoder*} transcoder The pointer to an OH_AVTranscoder instance.
54///
55/// {OH_AVTranscoder_State} state Indicates the transcoder state. For details, see [`OH_AVTranscoder_State`].
56///
57/// {void*} userData Pointer to user specific data.
58///
59/// Available since API-level: 20
60#[cfg(feature = "api-20")]
61#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
62pub type OH_AVTranscoder_OnStateChange = ::core::option::Option<
63    unsafe extern "C" fn(
64        transcoder: *mut OH_AVTranscoder,
65        state: OH_AVTranscoder_State,
66        userData: *mut ::core::ffi::c_void,
67    ),
68>;
69/// Called when an error occurred during transcoding
70/// # Arguments
71///
72/// {OH_AVTranscoder*} transcoder Pointer to an OH_AVTranscoder instance.
73///
74/// {int32_t} errorCode Error code.
75/// [`AV_ERR_NO_MEMORY`] if memory is insufficient.
76/// [`AV_ERR_IO`] if IO access failed.
77/// [`AV_ERR_INVALID_STATE`] if the current state does not support this operation.
78/// [`AV_ERR_UNSUPPORT`] if unsurpport function.
79/// [`AV_ERR_INVALID_VAL`] if the parameter check failed.
80/// [`AV_ERR_OPERATE_NOT_PERMIT`] if operation not allowed.
81///
82/// {const char*} errorMsg Error message.
83///
84/// {void*} userData Pointer to user specific data.
85///
86/// Available since API-level: 20
87#[cfg(feature = "api-20")]
88#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
89pub type OH_AVTranscoder_OnError = ::core::option::Option<
90    unsafe extern "C" fn(
91        transcoder: *mut OH_AVTranscoder,
92        errorCode: i32,
93        errorMsg: *const ::core::ffi::c_char,
94        userData: *mut ::core::ffi::c_void,
95    ),
96>;
97/// Progress indicator function definition, called when transcoding progress is updated
98/// # Arguments
99///
100/// {OH_AVTranscoder*} transcoder Pointer to an OH_AVTranscoder instance.
101///
102/// {int32_t} progress Transcoding progress.
103///
104/// {void*} userData Pointer to user specific data.
105///
106/// Available since API-level: 20
107#[cfg(feature = "api-20")]
108#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
109pub type OH_AVTranscoder_OnProgressUpdate = ::core::option::Option<
110    unsafe extern "C" fn(
111        transcoder: *mut OH_AVTranscoder,
112        progress: i32,
113        userData: *mut ::core::ffi::c_void,
114    ),
115>;