diff --git a/inc/PeerConnectionManager.h b/inc/PeerConnectionManager.h index bb32bf3c..3e662c4f 100755 --- a/inc/PeerConnectionManager.h +++ b/inc/PeerConnectionManager.h @@ -158,8 +158,8 @@ class PeerConnectionManager { virtual void OnStatsDelivered(const rtc::scoped_refptr& report) { for (const webrtc::RTCStats& stats : *report) { Json::Value statsMembers; - for (const webrtc::RTCStatsMemberInterface* member : stats.Members()) { - statsMembers[member->name()] = member->ValueToString(); + for (auto & attribute : stats.Attributes()) { + statsMembers[attribute.name()] = attribute.ValueToString(); } m_report[stats.id()] = statsMembers; } diff --git a/inc/VideoDecoder.h b/inc/VideoDecoder.h index 9268dbfb..16abcae5 100644 --- a/inc/VideoDecoder.h +++ b/inc/VideoDecoder.h @@ -165,7 +165,7 @@ class VideoDecoder : public rtc::VideoSourceInterface, publi std::this_thread::sleep_for(std::chrono::milliseconds(delayms)); } } else { - std::this_thread::sleep_for(std::chrono::milliseconds(5)); + std::this_thread::sleep_for(std::chrono::milliseconds(1)); } m_scaler.OnFrame(decodedImage); diff --git a/src/main.cpp b/src/main.cpp index 5b118a33..fa382b0d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -45,6 +45,17 @@ class TurnAuth : public cricket::TurnAuthInterface { } }; +class TurnRedirector : public cricket::TurnRedirectInterface +{ +public: + explicit TurnRedirector() {} + + virtual bool ShouldRedirect(const rtc::SocketAddress &, rtc::SocketAddress *out) + { + return true; + } +}; + /* --------------------------------------------------------------------------- ** main ** -------------------------------------------------------------------------*/ @@ -74,6 +85,7 @@ int main(int argc, char* argv[]) webrtc::PeerConnectionInterface::IceTransportsType transportType = webrtc::PeerConnectionInterface::IceTransportsType::kAll; std::string webrtcTrialsFields = "WebRTC-FrameDropper/Disabled/"; TurnAuth turnAuth; + TurnRedirector turnRedirector; std::string httpAddress("0.0.0.0:"); std::string httpPort = "8000"; @@ -284,6 +296,7 @@ int main(int argc, char* argv[]) server_addr.FromString(addr); turnserver.reset(new cricket::TurnServer(rtc::Thread::Current())); turnserver->set_auth_hook(&turnAuth); + turnserver->set_redirect_hook(&turnRedirector); rtc::Socket* tcp_server_socket = thread->socketserver()->CreateSocket(AF_INET, SOCK_STREAM); if (tcp_server_socket) {