Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 142 // the range [0.0, 1.0]. The encoder would typically use this information to | 142 // the range [0.0, 1.0]. The encoder would typically use this information to |
| 143 // adjust channel coding efforts, such as FEC. The default implementation | 143 // adjust channel coding efforts, such as FEC. The default implementation |
| 144 // does nothing. | 144 // does nothing. |
| 145 virtual void SetProjectedPacketLossRate(double fraction); | 145 virtual void SetProjectedPacketLossRate(double fraction); |
| 146 | 146 |
| 147 // Tells the encoder what average bitrate we'd like it to produce. The | 147 // Tells the encoder what average bitrate we'd like it to produce. The |
| 148 // encoder is free to adjust or disregard the given bitrate (the default | 148 // encoder is free to adjust or disregard the given bitrate (the default |
| 149 // implementation does the latter). | 149 // implementation does the latter). |
| 150 virtual void SetTargetBitrate(int target_bps); | 150 virtual void SetTargetBitrate(int target_bps); |
| 151 | 151 |
| 152 // Causes this encoder to let go of any other encoders it contains, and | |
| 153 // returns a pointer to an array where they are stored (which is required to | |
| 154 // live as long as this encoder). Unless the returned array is empty, you may | |
| 155 // not call any methods on this encoder afterwards, except for the | |
| 156 // destructor. The default implementation just returns an empty array. | |
| 157 // NOTE: This method is subject to change. Do not call or override it. | |
| 158 virtual rtc::ArrayView<std::unique_ptr<AudioEncoder>> | |
| 159 ReclaimContainedEncoders(); | |
|
kwiberg-webrtc
2016/06/22 13:46:12
This method is something of a hack. Hopefully, we'
| |
| 160 | |
| 152 protected: | 161 protected: |
| 153 // Subclasses implement this to perform the actual encoding. Called by | 162 // Subclasses implement this to perform the actual encoding. Called by |
| 154 // Encode(). | 163 // Encode(). |
| 155 virtual EncodedInfo EncodeImpl(uint32_t rtp_timestamp, | 164 virtual EncodedInfo EncodeImpl(uint32_t rtp_timestamp, |
| 156 rtc::ArrayView<const int16_t> audio, | 165 rtc::ArrayView<const int16_t> audio, |
| 157 rtc::Buffer* encoded) = 0; | 166 rtc::Buffer* encoded) = 0; |
| 158 }; | 167 }; |
| 159 } // namespace webrtc | 168 } // namespace webrtc |
| 160 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_H_ | 169 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_H_ |
| OLD | NEW |