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

Side by Side Diff: webrtc/modules/audio_coding/neteq/include/neteq.h

Issue 1965733002: NetEq: Implement muted output (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@muted-expand
Patch Set: Add new tests Created 4 years, 7 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 std::string ToString() const; 86 std::string ToString() const;
87 87
88 int sample_rate_hz; // Initial value. Will change with input data. 88 int sample_rate_hz; // Initial value. Will change with input data.
89 bool enable_audio_classifier; 89 bool enable_audio_classifier;
90 bool enable_post_decode_vad; 90 bool enable_post_decode_vad;
91 size_t max_packets_in_buffer; 91 size_t max_packets_in_buffer;
92 int max_delay_ms; 92 int max_delay_ms;
93 BackgroundNoiseMode background_noise_mode; 93 BackgroundNoiseMode background_noise_mode;
94 NetEqPlayoutMode playout_mode; 94 NetEqPlayoutMode playout_mode;
95 bool enable_fast_accelerate; 95 bool enable_fast_accelerate;
96 bool enable_muted_state = false;
96 }; 97 };
97 98
98 enum ReturnCodes { 99 enum ReturnCodes {
99 kOK = 0, 100 kOK = 0,
100 kFail = -1, 101 kFail = -1,
101 kNotImplemented = -2 102 kNotImplemented = -2
102 }; 103 };
103 104
104 enum ErrorCodes { 105 enum ErrorCodes {
105 kNoError = 0, 106 kNoError = 0,
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 // can be implied by inserting a sync-packet. 155 // can be implied by inserting a sync-packet.
155 // Returns kOk on success, kFail on failure. 156 // Returns kOk on success, kFail on failure.
156 virtual int InsertSyncPacket(const WebRtcRTPHeader& rtp_header, 157 virtual int InsertSyncPacket(const WebRtcRTPHeader& rtp_header,
157 uint32_t receive_timestamp) = 0; 158 uint32_t receive_timestamp) = 0;
158 159
159 // Instructs NetEq to deliver 10 ms of audio data. The data is written to 160 // Instructs NetEq to deliver 10 ms of audio data. The data is written to
160 // |audio_frame|. All data in |audio_frame| is wiped; |data_|, |speech_type_|, 161 // |audio_frame|. All data in |audio_frame| is wiped; |data_|, |speech_type_|,
161 // |num_channels_|, |sample_rate_hz_|, |samples_per_channel_|, and 162 // |num_channels_|, |sample_rate_hz_|, |samples_per_channel_|, and
162 // |vad_activity_| are updated upon success. If an error is returned, some 163 // |vad_activity_| are updated upon success. If an error is returned, some
163 // fields may not have been updated. 164 // fields may not have been updated.
165 // If muted state is enabled (through Config::enable_muted_state), |muted|
166 // may be set to true after a prolonged expand period. When this happens, the
167 // |data_| in |audio_frame| is not written, but should be interpreted as being
168 // all zeros.
164 // Returns kOK on success, or kFail in case of an error. 169 // Returns kOK on success, or kFail in case of an error.
165 virtual int GetAudio(AudioFrame* audio_frame) = 0; 170 virtual int GetAudio(AudioFrame* audio_frame, bool* muted) = 0;
166 171
167 // Associates |rtp_payload_type| with |codec| and |codec_name|, and stores the 172 // Associates |rtp_payload_type| with |codec| and |codec_name|, and stores the
168 // information in the codec database. Returns 0 on success, -1 on failure. 173 // information in the codec database. Returns 0 on success, -1 on failure.
169 // The name is only used to provide information back to the caller about the 174 // The name is only used to provide information back to the caller about the
170 // decoders. Hence, the name is arbitrary, and may be empty. 175 // decoders. Hence, the name is arbitrary, and may be empty.
171 virtual int RegisterPayloadType(NetEqDecoder codec, 176 virtual int RegisterPayloadType(NetEqDecoder codec,
172 const std::string& codec_name, 177 const std::string& codec_name,
173 uint8_t rtp_payload_type) = 0; 178 uint8_t rtp_payload_type) = 0;
174 179
175 // Provides an externally created decoder object |decoder| to insert in the 180 // Provides an externally created decoder object |decoder| to insert in the
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 294
290 protected: 295 protected:
291 NetEq() {} 296 NetEq() {}
292 297
293 private: 298 private:
294 RTC_DISALLOW_COPY_AND_ASSIGN(NetEq); 299 RTC_DISALLOW_COPY_AND_ASSIGN(NetEq);
295 }; 300 };
296 301
297 } // namespace webrtc 302 } // namespace webrtc
298 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_INCLUDE_NETEQ_H_ 303 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_INCLUDE_NETEQ_H_
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/acm2/acm_receiver.cc ('k') | webrtc/modules/audio_coding/neteq/neteq.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698