diff --git a/src/sora_signaling.cpp b/src/sora_signaling.cpp index 9a78fb7d..7fd77953 100644 --- a/src/sora_signaling.cpp +++ b/src/sora_signaling.cpp @@ -1647,17 +1647,20 @@ void SoraSignaling::OnMessage( } if (label == "stats") { - pc_->GetStats( - RTCStatsCallback::Create( - [self = shared_from_this()]( - const rtc::scoped_refptr& - report) { - if (self->state_ != State::Connected) { - return; - } - self->DoSendPong(report); - }) - .get()); + const std::string type = json.at("type").as_string().c_str(); + if (type == "req-stats") { + pc_->GetStats( + RTCStatsCallback::Create( + [self = shared_from_this()]( + const rtc::scoped_refptr& + report) { + if (self->state_ != State::Connected) { + return; + } + self->DoSendPong(report); + }) + .get()); + } return; } diff --git a/test/hello.cpp b/test/hello.cpp index fc4f9b3a..e00f93c2 100644 --- a/test/hello.cpp +++ b/test/hello.cpp @@ -44,18 +44,18 @@ void HelloSora::Run() { audio_track_id, pc_factory()->CreateAudioSource(cricket::AudioOptions()).get()); - if (config_.mode == HelloSoraConfig::Mode::Hello) { - sora::CameraDeviceCapturerConfig cam_config; - cam_config.width = 1024; - cam_config.height = 768; - cam_config.fps = 30; - cam_config.jni_env = env; - cam_config.application_context = GetAndroidApplicationContext(env); - video_source_ = sora::CreateCameraDeviceCapturer(cam_config); - std::string video_track_id = rtc::CreateRandomString(16); - video_track_ = - pc_factory()->CreateVideoTrack(video_track_id, video_source_.get()); - } + //if (config_.mode == HelloSoraConfig::Mode::Hello) { + // sora::CameraDeviceCapturerConfig cam_config; + // cam_config.width = 1024; + // cam_config.height = 768; + // cam_config.fps = 30; + // cam_config.jni_env = env; + // cam_config.application_context = GetAndroidApplicationContext(env); + // video_source_ = sora::CreateCameraDeviceCapturer(cam_config); + // std::string video_track_id = rtc::CreateRandomString(16); + // video_track_ = + // pc_factory()->CreateVideoTrack(video_track_id, video_source_.get()); + //} ioc_.reset(new boost::asio::io_context(1));