| Index: webrtc/modules/video_capture/linux/video_capture_linux.cc
|
| diff --git a/webrtc/modules/video_capture/linux/video_capture_linux.cc b/webrtc/modules/video_capture/linux/video_capture_linux.cc
|
| index 13149dcafcd705637d04c3b0bbf8aabc1502904c..cee1355c0908f09227660ed1a844ef22bae13c7a 100644
|
| --- a/webrtc/modules/video_capture/linux/video_capture_linux.cc
|
| +++ b/webrtc/modules/video_capture/linux/video_capture_linux.cc
|
| @@ -21,26 +21,22 @@
|
| #include <iostream>
|
| #include <new>
|
|
|
| +#include "webrtc/base/refcount.h"
|
| +#include "webrtc/base/scoped_ref_ptr.h"
|
| #include "webrtc/modules/video_capture/linux/video_capture_linux.h"
|
| #include "webrtc/system_wrappers/include/critical_section_wrapper.h"
|
| -#include "webrtc/system_wrappers/include/ref_count.h"
|
| #include "webrtc/system_wrappers/include/trace.h"
|
|
|
| -namespace webrtc
|
| -{
|
| -namespace videocapturemodule
|
| -{
|
| -VideoCaptureModule* VideoCaptureImpl::Create(const int32_t id,
|
| - const char* deviceUniqueId)
|
| -{
|
| - RefCountImpl<videocapturemodule::VideoCaptureModuleV4L2>* implementation =
|
| - new RefCountImpl<videocapturemodule::VideoCaptureModuleV4L2>(id);
|
| +namespace webrtc {
|
| +namespace videocapturemodule {
|
| +rtc::scoped_refptr<VideoCaptureModule> VideoCaptureImpl::Create(
|
| + const int32_t id,
|
| + const char* deviceUniqueId) {
|
| + rtc::scoped_refptr<VideoCaptureModuleV4L2> implementation(
|
| + new rtc::RefCountedObject<VideoCaptureModuleV4L2>(id));
|
|
|
| - if (!implementation || implementation->Init(deviceUniqueId) != 0)
|
| - {
|
| - delete implementation;
|
| - implementation = NULL;
|
| - }
|
| + if (implementation->Init(deviceUniqueId) != 0)
|
| + return nullptr;
|
|
|
| return implementation;
|
| }
|
|
|