diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
commit | 8dd16259287f58f9273002717ec4d27e97127719 (patch) | |
tree | 3863e62a53829a84037444beab3abd4ed9dfc7d0 /third_party/libwebrtc/api/video_codecs/video_codec.cc | |
parent | Releasing progress-linux version 126.0.1-1~progress7.99u1. (diff) | |
download | firefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz firefox-8dd16259287f58f9273002717ec4d27e97127719.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/api/video_codecs/video_codec.cc')
-rw-r--r-- | third_party/libwebrtc/api/video_codecs/video_codec.cc | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/third_party/libwebrtc/api/video_codecs/video_codec.cc b/third_party/libwebrtc/api/video_codecs/video_codec.cc index 39a345d699..82c9bfc8ea 100644 --- a/third_party/libwebrtc/api/video_codecs/video_codec.cc +++ b/third_party/libwebrtc/api/video_codecs/video_codec.cc @@ -16,6 +16,7 @@ #include "absl/strings/match.h" #include "rtc_base/checks.h" +#include "rtc_base/strings/string_builder.h" namespace webrtc { namespace { @@ -73,6 +74,35 @@ VideoCodec::VideoCodec() codec_specific_(), complexity_(VideoCodecComplexity::kComplexityNormal) {} +std::string VideoCodec::ToString() const { + char string_buf[2048]; + rtc::SimpleStringBuilder ss(string_buf); + + ss << "VideoCodec {" << "type: " << CodecTypeToPayloadString(codecType) + << ", mode: " + << (mode == VideoCodecMode::kRealtimeVideo ? "RealtimeVideo" + : "Screensharing"); + if (IsSinglecast()) { + absl::optional<ScalabilityMode> scalability_mode = GetScalabilityMode(); + if (scalability_mode.has_value()) { + ss << ", Singlecast: {" << width << "x" << height << " " + << ScalabilityModeToString(*scalability_mode) + << (active ? ", active" : ", inactive") << "}"; + } + } else { + ss << ", Simulcast: {"; + for (size_t i = 0; i < numberOfSimulcastStreams; ++i) { + const SimulcastStream stream = simulcastStream[i]; + ss << "[" << stream.width << "x" << stream.height << " " + << ScalabilityModeToString(stream.GetScalabilityMode()) + << (stream.active ? ", active" : ", inactive") << "]"; + } + ss << "}"; + } + ss << "}"; + return ss.str(); +} + VideoCodecVP8* VideoCodec::VP8() { RTC_DCHECK_EQ(codecType, kVideoCodecVP8); return &codec_specific_.VP8; |