OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // Simulate end to end streaming. | 5 // Simulate end to end streaming. |
6 // | 6 // |
7 // Input: | 7 // Input: |
8 // --source= | 8 // --source= |
9 // WebM used as the source of video and audio frames. | 9 // WebM used as the source of video and audio frames. |
10 // --output= | 10 // --output= |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 &testing_clock, | 303 &testing_clock, |
304 video_sender_config); | 304 video_sender_config); |
305 | 305 |
306 // Initializing audio and video senders. | 306 // Initializing audio and video senders. |
307 cast_sender->InitializeAudio(audio_sender_config, | 307 cast_sender->InitializeAudio(audio_sender_config, |
308 base::Bind(&AudioInitializationStatus)); | 308 base::Bind(&AudioInitializationStatus)); |
309 cast_sender->InitializeVideo(media_source.get_video_config(), | 309 cast_sender->InitializeVideo(media_source.get_video_config(), |
310 base::Bind(&VideoInitializationStatus), | 310 base::Bind(&VideoInitializationStatus), |
311 CreateDefaultVideoEncodeAcceleratorCallback(), | 311 CreateDefaultVideoEncodeAcceleratorCallback(), |
312 CreateDefaultVideoEncodeMemoryCallback()); | 312 CreateDefaultVideoEncodeMemoryCallback()); |
| 313 task_runner->RunTasks(); |
313 | 314 |
314 // Start sending. | 315 // Start sending. |
315 if (!source_path.empty()) { | 316 if (!source_path.empty()) { |
316 // 0 means using the FPS from the file. | 317 // 0 means using the FPS from the file. |
317 media_source.SetSourceFile(source_path, 0); | 318 media_source.SetSourceFile(source_path, 0); |
318 } | 319 } |
319 media_source.Start(cast_sender->audio_frame_input(), | 320 media_source.Start(cast_sender->audio_frame_input(), |
320 cast_sender->video_frame_input()); | 321 cast_sender->video_frame_input()); |
321 | 322 |
322 // Run for 3 minutes. | 323 // Run for 3 minutes. |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 values.SetBoolean("sim", true); | 512 values.SetBoolean("sim", true); |
512 values.SetString("sim-id", sim_id); | 513 values.SetString("sim-id", sim_id); |
513 | 514 |
514 std::string extra_data; | 515 std::string extra_data; |
515 base::JSONWriter::Write(&values, &extra_data); | 516 base::JSONWriter::Write(&values, &extra_data); |
516 | 517 |
517 // Run. | 518 // Run. |
518 media::cast::RunSimulation(source_path, output_path, extra_data, model); | 519 media::cast::RunSimulation(source_path, output_path, extra_data, model); |
519 return 0; | 520 return 0; |
520 } | 521 } |
OLD | NEW |