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 #include "media/video/capture/win/video_capture_device_win.h" | 5 #include "media/video/capture/win/video_capture_device_win.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <list> | 8 #include <list> |
9 | 9 |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 DCHECK(pin); | 80 DCHECK(pin); |
81 bool found = false; | 81 bool found = false; |
82 ScopedComPtr<IKsPropertySet> ks_property; | 82 ScopedComPtr<IKsPropertySet> ks_property; |
83 HRESULT hr = ks_property.QueryFrom(pin); | 83 HRESULT hr = ks_property.QueryFrom(pin); |
84 if (SUCCEEDED(hr)) { | 84 if (SUCCEEDED(hr)) { |
85 GUID pin_category; | 85 GUID pin_category; |
86 DWORD return_value; | 86 DWORD return_value; |
87 hr = ks_property->Get(AMPROPSETID_Pin, AMPROPERTY_PIN_CATEGORY, NULL, 0, | 87 hr = ks_property->Get(AMPROPSETID_Pin, AMPROPERTY_PIN_CATEGORY, NULL, 0, |
88 &pin_category, sizeof(pin_category), &return_value); | 88 &pin_category, sizeof(pin_category), &return_value); |
89 if (SUCCEEDED(hr) && (return_value == sizeof(pin_category))) { | 89 if (SUCCEEDED(hr) && (return_value == sizeof(pin_category))) { |
90 found = (pin_category == category) ? true : false; | 90 found = (pin_category == category); |
91 } | 91 } |
92 } | 92 } |
93 return found; | 93 return found; |
94 } | 94 } |
95 | 95 |
96 // Finds a IPin on a IBaseFilter given the direction an category. | 96 // Finds a IPin on a IBaseFilter given the direction an category. |
97 HRESULT GetPin(IBaseFilter* filter, PIN_DIRECTION pin_dir, REFGUID category, | 97 HRESULT GetPin(IBaseFilter* filter, PIN_DIRECTION pin_dir, REFGUID category, |
98 IPin** pin) { | 98 IPin** pin) { |
99 DCHECK(pin); | 99 DCHECK(pin); |
100 ScopedComPtr<IEnumPins> pin_emum; | 100 ScopedComPtr<IEnumPins> pin_emum; |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 } | 662 } |
663 | 663 |
664 void VideoCaptureDeviceWin::SetErrorState(const char* reason) { | 664 void VideoCaptureDeviceWin::SetErrorState(const char* reason) { |
665 DCHECK(CalledOnValidThread()); | 665 DCHECK(CalledOnValidThread()); |
666 DVLOG(1) << reason; | 666 DVLOG(1) << reason; |
667 state_ = kError; | 667 state_ = kError; |
668 observer_->OnError(); | 668 observer_->OnError(); |
669 } | 669 } |
670 | 670 |
671 } // namespace media | 671 } // namespace media |
OLD | NEW |