• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Copyright (c) 2017 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 #include "logging/rtc_event_log/events/rtc_event_audio_network_adaptation.h"
12 
13 #include <utility>
14 
15 #include "absl/memory/memory.h"
16 #include "modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor_config.h"
17 #include "rtc_base/checks.h"
18 
19 namespace webrtc {
20 
RtcEventAudioNetworkAdaptation(std::unique_ptr<AudioEncoderRuntimeConfig> config)21 RtcEventAudioNetworkAdaptation::RtcEventAudioNetworkAdaptation(
22     std::unique_ptr<AudioEncoderRuntimeConfig> config)
23     : config_(std::move(config)) {
24   RTC_DCHECK(config_);
25 }
26 
RtcEventAudioNetworkAdaptation(const RtcEventAudioNetworkAdaptation & other)27 RtcEventAudioNetworkAdaptation::RtcEventAudioNetworkAdaptation(
28     const RtcEventAudioNetworkAdaptation& other)
29     : RtcEvent(other.timestamp_us_),
30       config_(std::make_unique<AudioEncoderRuntimeConfig>(*other.config_)) {}
31 
32 RtcEventAudioNetworkAdaptation::~RtcEventAudioNetworkAdaptation() = default;
33 
GetType() const34 RtcEvent::Type RtcEventAudioNetworkAdaptation::GetType() const {
35   return RtcEvent::Type::AudioNetworkAdaptation;
36 }
37 
IsConfigEvent() const38 bool RtcEventAudioNetworkAdaptation::IsConfigEvent() const {
39   return false;
40 }
41 
42 std::unique_ptr<RtcEventAudioNetworkAdaptation>
Copy() const43 RtcEventAudioNetworkAdaptation::Copy() const {
44   return absl::WrapUnique(new RtcEventAudioNetworkAdaptation(*this));
45 }
46 
47 }  // namespace webrtc
48