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

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

Issue 2830893004: Migrate IID Coupled Uses of ScopedComPtr::ReceiveVoid() to IID_PPV_ARGS (Closed)
Patch Set: Created 3 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/capture/video/win/video_capture_device_factory_win.h" 5 #include "media/capture/video/win/video_capture_device_factory_win.h"
6 6
7 #include <mfapi.h> 7 #include <mfapi.h>
8 #include <mferror.h> 8 #include <mferror.h>
9 #include <objbase.h>
9 #include <stddef.h> 10 #include <stddef.h>
10 11
11 #include "base/command_line.h" 12 #include "base/command_line.h"
12 #include "base/macros.h" 13 #include "base/macros.h"
13 #include "base/metrics/histogram_macros.h" 14 #include "base/metrics/histogram_macros.h"
14 #include "base/strings/string_util.h" 15 #include "base/strings/string_util.h"
15 #include "base/strings/sys_string_conversions.h" 16 #include "base/strings/sys_string_conversions.h"
16 #include "base/win/scoped_co_mem.h" 17 #include "base/win/scoped_co_mem.h"
17 #include "base/win/scoped_variant.h" 18 #include "base/win/scoped_variant.h"
18 #include "base/win/windows_version.h" 19 #include "base/win/windows_version.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 // CreateClassEnumerator returns S_FALSE on some Windows OS 164 // CreateClassEnumerator returns S_FALSE on some Windows OS
164 // when no camera exist. Therefore the FAILED macro can't be used. 165 // when no camera exist. Therefore the FAILED macro can't be used.
165 if (hr != S_OK) 166 if (hr != S_OK)
166 return; 167 return;
167 168
168 // Enumerate all video capture devices. 169 // Enumerate all video capture devices.
169 for (ScopedComPtr<IMoniker> moniker; 170 for (ScopedComPtr<IMoniker> moniker;
170 enum_moniker->Next(1, moniker.Receive(), NULL) == S_OK; 171 enum_moniker->Next(1, moniker.Receive(), NULL) == S_OK;
171 moniker.Reset()) { 172 moniker.Reset()) {
172 ScopedComPtr<IPropertyBag> prop_bag; 173 ScopedComPtr<IPropertyBag> prop_bag;
173 hr = moniker->BindToStorage(0, 0, IID_IPropertyBag, prop_bag.ReceiveVoid()); 174 hr = moniker->BindToStorage(0, 0, IID_PPV_ARGS(&prop_bag));
174 if (FAILED(hr)) 175 if (FAILED(hr))
175 continue; 176 continue;
176 177
177 // Find the description or friendly name. 178 // Find the description or friendly name.
178 ScopedVariant name; 179 ScopedVariant name;
179 hr = prop_bag->Read(L"Description", name.Receive(), 0); 180 hr = prop_bag->Read(L"Description", name.Receive(), 0);
180 if (FAILED(hr)) 181 if (FAILED(hr))
181 hr = prop_bag->Read(L"FriendlyName", name.Receive(), 0); 182 hr = prop_bag->Read(L"FriendlyName", name.Receive(), 0);
182 183
183 if (FAILED(hr) || name.type() != VT_BSTR) 184 if (FAILED(hr) || name.type() != VT_BSTR)
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 } 461 }
461 462
462 // static 463 // static
463 VideoCaptureDeviceFactory* 464 VideoCaptureDeviceFactory*
464 VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory( 465 VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory(
465 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { 466 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) {
466 return new VideoCaptureDeviceFactoryWin(); 467 return new VideoCaptureDeviceFactoryWin();
467 } 468 }
468 469
469 } // namespace media 470 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/win/core_audio_util_win.cc ('k') | media/capture/video/win/video_capture_device_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698