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

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

Issue 1764623002: Remove the ID from AcmReceiver (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | webrtc/modules/audio_coding/acm2/acm_receiver.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) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 // -1 if an error occurred. 204 // -1 if an error occurred.
205 // 205 //
206 int RemoveCodec(uint8_t payload_type); 206 int RemoveCodec(uint8_t payload_type);
207 207
208 // 208 //
209 // Remove all registered codecs. 209 // Remove all registered codecs.
210 // 210 //
211 int RemoveAllCodecs(); 211 int RemoveAllCodecs();
212 212
213 // 213 //
214 // Set ID.
215 //
216 void set_id(int id); // TODO(turajs): can be inline.
217
218 //
219 // Gets the RTP timestamp of the last sample delivered by GetAudio(). 214 // Gets the RTP timestamp of the last sample delivered by GetAudio().
220 // Returns true if the RTP timestamp is valid, otherwise false. 215 // Returns true if the RTP timestamp is valid, otherwise false.
221 // 216 //
222 bool GetPlayoutTimestamp(uint32_t* timestamp); 217 bool GetPlayoutTimestamp(uint32_t* timestamp);
223 218
224 // 219 //
225 // Get the audio codec associated with the last non-CNG/non-DTMF received 220 // Get the audio codec associated with the last non-CNG/non-DTMF received
226 // payload. If no non-CNG/non-DTMF packet is received -1 is returned, 221 // payload. If no non-CNG/non-DTMF packet is received -1 is returned,
227 // otherwise return 0. 222 // otherwise return 0.
228 // 223 //
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 void GetDecodingCallStatistics(AudioDecodingCallStats* stats) const; 270 void GetDecodingCallStatistics(AudioDecodingCallStats* stats) const;
276 271
277 private: 272 private:
278 const Decoder* RtpHeaderToDecoder(const RTPHeader& rtp_header, 273 const Decoder* RtpHeaderToDecoder(const RTPHeader& rtp_header,
279 uint8_t payload_type) const 274 uint8_t payload_type) const
280 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); 275 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
281 276
282 uint32_t NowInTimestamp(int decoder_sampling_rate) const; 277 uint32_t NowInTimestamp(int decoder_sampling_rate) const;
283 278
284 rtc::CriticalSection crit_sect_; 279 rtc::CriticalSection crit_sect_;
285 int id_; // TODO(henrik.lundin) Make const.
286 const Decoder* last_audio_decoder_ GUARDED_BY(crit_sect_); 280 const Decoder* last_audio_decoder_ GUARDED_BY(crit_sect_);
287 AudioFrame::VADActivity previous_audio_activity_ GUARDED_BY(crit_sect_); 281 AudioFrame::VADActivity previous_audio_activity_ GUARDED_BY(crit_sect_);
288 ACMResampler resampler_ GUARDED_BY(crit_sect_); 282 ACMResampler resampler_ GUARDED_BY(crit_sect_);
289 // Used in GetAudio, declared as member to avoid allocating every 10ms. 283 // Used in GetAudio, declared as member to avoid allocating every 10ms.
290 // TODO(henrik.lundin) Stack-allocate in GetAudio instead? 284 // TODO(henrik.lundin) Stack-allocate in GetAudio instead?
291 std::unique_ptr<int16_t[]> audio_buffer_ GUARDED_BY(crit_sect_); 285 std::unique_ptr<int16_t[]> audio_buffer_ GUARDED_BY(crit_sect_);
292 std::unique_ptr<int16_t[]> last_audio_buffer_ GUARDED_BY(crit_sect_); 286 std::unique_ptr<int16_t[]> last_audio_buffer_ GUARDED_BY(crit_sect_);
293 CallStatistics call_stats_ GUARDED_BY(crit_sect_); 287 CallStatistics call_stats_ GUARDED_BY(crit_sect_);
294 NetEq* neteq_; 288 NetEq* neteq_;
295 // Decoders map is keyed by payload type 289 // Decoders map is keyed by payload type
296 std::map<uint8_t, Decoder> decoders_ GUARDED_BY(crit_sect_); 290 std::map<uint8_t, Decoder> decoders_ GUARDED_BY(crit_sect_);
297 bool vad_enabled_; 291 bool vad_enabled_;
298 Clock* clock_; // TODO(henrik.lundin) Make const if possible. 292 Clock* clock_; // TODO(henrik.lundin) Make const if possible.
299 bool resampled_last_output_frame_ GUARDED_BY(crit_sect_); 293 bool resampled_last_output_frame_ GUARDED_BY(crit_sect_);
300 rtc::Optional<int> last_packet_sample_rate_hz_ GUARDED_BY(crit_sect_); 294 rtc::Optional<int> last_packet_sample_rate_hz_ GUARDED_BY(crit_sect_);
301 }; 295 };
302 296
303 } // namespace acm2 297 } // namespace acm2
304 298
305 } // namespace webrtc 299 } // namespace webrtc
306 300
307 #endif // WEBRTC_MODULES_AUDIO_CODING_ACM2_ACM_RECEIVER_H_ 301 #endif // WEBRTC_MODULES_AUDIO_CODING_ACM2_ACM_RECEIVER_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/acm2/acm_receiver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698