| 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 // VideoCaptureDevice is the abstract base class for realizing video capture | 5 // VideoCaptureDevice is the abstract base class for realizing video capture |
| 6 // device support in Chromium. It provides the interface for OS dependent | 6 // device support in Chromium. It provides the interface for OS dependent |
| 7 // implementations. | 7 // implementations. |
| 8 // The class is created and functions are invoked on a thread owned by | 8 // The class is created and functions are invoked on a thread owned by |
| 9 // VideoCaptureManager. Capturing is done on other threads, depending on the OS | 9 // VideoCaptureManager. Capturing is done on other threads, depending on the OS |
| 10 // specific implementation. | 10 // specific implementation. |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 // be StopAndDeAllocate()-ed. |reason| is a text description of the error. | 135 // be StopAndDeAllocate()-ed. |reason| is a text description of the error. |
| 136 virtual void OnError(const tracked_objects::Location& from_here, | 136 virtual void OnError(const tracked_objects::Location& from_here, |
| 137 const std::string& reason) = 0; | 137 const std::string& reason) = 0; |
| 138 | 138 |
| 139 // VideoCaptureDevice requests the |message| to be logged. | 139 // VideoCaptureDevice requests the |message| to be logged. |
| 140 virtual void OnLog(const std::string& message) {} | 140 virtual void OnLog(const std::string& message) {} |
| 141 | 141 |
| 142 // Returns the current buffer pool utilization, in the range 0.0 (no buffers | 142 // Returns the current buffer pool utilization, in the range 0.0 (no buffers |
| 143 // are in use by producers or consumers) to 1.0 (all buffers are in use). | 143 // are in use by producers or consumers) to 1.0 (all buffers are in use). |
| 144 virtual double GetBufferPoolUtilization() const = 0; | 144 virtual double GetBufferPoolUtilization() const = 0; |
| 145 |
| 146 virtual void SetCameraFacing(bool is_back_camera) {} |
| 145 }; | 147 }; |
| 146 | 148 |
| 147 virtual ~VideoCaptureDevice(); | 149 virtual ~VideoCaptureDevice(); |
| 148 | 150 |
| 149 // Prepares the video capturer for use. StopAndDeAllocate() must be called | 151 // Prepares the video capturer for use. StopAndDeAllocate() must be called |
| 150 // before the object is deleted. | 152 // before the object is deleted. |
| 151 virtual void AllocateAndStart(const VideoCaptureParams& params, | 153 virtual void AllocateAndStart(const VideoCaptureParams& params, |
| 152 std::unique_ptr<Client> client) = 0; | 154 std::unique_ptr<Client> client) = 0; |
| 153 | 155 |
| 154 // In cases where the video capturer self-pauses (e.g., a screen capturer | 156 // In cases where the video capturer self-pauses (e.g., a screen capturer |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 | 232 |
| 231 private: | 233 private: |
| 232 // Gets the power line frequency from the current system time zone if this is | 234 // Gets the power line frequency from the current system time zone if this is |
| 233 // defined, otherwise returns 0. | 235 // defined, otherwise returns 0. |
| 234 PowerLineFrequency GetPowerLineFrequencyForLocation() const; | 236 PowerLineFrequency GetPowerLineFrequencyForLocation() const; |
| 235 }; | 237 }; |
| 236 | 238 |
| 237 } // namespace media | 239 } // namespace media |
| 238 | 240 |
| 239 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_H_ | 241 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_H_ |
| OLD | NEW |