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

Side by Side Diff: media/video/capture/win/video_capture_device_win.cc

Issue 10939010: Cleanup: avoid foo ? true : false, part 1. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: rebase Created 8 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « media/tools/player_wtl/mainfrm.h ('k') | skia/ext/convolver_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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
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
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
OLDNEW
« no previous file with comments | « media/tools/player_wtl/mainfrm.h ('k') | skia/ext/convolver_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698