Index: media/gpu/media_foundation_video_encode_accelerator_win.cc |
diff --git a/media/gpu/media_foundation_video_encode_accelerator_win.cc b/media/gpu/media_foundation_video_encode_accelerator_win.cc |
index fea0fb9d4ce283a23bc315074495ad942715fc0a..06e326bd4a82b1907d279d259d0558783db24ee7 100644 |
--- a/media/gpu/media_foundation_video_encode_accelerator_win.cc |
+++ b/media/gpu/media_foundation_video_encode_accelerator_win.cc |
@@ -10,6 +10,7 @@ |
#include <codecapi.h> |
#include <mferror.h> |
#include <mftransform.h> |
+#include <objbase.h> |
#include <iterator> |
#include <utility> |
@@ -355,7 +356,8 @@ bool MediaFoundationVideoEncodeAccelerator::CreateHardwareEncoderMFT() { |
RETURN_ON_HR_FAILURE(hr, "Couldn't enumerate hardware encoder", false); |
RETURN_ON_FAILURE((count > 0), "No HW encoder found", false); |
DVLOG(3) << "HW encoder(s) found: " << count; |
- hr = encoder_.CreateInstance(CLSIDs[0]); |
+ hr = ::CoCreateInstance(CLSIDs[0], nullptr, CLSCTX_ALL, |
+ IID_PPV_ARGS(&encoder_)); |
RETURN_ON_HR_FAILURE(hr, "Couldn't activate hardware encoder", false); |
RETURN_ON_FAILURE((encoder_.Get() != nullptr), |
"No HW encoder instance created", false); |