| 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 #include "media/capture/video/fake_video_capture_device_factory.h" | 5 #include "media/capture/video/fake_video_capture_device_factory.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
| 10 #include "base/strings/string_tokenizer.h" | 10 #include "base/strings/string_tokenizer.h" |
| 11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 12 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
| 13 #include "build/build_config.h" |
| 13 #include "media/base/media_switches.h" | 14 #include "media/base/media_switches.h" |
| 14 | 15 |
| 15 namespace media { | 16 namespace media { |
| 16 | 17 |
| 17 // Cap the frame rate command line input to reasonable values. | 18 // Cap the frame rate command line input to reasonable values. |
| 18 static const float kFakeCaptureMinFrameRate = 5.0f; | 19 static const float kFakeCaptureMinFrameRate = 5.0f; |
| 19 static const float kFakeCaptureMaxFrameRate = 60.0f; | 20 static const float kFakeCaptureMaxFrameRate = 60.0f; |
| 20 // Default rate if none is specified as part of the command line. | 21 // Default rate if none is specified as part of the command line. |
| 21 static const float kFakeCaptureDefaultFrameRate = 20.0f; | 22 static const float kFakeCaptureDefaultFrameRate = 20.0f; |
| 22 | 23 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 if (base::StringToDouble(param.back(), &fps)) { | 116 if (base::StringToDouble(param.back(), &fps)) { |
| 116 frame_rate_ = | 117 frame_rate_ = |
| 117 std::max(kFakeCaptureMinFrameRate, static_cast<float>(fps)); | 118 std::max(kFakeCaptureMinFrameRate, static_cast<float>(fps)); |
| 118 frame_rate_ = std::min(kFakeCaptureMaxFrameRate, frame_rate_); | 119 frame_rate_ = std::min(kFakeCaptureMaxFrameRate, frame_rate_); |
| 119 } | 120 } |
| 120 } | 121 } |
| 121 } | 122 } |
| 122 } | 123 } |
| 123 | 124 |
| 124 } // namespace media | 125 } // namespace media |
| OLD | NEW |