| 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 <errno.h> | 11 #include <errno.h> |
| 12 #include <fcntl.h> | 12 #include <fcntl.h> |
| 13 #include <linux/videodev2.h> | 13 #include <linux/videodev2.h> |
| 14 #include <stdio.h> | 14 #include <stdio.h> |
| 15 #include <string.h> | 15 #include <string.h> |
| 16 #include <sys/ioctl.h> | 16 #include <sys/ioctl.h> |
| 17 #include <sys/mman.h> | 17 #include <sys/mman.h> |
| 18 #include <sys/stat.h> | 18 #include <sys/stat.h> |
| 19 #include <unistd.h> | 19 #include <unistd.h> |
| 20 | 20 |
| 21 #include <iostream> | 21 #include <iostream> |
| 22 #include <new> | 22 #include <new> |
| 23 | 23 |
| 24 #include "webrtc/base/refcount.h" | |
| 25 #include "webrtc/base/scoped_ref_ptr.h" | |
| 26 #include "webrtc/modules/video_capture/linux/video_capture_linux.h" | 24 #include "webrtc/modules/video_capture/linux/video_capture_linux.h" |
| 25 #include "webrtc/rtc_base/refcount.h" |
| 26 #include "webrtc/rtc_base/scoped_ref_ptr.h" |
| 27 #include "webrtc/system_wrappers/include/trace.h" | 27 #include "webrtc/system_wrappers/include/trace.h" |
| 28 | 28 |
| 29 namespace webrtc { | 29 namespace webrtc { |
| 30 namespace videocapturemodule { | 30 namespace videocapturemodule { |
| 31 rtc::scoped_refptr<VideoCaptureModule> VideoCaptureImpl::Create( | 31 rtc::scoped_refptr<VideoCaptureModule> VideoCaptureImpl::Create( |
| 32 const char* deviceUniqueId) { | 32 const char* deviceUniqueId) { |
| 33 rtc::scoped_refptr<VideoCaptureModuleV4L2> implementation( | 33 rtc::scoped_refptr<VideoCaptureModuleV4L2> implementation( |
| 34 new rtc::RefCountedObject<VideoCaptureModuleV4L2>()); | 34 new rtc::RefCountedObject<VideoCaptureModuleV4L2>()); |
| 35 | 35 |
| 36 if (implementation->Init(deviceUniqueId) != 0) | 36 if (implementation->Init(deviceUniqueId) != 0) |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 { | 464 { |
| 465 settings.width = _currentWidth; | 465 settings.width = _currentWidth; |
| 466 settings.height = _currentHeight; | 466 settings.height = _currentHeight; |
| 467 settings.maxFPS = _currentFrameRate; | 467 settings.maxFPS = _currentFrameRate; |
| 468 settings.videoType = _captureVideoType; | 468 settings.videoType = _captureVideoType; |
| 469 | 469 |
| 470 return 0; | 470 return 0; |
| 471 } | 471 } |
| 472 } // namespace videocapturemodule | 472 } // namespace videocapturemodule |
| 473 } // namespace webrtc | 473 } // namespace webrtc |
| OLD | NEW |