| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #include "webrtc/base/refcount.h" | 11 #include "webrtc/base/refcount.h" |
| 12 #include "webrtc/base/scoped_ref_ptr.h" | 12 #include "webrtc/base/scoped_ref_ptr.h" |
| 13 #include "webrtc/modules/video_capture/windows/video_capture_ds.h" | 13 #include "webrtc/modules/video_capture/windows/video_capture_ds.h" |
| 14 #include "webrtc/modules/video_capture/windows/video_capture_mf.h" | 14 #include "webrtc/modules/video_capture/windows/video_capture_mf.h" |
| 15 | 15 |
| 16 namespace webrtc { | 16 namespace webrtc { |
| 17 namespace videocapturemodule { | 17 namespace videocapturemodule { |
| 18 | 18 |
| 19 // static | 19 // static |
| 20 VideoCaptureModule::DeviceInfo* VideoCaptureImpl::CreateDeviceInfo( | 20 VideoCaptureModule::DeviceInfo* VideoCaptureImpl::CreateDeviceInfo() { |
| 21 const int32_t id) { | |
| 22 // TODO(tommi): Use the Media Foundation version on Vista and up. | 21 // TODO(tommi): Use the Media Foundation version on Vista and up. |
| 23 return DeviceInfoDS::Create(id); | 22 return DeviceInfoDS::Create(); |
| 24 } | 23 } |
| 25 | 24 |
| 26 rtc::scoped_refptr<VideoCaptureModule> VideoCaptureImpl::Create( | 25 rtc::scoped_refptr<VideoCaptureModule> VideoCaptureImpl::Create( |
| 27 const int32_t id, | |
| 28 const char* device_id) { | 26 const char* device_id) { |
| 29 if (device_id == nullptr) | 27 if (device_id == nullptr) |
| 30 return nullptr; | 28 return nullptr; |
| 31 | 29 |
| 32 // TODO(tommi): Use Media Foundation implementation for Vista and up. | 30 // TODO(tommi): Use Media Foundation implementation for Vista and up. |
| 33 rtc::scoped_refptr<VideoCaptureDS> capture( | 31 rtc::scoped_refptr<VideoCaptureDS> capture( |
| 34 new rtc::RefCountedObject<VideoCaptureDS>(id)); | 32 new rtc::RefCountedObject<VideoCaptureDS>()); |
| 35 if (capture->Init(id, device_id) != 0) { | 33 if (capture->Init(device_id) != 0) { |
| 36 return nullptr; | 34 return nullptr; |
| 37 } | 35 } |
| 38 | 36 |
| 39 return capture; | 37 return capture; |
| 40 } | 38 } |
| 41 | 39 |
| 42 } // namespace videocapturemodule | 40 } // namespace videocapturemodule |
| 43 } // namespace webrtc | 41 } // namespace webrtc |
| OLD | NEW |