ZegoPlayRecorder
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
Public Member Functions | List of all members
ZEGO::LIVEROOM::ICallback Class Referenceabstract

#include <LiveRoom.h>

Public Member Functions

virtual void OnInitSDK (int errorCode)
 
virtual void OnLoginRoom (int errorCode, const char *pszRoomID)=0
 
virtual void OnLogoutRoom (int errorCode, const char *pszRoomID)
 
virtual void OnDisconnect (int errorCode, const char *pszRoomID)=0
 
virtual void OnStreamUpdate (ZegoStreamUpdateType type, ZegoStreamInfo *pStreamInfo, unsigned int streamCount, const char *pszRoomID)=0
 
virtual void OnStreamRecordBegin (const char *pszStreamID, const char *pszPathAndName)=0
 
virtual void OnStreamRecordEnd (const char *pszStreamID, const char *pszPathAndName, RecordEndReason reason)=0
 
virtual void OnStreamRecordEvent (const char *pszStreamID, RecordEvent event)
 
virtual void OnStreamRecordData (const char *pszStreamID, const char *data, int len)
 
virtual void OnSeek (const char *pszStreamID, long long offset, int whence)
 
virtual void OnVideoDataCallback (const unsigned char **pData, int *dataLen, const char *pszStreamID, int width, int height, int strides[4], VideoPixelFormat pixel_format)
 
virtual void OnAudioDataCallback (const char *pszStreamID, const AudioFrame &frame)
 
virtual void OnMixStreamRecordUpdate (const char **ppszStreamID, int nStreamCount)=0
 
virtual ~ICallback ()
 

Detailed Description

事件回调

Constructor & Destructor Documentation

virtual ZEGO::LIVEROOM::ICallback::~ICallback ( )
inlinevirtual

Member Function Documentation

virtual void ZEGO::LIVEROOM::ICallback::OnAudioDataCallback ( const char *  pszStreamID,
const AudioFrame frame 
)
inlinevirtual

音频数据回调,回调抛出每路单流音频解码数据,不要在回调函数中做耗时的操作

Parameters
pszStreamID流 ID
frame音频数据
virtual void ZEGO::LIVEROOM::ICallback::OnDisconnect ( int  errorCode,
const char *  pszRoomID 
)
pure virtual

与 server 断开通知

Parameters
errorCode错误码,0 表示无错误
pszRoomID房间 ID
Attention
建议开发者在此通知中进行重新登录、提示等其他恢复逻辑 与 server 断开连接后,SDK 会进行重试,重试失败抛出此错误。请注意,此时 SDK 与服务器的所有连接均会断开
virtual void ZEGO::LIVEROOM::ICallback::OnInitSDK ( int  errorCode)
inlinevirtual

InitSDK回调

Parameters
errorCode错误码,0 表示无错误
virtual void ZEGO::LIVEROOM::ICallback::OnLoginRoom ( int  errorCode,
const char *  pszRoomID 
)
pure virtual

登录房间成功回调

Parameters
errorCode错误码,0 表示无错误
pszRoomID房间 ID
virtual void ZEGO::LIVEROOM::ICallback::OnLogoutRoom ( int  errorCode,
const char *  pszRoomID 
)
inlinevirtual

退出房间回调

Parameters
errorCode错误码,0 表示无错误
pszRoomID房间 ID
virtual void ZEGO::LIVEROOM::ICallback::OnMixStreamRecordUpdate ( const char **  ppszStreamID,
int  nStreamCount 
)
pure virtual

混流录制信息更新回调

Parameters
ppszStreamID流 ID, 正在录制流数组
nStreamCount正在录制流数组大小 这个回调表示哪些流参与混流录制,只包括成功拉到数据的流,SDK内容会重试拉失败的流,拉流状态变化时会回调
virtual void ZEGO::LIVEROOM::ICallback::OnSeek ( const char *  pszStreamID,
long long  offset,
int  whence 
)
inlinevirtual

录制seek回调

Parameters
pszStreamID流 ID, NULL表示混流录制回调
offset偏移大小
whence偏移位置,SEEK_SET/SEEK_CUR/SEEK_END
Attention
调用SetMuxerOutType且参数为MuxerOutTypeOnlyCallback时才有该回调,收到该回调需要调用fseek或者seek再继续写OnStreamRecordData回调的数据
virtual void ZEGO::LIVEROOM::ICallback::OnStreamRecordBegin ( const char *  pszStreamID,
const char *  pszPathAndName 
)
pure virtual

录制开始回调

Parameters
pszStreamID流 ID, NULL表示混流录制回调
pszPathAndName录制文件路径
virtual void ZEGO::LIVEROOM::ICallback::OnStreamRecordData ( const char *  pszStreamID,
const char *  data,
int  len 
)
inlinevirtual

录制数据回调

Parameters
pszStreamID流 ID, NULL表示混流录制回调
data录制数据
len录制数据长度
Attention
调用SetMuxerOutType且参数为MuxerOutTypeOnlyCallback时才有该回调
virtual void ZEGO::LIVEROOM::ICallback::OnStreamRecordEnd ( const char *  pszStreamID,
const char *  pszPathAndName,
RecordEndReason  reason 
)
pure virtual

录制结束回调

Parameters
pszStreamID流 ID, NULL表示混流录制回调
pszPathAndName录制文件路径
reason录制结束原因
virtual void ZEGO::LIVEROOM::ICallback::OnStreamRecordEvent ( const char *  pszStreamID,
RecordEvent  event 
)
inlinevirtual

录制事件回调

Parameters
pszStreamID流 ID, NULL表示混流录制回调
event录制过程发生的事件
virtual void ZEGO::LIVEROOM::ICallback::OnStreamUpdate ( ZegoStreamUpdateType  type,
ZegoStreamInfo pStreamInfo,
unsigned int  streamCount,
const char *  pszRoomID 
)
pure virtual

流信息更新

Parameters
type更新类型
pStreamInfo直播流数组
streamCount直播流个数
pszRoomID房间 ID
Attention
登录房间后如果已存在流会收到流增加通知,之后房间内增加流、删除流,均会触发此更新
virtual void ZEGO::LIVEROOM::ICallback::OnVideoDataCallback ( const unsigned char **  pData,
int *  dataLen,
const char *  pszStreamID,
int  width,
int  height,
int  strides[4],
VideoPixelFormat  pixel_format 
)
inlinevirtual

视频帧数据回调,回调抛出每路单流解码帧数据,不要在回调函数中做耗时的操作

Parameters
pData视频数据起始地址
dataLen视频数据长度
pszStreamID流 ID
width视频宽度
height视频高度
strides每个平面一行字节数
pixel_format视频帧数据格式
Attention
混流录制时调用EnableExternalRender且参数为true时才有该回调

The documentation for this class was generated from the following file: