| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // not smaller than the number of bytes actually produced by the encoder. | 64 // not smaller than the number of bytes actually produced by the encoder. |
| 65 EncodedInfo Encode(uint32_t rtp_timestamp, | 65 EncodedInfo Encode(uint32_t rtp_timestamp, |
| 66 const int16_t* audio, | 66 const int16_t* audio, |
| 67 size_t num_samples_per_channel, | 67 size_t num_samples_per_channel, |
| 68 size_t max_encoded_bytes, | 68 size_t max_encoded_bytes, |
| 69 uint8_t* encoded); | 69 uint8_t* encoded); |
| 70 | 70 |
| 71 // Return the input sample rate in Hz and the number of input channels. | 71 // Return the input sample rate in Hz and the number of input channels. |
| 72 // These are constants set at instantiation time. | 72 // These are constants set at instantiation time. |
| 73 virtual int SampleRateHz() const = 0; | 73 virtual int SampleRateHz() const = 0; |
| 74 virtual int NumChannels() const = 0; | 74 virtual size_t NumChannels() const = 0; |
| 75 | 75 |
| 76 // Return the maximum number of bytes that can be produced by the encoder | 76 // Return the maximum number of bytes that can be produced by the encoder |
| 77 // at each Encode() call. The caller can use the return value to determine | 77 // at each Encode() call. The caller can use the return value to determine |
| 78 // the size of the buffer that needs to be allocated. This value is allowed | 78 // the size of the buffer that needs to be allocated. This value is allowed |
| 79 // to depend on encoder parameters like bitrate, frame size etc., so if | 79 // to depend on encoder parameters like bitrate, frame size etc., so if |
| 80 // any of these change, the caller of Encode() is responsible for checking | 80 // any of these change, the caller of Encode() is responsible for checking |
| 81 // that the buffer is large enough by calling MaxEncodedBytes() again. | 81 // that the buffer is large enough by calling MaxEncodedBytes() again. |
| 82 virtual size_t MaxEncodedBytes() const = 0; | 82 virtual size_t MaxEncodedBytes() const = 0; |
| 83 | 83 |
| 84 // Returns the rate with which the RTP timestamps are updated. By default, | 84 // Returns the rate with which the RTP timestamps are updated. By default, |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 // Sets the maximum rate which the codec may not exceed for any packet. | 143 // Sets the maximum rate which the codec may not exceed for any packet. |
| 144 virtual void SetMaxRate(int max_rate_bps) = 0; | 144 virtual void SetMaxRate(int max_rate_bps) = 0; |
| 145 | 145 |
| 146 // Informs the encoder about the maximum sample rate which the decoder will | 146 // Informs the encoder about the maximum sample rate which the decoder will |
| 147 // use when decoding the bitstream. The implementation is free to disregard | 147 // use when decoding the bitstream. The implementation is free to disregard |
| 148 // this hint. | 148 // this hint. |
| 149 virtual bool SetMaxPlaybackRate(int frequency_hz) = 0; | 149 virtual bool SetMaxPlaybackRate(int frequency_hz) = 0; |
| 150 }; | 150 }; |
| 151 } // namespace webrtc | 151 } // namespace webrtc |
| 152 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_H_ | 152 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_H_ |
| OLD | NEW |