| 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 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 TTDeviceRemoval = 13, | 42 TTDeviceRemoval = 13, |
| 43 TTMobileAPI = 14, | 43 TTMobileAPI = 14, |
| 44 TTTest = 66, | 44 TTTest = 66, |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 struct AudioPacket | 47 struct AudioPacket |
| 48 { | 48 { |
| 49 uint8_t dataBuffer[4 * 960]; | 49 uint8_t dataBuffer[4 * 960]; |
| 50 size_t nSamples; | 50 size_t nSamples; |
| 51 size_t nBytesPerSample; | 51 size_t nBytesPerSample; |
| 52 uint8_t nChannels; | 52 size_t nChannels; |
| 53 uint32_t samplesPerSec; | 53 uint32_t samplesPerSec; |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 class ProcessThread; | 56 class ProcessThread; |
| 57 | 57 |
| 58 namespace webrtc | 58 namespace webrtc |
| 59 { | 59 { |
| 60 | 60 |
| 61 class AudioDeviceModule; | 61 class AudioDeviceModule; |
| 62 class AudioEventObserver; | 62 class AudioEventObserver; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 81 // ---------------------------------------------------------------------------- | 81 // ---------------------------------------------------------------------------- |
| 82 // AudioTransport | 82 // AudioTransport |
| 83 // ---------------------------------------------------------------------------- | 83 // ---------------------------------------------------------------------------- |
| 84 | 84 |
| 85 class AudioTransportImpl: public AudioTransport | 85 class AudioTransportImpl: public AudioTransport |
| 86 { | 86 { |
| 87 public: | 87 public: |
| 88 int32_t RecordedDataIsAvailable(const void* audioSamples, | 88 int32_t RecordedDataIsAvailable(const void* audioSamples, |
| 89 const size_t nSamples, | 89 const size_t nSamples, |
| 90 const size_t nBytesPerSample, | 90 const size_t nBytesPerSample, |
| 91 const uint8_t nChannels, | 91 const size_t nChannels, |
| 92 const uint32_t samplesPerSec, | 92 const uint32_t samplesPerSec, |
| 93 const uint32_t totalDelayMS, | 93 const uint32_t totalDelayMS, |
| 94 const int32_t clockDrift, | 94 const int32_t clockDrift, |
| 95 const uint32_t currentMicLevel, | 95 const uint32_t currentMicLevel, |
| 96 const bool keyPressed, | 96 const bool keyPressed, |
| 97 uint32_t& newMicLevel) override; | 97 uint32_t& newMicLevel) override; |
| 98 | 98 |
| 99 int32_t NeedMorePlayData(const size_t nSamples, | 99 int32_t NeedMorePlayData(const size_t nSamples, |
| 100 const size_t nBytesPerSample, | 100 const size_t nBytesPerSample, |
| 101 const uint8_t nChannels, | 101 const size_t nChannels, |
| 102 const uint32_t samplesPerSec, | 102 const uint32_t samplesPerSec, |
| 103 void* audioSamples, | 103 void* audioSamples, |
| 104 size_t& nSamplesOut, | 104 size_t& nSamplesOut, |
| 105 int64_t* elapsed_time_ms, | 105 int64_t* elapsed_time_ms, |
| 106 int64_t* ntp_time_ms) override; | 106 int64_t* ntp_time_ms) override; |
| 107 | 107 |
| 108 int OnDataAvailable(const int voe_channels[], | |
| 109 int number_of_voe_channels, | |
| 110 const int16_t* audio_data, | |
| 111 int sample_rate, | |
| 112 int number_of_channels, | |
| 113 size_t number_of_frames, | |
| 114 int audio_delay_milliseconds, | |
| 115 int current_volume, | |
| 116 bool key_pressed, | |
| 117 bool need_audio_processing) override; | |
| 118 | |
| 119 void PushCaptureData(int voe_channel, const void* audio_data, | |
| 120 int bits_per_sample, int sample_rate, | |
| 121 int number_of_channels, | |
| 122 size_t number_of_frames) override; | |
| 123 | |
| 124 void PullRenderData(int bits_per_sample, int sample_rate, | |
| 125 int number_of_channels, size_t number_of_frames, | |
| 126 void* audio_data, | |
| 127 int64_t* elapsed_time_ms, | |
| 128 int64_t* ntp_time_ms) override; | |
| 129 | |
| 130 AudioTransportImpl(AudioDeviceModule* audioDevice); | 108 AudioTransportImpl(AudioDeviceModule* audioDevice); |
| 131 ~AudioTransportImpl(); | 109 ~AudioTransportImpl(); |
| 132 | 110 |
| 133 public: | 111 public: |
| 134 int32_t SetFilePlayout(bool enable, const char* fileName = NULL); | 112 int32_t SetFilePlayout(bool enable, const char* fileName = NULL); |
| 135 void SetFullDuplex(bool enable); | 113 void SetFullDuplex(bool enable); |
| 136 void SetSpeakerVolume(bool enable) | 114 void SetSpeakerVolume(bool enable) |
| 137 { | 115 { |
| 138 _speakerVolume = enable; | 116 _speakerVolume = enable; |
| 139 } | 117 } |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 | 208 |
| 231 rtc::scoped_ptr<ProcessThread> _processThread; | 209 rtc::scoped_ptr<ProcessThread> _processThread; |
| 232 AudioDeviceModule* _audioDevice; | 210 AudioDeviceModule* _audioDevice; |
| 233 AudioEventObserver* _audioEventObserver; | 211 AudioEventObserver* _audioEventObserver; |
| 234 AudioTransportImpl* _audioTransport; | 212 AudioTransportImpl* _audioTransport; |
| 235 }; | 213 }; |
| 236 | 214 |
| 237 } // namespace webrtc | 215 } // namespace webrtc |
| 238 | 216 |
| 239 #endif // #ifndef WEBRTC_AUDIO_DEVICE_FUNC_TEST_MANAGER_H | 217 #endif // #ifndef WEBRTC_AUDIO_DEVICE_FUNC_TEST_MANAGER_H |
| OLD | NEW |