| 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 25 matching lines...) Expand all Loading... |
| 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 |
| OLD | NEW |