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

Side by Side Diff: webrtc/modules/audio_coding/acm2/audio_coding_module_impl.h

Issue 1673213002: AudioCodingModule: Add methods for injecting external encoder stacks (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: more docs Created 4 years, 10 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 ///////////////////////////////////////// 40 /////////////////////////////////////////
41 // Sender 41 // Sender
42 // 42 //
43 43
44 // Can be called multiple times for Codec, CNG, RED. 44 // Can be called multiple times for Codec, CNG, RED.
45 int RegisterSendCodec(const CodecInst& send_codec) override; 45 int RegisterSendCodec(const CodecInst& send_codec) override;
46 46
47 void RegisterExternalSendCodec( 47 void RegisterExternalSendCodec(
48 AudioEncoder* external_speech_encoder) override; 48 AudioEncoder* external_speech_encoder) override;
49 49
50 void VisitEncoder(const EncoderVisitor& ev) override;
51
50 // Get current send codec. 52 // Get current send codec.
51 rtc::Optional<CodecInst> SendCodec() const override; 53 rtc::Optional<CodecInst> SendCodec() const override;
52 54
53 // Get current send frequency. 55 // Get current send frequency.
54 int SendFrequency() const override; 56 int SendFrequency() const override;
55 57
56 // Sets the bitrate to the specified value in bits/sec. In case the codec does 58 // Sets the bitrate to the specified value in bits/sec. In case the codec does
57 // not support the requested value it will choose an appropriate value 59 // not support the requested value it will choose an appropriate value
58 // instead. 60 // instead.
59 void SetBitRate(int bitrate_bps) override; 61 void SetBitRate(int bitrate_bps) override;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 112
111 // Initialize receiver, resets codec database etc. 113 // Initialize receiver, resets codec database etc.
112 int InitializeReceiver() override; 114 int InitializeReceiver() override;
113 115
114 // Get current receive frequency. 116 // Get current receive frequency.
115 int ReceiveFrequency() const override; 117 int ReceiveFrequency() const override;
116 118
117 // Get current playout frequency. 119 // Get current playout frequency.
118 int PlayoutFrequency() const override; 120 int PlayoutFrequency() const override;
119 121
120 // Register possible receive codecs, can be called multiple times,
121 // for codecs, CNG, DTMF, RED.
122 int RegisterReceiveCodec(const CodecInst& receive_codec) override; 122 int RegisterReceiveCodec(const CodecInst& receive_codec) override;
123 int RegisterReceiveCodec(const CodecInst& receive_codec,
124 const DecoderFactory& df) override;
123 125
124 int RegisterExternalReceiveCodec(int rtp_payload_type, 126 int RegisterExternalReceiveCodec(int rtp_payload_type,
125 AudioDecoder* external_decoder, 127 AudioDecoder* external_decoder,
126 int sample_rate_hz, 128 int sample_rate_hz,
127 int num_channels, 129 int num_channels,
128 const std::string& name) override; 130 const std::string& name) override;
129 131
130 // Get current received codec. 132 // Get current received codec.
131 int ReceiveCodec(CodecInst* current_codec) const override; 133 int ReceiveCodec(CodecInst* current_codec) const override;
132 134
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 // Logs the new value if it is different from the last logged value, or if 206 // Logs the new value if it is different from the last logged value, or if
205 // this is the first call. 207 // this is the first call.
206 void MaybeLog(int value); 208 void MaybeLog(int value);
207 209
208 private: 210 private:
209 int last_value_ = 0; 211 int last_value_ = 0;
210 int first_time_ = true; 212 int first_time_ = true;
211 const std::string histogram_name_; 213 const std::string histogram_name_;
212 }; 214 };
213 215
216 int RegisterReceiveCodecUnlocked(const CodecInst& codec,
217 const DecoderFactory& df)
218 EXCLUSIVE_LOCKS_REQUIRED(acm_crit_sect_);
219
214 int Add10MsDataInternal(const AudioFrame& audio_frame, InputData* input_data) 220 int Add10MsDataInternal(const AudioFrame& audio_frame, InputData* input_data)
215 EXCLUSIVE_LOCKS_REQUIRED(acm_crit_sect_); 221 EXCLUSIVE_LOCKS_REQUIRED(acm_crit_sect_);
216 int Encode(const InputData& input_data) 222 int Encode(const InputData& input_data)
217 EXCLUSIVE_LOCKS_REQUIRED(acm_crit_sect_); 223 EXCLUSIVE_LOCKS_REQUIRED(acm_crit_sect_);
218 224
219 int InitializeReceiverSafe() EXCLUSIVE_LOCKS_REQUIRED(acm_crit_sect_); 225 int InitializeReceiverSafe() EXCLUSIVE_LOCKS_REQUIRED(acm_crit_sect_);
220 226
221 bool HaveValidEncoder(const char* caller_name) const 227 bool HaveValidEncoder(const char* caller_name) const
222 EXCLUSIVE_LOCKS_REQUIRED(acm_crit_sect_); 228 EXCLUSIVE_LOCKS_REQUIRED(acm_crit_sect_);
223 229
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 rtc::CriticalSection callback_crit_sect_; 289 rtc::CriticalSection callback_crit_sect_;
284 AudioPacketizationCallback* packetization_callback_ 290 AudioPacketizationCallback* packetization_callback_
285 GUARDED_BY(callback_crit_sect_); 291 GUARDED_BY(callback_crit_sect_);
286 ACMVADCallback* vad_callback_ GUARDED_BY(callback_crit_sect_); 292 ACMVADCallback* vad_callback_ GUARDED_BY(callback_crit_sect_);
287 }; 293 };
288 294
289 } // namespace acm2 295 } // namespace acm2
290 } // namespace webrtc 296 } // namespace webrtc
291 297
292 #endif // WEBRTC_MODULES_AUDIO_CODING_ACM2_AUDIO_CODING_MODULE_IMPL_H_ 298 #endif // WEBRTC_MODULES_AUDIO_CODING_ACM2_AUDIO_CODING_MODULE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698