| 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 |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 if (ioctl(_deviceFd, VIDIOC_S_FMT, &video_fmt) < 0) | 220 if (ioctl(_deviceFd, VIDIOC_S_FMT, &video_fmt) < 0) |
| 221 { | 221 { |
| 222 WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, 0, | 222 WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, 0, |
| 223 "error in VIDIOC_S_FMT, errno = %d", errno); | 223 "error in VIDIOC_S_FMT, errno = %d", errno); |
| 224 return -1; | 224 return -1; |
| 225 } | 225 } |
| 226 | 226 |
| 227 // initialize current width and height | 227 // initialize current width and height |
| 228 _currentWidth = video_fmt.fmt.pix.width; | 228 _currentWidth = video_fmt.fmt.pix.width; |
| 229 _currentHeight = video_fmt.fmt.pix.height; | 229 _currentHeight = video_fmt.fmt.pix.height; |
| 230 _captureDelay = 120; | |
| 231 | 230 |
| 232 // Trying to set frame rate, before check driver capability. | 231 // Trying to set frame rate, before check driver capability. |
| 233 bool driver_framerate_support = true; | 232 bool driver_framerate_support = true; |
| 234 struct v4l2_streamparm streamparms; | 233 struct v4l2_streamparm streamparms; |
| 235 memset(&streamparms, 0, sizeof(streamparms)); | 234 memset(&streamparms, 0, sizeof(streamparms)); |
| 236 streamparms.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; | 235 streamparms.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; |
| 237 if (ioctl(_deviceFd, VIDIOC_G_PARM, &streamparms) < 0) { | 236 if (ioctl(_deviceFd, VIDIOC_G_PARM, &streamparms) < 0) { |
| 238 WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, 0, | 237 WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, 0, |
| 239 "error in VIDIOC_G_PARM errno = %d", errno); | 238 "error in VIDIOC_G_PARM errno = %d", errno); |
| 240 driver_framerate_support = false; | 239 driver_framerate_support = false; |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 { | 478 { |
| 480 settings.width = _currentWidth; | 479 settings.width = _currentWidth; |
| 481 settings.height = _currentHeight; | 480 settings.height = _currentHeight; |
| 482 settings.maxFPS = _currentFrameRate; | 481 settings.maxFPS = _currentFrameRate; |
| 483 settings.rawType=_captureVideoType; | 482 settings.rawType=_captureVideoType; |
| 484 | 483 |
| 485 return 0; | 484 return 0; |
| 486 } | 485 } |
| 487 } // namespace videocapturemodule | 486 } // namespace videocapturemodule |
| 488 } // namespace webrtc | 487 } // namespace webrtc |
| OLD | NEW |