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.h" | 9 #include "chrome/common/render_messages.h" |
10 #include "chrome/renderer/audio_message_filter.h" | 10 #include "chrome/renderer/audio_message_filter.h" |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 io_loop_->AddDestructionObserver(this); | 246 io_loop_->AddDestructionObserver(this); |
247 | 247 |
248 ViewHostMsg_Audio_CreateStream_Params params; | 248 ViewHostMsg_Audio_CreateStream_Params params; |
249 params.format = format; | 249 params.format = format; |
250 params.channels = channels; | 250 params.channels = channels; |
251 params.sample_rate = sample_rate; | 251 params.sample_rate = sample_rate; |
252 params.bits_per_sample = bits_per_sample; | 252 params.bits_per_sample = bits_per_sample; |
253 params.packet_size = packet_size; | 253 params.packet_size = packet_size; |
254 params.buffer_capacity = buffer_capacity; | 254 params.buffer_capacity = buffer_capacity; |
255 | 255 |
256 filter_->Send(new ViewHostMsg_CreateAudioStream(0, stream_id_, params)); | 256 filter_->Send(new ViewHostMsg_CreateAudioStream(0, stream_id_, params, |
| 257 false)); |
257 } | 258 } |
258 | 259 |
259 void AudioRendererImpl::OnPlay() { | 260 void AudioRendererImpl::OnPlay() { |
260 DCHECK(MessageLoop::current() == io_loop_); | 261 DCHECK(MessageLoop::current() == io_loop_); |
261 | 262 |
262 filter_->Send(new ViewHostMsg_PlayAudioStream(0, stream_id_)); | 263 filter_->Send(new ViewHostMsg_PlayAudioStream(0, stream_id_)); |
263 } | 264 } |
264 | 265 |
265 void AudioRendererImpl::OnPause() { | 266 void AudioRendererImpl::OnPause() { |
266 DCHECK(MessageLoop::current() == io_loop_); | 267 DCHECK(MessageLoop::current() == io_loop_); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 prerolling_ = false; | 351 prerolling_ = false; |
351 preroll_bytes_ = 0; | 352 preroll_bytes_ = 0; |
352 filter_->Send(new ViewHostMsg_PlayAudioStream(0, stream_id_)); | 353 filter_->Send(new ViewHostMsg_PlayAudioStream(0, stream_id_)); |
353 } else { | 354 } else { |
354 preroll_bytes_ -= filled; | 355 preroll_bytes_ -= filled; |
355 } | 356 } |
356 } | 357 } |
357 } | 358 } |
358 } | 359 } |
359 } | 360 } |
OLD | NEW |