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

Unified Diff: media/capture/video/win/video_capture_device_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
Index: media/capture/video/win/video_capture_device_win.cc
diff --git a/media/capture/video/win/video_capture_device_win.cc b/media/capture/video/win/video_capture_device_win.cc
index 7a4ba030c661aa36403596485337571c49c5ab02..bd76633bfa35da4e72a435c8121bfeb8c4217dc1 100644
--- a/media/capture/video/win/video_capture_device_win.cc
+++ b/media/capture/video/win/video_capture_device_win.cc
@@ -108,8 +108,8 @@ HRESULT VideoCaptureDeviceWin::GetDeviceFilter(const std::string& device_id,
DCHECK(filter);
ScopedComPtr<ICreateDevEnum> dev_enum;
- HRESULT hr =
- dev_enum.CreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC);
+ HRESULT hr = ::CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC,
+ IID_PPV_ARGS(&dev_enum));
if (FAILED(hr))
return hr;
@@ -316,14 +316,14 @@ bool VideoCaptureDeviceWin::Init() {
input_sink_pin_ = sink_filter_->GetPin(0);
- hr = graph_builder_.CreateInstance(CLSID_FilterGraph, NULL,
- CLSCTX_INPROC_SERVER);
+ hr = ::CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,
+ IID_PPV_ARGS(&graph_builder_));
DLOG_IF_FAILED_WITH_HRESULT("Failed to create capture filter", hr);
if (FAILED(hr))
return false;
- hr = capture_graph_builder_.CreateInstance(CLSID_CaptureGraphBuilder2, NULL,
- CLSCTX_INPROC);
+ hr = ::CoCreateInstance(CLSID_CaptureGraphBuilder2, NULL, CLSCTX_INPROC,
+ IID_PPV_ARGS(&capture_graph_builder_));
DLOG_IF_FAILED_WITH_HRESULT("Failed to create the Capture Graph Builder", hr);
if (FAILED(hr))
return false;

Powered by Google App Engine
This is Rietveld 408576698