mirror of
https://gitee.com/openharmony/interface_sdk_c
synced 2024-11-24 07:09:59 +00:00
AVSource支持自定义数据源NDK接口
Signed-off-by: wangyan <wangyan431@huawei.com>
This commit is contained in:
parent
1d53a5e45d
commit
deeb33a09c
@ -150,6 +150,37 @@ typedef struct OH_AVCodecCallback {
|
||||
OH_AVCodecOnNewOutputBuffer onNewOutputBuffer;
|
||||
} OH_AVCodecCallback;
|
||||
|
||||
/**
|
||||
* @brief The function pointer will be called to get sequenced media data.
|
||||
* @syscap SystemCapability.Multimedia.Media.CodecBase
|
||||
* @param data The buffer to fill.
|
||||
* @param length Length of data to read.
|
||||
* @param offset Start offset to read.
|
||||
* @return Actual length of data read to the buffer.
|
||||
* @since 12
|
||||
*/
|
||||
typedef int32_t (*OH_AVDataSourceReadAt)(OH_AVBuffer *data, int32_t length, int64_t offset);
|
||||
|
||||
/**
|
||||
* @brief User customized data source.
|
||||
* @syscap SystemCapability.Multimedia.Media.CodecBase
|
||||
* @since 12
|
||||
*/
|
||||
typedef struct OH_AVDataSource {
|
||||
/**
|
||||
* @brief Total size of the data source.
|
||||
* @syscap SystemCapability.Multimedia.Media.CodecBase
|
||||
* @since 12
|
||||
*/
|
||||
int64_t size;
|
||||
/**
|
||||
* @brief Data callback of the data source.
|
||||
* @syscap SystemCapability.Multimedia.Media.CodecBase
|
||||
* @since 12
|
||||
*/
|
||||
OH_AVDataSourceReadAt readAt;
|
||||
} OH_AVDataSource;
|
||||
|
||||
/**
|
||||
* @brief Enumerates the MIME types of audio and video codecs
|
||||
* @syscap SystemCapability.Multimedia.Media.CodecBase
|
||||
|
@ -27,6 +27,15 @@ extern "C" {
|
||||
|
||||
typedef struct OH_AVSource OH_AVSource;
|
||||
|
||||
/**
|
||||
* @brief Creates an OH_AVSource instance that models the media with data source.
|
||||
* @syscap SystemCapability.Multimedia.Media.Spliter
|
||||
* @param dataSource User customized media resource.
|
||||
* @return Returns a pointer to an OH_AVSource instance
|
||||
* @since 12
|
||||
*/
|
||||
OH_AVSource *OH_AVSource_CreateWithDataSource(OH_AVDataSource *dataSource);
|
||||
|
||||
/**
|
||||
* @brief Creates an OH_AVSource instance that models the media at the URI.
|
||||
* @syscap SystemCapability.Multimedia.Media.Spliter
|
||||
|
Loading…
Reference in New Issue
Block a user