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

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: some fixing 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 Config();
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(
39 const Config& config,
40 std::unique_ptr<ControllerManager> controller_manager,
41 std::unique_ptr<DebugDumpWriter> debug_dump_writer = nullptr);
42
34 ~AudioNetworkAdaptorImpl() override; 43 ~AudioNetworkAdaptorImpl() override;
35 44
36 void SetUplinkBandwidth(int uplink_bandwidth_bps) override; 45 void SetUplinkBandwidth(int uplink_bandwidth_bps) override;
37 46
38 void SetUplinkPacketLossFraction(float uplink_packet_loss_fraction) override; 47 void SetUplinkPacketLossFraction(float uplink_packet_loss_fraction) override;
39 48
49 void SetRtt(int rtt_ms) override;
50
40 void SetReceiverFrameLengthRange(int min_frame_length_ms, 51 void SetReceiverFrameLengthRange(int min_frame_length_ms,
41 int max_frame_length_ms) override; 52 int max_frame_length_ms) override;
42 53
43 EncoderRuntimeConfig GetEncoderRuntimeConfig() override; 54 EncoderRuntimeConfig GetEncoderRuntimeConfig() override;
44 55
45 void StartDebugDump(FILE* file_handle) override; 56 void StartDebugDump(FILE* file_handle) override;
46 57
58 void StopDebugDump() override;
59
47 private: 60 private:
61 void DumpNetworkMetrics();
62
48 const Config config_; 63 const Config config_;
49 64
50 std::unique_ptr<ControllerManager> controller_manager_; 65 std::unique_ptr<ControllerManager> controller_manager_;
51 66
67 std::unique_ptr<DebugDumpWriter> debug_dump_writer_;
68
52 Controller::NetworkMetrics last_metrics_; 69 Controller::NetworkMetrics last_metrics_;
53 70
54 RTC_DISALLOW_COPY_AND_ASSIGN(AudioNetworkAdaptorImpl); 71 RTC_DISALLOW_COPY_AND_ASSIGN(AudioNetworkAdaptorImpl);
55 }; 72 };
56 73
57 } // namespace webrtc 74 } // namespace webrtc
58 75
59 #endif // WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_AUDIO_NETWORK_ADAPT OR_IMPL_H_ 76 #endif // WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_AUDIO_NETWORK_ADAPT OR_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698