一对一视频通话(VOIP)
6.1 创建VOIP
创建CVoipManager对象
添加回调函数指针
对象所属类需要实现IVoipManagerListener接口 m_pVoipManager = new XHVoipManager(this);
|
6.2 回调函数说明
virtual void onCalling(string fromID);
virtual void onAudioCalling(string fromID);
virtual void onCancled(string fromID);
virtual void onRefused(string fromID);
virtual void onBusy(string fromID);
virtual void onMiss(CIMMessage* pMsg);
virtual void onConnected(string fromID);
virtual void onHangup(string fromID);
virtual void onError(string errorCode);
virtual void onReceiveRealtimeData(uint8_t* data, int length);
virtual int getVideoRaw(string strUserId, int w, int h, uint8_t* videoData, int videoDataLen);
virtual void onTransStateChanged(int state);
|
6.3 XHVoipManager API 说明
void setRtcMediaType(int mediaTypeEnum);
int getRtcMediaType();
bool call(string strTargetId);
bool audioCall(string strTargetId);
void cancel();
void accept(string fromID);
void refuse();
void hangup(int isActive);
void insertAudioRaw(uint8_t* audioData, int dataLen);
void insertVideoRaw(uint8_t* videoData, int dataLen, int isBig);
int cropVideoRawNV12(int w, int h, uint8_t* videoData, int dataLen, int yuvProcessPlan, int rotation, int needMirror, uint8_t* outVideoDataBig, uint8_t* outVideoDataSmall);
void querySoundData(uint8_t** pData, int* nLength);
|