From 9a9ba4d20745f9eb27cf26e1497c957b94953755 Mon Sep 17 00:00:00 2001 From: Alex Studer Date: Wed, 3 Jul 2024 15:59:58 -0400 Subject: [PATCH] Android: Create ImageDecoderClient for ImageCodecPlugin This adjusts for changes to the constructor of ImageCodecPlugin. --- Ladybird/Android/src/main/cpp/WebContentService.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Ladybird/Android/src/main/cpp/WebContentService.cpp b/Ladybird/Android/src/main/cpp/WebContentService.cpp index 7e1c7179c52..930a724b38f 100644 --- a/Ladybird/Android/src/main/cpp/WebContentService.cpp +++ b/Ladybird/Android/src/main/cpp/WebContentService.cpp @@ -37,8 +37,10 @@ static ErrorOr> bind_request_server_servi return bind_service(&bind_request_server_java); } -template ErrorOr, Error> -bind_service(void (*)(int)); +static ErrorOr> bind_image_decoder_service() +{ + return bind_service(&bind_image_decoder_java); +} static ErrorOr load_content_filters(); @@ -49,7 +51,9 @@ ErrorOr service_main(int ipc_socket) Core::EventLoop event_loop; Web::Platform::EventLoopPlugin::install(*new Web::Platform::EventLoopPluginSerenity); - Web::Platform::ImageCodecPlugin::install(*new Ladybird::ImageCodecPlugin); + + auto image_decoder_client = TRY(bind_image_decoder_service()); + Web::Platform::ImageCodecPlugin::install(*new Ladybird::ImageCodecPlugin(move(image_decoder_client))); Web::Platform::AudioCodecPlugin::install_creation_hook([](auto loader) { (void)loader;