Skip to content

No public description #112

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
2 changes: 1 addition & 1 deletion cpp/api/media_api_client_factory_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class MediaApiClientFactoryInterface {
/// Creates a `MediaApiClientInterface` instance.
virtual absl::StatusOr<std::unique_ptr<MediaApiClientInterface>>
CreateMediaApiClient(const MediaApiClientConfiguration& api_config,
rtc::scoped_refptr<MediaApiClientObserverInterface>
webrtc::scoped_refptr<MediaApiClientObserverInterface>
api_session_observer) = 0;
};

Expand Down
3 changes: 2 additions & 1 deletion cpp/api/media_api_client_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,8 @@ class MediaApiClientInterface {
/// until the client is destroyed.
static absl::StatusOr<std::unique_ptr<MediaApiClientInterface>> Create(
const MediaApiClientConfiguration& api_config,
rtc::scoped_refptr<MediaApiClientObserverInterface> api_session_observer);
webrtc::scoped_refptr<MediaApiClientObserverInterface>
api_session_observer);
};

} // namespace meet
Expand Down
4 changes: 2 additions & 2 deletions cpp/samples/multi_user_media_collector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void MultiUserMediaCollector::OnAudioFrame(meet::AudioFrame frame) {

void MultiUserMediaCollector::OnVideoFrame(meet::VideoFrame frame) {
absl::Time received_time = absl::Now();
rtc::scoped_refptr<webrtc::I420BufferInterface> buffer =
webrtc::scoped_refptr<webrtc::I420BufferInterface> buffer =
frame.frame.video_frame_buffer()->ToI420();

collector_thread_->PostTask([this, buffer = std::move(buffer),
Expand Down Expand Up @@ -128,7 +128,7 @@ void MultiUserMediaCollector::HandleAudioData(std::vector<int16_t> samples,
}

void MultiUserMediaCollector::HandleVideoData(
rtc::scoped_refptr<webrtc::I420BufferInterface> buffer,
webrtc::scoped_refptr<webrtc::I420BufferInterface> buffer,
uint32_t contributing_source, absl::Time received_time) {
DCHECK(collector_thread_->IsCurrent());

Expand Down
12 changes: 6 additions & 6 deletions cpp/samples/multi_user_media_collector.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class MultiUserMediaCollector : public meet::MediaApiClientObserverInterface {
// participant manager.
MultiUserMediaCollector(absl::string_view output_file_prefix,
absl::Duration segment_gap_threshold,
std::unique_ptr<rtc::Thread> collector_thread)
std::unique_ptr<webrtc::Thread> collector_thread)
: output_file_prefix_(output_file_prefix),
segment_gap_threshold_(segment_gap_threshold),
collector_thread_(std::move(collector_thread)) {
Expand Down Expand Up @@ -129,7 +129,7 @@ class MultiUserMediaCollector : public meet::MediaApiClientObserverInterface {
OutputWriterProvider output_writer_provider,
SegmentRenamer segment_renamer, absl::Duration segment_gap_threshold,
std::unique_ptr<ResourceManagerInterface> resource_manager,
std::unique_ptr<rtc::Thread> collector_thread)
std::unique_ptr<webrtc::Thread> collector_thread)
: output_file_prefix_(output_file_prefix),
output_writer_provider_(std::move(output_writer_provider)),
segment_renamer_(std::move(segment_renamer)),
Expand Down Expand Up @@ -209,9 +209,9 @@ class MultiUserMediaCollector : public meet::MediaApiClientObserverInterface {
void HandleAudioData(std::vector<int16_t> samples,
ContributingSource contributing_source,
absl::Time received_time);
void HandleVideoData(rtc::scoped_refptr<webrtc::I420BufferInterface> buffer,
ContributingSource contributing_source,
absl::Time received_time);
void HandleVideoData(
webrtc::scoped_refptr<webrtc::I420BufferInterface> buffer,
ContributingSource contributing_source, absl::Time received_time);

// Closes the audio or video segment. This will rename the file to include
// the start and end times of the segment.
Expand Down Expand Up @@ -243,7 +243,7 @@ class MultiUserMediaCollector : public meet::MediaApiClientObserverInterface {

// The media collector's internal thread. Used for moving work off of the
// MediaApiClient's threads and synchronizing access to member variables.
std::unique_ptr<rtc::Thread> collector_thread_;
std::unique_ptr<webrtc::Thread> collector_thread_;
};

} // namespace media_api_samples
Expand Down
38 changes: 19 additions & 19 deletions cpp/samples/multi_user_media_collector_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,31 +55,31 @@ using ::testing::ScopedMockLog;

TEST(MultiUserMediaCollectorTest, WaitForJoinedTimesOutBeforeJoining) {
auto collector = webrtc::make_ref_counted<MultiUserMediaCollector>(
"test_", absl::Seconds(1), rtc::Thread::Create());
"test_", absl::Seconds(1), webrtc::Thread::Create());

EXPECT_EQ(collector->WaitForJoined(absl::Seconds(1)).code(),
absl::StatusCode::kDeadlineExceeded);
}

TEST(MultiUserMediaCollectorTest, WaitForJoinedSucceedsAfterJoining) {
auto collector = webrtc::make_ref_counted<MultiUserMediaCollector>(
"test_", absl::Seconds(1), rtc::Thread::Create());
"test_", absl::Seconds(1), webrtc::Thread::Create());
collector->OnJoined();
EXPECT_EQ(collector->WaitForJoined(absl::Seconds(1)), absl::OkStatus());
}

TEST(MultiUserMediaCollectorTest,
WaitForDisconnectedTimesOutBeforeDisconnecting) {
auto collector = webrtc::make_ref_counted<MultiUserMediaCollector>(
"test_", absl::Seconds(1), rtc::Thread::Create());
"test_", absl::Seconds(1), webrtc::Thread::Create());

EXPECT_EQ(collector->WaitForDisconnected(absl::Seconds(1)).code(),
absl::StatusCode::kDeadlineExceeded);
}

TEST(MultiUserMediaCollectorTest,
WaitForDisconnectedSucceedsAfterDisconnecting) {
auto thread = rtc::Thread::Create();
auto thread = webrtc::Thread::Create();
thread->Start();
auto collector = webrtc::make_ref_counted<MultiUserMediaCollector>(
"test_", absl::Seconds(1), std::move(thread));
Expand Down Expand Up @@ -116,7 +116,7 @@ TEST(MultiUserMediaCollectorTest, ClosesAudioAndVideoSegmentsOnDisconnect) {
EXPECT_CALL(*mock_resource_manager, GetOutputFileIdentifier(2))
.WillOnce(Return("identifier_2"));
auto renamer = MockFunction<void(absl::string_view, absl::string_view)>();
auto thread = rtc::Thread::Create();
auto thread = webrtc::Thread::Create();
thread->Start();
auto collector = webrtc::make_ref_counted<MultiUserMediaCollector>(
"test_", std::move(mock_output_file_provider).AsStdFunction(),
Expand Down Expand Up @@ -167,7 +167,7 @@ TEST(MultiUserMediaCollectorTest, ClosingSegmentsRenamesFiles) {
EXPECT_CALL(mock_renamer,
Call("test_video_identifier_2_tmp_10x5.yuv",
MatchesRegex("test_video_identifier_2_.*_.*_10x5\\.yuv")));
auto thread = rtc::Thread::Create();
auto thread = webrtc::Thread::Create();
thread->Start();
auto collector = webrtc::make_ref_counted<MultiUserMediaCollector>(
"test_", std::move(mock_output_file_provider).AsStdFunction(),
Expand Down Expand Up @@ -204,7 +204,7 @@ TEST(MultiUserMediaCollectorTest, ReceivesAudioFrameAndWritesToFile) {
EXPECT_CALL(*mock_resource_manager, GetOutputFileIdentifier(1))
.WillOnce(Return("identifier_1"));
auto renamer = MockFunction<void(absl::string_view, absl::string_view)>();
auto thread = rtc::Thread::Create();
auto thread = webrtc::Thread::Create();
thread->Start();
auto collector = webrtc::make_ref_counted<MultiUserMediaCollector>(
"test_", std::move(mock_output_file_provider).AsStdFunction(),
Expand Down Expand Up @@ -246,7 +246,7 @@ TEST(MultiUserMediaCollectorTest,
EXPECT_CALL(*mock_resource_manager, GetOutputFileIdentifier(1))
.WillOnce(Return("identifier_1"));
auto renamer = MockFunction<void(absl::string_view, absl::string_view)>();
auto thread = rtc::Thread::Create();
auto thread = webrtc::Thread::Create();
thread->Start();
auto collector = webrtc::make_ref_counted<MultiUserMediaCollector>(
"test_", std::move(mock_output_file_provider).AsStdFunction(),
Expand Down Expand Up @@ -306,7 +306,7 @@ TEST(MultiUserMediaCollectorTest,
EXPECT_CALL(*mock_resource_manager, GetOutputFileIdentifier(2))
.WillOnce(Return("identifier_2"));
auto renamer = MockFunction<void(absl::string_view, absl::string_view)>();
auto thread = rtc::Thread::Create();
auto thread = webrtc::Thread::Create();
thread->Start();
auto collector = webrtc::make_ref_counted<MultiUserMediaCollector>(
"test_", std::move(mock_output_file_provider).AsStdFunction(),
Expand Down Expand Up @@ -376,7 +376,7 @@ TEST(MultiUserMediaCollectorTest,
EXPECT_CALL(*mock_resource_manager, GetOutputFileIdentifier(1))
.WillRepeatedly(Return("identifier_1"));
auto renamer = MockFunction<void(absl::string_view, absl::string_view)>();
auto thread = rtc::Thread::Create();
auto thread = webrtc::Thread::Create();
thread->Start();
auto collector = webrtc::make_ref_counted<MultiUserMediaCollector>(
"test_", std::move(mock_output_file_provider).AsStdFunction(),
Expand Down Expand Up @@ -430,7 +430,7 @@ TEST(MultiUserMediaCollectorTest, StartingNewAudioSegmentReleasesOldSegment) {
EXPECT_CALL(*mock_resource_manager, GetOutputFileIdentifier(1))
.WillRepeatedly(Return("identifier_1"));
auto renamer = MockFunction<void(absl::string_view, absl::string_view)>();
auto thread = rtc::Thread::Create();
auto thread = webrtc::Thread::Create();
thread->Start();
auto collector = webrtc::make_ref_counted<MultiUserMediaCollector>(
"test_", std::move(mock_output_file_provider).AsStdFunction(),
Expand Down Expand Up @@ -458,7 +458,7 @@ TEST(MultiUserMediaCollectorTest,
EXPECT_CALL(*mock_resource_manager, GetOutputFileIdentifier(1))
.WillOnce(Return(absl::InternalError("test error")));
auto renamer = MockFunction<void(absl::string_view, absl::string_view)>();
auto thread = rtc::Thread::Create();
auto thread = webrtc::Thread::Create();
thread->Start();
auto collector = webrtc::make_ref_counted<MultiUserMediaCollector>(
"test_",
Expand Down Expand Up @@ -509,7 +509,7 @@ TEST(MultiUserMediaCollectorTest, ReceivesVideoFrameAndWritesToFile) {
EXPECT_CALL(*mock_resource_manager, GetOutputFileIdentifier(1))
.WillOnce(Return("identifier_1"));
auto renamer = MockFunction<void(absl::string_view, absl::string_view)>();
auto thread = rtc::Thread::Create();
auto thread = webrtc::Thread::Create();
thread->Start();
auto collector = webrtc::make_ref_counted<MultiUserMediaCollector>(
"test_", std::move(mock_output_file_provider).AsStdFunction(),
Expand Down Expand Up @@ -550,7 +550,7 @@ TEST(MultiUserMediaCollectorTest,
EXPECT_CALL(*mock_resource_manager, GetOutputFileIdentifier(1))
.WillOnce(Return("identifier_1"));
auto renamer = MockFunction<void(absl::string_view, absl::string_view)>();
auto thread = rtc::Thread::Create();
auto thread = webrtc::Thread::Create();
thread->Start();
auto collector = webrtc::make_ref_counted<MultiUserMediaCollector>(
"test_", std::move(mock_output_file_provider).AsStdFunction(),
Expand Down Expand Up @@ -608,7 +608,7 @@ TEST(MultiUserMediaCollectorTest,
EXPECT_CALL(*mock_resource_manager, GetOutputFileIdentifier(2))
.WillOnce(Return("identifier_2"));
auto renamer = MockFunction<void(absl::string_view, absl::string_view)>();
auto thread = rtc::Thread::Create();
auto thread = webrtc::Thread::Create();
thread->Start();
auto collector = webrtc::make_ref_counted<MultiUserMediaCollector>(
"test_", std::move(mock_output_file_provider).AsStdFunction(),
Expand Down Expand Up @@ -684,7 +684,7 @@ TEST(MultiUserMediaCollectorTest,
.Times(3)
.WillRepeatedly(Return("identifier_1"));
auto renamer = MockFunction<void(absl::string_view, absl::string_view)>();
auto thread = rtc::Thread::Create();
auto thread = webrtc::Thread::Create();
thread->Start();
auto collector = webrtc::make_ref_counted<MultiUserMediaCollector>(
"test_", std::move(mock_output_file_provider).AsStdFunction(),
Expand Down Expand Up @@ -755,7 +755,7 @@ TEST(MultiUserMediaCollectorTest,
EXPECT_CALL(*mock_resource_manager, GetOutputFileIdentifier(1))
.WillRepeatedly(Return("identifier_1"));
auto renamer = MockFunction<void(absl::string_view, absl::string_view)>();
auto thread = rtc::Thread::Create();
auto thread = webrtc::Thread::Create();
thread->Start();
auto collector = webrtc::make_ref_counted<MultiUserMediaCollector>(
"test_", std::move(mock_output_file_provider).AsStdFunction(),
Expand Down Expand Up @@ -808,7 +808,7 @@ TEST(MultiUserMediaCollectorTest, StartingNewVideoSegmentReleasesOldSegment) {
EXPECT_CALL(*mock_resource_manager, GetOutputFileIdentifier(1))
.WillRepeatedly(Return("identifier_1"));
auto renamer = MockFunction<void(absl::string_view, absl::string_view)>();
auto thread = rtc::Thread::Create();
auto thread = webrtc::Thread::Create();
thread->Start();
auto collector = webrtc::make_ref_counted<MultiUserMediaCollector>(
"test_", std::move(mock_output_file_provider).AsStdFunction(),
Expand Down Expand Up @@ -836,7 +836,7 @@ TEST(MultiUserMediaCollectorTest,
EXPECT_CALL(*mock_resource_manager, GetOutputFileIdentifier(1))
.WillOnce(Return(absl::InternalError("test error")));
auto renamer = MockFunction<void(absl::string_view, absl::string_view)>();
auto thread = rtc::Thread::Create();
auto thread = webrtc::Thread::Create();
thread->Start();
auto collector = webrtc::make_ref_counted<MultiUserMediaCollector>(
"test_",
Expand Down
2 changes: 1 addition & 1 deletion cpp/samples/multi_user_media_sample.cc
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ int main(int argc, char** argv) {
return EXIT_FAILURE;
}

std::unique_ptr<rtc::Thread> collector_thread = rtc::Thread::Create();
std::unique_ptr<webrtc::Thread> collector_thread = webrtc::Thread::Create();
collector_thread->SetName("collector_thread", nullptr);
if (!collector_thread->Start()) {
LOG(ERROR) << "Failed to start collector thread";
Expand Down
2 changes: 1 addition & 1 deletion cpp/samples/single_user_media_collector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void SingleUserMediaCollector::HandleAudioBuffer(std::vector<int16_t> pcm16) {
}

void SingleUserMediaCollector::HandleVideoBuffer(
rtc::scoped_refptr<webrtc::VideoFrameBuffer> buffer) {
webrtc::scoped_refptr<webrtc::VideoFrameBuffer> buffer) {
DCHECK(collector_thread_->IsCurrent());

// Meet video frames are always in YUV420p format.
Expand Down
9 changes: 5 additions & 4 deletions cpp/samples/single_user_media_collector.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class SingleUserMediaCollector : public meet::MediaApiClientObserverInterface {
public:
// Default constructor that writes media to real files.
SingleUserMediaCollector(absl::string_view output_file_prefix,
std::unique_ptr<rtc::Thread> collector_thread)
std::unique_ptr<webrtc::Thread> collector_thread)
: output_file_prefix_(output_file_prefix),
collector_thread_(std::move(collector_thread)) {
output_writer_provider_ = [](absl::string_view file_name) {
Expand All @@ -78,7 +78,7 @@ class SingleUserMediaCollector : public meet::MediaApiClientObserverInterface {

// Constructor that allows injecting a custom writer provider for testing.
SingleUserMediaCollector(absl::string_view output_file_prefix,
std::unique_ptr<rtc::Thread> collector_thread,
std::unique_ptr<webrtc::Thread> collector_thread,
OutputWriterProvider output_writer_provider)
: output_file_prefix_(output_file_prefix),
output_writer_provider_(std::move(output_writer_provider)),
Expand Down Expand Up @@ -130,7 +130,8 @@ class SingleUserMediaCollector : public meet::MediaApiClientObserverInterface {
};

void HandleAudioBuffer(std::vector<int16_t> pcm16);
void HandleVideoBuffer(rtc::scoped_refptr<webrtc::VideoFrameBuffer> buffer);
void HandleVideoBuffer(
webrtc::scoped_refptr<webrtc::VideoFrameBuffer> buffer);

std::string output_file_prefix_;
OutputWriterProvider output_writer_provider_;
Expand All @@ -152,7 +153,7 @@ class SingleUserMediaCollector : public meet::MediaApiClientObserverInterface {

// The media collector's internal thread. Used for moving work off of the
// MediaApiClient's threads and synchronizing access to member variables.
std::unique_ptr<rtc::Thread> collector_thread_;
std::unique_ptr<webrtc::Thread> collector_thread_;
};

} // namespace media_api_samples
Expand Down
18 changes: 9 additions & 9 deletions cpp/samples/single_user_media_collector_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,23 @@ using ::testing::Return;

TEST(SingleUserMediaCollectorTest, WaitForJoinedTimesOutBeforeJoining) {
auto collector = webrtc::make_ref_counted<SingleUserMediaCollector>(
"test_", rtc::Thread::Create());
"test_", webrtc::Thread::Create());

EXPECT_EQ(collector->WaitForJoined(absl::Seconds(1)).code(),
absl::StatusCode::kDeadlineExceeded);
}

TEST(SingleUserMediaCollectorTest, WaitForJoinedSucceedsAfterJoining) {
auto collector = webrtc::make_ref_counted<SingleUserMediaCollector>(
"test_", rtc::Thread::Create());
"test_", webrtc::Thread::Create());
collector->OnJoined();
EXPECT_EQ(collector->WaitForJoined(absl::Seconds(1)), absl::OkStatus());
}

TEST(SingleUserMediaCollectorTest,
WaitForDisconnectedTimesOutBeforeDisconnecting) {
auto collector = webrtc::make_ref_counted<SingleUserMediaCollector>(
"test_", rtc::Thread::Create());
"test_", webrtc::Thread::Create());

EXPECT_EQ(collector->WaitForDisconnected(absl::Seconds(1)).code(),
absl::StatusCode::kDeadlineExceeded);
Expand All @@ -70,7 +70,7 @@ TEST(SingleUserMediaCollectorTest,
TEST(SingleUserMediaCollectorTest,
WaitForDisconnectedSucceedsAfterDisconnecting) {
auto collector = webrtc::make_ref_counted<SingleUserMediaCollector>(
"test_", rtc::Thread::Create());
"test_", webrtc::Thread::Create());
collector->OnDisconnected(absl::OkStatus());
EXPECT_EQ(collector->WaitForDisconnected(absl::Seconds(1)), absl::OkStatus());
}
Expand All @@ -95,7 +95,7 @@ TEST(SingleUserMediaCollectorTest, ReceivesAudioFrameAndWritesToAudioFile) {
mock_output_file_provider;
EXPECT_CALL(mock_output_file_provider, Call("test_audio.pcm"))
.WillOnce(Return(std::move(mock_output_file)));
auto thread = rtc::Thread::Create();
auto thread = webrtc::Thread::Create();
thread->Start();
auto collector = webrtc::make_ref_counted<SingleUserMediaCollector>(
"test_", std::move(thread),
Expand Down Expand Up @@ -127,7 +127,7 @@ TEST(SingleUserMediaCollectorTest, ReceivesAudioFrameOnlyCreatesOneAudioFile) {
EXPECT_CALL(mock_output_file_provider, Call(_))
.Times(1)
.WillOnce(Return(std::move(mock_output_file)));
auto thread = rtc::Thread::Create();
auto thread = webrtc::Thread::Create();
thread->Start();
auto collector = webrtc::make_ref_counted<SingleUserMediaCollector>(
"test_", std::move(thread),
Expand Down Expand Up @@ -161,7 +161,7 @@ TEST(SingleUserMediaCollectorTest, ReceivesVideoFrameAndWritesToVideoFile) {
mock_output_file_provider;
EXPECT_CALL(mock_output_file_provider, Call("test_video_0_10x5.yuv"))
.WillOnce(Return(std::move(mock_output_file)));
auto thread = rtc::Thread::Create();
auto thread = webrtc::Thread::Create();
thread->Start();
auto collector = webrtc::make_ref_counted<SingleUserMediaCollector>(
"test_", std::move(thread),
Expand All @@ -187,7 +187,7 @@ TEST(SingleUserMediaCollectorTest,
write_notification.Notify();
return std::make_unique<MockOutputWriter>();
});
auto thread = rtc::Thread::Create();
auto thread = webrtc::Thread::Create();
thread->Start();
auto collector = webrtc::make_ref_counted<SingleUserMediaCollector>(
"test_", std::move(thread),
Expand Down Expand Up @@ -226,7 +226,7 @@ TEST(SingleUserMediaCollectorTest,
write_notification3.Notify();
return std::make_unique<MockOutputWriter>();
});
auto thread = rtc::Thread::Create();
auto thread = webrtc::Thread::Create();
thread->Start();
auto collector = webrtc::make_ref_counted<SingleUserMediaCollector>(
"test_", std::move(thread),
Expand Down
2 changes: 1 addition & 1 deletion cpp/samples/single_user_media_sample.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ int main(int argc, char** argv) {
return EXIT_FAILURE;
}

std::unique_ptr<rtc::Thread> collector_thread = rtc::Thread::Create();
std::unique_ptr<webrtc::Thread> collector_thread = webrtc::Thread::Create();
collector_thread->SetName("collector_thread", nullptr);
if (!collector_thread->Start()) {
LOG(ERROR) << "Failed to start collector thread";
Expand Down
Loading
Loading