| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 */ | 26 */ |
| 27 | 27 |
| 28 #if !defined(__has_feature) || !__has_feature(objc_arc) | 28 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 29 #error "This file requires ARC support." | 29 #error "This file requires ARC support." |
| 30 #endif | 30 #endif |
| 31 | 31 |
| 32 #import "RTCMediaConstraints+Internal.h" | 32 #import "RTCMediaConstraints+Internal.h" |
| 33 | 33 |
| 34 #import "RTCPair.h" | 34 #import "RTCPair.h" |
| 35 | 35 |
| 36 #include "webrtc/base/scoped_ptr.h" | 36 #include <memory> |
| 37 | 37 |
| 38 // TODO(hughv): Add accessors for mandatory and optional constraints. | 38 // TODO(hughv): Add accessors for mandatory and optional constraints. |
| 39 // TODO(hughv): Add description. | 39 // TODO(hughv): Add description. |
| 40 | 40 |
| 41 @implementation RTCMediaConstraints { | 41 @implementation RTCMediaConstraints { |
| 42 rtc::scoped_ptr<webrtc::RTCMediaConstraintsNative> _constraints; | 42 std::unique_ptr<webrtc::RTCMediaConstraintsNative> _constraints; |
| 43 webrtc::MediaConstraintsInterface::Constraints _mandatory; | 43 webrtc::MediaConstraintsInterface::Constraints _mandatory; |
| 44 webrtc::MediaConstraintsInterface::Constraints _optional; | 44 webrtc::MediaConstraintsInterface::Constraints _optional; |
| 45 } | 45 } |
| 46 | 46 |
| 47 - (id)initWithMandatoryConstraints:(NSArray*)mandatory | 47 - (id)initWithMandatoryConstraints:(NSArray*)mandatory |
| 48 optionalConstraints:(NSArray*)optional { | 48 optionalConstraints:(NSArray*)optional { |
| 49 if ((self = [super init])) { | 49 if ((self = [super init])) { |
| 50 _mandatory = [[self class] constraintsFromArray:mandatory]; | 50 _mandatory = [[self class] constraintsFromArray:mandatory]; |
| 51 _optional = [[self class] constraintsFromArray:optional]; | 51 _optional = [[self class] constraintsFromArray:optional]; |
| 52 _constraints.reset( | 52 _constraints.reset( |
| (...skipping 14 matching lines...) Expand all Loading... |
| 67 | 67 |
| 68 @end | 68 @end |
| 69 | 69 |
| 70 @implementation RTCMediaConstraints (internal) | 70 @implementation RTCMediaConstraints (internal) |
| 71 | 71 |
| 72 - (const webrtc::RTCMediaConstraintsNative*)constraints { | 72 - (const webrtc::RTCMediaConstraintsNative*)constraints { |
| 73 return _constraints.get(); | 73 return _constraints.get(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 @end | 76 @end |
| OLD | NEW |