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

Side by Side Diff: webrtc/voice_engine/voe_base_impl.h

Issue 2665693002: Moves channel-dependent audio input processing to separate encoder task queue (Closed)
Patch Set: Removed debug logs in ADB Created 3 years, 8 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 int GetVersion(char version[1024]) override; 56 int GetVersion(char version[1024]) override;
57 57
58 int LastError() override; 58 int LastError() override;
59 59
60 AudioTransport* audio_transport() override { return this; } 60 AudioTransport* audio_transport() override { return this; }
61 61
62 int AssociateSendChannel(int channel, int accociate_send_channel) override; 62 int AssociateSendChannel(int channel, int accociate_send_channel) override;
63 63
64 // AudioTransport 64 // AudioTransport
65 int32_t RecordedDataIsAvailable(const void* audioSamples, 65 int32_t RecordedDataIsAvailable(const void* audio_data,
66 const size_t nSamples, 66 const size_t number_of_frames,
67 const size_t nBytesPerSample, 67 const size_t bytes_per_sample,
68 const size_t nChannels, 68 const size_t number_of_channels,
69 const uint32_t samplesPerSec, 69 const uint32_t sample_rate,
70 const uint32_t totalDelayMS, 70 const uint32_t audio_delay_milliseconds,
71 const int32_t clockDrift, 71 const int32_t clock_drift,
72 const uint32_t currentMicLevel, 72 const uint32_t volume,
73 const bool keyPressed, 73 const bool key_pressed,
74 uint32_t& newMicLevel) override; 74 uint32_t& new_mic_volume) override;
75 int32_t NeedMorePlayData(const size_t nSamples, 75 int32_t NeedMorePlayData(const size_t nSamples,
76 const size_t nBytesPerSample, 76 const size_t nBytesPerSample,
77 const size_t nChannels, 77 const size_t nChannels,
78 const uint32_t samplesPerSec, 78 const uint32_t samplesPerSec,
79 void* audioSamples, 79 void* audioSamples,
80 size_t& nSamplesOut, 80 size_t& nSamplesOut,
81 int64_t* elapsed_time_ms, 81 int64_t* elapsed_time_ms,
82 int64_t* ntp_time_ms) override; 82 int64_t* ntp_time_ms) override;
83 void PushCaptureData(int voe_channel, 83 void PushCaptureData(int voe_channel,
84 const void* audio_data, 84 const void* audio_data,
(...skipping 17 matching lines...) Expand all
102 VoEBaseImpl(voe::SharedData* shared); 102 VoEBaseImpl(voe::SharedData* shared);
103 ~VoEBaseImpl() override; 103 ~VoEBaseImpl() override;
104 104
105 private: 105 private:
106 int32_t StartPlayout(); 106 int32_t StartPlayout();
107 int32_t StopPlayout(); 107 int32_t StopPlayout();
108 int32_t StartSend(); 108 int32_t StartSend();
109 int32_t StopSend(); 109 int32_t StopSend();
110 int32_t TerminateInternal(); 110 int32_t TerminateInternal();
111 111
112 // Helper function to process the recorded data with AudioProcessing Module,
113 // demultiplex the data to specific voe channels, encode and send to the
114 // network. When |number_of_VoE_channels| is 0, it will demultiplex the
115 // data to all the existing VoE channels.
116 // It returns new AGC microphone volume or 0 if no volume changes
117 // should be done.
118 int ProcessRecordedDataWithAPM(
119 const int voe_channels[], size_t number_of_voe_channels,
120 const void* audio_data, uint32_t sample_rate, size_t number_of_channels,
121 size_t number_of_frames, uint32_t audio_delay_milliseconds,
122 int32_t clock_drift, uint32_t volume, bool key_pressed);
123
124 void GetPlayoutData(int sample_rate, size_t number_of_channels, 112 void GetPlayoutData(int sample_rate, size_t number_of_channels,
125 size_t number_of_frames, bool feed_data_to_apm, 113 size_t number_of_frames, bool feed_data_to_apm,
126 void* audio_data, int64_t* elapsed_time_ms, 114 void* audio_data, int64_t* elapsed_time_ms,
127 int64_t* ntp_time_ms); 115 int64_t* ntp_time_ms);
128 116
129 // Initialize channel by setting Engine Information then initializing 117 // Initialize channel by setting Engine Information then initializing
130 // channel. 118 // channel.
131 int InitializeChannel(voe::ChannelOwner* channel_owner); 119 int InitializeChannel(voe::ChannelOwner* channel_owner);
132 VoiceEngineObserver* voiceEngineObserverPtr_; 120 VoiceEngineObserver* voiceEngineObserverPtr_;
133 rtc::CriticalSection callbackCritSect_; 121 rtc::CriticalSection callbackCritSect_;
134 rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_; 122 rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_;
135 123
136 AudioFrame audioFrame_; 124 AudioFrame audioFrame_;
137 voe::SharedData* shared_; 125 voe::SharedData* shared_;
138 }; 126 };
139 127
140 } // namespace webrtc 128 } // namespace webrtc
141 129
142 #endif // WEBRTC_VOICE_ENGINE_VOE_BASE_IMPL_H 130 #endif // WEBRTC_VOICE_ENGINE_VOE_BASE_IMPL_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698