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

Side by Side Diff: media/audio/win/audio_low_latency_input_win.cc

Issue 2712483006: Add histogram to track down errors when initializing the audio client. (Closed)
Patch Set: Created 3 years, 10 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 <cmath> 7 #include <cmath>
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 // This setting should lead to lowest possible latency. 708 // This setting should lead to lowest possible latency.
709 HRESULT hr = audio_client_->Initialize( 709 HRESULT hr = audio_client_->Initialize(
710 AUDCLNT_SHAREMODE_SHARED, flags, 710 AUDCLNT_SHAREMODE_SHARED, flags,
711 0, // hnsBufferDuration 711 0, // hnsBufferDuration
712 0, &format_, device_id_ == AudioDeviceDescription::kCommunicationsDeviceId 712 0, &format_, device_id_ == AudioDeviceDescription::kCommunicationsDeviceId
713 ? &kCommunicationsSessionId 713 ? &kCommunicationsSessionId
714 : nullptr); 714 : nullptr);
715 715
716 if (FAILED(hr)) { 716 if (FAILED(hr)) {
717 open_result_ = OPEN_RESULT_AUDIO_CLIENT_INIT_FAILED; 717 open_result_ = OPEN_RESULT_AUDIO_CLIENT_INIT_FAILED;
718 UMA_HISTOGRAM_SPARSE_SLOWLY("Media.Audio.Capture.Win.InitError", hr);
henrika (OOO until Aug 14) 2017/02/23 11:20:52 Just FYI. Mac specific stats are callled e.g. Medi
718 return hr; 719 return hr;
719 } 720 }
720 721
721 // Retrieve the length of the endpoint buffer shared between the client 722 // Retrieve the length of the endpoint buffer shared between the client
722 // and the audio engine. The buffer length determines the maximum amount 723 // and the audio engine. The buffer length determines the maximum amount
723 // of capture data that the audio engine can read from the endpoint buffer 724 // of capture data that the audio engine can read from the endpoint buffer
724 // during a single processing pass. 725 // during a single processing pass.
725 // A typical value is 960 audio frames <=> 20ms @ 48kHz sample rate. 726 // A typical value is 960 audio frames <=> 20ms @ 48kHz sample rate.
726 hr = audio_client_->GetBufferSize(&endpoint_buffer_size_frames_); 727 hr = audio_client_->GetBufferSize(&endpoint_buffer_size_frames_);
727 if (FAILED(hr)) { 728 if (FAILED(hr)) {
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 OPEN_RESULT_MAX + 1); 828 OPEN_RESULT_MAX + 1);
828 } 829 }
829 830
830 double WASAPIAudioInputStream::ProvideInput(AudioBus* audio_bus, 831 double WASAPIAudioInputStream::ProvideInput(AudioBus* audio_bus,
831 uint32_t frames_delayed) { 832 uint32_t frames_delayed) {
832 fifo_->Consume()->CopyTo(audio_bus); 833 fifo_->Consume()->CopyTo(audio_bus);
833 return 1.0; 834 return 1.0;
834 } 835 }
835 836
836 } // namespace media 837 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698