| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 LOG(INFO) << "Source: " << source_path.value(); | 258 LOG(INFO) << "Source: " << source_path.value(); |
| 259 fake_media_source->SetSourceFile(source_path, final_fps); | 259 fake_media_source->SetSourceFile(source_path, final_fps); |
| 260 } | 260 } |
| 261 if (cmd->HasSwitch(kSwitchVaryFrameSizes)) | 261 if (cmd->HasSwitch(kSwitchVaryFrameSizes)) |
| 262 fake_media_source->SetVariableFrameSizeMode(true); | 262 fake_media_source->SetVariableFrameSizeMode(true); |
| 263 | 263 |
| 264 // CastTransport initialization. | 264 // CastTransport initialization. |
| 265 std::unique_ptr<media::cast::CastTransport> transport_sender = | 265 std::unique_ptr<media::cast::CastTransport> transport_sender = |
| 266 media::cast::CastTransport::Create( | 266 media::cast::CastTransport::Create( |
| 267 cast_environment->Clock(), base::TimeDelta::FromSeconds(1), | 267 cast_environment->Clock(), base::TimeDelta::FromSeconds(1), |
| 268 base::WrapUnique(new TransportClient(cast_environment->logger())), | 268 base::MakeUnique<TransportClient>(cast_environment->logger()), |
| 269 base::WrapUnique(new media::cast::UdpTransport( | 269 base::MakeUnique<media::cast::UdpTransport>( |
| 270 nullptr, io_message_loop.task_runner(), net::IPEndPoint(), | 270 nullptr, io_message_loop.task_runner(), net::IPEndPoint(), |
| 271 remote_endpoint, base::Bind(&UpdateCastTransportStatus))), | 271 remote_endpoint, base::Bind(&UpdateCastTransportStatus)), |
| 272 io_message_loop.task_runner()); | 272 io_message_loop.task_runner()); |
| 273 | 273 |
| 274 // Set up event subscribers. | 274 // Set up event subscribers. |
| 275 std::unique_ptr<media::cast::EncodingEventSubscriber> video_event_subscriber; | 275 std::unique_ptr<media::cast::EncodingEventSubscriber> video_event_subscriber; |
| 276 std::unique_ptr<media::cast::EncodingEventSubscriber> audio_event_subscriber; | 276 std::unique_ptr<media::cast::EncodingEventSubscriber> audio_event_subscriber; |
| 277 std::string video_log_file_name("/tmp/video_events.log.gz"); | 277 std::string video_log_file_name("/tmp/video_events.log.gz"); |
| 278 std::string audio_log_file_name("/tmp/audio_events.log.gz"); | 278 std::string audio_log_file_name("/tmp/audio_events.log.gz"); |
| 279 LOG(INFO) << "Logging audio events to: " << audio_log_file_name; | 279 LOG(INFO) << "Logging audio events to: " << audio_log_file_name; |
| 280 LOG(INFO) << "Logging video events to: " << video_log_file_name; | 280 LOG(INFO) << "Logging video events to: " << video_log_file_name; |
| 281 video_event_subscriber.reset(new media::cast::EncodingEventSubscriber( | 281 video_event_subscriber.reset(new media::cast::EncodingEventSubscriber( |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 FROM_HERE, base::Bind(&media::cast::CastSender::InitializeAudio, | 348 FROM_HERE, base::Bind(&media::cast::CastSender::InitializeAudio, |
| 349 base::Unretained(cast_sender.get()), audio_config, | 349 base::Unretained(cast_sender.get()), audio_config, |
| 350 base::Bind(&QuitLoopOnInitializationResult))); | 350 base::Bind(&QuitLoopOnInitializationResult))); |
| 351 io_message_loop.Run(); // Wait for audio initialization. | 351 io_message_loop.Run(); // Wait for audio initialization. |
| 352 | 352 |
| 353 fake_media_source->Start(cast_sender->audio_frame_input(), | 353 fake_media_source->Start(cast_sender->audio_frame_input(), |
| 354 cast_sender->video_frame_input()); | 354 cast_sender->video_frame_input()); |
| 355 io_message_loop.Run(); | 355 io_message_loop.Run(); |
| 356 return 0; | 356 return 0; |
| 357 } | 357 } |
| OLD | NEW |