OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "media/audio/audio_device_thread.h" | 5 #include "media/audio/audio_device_thread.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 DCHECK(thread_.is_null()); | 108 DCHECK(thread_.is_null()); |
109 } | 109 } |
110 | 110 |
111 void AudioDeviceThread::Thread::Start() { | 111 void AudioDeviceThread::Thread::Start() { |
112 base::AutoLock auto_lock(callback_lock_); | 112 base::AutoLock auto_lock(callback_lock_); |
113 DCHECK(thread_.is_null()); | 113 DCHECK(thread_.is_null()); |
114 // This reference will be released when the thread exists. | 114 // This reference will be released when the thread exists. |
115 AddRef(); | 115 AddRef(); |
116 | 116 |
117 PlatformThread::CreateWithPriority(0, this, &thread_, | 117 PlatformThread::CreateWithPriority(0, this, &thread_, |
118 base::kThreadPriority_RealtimeAudio); | 118 base::ThreadPriority::REALTIME_AUDIO); |
119 CHECK(!thread_.is_null()); | 119 CHECK(!thread_.is_null()); |
120 } | 120 } |
121 | 121 |
122 void AudioDeviceThread::Thread::Stop(base::MessageLoop* loop_for_join) { | 122 void AudioDeviceThread::Thread::Stop(base::MessageLoop* loop_for_join) { |
123 socket_.Shutdown(); | 123 socket_.Shutdown(); |
124 | 124 |
125 base::PlatformThreadHandle thread = base::PlatformThreadHandle(); | 125 base::PlatformThreadHandle thread = base::PlatformThreadHandle(); |
126 | 126 |
127 { // NOLINT | 127 { // NOLINT |
128 base::AutoLock auto_lock(callback_lock_); | 128 base::AutoLock auto_lock(callback_lock_); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 } | 218 } |
219 | 219 |
220 AudioDeviceThread::Callback::~Callback() {} | 220 AudioDeviceThread::Callback::~Callback() {} |
221 | 221 |
222 void AudioDeviceThread::Callback::InitializeOnAudioThread() { | 222 void AudioDeviceThread::Callback::InitializeOnAudioThread() { |
223 MapSharedMemory(); | 223 MapSharedMemory(); |
224 CHECK(shared_memory_.memory()); | 224 CHECK(shared_memory_.memory()); |
225 } | 225 } |
226 | 226 |
227 } // namespace media. | 227 } // namespace media. |
OLD | NEW |