[PCLF] Add ToString function for VideoResolution
Bug: b/231394729 Change-Id: Iac803440153d368f0c2ea143e64fe347323eeeef Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264556 Commit-Queue: Artem Titov <titovartem@webrtc.org> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/main@{#37082}
This commit is contained in:
parent
7e897aeb92
commit
bccb452eb6
@ -460,6 +460,7 @@ rtc_source_set("peer_connection_quality_test_fixture_api") {
|
||||
"../modules/audio_processing:api",
|
||||
"../rtc_base:checks",
|
||||
"../rtc_base:rtc_base",
|
||||
"../rtc_base:stringutils",
|
||||
"../rtc_base:threading",
|
||||
"audio:audio_mixer_api",
|
||||
"rtc_event_log",
|
||||
|
||||
@ -10,18 +10,36 @@
|
||||
|
||||
#include "api/test/peerconnection_quality_test_fixture.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "absl/types/optional.h"
|
||||
#include "api/array_view.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/strings/string_builder.h"
|
||||
|
||||
namespace webrtc {
|
||||
namespace webrtc_pc_e2e {
|
||||
namespace {
|
||||
|
||||
using VideoCodecConfig = ::webrtc::webrtc_pc_e2e::
|
||||
PeerConnectionE2EQualityTestFixture::VideoCodecConfig;
|
||||
using VideoSubscription = ::webrtc::webrtc_pc_e2e::
|
||||
PeerConnectionE2EQualityTestFixture::VideoSubscription;
|
||||
|
||||
std::string SpecToString(
|
||||
PeerConnectionE2EQualityTestFixture::VideoResolution::VideoResolution::Spec
|
||||
spec) {
|
||||
switch (spec) {
|
||||
case PeerConnectionE2EQualityTestFixture::VideoResolution::Spec::kNone:
|
||||
return "None";
|
||||
case PeerConnectionE2EQualityTestFixture::VideoResolution::Spec::
|
||||
kMaxFromSender:
|
||||
return "MaxFromSender";
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
PeerConnectionE2EQualityTestFixture::VideoResolution::VideoResolution(
|
||||
size_t width,
|
||||
size_t height,
|
||||
@ -41,6 +59,14 @@ bool PeerConnectionE2EQualityTestFixture::VideoResolution::operator==(
|
||||
fps_ == other.fps_ && spec_ == other.spec_;
|
||||
}
|
||||
|
||||
std::string PeerConnectionE2EQualityTestFixture::VideoResolution::ToString()
|
||||
const {
|
||||
rtc::StringBuilder out;
|
||||
out << "{ width=" << width_ << ", height=" << height_ << ", fps=" << fps_
|
||||
<< ", spec=" << SpecToString(spec_) << " }";
|
||||
return out.Release();
|
||||
}
|
||||
|
||||
bool PeerConnectionE2EQualityTestFixture::VideoSubscription::operator==(
|
||||
const VideoSubscription& other) const {
|
||||
return default_resolution_ == other.default_resolution_ &&
|
||||
|
||||
@ -208,6 +208,8 @@ class PeerConnectionE2EQualityTestFixture {
|
||||
// if it's spec is `Spec::kNone`.
|
||||
bool IsRegular() const { return spec_ == Spec::kNone; }
|
||||
|
||||
std::string ToString() const;
|
||||
|
||||
private:
|
||||
size_t width_ = 0;
|
||||
size_t height_ = 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user