| 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 "content/renderer/media/media_stream_video_source.h" | 5 #include "content/renderer/media/media_stream_video_source.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
| 14 #include "base/trace_event/trace_event.h" | 14 #include "base/trace_event/trace_event.h" |
| 15 #include "content/child/child_process.h" | 15 #include "content/child/child_process.h" |
| 16 #include "content/renderer/media/media_stream_video_track.h" | 16 #include "content/renderer/media/media_stream_video_track.h" |
| 17 #include "content/renderer/media/video_track_adapter.h" | 17 #include "content/renderer/media/video_track_adapter.h" |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 const char* const kLegalVideoConstraints[] = { | 23 const char* const kLegalVideoConstraints[] = {"width", |
| 24 "width", "height", "aspectRatio", "frameRate", | 24 "height", |
| 25 "facingMode", "deviceId", "groupId", "mediaStreamSource", | 25 "aspectRatio", |
| 26 }; | 26 "frameRate", |
| 27 "facingMode", |
| 28 "deviceId", |
| 29 "groupId", |
| 30 "mediaStreamSource", |
| 31 "googNoiseReduction"}; |
| 27 | 32 |
| 28 // Returns true if |constraint| has mandatory constraints. | 33 // Returns true if |constraint| has mandatory constraints. |
| 29 bool HasMandatoryConstraints(const blink::WebMediaConstraints& constraints) { | 34 bool HasMandatoryConstraints(const blink::WebMediaConstraints& constraints) { |
| 30 return constraints.basic().hasMandatory(); | 35 return constraints.basic().hasMandatory(); |
| 31 } | 36 } |
| 32 | 37 |
| 33 // Retrieve the desired max width and height from |constraints|. If not set, | 38 // Retrieve the desired max width and height from |constraints|. If not set, |
| 34 // the |desired_width| and |desired_height| are set to | 39 // the |desired_width| and |desired_height| are set to |
| 35 // std::numeric_limits<int>::max(); | 40 // std::numeric_limits<int>::max(); |
| 36 // If either max or exact width or height is set as a mandatory constraint, | 41 // If either max or exact width or height is set as a mandatory constraint, |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 callback(callback) { | 610 callback(callback) { |
| 606 } | 611 } |
| 607 | 612 |
| 608 MediaStreamVideoSource::TrackDescriptor::TrackDescriptor( | 613 MediaStreamVideoSource::TrackDescriptor::TrackDescriptor( |
| 609 const TrackDescriptor& other) = default; | 614 const TrackDescriptor& other) = default; |
| 610 | 615 |
| 611 MediaStreamVideoSource::TrackDescriptor::~TrackDescriptor() { | 616 MediaStreamVideoSource::TrackDescriptor::~TrackDescriptor() { |
| 612 } | 617 } |
| 613 | 618 |
| 614 } // namespace content | 619 } // namespace content |
| OLD | NEW |