ohos-media-sys 0.1.0

Raw Bindings to the media framework on OpenHarmony
Documentation
// automatically generated by rust-bindgen 0.71.1

#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(deprecated)]
#[allow(unused_imports)]
use crate::averrors::OH_AVErrCode;

/// definiton of avtranscoder
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
#[repr(C)]
pub struct OH_AVTranscoder {
    _unused: [u8; 0],
}
/// definiton of avtranscoder config
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
#[repr(C)]
pub struct OH_AVTranscoder_Config {
    _unused: [u8; 0],
}
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
impl OH_AVTranscoder_State {
    /// prepared states
    pub const AVTRANSCODER_PREPARED: OH_AVTranscoder_State = OH_AVTranscoder_State(1);
    /// started states
    pub const AVTRANSCODER_STARTED: OH_AVTranscoder_State = OH_AVTranscoder_State(2);
    /// paused states
    pub const AVTRANSCODER_PAUSED: OH_AVTranscoder_State = OH_AVTranscoder_State(3);
    /// cancelled states
    pub const AVTRANSCODER_CANCELLED: OH_AVTranscoder_State = OH_AVTranscoder_State(4);
    /// completed states
    pub const AVTRANSCODER_COMPLETED: OH_AVTranscoder_State = OH_AVTranscoder_State(5);
}
#[repr(transparent)]
/// Transcoder States
///
/// 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_AVTranscoder_State(pub ::core::ffi::c_uint);
/// Called when the state changed of current transcoding.
/// # Arguments
///
/// {OH_AVTranscoder*} transcoder The pointer to an OH_AVTranscoder instance.
///
/// {OH_AVTranscoder_State} state Indicates the transcoder state. For details, see [`OH_AVTranscoder_State`].
///
/// {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_AVTranscoder_OnStateChange = ::core::option::Option<
    unsafe extern "C" fn(
        transcoder: *mut OH_AVTranscoder,
        state: OH_AVTranscoder_State,
        userData: *mut ::core::ffi::c_void,
    ),
>;
/// Called when an error occurred during transcoding
/// # Arguments
///
/// {OH_AVTranscoder*} transcoder Pointer to an OH_AVTranscoder instance.
///
/// {int32_t} errorCode Error code.
/// [`AV_ERR_NO_MEMORY`] if memory is insufficient.
/// [`AV_ERR_IO`] if IO access failed.
/// [`AV_ERR_INVALID_STATE`] if the current state does not support this operation.
/// [`AV_ERR_UNSUPPORT`] if unsurpport function.
/// [`AV_ERR_INVALID_VAL`] if the parameter check failed.
/// [`AV_ERR_OPERATE_NOT_PERMIT`] if operation not allowed.
///
/// {const char*} errorMsg Error message.
///
/// {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_AVTranscoder_OnError = ::core::option::Option<
    unsafe extern "C" fn(
        transcoder: *mut OH_AVTranscoder,
        errorCode: i32,
        errorMsg: *const ::core::ffi::c_char,
        userData: *mut ::core::ffi::c_void,
    ),
>;
/// Progress indicator function definition, called when transcoding progress is updated
/// # Arguments
///
/// {OH_AVTranscoder*} transcoder Pointer to an OH_AVTranscoder instance.
///
/// {int32_t} progress Transcoding progress.
///
/// {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_AVTranscoder_OnProgressUpdate = ::core::option::Option<
    unsafe extern "C" fn(
        transcoder: *mut OH_AVTranscoder,
        progress: i32,
        userData: *mut ::core::ffi::c_void,
    ),
>;