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::avbuffer_info::OH_AVCodecBufferAttr;
#[allow(unused_imports)]
use crate::avcodec_base::{OH_AVCodec, OH_AVCodecAsyncCallback};
#[allow(unused_imports)]
use crate::averrors::OH_AVErrCode;
#[allow(unused_imports)]
use crate::avformat::OH_AVFormat;

extern "C" {
    /// Creates an audio decoder instance from the mime type, which is recommended in most cases.
    ///
    /// Required System Capabilities: SystemCapability.Multimedia.Media.AudioDecoder
    /// # Arguments
    ///
    /// * `mime` - mime type description string, refer to [`AVCODEC_MIME_TYPE`]
    ///
    /// # Returns
    ///
    /// * Returns a Pointer to an OH_AVCodec instance
    ///
    /// **Deprecated** since 11
    /// OH_AudioCodec_CreateByMime
    ///
    /// Available since API-level: 9
    #[deprecated(since = "11")]
    pub fn OH_AudioDecoder_CreateByMime(mime: *const ::core::ffi::c_char) -> *mut OH_AVCodec;
    /// Create an audio decoder instance through the audio decoder name.
    /// The premise of using this interface is to know the exact name of the decoder.
    ///
    /// Required System Capabilities: SystemCapability.Multimedia.Media.AudioDecoder
    /// # Arguments
    ///
    /// * `name` - Audio codec name
    ///
    /// # Returns
    ///
    /// * Returns a Pointer to an OH_AVCodec instance
    ///
    /// **Deprecated** since 11
    /// OH_AudioCodec_CreateByName
    ///
    /// Available since API-level: 9
    #[deprecated(since = "11")]
    pub fn OH_AudioDecoder_CreateByName(name: *const ::core::ffi::c_char) -> *mut OH_AVCodec;
    /// Clear the internal resources of the decoder and destroy the decoder instance
    ///
    /// Required System Capabilities: SystemCapability.Multimedia.Media.AudioDecoder
    /// # Arguments
    ///
    /// * `codec` - Pointer to an OH_AVCodec instance
    ///
    /// # Returns
    ///
    /// * Returns AV_ERR_OK if the execution is successful,
    /// otherwise returns a specific error code, refer to [`OH_AVErrCode`]
    ///
    /// **Deprecated** since 11
    /// OH_AudioCodec_Destroy
    ///
    /// Available since API-level: 9
    #[deprecated(since = "11")]
    pub fn OH_AudioDecoder_Destroy(codec: *mut OH_AVCodec) -> OH_AVErrCode;
    /// Set the asynchronous callback function so that your application
    /// can respond to the events generated by the audio decoder. This interface must be called before Prepare is called.
    ///
    /// Required System Capabilities: SystemCapability.Multimedia.Media.AudioDecoder
    /// # Arguments
    ///
    /// * `codec` - Pointer to an OH_AVCodec instance
    ///
    /// * `callback` - A collection of all callback functions, see [`OH_AVCodecAsyncCallback`]
    ///
    /// * `userData` - User specific data
    ///
    /// # Returns
    ///
    /// * Returns AV_ERR_OK if the execution is successful,
    /// otherwise returns a specific error code, refer to [`OH_AVErrCode`]
    ///
    /// **Deprecated** since 11
    /// OH_AudioCodec_RegisterCallback
    ///
    /// Available since API-level: 9
    #[deprecated(since = "11")]
    pub fn OH_AudioDecoder_SetCallback(
        codec: *mut OH_AVCodec,
        callback: OH_AVCodecAsyncCallback,
        userData: *mut ::core::ffi::c_void,
    ) -> OH_AVErrCode;
    /// To configure the audio decoder, typically, you need to configure the description information of the decoded
    /// audio track, which can be extracted from the OH_AVSource. This interface must be called before Prepare is called.
    ///
    /// Required System Capabilities: SystemCapability.Multimedia.Media.AudioDecoder
    /// # Arguments
    ///
    /// * `codec` - Pointer to an OH_AVCodec instance
    ///
    /// * `format` - A pointer to an OH_AVFormat giving a description of the audio track to be decoded
    ///
    /// # Returns
    ///
    /// * Returns AV_ERR_OK if the execution is successful,
    /// otherwise returns a specific error code, refer to [`OH_AVErrCode`]
    ///
    /// **Deprecated** since 11
    /// OH_AudioCodec_Configure
    ///
    /// Available since API-level: 9
    #[deprecated(since = "11")]
    pub fn OH_AudioDecoder_Configure(
        codec: *mut OH_AVCodec,
        format: *mut OH_AVFormat,
    ) -> OH_AVErrCode;
    /// To prepare the internal resources of the decoder, the Configure interface must be called
    /// before calling this interface.
    ///
    /// Required System Capabilities: SystemCapability.Multimedia.Media.AudioDecoder
    /// # Arguments
    ///
    /// * `codec` - Pointer to an OH_AVCodec instance
    ///
    /// # Returns
    ///
    /// * Returns AV_ERR_OK if the execution is successful,
    /// otherwise returns a specific error code, refer to [`OH_AVErrCode`]
    ///
    /// **Deprecated** since 11
    /// OH_AudioCodec_Prepare
    ///
    /// Available since API-level: 9
    #[deprecated(since = "11")]
    pub fn OH_AudioDecoder_Prepare(codec: *mut OH_AVCodec) -> OH_AVErrCode;
    /// Start the decoder, this interface must be called after the Prepare is successful.
    /// After being successfully started, the decoder will start reporting NeedInputData events.
    ///
    /// Required System Capabilities: SystemCapability.Multimedia.Media.AudioDecoder
    /// # Arguments
    ///
    /// * `codec` - Pointer to an OH_AVCodec instance
    ///
    /// # Returns
    ///
    /// * Returns AV_ERR_OK if the execution is successful,
    /// otherwise returns a specific error code, refer to [`OH_AVErrCode`]
    ///
    /// **Deprecated** since 11
    /// OH_AudioCodec_Start
    ///
    /// Available since API-level: 9
    #[deprecated(since = "11")]
    pub fn OH_AudioDecoder_Start(codec: *mut OH_AVCodec) -> OH_AVErrCode;
    /// Stop the decoder. After stopping, you can re-enter the Started state through Start,
    /// but it should be noted that need to re-enter if the decoder has been input before
    /// Codec-Specific-Data.
    ///
    /// Required System Capabilities: SystemCapability.Multimedia.Media.AudioDecoder
    /// # Arguments
    ///
    /// * `codec` - Pointer to an OH_AVCodec instance
    ///
    /// # Returns
    ///
    /// * Returns AV_ERR_OK if the execution is successful,
    /// otherwise returns a specific error code, refer to [`OH_AVErrCode`]
    ///
    /// **Deprecated** since 11
    /// OH_AudioCodec_Stop
    ///
    /// Available since API-level: 9
    #[deprecated(since = "11")]
    pub fn OH_AudioDecoder_Stop(codec: *mut OH_AVCodec) -> OH_AVErrCode;
    /// Clear the input and output data buffered in the decoder. After this interface is called, all the Buffer
    /// indexes previously reported through the asynchronous callback will be invalidated, make sure not to access
    /// the Buffers corresponding to these indexes.
    ///
    /// Required System Capabilities: SystemCapability.Multimedia.Media.AudioDecoder
    /// # Arguments
    ///
    /// * `codec` - Pointer to an OH_AVCodec instance
    ///
    /// # Returns
    ///
    /// * Returns AV_ERR_OK if the execution is successful,
    /// otherwise returns a specific error code, refer to [`OH_AVErrCode`]
    ///
    /// **Deprecated** since 11
    /// OH_AudioCodec_Flush
    ///
    /// Available since API-level: 9
    #[deprecated(since = "11")]
    pub fn OH_AudioDecoder_Flush(codec: *mut OH_AVCodec) -> OH_AVErrCode;
    /// Reset the decoder. To continue decoding, you need to call the Configure interface again to
    /// configure the decoder instance.
    ///
    /// Required System Capabilities: SystemCapability.Multimedia.Media.AudioDecoder
    /// # Arguments
    ///
    /// * `codec` - Pointer to an OH_AVCodec instance
    ///
    /// # Returns
    ///
    /// * Returns AV_ERR_OK if the execution is successful,
    /// otherwise returns a specific error code, refer to [`OH_AVErrCode`]
    ///
    /// **Deprecated** since 11
    /// OH_AudioCodec_Reset
    ///
    /// Available since API-level: 9
    #[deprecated(since = "11")]
    pub fn OH_AudioDecoder_Reset(codec: *mut OH_AVCodec) -> OH_AVErrCode;
    /// Get the description information of the output data of the decoder, refer to [`OH_AVFormat`] for details.
    /// 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.AudioDecoder
    /// # Arguments
    ///
    /// * `codec` - Pointer to an OH_AVCodec instance
    ///
    /// # Returns
    ///
    /// * Returns the OH_AVFormat handle pointer, the life cycle is refreshed with the next GetOutputMediaDescription,
    /// or destroyed with OH_AVCodec;
    ///
    /// **Deprecated** since 11
    /// OH_AudioCodec_GetOutputDescription
    ///
    /// Available since API-level: 9
    #[deprecated(since = "11")]
    pub fn OH_AudioDecoder_GetOutputDescription(codec: *mut OH_AVCodec) -> *mut OH_AVFormat;
    /// Set dynamic parameters to the decoder. Note: This interface can only be called after the decoder is started.
    /// At the same time, incorrect parameter settings may cause decoding failure.
    ///
    /// Required System Capabilities: SystemCapability.Multimedia.Media.AudioDecoder
    /// # Arguments
    ///
    /// * `codec` - Pointer to an OH_AVCodec instance
    ///
    /// * `format` - OH_AVFormat handle pointer
    ///
    /// # Returns
    ///
    /// * Returns AV_ERR_OK if the execution is successful,
    /// otherwise returns a specific error code, refer to [`OH_AVErrCode`]
    ///
    /// **Deprecated** since 11
    /// OH_AudioCodec_SetParameter
    ///
    /// Available since API-level: 9
    #[deprecated(since = "11")]
    pub fn OH_AudioDecoder_SetParameter(
        codec: *mut OH_AVCodec,
        format: *mut OH_AVFormat,
    ) -> OH_AVErrCode;
    /// Submit the input buffer filled with data to the audio decoder. The [`OH_AVCodecOnNeedInputData`] callback
    /// will report the available input buffer and the corresponding index value. Once the buffer with the specified index
    /// is submitted to the audio decoder, the buffer cannot be accessed again until the [`OH_AVCodecOnNeedInputData`]
    /// callback is received again reporting that the buffer with the same index is available. In addition, for some
    /// decoders, it is required to input Codec-Specific-Data to the decoder at the beginning to initialize the decoding
    /// process of the decoder.
    ///
    /// Required System Capabilities: SystemCapability.Multimedia.Media.AudioDecoder
    /// # Arguments
    ///
    /// * `codec` - Pointer to an OH_AVCodec instance
    ///
    /// * `index` - Enter the index value corresponding to the Buffer
    ///
    /// * `attr` - Information describing the data contained in the Buffer
    ///
    /// # Returns
    ///
    /// * Returns AV_ERR_OK if the execution is successful,
    /// otherwise returns a specific error code, refer to [`OH_AVErrCode`]
    ///
    /// **Deprecated** since 11
    /// OH_AudioCodec_PushInputBuffer
    ///
    /// Available since API-level: 9
    #[deprecated(since = "11")]
    pub fn OH_AudioDecoder_PushInputData(
        codec: *mut OH_AVCodec,
        index: u32,
        attr: OH_AVCodecBufferAttr,
    ) -> OH_AVErrCode;
    /// Return the processed output Buffer to the decoder.
    ///
    /// Required System Capabilities: SystemCapability.Multimedia.Media.AudioDecoder
    /// # Arguments
    ///
    /// * `codec` - Pointer to an OH_AVCodec instance
    ///
    /// * `index` - The index value corresponding to the output Buffer
    ///
    /// # Returns
    ///
    /// * Returns AV_ERR_OK if the execution is successful,
    /// otherwise returns a specific error code, refer to [`OH_AVErrCode`]
    ///
    /// **Deprecated** since 11
    /// OH_AudioCodec_FreeOutputBuffer
    ///
    /// Available since API-level: 9
    #[deprecated(since = "11")]
    pub fn OH_AudioDecoder_FreeOutputData(codec: *mut OH_AVCodec, index: u32) -> OH_AVErrCode;
    /// Check whether the current codec instance is valid. It can be used fault recovery or app
    /// switchback from the background
    ///
    /// Required System Capabilities: SystemCapability.Multimedia.Media.AudioDecoder
    /// # Arguments
    ///
    /// * `codec` - Pointer to an OH_AVCodec instance
    ///
    /// * `isValid` - Output Parameter. A pointer to a boolean instance, it is true if the codec instance is valid,
    /// false if the codec instance is invalid
    ///
    /// # Returns
    ///
    /// * Returns AV_ERR_OK if the execution is successful,
    /// otherwise returns a specific error code, refer to [`OH_AVErrCode`]
    ///
    /// **Deprecated** since 11
    /// OH_AudioCodec_IsValid
    ///
    /// Available since API-level: 10
    #[deprecated(since = "11")]
    pub fn OH_AudioDecoder_IsValid(codec: *mut OH_AVCodec, isValid: *mut bool) -> OH_AVErrCode;
}