腾讯云直播的播放器回调通知。
可以接收 V2TXLivePlayer 播放器的一些回调通知,包括播放器状态、播放音量回调、音视频首帧回调、统计数据、警告和错误信息等。
◆ liteav::V2TXLivePlayerObserver
| class liteav::V2TXLivePlayerObserver |
Public 成员函数 |
| virtual | ~V2TXLivePlayerObserver () |
| |
| virtual void | onError (V2TXLivePlayer *player, int32_t code, const char *msg, void *extraInfo) |
| |
| virtual void | onWarning (V2TXLivePlayer *player, int32_t code, const char *msg, void *extraInfo) |
| |
| virtual void | onConnected (V2TXLivePlayer *player, void *extraInfo) |
| |
| virtual void | onVideoPlaying (V2TXLivePlayer *player, bool firstPlay, void *extraInfo) |
| |
| virtual void | onAudioPlaying (V2TXLivePlayer *player, bool firstPlay, void *extraInfo) |
| |
| virtual void | onVideoLoading (V2TXLivePlayer *player, void *extraInfo) |
| |
| virtual void | onAudioLoading (V2TXLivePlayer *player, void *extraInfo) |
| |
| virtual void | onPlayoutVolumeUpdate (V2TXLivePlayer *player, int32_t volume) |
| |
| virtual void | onStatisticsUpdate (V2TXLivePlayer *player, V2TXLivePlayerStatistics statistics) |
| |
| virtual void | onSnapshotComplete (V2TXLivePlayer *player, const char *image, int length, int width, int height, V2TXLivePixelFormat format) |
| |
| virtual void | onRenderVideoFrame (V2TXLivePlayer *player, const V2TXLiveVideoFrame *videoFrame) |
| |
| virtual void | onReceiveSeiMessage (V2TXLivePlayer *player, int payloadType, const uint8_t *data, uint32_t dataSize) |
| |
◆ ~V2TXLivePlayerObserver()
◆ onAudioLoading()
| virtual void onAudioLoading |
( |
V2TXLivePlayer * |
player, |
|
|
void * |
extraInfo |
|
) |
| |
|
inlinevirtual |
音频加载事件
- 参数
-
| player | 回调该通知的播放器对象 |
| extraInfo | 扩展信息 |
◆ onAudioPlaying()
| virtual void onAudioPlaying |
( |
V2TXLivePlayer * |
player, |
|
|
bool |
firstPlay, |
|
|
void * |
extraInfo |
|
) |
| |
|
inlinevirtual |
音频播放事件
- 参数
-
| player | 回调该通知的播放器对象 |
| firstPlay | 第一次播放标志 |
| extraInfo | 扩展信息 |
◆ onConnected()
| virtual void onConnected |
( |
V2TXLivePlayer * |
player, |
|
|
void * |
extraInfo |
|
) |
| |
|
inlinevirtual |
已经成功连接到服务器
- 参数
-
| player | 回调该通知的播放器对象 |
| extraInfo | 扩展信息 |
◆ onError()
| virtual void onError |
( |
V2TXLivePlayer * |
player, |
|
|
int32_t |
code, |
|
|
const char * |
msg, |
|
|
void * |
extraInfo |
|
) |
| |
|
inlinevirtual |
直播播放器错误通知,播放器出现错误时,会回调该通知
- 参数
-
| player | 回调该通知的播放器对象 |
| code | 错误码 V2TXLiveCode |
| msg | 错误信息 |
| extraInfo | 扩展信息 |
◆ onPlayoutVolumeUpdate()
| virtual void onPlayoutVolumeUpdate |
( |
V2TXLivePlayer * |
player, |
|
|
int32_t |
volume |
|
) |
| |
|
inlinevirtual |
◆ onReceiveSeiMessage()
| virtual void onReceiveSeiMessage |
( |
V2TXLivePlayer * |
player, |
|
|
int |
payloadType, |
|
|
const uint8_t * |
data, |
|
|
uint32_t |
dataSize |
|
) |
| |
|
inlinevirtual |
收到 SEI 消息的回调,发送端通过 V2TXLivePusher 中的 sendSeiMessage 来发送 SEI 消息。
- 注意
- 调用 V2TXLivePlayer 中的
enableReceiveSeiMessage 开启接收 SEI 消息之后,会收到这个回调通知
- 参数
-
| player | 回调该通知的播放器对象 |
| payloadType | 收到 SEI 消息的 payloadType |
| data | 数据 |
| dataSize | 数据大小 |
◆ onRenderVideoFrame()
自定义视频渲染回调
- 参数
-
- 注意
- 需要您调用 V2TXLivePlayer::enableObserveVideoFrame:pixelFormat:bufferType: "enableObserveVideoFrame" 开启回调开关
◆ onSnapshotComplete()
截图回调
- 注意
- 调用 snapshot 截图之后,会收到这个回调通知
- 参数
-
| player | 回调该通知的播放器对象 |
| image | 已截取的视频画面 |
| length | 截图数据长度,对于BGRA32而言,length = width * height * 4 |
| width | 截图画面的宽度 |
| height | 截图画面的高度 |
| format | 截图数据格式,目前只支持 V2TXLivePixelFormatBGRA32 |
◆ onStatisticsUpdate()
◆ onVideoLoading()
| virtual void onVideoLoading |
( |
V2TXLivePlayer * |
player, |
|
|
void * |
extraInfo |
|
) |
| |
|
inlinevirtual |
视频加载事件
- 参数
-
| player | 回调该通知的播放器对象 |
| extraInfo | 扩展信息 |
◆ onVideoPlaying()
| virtual void onVideoPlaying |
( |
V2TXLivePlayer * |
player, |
|
|
bool |
firstPlay, |
|
|
void * |
extraInfo |
|
) |
| |
|
inlinevirtual |
视频播放事件
- 参数
-
| player | 回调该通知的播放器对象 |
| firstPlay | 第一次播放标志 |
| extraInfo | 扩展信息 |
◆ onWarning()
| virtual void onWarning |
( |
V2TXLivePlayer * |
player, |
|
|
int32_t |
code, |
|
|
const char * |
msg, |
|
|
void * |
extraInfo |
|
) |
| |
|
inlinevirtual |
直播播放器警告通知
- 参数
-
| player | 回调该通知的播放器对象 |
| code | 警告码 V2TXLiveCode |
| msg | 警告信息 |
| extraInfo | 扩展信息 |
◆ MODULE_CPP_V2TXLIVEPLAYEROBSERVER_H_
| #define MODULE_CPP_V2TXLIVEPLAYEROBSERVER_H_ |