| 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 // is actually two-in-one: clients may implement OnIncomingCapturedData() or | 174 // is actually two-in-one: clients may implement OnIncomingCapturedData() or |
| 175 // ReserveOutputBuffer() + OnIncomingCapturedVideoFrame(), or all of them. | 175 // ReserveOutputBuffer() + OnIncomingCapturedVideoFrame(), or all of them. |
| 176 // All clients must implement OnError(). | 176 // All clients must implement OnError(). |
| 177 class MEDIA_EXPORT Client { | 177 class MEDIA_EXPORT Client { |
| 178 public: | 178 public: |
| 179 // Memory buffer returned by Client::ReserveOutputBuffer(). | 179 // Memory buffer returned by Client::ReserveOutputBuffer(). |
| 180 class MEDIA_EXPORT Buffer { | 180 class MEDIA_EXPORT Buffer { |
| 181 public: | 181 public: |
| 182 virtual ~Buffer() = 0; | 182 virtual ~Buffer() = 0; |
| 183 virtual int id() const = 0; | 183 virtual int id() const = 0; |
| 184 virtual size_t size() const = 0; | 184 virtual gfx::Size dimensions() const = 0; |
| 185 virtual size_t mapped_size() const = 0; |
| 185 virtual void* data(int plane) = 0; | 186 virtual void* data(int plane) = 0; |
| 186 void* data() { return data(0); } | 187 void* data() { return data(0); } |
| 187 virtual ClientBuffer AsClientBuffer(int plane) = 0; | 188 virtual ClientBuffer AsClientBuffer(int plane) = 0; |
| 188 #if defined(OS_POSIX) | 189 #if defined(OS_POSIX) |
| 189 virtual base::FileDescriptor AsPlatformFile() = 0; | 190 virtual base::FileDescriptor AsPlatformFile() = 0; |
| 190 #endif | 191 #endif |
| 191 }; | 192 }; |
| 192 | 193 |
| 193 virtual ~Client() {} | 194 virtual ~Client() {} |
| 194 | 195 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 int GetPowerLineFrequencyForLocation() const; | 286 int GetPowerLineFrequencyForLocation() const; |
| 286 | 287 |
| 287 protected: | 288 protected: |
| 288 static const int kPowerLine50Hz = 50; | 289 static const int kPowerLine50Hz = 50; |
| 289 static const int kPowerLine60Hz = 60; | 290 static const int kPowerLine60Hz = 60; |
| 290 }; | 291 }; |
| 291 | 292 |
| 292 } // namespace media | 293 } // namespace media |
| 293 | 294 |
| 294 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ | 295 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ |
| OLD | NEW |