OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |