| OLD | NEW |
| 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 |
| 11 #include <assert.h> | 11 #include <assert.h> |
| 12 | 12 |
| 13 #include "webrtc/modules/audio_device/audio_device_config.h" | 13 #include "webrtc/modules/audio_device/audio_device_config.h" |
| 14 #include "webrtc/modules/audio_device/linux/audio_device_pulse_linux.h" | 14 #include "webrtc/modules/audio_device/linux/audio_device_pulse_linux.h" |
| 15 #include "webrtc/rtc_base/checks.h" | 15 #include "webrtc/rtc_base/checks.h" |
| 16 #include "webrtc/rtc_base/logging.h" | 16 #include "webrtc/rtc_base/logging.h" |
| 17 #include "webrtc/system_wrappers/include/event_wrapper.h" | 17 #include "webrtc/system_wrappers/include/event_wrapper.h" |
| 18 | 18 |
| 19 webrtc::adm_linux_pulse::PulseAudioSymbolTable PaSymbolTable; | 19 webrtc::adm_linux_pulse::PulseAudioSymbolTable PaSymbolTable; |
| 20 | 20 |
| 21 // Accesses Pulse functions through our late-binding symbol table instead of | 21 // Accesses Pulse functions through our late-binding symbol table instead of |
| 22 // directly. This way we don't have to link to libpulse, which means our binary | 22 // directly. This way we don't have to link to libpulse, which means our binary |
| 23 // will work on systems that don't have it. | 23 // will work on systems that don't have it. |
| 24 #define LATE(sym) \ | 24 #define LATE(sym) \ |
| 25 LATESYM_GET(webrtc::adm_linux_pulse::PulseAudioSymbolTable, &PaSymbolTable, \ | 25 LATESYM_GET(webrtc::adm_linux_pulse::PulseAudioSymbolTable, &PaSymbolTable, \ |
| 26 sym) | 26 sym) |
| 27 | 27 |
| 28 namespace webrtc { | 28 namespace webrtc { |
| 29 | 29 |
| 30 AudioDeviceLinuxPulse::AudioDeviceLinuxPulse(const int32_t id) | 30 AudioDeviceLinuxPulse::AudioDeviceLinuxPulse() |
| 31 : _ptrAudioBuffer(NULL), | 31 : _ptrAudioBuffer(NULL), |
| 32 _timeEventRec(*EventWrapper::Create()), | 32 _timeEventRec(*EventWrapper::Create()), |
| 33 _timeEventPlay(*EventWrapper::Create()), | 33 _timeEventPlay(*EventWrapper::Create()), |
| 34 _recStartEvent(*EventWrapper::Create()), | 34 _recStartEvent(*EventWrapper::Create()), |
| 35 _playStartEvent(*EventWrapper::Create()), | 35 _playStartEvent(*EventWrapper::Create()), |
| 36 _id(id), | |
| 37 _mixerManager(id), | |
| 38 _inputDeviceIndex(0), | 36 _inputDeviceIndex(0), |
| 39 _outputDeviceIndex(0), | 37 _outputDeviceIndex(0), |
| 40 _inputDeviceIsSpecified(false), | 38 _inputDeviceIsSpecified(false), |
| 41 _outputDeviceIsSpecified(false), | 39 _outputDeviceIsSpecified(false), |
| 42 sample_rate_hz_(0), | 40 sample_rate_hz_(0), |
| 43 _recChannels(1), | 41 _recChannels(1), |
| 44 _playChannels(1), | 42 _playChannels(1), |
| 45 _playBufType(AudioDeviceModule::kFixedBufferSize), | 43 _playBufType(AudioDeviceModule::kFixedBufferSize), |
| 46 _initialized(false), | 44 _initialized(false), |
| 47 _recording(false), | 45 _recording(false), |
| (...skipping 2469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2517 | 2515 |
| 2518 // A bit change in keymap means a key is pressed | 2516 // A bit change in keymap means a key is pressed |
| 2519 for (i = 0; i < sizeof(szKey); i++) | 2517 for (i = 0; i < sizeof(szKey); i++) |
| 2520 state |= (szKey[i] ^ _oldKeyState[i]) & szKey[i]; | 2518 state |= (szKey[i] ^ _oldKeyState[i]) & szKey[i]; |
| 2521 | 2519 |
| 2522 // Save old state | 2520 // Save old state |
| 2523 memcpy((char*)_oldKeyState, (char*)szKey, sizeof(_oldKeyState)); | 2521 memcpy((char*)_oldKeyState, (char*)szKey, sizeof(_oldKeyState)); |
| 2524 return (state != 0); | 2522 return (state != 0); |
| 2525 } | 2523 } |
| 2526 } // namespace webrtc | 2524 } // namespace webrtc |
| OLD | NEW |