OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Test application that simulates a cast sender - Data can be either generated | 5 // Test application that simulates a cast sender - Data can be either generated |
6 // or read from a file. | 6 // or read from a file. |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 | 9 |
10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 if (!source_path.empty()) { | 314 if (!source_path.empty()) { |
315 LOG(INFO) << "Source: " << source_path.value(); | 315 LOG(INFO) << "Source: " << source_path.value(); |
316 fake_media_source->SetSourceFile(source_path, override_fps); | 316 fake_media_source->SetSourceFile(source_path, override_fps); |
317 } | 317 } |
318 | 318 |
319 // CastTransportSender initialization. | 319 // CastTransportSender initialization. |
320 scoped_ptr<media::cast::CastTransportSender> transport_sender = | 320 scoped_ptr<media::cast::CastTransportSender> transport_sender = |
321 media::cast::CastTransportSender::Create( | 321 media::cast::CastTransportSender::Create( |
322 NULL, // net log. | 322 NULL, // net log. |
323 cast_environment->Clock(), | 323 cast_environment->Clock(), |
| 324 net::IPEndPoint(), |
324 remote_endpoint, | 325 remote_endpoint, |
325 make_scoped_ptr(new base::DictionaryValue), // options | 326 make_scoped_ptr(new base::DictionaryValue), // options |
326 base::Bind(&UpdateCastTransportStatus), | 327 base::Bind(&UpdateCastTransportStatus), |
327 base::Bind(&LogRawEvents, cast_environment), | 328 base::Bind(&LogRawEvents, cast_environment), |
328 base::TimeDelta::FromSeconds(1), | 329 base::TimeDelta::FromSeconds(1), |
| 330 media::cast::PacketReceiverCallback(), |
329 io_message_loop.message_loop_proxy()); | 331 io_message_loop.message_loop_proxy()); |
330 | 332 |
331 // CastSender initialization. | 333 // CastSender initialization. |
332 scoped_ptr<media::cast::CastSender> cast_sender = | 334 scoped_ptr<media::cast::CastSender> cast_sender = |
333 media::cast::CastSender::Create(cast_environment, transport_sender.get()); | 335 media::cast::CastSender::Create(cast_environment, transport_sender.get()); |
334 cast_sender->InitializeVideo( | 336 cast_sender->InitializeVideo( |
335 fake_media_source->get_video_config(), | 337 fake_media_source->get_video_config(), |
336 base::Bind(&InitializationResult), | 338 base::Bind(&InitializationResult), |
337 media::cast::CreateDefaultVideoEncodeAcceleratorCallback(), | 339 media::cast::CreateDefaultVideoEncodeAcceleratorCallback(), |
338 media::cast::CreateDefaultVideoEncodeMemoryCallback()); | 340 media::cast::CreateDefaultVideoEncodeMemoryCallback()); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 base::Passed(&audio_stats_subscriber), | 404 base::Passed(&audio_stats_subscriber), |
403 base::Passed(&offset_estimator)), | 405 base::Passed(&offset_estimator)), |
404 base::TimeDelta::FromSeconds(logging_duration_seconds)); | 406 base::TimeDelta::FromSeconds(logging_duration_seconds)); |
405 | 407 |
406 fake_media_source->Start(cast_sender->audio_frame_input(), | 408 fake_media_source->Start(cast_sender->audio_frame_input(), |
407 cast_sender->video_frame_input()); | 409 cast_sender->video_frame_input()); |
408 | 410 |
409 io_message_loop.Run(); | 411 io_message_loop.Run(); |
410 return 0; | 412 return 0; |
411 } | 413 } |
OLD | NEW |