OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Windows specific implementation of VideoCaptureDevice. |
| 6 // DirectShow is used for capturing. DirectShow provide its own threads |
| 7 // for capturing. |
| 8 |
| 9 #ifndef MEDIA_VIDEO_CAPTURE_WIN_CAPABILITY_LIST_WIN_H_ |
| 10 #define MEDIA_VIDEO_CAPTURE_WIN_CAPABILITY_LIST_WIN_H_ |
| 11 |
| 12 #include <list> |
| 13 |
| 14 #include "base/threading/non_thread_safe.h" |
| 15 #include "media/video/capture/video_capture_types.h" |
| 16 |
| 17 namespace media { |
| 18 |
| 19 struct VideoCaptureCapabilityWin : public VideoCaptureCapability { |
| 20 explicit VideoCaptureCapabilityWin(int index) : stream_index(index) {} |
| 21 int stream_index; |
| 22 }; |
| 23 |
| 24 class CapabilityList : public base::NonThreadSafe { |
| 25 public: |
| 26 CapabilityList(); |
| 27 ~CapabilityList(); |
| 28 |
| 29 bool empty() const { return capabilities_.empty(); } |
| 30 |
| 31 // Appends an entry to the list. |
| 32 void Add(const VideoCaptureCapabilityWin& capability); |
| 33 |
| 34 // Loops through the list of capabilities and returns an index of the best |
| 35 // matching capability. The algorithm prioritizes height, width, frame rate |
| 36 // and color format in that order. |
| 37 const VideoCaptureCapabilityWin& GetBestMatchedCapability( |
| 38 int requested_width, int requested_height, |
| 39 int requested_frame_rate) const; |
| 40 |
| 41 private: |
| 42 typedef std::list<VideoCaptureCapabilityWin> Capabilities; |
| 43 Capabilities capabilities_; |
| 44 |
| 45 DISALLOW_COPY_AND_ASSIGN(CapabilityList); |
| 46 }; |
| 47 |
| 48 } // namespace media |
| 49 |
| 50 #endif // MEDIA_VIDEO_CAPTURE_WIN_CAPABILITY_LIST_WIN_H_ |
OLD | NEW |