• Andres Calderon Jaramillo's avatar
    Extend SharedImage life in MailboxVideoFrameConverter. · cb0b1149
    Andres Calderon Jaramillo authored
    This CL fixes the MailboxVideoFrameConverter to let ScopedSharedImage be
    owned by the unwrapped DMA-buf VideoFrame (a.k.a. origin_frame in the
    code). Note that the mailbox VideoFrame sent to the client has a
    reference to the wrapping VideoFrame. Therefore, the new ownership model
    ensures that the SharedImage lives at least as long as the mailbox
    VideoFrame, even if the MailboxVideoFrameConverter dies in the meantime
    (this has been observed to happen when pausing a video then switching to
    another tab to play another video and then switching back to the
    original tab - see referenced bug for more details).
    
    Note that ScopedSharedImage is changed to be mutable. That's because we
    need to handle a case in which the visible rectangle of a VideoFrame
    changes and the SharedImage needs to be regenerated.
    
    Bug: 1044890
    Test: forced the use of VD in krane and went through scenario in bug.
    Change-Id: I4ff20b0b5088a7a202efc98747fdb5e7a9e9d5f4
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2119153
    Commit-Queue: Andres Calderon Jaramillo <andrescj@chromium.org>
    Reviewed-by: default avatarChih-Yu Huang <akahuang@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#754785}
    cb0b1149
mailbox_video_frame_converter.cc 16.9 KB