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

Side by Side Diff: webrtc/voice_engine/voe_base_impl.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, 4 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
« no previous file with comments | « webrtc/voice_engine/utility_unittest.cc ('k') | webrtc/voice_engine/voe_base_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 int GetVersion(char version[1024]) override; 48 int GetVersion(char version[1024]) override;
49 49
50 int LastError() override; 50 int LastError() override;
51 51
52 AudioTransport* audio_transport() override { return this; } 52 AudioTransport* audio_transport() override { return this; }
53 53
54 int AssociateSendChannel(int channel, int accociate_send_channel) override; 54 int AssociateSendChannel(int channel, int accociate_send_channel) override;
55 55
56 // AudioTransport 56 // AudioTransport
57 int32_t RecordedDataIsAvailable(const void* audioSamples, uint32_t nSamples, 57 int32_t RecordedDataIsAvailable(const void* audioSamples, size_t nSamples,
58 uint8_t nBytesPerSample, uint8_t nChannels, 58 size_t nBytesPerSample, uint8_t nChannels,
59 uint32_t samplesPerSec, uint32_t totalDelayMS, 59 uint32_t samplesPerSec, uint32_t totalDelayMS,
60 int32_t clockDrift, uint32_t micLevel, 60 int32_t clockDrift, uint32_t micLevel,
61 bool keyPressed, 61 bool keyPressed,
62 uint32_t& newMicLevel) override; 62 uint32_t& newMicLevel) override;
63 int32_t NeedMorePlayData(uint32_t nSamples, uint8_t nBytesPerSample, 63 int32_t NeedMorePlayData(size_t nSamples, size_t nBytesPerSample,
64 uint8_t nChannels, uint32_t samplesPerSec, 64 uint8_t nChannels, uint32_t samplesPerSec,
65 void* audioSamples, uint32_t& nSamplesOut, 65 void* audioSamples, size_t& nSamplesOut,
66 int64_t* elapsed_time_ms, 66 int64_t* elapsed_time_ms,
67 int64_t* ntp_time_ms) override; 67 int64_t* ntp_time_ms) override;
68 int OnDataAvailable(const int voe_channels[], int number_of_voe_channels, 68 int OnDataAvailable(const int voe_channels[], int number_of_voe_channels,
69 const int16_t* audio_data, int sample_rate, 69 const int16_t* audio_data, int sample_rate,
70 int number_of_channels, int number_of_frames, 70 int number_of_channels, size_t number_of_frames,
71 int audio_delay_milliseconds, int volume, 71 int audio_delay_milliseconds, int volume,
72 bool key_pressed, bool need_audio_processing) override; 72 bool key_pressed, bool need_audio_processing) override;
73 void OnData(int voe_channel, const void* audio_data, int bits_per_sample, 73 void OnData(int voe_channel, const void* audio_data, int bits_per_sample,
74 int sample_rate, int number_of_channels, 74 int sample_rate, int number_of_channels,
75 int number_of_frames) override; 75 size_t number_of_frames) override;
76 void PushCaptureData(int voe_channel, const void* audio_data, 76 void PushCaptureData(int voe_channel, const void* audio_data,
77 int bits_per_sample, int sample_rate, 77 int bits_per_sample, int sample_rate,
78 int number_of_channels, int number_of_frames) override; 78 int number_of_channels,
79 size_t number_of_frames) override;
79 void PullRenderData(int bits_per_sample, int sample_rate, 80 void PullRenderData(int bits_per_sample, int sample_rate,
80 int number_of_channels, int number_of_frames, 81 int number_of_channels, size_t number_of_frames,
81 void* audio_data, int64_t* elapsed_time_ms, 82 void* audio_data, int64_t* elapsed_time_ms,
82 int64_t* ntp_time_ms) override; 83 int64_t* ntp_time_ms) override;
83 84
84 // AudioDeviceObserver 85 // AudioDeviceObserver
85 void OnErrorIsReported(ErrorCode error) override; 86 void OnErrorIsReported(ErrorCode error) override;
86 void OnWarningIsReported(WarningCode warning) override; 87 void OnWarningIsReported(WarningCode warning) override;
87 88
88 protected: 89 protected:
89 VoEBaseImpl(voe::SharedData* shared); 90 VoEBaseImpl(voe::SharedData* shared);
90 ~VoEBaseImpl() override; 91 ~VoEBaseImpl() override;
91 92
92 private: 93 private:
93 int32_t StartPlayout(); 94 int32_t StartPlayout();
94 int32_t StopPlayout(); 95 int32_t StopPlayout();
95 int32_t StartSend(); 96 int32_t StartSend();
96 int32_t StopSend(); 97 int32_t StopSend();
97 int32_t TerminateInternal(); 98 int32_t TerminateInternal();
98 99
99 // Helper function to process the recorded data with AudioProcessing Module, 100 // Helper function to process the recorded data with AudioProcessing Module,
100 // demultiplex the data to specific voe channels, encode and send to the 101 // demultiplex the data to specific voe channels, encode and send to the
101 // network. When |number_of_VoE_channels| is 0, it will demultiplex the 102 // network. When |number_of_VoE_channels| is 0, it will demultiplex the
102 // data to all the existing VoE channels. 103 // data to all the existing VoE channels.
103 // It returns new AGC microphone volume or 0 if no volume changes 104 // It returns new AGC microphone volume or 0 if no volume changes
104 // should be done. 105 // should be done.
105 int ProcessRecordedDataWithAPM( 106 int ProcessRecordedDataWithAPM(
106 const int voe_channels[], int number_of_voe_channels, 107 const int voe_channels[], int number_of_voe_channels,
107 const void* audio_data, uint32_t sample_rate, uint8_t number_of_channels, 108 const void* audio_data, uint32_t sample_rate, uint8_t number_of_channels,
108 uint32_t number_of_frames, uint32_t audio_delay_milliseconds, 109 size_t number_of_frames, uint32_t audio_delay_milliseconds,
109 int32_t clock_drift, uint32_t volume, bool key_pressed); 110 int32_t clock_drift, uint32_t volume, bool key_pressed);
110 111
111 void GetPlayoutData(int sample_rate, int number_of_channels, 112 void GetPlayoutData(int sample_rate, int number_of_channels,
112 int number_of_frames, bool feed_data_to_apm, 113 size_t number_of_frames, bool feed_data_to_apm,
113 void* audio_data, int64_t* elapsed_time_ms, 114 void* audio_data, int64_t* elapsed_time_ms,
114 int64_t* ntp_time_ms); 115 int64_t* ntp_time_ms);
115 116
116 int32_t AddVoEVersion(char* str) const; 117 int32_t AddVoEVersion(char* str) const;
117 118
118 // Initialize channel by setting Engine Information then initializing 119 // Initialize channel by setting Engine Information then initializing
119 // channel. 120 // channel.
120 int InitializeChannel(voe::ChannelOwner* channel_owner); 121 int InitializeChannel(voe::ChannelOwner* channel_owner);
121 #ifdef WEBRTC_EXTERNAL_TRANSPORT 122 #ifdef WEBRTC_EXTERNAL_TRANSPORT
122 int32_t AddExternalTransportBuild(char* str) const; 123 int32_t AddExternalTransportBuild(char* str) const;
123 #endif 124 #endif
124 VoiceEngineObserver* voiceEngineObserverPtr_; 125 VoiceEngineObserver* voiceEngineObserverPtr_;
125 CriticalSectionWrapper& callbackCritSect_; 126 CriticalSectionWrapper& callbackCritSect_;
126 127
127 AudioFrame audioFrame_; 128 AudioFrame audioFrame_;
128 voe::SharedData* shared_; 129 voe::SharedData* shared_;
129 }; 130 };
130 131
131 } // namespace webrtc 132 } // namespace webrtc
132 133
133 #endif // WEBRTC_VOICE_ENGINE_VOE_BASE_IMPL_H 134 #endif // WEBRTC_VOICE_ENGINE_VOE_BASE_IMPL_H
OLDNEW
« no previous file with comments | « webrtc/voice_engine/utility_unittest.cc ('k') | webrtc/voice_engine/voe_base_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698