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

Side by Side Diff: webrtc/modules/audio_coding/audio_network_adaptor/debug_dump_writer.cc

Issue 2745473003: Resolve cyclic dependency between audio network adaptor and event log api (Closed)
Patch Set: Revert "Activated checks for rtc_event_log_api" Created 3 years, 8 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
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 } 42 }
43 43
44 } // namespace 44 } // namespace
45 #endif // WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP 45 #endif // WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP
46 46
47 class DebugDumpWriterImpl final : public DebugDumpWriter { 47 class DebugDumpWriterImpl final : public DebugDumpWriter {
48 public: 48 public:
49 explicit DebugDumpWriterImpl(FILE* file_handle); 49 explicit DebugDumpWriterImpl(FILE* file_handle);
50 ~DebugDumpWriterImpl() override = default; 50 ~DebugDumpWriterImpl() override = default;
51 51
52 void DumpEncoderRuntimeConfig( 52 void DumpEncoderRuntimeConfig(const AudioEncoderRuntimeConfig& config,
53 const AudioNetworkAdaptor::EncoderRuntimeConfig& config, 53 int64_t timestamp) override;
54 int64_t timestamp) override;
55 54
56 void DumpNetworkMetrics(const Controller::NetworkMetrics& metrics, 55 void DumpNetworkMetrics(const Controller::NetworkMetrics& metrics,
57 int64_t timestamp) override; 56 int64_t timestamp) override;
58 57
59 private: 58 private:
60 std::unique_ptr<FileWrapper> dump_file_; 59 std::unique_ptr<FileWrapper> dump_file_;
61 }; 60 };
62 61
63 DebugDumpWriterImpl::DebugDumpWriterImpl(FILE* file_handle) 62 DebugDumpWriterImpl::DebugDumpWriterImpl(FILE* file_handle)
64 : dump_file_(FileWrapper::Create()) { 63 : dump_file_(FileWrapper::Create()) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 if (metrics.uplink_recoverable_packet_loss_fraction) { 96 if (metrics.uplink_recoverable_packet_loss_fraction) {
98 dump_metrics->set_uplink_recoverable_packet_loss_fraction( 97 dump_metrics->set_uplink_recoverable_packet_loss_fraction(
99 *metrics.uplink_recoverable_packet_loss_fraction); 98 *metrics.uplink_recoverable_packet_loss_fraction);
100 } 99 }
101 100
102 DumpEventToFile(event, dump_file_.get()); 101 DumpEventToFile(event, dump_file_.get());
103 #endif // WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP 102 #endif // WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP
104 } 103 }
105 104
106 void DebugDumpWriterImpl::DumpEncoderRuntimeConfig( 105 void DebugDumpWriterImpl::DumpEncoderRuntimeConfig(
107 const AudioNetworkAdaptor::EncoderRuntimeConfig& config, 106 const AudioEncoderRuntimeConfig& config,
108 int64_t timestamp) { 107 int64_t timestamp) {
109 #ifdef WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP 108 #ifdef WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP
110 Event event; 109 Event event;
111 event.set_timestamp(timestamp); 110 event.set_timestamp(timestamp);
112 event.set_type(Event::ENCODER_RUNTIME_CONFIG); 111 event.set_type(Event::ENCODER_RUNTIME_CONFIG);
113 auto dump_config = event.mutable_encoder_runtime_config(); 112 auto dump_config = event.mutable_encoder_runtime_config();
114 113
115 if (config.bitrate_bps) 114 if (config.bitrate_bps)
116 dump_config->set_bitrate_bps(*config.bitrate_bps); 115 dump_config->set_bitrate_bps(*config.bitrate_bps);
117 116
(...skipping 16 matching lines...) Expand all
134 133
135 DumpEventToFile(event, dump_file_.get()); 134 DumpEventToFile(event, dump_file_.get());
136 #endif // WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP 135 #endif // WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP
137 } 136 }
138 137
139 std::unique_ptr<DebugDumpWriter> DebugDumpWriter::Create(FILE* file_handle) { 138 std::unique_ptr<DebugDumpWriter> DebugDumpWriter::Create(FILE* file_handle) {
140 return std::unique_ptr<DebugDumpWriter>(new DebugDumpWriterImpl(file_handle)); 139 return std::unique_ptr<DebugDumpWriter>(new DebugDumpWriterImpl(file_handle));
141 } 140 }
142 141
143 } // namespace webrtc 142 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698