音频流解码接口,均为同步阻塞操作,分离了创建-发送-销毁,相比于MediaAdecStreamSync减少频繁调用下的性能开销
#include "MediaAdec.hpp"
|
| ErrCodeE | Create () |
| | 创建MsgTopicPublisherSync2 更多...
|
| |
| void | Destroy () |
| | 销毁MsgTopicPublisherSync2 更多...
|
| |
| ErrCodeE | PushFrame (int32_t chn, MediaAdec::Frame &frame, int32_t timeoutMs=1000) |
| | 发送音频帧到媒体服务进行解码播放,这里发送的音频帧的编码格式需要与MediaClientAenc中配置的解码格式一致 更多...
|
| |
| ErrCodeE | PushRawPcm (int32_t chn, MediaAdec::Frame &frame, int32_t timeoutMs=1000) |
| | 发送Pcm音频帧到媒体服务直接播放 更多...
|
| |
| ErrCodeE | PlayFile (int32_t chn, const char *path, int32_t timeoutMs=1000) |
| | 添加音频文件路径至媒体服务的播放列表中,添加后此函数就会返回,列表为空时会立刻播放 更多...
|
| |
| ErrCodeE | PlayFileWithVolume (int32_t chn, const char *path, int32_t volume, int32_t timeoutMs=1000) |
| | 添加音频文件路径至媒体服务的播放列表中,添加后此函数就会返回,列表为空时会立刻播放 更多...
|
| |
| ErrCodeE | PlayCtrlQuit (int32_t chn, bool fullInterrupt=true, int32_t timeoutMs=1000) |
| | 终止播放并清空媒体服务播放列表 更多...
|
| |
◆ Create()
| ErrCodeE Emx::MediaAdecStreamSync2::Create |
( |
| ) |
|
|
inline |
◆ Destroy()
| void Emx::MediaAdecStreamSync2::Destroy |
( |
| ) |
|
|
inline |
◆ PushFrame()
- 参数
-
| chn | [in] 目的通道号 |
| frame | [in] 与音频帧信息 |
| timeoutMs | [in] 超时时间,默认1s |
- 返回
- ErrCode
◆ PushRawPcm()
- 参数
-
| chn | [in] 目的通道号 |
| frame | [in] 音频帧信息 |
| timeoutMs | [in] 超时时间,默认1s |
- 返回
- ErrCode
◆ PlayFile()
| ErrCodeE Emx::MediaAdecStreamSync2::PlayFile |
( |
int32_t |
chn, |
|
|
const char * |
path, |
|
|
int32_t |
timeoutMs = 1000 |
|
) |
| |
- 参数
-
| chn | [in] 目的通道号 |
| path | [in] 音频文件路径 |
| timeoutMs | [in] 超时时间,默认1s |
- 返回
- ErrCode
◆ PlayFileWithVolume()
| ErrCodeE Emx::MediaAdecStreamSync2::PlayFileWithVolume |
( |
int32_t |
chn, |
|
|
const char * |
path, |
|
|
int32_t |
volume, |
|
|
int32_t |
timeoutMs = 1000 |
|
) |
| |
- 参数
-
| chn | [in] 目的通道号 |
| path | [in] 音频文件路径 |
| volume | [in] 希望临时以此音量播放文件 |
| timeoutMs | [in] 超时时间,默认1s |
- 返回
- ErrCode
◆ PlayCtrlQuit()
| ErrCodeE Emx::MediaAdecStreamSync2::PlayCtrlQuit |
( |
int32_t |
chn, |
|
|
bool |
fullInterrupt = true, |
|
|
int32_t |
timeoutMs = 1000 |
|
) |
| |
- 参数
-
| chn | [in] 目的通道号 |
| fullInterrupt | [in] 是否完全中断 默认true |
| timeoutMs | [in] 超时时间,默认1s |
- 返回
- ErrCode