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

Side by Side Diff: webrtc/modules/audio_device/mac/audio_device_mac.cc

Issue 1476453002: Clean up PlatformThread. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: IsRunning DCHECK Created 5 years 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 1647 matching lines...) Expand 10 before | Expand all | Expand 10 after
1658 } 1658 }
1659 1659
1660 if (!_initialized) 1660 if (!_initialized)
1661 { 1661 {
1662 WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, 1662 WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id,
1663 " Recording worker thread has not been started"); 1663 " Recording worker thread has not been started");
1664 return -1; 1664 return -1;
1665 } 1665 }
1666 1666
1667 RTC_DCHECK(!capture_worker_thread_.get()); 1667 RTC_DCHECK(!capture_worker_thread_.get());
1668 capture_worker_thread_ = 1668 capture_worker_thread_.reset(
1669 PlatformThread::CreateThread(RunCapture, this, "CaptureWorkerThread"); 1669 new rtc::PlatformThread(RunCapture, this, "CaptureWorkerThread"));
1670 RTC_DCHECK(capture_worker_thread_.get()); 1670 RTC_DCHECK(capture_worker_thread_.get());
1671 capture_worker_thread_->Start(); 1671 capture_worker_thread_->Start();
1672 capture_worker_thread_->SetPriority(kRealtimePriority); 1672 capture_worker_thread_->SetPriority(rtc::kRealtimePriority);
1673 1673
1674 OSStatus err = noErr; 1674 OSStatus err = noErr;
1675 if (_twoDevices) 1675 if (_twoDevices)
1676 { 1676 {
1677 WEBRTC_CA_RETURN_ON_ERR(AudioDeviceStart(_inputDeviceID, _inDeviceIOProc ID)); 1677 WEBRTC_CA_RETURN_ON_ERR(AudioDeviceStart(_inputDeviceID, _inDeviceIOProc ID));
1678 } else if (!_playing) 1678 } else if (!_playing)
1679 { 1679 {
1680 WEBRTC_CA_RETURN_ON_ERR(AudioDeviceStart(_inputDeviceID, _deviceIOProcID )); 1680 WEBRTC_CA_RETURN_ON_ERR(AudioDeviceStart(_inputDeviceID, _deviceIOProcID ));
1681 } 1681 }
1682 1682
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
1813 { 1813 {
1814 return -1; 1814 return -1;
1815 } 1815 }
1816 1816
1817 if (_playing) 1817 if (_playing)
1818 { 1818 {
1819 return 0; 1819 return 0;
1820 } 1820 }
1821 1821
1822 RTC_DCHECK(!render_worker_thread_.get()); 1822 RTC_DCHECK(!render_worker_thread_.get());
1823 render_worker_thread_ = 1823 render_worker_thread_.reset(
1824 PlatformThread::CreateThread(RunRender, this, "RenderWorkerThread"); 1824 new rtc::PlatformThread(RunRender, this, "RenderWorkerThread"));
1825 render_worker_thread_->Start(); 1825 render_worker_thread_->Start();
1826 render_worker_thread_->SetPriority(kRealtimePriority); 1826 render_worker_thread_->SetPriority(rtc::kRealtimePriority);
1827 1827
1828 if (_twoDevices || !_recording) 1828 if (_twoDevices || !_recording)
1829 { 1829 {
1830 OSStatus err = noErr; 1830 OSStatus err = noErr;
1831 WEBRTC_CA_RETURN_ON_ERR(AudioDeviceStart(_outputDeviceID, _deviceIOProcI D)); 1831 WEBRTC_CA_RETURN_ON_ERR(AudioDeviceStart(_outputDeviceID, _deviceIOProcI D));
1832 } 1832 }
1833 _playing = true; 1833 _playing = true;
1834 1834
1835 return 0; 1835 return 0;
1836 } 1836 }
(...skipping 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after
3232 kCGEventSourceStateHIDSystemState, 3232 kCGEventSourceStateHIDSystemState,
3233 key_index); 3233 key_index);
3234 // A false -> true change in keymap means a key is pressed. 3234 // A false -> true change in keymap means a key is pressed.
3235 key_down |= (keyState && !prev_key_state_[key_index]); 3235 key_down |= (keyState && !prev_key_state_[key_index]);
3236 // Save current state. 3236 // Save current state.
3237 prev_key_state_[key_index] = keyState; 3237 prev_key_state_[key_index] = keyState;
3238 } 3238 }
3239 return key_down; 3239 return key_down;
3240 } 3240 }
3241 } // namespace webrtc 3241 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_device/mac/audio_device_mac.h ('k') | webrtc/modules/audio_device/win/audio_device_wave_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698