Commit b6cf0587 authored by Sergey Ulanov's avatar Sergey Ulanov Committed by Commit Bot

[Fuchsia] Fix FuchsiaVideoDecoder to request frame synchronization fence

FuchsiaVideoDecoder is supposed to wait for video frames to be rendered
before returning the underylying buffer to the decoder to reuse it. The
corresponding logic was already implemented, but it wasn't working
properly because the decoder wasn't setting READ_LOCK_FENCES_ENABLED
flag in the generated frames. As result VideoResourceUpdater wasn't
setting read_lock_fences_enabled flag in corresponding
TransferableResources and so Viz wasn't returning sync token for these
resources. Now the decoder sets READ_LOCK_FENCES_ENABLED flag, so frame
reuse is synchronized properly.

Bug: b/143308693
Change-Id: I9746c69c4a6cbd1c6ea1c708731f1cf8fc620a94
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1904951
Auto-Submit: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: default avatarKevin Marshall <kmarshall@chromium.org>
Reviewed-by: default avatarDavid Dorwin <ddorwin@chromium.org>
Commit-Queue: David Dorwin <ddorwin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713724}
parent 80ae7982
......@@ -96,11 +96,16 @@ class OutputMailbox {
mailboxes[0].mailbox = mailbox_;
mailboxes[0].sync_token = shared_image_interface_->GenUnverifiedSyncToken();
return VideoFrame::WrapNativeTextures(
auto frame = VideoFrame::WrapNativeTextures(
pixel_format, mailboxes,
BindToCurrentLoop(base::BindOnce(&OutputMailbox::OnFrameDestroyed,
base::Unretained(this))),
coded_size, visible_rect, natural_size, timestamp);
// Request a fence we'll wait on before reusing the buffer.
frame->metadata()->SetBoolean(VideoFrameMetadata::READ_LOCK_FENCES_ENABLED,
true);
return frame;
}
// Called by FuchsiaVideoDecoder when it no longer needs this mailbox.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment