diff --git a/talk/app/webrtc/objc/RTCAVFoundationVideoSource.mm b/talk/app/webrtc/objc/RTCAVFoundationVideoSource.mm index 9d82283142..8b4e454a6e 100644 --- a/talk/app/webrtc/objc/RTCAVFoundationVideoSource.mm +++ b/talk/app/webrtc/objc/RTCAVFoundationVideoSource.mm @@ -32,12 +32,14 @@ #import "RTCPeerConnectionFactory+Internal.h" #import "RTCVideoSource+Internal.h" +#include + @implementation RTCAVFoundationVideoSource - (instancetype)initWithFactory:(RTCPeerConnectionFactory*)factory constraints:(RTCMediaConstraints*)constraints { NSParameterAssert(factory); - rtc::scoped_ptr capturer; + std::unique_ptr capturer; capturer.reset(new webrtc::AVFoundationVideoCapturer()); rtc::scoped_refptr source = factory.nativeFactory->CreateVideoSource(capturer.release(), constraints.constraints); diff --git a/talk/app/webrtc/objc/RTCDataChannel.mm b/talk/app/webrtc/objc/RTCDataChannel.mm index 00d51b10ee..114b916fb4 100644 --- a/talk/app/webrtc/objc/RTCDataChannel.mm +++ b/talk/app/webrtc/objc/RTCDataChannel.mm @@ -31,8 +31,9 @@ #import "RTCDataChannel+Internal.h" +#include + #include "webrtc/api/datachannelinterface.h" -#include "webrtc/base/scoped_ptr.h" namespace webrtc { @@ -146,7 +147,7 @@ std::string StdStringFromNSString(NSString* nsString) { @end @implementation RTCDataBuffer { - rtc::scoped_ptr _dataBuffer; + std::unique_ptr _dataBuffer; } - (instancetype)initWithData:(NSData*)data isBinary:(BOOL)isBinary { @@ -187,7 +188,7 @@ std::string StdStringFromNSString(NSString* nsString) { @implementation RTCDataChannel { rtc::scoped_refptr _dataChannel; - rtc::scoped_ptr _observer; + std::unique_ptr _observer; BOOL _isObserverRegistered; } diff --git a/talk/app/webrtc/objc/RTCI420Frame.mm b/talk/app/webrtc/objc/RTCI420Frame.mm index 0ce24a3495..d8be8ceed1 100644 --- a/talk/app/webrtc/objc/RTCI420Frame.mm +++ b/talk/app/webrtc/objc/RTCI420Frame.mm @@ -27,11 +27,12 @@ #import "RTCI420Frame.h" +#include + #include "webrtc/media/base/videoframe.h" -#include "webrtc/base/scoped_ptr.h" @implementation RTCI420Frame { - rtc::scoped_ptr _videoFrame; + std::unique_ptr _videoFrame; } - (NSUInteger)width { diff --git a/talk/app/webrtc/objc/RTCMediaConstraints.mm b/talk/app/webrtc/objc/RTCMediaConstraints.mm index f5cfe33619..a79afb1794 100644 --- a/talk/app/webrtc/objc/RTCMediaConstraints.mm +++ b/talk/app/webrtc/objc/RTCMediaConstraints.mm @@ -33,13 +33,13 @@ #import "RTCPair.h" -#include "webrtc/base/scoped_ptr.h" +#include // TODO(hughv): Add accessors for mandatory and optional constraints. // TODO(hughv): Add description. @implementation RTCMediaConstraints { - rtc::scoped_ptr _constraints; + std::unique_ptr _constraints; webrtc::MediaConstraintsInterface::Constraints _mandatory; webrtc::MediaConstraintsInterface::Constraints _optional; } diff --git a/talk/app/webrtc/objc/RTCMediaStreamTrack.mm b/talk/app/webrtc/objc/RTCMediaStreamTrack.mm index c529f5a4b2..e0d5cae9da 100644 --- a/talk/app/webrtc/objc/RTCMediaStreamTrack.mm +++ b/talk/app/webrtc/objc/RTCMediaStreamTrack.mm @@ -32,6 +32,8 @@ #import "RTCEnumConverter.h" #import "RTCMediaStreamTrack+Internal.h" +#include + namespace webrtc { class RTCMediaStreamTrackObserver : public ObserverInterface { @@ -49,7 +51,7 @@ class RTCMediaStreamTrackObserver : public ObserverInterface { @implementation RTCMediaStreamTrack { rtc::scoped_refptr _mediaTrack; - rtc::scoped_ptr _observer; + std::unique_ptr _observer; } @synthesize label; diff --git a/talk/app/webrtc/objc/RTCOpenGLVideoRenderer.mm b/talk/app/webrtc/objc/RTCOpenGLVideoRenderer.mm index cfead91bca..b0f1b80cc0 100644 --- a/talk/app/webrtc/objc/RTCOpenGLVideoRenderer.mm +++ b/talk/app/webrtc/objc/RTCOpenGLVideoRenderer.mm @@ -33,7 +33,7 @@ #include -#include "webrtc/base/scoped_ptr.h" +#include #if TARGET_OS_IPHONE #import @@ -184,7 +184,7 @@ static const GLsizei kNumTextures = 3 * kNumTextureSets; GLint _vSampler; // Used to create a non-padded plane for GPU upload when we receive padded // frames. - rtc::scoped_ptr _planeBuffer; + std::unique_ptr _planeBuffer; } + (void)initialize { diff --git a/talk/app/webrtc/objc/RTCPeerConnection.mm b/talk/app/webrtc/objc/RTCPeerConnection.mm index 0ec61814f3..da092c8026 100644 --- a/talk/app/webrtc/objc/RTCPeerConnection.mm +++ b/talk/app/webrtc/objc/RTCPeerConnection.mm @@ -45,6 +45,8 @@ #import "RTCStatsDelegate.h" #import "RTCStatsReport+Internal.h" +#include + #include "webrtc/api/jsep.h" NSString* const kRTCSessionDescriptionDelegateErrorDomain = @"RTCSDPError"; @@ -141,12 +143,12 @@ class RTCStatsObserver : public StatsObserver { @implementation RTCPeerConnection { NSMutableArray* _localStreams; - rtc::scoped_ptr _observer; + std::unique_ptr _observer; rtc::scoped_refptr _peerConnection; } - (BOOL)addICECandidate:(RTCICECandidate*)candidate { - rtc::scoped_ptr iceCandidate( + std::unique_ptr iceCandidate( candidate.candidate); return self.peerConnection->AddIceCandidate(iceCandidate.get()); } diff --git a/talk/app/webrtc/objc/RTCPeerConnectionFactory+Internal.h b/talk/app/webrtc/objc/RTCPeerConnectionFactory+Internal.h index d7dd3e551d..113327b7a4 100644 --- a/talk/app/webrtc/objc/RTCPeerConnectionFactory+Internal.h +++ b/talk/app/webrtc/objc/RTCPeerConnectionFactory+Internal.h @@ -28,7 +28,6 @@ #import "RTCPeerConnectionFactory.h" #include "webrtc/api/peerconnectionfactory.h" -#include "webrtc/base/scoped_ptr.h" @interface RTCPeerConnectionFactory () diff --git a/talk/app/webrtc/objc/RTCPeerConnectionFactory.mm b/talk/app/webrtc/objc/RTCPeerConnectionFactory.mm index a60263a12f..cd81f35e2a 100644 --- a/talk/app/webrtc/objc/RTCPeerConnectionFactory.mm +++ b/talk/app/webrtc/objc/RTCPeerConnectionFactory.mm @@ -31,6 +31,7 @@ #import "RTCPeerConnectionFactory+Internal.h" +#include #include #import "RTCAudioTrack+Internal.h" @@ -55,8 +56,8 @@ #include "webrtc/base/ssladapter.h" @implementation RTCPeerConnectionFactory { - rtc::scoped_ptr _signalingThread; - rtc::scoped_ptr _workerThread; + std::unique_ptr _signalingThread; + std::unique_ptr _workerThread; } @synthesize nativeFactory = _nativeFactory; diff --git a/talk/app/webrtc/objc/RTCPeerConnectionInterface.mm b/talk/app/webrtc/objc/RTCPeerConnectionInterface.mm index 8cbb588351..0d8c3aec52 100644 --- a/talk/app/webrtc/objc/RTCPeerConnectionInterface.mm +++ b/talk/app/webrtc/objc/RTCPeerConnectionInterface.mm @@ -31,6 +31,8 @@ #import "talk/app/webrtc/objc/RTCICEServer+Internal.h" #import "talk/app/webrtc/objc/public/RTCLogging.h" +#include + @implementation RTCConfiguration @synthesize iceTransportsType = _iceTransportsType; @@ -95,11 +97,12 @@ nativeConfig.ice_connection_receiving_timeout = _iceConnectionReceivingTimeout; nativeConfig.ice_backup_candidate_pair_ping_interval = _iceBackupCandidatePairPingInterval; if (_keyType == kRTCEncryptionKeyTypeECDSA) { - rtc::scoped_ptr identity( + std::unique_ptr identity( rtc::SSLIdentity::Generate(webrtc::kIdentityName, rtc::KT_ECDSA)); if (identity) { nativeConfig.certificates.push_back( - rtc::RTCCertificate::Create(std::move(identity))); + rtc::RTCCertificate::Create( + rtc::UniqueToScoped(std::move(identity)))); } else { RTCLogWarning(@"Failed to generate ECDSA identity. RSA will be used."); } diff --git a/talk/app/webrtc/objc/RTCVideoCapturer.mm b/talk/app/webrtc/objc/RTCVideoCapturer.mm index 2ce01f53a3..50e1cef4a0 100644 --- a/talk/app/webrtc/objc/RTCVideoCapturer.mm +++ b/talk/app/webrtc/objc/RTCVideoCapturer.mm @@ -31,16 +31,18 @@ #import "RTCVideoCapturer+Internal.h" +#include + #include "webrtc/media/base/videocapturer.h" #include "webrtc/media/devices/devicemanager.h" @implementation RTCVideoCapturer { - rtc::scoped_ptr _capturer; + std::unique_ptr _capturer; } + (RTCVideoCapturer*)capturerWithDeviceName:(NSString*)deviceName { const std::string& device_name = std::string([deviceName UTF8String]); - rtc::scoped_ptr device_manager( + std::unique_ptr device_manager( cricket::DeviceManagerFactory::Create()); bool initialized = device_manager->Init(); NSAssert(initialized, @"DeviceManager::Init() failed"); @@ -49,7 +51,7 @@ LOG(LS_ERROR) << "GetVideoCaptureDevice failed"; return 0; } - rtc::scoped_ptr capturer( + std::unique_ptr capturer( device_manager->CreateVideoCapturer(device)); RTCVideoCapturer* rtcCapturer = [[RTCVideoCapturer alloc] initWithCapturer:capturer.release()]; diff --git a/talk/app/webrtc/objc/RTCVideoRendererAdapter.mm b/talk/app/webrtc/objc/RTCVideoRendererAdapter.mm index e601420121..b0b21291b9 100644 --- a/talk/app/webrtc/objc/RTCVideoRendererAdapter.mm +++ b/talk/app/webrtc/objc/RTCVideoRendererAdapter.mm @@ -32,6 +32,8 @@ #import "RTCI420Frame+Internal.h" #import "RTCVideoRendererAdapter.h" +#include + namespace webrtc { class RTCVideoRendererNativeAdapter : public VideoRendererInterface { @@ -60,7 +62,7 @@ class RTCVideoRendererNativeAdapter : public VideoRendererInterface { @implementation RTCVideoRendererAdapter { id _videoRenderer; - rtc::scoped_ptr _adapter; + std::unique_ptr _adapter; } - (instancetype)initWithVideoRenderer:(id)videoRenderer { diff --git a/talk/app/webrtc/objc/avfoundationvideocapturer.h b/talk/app/webrtc/objc/avfoundationvideocapturer.h index b496f69629..adf7b2816c 100644 --- a/talk/app/webrtc/objc/avfoundationvideocapturer.h +++ b/talk/app/webrtc/objc/avfoundationvideocapturer.h @@ -28,7 +28,6 @@ #ifndef TALK_APP_WEBRTC_OBJC_AVFOUNDATION_VIDEO_CAPTURER_H_ #define TALK_APP_WEBRTC_OBJC_AVFOUNDATION_VIDEO_CAPTURER_H_ -#include "webrtc/base/scoped_ptr.h" #include "webrtc/media/base/videocapturer.h" #include "webrtc/video_frame.h"