video_capture_factory.cc (1972B)
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 "modules/video_capture/video_capture_factory.h" 12 13 #include "api/scoped_refptr.h" 14 #include "modules/video_capture/video_capture.h" 15 #include "modules/video_capture/video_capture_impl.h" 16 #include "system_wrappers/include/clock.h" 17 18 namespace webrtc { 19 20 scoped_refptr<VideoCaptureModule> VideoCaptureFactory::Create( 21 [[maybe_unused]] const char* deviceUniqueIdUTF8) { 22 return videocapturemodule::VideoCaptureImpl::Create( 23 Clock::GetRealTimeClockRaw(), deviceUniqueIdUTF8); 24 } 25 26 scoped_refptr<VideoCaptureModule> VideoCaptureFactory::Create( 27 [[maybe_unused]] VideoCaptureOptions* options, 28 [[maybe_unused]] const char* deviceUniqueIdUTF8) { 29 // This is only implemented on pure Linux and WEBRTC_LINUX is defined for 30 // Android as well 31 #if (!defined(WEBRTC_LINUX) && !defined(WEBRTC_BSD)) || defined(WEBRTC_ANDROID) 32 return nullptr; 33 #else 34 return videocapturemodule::VideoCaptureImpl::Create( 35 Clock::GetRealTimeClockRaw(), options, deviceUniqueIdUTF8); 36 #endif 37 } 38 39 VideoCaptureModule::DeviceInfo* VideoCaptureFactory::CreateDeviceInfo() { 40 return videocapturemodule::VideoCaptureImpl::CreateDeviceInfo(); 41 } 42 43 VideoCaptureModule::DeviceInfo* VideoCaptureFactory::CreateDeviceInfo( 44 [[maybe_unused]] VideoCaptureOptions* options) { 45 // This is only implemented on pure Linux and WEBRTC_LINUX is defined for 46 // Android as well 47 #if (!defined(WEBRTC_LINUX) && !defined(WEBRTC_BSD)) || defined(WEBRTC_ANDROID) 48 return nullptr; 49 #else 50 return videocapturemodule::VideoCaptureImpl::CreateDeviceInfo(options); 51 #endif 52 } 53 54 } // namespace webrtc