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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // at each Encode() call. The caller can use the return value to determine | 54 // at each Encode() call. The caller can use the return value to determine |
55 // the size of the buffer that needs to be allocated. This value is allowed | 55 // the size of the buffer that needs to be allocated. This value is allowed |
56 // to depend on encoder parameters like bitrate, frame size etc., so if | 56 // to depend on encoder parameters like bitrate, frame size etc., so if |
57 // any of these change, the caller of Encode() is responsible for checking | 57 // any of these change, the caller of Encode() is responsible for checking |
58 // that the buffer is large enough by calling MaxEncodedBytes() again. | 58 // that the buffer is large enough by calling MaxEncodedBytes() again. |
59 virtual size_t MaxEncodedBytes() const = 0; | 59 virtual size_t MaxEncodedBytes() const = 0; |
60 | 60 |
61 // Returns the input sample rate in Hz and the number of input channels. | 61 // Returns the input sample rate in Hz and the number of input channels. |
62 // These are constants set at instantiation time. | 62 // These are constants set at instantiation time. |
63 virtual int SampleRateHz() const = 0; | 63 virtual int SampleRateHz() const = 0; |
64 virtual int NumChannels() const = 0; | 64 virtual size_t NumChannels() const = 0; |
65 | 65 |
66 // Returns the rate at which the RTP timestamps are updated. The default | 66 // Returns the rate at which the RTP timestamps are updated. The default |
67 // implementation returns SampleRateHz(). | 67 // implementation returns SampleRateHz(). |
68 virtual int RtpTimestampRateHz() const; | 68 virtual int RtpTimestampRateHz() const; |
69 | 69 |
70 // Returns the number of 10 ms frames the encoder will put in the next | 70 // Returns the number of 10 ms frames the encoder will put in the next |
71 // packet. This value may only change when Encode() outputs a packet; i.e., | 71 // packet. This value may only change when Encode() outputs a packet; i.e., |
72 // the encoder may vary the number of 10 ms frames from packet to packet, but | 72 // the encoder may vary the number of 10 ms frames from packet to packet, but |
73 // it must decide the length of the next packet no later than when outputting | 73 // it must decide the length of the next packet no later than when outputting |
74 // the preceding packet. | 74 // the preceding packet. |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 // does nothing. | 134 // does nothing. |
135 virtual void SetProjectedPacketLossRate(double fraction); | 135 virtual void SetProjectedPacketLossRate(double fraction); |
136 | 136 |
137 // 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 |
138 // 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 |
139 // implementation does the latter). | 139 // implementation does the latter). |
140 virtual void SetTargetBitrate(int target_bps); | 140 virtual void SetTargetBitrate(int target_bps); |
141 }; | 141 }; |
142 } // namespace webrtc | 142 } // namespace webrtc |
143 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_H_ | 143 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_H_ |
OLD | NEW |