| 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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 media::VideoFrame::Format format, | 212 media::VideoFrame::Format format, |
| 213 const gfx::Size& dimensions) = 0; | 213 const gfx::Size& dimensions) = 0; |
| 214 | 214 |
| 215 // Captured a new video frame, held in |frame|. | 215 // Captured a new video frame, held in |frame|. |
| 216 // | 216 // |
| 217 // As the frame is backed by a reservation returned by | 217 // As the frame is backed by a reservation returned by |
| 218 // ReserveOutputBuffer(), delivery is guaranteed and will require no | 218 // ReserveOutputBuffer(), delivery is guaranteed and will require no |
| 219 // additional copies in the browser process. | 219 // additional copies in the browser process. |
| 220 virtual void OnIncomingCapturedVideoFrame( | 220 virtual void OnIncomingCapturedVideoFrame( |
| 221 const scoped_refptr<Buffer>& buffer, | 221 const scoped_refptr<Buffer>& buffer, |
| 222 const VideoCaptureFormat& buffer_format, | |
| 223 const scoped_refptr<media::VideoFrame>& frame, | 222 const scoped_refptr<media::VideoFrame>& frame, |
| 224 const base::TimeTicks& timestamp) = 0; | 223 const base::TimeTicks& timestamp) = 0; |
| 225 | 224 |
| 226 // An error has occurred that cannot be handled and VideoCaptureDevice must | 225 // An error has occurred that cannot be handled and VideoCaptureDevice must |
| 227 // be StopAndDeAllocate()-ed. |reason| is a text description of the error. | 226 // be StopAndDeAllocate()-ed. |reason| is a text description of the error. |
| 228 virtual void OnError(const std::string& reason) = 0; | 227 virtual void OnError(const std::string& reason) = 0; |
| 229 | 228 |
| 230 // VideoCaptureDevice requests the |message| to be logged. | 229 // VideoCaptureDevice requests the |message| to be logged. |
| 231 virtual void OnLog(const std::string& message) {} | 230 virtual void OnLog(const std::string& message) {} |
| 232 }; | 231 }; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 257 int GetPowerLineFrequencyForLocation() const; | 256 int GetPowerLineFrequencyForLocation() const; |
| 258 | 257 |
| 259 protected: | 258 protected: |
| 260 static const int kPowerLine50Hz = 50; | 259 static const int kPowerLine50Hz = 50; |
| 261 static const int kPowerLine60Hz = 60; | 260 static const int kPowerLine60Hz = 60; |
| 262 }; | 261 }; |
| 263 | 262 |
| 264 } // namespace media | 263 } // namespace media |
| 265 | 264 |
| 266 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ | 265 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ |
| OLD | NEW |