Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Side by Side Diff: third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp

Issue 1636403002: Allow and ignore the googLeakyBucket constraint. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add another constraint from test case Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 const char kScreencastMinBitrate[] = "googScreencastMinBitrate"; 115 const char kScreencastMinBitrate[] = "googScreencastMinBitrate";
116 const char kCpuOveruseDetection[] = "googCpuOveruseDetection"; 116 const char kCpuOveruseDetection[] = "googCpuOveruseDetection";
117 const char kCpuUnderuseThreshold[] = "googCpuUnderuseThreshold"; 117 const char kCpuUnderuseThreshold[] = "googCpuUnderuseThreshold";
118 const char kCpuOveruseThreshold[] = "googCpuOveruseThreshold"; 118 const char kCpuOveruseThreshold[] = "googCpuOveruseThreshold";
119 const char kCpuUnderuseEncodeRsdThreshold[] = "googCpuUnderuseEncodeRsdThreshold "; 119 const char kCpuUnderuseEncodeRsdThreshold[] = "googCpuUnderuseEncodeRsdThreshold ";
120 const char kCpuOveruseEncodeRsdThreshold[] = "googCpuOveruseEncodeRsdThreshold"; 120 const char kCpuOveruseEncodeRsdThreshold[] = "googCpuOveruseEncodeRsdThreshold";
121 const char kCpuOveruseEncodeUsage[] = "googCpuOveruseEncodeUsage"; 121 const char kCpuOveruseEncodeUsage[] = "googCpuOveruseEncodeUsage";
122 const char kHighStartBitrate[] = "googHighStartBitrate"; 122 const char kHighStartBitrate[] = "googHighStartBitrate";
123 const char kPayloadPadding[] = "googPayloadPadding"; 123 const char kPayloadPadding[] = "googPayloadPadding";
124 // End of names from libjingle 124 // End of names from libjingle
125 // Names that have been used in the past, but should now be ignored.
126 // Kept around for backwards compatibility.
127 // https://crbug.com/579729
128 const char kGoogLeakyBucket[] = "googLeakyBucket";
129 const char kEnableAutoThrottling[] = "enableAutoThrottling";
125 130
126 // Names used for testing. 131 // Names used for testing.
127 const char kTestConstraint1[] = "valid_and_supported_1"; 132 const char kTestConstraint1[] = "valid_and_supported_1";
128 const char kTestConstraint2[] = "valid_and_supported_2"; 133 const char kTestConstraint2[] = "valid_and_supported_2";
129 134
130 static bool parseMandatoryConstraintsDictionary(const Dictionary& mandatoryConst raintsDictionary, WebVector<WebMediaConstraint>& mandatory) 135 static bool parseMandatoryConstraintsDictionary(const Dictionary& mandatoryConst raintsDictionary, WebVector<WebMediaConstraint>& mandatory)
131 { 136 {
132 Vector<WebMediaConstraint> mandatoryConstraintsVector; 137 Vector<WebMediaConstraint> mandatoryConstraintsVector;
133 HashMap<String, String> mandatoryConstraintsHashMap; 138 HashMap<String, String> mandatoryConstraintsHashMap;
134 bool ok = mandatoryConstraintsDictionary.getOwnPropertiesAsStringHashMap(man datoryConstraintsHashMap); 139 bool ok = mandatoryConstraintsDictionary.getOwnPropertiesAsStringHashMap(man datoryConstraintsHashMap);
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 } else if (constraint.m_name.equals(kCpuUnderuseEncodeRsdThreshold)) { 350 } else if (constraint.m_name.equals(kCpuUnderuseEncodeRsdThreshold)) {
346 result.googCpuUnderuseEncodeRsdThreshold.setExact(atoi(constraint.m_ value.utf8().c_str())); 351 result.googCpuUnderuseEncodeRsdThreshold.setExact(atoi(constraint.m_ value.utf8().c_str()));
347 } else if (constraint.m_name.equals(kCpuOveruseEncodeRsdThreshold)) { 352 } else if (constraint.m_name.equals(kCpuOveruseEncodeRsdThreshold)) {
348 result.googCpuOveruseEncodeRsdThreshold.setExact(atoi(constraint.m_v alue.utf8().c_str())); 353 result.googCpuOveruseEncodeRsdThreshold.setExact(atoi(constraint.m_v alue.utf8().c_str()));
349 } else if (constraint.m_name.equals(kCpuOveruseEncodeUsage)) { 354 } else if (constraint.m_name.equals(kCpuOveruseEncodeUsage)) {
350 result.googCpuOveruseEncodeUsage.setExact(toBoolean(constraint.m_val ue)); 355 result.googCpuOveruseEncodeUsage.setExact(toBoolean(constraint.m_val ue));
351 } else if (constraint.m_name.equals(kHighStartBitrate)) { 356 } else if (constraint.m_name.equals(kHighStartBitrate)) {
352 result.googHighStartBitrate.setExact(atoi(constraint.m_value.utf8(). c_str())); 357 result.googHighStartBitrate.setExact(atoi(constraint.m_value.utf8(). c_str()));
353 } else if (constraint.m_name.equals(kPayloadPadding)) { 358 } else if (constraint.m_name.equals(kPayloadPadding)) {
354 result.googPayloadPadding.setExact(toBoolean(constraint.m_value)); 359 result.googPayloadPadding.setExact(toBoolean(constraint.m_value));
360 } else if (constraint.m_name.equals(kGoogLeakyBucket)
361 || constraint.m_name.equals(kEnableAutoThrottling)) {
362 WTF_LOG(Media, "Obsolete constraint %s passed", constraint.m_name.ut f8().c_str());
jochen (gone - plz use gerrit) 2016/01/28 08:54:37 is it reasonable to log something to the console (
355 } else if (constraint.m_name.equals(kTestConstraint1) 363 } else if (constraint.m_name.equals(kTestConstraint1)
356 || constraint.m_name.equals(kTestConstraint2)) { 364 || constraint.m_name.equals(kTestConstraint2)) {
357 // These constraints are only for testing parsing. 365 // These constraints are only for testing parsing.
358 // Values 0 and 1 are legal, all others are a ConstraintError. 366 // Values 0 and 1 are legal, all others are a ConstraintError.
359 if (!constraint.m_value.equals("0") && !constraint.m_value.equals("1 ")) 367 if (!constraint.m_value.equals("0") && !constraint.m_value.equals("1 "))
360 errorState.throwConstraintError("Illegal value for constraint", constraint.m_name); 368 errorState.throwConstraintError("Illegal value for constraint", constraint.m_name);
361 } else { 369 } else {
362 // TODO(hta): UMA stats for unknown constraints passed. 370 // TODO(hta): UMA stats for unknown constraints passed.
363 // https://crbug.com/576613 371 // https://crbug.com/576613
364 WTF_LOG(Media, "Unknown constraint name detected"); 372 WTF_LOG(Media, "Unknown constraint name detected");
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 526
519 WebMediaConstraints create() 527 WebMediaConstraints create()
520 { 528 {
521 WebMediaConstraints constraints; 529 WebMediaConstraints constraints;
522 constraints.initialize(); 530 constraints.initialize();
523 return constraints; 531 return constraints;
524 } 532 }
525 533
526 } // namespace MediaConstraintsImpl 534 } // namespace MediaConstraintsImpl
527 } // namespace blink 535 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698