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::kHighLatencyAudio)) { | 44 switches::kLowLatencyAudio)) { |
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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 media::SetActualDataSizeInBytes(shared_memory_.get(), | 484 media::SetActualDataSizeInBytes(shared_memory_.get(), |
485 shared_memory_size_, | 485 shared_memory_size_, |
486 size); | 486 size); |
487 UpdateEarliestEndTime(size, request_delay, time_now); | 487 UpdateEarliestEndTime(size, request_delay, time_now); |
488 } | 488 } |
489 } | 489 } |
490 | 490 |
491 void AudioRendererImpl::Send(IPC::Message* message) { | 491 void AudioRendererImpl::Send(IPC::Message* message) { |
492 filter_->Send(message); | 492 filter_->Send(message); |
493 } | 493 } |
OLD | NEW |