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

Unified Diff: media/audio/win/device_enumeration_win.cc

Issue 2887243002: Remove ScopedComPtr::CreateInstance() (Closed)
Patch Set: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/audio/win/core_audio_util_win.cc ('k') | media/capture/video/win/video_capture_device_factory_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/win/device_enumeration_win.cc
diff --git a/media/audio/win/device_enumeration_win.cc b/media/audio/win/device_enumeration_win.cc
index 894b61cc7df97e4c5e957804e53f71f326687893..9be9d49270d4f7c27b0c632a89adb2afc288d517 100644
--- a/media/audio/win/device_enumeration_win.cc
+++ b/media/audio/win/device_enumeration_win.cc
@@ -4,6 +4,7 @@
#include <MMDeviceAPI.h>
#include <mmsystem.h>
+#include <objbase.h>
#include <Functiondiscoverykeys_devpkey.h> // MMDeviceAPI.h must come first
#include <stddef.h>
@@ -29,8 +30,9 @@ static bool GetDeviceNamesWinImpl(EDataFlow data_flow,
// It is assumed that this method is called from a COM thread, i.e.,
// CoInitializeEx() is not called here again to avoid STA/MTA conflicts.
ScopedComPtr<IMMDeviceEnumerator> enumerator;
- HRESULT hr = enumerator.CreateInstance(__uuidof(MMDeviceEnumerator), NULL,
- CLSCTX_INPROC_SERVER);
+ HRESULT hr =
+ ::CoCreateInstance(__uuidof(MMDeviceEnumerator), NULL,
+ CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&enumerator));
DCHECK_NE(CO_E_NOTINITIALIZED, hr);
if (FAILED(hr)) {
LOG(WARNING) << "Failed to create IMMDeviceEnumerator: " << std::hex << hr;
« no previous file with comments | « media/audio/win/core_audio_util_win.cc ('k') | media/capture/video/win/video_capture_device_factory_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698