Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Side by Side Diff: talk/app/webrtc/objc/RTCVideoCapturer.mm

Issue 1937693002: Replace scoped_ptr with unique_ptr everywhere (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@unique5
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/api/quicdatachannel_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 25 matching lines...) Expand all
36 #include "webrtc/media/base/videocapturer.h" 36 #include "webrtc/media/base/videocapturer.h"
37 #include "webrtc/media/engine/webrtcvideocapturerfactory.h" 37 #include "webrtc/media/engine/webrtcvideocapturerfactory.h"
38 38
39 @implementation RTCVideoCapturer { 39 @implementation RTCVideoCapturer {
40 std::unique_ptr<cricket::VideoCapturer> _capturer; 40 std::unique_ptr<cricket::VideoCapturer> _capturer;
41 } 41 }
42 42
43 + (RTCVideoCapturer*)capturerWithDeviceName:(NSString*)deviceName { 43 + (RTCVideoCapturer*)capturerWithDeviceName:(NSString*)deviceName {
44 cricket::WebRtcVideoDeviceCapturerFactory factory; 44 cricket::WebRtcVideoDeviceCapturerFactory factory;
45 cricket::Device device(std::string(deviceName.UTF8String), 0); 45 cricket::Device device(std::string(deviceName.UTF8String), 0);
46 rtc::scoped_ptr<cricket::VideoCapturer> capturer(factory.Create(device)); 46 std::unique_ptr<cricket::VideoCapturer> capturer(factory.Create(device));
47 RTCVideoCapturer* rtcCapturer = 47 RTCVideoCapturer* rtcCapturer =
48 [[RTCVideoCapturer alloc] initWithCapturer:capturer.release()]; 48 [[RTCVideoCapturer alloc] initWithCapturer:capturer.release()];
49 return rtcCapturer; 49 return rtcCapturer;
50 } 50 }
51 51
52 @end 52 @end
53 53
54 @implementation RTCVideoCapturer (Internal) 54 @implementation RTCVideoCapturer (Internal)
55 55
56 - (id)initWithCapturer:(cricket::VideoCapturer*)capturer { 56 - (id)initWithCapturer:(cricket::VideoCapturer*)capturer {
57 if ((self = [super init])) { 57 if ((self = [super init])) {
58 _capturer.reset(capturer); 58 _capturer.reset(capturer);
59 } 59 }
60 return self; 60 return self;
61 } 61 }
62 62
63 - (cricket::VideoCapturer*)takeNativeCapturer { 63 - (cricket::VideoCapturer*)takeNativeCapturer {
64 return _capturer.release(); 64 return _capturer.release();
65 } 65 }
66 66
67 @end 67 @end
OLDNEW
« no previous file with comments | « no previous file | webrtc/api/quicdatachannel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698