OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 |
11 #ifndef WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_AUDIO_NETWORK_ADAPTOR_
IMPL_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_AUDIO_NETWORK_ADAPTOR_
IMPL_H_ |
12 #define WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_AUDIO_NETWORK_ADAPTOR_
IMPL_H_ | 12 #define WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_AUDIO_NETWORK_ADAPTOR_
IMPL_H_ |
13 | 13 |
14 #include <memory> | 14 #include <memory> |
15 | 15 |
16 #include "webrtc/base/constructormagic.h" | 16 #include "webrtc/base/constructormagic.h" |
17 #include "webrtc/modules/audio_coding/audio_network_adaptor/controller.h" | 17 #include "webrtc/modules/audio_coding/audio_network_adaptor/controller.h" |
18 #include "webrtc/modules/audio_coding/audio_network_adaptor/controller_manager.h
" | 18 #include "webrtc/modules/audio_coding/audio_network_adaptor/controller_manager.h
" |
19 #include "webrtc/modules/audio_coding/audio_network_adaptor/debug_dump_writer.h" | |
20 #include "webrtc/modules/audio_coding/audio_network_adaptor/include/audio_networ
k_adaptor.h" | 19 #include "webrtc/modules/audio_coding/audio_network_adaptor/include/audio_networ
k_adaptor.h" |
21 #include "webrtc/system_wrappers/include/clock.h" | |
22 | 20 |
23 namespace webrtc { | 21 namespace webrtc { |
24 | 22 |
25 class AudioNetworkAdaptorImpl final : public AudioNetworkAdaptor { | 23 class AudioNetworkAdaptorImpl final : public AudioNetworkAdaptor { |
26 public: | 24 public: |
27 struct Config { | 25 struct Config { |
28 Config(); | 26 Config(); |
29 ~Config(); | 27 ~Config(); |
30 const Clock* clock; | |
31 }; | 28 }; |
32 | 29 |
33 AudioNetworkAdaptorImpl( | 30 AudioNetworkAdaptorImpl( |
34 const Config& config, | 31 const Config& config, |
35 std::unique_ptr<ControllerManager> controller_manager); | 32 std::unique_ptr<ControllerManager> controller_manager); |
36 | 33 |
37 // Dependency injection for testing. | |
38 AudioNetworkAdaptorImpl( | |
39 const Config& config, | |
40 std::unique_ptr<ControllerManager> controller_manager, | |
41 std::unique_ptr<DebugDumpWriter> debug_dump_writer = nullptr); | |
42 | |
43 ~AudioNetworkAdaptorImpl() override; | 34 ~AudioNetworkAdaptorImpl() override; |
44 | 35 |
45 void SetUplinkBandwidth(int uplink_bandwidth_bps) override; | 36 void SetUplinkBandwidth(int uplink_bandwidth_bps) override; |
46 | 37 |
47 void SetUplinkPacketLossFraction(float uplink_packet_loss_fraction) override; | 38 void SetUplinkPacketLossFraction(float uplink_packet_loss_fraction) override; |
48 | 39 |
49 void SetRtt(int rtt_ms) override; | |
50 | |
51 void SetReceiverFrameLengthRange(int min_frame_length_ms, | 40 void SetReceiverFrameLengthRange(int min_frame_length_ms, |
52 int max_frame_length_ms) override; | 41 int max_frame_length_ms) override; |
53 | 42 |
54 EncoderRuntimeConfig GetEncoderRuntimeConfig() override; | 43 EncoderRuntimeConfig GetEncoderRuntimeConfig() override; |
55 | 44 |
56 void StartDebugDump(FILE* file_handle) override; | 45 void StartDebugDump(FILE* file_handle) override; |
57 | 46 |
58 void StopDebugDump() override; | |
59 | |
60 private: | 47 private: |
61 void DumpNetworkMetrics(); | |
62 | |
63 const Config config_; | 48 const Config config_; |
64 | 49 |
65 std::unique_ptr<ControllerManager> controller_manager_; | 50 std::unique_ptr<ControllerManager> controller_manager_; |
66 | 51 |
67 std::unique_ptr<DebugDumpWriter> debug_dump_writer_; | |
68 | |
69 Controller::NetworkMetrics last_metrics_; | 52 Controller::NetworkMetrics last_metrics_; |
70 | 53 |
71 RTC_DISALLOW_COPY_AND_ASSIGN(AudioNetworkAdaptorImpl); | 54 RTC_DISALLOW_COPY_AND_ASSIGN(AudioNetworkAdaptorImpl); |
72 }; | 55 }; |
73 | 56 |
74 } // namespace webrtc | 57 } // namespace webrtc |
75 | 58 |
76 #endif // WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_AUDIO_NETWORK_ADAPT
OR_IMPL_H_ | 59 #endif // WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_AUDIO_NETWORK_ADAPT
OR_IMPL_H_ |
OLD | NEW |