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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 new media::cast::CastEnvironment( | 252 new media::cast::CastEnvironment( |
253 make_scoped_ptr<base::TickClock>(new base::DefaultTickClock()), | 253 make_scoped_ptr<base::TickClock>(new base::DefaultTickClock()), |
254 io_message_loop.message_loop_proxy(), | 254 io_message_loop.message_loop_proxy(), |
255 audio_thread.message_loop_proxy(), | 255 audio_thread.message_loop_proxy(), |
256 video_thread.message_loop_proxy())); | 256 video_thread.message_loop_proxy())); |
257 | 257 |
258 // SendProcess initialization. | 258 // SendProcess initialization. |
259 scoped_ptr<media::cast::FakeMediaSource> fake_media_source( | 259 scoped_ptr<media::cast::FakeMediaSource> fake_media_source( |
260 new media::cast::FakeMediaSource(test_thread.message_loop_proxy(), | 260 new media::cast::FakeMediaSource(test_thread.message_loop_proxy(), |
261 cast_environment->Clock(), | 261 cast_environment->Clock(), |
262 video_config, false)); | 262 audio_config, |
| 263 video_config, |
| 264 false)); |
263 | 265 |
264 int override_fps = 0; | 266 int override_fps = 0; |
265 if (!base::StringToInt(cmd->GetSwitchValueASCII(kSwitchFps), | 267 if (!base::StringToInt(cmd->GetSwitchValueASCII(kSwitchFps), |
266 &override_fps)){ | 268 &override_fps)){ |
267 override_fps = 0; | 269 override_fps = 0; |
268 } | 270 } |
269 base::FilePath source_path = cmd->GetSwitchValuePath(kSwitchSourceFile); | 271 base::FilePath source_path = cmd->GetSwitchValuePath(kSwitchSourceFile); |
270 if (!source_path.empty()) { | 272 if (!source_path.empty()) { |
271 LOG(INFO) << "Source: " << source_path.value(); | 273 LOG(INFO) << "Source: " << source_path.value(); |
272 fake_media_source->SetSourceFile(source_path, override_fps); | 274 fake_media_source->SetSourceFile(source_path, override_fps); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 base::Unretained(cast_sender.get()), | 373 base::Unretained(cast_sender.get()), |
372 audio_config, | 374 audio_config, |
373 base::Bind(&QuitLoopOnInitializationResult))); | 375 base::Bind(&QuitLoopOnInitializationResult))); |
374 io_message_loop.Run(); // Wait for audio initialization. | 376 io_message_loop.Run(); // Wait for audio initialization. |
375 | 377 |
376 fake_media_source->Start(cast_sender->audio_frame_input(), | 378 fake_media_source->Start(cast_sender->audio_frame_input(), |
377 cast_sender->video_frame_input()); | 379 cast_sender->video_frame_input()); |
378 io_message_loop.Run(); | 380 io_message_loop.Run(); |
379 return 0; | 381 return 0; |
380 } | 382 } |
OLD | NEW |