OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 const MediaConstraintsInterface::Constraints& | 32 const MediaConstraintsInterface::Constraints& |
33 MediaConstraints::GetOptional() const { | 33 MediaConstraints::GetOptional() const { |
34 return optional_; | 34 return optional_; |
35 } | 35 } |
36 | 36 |
37 } // namespace webrtc | 37 } // namespace webrtc |
38 | 38 |
39 | 39 |
40 @implementation RTCMediaConstraints { | 40 @implementation RTCMediaConstraints { |
41 NSDictionary<NSString *, NSString *> *_mandatory; | 41 NSDictionary/*<NSString *, NSString *>*/ *_mandatory; |
42 NSDictionary<NSString *, NSString *> *_optional; | 42 NSDictionary/*<NSString *, NSString *>*/ *_optional; |
43 } | 43 } |
44 | 44 |
45 - (instancetype)initWithMandatoryConstraints: | 45 - (instancetype)initWithMandatoryConstraints: |
46 (NSDictionary<NSString *, NSString *> *)mandatory | 46 (NSDictionary/*<NSString *, NSString *>*/ *)mandatory |
47 optionalConstraints: | 47 optionalConstraints: |
48 (NSDictionary<NSString *, NSString *> *)optional { | 48 (NSDictionary/*<NSString *, NSString *>*/ *)optional { |
49 if (self = [super init]) { | 49 if (self = [super init]) { |
50 _mandatory = [[NSDictionary alloc] initWithDictionary:mandatory | 50 _mandatory = [[NSDictionary alloc] initWithDictionary:mandatory |
51 copyItems:YES]; | 51 copyItems:YES]; |
52 _optional = [[NSDictionary alloc] initWithDictionary:optional | 52 _optional = [[NSDictionary alloc] initWithDictionary:optional |
53 copyItems:YES]; | 53 copyItems:YES]; |
54 } | 54 } |
55 return self; | 55 return self; |
56 } | 56 } |
57 | 57 |
58 - (NSString *)description { | 58 - (NSString *)description { |
(...skipping 10 matching lines...) Expand all Loading... |
69 webrtc::MediaConstraintsInterface::Constraints optional = | 69 webrtc::MediaConstraintsInterface::Constraints optional = |
70 [[self class] nativeConstraintsForConstraints:_optional]; | 70 [[self class] nativeConstraintsForConstraints:_optional]; |
71 | 71 |
72 webrtc::MediaConstraints *nativeConstraints = | 72 webrtc::MediaConstraints *nativeConstraints = |
73 new webrtc::MediaConstraints(mandatory, optional); | 73 new webrtc::MediaConstraints(mandatory, optional); |
74 return rtc::scoped_ptr<webrtc::MediaConstraints>(nativeConstraints); | 74 return rtc::scoped_ptr<webrtc::MediaConstraints>(nativeConstraints); |
75 } | 75 } |
76 | 76 |
77 + (webrtc::MediaConstraintsInterface::Constraints) | 77 + (webrtc::MediaConstraintsInterface::Constraints) |
78 nativeConstraintsForConstraints: | 78 nativeConstraintsForConstraints: |
79 (NSDictionary<NSString *, NSString *> *)constraints { | 79 (NSDictionary/*<NSString *, NSString *>*/ *)constraints { |
80 webrtc::MediaConstraintsInterface::Constraints nativeConstraints; | 80 webrtc::MediaConstraintsInterface::Constraints nativeConstraints; |
81 for (NSString *key in constraints) { | 81 for (NSString *key in constraints) { |
82 NSAssert([key isKindOfClass:[NSString class]], | 82 NSAssert([key isKindOfClass:[NSString class]], |
83 @"%@ is not an NSString.", key); | 83 @"%@ is not an NSString.", key); |
84 NSAssert([constraints[key] isKindOfClass:[NSString class]], | 84 NSString *value = [constraints objectForKey:key]; |
85 @"%@ is not an NSString.", constraints[key]); | 85 NSAssert([value isKindOfClass:[NSString class]], |
| 86 @"%@ is not an NSString.", value); |
86 nativeConstraints.push_back(webrtc::MediaConstraintsInterface::Constraint( | 87 nativeConstraints.push_back(webrtc::MediaConstraintsInterface::Constraint( |
87 key.stdString, constraints[key].stdString)); | 88 key.stdString, value.stdString)); |
88 } | 89 } |
89 return nativeConstraints; | 90 return nativeConstraints; |
90 } | 91 } |
91 | 92 |
92 @end | 93 @end |
OLD | NEW |