Name rate adaptation tests
Bug: none Change-Id: I10f9b2b14b5fa464d5a88d485e8c7ea1be636faf Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/272680 Commit-Queue: Sergey Silkin <ssilkin@webrtc.org> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org> Cr-Commit-Position: refs/heads/main@{#37884}
This commit is contained in:
parent
ef26df8460
commit
5d80958d5e
@ -1088,7 +1088,10 @@ if (rtc_include_tests) {
|
||||
if (is_android) {
|
||||
sources += [ "codecs/test/videocodec_test_mediacodec.cc" ]
|
||||
|
||||
deps += [ ":android_codec_factory_helper" ]
|
||||
deps += [
|
||||
":android_codec_factory_helper",
|
||||
"../../rtc_base:stringutils",
|
||||
]
|
||||
}
|
||||
|
||||
if (is_ios || is_mac) {
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
#include "media/base/media_constants.h"
|
||||
#include "modules/video_coding/codecs/test/android_codec_factory_helper.h"
|
||||
#include "modules/video_coding/codecs/test/videocodec_test_fixture_impl.h"
|
||||
#include "rtc_base/strings/string_builder.h"
|
||||
#include "test/gtest.h"
|
||||
#include "test/testsupport/file_utils.h"
|
||||
|
||||
@ -27,34 +28,48 @@ namespace {
|
||||
const int kForemanNumFrames = 300;
|
||||
const int kForemanFramerateFps = 30;
|
||||
|
||||
struct RateProfileData {
|
||||
std::string name;
|
||||
std::vector<webrtc::test::RateProfile> rate_profile;
|
||||
};
|
||||
|
||||
const size_t kConstRateIntervalSec = 10;
|
||||
const std::vector<webrtc::test::RateProfile> kBitRateHighLowHigh = {
|
||||
|
||||
const RateProfileData kBitRateHighLowHigh = {
|
||||
/*name=*/"BitRateHighLowHigh",
|
||||
/*rate_profile=*/{
|
||||
{/*target_kbps=*/3000, /*input_fps=*/30, /*frame_num=*/0},
|
||||
{/*target_kbps=*/1500, /*input_fps=*/30, /*frame_num=*/300},
|
||||
{/*target_kbps=*/750, /*input_fps=*/30, /*frame_num=*/600},
|
||||
{/*target_kbps=*/1500, /*input_fps=*/30, /*frame_num=*/900},
|
||||
{/*target_kbps=*/3000, /*input_fps=*/30, /*frame_num=*/1200}};
|
||||
{/*target_kbps=*/3000, /*input_fps=*/30, /*frame_num=*/1200}}};
|
||||
|
||||
const std::vector<webrtc::test::RateProfile> kBitRateLowHighLow = {
|
||||
const RateProfileData kBitRateLowHighLow = {
|
||||
/*name=*/"BitRateLowHighLow",
|
||||
/*rate_profile=*/{
|
||||
{/*target_kbps=*/750, /*input_fps=*/30, /*frame_num=*/0},
|
||||
{/*target_kbps=*/1500, /*input_fps=*/30, /*frame_num=*/300},
|
||||
{/*target_kbps=*/3000, /*input_fps=*/30, /*frame_num=*/600},
|
||||
{/*target_kbps=*/1500, /*input_fps=*/30, /*frame_num=*/900},
|
||||
{/*target_kbps=*/720, /*input_fps=*/30, /*frame_num=*/1200}};
|
||||
{/*target_kbps=*/750, /*input_fps=*/30, /*frame_num=*/1200}}};
|
||||
|
||||
const std::vector<webrtc::test::RateProfile> kFrameRateHighLowHigh = {
|
||||
const RateProfileData kFrameRateHighLowHigh = {
|
||||
/*name=*/"FrameRateHighLowHigh",
|
||||
/*rate_profile=*/{
|
||||
{/*target_kbps=*/2000, /*input_fps=*/30, /*frame_num=*/0},
|
||||
{/*target_kbps=*/2000, /*input_fps=*/15, /*frame_num=*/300},
|
||||
{/*target_kbps=*/2000, /*input_fps=*/7.5, /*frame_num=*/450},
|
||||
{/*target_kbps=*/2000, /*input_fps=*/15, /*frame_num=*/525},
|
||||
{/*target_kbps=*/2000, /*input_fps=*/30, /*frame_num=*/675}};
|
||||
{/*target_kbps=*/2000, /*input_fps=*/30, /*frame_num=*/675}}};
|
||||
|
||||
const std::vector<webrtc::test::RateProfile> kFrameRateLowHighLow = {
|
||||
const RateProfileData kFrameRateLowHighLow = {
|
||||
/*name=*/"FrameRateLowHighLow",
|
||||
/*rate_profile=*/{
|
||||
{/*target_kbps=*/2000, /*input_fps=*/7.5, /*frame_num=*/0},
|
||||
{/*target_kbps=*/2000, /*input_fps=*/15, /*frame_num=*/75},
|
||||
{/*target_kbps=*/2000, /*input_fps=*/30, /*frame_num=*/225},
|
||||
{/*target_kbps=*/2000, /*input_fps=*/15, /*frame_num=*/525},
|
||||
{/*target_kbps=*/2000, /*input_fps=*/7.5, /*frame_num=*/775}};
|
||||
{/*target_kbps=*/2000, /*input_fps=*/7.5, /*frame_num=*/775}}};
|
||||
|
||||
VideoCodecTestFixture::Config CreateConfig() {
|
||||
VideoCodecTestFixture::Config config;
|
||||
@ -175,11 +190,21 @@ TEST(VideoCodecTestMediaCodec, ForemanMixedRes100kbpsVp8H264) {
|
||||
|
||||
class VideoCodecTestMediaCodecRateAdaptation
|
||||
: public ::testing::TestWithParam<
|
||||
std::tuple<std::vector<webrtc::test::RateProfile>, std::string>> {};
|
||||
std::tuple<RateProfileData, std::string>> {
|
||||
public:
|
||||
static std::string ParamInfoToStr(
|
||||
const ::testing::TestParamInfo<
|
||||
VideoCodecTestMediaCodecRateAdaptation::ParamType>& info) {
|
||||
char buf[512];
|
||||
rtc::SimpleStringBuilder ss(buf);
|
||||
ss << std::get<0>(info.param).name << "_" << std::get<1>(info.param);
|
||||
return ss.str();
|
||||
}
|
||||
};
|
||||
|
||||
TEST_P(VideoCodecTestMediaCodecRateAdaptation, DISABLED_RateAdaptation) {
|
||||
const std::vector<webrtc::test::RateProfile> rate_profile =
|
||||
std::get<0>(GetParam());
|
||||
std::get<0>(GetParam()).rate_profile;
|
||||
const std::string codec_name = std::get<1>(GetParam());
|
||||
|
||||
VideoCodecTestFixture::Config config;
|
||||
@ -235,7 +260,8 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
kFrameRateHighLowHigh),
|
||||
::testing::Values(cricket::kVp8CodecName,
|
||||
cricket::kVp9CodecName,
|
||||
cricket::kH264CodecName)));
|
||||
cricket::kH264CodecName)),
|
||||
VideoCodecTestMediaCodecRateAdaptation::ParamInfoToStr);
|
||||
|
||||
} // namespace test
|
||||
} // namespace webrtc
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user