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/renderer/media/audio_message_filter.h" | 5 #include "content/renderer/media/audio_message_filter.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop_proxy.h" | 8 #include "base/message_loop/message_loop_proxy.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "content/common/media/audio_messages.h" | 10 #include "content/common/media/audio_messages.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 int stream_id_; | 42 int stream_id_; |
43 }; | 43 }; |
44 | 44 |
45 AudioMessageFilter* AudioMessageFilter::g_filter = NULL; | 45 AudioMessageFilter* AudioMessageFilter::g_filter = NULL; |
46 | 46 |
47 AudioMessageFilter::AudioMessageFilter( | 47 AudioMessageFilter::AudioMessageFilter( |
48 const scoped_refptr<base::MessageLoopProxy>& io_message_loop) | 48 const scoped_refptr<base::MessageLoopProxy>& io_message_loop) |
49 : sender_(NULL), | 49 : sender_(NULL), |
50 audio_hardware_config_(NULL), | 50 audio_hardware_config_(NULL), |
51 io_message_loop_(io_message_loop) { | 51 io_message_loop_(io_message_loop) { |
52 DCHECK(!g_filter); | |
53 g_filter = this; | 52 g_filter = this; |
54 } | 53 } |
55 | 54 |
56 AudioMessageFilter::~AudioMessageFilter() { | 55 AudioMessageFilter::~AudioMessageFilter() { |
57 DCHECK_EQ(g_filter, this); | 56 DCHECK_EQ(g_filter, this); |
58 g_filter = NULL; | 57 g_filter = NULL; |
59 } | 58 } |
60 | 59 |
61 // static | 60 // static |
62 AudioMessageFilter* AudioMessageFilter::Get() { | 61 AudioMessageFilter* AudioMessageFilter::Get() { |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 audio_hardware_config_->UpdateOutputConfig(output_params); | 235 audio_hardware_config_->UpdateOutputConfig(output_params); |
237 } | 236 } |
238 | 237 |
239 void AudioMessageFilter::SetAudioHardwareConfig( | 238 void AudioMessageFilter::SetAudioHardwareConfig( |
240 media::AudioHardwareConfig* config) { | 239 media::AudioHardwareConfig* config) { |
241 base::AutoLock auto_lock(lock_); | 240 base::AutoLock auto_lock(lock_); |
242 audio_hardware_config_ = config; | 241 audio_hardware_config_ = config; |
243 } | 242 } |
244 | 243 |
245 } // namespace content | 244 } // namespace content |
OLD | NEW |