Skip to content

Commit

Permalink
fix build with latest webrtc
Browse files Browse the repository at this point in the history
  • Loading branch information
mpromonet committed Jan 20, 2024
1 parent c26aaa2 commit b409bb5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
4 changes: 2 additions & 2 deletions inc/PeerConnectionManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ class PeerConnectionManager {
virtual void OnStatsDelivered(const rtc::scoped_refptr<const webrtc::RTCStatsReport>& 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;
}
Expand Down
2 changes: 1 addition & 1 deletion inc/VideoDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class VideoDecoder : public rtc::VideoSourceInterface<webrtc::VideoFrame>, 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);
Expand Down
13 changes: 13 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
** -------------------------------------------------------------------------*/
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit b409bb5

Please sign in to comment.