-
Notifications
You must be signed in to change notification settings - Fork 229
metaRTC7 API
typedef struct{
void* conn;
YangAVInfo* avinfo;
YangStreamConfig streamconfig;
}YangPeer;
typedef struct {
YangPeer peer;
//0:host 1:stun 2:turn
YangIceCandidateType (*getIceCandidateType)(YangPeer* peer);
//add audio track
int32_t (*addAudioTrack)(YangPeer* peer,YangAudioCodec codec);
//add video track
int32_t (*addVideoTrack)(YangPeer* peer,YangVideoCodec codec);
//set direction
int32_t (*addTransceiver)(YangPeer* peer,YangRtcDirection direction);
//create local sdp
int32_t (*createOffer)(YangPeer* peer, char **psdp);
//When exchanging sdp, after obtaining the peer sdp, generate a local sdp to send back to the peer
int32_t (*createAnswer)(YangPeer* peer,char* answer);
//After the http listening signal listens to the request, generate the answer sdp of http
int32_t (*createHttpAnswer)(YangPeer* peer,char* answer);
// create datachnnel
int32_t (*createDataChannel)(YangPeer* peer);
//set remote peer sdp
int32_t (*setRemoteDescription)(YangPeer* peer,char* sdp);
//Encapsulates the signaling exchange of srs/zlm and starts metaRTC
int32_t (*connectSfuServer)(YangPeer* peer);
//Connect to sfu/mcu that supports whip/whep protocol
int32_t (*connectWhipWhepServer)(YangPeer* peer,char* url);
//close metartc
int32_t (*close)(YangPeer* peer);
//live connection state
int32_t (*isAlive)(YangPeer* peer);
//Is it already connected
int32_t (*isConnected)(YangPeer* peer);
//push audio stream
int32_t (*on_audio)(YangPeer* peer,YangFrame* audioFrame);
//push video stream
int32_t (*on_video)(YangPeer* peer,YangFrame* videoFrame);
//push datachannel message
int32_t (*on_message)(YangPeer* peer,YangFrame* msgFrame);
//send rtc system message
int32_t (*sendRtcMessage)(YangPeer* peer, YangRtcMessageType mess);
}YangPeerConnection;