| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 119 |
| 120 // Sets the application mode. Returns true if the codec was able to comply. | 120 // Sets the application mode. Returns true if the codec was able to comply. |
| 121 // The default implementation just returns false. | 121 // The default implementation just returns false. |
| 122 enum class Application { kSpeech, kAudio }; | 122 enum class Application { kSpeech, kAudio }; |
| 123 virtual bool SetApplication(Application application); | 123 virtual bool SetApplication(Application application); |
| 124 | 124 |
| 125 // Tells the encoder about the highest sample rate the decoder is expected to | 125 // Tells the encoder about the highest sample rate the decoder is expected to |
| 126 // use when decoding the bitstream. The encoder would typically use this | 126 // use when decoding the bitstream. The encoder would typically use this |
| 127 // information to adjust the quality of the encoding. The default | 127 // information to adjust the quality of the encoding. The default |
| 128 // implementation just returns true. | 128 // implementation just returns true. |
| 129 // TODO(kwiberg): Change return value to void, since it doesn't matter | 129 virtual void SetMaxPlaybackRate(int frequency_hz); |
| 130 // whether the encoder approved of the max playback rate or not. | |
| 131 virtual bool SetMaxPlaybackRate(int frequency_hz); | |
| 132 | 130 |
| 133 // Tells the encoder what the projected packet loss rate is. The rate is in | 131 // Tells the encoder what the projected packet loss rate is. The rate is in |
| 134 // the range [0.0, 1.0]. The encoder would typically use this information to | 132 // the range [0.0, 1.0]. The encoder would typically use this information to |
| 135 // adjust channel coding efforts, such as FEC. The default implementation | 133 // adjust channel coding efforts, such as FEC. The default implementation |
| 136 // does nothing. | 134 // does nothing. |
| 137 virtual void SetProjectedPacketLossRate(double fraction); | 135 virtual void SetProjectedPacketLossRate(double fraction); |
| 138 | 136 |
| 139 // Tells the encoder what average bitrate we'd like it to produce. The | 137 // Tells the encoder what average bitrate we'd like it to produce. The |
| 140 // encoder is free to adjust or disregard the given bitrate (the default | 138 // encoder is free to adjust or disregard the given bitrate (the default |
| 141 // implementation does the latter). | 139 // implementation does the latter). |
| 142 virtual void SetTargetBitrate(int target_bps); | 140 virtual void SetTargetBitrate(int target_bps); |
| 143 | 141 |
| 144 // Sets the maximum bitrate which must not be exceeded for any packet. The | 142 // Sets the maximum bitrate which must not be exceeded for any packet. The |
| 145 // encoder is free to adjust or disregard this value (the default | 143 // encoder is free to adjust or disregard this value (the default |
| 146 // implementation does the latter). | 144 // implementation does the latter). |
| 147 virtual void SetMaxBitrate(int max_bps); | 145 virtual void SetMaxBitrate(int max_bps); |
| 148 | 146 |
| 149 // Sets an upper limit on the size of packet payloads produced by the | 147 // Sets an upper limit on the size of packet payloads produced by the |
| 150 // encoder. The encoder is free to adjust or disregard this value (the | 148 // encoder. The encoder is free to adjust or disregard this value (the |
| 151 // default implementation does the latter). | 149 // default implementation does the latter). |
| 152 virtual void SetMaxPayloadSize(int max_payload_size_bytes); | 150 virtual void SetMaxPayloadSize(int max_payload_size_bytes); |
| 153 }; | 151 }; |
| 154 } // namespace webrtc | 152 } // namespace webrtc |
| 155 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_H_ | 153 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_H_ |
| OLD | NEW |