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