| Index: webrtc/modules/video_capture/windows/video_capture_factory_windows.cc
|
| diff --git a/webrtc/modules/video_capture/windows/video_capture_factory_windows.cc b/webrtc/modules/video_capture/windows/video_capture_factory_windows.cc
|
| index 747d3d60cfc719e0d44807574fbad1e44cce0ea9..0d347cb64f428e43d0952ca9e06a9b2753bac28a 100644
|
| --- a/webrtc/modules/video_capture/windows/video_capture_factory_windows.cc
|
| +++ b/webrtc/modules/video_capture/windows/video_capture_factory_windows.cc
|
| @@ -8,9 +8,10 @@
|
| * be found in the AUTHORS file in the root of the source tree.
|
| */
|
|
|
| +#include "webrtc/base/refcount.h"
|
| +#include "webrtc/base/scoped_ref_ptr.h"
|
| #include "webrtc/modules/video_capture/windows/video_capture_ds.h"
|
| #include "webrtc/modules/video_capture/windows/video_capture_mf.h"
|
| -#include "webrtc/system_wrappers/include/ref_count.h"
|
|
|
| namespace webrtc {
|
| namespace videocapturemodule {
|
| @@ -22,16 +23,17 @@ VideoCaptureModule::DeviceInfo* VideoCaptureImpl::CreateDeviceInfo(
|
| return DeviceInfoDS::Create(id);
|
| }
|
|
|
| -VideoCaptureModule* VideoCaptureImpl::Create(const int32_t id,
|
| - const char* device_id) {
|
| - if (device_id == NULL)
|
| - return NULL;
|
| +rtc::scoped_refptr<VideoCaptureModule> VideoCaptureImpl::Create(
|
| + const int32_t id,
|
| + const char* device_id) {
|
| + if (device_id == nullptr)
|
| + return nullptr;
|
|
|
| // TODO(tommi): Use Media Foundation implementation for Vista and up.
|
| - RefCountImpl<VideoCaptureDS>* capture = new RefCountImpl<VideoCaptureDS>(id);
|
| + rtc::scoped_refptr<VideoCaptureDS> capture(
|
| + new rtc::RefCountedObject<VideoCaptureDS>(id));
|
| if (capture->Init(id, device_id) != 0) {
|
| - delete capture;
|
| - capture = NULL;
|
| + return nullptr;
|
| }
|
|
|
| return capture;
|
|
|