| 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 // Linux specific implementation of VideoCaptureDevice. | 5 // Linux specific implementation of VideoCaptureDevice. |
| 6 // V4L2 is used for capturing. V4L2 does not provide its own thread for | 6 // V4L2 is used for capturing. V4L2 does not provide its own thread for |
| 7 // capturing so this implementation uses a Chromium thread for fetching frames | 7 // capturing so this implementation uses a Chromium thread for fetching frames |
| 8 // from V4L2. | 8 // from V4L2. |
| 9 | 9 |
| 10 #ifndef MEDIA_VIDEO_CAPTURE_LINUX_VIDEO_CAPTURE_DEVICE_LINUX_H_ | 10 #ifndef MEDIA_VIDEO_CAPTURE_LINUX_VIDEO_CAPTURE_DEVICE_LINUX_H_ |
| 11 #define MEDIA_VIDEO_CAPTURE_LINUX_VIDEO_CAPTURE_DEVICE_LINUX_H_ | 11 #define MEDIA_VIDEO_CAPTURE_LINUX_VIDEO_CAPTURE_DEVICE_LINUX_H_ |
| 12 | 12 |
| 13 #include <string> | 13 #include <string> |
| 14 | 14 |
| 15 #include "base/threading/thread.h" | 15 #include "base/threading/thread.h" |
| 16 #include "media/video/capture/video_capture_device.h" | 16 #include "media/video/capture/video_capture_device.h" |
| 17 #include "media/video/capture/video_capture_types.h" | 17 #include "media/video/capture/video_capture_types.h" |
| 18 | 18 |
| 19 namespace media { | 19 namespace media { |
| 20 | 20 |
| 21 class VideoCaptureDeviceLinux : public VideoCaptureDevice { | 21 class VideoCaptureDeviceLinux : public VideoCaptureDevice { |
| 22 public: | 22 public: |
| 23 explicit VideoCaptureDeviceLinux(const Name& device_name); | 23 explicit VideoCaptureDeviceLinux(const Name& device_name); |
| 24 virtual ~VideoCaptureDeviceLinux(); | 24 virtual ~VideoCaptureDeviceLinux(); |
| 25 | 25 |
| 26 // VideoCaptureDevice implementation. | 26 // VideoCaptureDevice implementation. |
| 27 virtual VideoEncodingCapability GetEncodingCapability() OVERRIDE; |
| 28 virtual void TryConfigureEncodedBitstream( |
| 29 const RuntimeVideoEncodingParameters& params) OVERRIDE; |
| 27 virtual void Allocate(int width, | 30 virtual void Allocate(int width, |
| 28 int height, | 31 int height, |
| 29 int frame_rate, | 32 int frame_rate, |
| 30 EventHandler* observer) OVERRIDE; | 33 EventHandler* observer) OVERRIDE; |
| 31 virtual void Start() OVERRIDE; | 34 virtual void Start() OVERRIDE; |
| 32 virtual void Stop() OVERRIDE; | 35 virtual void Stop() OVERRIDE; |
| 33 virtual void DeAllocate() OVERRIDE; | 36 virtual void DeAllocate() OVERRIDE; |
| 34 virtual const Name& device_name() OVERRIDE; | 37 virtual const Name& device_name() OVERRIDE; |
| 35 | 38 |
| 36 private: | 39 private: |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 Buffer* buffer_pool_; | 74 Buffer* buffer_pool_; |
| 72 int buffer_pool_size_; // Number of allocated buffers. | 75 int buffer_pool_size_; // Number of allocated buffers. |
| 73 int timeout_count_; | 76 int timeout_count_; |
| 74 | 77 |
| 75 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceLinux); | 78 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceLinux); |
| 76 }; | 79 }; |
| 77 | 80 |
| 78 } // namespace media | 81 } // namespace media |
| 79 | 82 |
| 80 #endif // MEDIA_VIDEO_CAPTURE_LINUX_VIDEO_CAPTURE_DEVICE_LINUX_H_ | 83 #endif // MEDIA_VIDEO_CAPTURE_LINUX_VIDEO_CAPTURE_DEVICE_LINUX_H_ |
| OLD | NEW |