| 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. | 5 // Windows specific implementation of VideoCaptureDevice. |
| 6 // DirectShow is used for capturing. DirectShow provide its own threads | 6 // DirectShow is used for capturing. DirectShow provide its own threads |
| 7 // for capturing. | 7 // for capturing. |
| 8 | 8 |
| 9 #ifndef MEDIA_CAPTURE_VIDEO_WIN_VIDEO_CAPTURE_DEVICE_MF_WIN_H_ | 9 #ifndef MEDIA_CAPTURE_VIDEO_WIN_VIDEO_CAPTURE_DEVICE_MF_WIN_H_ |
| 10 #define MEDIA_CAPTURE_VIDEO_WIN_VIDEO_CAPTURE_DEVICE_MF_WIN_H_ | 10 #define MEDIA_CAPTURE_VIDEO_WIN_VIDEO_CAPTURE_DEVICE_MF_WIN_H_ |
| 11 | 11 |
| 12 #include <mfidl.h> | 12 #include <mfidl.h> |
| 13 #include <mfreadwrite.h> | 13 #include <mfreadwrite.h> |
| 14 #include <stdint.h> | 14 #include <stdint.h> |
| 15 | 15 |
| 16 #include <vector> | 16 #include <vector> |
| 17 | 17 |
| 18 #include "base/macros.h" | 18 #include "base/macros.h" |
| 19 #include "base/synchronization/lock.h" | 19 #include "base/synchronization/lock.h" |
| 20 #include "base/threading/non_thread_safe.h" | 20 #include "base/threading/non_thread_safe.h" |
| 21 #include "base/win/scoped_comptr.h" | 21 #include "base/win/scoped_comptr.h" |
| 22 #include "media/capture/capture_export.h" | 22 #include "media/base/media_export.h" |
| 23 #include "media/capture/video/video_capture_device.h" | 23 #include "media/capture/video/video_capture_device.h" |
| 24 | 24 |
| 25 interface IMFSourceReader; | 25 interface IMFSourceReader; |
| 26 | 26 |
| 27 namespace tracked_objects { | 27 namespace tracked_objects { |
| 28 class Location; | 28 class Location; |
| 29 } // namespace tracked_objects | 29 } // namespace tracked_objects |
| 30 | 30 |
| 31 namespace media { | 31 namespace media { |
| 32 | 32 |
| 33 class MFReaderCallback; | 33 class MFReaderCallback; |
| 34 | 34 |
| 35 const DWORD kFirstVideoStream = | 35 const DWORD kFirstVideoStream = |
| 36 static_cast<DWORD>(MF_SOURCE_READER_FIRST_VIDEO_STREAM); | 36 static_cast<DWORD>(MF_SOURCE_READER_FIRST_VIDEO_STREAM); |
| 37 | 37 |
| 38 class CAPTURE_EXPORT VideoCaptureDeviceMFWin : public base::NonThreadSafe, | 38 class MEDIA_EXPORT VideoCaptureDeviceMFWin : public base::NonThreadSafe, |
| 39 public VideoCaptureDevice { | 39 public VideoCaptureDevice { |
| 40 public: | 40 public: |
| 41 static bool FormatFromGuid(const GUID& guid, VideoPixelFormat* format); | 41 static bool FormatFromGuid(const GUID& guid, VideoPixelFormat* format); |
| 42 | 42 |
| 43 explicit VideoCaptureDeviceMFWin(const Name& device_name); | 43 explicit VideoCaptureDeviceMFWin(const Name& device_name); |
| 44 ~VideoCaptureDeviceMFWin() override; | 44 ~VideoCaptureDeviceMFWin() override; |
| 45 | 45 |
| 46 // Opens the device driver for this device. | 46 // Opens the device driver for this device. |
| 47 bool Init(const base::win::ScopedComPtr<IMFMediaSource>& source); | 47 bool Init(const base::win::ScopedComPtr<IMFMediaSource>& source); |
| 48 | 48 |
| 49 // VideoCaptureDevice implementation. | 49 // VideoCaptureDevice implementation. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 71 base::win::ScopedComPtr<IMFSourceReader> reader_; | 71 base::win::ScopedComPtr<IMFSourceReader> reader_; |
| 72 VideoCaptureFormat capture_format_; | 72 VideoCaptureFormat capture_format_; |
| 73 bool capture_; | 73 bool capture_; |
| 74 | 74 |
| 75 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceMFWin); | 75 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceMFWin); |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 } // namespace media | 78 } // namespace media |
| 79 | 79 |
| 80 #endif // MEDIA_CAPTURE_VIDEO_WIN_VIDEO_CAPTURE_DEVICE_MF_WIN_H_ | 80 #endif // MEDIA_CAPTURE_VIDEO_WIN_VIDEO_CAPTURE_DEVICE_MF_WIN_H_ |
| OLD | NEW |