• liberato's avatar
    Add SurfaceTexture::release and call it from AVDA. · 2c238bbd
    liberato authored
    SurfaceTexture::release() discards unused buffers and tears down the
    SurfaceTexture, leaving only the front buffer if it's bound to a GL
    texture.  This CL plumbs that down to native.
    
    This CL also uses it for AVDA, so that back buffers don't take up
    memory when the deferred strategy is shut down.
    
    As part of that, it splits strategy cleanup into two parts.  The
    first is called before flush, while the latter is called after.
    This prevents transitioning the SurfaceTexture into the released
    state while the flush is still trying to talk to MediaCodec.  It's
    unclear that would be safe.
    
    BUG=619658
    
    Review-Url: https://codereview.chromium.org/2095873005
    Cr-Commit-Position: refs/heads/master@{#402187}
    2c238bbd
android_copying_backing_strategy.h 2.25 KB