Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Side by Side Diff: webrtc/modules/audio_coding/audio_network_adaptor/audio_network_adaptor_impl.h

Issue 2356763002: Adding debug dump to audio network adaptor. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
19 #include "webrtc/modules/audio_coding/audio_network_adaptor/include/audio_networ k_adaptor.h" 20 #include "webrtc/modules/audio_coding/audio_network_adaptor/include/audio_networ k_adaptor.h"
21 #include "webrtc/system_wrappers/include/clock.h"
20 22
21 namespace webrtc { 23 namespace webrtc {
22 24
23 class AudioNetworkAdaptorImpl final : public AudioNetworkAdaptor { 25 class AudioNetworkAdaptorImpl final : public AudioNetworkAdaptor {
24 public: 26 public:
25 struct Config { 27 struct Config {
26 Config(); 28 explicit Config(const Clock* clock);
kwiberg-webrtc 2016/09/21 10:54:09 I'd argue that this constructor isn't necessary; i
minyue-webrtc 2016/09/22 15:11:49 Ok. I can ask you about this offline.
27 ~Config(); 29 ~Config();
30 const Clock* clock;
28 }; 31 };
29 32
30 AudioNetworkAdaptorImpl( 33 AudioNetworkAdaptorImpl(
31 const Config& config, 34 const Config& config,
32 std::unique_ptr<ControllerManager> controller_manager); 35 std::unique_ptr<ControllerManager> controller_manager);
33 36
37 // Dependency injection for testing.
38 AudioNetworkAdaptorImpl(const Config& config,
39 std::unique_ptr<ControllerManager> controller_manager,
40 std::unique_ptr<DebugDumpWriter> debug_dump_writer);
41
34 ~AudioNetworkAdaptorImpl() override; 42 ~AudioNetworkAdaptorImpl() override;
35 43
36 void SetUplinkBandwidth(int uplink_bandwidth_bps) override; 44 void SetUplinkBandwidth(int uplink_bandwidth_bps) override;
37 45
38 void SetUplinkPacketLossFraction(float uplink_packet_loss_fraction) override; 46 void SetUplinkPacketLossFraction(float uplink_packet_loss_fraction) override;
39 47
48 void SetRtt(int rtt_ms) override;
49
40 void SetReceiverFrameLengthRange(int min_frame_length_ms, 50 void SetReceiverFrameLengthRange(int min_frame_length_ms,
41 int max_frame_length_ms) override; 51 int max_frame_length_ms) override;
42 52
43 EncoderRuntimeConfig GetEncoderRuntimeConfig() override; 53 EncoderRuntimeConfig GetEncoderRuntimeConfig() override;
44 54
45 void StartDebugDump(FILE* file_handle) override; 55 void StartDebugDump(FILE* file_handle) override;
46 56
57 void StopDebugDump() override;
58
47 private: 59 private:
60 void DumpNetworkMetrics();
61
48 const Config config_; 62 const Config config_;
49 63
50 std::unique_ptr<ControllerManager> controller_manager_; 64 std::unique_ptr<ControllerManager> controller_manager_;
51 65
66 std::unique_ptr<DebugDumpWriter> debug_dump_writer_;
67
52 Controller::NetworkMetrics last_metrics_; 68 Controller::NetworkMetrics last_metrics_;
53 69
54 RTC_DISALLOW_COPY_AND_ASSIGN(AudioNetworkAdaptorImpl); 70 RTC_DISALLOW_COPY_AND_ASSIGN(AudioNetworkAdaptorImpl);
55 }; 71 };
56 72
57 } // namespace webrtc 73 } // namespace webrtc
58 74
59 #endif // WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_AUDIO_NETWORK_ADAPT OR_IMPL_H_ 75 #endif // WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_AUDIO_NETWORK_ADAPT OR_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698