xref: /aosp_15_r20/external/webrtc/logging/rtc_event_log/events/rtc_event_audio_network_adaptation.cc (revision d9f758449e529ab9291ac668be2861e7a55c2422)
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 
34 std::unique_ptr<RtcEventAudioNetworkAdaptation>
Copy() const35 RtcEventAudioNetworkAdaptation::Copy() const {
36   return absl::WrapUnique(new RtcEventAudioNetworkAdaptation(*this));
37 }
38 
39 }  // namespace webrtc
40