@Test public void release_withOwner() { FixedSizeSurfaceTexture surfaceTexture = new FixedSizeSurfaceTexture(0, new Size(1920, 1080), mOwner); when(mOwner.requestRelease()).thenReturn(false); surfaceTexture.release(); assertThat(surfaceTexture.mIsSuperReleased).isFalse(); when(mOwner.requestRelease()).thenReturn(true); surfaceTexture.release(); assertThat(surfaceTexture.mIsSuperReleased).isTrue(); }
@Override public void release() { if (mOwner.requestRelease()) { super.release(); mIsSuperReleased = true; } }
FixedSizeSurfaceTexture extends SurfaceTexture { @Override public void release() { if (mOwner.requestRelease()) { super.release(); mIsSuperReleased = true; } } }
FixedSizeSurfaceTexture extends SurfaceTexture { @Override public void release() { if (mOwner.requestRelease()) { super.release(); mIsSuperReleased = true; } } FixedSizeSurfaceTexture(int texName, Size fixedSize);   FixedSizeSurfaceTexture(int texName, Size fixedSize, Owner owner);   FixedSizeSurfaceTexture(int texName, boolean singleBufferMode, Size fixedSize); @RequiresApi(api = VERSION_CODES.O)  FixedSizeSurfaceTexture(boolean singleBufferMode, Size fixedSize); }
FixedSizeSurfaceTexture extends SurfaceTexture { @Override public void release() { if (mOwner.requestRelease()) { super.release(); mIsSuperReleased = true; } } FixedSizeSurfaceTexture(int texName, Size fixedSize);   FixedSizeSurfaceTexture(int texName, Size fixedSize, Owner owner);   FixedSizeSurfaceTexture(int texName, boolean singleBufferMode, Size fixedSize); @RequiresApi(api = VERSION_CODES.O)  FixedSizeSurfaceTexture(boolean singleBufferMode, Size fixedSize); @Override void setDefaultBufferSize(int width, int height); @Override void release(); }
FixedSizeSurfaceTexture extends SurfaceTexture { @Override public void release() { if (mOwner.requestRelease()) { super.release(); mIsSuperReleased = true; } } FixedSizeSurfaceTexture(int texName, Size fixedSize);   FixedSizeSurfaceTexture(int texName, Size fixedSize, Owner owner);   FixedSizeSurfaceTexture(int texName, boolean singleBufferMode, Size fixedSize); @RequiresApi(api = VERSION_CODES.O)  FixedSizeSurfaceTexture(boolean singleBufferMode, Size fixedSize); @Override void setDefaultBufferSize(int width, int height); @Override void release();  }