| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_RENDERER_MEDIA_RTC_MEDIA_CONSTRAINTS_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_RTC_MEDIA_CONSTRAINTS_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_RTC_MEDIA_CONSTRAINTS_H_ | 6 #define CONTENT_RENDERER_MEDIA_RTC_MEDIA_CONSTRAINTS_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "content/common/content_export.h" |
| 9 #include "third_party/libjingle/source/talk/app/webrtc/mediaconstraintsinterface
.h" | 10 #include "third_party/libjingle/source/talk/app/webrtc/mediaconstraintsinterface
.h" |
| 10 | 11 |
| 11 namespace WebKit { | 12 namespace WebKit { |
| 12 class WebMediaConstraints; | 13 class WebMediaConstraints; |
| 13 } | 14 } |
| 14 | 15 |
| 15 namespace content { | 16 namespace content { |
| 16 | 17 |
| 17 // RTCMediaConstraints acts as a glue layer between WebKits MediaConstraints and | 18 // RTCMediaConstraints acts as a glue layer between WebKits MediaConstraints and |
| 18 // libjingle webrtc::MediaConstraintsInterface. | 19 // libjingle webrtc::MediaConstraintsInterface. |
| 19 // Constraints are used by PeerConnection and getUserMedia API calls. | 20 // Constraints are used by PeerConnection and getUserMedia API calls. |
| 20 class RTCMediaConstraints : public webrtc::MediaConstraintsInterface { | 21 class CONTENT_EXPORT RTCMediaConstraints |
| 22 : public NON_EXPORTED_BASE(webrtc::MediaConstraintsInterface) { |
| 21 public: | 23 public: |
| 24 RTCMediaConstraints(); |
| 22 explicit RTCMediaConstraints( | 25 explicit RTCMediaConstraints( |
| 23 const WebKit::WebMediaConstraints& constraints); | 26 const WebKit::WebMediaConstraints& constraints); |
| 24 virtual ~RTCMediaConstraints(); | 27 virtual ~RTCMediaConstraints(); |
| 25 virtual const Constraints& GetMandatory() const OVERRIDE; | 28 virtual const Constraints& GetMandatory() const OVERRIDE; |
| 26 virtual const Constraints& GetOptional() const OVERRIDE; | 29 virtual const Constraints& GetOptional() const OVERRIDE; |
| 27 void AddOptional(const std::string& key, const std::string& value); | 30 void AddOptional(const std::string& key, const std::string& value); |
| 31 // Adds a mandatory constraint, optionally overriding an existing one. |
| 32 // If the constraint is already set and |override_if_exists| is false, |
| 33 // the function will return false, otherwise true. |
| 34 bool AddMandatory(const std::string& key, const std::string& value, |
| 35 bool override_if_exists); |
| 28 | 36 |
| 29 protected: | 37 protected: |
| 30 Constraints mandatory_; | 38 Constraints mandatory_; |
| 31 Constraints optional_; | 39 Constraints optional_; |
| 32 }; | 40 }; |
| 33 | 41 |
| 34 } // namespace content | 42 } // namespace content |
| 35 | 43 |
| 36 | 44 |
| 37 #endif // CONTENT_RENDERER_MEDIA_RTC_MEDIA_CONSTRAINTS_H_ | 45 #endif // CONTENT_RENDERER_MEDIA_RTC_MEDIA_CONSTRAINTS_H_ |
| OLD | NEW |