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. |
11 | 11 |
12 #ifndef MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ | 12 #ifndef MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ |
13 #define MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ | 13 #define MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ |
14 | 14 |
15 #include <list> | 15 #include <list> |
16 #include <string> | 16 #include <string> |
17 | 17 |
18 #include "base/logging.h" | 18 #include "base/logging.h" |
19 #include "base/time/time.h" | 19 #include "base/time/time.h" |
20 #include "media/base/media_export.h" | 20 #include "media/base/media_export.h" |
| 21 #include "media/base/video_frame.h" |
21 #include "media/video/capture/video_capture_types.h" | 22 #include "media/video/capture/video_capture_types.h" |
22 | 23 |
23 namespace media { | 24 namespace media { |
24 | 25 |
25 class MEDIA_EXPORT VideoCaptureDevice { | 26 class MEDIA_EXPORT VideoCaptureDevice { |
26 public: | 27 public: |
27 // Represents a capture device name and ID. | 28 // Represents a capture device name and ID. |
28 // You should not create an instance of this class directly by e.g. setting | 29 // You should not create an instance of this class directly by e.g. setting |
29 // various properties directly. Instead use | 30 // various properties directly. Instead use |
30 // VideoCaptureDevice::GetDeviceNames to do this for you and if you need to | 31 // VideoCaptureDevice::GetDeviceNames to do this for you and if you need to |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 CaptureApiClass capture_api_class_; | 107 CaptureApiClass capture_api_class_; |
107 #endif // if defined(OS_WIN) | 108 #endif // if defined(OS_WIN) |
108 // Allow generated copy constructor and assignment. | 109 // Allow generated copy constructor and assignment. |
109 }; | 110 }; |
110 | 111 |
111 // Manages a list of Name entries. | 112 // Manages a list of Name entries. |
112 class MEDIA_EXPORT Names | 113 class MEDIA_EXPORT Names |
113 : public NON_EXPORTED_BASE(std::list<Name>) { | 114 : public NON_EXPORTED_BASE(std::list<Name>) { |
114 public: | 115 public: |
115 // Returns NULL if no entry was found by that ID. | 116 // Returns NULL if no entry was found by that ID. |
| 117 // TODO(mcasas): Possibly not used anymore, double check. |
116 Name* FindById(const std::string& id); | 118 Name* FindById(const std::string& id); |
117 | 119 |
118 // Allow generated copy constructor and assignment. | 120 // Allow generated copy constructor and assignment. |
119 }; | 121 }; |
120 | 122 |
121 class MEDIA_EXPORT Client { | 123 class MEDIA_EXPORT Client { |
122 public: | 124 public: |
123 virtual ~Client() {} | 125 virtual ~Client() {} |
124 | 126 |
125 // Reserve an output buffer into which a video frame can be captured | 127 // Reserve an output buffer into which a video frame can be captured |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 // If deallocation is done asynchronously, then the device implementation must | 218 // If deallocation is done asynchronously, then the device implementation must |
217 // ensure that a subsequent AllocateAndStart() operation targeting the same ID | 219 // ensure that a subsequent AllocateAndStart() operation targeting the same ID |
218 // would be sequenced through the same task runner, so that deallocation | 220 // would be sequenced through the same task runner, so that deallocation |
219 // happens first. | 221 // happens first. |
220 virtual void StopAndDeAllocate() = 0; | 222 virtual void StopAndDeAllocate() = 0; |
221 }; | 223 }; |
222 | 224 |
223 } // namespace media | 225 } // namespace media |
224 | 226 |
225 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ | 227 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ |
OLD | NEW |