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 #ifndef CHROMECAST_BASE_CHROMECAST_SWITCHES_H_ | 5 #ifndef CHROMECAST_BASE_CHROMECAST_SWITCHES_H_ |
6 #define CHROMECAST_BASE_CHROMECAST_SWITCHES_H_ | 6 #define CHROMECAST_BASE_CHROMECAST_SWITCHES_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 extern const char kAcceptResourceProvider[]; | 38 extern const char kAcceptResourceProvider[]; |
39 | 39 |
40 // ALSA-based CMA switches. (Only valid for audio products.) | 40 // ALSA-based CMA switches. (Only valid for audio products.) |
41 extern const char kAlsaOutputBufferSize[]; | 41 extern const char kAlsaOutputBufferSize[]; |
42 extern const char kAlsaOutputPeriodSize[]; | 42 extern const char kAlsaOutputPeriodSize[]; |
43 extern const char kAlsaOutputStartThreshold[]; | 43 extern const char kAlsaOutputStartThreshold[]; |
44 extern const char kAlsaOutputAvailMin[]; | 44 extern const char kAlsaOutputAvailMin[]; |
45 extern const char kAlsaCheckCloseTimeout[]; | 45 extern const char kAlsaCheckCloseTimeout[]; |
46 extern const char kAlsaEnableUpsampling[]; | 46 extern const char kAlsaEnableUpsampling[]; |
47 extern const char kAlsaFixedOutputSampleRate[]; | 47 extern const char kAlsaFixedOutputSampleRate[]; |
| 48 extern const char kMaxOutputVolumeDba1m[]; |
48 | 49 |
49 // Memory pressure switches | 50 // Memory pressure switches |
50 extern const char kMemPressureSystemReservedKb[]; | 51 extern const char kMemPressureSystemReservedKb[]; |
51 | 52 |
52 // GPU process switches | 53 // GPU process switches |
53 extern const char kCastInitialScreenWidth[]; | 54 extern const char kCastInitialScreenWidth[]; |
54 extern const char kCastInitialScreenHeight[]; | 55 extern const char kCastInitialScreenHeight[]; |
55 | 56 |
56 // Graphics switches | 57 // Graphics switches |
57 extern const char kDesktopWindow1080p[]; | 58 extern const char kDesktopWindow1080p[]; |
58 | 59 |
59 } // namespace switches | 60 } // namespace switches |
60 | 61 |
61 namespace chromecast { | 62 namespace chromecast { |
62 | 63 |
63 // Gets boolean value from switch |switch_string|. | 64 // Gets boolean value from switch |switch_string|. |
64 // --|switch_string| -> true | 65 // --|switch_string| -> true |
65 // --|switch_string|="true" -> true | 66 // --|switch_string|="true" -> true |
66 // --|switch_string|="false" -> false | 67 // --|switch_string|="false" -> false |
67 // no switch named |switch_string| -> |default_value| | 68 // no switch named |switch_string| -> |default_value| |
68 bool GetSwitchValueBoolean(const std::string& switch_string, | 69 bool GetSwitchValueBoolean(const std::string& switch_string, |
69 const bool default_value); | 70 const bool default_value); |
70 | 71 |
| 72 // Gets an integer value from switch |switch_name|. If the switch is not present |
| 73 // in the command line, or the value is not an integer, the |default_value| is |
| 74 // returned. |
| 75 int GetSwitchValueInt(const std::string& switch_name, const int default_value); |
| 76 |
| 77 // Gets a non-negative integer value from switch |switch_name|. If the switch is |
| 78 // not present in the command line, or the value is not a non-negative integer, |
| 79 // the |default_value| is returned. |
| 80 int GetSwitchValueNonNegativeInt(const std::string& switch_name, |
| 81 const int default_value); |
| 82 |
71 } // namespace chromecast | 83 } // namespace chromecast |
72 | 84 |
73 #endif // CHROMECAST_BASE_CHROMECAST_SWITCHES_H_ | 85 #endif // CHROMECAST_BASE_CHROMECAST_SWITCHES_H_ |
OLD | NEW |