| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 int frame_size_ms = 20; | 43 int frame_size_ms = 20; |
| 44 size_t num_channels = 1; | 44 size_t num_channels = 1; |
| 45 int payload_type = 120; | 45 int payload_type = 120; |
| 46 ApplicationMode application = kVoip; | 46 ApplicationMode application = kVoip; |
| 47 rtc::Optional<int> bitrate_bps; // Unset means to use default value. | 47 rtc::Optional<int> bitrate_bps; // Unset means to use default value. |
| 48 bool fec_enabled = false; | 48 bool fec_enabled = false; |
| 49 int max_playback_rate_hz = 48000; | 49 int max_playback_rate_hz = 48000; |
| 50 int complexity = kDefaultComplexity; | 50 int complexity = kDefaultComplexity; |
| 51 bool dtx_enabled = false; | 51 bool dtx_enabled = false; |
| 52 std::vector<int> supported_frame_lengths_ms; |
| 52 const Clock* clock = nullptr; | 53 const Clock* clock = nullptr; |
| 53 | 54 |
| 54 private: | 55 private: |
| 55 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) || defined(WEBRTC_ARCH_ARM) | 56 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) || defined(WEBRTC_ARCH_ARM) |
| 56 // If we are on Android, iOS and/or ARM, use a lower complexity setting as | 57 // If we are on Android, iOS and/or ARM, use a lower complexity setting as |
| 57 // default, to save encoder complexity. | 58 // default, to save encoder complexity. |
| 58 static const int kDefaultComplexity = 5; | 59 static const int kDefaultComplexity = 5; |
| 59 #else | 60 #else |
| 60 static const int kDefaultComplexity = 9; | 61 static const int kDefaultComplexity = 9; |
| 61 #endif | 62 #endif |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 bool EnableAudioNetworkAdaptor(const std::string& config_string, | 96 bool EnableAudioNetworkAdaptor(const std::string& config_string, |
| 96 const Clock* clock) override; | 97 const Clock* clock) override; |
| 97 void DisableAudioNetworkAdaptor() override; | 98 void DisableAudioNetworkAdaptor() override; |
| 98 void OnReceivedUplinkBandwidth(int uplink_bandwidth_bps) override; | 99 void OnReceivedUplinkBandwidth(int uplink_bandwidth_bps) override; |
| 99 void OnReceivedUplinkPacketLossFraction( | 100 void OnReceivedUplinkPacketLossFraction( |
| 100 float uplink_packet_loss_fraction) override; | 101 float uplink_packet_loss_fraction) override; |
| 101 void OnReceivedTargetAudioBitrate(int target_audio_bitrate_bps) override; | 102 void OnReceivedTargetAudioBitrate(int target_audio_bitrate_bps) override; |
| 102 void OnReceivedRtt(int rtt_ms) override; | 103 void OnReceivedRtt(int rtt_ms) override; |
| 103 void SetReceiverFrameLengthRange(int min_frame_length_ms, | 104 void SetReceiverFrameLengthRange(int min_frame_length_ms, |
| 104 int max_frame_length_ms) override; | 105 int max_frame_length_ms) override; |
| 106 rtc::ArrayView<const int> supported_frame_lengths_ms() const { |
| 107 return config_.supported_frame_lengths_ms; |
| 108 } |
| 105 | 109 |
| 106 // Getters for testing. | 110 // Getters for testing. |
| 107 double packet_loss_rate() const { return packet_loss_rate_; } | 111 double packet_loss_rate() const { return packet_loss_rate_; } |
| 108 ApplicationMode application() const { return config_.application; } | 112 ApplicationMode application() const { return config_.application; } |
| 109 bool fec_enabled() const { return config_.fec_enabled; } | 113 bool fec_enabled() const { return config_.fec_enabled; } |
| 110 size_t num_channels_to_encode() const { return num_channels_to_encode_; } | 114 size_t num_channels_to_encode() const { return num_channels_to_encode_; } |
| 111 int next_frame_length_ms() const { return next_frame_length_ms_; } | 115 int next_frame_length_ms() const { return next_frame_length_ms_; } |
| 112 | 116 |
| 113 protected: | 117 protected: |
| 114 EncodedInfo EncodeImpl(uint32_t rtp_timestamp, | 118 EncodedInfo EncodeImpl(uint32_t rtp_timestamp, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 139 std::unique_ptr<PacketLossFractionSmoother> packet_loss_fraction_smoother_; | 143 std::unique_ptr<PacketLossFractionSmoother> packet_loss_fraction_smoother_; |
| 140 AudioNetworkAdaptorCreator audio_network_adaptor_creator_; | 144 AudioNetworkAdaptorCreator audio_network_adaptor_creator_; |
| 141 std::unique_ptr<AudioNetworkAdaptor> audio_network_adaptor_; | 145 std::unique_ptr<AudioNetworkAdaptor> audio_network_adaptor_; |
| 142 | 146 |
| 143 RTC_DISALLOW_COPY_AND_ASSIGN(AudioEncoderOpus); | 147 RTC_DISALLOW_COPY_AND_ASSIGN(AudioEncoderOpus); |
| 144 }; | 148 }; |
| 145 | 149 |
| 146 } // namespace webrtc | 150 } // namespace webrtc |
| 147 | 151 |
| 148 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_OPUS_AUDIO_ENCODER_OPUS_H_ | 152 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_OPUS_AUDIO_ENCODER_OPUS_H_ |
| OLD | NEW |