• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Copyright (c) 2021 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 #include "test/pc/e2e/analyzer/video/default_video_quality_analyzer_internal_shared_objects.h"
11 
12 #include "api/video/video_frame.h"
13 #include "rtc_base/strings/string_builder.h"
14 
15 namespace webrtc {
16 
ToString() const17 std::string InternalStatsKey::ToString() const {
18   rtc::StringBuilder out;
19   out << "stream=" << stream << "_sender=" << sender
20       << "_receiver=" << receiver;
21   return out.str();
22 }
23 
operator <(const InternalStatsKey & a,const InternalStatsKey & b)24 bool operator<(const InternalStatsKey& a, const InternalStatsKey& b) {
25   if (a.stream != b.stream) {
26     return a.stream < b.stream;
27   }
28   if (a.sender != b.sender) {
29     return a.sender < b.sender;
30   }
31   return a.receiver < b.receiver;
32 }
33 
operator ==(const InternalStatsKey & a,const InternalStatsKey & b)34 bool operator==(const InternalStatsKey& a, const InternalStatsKey& b) {
35   return a.stream == b.stream && a.sender == b.sender &&
36          a.receiver == b.receiver;
37 }
38 
FrameComparison(InternalStatsKey stats_key,absl::optional<VideoFrame> captured,absl::optional<VideoFrame> rendered,FrameComparisonType type,FrameStats frame_stats,OverloadReason overload_reason)39 FrameComparison::FrameComparison(InternalStatsKey stats_key,
40                                  absl::optional<VideoFrame> captured,
41                                  absl::optional<VideoFrame> rendered,
42                                  FrameComparisonType type,
43                                  FrameStats frame_stats,
44                                  OverloadReason overload_reason)
45     : stats_key(std::move(stats_key)),
46       captured(std::move(captured)),
47       rendered(std::move(rendered)),
48       type(type),
49       frame_stats(std::move(frame_stats)),
50       overload_reason(overload_reason) {}
51 
52 }  // namespace webrtc
53