mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-23 03:10:04 +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{
|
bool WebRtcTransportImp::canSendRtp() const{
|
||||||
auto &sdp = getSdp(SdpType::answer);
|
if (!_play_src) {
|
||||||
return _play_src && (sdp.media[0].direction == RtpDirection::sendrecv || sdp.media[0].direction == RtpDirection::sendonly);
|
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{
|
bool WebRtcTransportImp::canRecvRtp() const{
|
||||||
auto &sdp = getSdp(SdpType::answer);
|
if (!_push_src) {
|
||||||
return _push_src && (sdp.media[0].direction == RtpDirection::sendrecv || sdp.media[0].direction == RtpDirection::recvonly);
|
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() {
|
void WebRtcTransportImp::onStartWebRTC() {
|
||||||
|
Loading…
Reference in New Issue
Block a user