| 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 // Windows specific implementation of VideoCaptureDevice. DirectShow is used for | 5 // Windows specific implementation of VideoCaptureDevice. DirectShow is used for |
| 6 // capturing. DirectShow provide its own threads for capturing. | 6 // capturing. DirectShow provide its own threads for capturing. |
| 7 | 7 |
| 8 #ifndef MEDIA_CAPTURE_VIDEO_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_ | 8 #ifndef DEVICE_CAPTURE_VIDEO_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_ |
| 9 #define MEDIA_CAPTURE_VIDEO_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_ | 9 #define DEVICE_CAPTURE_VIDEO_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_ |
| 10 | 10 |
| 11 // Avoid including strsafe.h via dshow as it will cause build warnings. | 11 // Avoid including strsafe.h via dshow as it will cause build warnings. |
| 12 #define NO_DSHOW_STRSAFE | 12 #define NO_DSHOW_STRSAFE |
| 13 #include <dshow.h> | 13 #include <dshow.h> |
| 14 #include <stdint.h> | 14 #include <stdint.h> |
| 15 | 15 |
| 16 #include <map> | 16 #include <map> |
| 17 #include <string> | 17 #include <string> |
| 18 | 18 |
| 19 #include "base/macros.h" | 19 #include "base/macros.h" |
| 20 #include "base/threading/thread_checker.h" | 20 #include "base/threading/thread_checker.h" |
| 21 #include "base/win/scoped_comptr.h" | 21 #include "base/win/scoped_comptr.h" |
| 22 #include "device/capture/video/video_capture_device.h" |
| 23 #include "device/capture/video/win/capability_list_win.h" |
| 24 #include "device/capture/video/win/sink_filter_win.h" |
| 25 #include "device/capture/video/win/sink_input_pin_win.h" |
| 22 #include "media/base/video_capture_types.h" | 26 #include "media/base/video_capture_types.h" |
| 23 #include "media/capture/video/video_capture_device.h" | |
| 24 #include "media/capture/video/win/capability_list_win.h" | |
| 25 #include "media/capture/video/win/sink_filter_win.h" | |
| 26 #include "media/capture/video/win/sink_input_pin_win.h" | |
| 27 | 27 |
| 28 namespace tracked_objects { | 28 namespace tracked_objects { |
| 29 class Location; | 29 class Location; |
| 30 } // namespace tracked_objects | 30 } // namespace tracked_objects |
| 31 | 31 |
| 32 namespace media { | 32 namespace device { |
| 33 | 33 |
| 34 // All the methods in the class can only be run on a COM initialized thread. | 34 // All the methods in the class can only be run on a COM initialized thread. |
| 35 class VideoCaptureDeviceWin : public VideoCaptureDevice, | 35 class VideoCaptureDeviceWin : public VideoCaptureDevice, |
| 36 public SinkFilterObserver { | 36 public SinkFilterObserver { |
| 37 public: | 37 public: |
| 38 // A utility class that wraps the AM_MEDIA_TYPE type and guarantees that | 38 // A utility class that wraps the AM_MEDIA_TYPE type and guarantees that |
| 39 // we free the structure when exiting the scope. DCHECKing is also done to | 39 // we free the structure when exiting the scope. DCHECKing is also done to |
| 40 // avoid memory leaks. | 40 // avoid memory leaks. |
| 41 class ScopedMediaType { | 41 class ScopedMediaType { |
| 42 public: | 42 public: |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 CapabilityList capabilities_; | 113 CapabilityList capabilities_; |
| 114 VideoCaptureFormat capture_format_; | 114 VideoCaptureFormat capture_format_; |
| 115 | 115 |
| 116 base::TimeTicks first_ref_time_; | 116 base::TimeTicks first_ref_time_; |
| 117 | 117 |
| 118 base::ThreadChecker thread_checker_; | 118 base::ThreadChecker thread_checker_; |
| 119 | 119 |
| 120 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceWin); | 120 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceWin); |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 } // namespace media | 123 } // namespace device |
| 124 | 124 |
| 125 #endif // MEDIA_CAPTURE_VIDEO_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_ | 125 #endif // DEVICE_CAPTURE_VIDEO_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_ |
| OLD | NEW |