Commit 2a906ad0 by Johnny

保留 WebRtcTransport::onCheckSdp 接口。

parent 0f4289a5
......@@ -188,6 +188,7 @@ std::string WebRtcTransport::getAnswerSdp(const string &offer){
_offer_sdp->loadFrom(offer);
_offer_sdp->checkSdp();
_offer_sdp->checkValidSSRC();
// onCheckSdp(SdpType::offer, *_offer_sdp);
setRemoteDtlsFingerprint(*_offer_sdp);
//// sdp 配置 ////
......@@ -202,7 +203,7 @@ std::string WebRtcTransport::getAnswerSdp(const string &offer){
//// 生成answer sdp ////
_answer_sdp = configure.createAnswer(*_offer_sdp);
_answer_sdp->checkSdp();
onCheckAnswer(*_answer_sdp);
onCheckSdp(SdpType::answer, *_answer_sdp);
return _answer_sdp->toString();
} catch (exception &ex) {
onShutdown(SockException(Err_shutdown, ex.what()));
......@@ -549,6 +550,17 @@ void WebRtcTransportImp::onCheckAnswer(RtcSession &sdp) {
}
}
void WebRtcTransportImp::onCheckSdp(SdpType type, RtcSession &sdp) {
switch (type) {
case SdpType::answer:
onCheckAnswer(sdp);
break;
default:
// TODO for offer and other
break;
}
}
void WebRtcTransportImp::onRtcConfigure(RtcConfigure &configure) const {
WebRtcTransport::onRtcConfigure(configure);
......
......@@ -106,7 +106,7 @@ protected:
protected:
virtual void onStartWebRTC() = 0;
virtual void onRtcConfigure(RtcConfigure &configure) const;
virtual void onCheckAnswer(RtcSession &sdp) = 0;
virtual void onCheckSdp(SdpType type, RtcSession &sdp) = 0;
virtual void onSendSockData(const char *buf, size_t len, struct sockaddr_in *dst, bool flush = true) = 0;
virtual void onRtp(const char *buf, size_t len, uint64_t stamp_ms) = 0;
......@@ -184,7 +184,7 @@ public:
protected:
void onStartWebRTC() override;
void onSendSockData(const char *buf, size_t len, struct sockaddr_in *dst, bool flush = true) override;
void onCheckAnswer(RtcSession &sdp) override;
void onCheckSdp(SdpType type, RtcSession &sdp) override;
void onRtcConfigure(RtcConfigure &configure) const override;
void onRtp(const char *buf, size_t len, uint64_t stamp_ms) override;
......@@ -222,6 +222,7 @@ private:
void registerSelf();
void unregisterSelf();
void unrefSelf();
void onCheckAnswer(RtcSession &sdp);
private:
bool _simulcast = false;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论