| 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 "api/video/video_adaptation_counters.h" |
| 12 |
| 13 | #include "rtc_base/strings/string_builder.h" |
| 14 |
| 15 | namespace webrtc { |
| 16 |
| 17 | bool VideoAdaptationCounters::operator==( |
| 18 | const VideoAdaptationCounters& rhs) const { |
| 19 | return fps_adaptations == rhs.fps_adaptations && |
| 20 | resolution_adaptations == rhs.resolution_adaptations; |
| 21 | } |
| 22 |
| 23 | bool VideoAdaptationCounters::operator!=( |
| 24 | const VideoAdaptationCounters& rhs) const { |
| 25 | return !(rhs == *this); |
| 26 | } |
| 27 |
| 28 | VideoAdaptationCounters VideoAdaptationCounters::operator+( |
| 29 | const VideoAdaptationCounters& other) const { |
| 30 | return VideoAdaptationCounters( |
| 31 | resolution_adaptations + other.resolution_adaptations, |
| 32 | fps_adaptations + other.fps_adaptations); |
| 33 | } |
| 34 |
| 35 | std::string VideoAdaptationCounters::ToString() const { |
| 36 | rtc::StringBuilder ss; |
| 37 | ss << "{ res=" << resolution_adaptations << " fps=" << fps_adaptations |
| 38 | << " }"; |
| 39 | return ss.Release(); |
| 40 | } |
| 41 |
| 42 | } // namespace webrtc |
| 43 |