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;

/// Forward declaration of OH_AVFormat.
///
///
/// Available since API-level: 9
#[repr(C)]
pub struct OH_AVMemory {
    _unused: [u8; 0],
}
extern "C" {
    /// Create an OH_AVMemory instance
    ///
    /// Required System Capabilities: SystemCapability.Multimedia.Media.Core
    /// # Arguments
    ///
    /// * `size` - the memory's size, bytes.
    ///
    /// # Returns
    ///
    /// * Returns a pointer to an OH_AVMemory instance for success, needs to be freed by OH_AVMemory_Destroy,
    /// otherwise returns nullptr. Possible failure causes: 1. size <= 0. 2. create OH_AVMemory failed.
    /// 3.failed to new OH_AVMemory.
    ///
    /// **Deprecated** since 11
    /// OH_AVBuffer_Create
    ///
    /// Available since API-level: 10
    #[deprecated(since = "11")]
    pub fn OH_AVMemory_Create(size: i32) -> *mut OH_AVMemory;
    /// Get the memory's virtual address
    ///
    /// Required System Capabilities: SystemCapability.Multimedia.Media.Core
    /// # Arguments
    ///
    /// * `mem` - Encapsulate OH_AVMemory structure instance pointer
    ///
    /// # Returns
    ///
    /// * the memory's virtual address if the memory is valid, otherwise nullptr.
    /// Possible failure causes: 1. input mem is nullptr. 2. mem's magic error. 3. mem's memory is nullptr.
    ///
    /// **Deprecated** since 11
    /// OH_AVBuffer_GetAddr
    ///
    /// Available since API-level: 9
    ///
    /// Version: 1.0
    #[deprecated(since = "11")]
    pub fn OH_AVMemory_GetAddr(mem: *mut OH_AVMemory) -> *mut u8;
    /// Get the memory's size
    ///
    /// Required System Capabilities: SystemCapability.Multimedia.Media.Core
    /// # Arguments
    ///
    /// * `mem` - Encapsulate OH_AVMemory structure instance pointer
    ///
    /// # Returns
    ///
    /// * the memory's size if the memory is valid, otherwise -1.
    /// Possible failure causes: 1. input mem is nullptr. 2. mem's magic error. 3. mem's memory is nullptr.
    ///
    /// **Deprecated** since 11
    /// OH_AVBuffer_GetCapacity
    ///
    /// Available since API-level: 9
    ///
    /// Version: 1.0
    #[deprecated(since = "11")]
    pub fn OH_AVMemory_GetSize(mem: *mut OH_AVMemory) -> i32;
    /// Clear the internal resources of the memory and destroy the memory
    /// instance
    ///
    /// Required System Capabilities: SystemCapability.Multimedia.Media.Core
    /// # Arguments
    ///
    /// * `mem` - Encapsulate OH_AVMemory structure instance pointer
    ///
    /// # Returns
    ///
    /// * Function result code.
    /// [`AV_ERR_OK`] if the execution is successful.
    /// [`AV_ERR_INVALID_VAL`] if input mem is nullptr, mem's magic error or input mem is not user created.
    ///
    /// **Deprecated** since 11
    /// OH_AVBuffer_Destroy
    ///
    /// Available since API-level: 10
    #[deprecated(since = "11")]
    pub fn OH_AVMemory_Destroy(mem: *mut OH_AVMemory) -> OH_AVErrCode;
}