| Index: content/browser/media/media_internals.cc
|
| diff --git a/content/browser/media/media_internals.cc b/content/browser/media/media_internals.cc
|
| index f2e9072a5f8c6b7cbfe160594e6dbc3d4b72cec2..a3db27e2624790b5277a2570c10479b317f4bfed 100644
|
| --- a/content/browser/media/media_internals.cc
|
| +++ b/content/browser/media/media_internals.cc
|
| @@ -5,6 +5,7 @@
|
| #include "content/browser/media/media_internals.h"
|
|
|
| #include "base/strings/string16.h"
|
| +#include "base/strings/string_number_conversions.h"
|
| #include "base/strings/stringprintf.h"
|
| #include "content/public/browser/browser_thread.h"
|
| #include "content/public/browser/web_ui.h"
|
| @@ -23,6 +24,37 @@ base::string16 SerializeUpdate(const std::string& function,
|
| function, std::vector<const base::Value*>(1, value));
|
| }
|
|
|
| +std::string EffectsToString(int effects) {
|
| + if (effects == media::AudioParameters::NO_EFFECTS)
|
| + return "NO_EFFECTS";
|
| +
|
| + struct {
|
| + int flag;
|
| + const char* name;
|
| + } flags[] = {
|
| + { media::AudioParameters::ECHO_CANCELLER, "ECHO_CANCELLER" },
|
| + { media::AudioParameters::DUCKING, "DUCKING" },
|
| + };
|
| +
|
| + std::string ret;
|
| + for (size_t i = 0; i < ARRAYSIZE_UNSAFE(flags); ++i) {
|
| + if (effects & flags[i].flag) {
|
| + if (!ret.empty())
|
| + ret += " | ";
|
| + ret += flags[i].name;
|
| + effects &= ~flags[i].flag;
|
| + }
|
| + }
|
| +
|
| + if (effects) {
|
| + if (!ret.empty())
|
| + ret += " | ";
|
| + ret += base::IntToString(effects);
|
| + }
|
| +
|
| + return ret;
|
| +}
|
| +
|
| const char kAudioLogStatusKey[] = "status";
|
| const char kAudioLogUpdateFunction[] = "media.updateAudioComponent";
|
|
|
| @@ -83,6 +115,7 @@ void AudioLogImpl::OnCreated(int component_id,
|
| dict.SetInteger("channels", params.channels());
|
| dict.SetString("channel_layout",
|
| ChannelLayoutToString(params.channel_layout()));
|
| + dict.SetString("effects", EffectsToString(params.effects()));
|
|
|
| media_internals_->SendUpdateAndCache(
|
| FormatCacheKey(component_id), kAudioLogUpdateFunction, &dict);
|
|
|