Skip to content

No public description #111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cpp/internal/conference_data_channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ConferenceDataChannel : public ConferenceDataChannelInterface,
public:
ConferenceDataChannel(
std::unique_ptr<ResourceHandlerInterface> resource_handler,
rtc::scoped_refptr<webrtc::DataChannelInterface> data_channel)
webrtc::scoped_refptr<webrtc::DataChannelInterface> data_channel)
: resource_handler_(std::move(resource_handler)),
data_channel_(std::move(data_channel)) {
data_channel_->RegisterObserver(this);
Expand Down Expand Up @@ -88,7 +88,7 @@ class ConferenceDataChannel : public ConferenceDataChannelInterface,

ResourceUpdateCallback callback_;
std::unique_ptr<ResourceHandlerInterface> resource_handler_;
rtc::scoped_refptr<webrtc::DataChannelInterface> data_channel_;
webrtc::scoped_refptr<webrtc::DataChannelInterface> data_channel_;
};

} // namespace meet
Expand Down
6 changes: 3 additions & 3 deletions cpp/internal/conference_media_tracks.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ConferenceAudioTrack : public webrtc::AudioTrackSinkInterface {

ConferenceAudioTrack(
std::string mid,
rtc::scoped_refptr<webrtc::RtpReceiverInterface> receiver,
webrtc::scoped_refptr<webrtc::RtpReceiverInterface> receiver,
AudioFrameCallback callback)
: mid_(std::move(mid)),
receiver_(std::move(receiver)),
Expand All @@ -58,14 +58,14 @@ class ConferenceAudioTrack : public webrtc::AudioTrackSinkInterface {
private:
// Media line from the SDP offer/answer that identifies this track.
std::string mid_;
rtc::scoped_refptr<webrtc::RtpReceiverInterface> receiver_;
webrtc::scoped_refptr<webrtc::RtpReceiverInterface> receiver_;
AudioFrameCallback callback_;
};

// Adapter class for rtc::VideoSinkInterface that converts
// webrtc::VideoFrames to meet::VideoFrames and calls the callback.
class ConferenceVideoTrack
: public rtc::VideoSinkInterface<webrtc::VideoFrame> {
: public webrtc::VideoSinkInterface<webrtc::VideoFrame> {
public:
using VideoFrameCallback = absl::AnyInvocable<void(VideoFrame frame)>;

Expand Down
12 changes: 6 additions & 6 deletions cpp/internal/conference_media_tracks_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ using ::testing::SizeIs;
using ::testing::UnorderedElementsAre;

TEST(ConferenceAudioTrackTest, CallsObserverWithAudioFrameFromLoudestSpeaker) {
rtc::scoped_refptr<webrtc::MockRtpReceiver> mock_receiver(
webrtc::scoped_refptr<webrtc::MockRtpReceiver> mock_receiver(
new webrtc::MockRtpReceiver());
webrtc::RtpSource csrc_rtp_source(
webrtc::Timestamp::Micros(1234567890),
Expand Down Expand Up @@ -103,7 +103,7 @@ TEST(ConferenceAudioTrackTest, CallsObserverWithAudioFrameFromLoudestSpeaker) {

TEST(ConferenceAudioTrackTest,
CallsObserverWithAudioFrameFromNonLoudestSpeaker) {
rtc::scoped_refptr<webrtc::MockRtpReceiver> mock_receiver(
webrtc::scoped_refptr<webrtc::MockRtpReceiver> mock_receiver(
new webrtc::MockRtpReceiver());
webrtc::RtpSource csrc_rtp_source(
webrtc::Timestamp::Micros(1234567890),
Expand Down Expand Up @@ -168,7 +168,7 @@ TEST(ConferenceAudioTrackTest, LogsErrorWithUnsupportedBitsPerSample) {
}

TEST(ConferenceAudioTrackTest, LogsErrorWithMissingCsrc) {
rtc::scoped_refptr<webrtc::MockRtpReceiver> mock_receiver(
webrtc::scoped_refptr<webrtc::MockRtpReceiver> mock_receiver(
new webrtc::MockRtpReceiver());
webrtc::RtpSource ssrc_rtp_source(
webrtc::Timestamp::Micros(1234567890),
Expand Down Expand Up @@ -201,7 +201,7 @@ TEST(ConferenceAudioTrackTest, LogsErrorWithMissingCsrc) {
}

TEST(ConferenceAudioTrackTest, LogsErrorWithMissingSsrc) {
rtc::scoped_refptr<webrtc::MockRtpReceiver> mock_receiver(
webrtc::scoped_refptr<webrtc::MockRtpReceiver> mock_receiver(
new webrtc::MockRtpReceiver());
webrtc::RtpSource csrc_rtp_source(
webrtc::Timestamp::Micros(1234567890),
Expand Down Expand Up @@ -233,7 +233,7 @@ TEST(ConferenceAudioTrackTest, LogsErrorWithMissingSsrc) {
EXPECT_EQ(message, "AudioFrame is missing SSRC for mid: mid");
}
TEST(ConferenceAudioTrackTest, LogsErrorWithMissingCsrcAndSsrc) {
rtc::scoped_refptr<webrtc::MockRtpReceiver> mock_receiver(
webrtc::scoped_refptr<webrtc::MockRtpReceiver> mock_receiver(
new webrtc::MockRtpReceiver());
EXPECT_CALL(*mock_receiver, GetSources)
.WillOnce(Return(std::vector<webrtc::RtpSource>()));
Expand Down Expand Up @@ -264,7 +264,7 @@ TEST(ConferenceAudioTrackTest, LogsErrorWithMissingCsrcAndSsrc) {
}

TEST(ConferenceAudioTrackTest, LogsErrorWithOnlyLoudestSpeakerCsrc) {
rtc::scoped_refptr<webrtc::MockRtpReceiver> mock_receiver(
webrtc::scoped_refptr<webrtc::MockRtpReceiver> mock_receiver(
new webrtc::MockRtpReceiver());
webrtc::RtpSource csrc_rtp_source(
webrtc::Timestamp::Micros(1234567890),
Expand Down
2 changes: 1 addition & 1 deletion cpp/internal/conference_peer_connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ void ConferencePeerConnection::OnConnectionChange(
}

void ConferencePeerConnection::OnTrack(
rtc::scoped_refptr<webrtc::RtpTransceiverInterface> transceiver) {
webrtc::scoped_refptr<webrtc::RtpTransceiverInterface> transceiver) {
if (track_signaled_callback_ == nullptr) {
LOG(WARNING)
<< "ConferencePeerConnection::OnTrack called without callback.";
Expand Down
32 changes: 17 additions & 15 deletions cpp/internal/conference_peer_connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class ConferencePeerConnection : public ConferencePeerConnectionInterface,
public webrtc::PeerConnectionObserver {
public:
ConferencePeerConnection(
std::unique_ptr<rtc::Thread> signaling_thread,
std::unique_ptr<webrtc::Thread> signaling_thread,
std::unique_ptr<HttpConnectorInterface> http_connector)
: signaling_thread_(std::move(signaling_thread)),
http_connector_(std::move(http_connector)) {};
Expand All @@ -67,17 +67,19 @@ class ConferencePeerConnection : public ConferencePeerConnectionInterface,
};

void OnAddStream(
rtc::scoped_refptr<webrtc::MediaStreamInterface> /* stream */) override {
webrtc::scoped_refptr<webrtc::MediaStreamInterface> /* stream */)
override {
VLOG(1) << "OnAddStream called.";
}

void OnRemoveStream(
rtc::scoped_refptr<webrtc::MediaStreamInterface> /* stream */) override {
webrtc::scoped_refptr<webrtc::MediaStreamInterface> /* stream */)
override {
VLOG(1) << "OnRemoveStream called.";
}

void OnDataChannel(
rtc::scoped_refptr<webrtc::DataChannelInterface> data_channel) override {
void OnDataChannel(webrtc::scoped_refptr<webrtc::DataChannelInterface>
data_channel) override {
LOG(ERROR) << "OnDataChannel opened from server: " << data_channel->label();
// The Meet servers should never open a data channel; all data channels are
// opened by the client.
Expand Down Expand Up @@ -120,7 +122,7 @@ class ConferencePeerConnection : public ConferencePeerConnectionInterface,
}

void OnIceCandidatesRemoved(
const std::vector<cricket::Candidate>& candidates) override {
const std::vector<webrtc::Candidate>& candidates) override {
VLOG(1) << "OnIceCandidatesRemoved: " << candidates.size();
}

Expand All @@ -129,20 +131,20 @@ class ConferencePeerConnection : public ConferencePeerConnectionInterface,
}

void OnIceSelectedCandidatePairChanged(
const cricket::CandidatePairChangeEvent& /* event */) override {
const webrtc::CandidatePairChangeEvent& /* event */) override {
VLOG(1) << "OnIceSelectedCandidatePairChanged called.";
}

void OnAddTrack(
rtc::scoped_refptr<webrtc::RtpReceiverInterface> /* receiver */,
webrtc::scoped_refptr<webrtc::RtpReceiverInterface> /* receiver */,
const std::vector<
rtc::scoped_refptr<webrtc::MediaStreamInterface>>& /* streams */)
webrtc::scoped_refptr<webrtc::MediaStreamInterface>>& /* streams */)
override {
VLOG(1) << "OnAddTrack called.";
}

void OnRemoveTrack(
rtc::scoped_refptr<webrtc::RtpReceiverInterface> receiver) override {
webrtc::scoped_refptr<webrtc::RtpReceiverInterface> receiver) override {
VLOG(1) << "OnRemoveTrack called.";
};

Expand All @@ -153,8 +155,8 @@ class ConferencePeerConnection : public ConferencePeerConnectionInterface,
void OnConnectionChange(
webrtc::PeerConnectionInterface::PeerConnectionState new_state) override;

void OnTrack(
rtc::scoped_refptr<webrtc::RtpTransceiverInterface> transceiver) override;
void OnTrack(webrtc::scoped_refptr<webrtc::RtpTransceiverInterface>
transceiver) override;

// Sets the disconnect callback for the conference peer connection. Conference
// peer connections can only have one disconnect callback at a time, and the
Expand Down Expand Up @@ -218,7 +220,7 @@ class ConferencePeerConnection : public ConferencePeerConnectionInterface,
// Calling this is not thread-safe, so it should only be called before the
// conference peer connection is used.
void SetPeerConnection(
rtc::scoped_refptr<webrtc::PeerConnectionInterface> peer_connection) {
webrtc::scoped_refptr<webrtc::PeerConnectionInterface> peer_connection) {
peer_connection_ = std::move(peer_connection);
}

Expand All @@ -229,9 +231,9 @@ class ConferencePeerConnection : public ConferencePeerConnectionInterface,

DisconnectCallback disconnect_callback_;
TrackSignaledCallback track_signaled_callback_;
std::unique_ptr<rtc::Thread> signaling_thread_;
std::unique_ptr<webrtc::Thread> signaling_thread_;
std::unique_ptr<HttpConnectorInterface> http_connector_;
rtc::scoped_refptr<webrtc::PeerConnectionInterface> peer_connection_;
webrtc::scoped_refptr<webrtc::PeerConnectionInterface> peer_connection_;
};

} // namespace meet
Expand Down
2 changes: 1 addition & 1 deletion cpp/internal/conference_peer_connection_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ConferencePeerConnectionInterface {
public:
using DisconnectCallback = absl::AnyInvocable<void(absl::Status)>;
using TrackSignaledCallback = absl::AnyInvocable<void(
rtc::scoped_refptr<webrtc::RtpTransceiverInterface>)>;
webrtc::scoped_refptr<webrtc::RtpTransceiverInterface>)>;

virtual ~ConferencePeerConnectionInterface() = default;

Expand Down
65 changes: 34 additions & 31 deletions cpp/internal/conference_peer_connection_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ class MockPeerConnection : public webrtc::MockPeerConnectionInterface {
using webrtc::MockPeerConnectionInterface::SetLocalDescription;
MOCK_METHOD(
void, SetLocalDescription,
(rtc::scoped_refptr<webrtc::SetLocalDescriptionObserverInterface>),
(webrtc::scoped_refptr<webrtc::SetLocalDescriptionObserverInterface>),
(override));

MOCK_METHOD(
void, SetRemoteDescription,
(std::unique_ptr<webrtc::SessionDescriptionInterface>,
rtc::scoped_refptr<webrtc::SetRemoteDescriptionObserverInterface>),
webrtc::scoped_refptr<webrtc::SetRemoteDescriptionObserverInterface>),
(override));
};

Expand All @@ -84,21 +84,21 @@ class MockHttpConnector : public HttpConnectorInterface {
(override));
};

std::unique_ptr<rtc::Thread> CreateSignalingThread() {
std::unique_ptr<rtc::Thread> thread = rtc::Thread::Create();
std::unique_ptr<webrtc::Thread> CreateSignalingThread() {
std::unique_ptr<webrtc::Thread> thread = webrtc::Thread::Create();
thread->SetName("signaling_thread", nullptr);
EXPECT_TRUE(thread->Start());
return thread;
}

TEST(ConferencePeerConnectionTest, ConnectSucceeds) {
auto peer_connection = rtc::make_ref_counted<MockPeerConnection>();
auto peer_connection = webrtc::make_ref_counted<MockPeerConnection>();
EXPECT_CALL(*peer_connection, SetLocalDescription(_))
.WillOnce(
[&](rtc::scoped_refptr<webrtc::SetLocalDescriptionObserverInterface>
observer) {
observer->OnSetLocalDescriptionComplete(webrtc::RTCError::OK());
});
.WillOnce([&](webrtc::scoped_refptr<
webrtc::SetLocalDescriptionObserverInterface>
observer) {
observer->OnSetLocalDescriptionComplete(webrtc::RTCError::OK());
});
auto answer_description =
std::make_unique<webrtc::MockSessionDescriptionInterface>();
EXPECT_CALL(*answer_description, ToString(_)).WillOnce([](std::string* str) {
Expand All @@ -115,7 +115,8 @@ TEST(ConferencePeerConnectionTest, ConnectSucceeds) {
EXPECT_CALL(*peer_connection, SetRemoteDescription(_, _))
.WillOnce(
[&](std::unique_ptr<webrtc::SessionDescriptionInterface> description,
rtc::scoped_refptr<webrtc::SetRemoteDescriptionObserverInterface>
webrtc::scoped_refptr<
webrtc::SetRemoteDescriptionObserverInterface>
observer) {
std::string remote_description;
description->ToString(&remote_description);
Expand Down Expand Up @@ -146,10 +147,11 @@ TEST(ConferencePeerConnectionTest, ConnectFailsWithNullPeerConnection) {

TEST(ConferencePeerConnectionTest,
ConnectFailsWhenSettingLocalDescriptionFails) {
auto peer_connection = rtc::make_ref_counted<MockPeerConnection>();
auto peer_connection = webrtc::make_ref_counted<MockPeerConnection>();
EXPECT_CALL(*peer_connection, SetLocalDescription(_))
.WillOnce(
[&](rtc::scoped_refptr<webrtc::SetLocalDescriptionObserverInterface>
[&](webrtc::scoped_refptr<
webrtc::SetLocalDescriptionObserverInterface>
observer) {
observer->OnSetLocalDescriptionComplete(
webrtc::RTCError(webrtc::RTCErrorType::INTERNAL_ERROR,
Expand All @@ -167,13 +169,13 @@ TEST(ConferencePeerConnectionTest,
}

TEST(ConferencePeerConnectionTest, ConnectFailsWhenHttpConnectorFails) {
auto peer_connection = rtc::make_ref_counted<MockPeerConnection>();
auto peer_connection = webrtc::make_ref_counted<MockPeerConnection>();
EXPECT_CALL(*peer_connection, SetLocalDescription(_))
.WillOnce(
[&](rtc::scoped_refptr<webrtc::SetLocalDescriptionObserverInterface>
observer) {
observer->OnSetLocalDescriptionComplete(webrtc::RTCError::OK());
});
.WillOnce([&](webrtc::scoped_refptr<
webrtc::SetLocalDescriptionObserverInterface>
observer) {
observer->OnSetLocalDescriptionComplete(webrtc::RTCError::OK());
});
auto answer_description =
std::make_unique<webrtc::MockSessionDescriptionInterface>();
EXPECT_CALL(*answer_description, ToString(_)).WillOnce([](std::string* str) {
Expand All @@ -198,13 +200,13 @@ TEST(ConferencePeerConnectionTest, ConnectFailsWhenHttpConnectorFails) {

TEST(ConferencePeerConnectionTest,
ConnectFailsWhenSettingRemoteDescriptionFails) {
auto peer_connection = rtc::make_ref_counted<MockPeerConnection>();
auto peer_connection = webrtc::make_ref_counted<MockPeerConnection>();
EXPECT_CALL(*peer_connection, SetLocalDescription(_))
.WillOnce(
[&](rtc::scoped_refptr<webrtc::SetLocalDescriptionObserverInterface>
observer) {
observer->OnSetLocalDescriptionComplete(webrtc::RTCError::OK());
});
.WillOnce([&](webrtc::scoped_refptr<
webrtc::SetLocalDescriptionObserverInterface>
observer) {
observer->OnSetLocalDescriptionComplete(webrtc::RTCError::OK());
});
auto answer_description =
std::make_unique<webrtc::MockSessionDescriptionInterface>();
EXPECT_CALL(*answer_description, ToString(_)).WillOnce([](std::string* str) {
Expand All @@ -219,7 +221,8 @@ TEST(ConferencePeerConnectionTest,
EXPECT_CALL(*peer_connection, SetRemoteDescription(_, _))
.WillOnce(
[&](std::unique_ptr<webrtc::SessionDescriptionInterface> description,
rtc::scoped_refptr<webrtc::SetRemoteDescriptionObserverInterface>
webrtc::scoped_refptr<
webrtc::SetRemoteDescriptionObserverInterface>
observer) {
observer->OnSetRemoteDescriptionComplete(
webrtc::RTCError(webrtc::RTCErrorType::INTERNAL_ERROR,
Expand All @@ -240,7 +243,7 @@ TEST(ConferencePeerConnectionTest,
ClosesPeerConnectionWhenConferencePeerConnectionIsClosed) {
ConferencePeerConnection conference_peer_connection(
CreateSignalingThread(), std::make_unique<MockHttpConnector>());
auto peer_connection = rtc::make_ref_counted<MockPeerConnection>();
auto peer_connection = webrtc::make_ref_counted<MockPeerConnection>();
absl::Notification notification;
EXPECT_CALL(*peer_connection, Close())
.Times(2)
Expand All @@ -265,7 +268,7 @@ TEST(ConferencePeerConnectionTest,
// Use a unique pointer to explicitly invoke the destructor.
auto conference_peer_connection = std::make_unique<ConferencePeerConnection>(
CreateSignalingThread(), std::make_unique<MockHttpConnector>());
auto peer_connection = rtc::make_ref_counted<MockPeerConnection>();
auto peer_connection = webrtc::make_ref_counted<MockPeerConnection>();
EXPECT_CALL(*peer_connection, Close()).WillOnce([&notification]() {
notification.Notify();
});
Expand Down Expand Up @@ -351,7 +354,7 @@ TEST(ConferencePeerConnectionTest,

TEST(ConferencePeerConnectionTest,
CallsTrackSignaledCallbackWhenTrackIsSignaled) {
MockFunction<void(rtc::scoped_refptr<webrtc::RtpTransceiverInterface>)>
MockFunction<void(webrtc::scoped_refptr<webrtc::RtpTransceiverInterface>)>
mock_function;
absl::Notification notification;
EXPECT_CALL(mock_function, Call(_)).WillOnce([&notification](auto) {
Expand All @@ -363,7 +366,7 @@ TEST(ConferencePeerConnectionTest,
mock_function.AsStdFunction());

conference_peer_connection.OnTrack(
rtc::make_ref_counted<webrtc::MockRtpTransceiver>());
webrtc::make_ref_counted<webrtc::MockRtpTransceiver>());

EXPECT_TRUE(notification.HasBeenNotified());
}
Expand All @@ -381,7 +384,7 @@ TEST(ConferencePeerConnectionTest,
log.StartCapturingLogs();

conference_peer_connection.OnTrack(
rtc::make_ref_counted<webrtc::MockRtpTransceiver>());
webrtc::make_ref_counted<webrtc::MockRtpTransceiver>());

EXPECT_EQ(message,
"ConferencePeerConnection::OnTrack called without callback.");
Expand Down
4 changes: 2 additions & 2 deletions cpp/internal/media_api_audio_device_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void MediaApiAudioDeviceModule::ProcessPlayData() {
return;
}

int64_t process_start_time = rtc::TimeMillis();
int64_t process_start_time = webrtc::TimeMillis();
const size_t number_of_samples = kAudioSampleRatePerMillisecond *
sampling_interval_.ms() *
kNumberOfAudioChannels;
Expand All @@ -88,7 +88,7 @@ void MediaApiAudioDeviceModule::ProcessPlayData() {
kAudioSampleRatePerMillisecond * 1000, sample_buffer.data(),
samples_out, &elapsed_time_ms, &ntp_time_ms);
}
int64_t process_end_time = rtc::TimeMillis();
int64_t process_end_time = webrtc::TimeMillis();

// Delay the next sampling for either:
// 1. (sampling interval) - (time to process current sample)
Expand Down
Loading
Loading