Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Unified Diff: media/cast/test/sender.cc

Issue 163553006: Cast: Refactoring Cast API's (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Responding to review Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/cast/test/sender.cc
diff --git a/media/cast/test/sender.cc b/media/cast/test/sender.cc
index 603b2de847c0124afda6e6dec1ff6becb689b513..6286689f2f2d3c715c9af72835ed1bc6033d8265 100644
--- a/media/cast/test/sender.cc
+++ b/media/cast/test/sender.cc
@@ -256,14 +256,14 @@ class SendProcess {
test_app_thread_proxy_->PostDelayedTask(
FROM_HERE,
base::Bind(&SendProcess::SendVideoFrameOnTime,
- base::Unretained(this),
+ weak_factory_.GetWeakPtr(),
video_frame),
video_frame_time - elapsed_time);
} else {
test_app_thread_proxy_->PostTask(
FROM_HERE,
base::Bind(&SendProcess::SendVideoFrameOnTime,
- base::Unretained(this),
+ weak_factory_.GetWeakPtr(),
video_frame));
}
}
@@ -297,8 +297,9 @@ void UpdateCastTransportStatus(
media::cast::transport::CastTransportStatus status) {}
void InitializationResult(media::cast::CastInitializationStatus result) {
- CHECK_EQ(result, media::cast::STATUS_INITIALIZED);
- VLOG(1) << "Cast Sender initialized";
+ bool end_result = result == media::cast::STATUS_AUDIO_INITIALIZED ||
+ result == media::cast::STATUS_VIDEO_INITIALIZED;
+ CHECK(end_result);
}
net::IPEndPoint CreateUDPAddress(std::string ip_str, int port) {
@@ -311,7 +312,6 @@ net::IPEndPoint CreateUDPAddress(std::string ip_str, int port) {
int main(int argc, char** argv) {
base::AtExitManager at_exit;
- VLOG(1) << "Cast Sender";
base::Thread test_thread("Cast sender test app thread");
base::Thread audio_thread("Cast audio encoder thread");
base::Thread video_thread("Cast video encoder thread");
@@ -363,13 +363,12 @@ int main(int argc, char** argv) {
media::cast::GetDefaultCastSenderLoggingConfig()));
scoped_ptr<media::cast::CastSender> cast_sender(
- media::cast::CastSender::CreateCastSender(
- cast_environment,
- &audio_config,
- &video_config,
- NULL, // gpu_factories.
- base::Bind(&InitializationResult),
- transport_sender.get()));
+ media::cast::CastSender::Create(cast_environment,
+ base::Bind(&InitializationResult),
+ transport_sender.get()));
+
+ cast_sender->InitializeVideo(video_config, NULL);
+ cast_sender->InitializeAudio(audio_config);
transport_sender->SetPacketReceiver(cast_sender->packet_receiver());

Powered by Google App Engine
This is Rietveld 408576698