| OLD | NEW |
| 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 "content/browser/media/media_internals.h" | 5 #include "content/browser/media/media_internals.h" |
| 6 | 6 |
| 7 #include "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 AudioLogImpl::~AudioLogImpl() {} | 103 AudioLogImpl::~AudioLogImpl() {} |
| 104 | 104 |
| 105 void AudioLogImpl::OnCreated(int component_id, | 105 void AudioLogImpl::OnCreated(int component_id, |
| 106 const media::AudioParameters& params, | 106 const media::AudioParameters& params, |
| 107 const std::string& device_id) { | 107 const std::string& device_id) { |
| 108 base::DictionaryValue dict; | 108 base::DictionaryValue dict; |
| 109 StoreComponentMetadata(component_id, &dict); | 109 StoreComponentMetadata(component_id, &dict); |
| 110 | 110 |
| 111 dict.SetString(kAudioLogStatusKey, "created"); | 111 dict.SetString(kAudioLogStatusKey, "created"); |
| 112 dict.SetString("device_id", device_id); | 112 dict.SetString("device_id", device_id); |
| 113 dict.SetInteger("input_channels", params.input_channels()); |
| 113 dict.SetInteger("frames_per_buffer", params.frames_per_buffer()); | 114 dict.SetInteger("frames_per_buffer", params.frames_per_buffer()); |
| 114 dict.SetInteger("sample_rate", params.sample_rate()); | 115 dict.SetInteger("sample_rate", params.sample_rate()); |
| 115 dict.SetInteger("channels", params.channels()); | 116 dict.SetInteger("channels", params.channels()); |
| 116 dict.SetString("channel_layout", | 117 dict.SetString("channel_layout", |
| 117 ChannelLayoutToString(params.channel_layout())); | 118 ChannelLayoutToString(params.channel_layout())); |
| 118 dict.SetString("effects", EffectsToString(params.effects())); | 119 dict.SetString("effects", EffectsToString(params.effects())); |
| 119 | 120 |
| 120 media_internals_->SendUpdateAndCache( | 121 media_internals_->SendUpdateAndCache( |
| 121 FormatCacheKey(component_id), kAudioLogUpdateFunction, &dict); | 122 FormatCacheKey(component_id), kAudioLogUpdateFunction, &dict); |
| 122 } | 123 } |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 const std::string& function, | 267 const std::string& function, |
| 267 const base::DictionaryValue* value) { | 268 const base::DictionaryValue* value) { |
| 268 SendUpdate(SerializeUpdate(function, value)); | 269 SendUpdate(SerializeUpdate(function, value)); |
| 269 | 270 |
| 270 base::AutoLock auto_lock(lock_); | 271 base::AutoLock auto_lock(lock_); |
| 271 scoped_ptr<base::Value> out_value; | 272 scoped_ptr<base::Value> out_value; |
| 272 CHECK(cached_data_.Remove(cache_key, &out_value)); | 273 CHECK(cached_data_.Remove(cache_key, &out_value)); |
| 273 } | 274 } |
| 274 | 275 |
| 275 } // namespace content | 276 } // namespace content |
| OLD | NEW |