/* * Copyright (c) 2022 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree.
*/ #include <memory> #include <string> #include <utility> #include <vector>
using ::cricket::kAv1CodecName; using ::cricket::kH264CodecName; using ::cricket::kVp8CodecName; using ::cricket::kVp9CodecName; using ::testing::Combine; using ::testing::Optional; using ::testing::UnitTest; using ::testing::Values; using ::testing::ValuesIn; using ::webrtc::webrtc_pc_e2e::EmulatedSFUConfig; using ::webrtc::webrtc_pc_e2e::PeerConfigurer; using ::webrtc::webrtc_pc_e2e::RunParams; using ::webrtc::webrtc_pc_e2e::ScreenShareConfig; using ::webrtc::webrtc_pc_e2e::VideoCodecConfig; using ::webrtc::webrtc_pc_e2e::VideoConfig;
std::unique_ptr<webrtc_pc_e2e::PeerConnectionE2EQualityTestFixture>
CreateTestFixture(absl::string_view test_case_name,
TimeController& time_controller,
std::pair<EmulatedNetworkManagerInterface*,
EmulatedNetworkManagerInterface*> network_links,
rtc::FunctionView<void(PeerConfigurer*)> alice_configurer,
rtc::FunctionView<void(PeerConfigurer*)> bob_configurer,
std::unique_ptr<VideoQualityAnalyzerInterface>
video_quality_analyzer = nullptr) { auto fixture = webrtc_pc_e2e::CreatePeerConnectionE2EQualityTestFixture(
std::string(test_case_name), time_controller, nullptr,
std::move(video_quality_analyzer)); auto alice = std::make_unique<PeerConfigurer>(
network_links.first->network_dependencies()); auto bob = std::make_unique<PeerConfigurer>(
network_links.second->network_dependencies());
alice_configurer(alice.get());
bob_configurer(bob.get());
fixture->AddPeer(std::move(alice));
fixture->AddPeer(std::move(bob)); return fixture;
}
// Takes the current active field trials set, and appends some new trials.
std::string AppendFieldTrials(std::string new_trial_string) { return std::string(field_trial::GetFieldTrialString()) + new_trial_string;
}
int num_spatial_layers =
ScalabilityModeToNumSpatialLayers(*scalability_mode); int num_temporal_layers =
ScalabilityModeToNumTemporalLayers(*scalability_mode);
// Records how many frames are seen for each spatial and temporal index at the // encoder and decoder level. class SvcVideoQualityAnalyzer : public DefaultVideoQualityAnalyzer { public: using SpatialTemporalLayerCounts = flat_map<int, flat_map<int, int>>;
void OnFramePreDecode(absl::string_view peer_name,
uint16_t frame_id, const EncodedImage& input_image) override {
std::optional<int> spatial_id = input_image.SpatialIndex();
std::optional<int> temporal_id = input_image.TemporalIndex(); if (!spatial_id) {
decoder_layers_seen_[0][temporal_id.value_or(0)]++;
} else { for (int i = 0; i <= *spatial_id; ++i) { // If there are no spatial layers (for example VP8), we still want to // record the temporal index for pseudo-layer "0" frames. if (*spatial_id == 0 ||
input_image.SpatialLayerFrameSize(i).value_or(0) > 0) {
decoder_layers_seen_[i][temporal_id.value_or(0)]++;
}
}
}
DefaultVideoQualityAnalyzer::OnFramePreDecode(peer_name, frame_id,
input_image);
}
void OnStatsReports(
absl::string_view pc_label, const rtc::scoped_refptr<const RTCStatsReport>& report) override { // Extract the scalability mode reported in the stats. auto outbound_stats = report->GetStatsOfType<RTCOutboundRtpStreamStats>(); for (constauto& stat : outbound_stats) { if (stat->scalability_mode.has_value()) {
reported_scalability_mode_ = *stat->scalability_mode;
}
}
}
#ifdefined(WEBRTC_USE_H264)
INSTANTIATE_TEST_SUITE_P(
SvcTestH264,
SvcTest,
Combine(ValuesIn({
SvcTestParameters::Create(kH264CodecName, "L1T1"),
SvcTestParameters::Create(kH264CodecName, "L1T2"),
SvcTestParameters::Create(kH264CodecName, "L1T3"),
}), // Like AV1, H.264 RTP format does not include SVC related // information, so always use Dependency Descriptor.
Values(UseDependencyDescriptor::Enabled)),
SvcTestNameGenerator); #endif
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.15Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.