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

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

Issue 2425223002: NetEq now works with packets as values, rather than pointers. (Closed)
Patch Set: Compare packets better in test. One more const. Created 4 years, 1 month 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/neteq/comfort_noise.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 27 matching lines...) Expand all
38 first_call_(true), 38 first_call_(true),
39 overlap_length_(5 * fs_hz_ / 8000), 39 overlap_length_(5 * fs_hz_ / 8000),
40 decoder_database_(decoder_database), 40 decoder_database_(decoder_database),
41 sync_buffer_(sync_buffer) { 41 sync_buffer_(sync_buffer) {
42 } 42 }
43 43
44 // Resets the state. Should be called before each new comfort noise period. 44 // Resets the state. Should be called before each new comfort noise period.
45 void Reset(); 45 void Reset();
46 46
47 // Update the comfort noise generator with the parameters in |packet|. 47 // Update the comfort noise generator with the parameters in |packet|.
48 // Will delete the packet. 48 int UpdateParameters(const Packet& packet);
49 int UpdateParameters(Packet* packet);
50 49
51 // Generates |requested_length| samples of comfort noise and writes to 50 // Generates |requested_length| samples of comfort noise and writes to
52 // |output|. If this is the first in call after Reset (or first after creating 51 // |output|. If this is the first in call after Reset (or first after creating
53 // the object), it will also mix in comfort noise at the end of the 52 // the object), it will also mix in comfort noise at the end of the
54 // SyncBuffer object provided in the constructor. 53 // SyncBuffer object provided in the constructor.
55 int Generate(size_t requested_length, AudioMultiVector* output); 54 int Generate(size_t requested_length, AudioMultiVector* output);
56 55
57 // Returns the last error code that was produced by the comfort noise 56 // Returns the last error code that was produced by the comfort noise
58 // decoder. Returns 0 if no error has been encountered since the last reset. 57 // decoder. Returns 0 if no error has been encountered since the last reset.
59 int internal_error_code() { return internal_error_code_; } 58 int internal_error_code() { return internal_error_code_; }
60 59
61 private: 60 private:
62 int fs_hz_; 61 int fs_hz_;
63 bool first_call_; 62 bool first_call_;
64 size_t overlap_length_; 63 size_t overlap_length_;
65 DecoderDatabase* decoder_database_; 64 DecoderDatabase* decoder_database_;
66 SyncBuffer* sync_buffer_; 65 SyncBuffer* sync_buffer_;
67 int internal_error_code_; 66 int internal_error_code_;
68 RTC_DISALLOW_COPY_AND_ASSIGN(ComfortNoise); 67 RTC_DISALLOW_COPY_AND_ASSIGN(ComfortNoise);
69 }; 68 };
70 69
71 } // namespace webrtc 70 } // namespace webrtc
72 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_COMFORT_NOISE_H_ 71 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_COMFORT_NOISE_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/neteq/comfort_noise.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698