 Chromium Code Reviews
 Chromium Code Reviews Issue 2306083002:
  Adding basic implementation of AudioNetworkAdaptor.  (Closed)
    
  
    Issue 2306083002:
  Adding basic implementation of AudioNetworkAdaptor.  (Closed) 
  | OLD | NEW | 
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | |
| 3 * | |
| 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 | |
| 6 * tree. An additional intellectual property rights grant can be found | |
| 7 * in the file PATENTS. All contributing project authors may | |
| 8 * be found in the AUTHORS file in the root of the source tree. | |
| 9 */ | |
| 10 | |
| 11 #ifndef WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_CONTROLLER_MANAGER_H_ | |
| 12 #define WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_CONTROLLER_MANAGER_H_ | |
| 13 | |
| 14 #include <memory> | |
| 15 #include <vector> | |
| 16 | |
| 17 #include "webrtc/base/constructormagic.h" | |
| 18 #include "webrtc/modules/audio_coding/audio_network_adaptor/controller.h" | |
| 19 | |
| 20 namespace webrtc { | |
| 21 | |
| 22 class ControllerManager { | |
| 23 public: | |
| 24 virtual ~ControllerManager() = default; | |
| 25 | |
| 26 // Sort controllers based on their significance. | |
| 27 virtual std::vector<Controller*> GetSortedControllers( | |
| 28 const Controller::NetworkMetrics& metrics) = 0; | |
| 29 | |
| 30 virtual std::vector<Controller*> GetControllers() const = 0; | |
| 31 }; | |
| 
kwiberg-webrtc
2016/09/13 11:11:42
Clean split between interface and implementation.
 | |
| 32 | |
| 33 class ControllerManagerImpl final : public ControllerManager { | |
| 34 public: | |
| 35 struct Config { | |
| 36 Config(); | |
| 37 ~Config(); | |
| 38 }; | |
| 
kwiberg-webrtc
2016/09/13 11:11:42
This one doesn't seem to be doing anything importa
 | |
| 39 | |
| 40 explicit ControllerManagerImpl(const Config& config); | |
| 
kwiberg-webrtc
2016/09/13 11:11:42
This constructor seems useless. I assume later CLs
 | |
| 41 | |
| 42 // Dependency injection for testing. | |
| 43 ControllerManagerImpl(const Config& config, | |
| 44 std::vector<std::unique_ptr<Controller>> controllers); | |
| 
kwiberg-webrtc
2016/09/13 11:11:42
Consider whether the same arguments as for AudioNe
 
minyue-webrtc
2016/09/13 11:48:50
Yes, ControllerManagerImpl(const Config& config) i
 
kwiberg-webrtc
2016/09/13 12:34:57
OK. I expect I'll have further comments on this to
 | |
| 45 | |
| 46 ~ControllerManagerImpl() override; | |
| 47 | |
| 48 // Sort controllers based on their significance. | |
| 49 std::vector<Controller*> GetSortedControllers( | |
| 50 const Controller::NetworkMetrics& metrics) override; | |
| 51 | |
| 52 std::vector<Controller*> GetControllers() const override; | |
| 53 | |
| 54 private: | |
| 55 const Config config_; | |
| 56 | |
| 57 std::vector<std::unique_ptr<Controller>> controllers_; | |
| 58 | |
| 59 std::vector<Controller*> default_sorted_controllers_; | |
| 60 | |
| 61 RTC_DISALLOW_COPY_AND_ASSIGN(ControllerManagerImpl); | |
| 62 }; | |
| 63 | |
| 64 } // namespace webrtc | |
| 65 | |
| 66 #endif // WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_CONTROLLER_MANAGER_ H_ | |
| OLD | NEW |