0

SetBackgroundSegmentationModel for newly created video_effects_service

video_effects_service is reset if it was idle for 5 seconds. So, if the
background segmentation model was set, the newly created
video_effects_service wouldn't get the current model. This CL fixes it.

Bug: 379669751
Change-Id: Ic56be804d8989c8943f2dc3c1e8067360cdcd2a8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6309359
Reviewed-by: Bryant Chandler <bryantchandler@chromium.org>
Commit-Queue: Ahmed Moussa <ahmedmoussa@google.com>
Cr-Commit-Position: refs/heads/main@{#1425835}
This commit is contained in:
ahmedmoussa
2025-02-27 10:24:04 -08:00
committed by Chromium LUCI CQ
parent 7759bfdd61
commit ba9cb9fe49

@ -73,6 +73,13 @@ void MediaEffectsService::BindVideoEffectsProcessor(
auto* video_effects_service = video_effects::GetVideoEffectsService();
CHECK(video_effects_service);
// The `video_effects_service` is reset if it is idle for more than 5 seconds.
// Re-send the model in case that has happened.
if (latest_segmentation_model_file_.IsValid()) {
video_effects_service->SetBackgroundSegmentationModel(
latest_segmentation_model_file_.Duplicate());
}
mojo::PendingRemote<viz::mojom::Gpu> gpu_remote;
mojo::PendingReceiver<viz::mojom::Gpu> gpu_receiver =
gpu_remote.InitWithNewPipeAndPassReceiver();