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

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

Issue 7827016: Enable low-latency audio by default. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « content/common/content_switches.cc ('k') | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_renderer_impl.h" 5 #include "content/renderer/media/audio_renderer_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 22 matching lines...) Expand all
33 shared_memory_size_(0), 33 shared_memory_size_(0),
34 stopped_(false), 34 stopped_(false),
35 pending_request_(false), 35 pending_request_(false),
36 prerolling_(false), 36 prerolling_(false),
37 preroll_bytes_(0) { 37 preroll_bytes_(0) {
38 filter_ = RenderThread::current()->audio_message_filter(); 38 filter_ = RenderThread::current()->audio_message_filter();
39 // Figure out if we are planning to use high or low latency code path. 39 // Figure out if we are planning to use high or low latency code path.
40 // We are initializing only one variable and double initialization is Ok, 40 // We are initializing only one variable and double initialization is Ok,
41 // so there would not be any issues caused by CPU memory model. 41 // so there would not be any issues caused by CPU memory model.
42 if (latency_type_ == kUninitializedLatency) { 42 if (latency_type_ == kUninitializedLatency) {
43 if (CommandLine::ForCurrentProcess()->HasSwitch( 43 if (!CommandLine::ForCurrentProcess()->HasSwitch(
44 switches::kLowLatencyAudio)) { 44 switches::kHighLatencyAudio)) {
45 latency_type_ = kLowLatency; 45 latency_type_ = kLowLatency;
46 } else { 46 } else {
47 latency_type_ = kHighLatency; 47 latency_type_ = kHighLatency;
48 } 48 }
49 } 49 }
50 } 50 }
51 51
52 AudioRendererImpl::~AudioRendererImpl() { 52 AudioRendererImpl::~AudioRendererImpl() {
53 } 53 }
54 54
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 media::SetActualDataSizeInBytes(shared_memory_.get(), 486 media::SetActualDataSizeInBytes(shared_memory_.get(),
487 shared_memory_size_, 487 shared_memory_size_,
488 size); 488 size);
489 UpdateEarliestEndTime(size, request_delay, time_now); 489 UpdateEarliestEndTime(size, request_delay, time_now);
490 } 490 }
491 } 491 }
492 492
493 void AudioRendererImpl::Send(IPC::Message* message) { 493 void AudioRendererImpl::Send(IPC::Message* message) {
494 filter_->Send(message); 494 filter_->Send(message);
495 } 495 }
OLDNEW
« no previous file with comments | « content/common/content_switches.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698