diff options
author | Evan Shrubsole <eshr@google.com> | 2020-05-20 12:24:57 +0200 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-05-25 09:32:13 +0000 |
commit | 236e0ed83a36215c828ed9e9050c43005d4a3473 (patch) | |
tree | 6bd228b0990fd2a368bab558f56d0f080b9d09e4 /call | |
parent | f2c0f15282a7e3cba8dbd2e3e71f4f0d15ebc7bd (diff) | |
download | webrtc-236e0ed83a36215c828ed9e9050c43005d4a3473.tar.gz |
Add logging for video restrictions
This will help show what the restrictions are before
and after they transform into sink wants.
These will not be so spammy as adaptations do not happen
very often.
Bug: None
Change-Id: Ib72b313f68c6934d7833d8a3f14ce00df602832b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175800
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#31341}
Diffstat (limited to 'call')
-rw-r--r-- | call/adaptation/video_source_restrictions.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/call/adaptation/video_source_restrictions.h b/call/adaptation/video_source_restrictions.h index 506bae6133..9ee670dba5 100644 --- a/call/adaptation/video_source_restrictions.h +++ b/call/adaptation/video_source_restrictions.h @@ -11,9 +11,11 @@ #ifndef CALL_ADAPTATION_VIDEO_SOURCE_RESTRICTIONS_H_ #define CALL_ADAPTATION_VIDEO_SOURCE_RESTRICTIONS_H_ +#include <string> #include <utility> #include "absl/types/optional.h" +#include "rtc_base/strings/string_builder.h" namespace webrtc { @@ -38,6 +40,19 @@ class VideoSourceRestrictions { return !(*this == rhs); } + std::string ToString() const { + rtc::StringBuilder ss; + ss << "{"; + if (max_frame_rate_) + ss << " max_fps=" << max_frame_rate_.value(); + if (max_pixels_per_frame_) + ss << " max_pixels_per_frame=" << max_pixels_per_frame_.value(); + if (target_pixels_per_frame_) + ss << " target_pixels_per_frame=" << target_pixels_per_frame_.value(); + ss << " }"; + return ss.Release(); + } + // The source must produce a resolution less than or equal to // max_pixels_per_frame(). const absl::optional<size_t>& max_pixels_per_frame() const; |