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

Side by Side Diff: webrtc/modules/audio_device/test/func_test_manager.h

Issue 1230503003: Update a ton of audio code to use size_t more correctly and in general reduce (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync Created 5 years, 3 months 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 29 matching lines...) Expand all
40 TTMicrophoneAGC = 10, 40 TTMicrophoneAGC = 10,
41 TTLoopback = 11, 41 TTLoopback = 11,
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 uint16_t nSamples; 50 size_t nSamples;
51 uint16_t nBytesPerSample; 51 size_t nBytesPerSample;
52 uint8_t nChannels; 52 uint8_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;
(...skipping 17 matching lines...) Expand all
79 }; 79 };
80 80
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 uint32_t nSamples, 89 const size_t nSamples,
90 const uint8_t nBytesPerSample, 90 const size_t nBytesPerSample,
91 const uint8_t nChannels, 91 const uint8_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 uint32_t nSamples, 99 int32_t NeedMorePlayData(const size_t nSamples,
100 const uint8_t nBytesPerSample, 100 const size_t nBytesPerSample,
101 const uint8_t nChannels, 101 const uint8_t nChannels,
102 const uint32_t samplesPerSec, 102 const uint32_t samplesPerSec,
103 void* audioSamples, 103 void* audioSamples,
104 uint32_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[], 108 int OnDataAvailable(const int voe_channels[],
109 int number_of_voe_channels, 109 int number_of_voe_channels,
110 const int16_t* audio_data, 110 const int16_t* audio_data,
111 int sample_rate, 111 int sample_rate,
112 int number_of_channels, 112 int number_of_channels,
113 int number_of_frames, 113 size_t number_of_frames,
114 int audio_delay_milliseconds, 114 int audio_delay_milliseconds,
115 int current_volume, 115 int current_volume,
116 bool key_pressed, 116 bool key_pressed,
117 bool need_audio_processing) override; 117 bool need_audio_processing) override;
118 118
119 void PushCaptureData(int voe_channel, const void* audio_data, 119 void PushCaptureData(int voe_channel, const void* audio_data,
120 int bits_per_sample, int sample_rate, 120 int bits_per_sample, int sample_rate,
121 int number_of_channels, 121 int number_of_channels,
122 int number_of_frames) override; 122 size_t number_of_frames) override;
123 123
124 void PullRenderData(int bits_per_sample, int sample_rate, 124 void PullRenderData(int bits_per_sample, int sample_rate,
125 int number_of_channels, int number_of_frames, 125 int number_of_channels, size_t number_of_frames,
126 void* audio_data, 126 void* audio_data,
127 int64_t* elapsed_time_ms, 127 int64_t* elapsed_time_ms,
128 int64_t* ntp_time_ms) override; 128 int64_t* ntp_time_ms) override;
129 129
130 AudioTransportImpl(AudioDeviceModule* audioDevice); 130 AudioTransportImpl(AudioDeviceModule* audioDevice);
131 ~AudioTransportImpl(); 131 ~AudioTransportImpl();
132 132
133 public: 133 public:
134 int32_t SetFilePlayout(bool enable, const char* fileName = NULL); 134 int32_t SetFilePlayout(bool enable, const char* fileName = NULL);
135 void SetFullDuplex(bool enable); 135 void SetFullDuplex(bool enable);
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 230
231 rtc::scoped_ptr<ProcessThread> _processThread; 231 rtc::scoped_ptr<ProcessThread> _processThread;
232 AudioDeviceModule* _audioDevice; 232 AudioDeviceModule* _audioDevice;
233 AudioEventObserver* _audioEventObserver; 233 AudioEventObserver* _audioEventObserver;
234 AudioTransportImpl* _audioTransport; 234 AudioTransportImpl* _audioTransport;
235 }; 235 };
236 236
237 } // namespace webrtc 237 } // namespace webrtc
238 238
239 #endif // #ifndef WEBRTC_AUDIO_DEVICE_FUNC_TEST_MANAGER_H 239 #endif // #ifndef WEBRTC_AUDIO_DEVICE_FUNC_TEST_MANAGER_H
OLDNEW
« no previous file with comments | « webrtc/modules/audio_device/test/audio_device_test_api.cc ('k') | webrtc/modules/audio_device/test/func_test_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698