Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: chrome/renderer/media/audio_renderer_impl.cc

Issue 661386: Add a parameter to CreateAudioStream to choose between standard and low-latency mode. (Closed)
Patch Set: . Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/common/render_messages_internal.h ('k') | chrome/renderer/pepper_devices.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/common/render_messages_internal.h ('k') | chrome/renderer/pepper_devices.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698