• 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_receive_stream_config.h"
12 
13 #include <utility>
14 
15 #include "absl/memory/memory.h"
16 #include "logging/rtc_event_log/rtc_stream_config.h"
17 #include "rtc_base/checks.h"
18 
19 namespace webrtc {
20 
RtcEventAudioReceiveStreamConfig(std::unique_ptr<rtclog::StreamConfig> config)21 RtcEventAudioReceiveStreamConfig::RtcEventAudioReceiveStreamConfig(
22     std::unique_ptr<rtclog::StreamConfig> config)
23     : config_(std::move(config)) {
24   RTC_DCHECK(config_);
25 }
26 
RtcEventAudioReceiveStreamConfig(const RtcEventAudioReceiveStreamConfig & other)27 RtcEventAudioReceiveStreamConfig::RtcEventAudioReceiveStreamConfig(
28     const RtcEventAudioReceiveStreamConfig& other)
29     : RtcEvent(other.timestamp_us_),
30       config_(std::make_unique<rtclog::StreamConfig>(*other.config_)) {}
31 
32 RtcEventAudioReceiveStreamConfig::~RtcEventAudioReceiveStreamConfig() = default;
33 
GetType() const34 RtcEvent::Type RtcEventAudioReceiveStreamConfig::GetType() const {
35   return RtcEvent::Type::AudioReceiveStreamConfig;
36 }
37 
IsConfigEvent() const38 bool RtcEventAudioReceiveStreamConfig::IsConfigEvent() const {
39   return true;
40 }
41 
42 std::unique_ptr<RtcEventAudioReceiveStreamConfig>
Copy() const43 RtcEventAudioReceiveStreamConfig::Copy() const {
44   return absl::WrapUnique<RtcEventAudioReceiveStreamConfig>(
45       new RtcEventAudioReceiveStreamConfig(*this));
46 }
47 
48 }  // namespace webrtc
49