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

Side by Side Diff: media/video/capture/win/video_capture_device_mf_win.h

Issue 558503003: Windows video capture: Remove duplicated code from GetDeviceSupportedFormats* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 // 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_VIDEO_CAPTURE_WIN_VIDEO_CAPTURE_DEVICE_MF_WIN_H_ 9 #ifndef MEDIA_VIDEO_CAPTURE_WIN_VIDEO_CAPTURE_DEVICE_MF_WIN_H_
10 #define MEDIA_VIDEO_CAPTURE_WIN_VIDEO_CAPTURE_DEVICE_MF_WIN_H_ 10 #define MEDIA_VIDEO_CAPTURE_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 14
15 #include <vector> 15 #include <vector>
16 16
17 #include "base/synchronization/lock.h" 17 #include "base/synchronization/lock.h"
18 #include "base/threading/non_thread_safe.h" 18 #include "base/threading/non_thread_safe.h"
19 #include "base/win/scoped_comptr.h" 19 #include "base/win/scoped_comptr.h"
20 #include "media/base/media_export.h" 20 #include "media/base/media_export.h"
21 #include "media/video/capture/video_capture_device.h" 21 #include "media/video/capture/video_capture_device.h"
22 #include "media/video/capture/win/capability_list_win.h"
22 23
23 interface IMFSourceReader; 24 interface IMFSourceReader;
24 25
25 namespace media { 26 namespace media {
26 27
27 class MFReaderCallback; 28 class MFReaderCallback;
28 29
29 const DWORD kFirstVideoStream = 30 const DWORD kFirstVideoStream =
30 static_cast<DWORD>(MF_SOURCE_READER_FIRST_VIDEO_STREAM); 31 static_cast<DWORD>(MF_SOURCE_READER_FIRST_VIDEO_STREAM);
31 32
32 class MEDIA_EXPORT VideoCaptureDeviceMFWin 33 class MEDIA_EXPORT VideoCaptureDeviceMFWin
33 : public base::NonThreadSafe, 34 : public base::NonThreadSafe,
34 public VideoCaptureDevice { 35 public VideoCaptureDevice {
35 public: 36 public:
37 static HRESULT VideoCaptureDeviceMFWin::FillCapabilities(
38 IMFSourceReader* source,
39 CapabilityList* capabilities);
36 static bool FormatFromGuid(const GUID& guid, VideoPixelFormat* format); 40 static bool FormatFromGuid(const GUID& guid, VideoPixelFormat* format);
37 41
38 explicit VideoCaptureDeviceMFWin(const Name& device_name); 42 explicit VideoCaptureDeviceMFWin(const Name& device_name);
39 virtual ~VideoCaptureDeviceMFWin(); 43 virtual ~VideoCaptureDeviceMFWin();
40 44
41 // Opens the device driver for this device. 45 // Opens the device driver for this device.
42 bool Init(const base::win::ScopedComPtr<IMFMediaSource>& source); 46 bool Init(const base::win::ScopedComPtr<IMFMediaSource>& source);
43 47
44 // VideoCaptureDevice implementation. 48 // VideoCaptureDevice implementation.
45 virtual void AllocateAndStart(const VideoCaptureParams& params, 49 virtual void AllocateAndStart(const VideoCaptureParams& params,
(...skipping 19 matching lines...) Expand all
65 base::win::ScopedComPtr<IMFSourceReader> reader_; 69 base::win::ScopedComPtr<IMFSourceReader> reader_;
66 VideoCaptureFormat capture_format_; 70 VideoCaptureFormat capture_format_;
67 bool capture_; 71 bool capture_;
68 72
69 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceMFWin); 73 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceMFWin);
70 }; 74 };
71 75
72 } // namespace media 76 } // namespace media
73 77
74 #endif // MEDIA_VIDEO_CAPTURE_WIN_VIDEO_CAPTURE_DEVICE_MF_WIN_H_ 78 #endif // MEDIA_VIDEO_CAPTURE_WIN_VIDEO_CAPTURE_DEVICE_MF_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698