| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/video/capture/linux/video_capture_device_linux.h" | 5 #include "media/video/capture/linux/video_capture_device_linux.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #if defined(OS_OPENBSD) | 9 #if defined(OS_OPENBSD) |
| 10 #include <sys/videoio.h> | 10 #include <sys/videoio.h> |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 // Check if the thread is running. | 166 // Check if the thread is running. |
| 167 // This means that the device have not been DeAllocated properly. | 167 // This means that the device have not been DeAllocated properly. |
| 168 DCHECK(!v4l2_thread_.IsRunning()); | 168 DCHECK(!v4l2_thread_.IsRunning()); |
| 169 | 169 |
| 170 v4l2_thread_.Stop(); | 170 v4l2_thread_.Stop(); |
| 171 if (device_fd_ >= 0) { | 171 if (device_fd_ >= 0) { |
| 172 close(device_fd_); | 172 close(device_fd_); |
| 173 } | 173 } |
| 174 } | 174 } |
| 175 | 175 |
| 176 VideoEncodingCapability VideoCaptureDeviceLinux::GetEncodingCapability() { |
| 177 return VideoEncodingCapability(); |
| 178 } |
| 179 |
| 180 void VideoCaptureDeviceLinux::TryConfigureEncodedBitstream( |
| 181 const RuntimeVideoEncodingParameters& params) { |
| 182 } |
| 183 |
| 176 void VideoCaptureDeviceLinux::Allocate(int width, | 184 void VideoCaptureDeviceLinux::Allocate(int width, |
| 177 int height, | 185 int height, |
| 178 int frame_rate, | 186 int frame_rate, |
| 179 EventHandler* observer) { | 187 EventHandler* observer) { |
| 180 if (v4l2_thread_.IsRunning()) { | 188 if (v4l2_thread_.IsRunning()) { |
| 181 return; // Wrong state. | 189 return; // Wrong state. |
| 182 } | 190 } |
| 183 v4l2_thread_.Start(); | 191 v4l2_thread_.Start(); |
| 184 v4l2_thread_.message_loop()->PostTask( | 192 v4l2_thread_.message_loop()->PostTask( |
| 185 FROM_HERE, | 193 FROM_HERE, |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 buffer_pool_size_ = 0; | 541 buffer_pool_size_ = 0; |
| 534 } | 542 } |
| 535 | 543 |
| 536 void VideoCaptureDeviceLinux::SetErrorState(const std::string& reason) { | 544 void VideoCaptureDeviceLinux::SetErrorState(const std::string& reason) { |
| 537 DVLOG(1) << reason; | 545 DVLOG(1) << reason; |
| 538 state_ = kError; | 546 state_ = kError; |
| 539 observer_->OnError(); | 547 observer_->OnError(); |
| 540 } | 548 } |
| 541 | 549 |
| 542 } // namespace media | 550 } // namespace media |
| OLD | NEW |