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

Side by Side Diff: media/audio/win/audio_low_latency_input_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 unified diff | Download patch
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/audio/win/audio_low_latency_input_win.h" 5 #include "media/audio/win/audio_low_latency_input_win.h"
6 6
7 #include <objbase.h> 7 #include <objbase.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <memory> 10 #include <memory>
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 NOTREACHED() << "Error code: " << err; 506 NOTREACHED() << "Error code: " << err;
507 if (sink_) 507 if (sink_)
508 sink_->OnError(this); 508 sink_->OnError(this);
509 } 509 }
510 510
511 HRESULT WASAPIAudioInputStream::SetCaptureDevice() { 511 HRESULT WASAPIAudioInputStream::SetCaptureDevice() {
512 DCHECK_EQ(OPEN_RESULT_OK, open_result_); 512 DCHECK_EQ(OPEN_RESULT_OK, open_result_);
513 DCHECK(!endpoint_device_.Get()); 513 DCHECK(!endpoint_device_.Get());
514 514
515 ScopedComPtr<IMMDeviceEnumerator> enumerator; 515 ScopedComPtr<IMMDeviceEnumerator> enumerator;
516 HRESULT hr = enumerator.CreateInstance(__uuidof(MMDeviceEnumerator), NULL, 516 HRESULT hr =
517 CLSCTX_INPROC_SERVER); 517 ::CoCreateInstance(__uuidof(MMDeviceEnumerator), NULL,
518 CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&enumerator));
518 if (FAILED(hr)) { 519 if (FAILED(hr)) {
519 open_result_ = OPEN_RESULT_CREATE_INSTANCE; 520 open_result_ = OPEN_RESULT_CREATE_INSTANCE;
520 return hr; 521 return hr;
521 } 522 }
522 523
523 // Retrieve the IMMDevice by using the specified role or the specified 524 // Retrieve the IMMDevice by using the specified role or the specified
524 // unique endpoint device-identification string. 525 // unique endpoint device-identification string.
525 526
526 if (device_id_ == AudioDeviceDescription::kDefaultDeviceId) { 527 if (device_id_ == AudioDeviceDescription::kDefaultDeviceId) {
527 // Retrieve the default capture audio endpoint for the specified role. 528 // Retrieve the default capture audio endpoint for the specified role.
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 OPEN_RESULT_MAX + 1); 829 OPEN_RESULT_MAX + 1);
829 } 830 }
830 831
831 double WASAPIAudioInputStream::ProvideInput(AudioBus* audio_bus, 832 double WASAPIAudioInputStream::ProvideInput(AudioBus* audio_bus,
832 uint32_t frames_delayed) { 833 uint32_t frames_delayed) {
833 fifo_->Consume()->CopyTo(audio_bus); 834 fifo_->Consume()->CopyTo(audio_bus);
834 return 1.0; 835 return 1.0;
835 } 836 }
836 837
837 } // namespace media 838 } // namespace media
OLDNEW
« no previous file with comments | « device/sensors/data_fetcher_shared_memory_win.cc ('k') | media/audio/win/core_audio_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698