feat(video): add support for legacy MPEG-2 and H.263+ encoders (#5194)

This commit is contained in:
Dave Lane authored and GitHub committed 2026-11-22 19:07:41 -05:00
1 parent 6b54f99fd8
commit 5f7d08e8d6
27 files changed
+1794 -448

No files matched your search

@@ -12,6 +12,7 @@
// local includes
#include "src/platform/linux/display_geometry.h"
#include "src/platform/linux/kms_display.h"
#include "src/video.h"
namespace {
@@ -46,6 +47,44 @@ namespace {
};
} // namespace
/**
* @brief One backend can refresh its outputs while another keeps its original connector and input bounds.
*/
TEST(KmsDisplayEnumerationTest, KeepsPlaneAndDesktopGeometryWithTheSelectedBackend) {
platf::kms::display_enumeration_t hardware;
hardware.cards.push_back({"/dev/dri/card1", {}});
hardware.outputs.emplace_back("DP-1", 0U, 31U, 51U);
hardware.desktop.add({.offset_x = 0, .offset_y = 0, .width = 1920, .height = 1080});
platf::kms::display_enumeration_t software;
software.cards.push_back({"/dev/dri/card0", {}});
software.cards.push_back({"/dev/dri/card1", {}});
software.outputs.emplace_back("HDMI-A-1", 0U, 57U, 67U);
software.outputs.emplace_back("DP-1", 1U, 31U, 51U);
software.desktop.add({.offset_x = -1280, .offset_y = 0, .width = 1280, .height = 720});
software.desktop.add({.offset_x = 0, .offset_y = 0, .width = 1920, .height = 1080});
EXPECT_EQ(hardware.display_index(""), 0U);
EXPECT_EQ(software.display_index("1"), 1U);
EXPECT_FALSE(hardware.display_index("HDMI-A-1"));
const auto software_index = software.display_index("DP-1");
const auto hardware_index = hardware.display_index("DP-1");
ASSERT_EQ(software_index, 1U);
ASSERT_EQ(hardware_index, 0U);
EXPECT_EQ(software.cards[software.outputs[*software_index].card_index].path, "/dev/dri/card1");
EXPECT_EQ(hardware.outputs[*hardware_index].plane_id, 31U);
EXPECT_EQ(hardware.outputs[*hardware_index].crtc_id, 51U);
geometry_display_t hardware_display;
geometry_display_t software_display;
hardware.desktop.apply(hardware_display);
software.desktop.apply(software_display);
EXPECT_EQ(hardware_display.env_width, 1920);
EXPECT_EQ(hardware_display.env_offset_x, 0);
EXPECT_EQ(software_display.env_width, 3200);
EXPECT_EQ(software_display.env_offset_x, -1280);
}
TEST(LinuxDisplayGeometryTest, EmptyAndInvalidMonitorsDoNotCreateAnInputDesktop) {
platf::desktop_geometry_t desktop;
EXPECT_EQ(desktop.bounds().width, 0);