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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 73 EncodedInfo(); | 73 EncodedInfo(); |
| 74 EncodedInfo(const EncodedInfo&); | 74 EncodedInfo(const EncodedInfo&); |
| 75 EncodedInfo(EncodedInfo&&); | 75 EncodedInfo(EncodedInfo&&); |
| 76 ~EncodedInfo(); | 76 ~EncodedInfo(); |
| 77 EncodedInfo& operator=(const EncodedInfo&); | 77 EncodedInfo& operator=(const EncodedInfo&); |
| 78 EncodedInfo& operator=(EncodedInfo&&); | 78 EncodedInfo& operator=(EncodedInfo&&); |
| 79 | 79 |
| 80 std::vector<EncodedInfoLeaf> redundant; | 80 std::vector<EncodedInfoLeaf> redundant; |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 // Statistics that can be obtained from an AudioEncoder. | |
| 84 struct AudioEncoderStats { | |
| 85 AudioEncoderStats(); | |
| 86 AudioEncoderStats(const AudioEncoderStats&); | |
| 87 ~AudioEncoderStats(); | |
| 88 rtc::Optional<int> ana_bitrate_action_counter; | |
|
ossu
2017/08/31 13:13:10
Are all these individually optional?
Since they'
ivoc
2017/08/31 14:57:50
I think some Optionality is needed here, since ANA
ossu
2017/08/31 15:40:20
1. If ANA being enabled or not is one statistic we
ivoc
2017/09/01 09:34:24
Re 1: I think it would be a bit strange to have a
ossu
2017/09/01 14:28:52
I guess if we don't really know if other stats wil
ivoc
2017/09/01 15:27:16
Thanks, that sounds like a good plan. As discussed
hbos
2017/09/04 08:49:54
Using optional is correct. If the value is being c
| |
| 89 rtc::Optional<int> ana_channel_action_counter; | |
| 90 rtc::Optional<int> ana_dtx_action_counter; | |
| 91 rtc::Optional<int> ana_fec_action_counter; | |
| 92 rtc::Optional<int> ana_frame_length_action_counter; | |
| 93 }; | |
| 94 | |
| 83 virtual ~AudioEncoder() = default; | 95 virtual ~AudioEncoder() = default; |
| 84 | 96 |
| 85 // Returns the input sample rate in Hz and the number of input channels. | 97 // Returns the input sample rate in Hz and the number of input channels. |
| 86 // These are constants set at instantiation time. | 98 // These are constants set at instantiation time. |
| 87 virtual int SampleRateHz() const = 0; | 99 virtual int SampleRateHz() const = 0; |
| 88 virtual size_t NumChannels() const = 0; | 100 virtual size_t NumChannels() const = 0; |
| 89 | 101 |
| 90 // Returns the rate at which the RTP timestamps are updated. The default | 102 // Returns the rate at which the RTP timestamps are updated. The default |
| 91 // implementation returns SampleRateHz(). | 103 // implementation returns SampleRateHz(). |
| 92 virtual int RtpTimestampRateHz() const; | 104 virtual int RtpTimestampRateHz() const; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 196 | 208 |
| 197 // Provides overhead to this encoder to adapt. The overhead is the number of | 209 // Provides overhead to this encoder to adapt. The overhead is the number of |
| 198 // bytes that will be added to each packet the encoder generates. | 210 // bytes that will be added to each packet the encoder generates. |
| 199 virtual void OnReceivedOverhead(size_t overhead_bytes_per_packet); | 211 virtual void OnReceivedOverhead(size_t overhead_bytes_per_packet); |
| 200 | 212 |
| 201 // To allow encoder to adapt its frame length, it must be provided the frame | 213 // To allow encoder to adapt its frame length, it must be provided the frame |
| 202 // length range that receivers can accept. | 214 // length range that receivers can accept. |
| 203 virtual void SetReceiverFrameLengthRange(int min_frame_length_ms, | 215 virtual void SetReceiverFrameLengthRange(int min_frame_length_ms, |
| 204 int max_frame_length_ms); | 216 int max_frame_length_ms); |
| 205 | 217 |
| 218 // Get statistics related to the audio encoder. | |
| 219 virtual AudioEncoderStats GetStats() const; | |
| 220 | |
| 206 protected: | 221 protected: |
| 207 // Subclasses implement this to perform the actual encoding. Called by | 222 // Subclasses implement this to perform the actual encoding. Called by |
| 208 // Encode(). | 223 // Encode(). |
| 209 virtual EncodedInfo EncodeImpl(uint32_t rtp_timestamp, | 224 virtual EncodedInfo EncodeImpl(uint32_t rtp_timestamp, |
| 210 rtc::ArrayView<const int16_t> audio, | 225 rtc::ArrayView<const int16_t> audio, |
| 211 rtc::Buffer* encoded) = 0; | 226 rtc::Buffer* encoded) = 0; |
| 212 }; | 227 }; |
| 213 } // namespace webrtc | 228 } // namespace webrtc |
| 214 #endif // WEBRTC_API_AUDIO_CODECS_AUDIO_ENCODER_H_ | 229 #endif // WEBRTC_API_AUDIO_CODECS_AUDIO_ENCODER_H_ |
| OLD | NEW |