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

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

Issue 17402002: Reconnect support for DirectShow video capture devices in parallel to MediaFoundation ones. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Corrected silly mistake in function call Created 7 years, 5 months 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
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.
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // These operators are needed due to storing the name in an STL container. 48 // These operators are needed due to storing the name in an STL container.
49 // In the shared build, all methods from the STL container will be exported 49 // In the shared build, all methods from the STL container will be exported
50 // so even though they're not used, they're still depended upon. 50 // so even though they're not used, they're still depended upon.
51 bool operator==(const Name& other) const { 51 bool operator==(const Name& other) const {
52 return other.id() == unique_id_ && other.name() == device_name_; 52 return other.id() == unique_id_ && other.name() == device_name_;
53 } 53 }
54 bool operator<(const Name& other) const { 54 bool operator<(const Name& other) const {
55 return unique_id_ < other.id(); 55 return unique_id_ < other.id();
56 } 56 }
57 57
58 #if defined(OS_WIN)
59 enum CaptureApiType {
60 MEDIA_FOUNDATION,
61 DIRECT_SHOW
62 };
tommi (sloooow) - chröme 2013/07/03 12:06:51 nit: empty line after this one
mcasas 2013/07/03 12:41:10 Done.
63 // Capture Api type is only for Windows targets.
64 const CaptureApiType& capture_api_type() const { return capture_api_type_; }
tommi (sloooow) - chröme 2013/07/03 12:06:51 return by value
mcasas 2013/07/03 12:41:10 Done.
65 void capture_api_type(const CaptureApiType & type) {
tommi (sloooow) - chröme 2013/07/03 12:06:51 set_capture_api_type(CaptureApiType type) note th
mcasas 2013/07/03 12:41:10 Done.
66 capture_api_type_ = type;
67 }
68 #endif // if defined(OS_WIN)
69
58 private: 70 private:
59 std::string device_name_; 71 std::string device_name_;
60 std::string unique_id_; 72 std::string unique_id_;
73 #if defined(OS_WIN)
74 CaptureApiType capture_api_type_;
tommi (sloooow) - chröme 2013/07/03 12:06:51 right now this variable isn't initialized in the c
mcasas 2013/07/03 12:41:10 The second sounds better to me.
75 #endif // if defined(OS_WIN)
61 // Allow generated copy constructor and assignment. 76 // Allow generated copy constructor and assignment.
62 }; 77 };
63 78
64 // Manages a list of Name entries. 79 // Manages a list of Name entries.
65 class MEDIA_EXPORT Names 80 class MEDIA_EXPORT Names
66 : public NON_EXPORTED_BASE(std::list<Name>) { 81 : public NON_EXPORTED_BASE(std::list<Name>) {
67 public: 82 public:
68 // Returns NULL if no entry was found by that ID. 83 // Returns NULL if no entry was found by that ID.
69 Name* FindById(const std::string& id); 84 Name* FindById(const std::string& id);
70 85
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 // not permitted to make any additional calls to its EventHandler. 185 // not permitted to make any additional calls to its EventHandler.
171 virtual void DeAllocate() = 0; 186 virtual void DeAllocate() = 0;
172 187
173 // Get the name of the capture device. 188 // Get the name of the capture device.
174 virtual const Name& device_name() = 0; 189 virtual const Name& device_name() = 0;
175 }; 190 };
176 191
177 } // namespace media 192 } // namespace media
178 193
179 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ 194 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698