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

Unified Diff: content/browser/media/media_internals.cc

Issue 890573003: Report AudioParameters::Format in media-internals. Fix effects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes. Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/media_internals.cc
diff --git a/content/browser/media/media_internals.cc b/content/browser/media/media_internals.cc
index e2a5ede68bbdd7fe2d38ccf0cdecd0dde7f32392..b5a93516a1bf7b97379cb6b7f87ed4ab43c7c43b 100644
--- a/content/browser/media/media_internals.cc
+++ b/content/browser/media/media_internals.cc
@@ -42,6 +42,7 @@ std::string EffectsToString(int effects) {
{ media::AudioParameters::ECHO_CANCELLER, "ECHO_CANCELLER" },
{ media::AudioParameters::DUCKING, "DUCKING" },
{ media::AudioParameters::KEYBOARD_MIC, "KEYBOARD_MIC" },
+ { media::AudioParameters::HOTWORD, "HOTWORD" },
};
std::string ret;
@@ -63,6 +64,22 @@ std::string EffectsToString(int effects) {
return ret;
}
+std::string FormatToString(media::AudioParameters::Format format) {
+ switch (format) {
+ case media::AudioParameters::AUDIO_PCM_LINEAR:
+ return "pcm_linear";
+ case media::AudioParameters::AUDIO_PCM_LOW_LATENCY:
+ return "pcm_low_latency";
+ case media::AudioParameters::AUDIO_FAKE:
+ return "fake";
+ case media::AudioParameters::AUDIO_LAST_FORMAT:
+ break;
+ }
+
+ NOTREACHED();
+ return "unknown";
+}
+
const char kAudioLogStatusKey[] = "status";
const char kAudioLogUpdateFunction[] = "media.updateAudioComponent";
@@ -117,6 +134,7 @@ void AudioLogImpl::OnCreated(int component_id,
dict.SetString(kAudioLogStatusKey, "created");
dict.SetString("device_id", device_id);
+ dict.SetString("device_type", FormatToString(params.format()));
dict.SetInteger("frames_per_buffer", params.frames_per_buffer());
dict.SetInteger("sample_rate", params.sample_rate());
dict.SetInteger("channels", params.channels());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698