| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 // additional copies in the browser process. | 180 // additional copies in the browser process. |
| 181 virtual void OnIncomingCapturedVideoFrame( | 181 virtual void OnIncomingCapturedVideoFrame( |
| 182 const scoped_refptr<Buffer>& buffer, | 182 const scoped_refptr<Buffer>& buffer, |
| 183 const VideoCaptureFormat& buffer_format, | 183 const VideoCaptureFormat& buffer_format, |
| 184 const scoped_refptr<media::VideoFrame>& frame, | 184 const scoped_refptr<media::VideoFrame>& frame, |
| 185 base::TimeTicks timestamp) = 0; | 185 base::TimeTicks timestamp) = 0; |
| 186 | 186 |
| 187 // An error has occurred that cannot be handled and VideoCaptureDevice must | 187 // An error has occurred that cannot be handled and VideoCaptureDevice must |
| 188 // be StopAndDeAllocate()-ed. |reason| is a text description of the error. | 188 // be StopAndDeAllocate()-ed. |reason| is a text description of the error. |
| 189 virtual void OnError(const std::string& reason) = 0; | 189 virtual void OnError(const std::string& reason) = 0; |
| 190 |
| 191 // The VideoCaptureDevice has a |message| to add to the Log. |
| 192 virtual void OnLog(const std::string& message) = 0; |
| 190 }; | 193 }; |
| 191 | 194 |
| 192 // Creates a VideoCaptureDevice object. | 195 // Creates a VideoCaptureDevice object. |
| 193 // Return NULL if the hardware is not available. | 196 // Return NULL if the hardware is not available. |
| 194 static VideoCaptureDevice* Create( | 197 static VideoCaptureDevice* Create( |
| 195 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | 198 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
| 196 const Name& device_name); | 199 const Name& device_name); |
| 197 virtual ~VideoCaptureDevice(); | 200 virtual ~VideoCaptureDevice(); |
| 198 | 201 |
| 199 // Gets the names of all video capture devices connected to this computer. | 202 // Gets the names of all video capture devices connected to this computer. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 230 int GetPowerLineFrequencyForLocation() const; | 233 int GetPowerLineFrequencyForLocation() const; |
| 231 | 234 |
| 232 protected: | 235 protected: |
| 233 static const int kPowerLine50Hz = 50; | 236 static const int kPowerLine50Hz = 50; |
| 234 static const int kPowerLine60Hz = 60; | 237 static const int kPowerLine60Hz = 60; |
| 235 }; | 238 }; |
| 236 | 239 |
| 237 } // namespace media | 240 } // namespace media |
| 238 | 241 |
| 239 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ | 242 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ |
| OLD | NEW |