Chromium Code Reviews| Index: webrtc/modules/audio_coding/audio_network_adaptor/frame_length_controller.h |
| diff --git a/webrtc/modules/audio_coding/audio_network_adaptor/frame_length_controller.h b/webrtc/modules/audio_coding/audio_network_adaptor/frame_length_controller.h |
| index ba0c1c2ab2d09a2c76f568d9d925b2974f3ffefe..1cb3adb47a25900f42ceab4dc46dcc32122a6135 100644 |
| --- a/webrtc/modules/audio_coding/audio_network_adaptor/frame_length_controller.h |
| +++ b/webrtc/modules/audio_coding/audio_network_adaptor/frame_length_controller.h |
| @@ -23,26 +23,27 @@ namespace webrtc { |
| // of FEC controller. |
| class FrameLengthController final : public Controller { |
| public: |
| + struct FrameLengthChange { |
|
minyue-webrtc
2017/02/02 10:42:08
how about wrapping this into Config?
michaelt
2017/02/02 11:17:18
Good idea.
|
| + FrameLengthChange(int from_frame_length_ms, int to_frame_length_ms); |
| + ~FrameLengthChange(); |
| + bool operator<(const FrameLengthChange& rhs) const; |
| + int from_frame_length_ms; |
| + int to_frame_length_ms; |
| + }; |
| struct Config { |
| - Config(const std::vector<int>& encoder_frame_lengths_ms, |
| - int initial_frame_length_ms, |
| - float fl_increasing_packet_loss_fraction, |
| - float fl_decreasing_packet_loss_fraction, |
| - int fl_20ms_to_60ms_bandwidth_bps, |
| - int fl_60ms_to_20ms_bandwidth_bps); |
| + Config( |
| + const std::vector<int>& encoder_frame_lengths_ms, |
| + int initial_frame_length_ms, |
| + float fl_increasing_packet_loss_fraction, |
| + float fl_decreasing_packet_loss_fraction, |
| + const std::map<FrameLengthChange, int>& frame_length_change_criteria); |
| Config(const Config& other); |
| ~Config(); |
| std::vector<int> encoder_frame_lengths_ms; |
| int initial_frame_length_ms; |
| - // Uplink packet loss fraction below which frame length can increase. |
|
minyue-webrtc
2017/02/02 10:42:08
why removing comment?
michaelt
2017/02/02 11:17:18
Oops
|
| float fl_increasing_packet_loss_fraction; |
| - // Uplink packet loss fraction below which frame length should decrease. |
| float fl_decreasing_packet_loss_fraction; |
| - // Uplink bandwidth below which frame length can switch from 20ms to 60ms. |
| - int fl_20ms_to_60ms_bandwidth_bps; |
| - // Uplink bandwidth above which frame length should switch from 60ms to |
| - // 20ms. |
| - int fl_60ms_to_20ms_bandwidth_bps; |
| + std::map<FrameLengthChange, int> frame_length_change_criteria; |
|
minyue-webrtc
2017/02/02 10:42:08
how about fl_changing_bandwidths_bps? and add a co
michaelt
2017/02/02 11:17:18
Would prefer to keep the old name. But if you insi
minyue-webrtc
2017/02/02 11:37:49
problem is that the old one does not say it is cri
michaelt
2017/02/02 11:57:03
ok, will even fit better to the rest of the config
|
| }; |
| explicit FrameLengthController(const Config& config); |
| @@ -54,16 +55,6 @@ class FrameLengthController final : public Controller { |
| void MakeDecision(AudioNetworkAdaptor::EncoderRuntimeConfig* config) override; |
| private: |
| - friend class FrameLengthControllerForTest; |
| - |
| - struct FrameLengthChange { |
| - FrameLengthChange(int from_frame_length_ms, int to_frame_length_ms); |
| - ~FrameLengthChange(); |
| - bool operator<(const FrameLengthChange& rhs) const; |
| - int from_frame_length_ms; |
| - int to_frame_length_ms; |
| - }; |
| - |
| bool FrameLengthIncreasingDecision( |
| const AudioNetworkAdaptor::EncoderRuntimeConfig& config) const; |
| @@ -74,8 +65,6 @@ class FrameLengthController final : public Controller { |
| std::vector<int>::const_iterator frame_length_ms_; |
| - std::map<FrameLengthChange, int> frame_length_change_criteria_; |
| - |
| rtc::Optional<int> uplink_bandwidth_bps_; |
| rtc::Optional<float> uplink_packet_loss_fraction_; |