OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/renderer/media/audio_renderer_impl.h" | 5 #include "chrome/renderer/media/audio_renderer_impl.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include "chrome/common/render_messages_params.h" | 9 #include "chrome/common/render_messages_params.h" |
10 #include "chrome/renderer/audio_message_filter.h" | 10 #include "chrome/renderer/audio_message_filter.h" |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
248 if (stopped_) | 248 if (stopped_) |
249 return; | 249 return; |
250 | 250 |
251 // Make sure we don't call create more than once. | 251 // Make sure we don't call create more than once. |
252 DCHECK_EQ(0, stream_id_); | 252 DCHECK_EQ(0, stream_id_); |
253 stream_id_ = filter_->AddDelegate(this); | 253 stream_id_ = filter_->AddDelegate(this); |
254 io_loop_->AddDestructionObserver(this); | 254 io_loop_->AddDestructionObserver(this); |
255 | 255 |
256 ViewHostMsg_Audio_CreateStream_Params params; | 256 ViewHostMsg_Audio_CreateStream_Params params; |
257 params.params = audio_params; | 257 params.params = audio_params; |
258 params.packet_size = 0; | 258 |
259 // Let the browser choose packet size. | |
260 params.params.samples_per_packet = 0; | |
scherkus (not reviewing)
2010/11/09 02:28:31
is this documented anywhere in params or IPC messa
Sergey Ulanov
2010/11/09 22:29:58
Added comments about it in render_messages_params.
| |
259 | 261 |
260 filter_->Send(new ViewHostMsg_CreateAudioStream(0, stream_id_, params, | 262 filter_->Send(new ViewHostMsg_CreateAudioStream(0, stream_id_, params, |
261 false)); | 263 false)); |
262 } | 264 } |
263 | 265 |
264 void AudioRendererImpl::PlayTask() { | 266 void AudioRendererImpl::PlayTask() { |
265 DCHECK(MessageLoop::current() == io_loop_); | 267 DCHECK(MessageLoop::current() == io_loop_); |
266 | 268 |
267 filter_->Send(new ViewHostMsg_PlayAudioStream(0, stream_id_)); | 269 filter_->Send(new ViewHostMsg_PlayAudioStream(0, stream_id_)); |
268 } | 270 } |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
350 DCHECK(MessageLoop::current() == io_loop_); | 352 DCHECK(MessageLoop::current() == io_loop_); |
351 | 353 |
352 // We treat the IO loop going away the same as stopping. | 354 // We treat the IO loop going away the same as stopping. |
353 AutoLock auto_lock(lock_); | 355 AutoLock auto_lock(lock_); |
354 if (stopped_) | 356 if (stopped_) |
355 return; | 357 return; |
356 | 358 |
357 stopped_ = true; | 359 stopped_ = true; |
358 DestroyTask(); | 360 DestroyTask(); |
359 } | 361 } |
OLD | NEW |