OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 // Below constraints should be used during PeerConnection construction. | 88 // Below constraints should be used during PeerConnection construction. |
89 const char MediaConstraintsInterface::kEnableDtlsSrtp[] = | 89 const char MediaConstraintsInterface::kEnableDtlsSrtp[] = |
90 "DtlsSrtpKeyAgreement"; | 90 "DtlsSrtpKeyAgreement"; |
91 const char MediaConstraintsInterface::kEnableRtpDataChannels[] = | 91 const char MediaConstraintsInterface::kEnableRtpDataChannels[] = |
92 "RtpDataChannels"; | 92 "RtpDataChannels"; |
93 // Google-specific constraint keys. | 93 // Google-specific constraint keys. |
94 const char MediaConstraintsInterface::kEnableDscp[] = "googDscp"; | 94 const char MediaConstraintsInterface::kEnableDscp[] = "googDscp"; |
95 const char MediaConstraintsInterface::kEnableIPv6[] = "googIPv6"; | 95 const char MediaConstraintsInterface::kEnableIPv6[] = "googIPv6"; |
96 const char MediaConstraintsInterface::kEnableVideoSuspendBelowMinBitrate[] = | 96 const char MediaConstraintsInterface::kEnableVideoSuspendBelowMinBitrate[] = |
97 "googSuspendBelowMinBitrate"; | 97 "googSuspendBelowMinBitrate"; |
98 const char MediaConstraintsInterface::kNumUnsignalledRecvStreams[] = | |
99 "googNumUnsignalledRecvStreams"; | |
100 const char MediaConstraintsInterface::kCombinedAudioVideoBwe[] = | 98 const char MediaConstraintsInterface::kCombinedAudioVideoBwe[] = |
101 "googCombinedAudioVideoBwe"; | 99 "googCombinedAudioVideoBwe"; |
102 const char MediaConstraintsInterface::kScreencastMinBitrate[] = | 100 const char MediaConstraintsInterface::kScreencastMinBitrate[] = |
103 "googScreencastMinBitrate"; | 101 "googScreencastMinBitrate"; |
104 // TODO(ronghuawu): Remove once cpu overuse detection is stable. | 102 // TODO(ronghuawu): Remove once cpu overuse detection is stable. |
105 const char MediaConstraintsInterface::kCpuOveruseDetection[] = | 103 const char MediaConstraintsInterface::kCpuOveruseDetection[] = |
106 "googCpuOveruseDetection"; | 104 "googCpuOveruseDetection"; |
107 const char MediaConstraintsInterface::kCpuUnderuseThreshold[] = | |
108 "googCpuUnderuseThreshold"; | |
109 const char MediaConstraintsInterface::kCpuOveruseThreshold[] = | |
110 "googCpuOveruseThreshold"; | |
111 const char MediaConstraintsInterface::kCpuUnderuseEncodeRsdThreshold[] = | |
112 "googCpuUnderuseEncodeRsdThreshold"; | |
113 const char MediaConstraintsInterface::kCpuOveruseEncodeRsdThreshold[] = | |
114 "googCpuOveruseEncodeRsdThreshold"; | |
115 const char MediaConstraintsInterface::kCpuOveruseEncodeUsage[] = | |
116 "googCpuOveruseEncodeUsage"; | |
117 const char MediaConstraintsInterface::kHighStartBitrate[] = | |
118 "googHighStartBitrate"; | |
119 const char MediaConstraintsInterface::kPayloadPadding[] = "googPayloadPadding"; | 105 const char MediaConstraintsInterface::kPayloadPadding[] = "googPayloadPadding"; |
120 | 106 |
121 | 107 |
122 // Set |value| to the value associated with the first appearance of |key|, or | 108 // Set |value| to the value associated with the first appearance of |key|, or |
123 // return false if |key| is not found. | 109 // return false if |key| is not found. |
124 bool MediaConstraintsInterface::Constraints::FindFirst( | 110 bool MediaConstraintsInterface::Constraints::FindFirst( |
125 const std::string& key, std::string* value) const { | 111 const std::string& key, std::string* value) const { |
126 for (Constraints::const_iterator iter = begin(); iter != end(); ++iter) { | 112 for (Constraints::const_iterator iter = begin(); iter != end(); ++iter) { |
127 if (iter->key == key) { | 113 if (iter->key == key) { |
128 *value = iter->value; | 114 *value = iter->value; |
(...skipping 25 matching lines...) Expand all Loading... |
154 ++*mandatory_constraints; | 140 ++*mandatory_constraints; |
155 return rtc::FromString(string_value, value); | 141 return rtc::FromString(string_value, value); |
156 } | 142 } |
157 if (constraints->GetOptional().FindFirst(key, &string_value)) { | 143 if (constraints->GetOptional().FindFirst(key, &string_value)) { |
158 return rtc::FromString(string_value, value); | 144 return rtc::FromString(string_value, value); |
159 } | 145 } |
160 return false; | 146 return false; |
161 } | 147 } |
162 | 148 |
163 } // namespace webrtc | 149 } // namespace webrtc |
OLD | NEW |