• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_EVENT_LOG_WRITER_H_
12 #define MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_EVENT_LOG_WRITER_H_
13 
14 #include "modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor_config.h"
15 
16 namespace webrtc {
17 class RtcEventLog;
18 
19 class EventLogWriter final {
20  public:
21   EventLogWriter(RtcEventLog* event_log,
22                  int min_bitrate_change_bps,
23                  float min_bitrate_change_fraction,
24                  float min_packet_loss_change_fraction);
25   ~EventLogWriter();
26 
27   EventLogWriter(const EventLogWriter&) = delete;
28   EventLogWriter& operator=(const EventLogWriter&) = delete;
29 
30   void MaybeLogEncoderConfig(const AudioEncoderRuntimeConfig& config);
31 
32  private:
33   void LogEncoderConfig(const AudioEncoderRuntimeConfig& config);
34 
35   RtcEventLog* const event_log_;
36   const int min_bitrate_change_bps_;
37   const float min_bitrate_change_fraction_;
38   const float min_packet_loss_change_fraction_;
39   AudioEncoderRuntimeConfig last_logged_config_;
40 };
41 
42 }  // namespace webrtc
43 
44 #endif  // MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_EVENT_LOG_WRITER_H_
45