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

Side by Side Diff: webrtc/modules/audio_coding/codecs/audio_encoder.h

Issue 1764583003: Renamed new EncodeInternal to EncodeImpl to ensure proper backwards compatibility. (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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 // Returns the current target bitrate in bits/s. The value -1 means that the 83 // Returns the current target bitrate in bits/s. The value -1 means that the
84 // codec adapts the target automatically, and a current target cannot be 84 // codec adapts the target automatically, and a current target cannot be
85 // provided. 85 // provided.
86 virtual int GetTargetBitrate() const = 0; 86 virtual int GetTargetBitrate() const = 0;
87 87
88 // Accepts one 10 ms block of input audio (i.e., SampleRateHz() / 100 * 88 // Accepts one 10 ms block of input audio (i.e., SampleRateHz() / 100 *
89 // NumChannels() samples). Multi-channel audio must be sample-interleaved. 89 // NumChannels() samples). Multi-channel audio must be sample-interleaved.
90 // The encoder appends zero or more bytes of output to |encoded| and returns 90 // The encoder appends zero or more bytes of output to |encoded| and returns
91 // additional encoding information. Encode() checks some preconditions, calls 91 // additional encoding information. Encode() checks some preconditions, calls
92 // EncodeInternal() which does the actual work, and then checks some 92 // EncodeImpl() which does the actual work, and then checks some
93 // postconditions. 93 // postconditions.
94 EncodedInfo Encode(uint32_t rtp_timestamp, 94 EncodedInfo Encode(uint32_t rtp_timestamp,
95 rtc::ArrayView<const int16_t> audio, 95 rtc::ArrayView<const int16_t> audio,
96 rtc::Buffer* encoded); 96 rtc::Buffer* encoded);
97 97
98 // Deprecated interface to Encode (remove eventually, bug 5591). May incur a 98 // Deprecated interface to Encode (remove eventually, bug 5591). May incur a
99 // copy. The encoder produces zero or more bytes of output in |encoded| and 99 // copy. The encoder produces zero or more bytes of output in |encoded| and
100 // returns additional encoding information. The caller is responsible for 100 // returns additional encoding information. The caller is responsible for
101 // making sure that |max_encoded_bytes| is not smaller than the number of 101 // making sure that |max_encoded_bytes| is not smaller than the number of
102 // bytes actually produced by the encoder. 102 // bytes actually produced by the encoder.
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 // Tells the encoder what average bitrate we'd like it to produce. The 158 // Tells the encoder what average bitrate we'd like it to produce. The
159 // encoder is free to adjust or disregard the given bitrate (the default 159 // encoder is free to adjust or disregard the given bitrate (the default
160 // implementation does the latter). 160 // implementation does the latter).
161 virtual void SetTargetBitrate(int target_bps); 161 virtual void SetTargetBitrate(int target_bps);
162 162
163 protected: 163 protected:
164 // Subclasses implement this to perform the actual encoding. Called by 164 // Subclasses implement this to perform the actual encoding. Called by
165 // Encode(). For compatibility reasons, this is implemented by default as a 165 // Encode(). For compatibility reasons, this is implemented by default as a
166 // call to the older version of EncodeInternal(). At least one of the two 166 // call to the older version of EncodeInternal(). At least one of the two
167 // interfaces of EncodeInternal _must_ be implemented by a subclass. 167 // interfaces of EncodeInternal _must_ be implemented by a subclass.
168 // Preferably this one. 168 // Preferably this one.
kwiberg-webrtc 2016/03/03 13:39:15 This comment needs some tweaking.
169 virtual EncodedInfo EncodeInternal(uint32_t rtp_timestamp, 169 virtual EncodedInfo EncodeImpl(uint32_t rtp_timestamp,
170 rtc::ArrayView<const int16_t> audio, 170 rtc::ArrayView<const int16_t> audio,
171 rtc::Buffer* encoded); 171 rtc::Buffer* encoded);
172 }; 172 };
173 } // namespace webrtc 173 } // namespace webrtc
174 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_H_ 174 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_H_
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/acm2/rent_a_codec_unittest.cc ('k') | webrtc/modules/audio_coding/codecs/audio_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698