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

Side by Side Diff: content/renderer/media/media_stream_constraints_util_video_content.cc

Issue 2750163002: Use spec-compliant algorithm for video content-capture deviceId selection in getUserMedia. (Closed)
Patch Set: address review comments and rebase Created 3 years, 9 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "content/renderer/media/media_stream_constraints_util_video_content.h" 5 #include "content/renderer/media/media_stream_constraints_util_video_content.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 } else { 245 } else {
246 DCHECK(candidates.device_id_set.IsEmpty()); 246 DCHECK(candidates.device_id_set.IsEmpty());
247 return VideoContentCaptureSourceSelectionResult( 247 return VideoContentCaptureSourceSelectionResult(
248 constraint_set.deviceId.name()); 248 constraint_set.deviceId.name());
249 } 249 }
250 } 250 }
251 251
252 } // namespace 252 } // namespace
253 253
254 VideoContentCaptureSourceSelectionResult:: 254 VideoContentCaptureSourceSelectionResult::
255 VideoContentCaptureSourceSelectionResult()
256 : VideoContentCaptureSourceSelectionResult("") {}
257
258 VideoContentCaptureSourceSelectionResult::
255 VideoContentCaptureSourceSelectionResult(const char* failed_constraint_name) 259 VideoContentCaptureSourceSelectionResult(const char* failed_constraint_name)
256 : failed_constraint_name_(failed_constraint_name) {} 260 : failed_constraint_name_(failed_constraint_name) {}
257 261
258 VideoContentCaptureSourceSelectionResult:: 262 VideoContentCaptureSourceSelectionResult::
259 VideoContentCaptureSourceSelectionResult( 263 VideoContentCaptureSourceSelectionResult(
260 std::string device_id, 264 std::string device_id,
261 const rtc::Optional<bool>& noise_reduction, 265 const rtc::Optional<bool>& noise_reduction,
262 media::VideoCaptureParams capture_params) 266 media::VideoCaptureParams capture_params)
263 : failed_constraint_name_(nullptr), 267 : failed_constraint_name_(nullptr),
264 device_id_(std::move(device_id)), 268 device_id_(std::move(device_id)),
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 candidates.Intersection(advanced_candidates); 326 candidates.Intersection(advanced_candidates);
323 if (!intersection.IsEmpty()) 327 if (!intersection.IsEmpty())
324 candidates = std::move(intersection); 328 candidates = std::move(intersection);
325 } 329 }
326 330
327 DCHECK(!candidates.IsEmpty()); 331 DCHECK(!candidates.IsEmpty());
328 return SelectResultFromCandidates(candidates, constraints.basic()); 332 return SelectResultFromCandidates(candidates, constraints.basic());
329 } 333 }
330 334
331 } // namespace content 335 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/media_stream_constraints_util_video_content.h ('k') | content/renderer/media/user_media_client_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698