Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: media/video/capture/video_capture_device.h

Issue 74703002: RELAND 29423003: Added video capture capabilities retrieval and caching to VideoCaptureManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 private: 103 private:
103 CaptureApiType capture_api_type_; 104 CaptureApiType capture_api_type_;
104 }; 105 };
105 106
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 typedef std::list<Name> Names;
113 : public NON_EXPORTED_BASE(std::list<Name>) {
114 public:
115 // Returns NULL if no entry was found by that ID.
116 Name* FindById(const std::string& id);
117
118 // Allow generated copy constructor and assignment.
119 };
120 114
121 class MEDIA_EXPORT Client { 115 class MEDIA_EXPORT Client {
122 public: 116 public:
123 virtual ~Client() {} 117 virtual ~Client() {}
124 118
125 // Reserve an output buffer into which a video frame can be captured 119 // Reserve an output buffer into which a video frame can be captured
126 // directly. If all buffers are currently busy, returns NULL. 120 // directly. If all buffers are currently busy, returns NULL.
127 // 121 //
128 // The returned VideoFrames will always be allocated with a YV12 format and 122 // The returned VideoFrames will always be allocated with a YV12 format and
129 // have dimensions matching |size|. It is the VideoCaptureDevice's 123 // have dimensions matching |size|. It is the VideoCaptureDevice's
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 // If deallocation is done asynchronously, then the device implementation must 206 // If deallocation is done asynchronously, then the device implementation must
213 // ensure that a subsequent AllocateAndStart() operation targeting the same ID 207 // ensure that a subsequent AllocateAndStart() operation targeting the same ID
214 // would be sequenced through the same task runner, so that deallocation 208 // would be sequenced through the same task runner, so that deallocation
215 // happens first. 209 // happens first.
216 virtual void StopAndDeAllocate() = 0; 210 virtual void StopAndDeAllocate() = 0;
217 }; 211 };
218 212
219 } // namespace media 213 } // namespace media
220 214
221 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ 215 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698