tests: Make H.264 videos work in visual tests
This commit is contained in:
parent
76da9621c9
commit
b7a100337e
|
@ -4553,6 +4553,7 @@ dependencies = [
|
|||
"ruffle_input_format",
|
||||
"ruffle_render",
|
||||
"ruffle_socket_format",
|
||||
"ruffle_video_external",
|
||||
"ruffle_video_software",
|
||||
"serde",
|
||||
"toml",
|
||||
|
|
|
@ -14,7 +14,11 @@ workspace = true
|
|||
# Enable running image comparison tests. This is off by default,
|
||||
# since the images we compare against are generated on CI, and may
|
||||
# not match your local machine's Vulkan version / image output.
|
||||
imgtests = ["ruffle_test_framework/ruffle_video_software", "ruffle_render_wgpu"]
|
||||
imgtests = [
|
||||
"ruffle_render_wgpu",
|
||||
"ruffle_test_framework/ruffle_video_software",
|
||||
"ruffle_test_framework/ruffle_video_external",
|
||||
]
|
||||
jpegxr = ["ruffle_test_framework/jpegxr"]
|
||||
lzma = ["ruffle_test_framework/lzma"]
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ ruffle_render = { path = "../../render" }
|
|||
ruffle_input_format = { path = "../input-format" }
|
||||
ruffle_socket_format = { path = "../socket-format" }
|
||||
ruffle_video_software = { path = "../../video/software", optional = true }
|
||||
ruffle_video_external = { path = "../../video/external", optional = true }
|
||||
image = { workspace = true, features = ["png"] }
|
||||
regex = "1.10.4"
|
||||
url = { workspace = true }
|
||||
|
|
|
@ -174,10 +174,25 @@ impl PlayerOptions {
|
|||
|
||||
player_builder = player_builder.with_player_runtime(self.runtime);
|
||||
|
||||
#[cfg(feature = "ruffle_video_software")]
|
||||
if self.with_video {
|
||||
use ruffle_video_software::backend::SoftwareVideoBackend;
|
||||
player_builder = player_builder.with_video(SoftwareVideoBackend::new())
|
||||
#[cfg(feature = "ruffle_video_external")]
|
||||
{
|
||||
use ruffle_video_external::backend::ExternalVideoBackend;
|
||||
let openh264_path = ExternalVideoBackend::get_openh264()
|
||||
.map_err(|e| anyhow!("Couldn't get OpenH264: {}", e))?;
|
||||
|
||||
player_builder =
|
||||
player_builder.with_video(ExternalVideoBackend::new(Some(openh264_path)));
|
||||
}
|
||||
|
||||
#[cfg(all(
|
||||
not(feature = "ruffle_video_external"),
|
||||
feature = "ruffle_video_software"
|
||||
))]
|
||||
{
|
||||
player_builder = player_builder
|
||||
.with_video(ruffle_video_software::backend::SoftwareVideoBackend::new());
|
||||
}
|
||||
}
|
||||
|
||||
Ok(player_builder)
|
||||
|
|
Loading…
Reference in New Issue