mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 19:00:01 +08:00
修复webrtc单track功能异常的问题
This commit is contained in:
parent
76d6e68ecc
commit
99a8154fa5
@ -386,13 +386,27 @@ void WebRtcTransportImp::onSendSockData(const char *buf, size_t len, struct sock
|
||||
///////////////////////////////////////////////////////////////////
|
||||
|
||||
bool WebRtcTransportImp::canSendRtp() const{
|
||||
auto &sdp = getSdp(SdpType::answer);
|
||||
return _play_src && (sdp.media[0].direction == RtpDirection::sendrecv || sdp.media[0].direction == RtpDirection::sendonly);
|
||||
if (!_play_src) {
|
||||
return false;
|
||||
}
|
||||
for (auto &m : getSdp(SdpType::answer).media) {
|
||||
if (m.direction == RtpDirection::sendrecv || m.direction == RtpDirection::sendonly) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool WebRtcTransportImp::canRecvRtp() const{
|
||||
auto &sdp = getSdp(SdpType::answer);
|
||||
return _push_src && (sdp.media[0].direction == RtpDirection::sendrecv || sdp.media[0].direction == RtpDirection::recvonly);
|
||||
if (!_push_src) {
|
||||
return false;
|
||||
}
|
||||
for (auto &m : getSdp(SdpType::answer).media) {
|
||||
if (m.direction == RtpDirection::sendrecv || m.direction == RtpDirection::recvonly) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void WebRtcTransportImp::onStartWebRTC() {
|
||||
|
Loading…
Reference in New Issue
Block a user