| 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 // additional copies in the browser process. |dimensions| indicates the | 173 // additional copies in the browser process. |dimensions| indicates the |
| 174 // frame width and height of the buffer contents; this is assumed to be of | 174 // frame width and height of the buffer contents; this is assumed to be of |
| 175 // |format| format and tightly packed. | 175 // |format| format and tightly packed. |
| 176 virtual void OnIncomingCapturedBuffer(const scoped_refptr<Buffer>& buffer, | 176 virtual void OnIncomingCapturedBuffer(const scoped_refptr<Buffer>& buffer, |
| 177 media::VideoFrame::Format format, | 177 media::VideoFrame::Format format, |
| 178 const gfx::Size& dimensions, | 178 const gfx::Size& dimensions, |
| 179 base::TimeTicks timestamp, | 179 base::TimeTicks timestamp, |
| 180 int frame_rate) = 0; | 180 int frame_rate) = 0; |
| 181 | 181 |
| 182 // An error has occurred that cannot be handled and VideoCaptureDevice must | 182 // An error has occurred that cannot be handled and VideoCaptureDevice must |
| 183 // be StopAndDeAllocate()-ed. | 183 // be StopAndDeAllocate()-ed. |reason| is a text description of the error. |
| 184 virtual void OnError() = 0; | 184 virtual void OnError(const std::string& reason) = 0; |
| 185 }; | 185 }; |
| 186 | 186 |
| 187 // Creates a VideoCaptureDevice object. | 187 // Creates a VideoCaptureDevice object. |
| 188 // Return NULL if the hardware is not available. | 188 // Return NULL if the hardware is not available. |
| 189 static VideoCaptureDevice* Create(const Name& device_name); | 189 static VideoCaptureDevice* Create(const Name& device_name); |
| 190 virtual ~VideoCaptureDevice(); | 190 virtual ~VideoCaptureDevice(); |
| 191 | 191 |
| 192 // Gets the names of all video capture devices connected to this computer. | 192 // Gets the names of all video capture devices connected to this computer. |
| 193 static void GetDeviceNames(Names* device_names); | 193 static void GetDeviceNames(Names* device_names); |
| 194 | 194 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 215 // If deallocation is done asynchronously, then the device implementation must | 215 // If deallocation is done asynchronously, then the device implementation must |
| 216 // ensure that a subsequent AllocateAndStart() operation targeting the same ID | 216 // ensure that a subsequent AllocateAndStart() operation targeting the same ID |
| 217 // would be sequenced through the same task runner, so that deallocation | 217 // would be sequenced through the same task runner, so that deallocation |
| 218 // happens first. | 218 // happens first. |
| 219 virtual void StopAndDeAllocate() = 0; | 219 virtual void StopAndDeAllocate() = 0; |
| 220 }; | 220 }; |
| 221 | 221 |
| 222 } // namespace media | 222 } // namespace media |
| 223 | 223 |
| 224 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ | 224 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ |
| OLD | NEW |