Commit 9ecbfdde authored by Wei Lee's avatar Wei Lee Committed by Commit Bot

media: Makes fake video support 30 fps

Bug: b/150004607
Test: capture_unittests

Change-Id: I2fd99575cb8a9b780946679ded96c10d94334370
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2063617
Commit-Queue: Guido Urdaneta <guidou@chromium.org>
Auto-Submit: Wei Lee <wtlee@chromium.org>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#743661}
parent 1cc4a129
......@@ -32,7 +32,7 @@ static const media::FakeVideoCaptureDevice::DeliveryMode kDefaultDeliveryMode =
static constexpr std::array<gfx::Size, 6> kDefaultResolutions{
{gfx::Size(96, 96), gfx::Size(320, 240), gfx::Size(640, 480),
gfx::Size(1280, 720), gfx::Size(1920, 1080), gfx::Size(3840, 2160)}};
static constexpr std::array<float, 1> kDefaultFrameRates{{20.0f}};
static constexpr std::array<float, 1> kDefaultFrameRates{{30.0f}};
static const double kInitialPan = 100.0;
static const double kInitialTilt = 100.0;
......
......@@ -209,27 +209,27 @@ TEST_F(FakeVideoCaptureDeviceTest, GetDeviceSupportedFormats) {
EXPECT_EQ(96, supported_formats[0].frame_size.width());
EXPECT_EQ(96, supported_formats[0].frame_size.height());
EXPECT_EQ(expected_format, supported_formats[0].pixel_format);
EXPECT_GE(supported_formats[0].frame_rate, 20.0);
EXPECT_GE(supported_formats[0].frame_rate, 30.0);
EXPECT_EQ(320, supported_formats[1].frame_size.width());
EXPECT_EQ(240, supported_formats[1].frame_size.height());
EXPECT_EQ(expected_format, supported_formats[1].pixel_format);
EXPECT_GE(supported_formats[1].frame_rate, 20.0);
EXPECT_GE(supported_formats[1].frame_rate, 30.0);
EXPECT_EQ(640, supported_formats[2].frame_size.width());
EXPECT_EQ(480, supported_formats[2].frame_size.height());
EXPECT_EQ(expected_format, supported_formats[2].pixel_format);
EXPECT_GE(supported_formats[2].frame_rate, 20.0);
EXPECT_GE(supported_formats[2].frame_rate, 30.0);
EXPECT_EQ(1280, supported_formats[3].frame_size.width());
EXPECT_EQ(720, supported_formats[3].frame_size.height());
EXPECT_EQ(expected_format, supported_formats[3].pixel_format);
EXPECT_GE(supported_formats[3].frame_rate, 20.0);
EXPECT_GE(supported_formats[3].frame_rate, 30.0);
EXPECT_EQ(1920, supported_formats[4].frame_size.width());
EXPECT_EQ(1080, supported_formats[4].frame_size.height());
EXPECT_EQ(expected_format, supported_formats[4].pixel_format);
EXPECT_GE(supported_formats[4].frame_rate, 20.0);
EXPECT_GE(supported_formats[4].frame_rate, 30.0);
EXPECT_EQ(3840, supported_formats[5].frame_size.width());
EXPECT_EQ(2160, supported_formats[5].frame_size.height());
EXPECT_EQ(expected_format, supported_formats[5].pixel_format);
EXPECT_GE(supported_formats[5].frame_rate, 20.0);
EXPECT_GE(supported_formats[5].frame_rate, 30.0);
device_index++;
}
}
......@@ -508,24 +508,24 @@ INSTANTIATE_TEST_SUITE_P(
FakeVideoCaptureDevice::DisplayMediaType::ANY,
{PIXEL_FORMAT_I420}},
CommandLineTestData{"device-count=4",
20,
30,
4u,
FakeVideoCaptureDevice::DisplayMediaType::ANY,
{PIXEL_FORMAT_I420, PIXEL_FORMAT_Y16,
PIXEL_FORMAT_MJPEG, PIXEL_FORMAT_I420}},
CommandLineTestData{"device-count=4,ownership=client",
20,
30,
4u,
FakeVideoCaptureDevice::DisplayMediaType::ANY,
{PIXEL_FORMAT_I420, PIXEL_FORMAT_Y16,
PIXEL_FORMAT_MJPEG, PIXEL_FORMAT_I420}},
CommandLineTestData{"device-count=0",
20,
30,
0u,
FakeVideoCaptureDevice::DisplayMediaType::ANY,
{PIXEL_FORMAT_I420}},
CommandLineTestData{"display-media-type=window",
20,
30,
1u,
FakeVideoCaptureDevice::DisplayMediaType::WINDOW,
{PIXEL_FORMAT_I420}},
......
......@@ -8,7 +8,7 @@
<body>
<script>
const FRAME_RATE_ERROR = 0.5;
const FRAME_RATE_ERROR = 1.0;
const SETTINGS_CHANGE_RATE = 0.8;
promise_test(async t => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment