From 2a156d24f75a470cfcea38b0f47da01693eacfc5 Mon Sep 17 00:00:00 2001
From: Vasiliy Telezhnikov <vasilyt@chromium.org>
Date: Thu, 31 Oct 2024 15:50:12 +0000
Subject: [PATCH] Fix missing YCbCr info for guessed sizes.

YCbCr info is required for display compositor to display frame properly
unless it's in overlay. When the resolution change, we guess coded size
to avoid round-trip to gpu thread and out of order rendering, we should
"guess" ycbcr info too by reusing previous one.

Bug: 370654173,b/373802886
Change-Id: I04d7e91f8e00fa0e1c3e31fe15b529fb4cca7337
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5980149
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: Vasiliy Telezhnikov <vasilyt@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1376341}
---
 media/gpu/android/frame_info_helper.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/media/gpu/android/frame_info_helper.cc b/media/gpu/android/frame_info_helper.cc
index 950dd8c54d494..65996f92aa00c 100644
--- a/media/gpu/android/frame_info_helper.cc
+++ b/media/gpu/android/frame_info_helper.cc
@@ -339,6 +339,7 @@ class FrameInfoHelperImpl : public FrameInfoHelper,
 
         // To avoid glitches during size changes, guess a likely coded size.
         auto info = GuessFrameInfo(*request.buffer_renderer);
+        info.ycbcr_info = frame_info_->ycbcr_info;
         waiting_for_real_frame_info_ = true;
 
         // Ensure we get the real coded size for the next frame.