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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 // | 286 // |
287 // |log_output_path| is the path to write serialized log. | 287 // |log_output_path| is the path to write serialized log. |
288 // |extra_data| is extra tagging information to write to log. | 288 // |extra_data| is extra tagging information to write to log. |
289 void RunSimulation(const base::FilePath& source_path, | 289 void RunSimulation(const base::FilePath& source_path, |
290 const base::FilePath& log_output_path, | 290 const base::FilePath& log_output_path, |
291 const base::FilePath& metrics_output_path, | 291 const base::FilePath& metrics_output_path, |
292 const base::FilePath& yuv_output_path, | 292 const base::FilePath& yuv_output_path, |
293 const std::string& extra_data, | 293 const std::string& extra_data, |
294 const NetworkSimulationModel& model) { | 294 const NetworkSimulationModel& model) { |
295 // Fake clock. Make sure start time is non zero. | 295 // Fake clock. Make sure start time is non zero. |
296 base::SimpleTestTickClock testing_clock; | 296 base::SimpleTestTickClock testing_clock(base::TimeTicks() + |
297 testing_clock.Advance(base::TimeDelta::FromSeconds(1)); | 297 base::TimeDelta::FromSeconds(1)); |
298 | 298 |
299 // Task runner. | 299 // Task runner. |
300 scoped_refptr<test::FakeSingleThreadTaskRunner> task_runner = | 300 scoped_refptr<test::FakeSingleThreadTaskRunner> task_runner = |
301 new test::FakeSingleThreadTaskRunner(&testing_clock); | 301 new test::FakeSingleThreadTaskRunner(&testing_clock); |
302 base::ThreadTaskRunnerHandle task_runner_handle(task_runner); | 302 base::ThreadTaskRunnerHandle task_runner_handle(task_runner); |
303 | 303 |
304 // CastEnvironments. | 304 // CastEnvironments. |
305 scoped_refptr<CastEnvironment> sender_env = new CastEnvironment( | 305 scoped_refptr<CastEnvironment> sender_env = new CastEnvironment( |
306 scoped_ptr<base::TickClock>(new test::SkewedTickClock(&testing_clock)), | 306 scoped_ptr<base::TickClock>(new test::SkewedTickClock(&testing_clock)), |
307 task_runner, task_runner, task_runner); | 307 task_runner, task_runner, task_runner); |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 values.SetString("sim-id", sim_id); | 718 values.SetString("sim-id", sim_id); |
719 | 719 |
720 std::string extra_data; | 720 std::string extra_data; |
721 base::JSONWriter::Write(values, &extra_data); | 721 base::JSONWriter::Write(values, &extra_data); |
722 | 722 |
723 // Run. | 723 // Run. |
724 media::cast::RunSimulation(source_path, log_output_path, metrics_output_path, | 724 media::cast::RunSimulation(source_path, log_output_path, metrics_output_path, |
725 yuv_output_path, extra_data, model); | 725 yuv_output_path, extra_data, model); |
726 return 0; | 726 return 0; |
727 } | 727 } |
OLD | NEW |