Android: Simlify createOesTextureBuffer() in VideoFrameBufferTest
There is no need to hold on to the render thread after the OES texture buffer has been created. toI420() is handled by the thread in the SurfaceTextureHelper. Bug: webrtc:9391 Change-Id: Ide081bc083db72bb991f1deba74d3cecf3e1fee6 Reviewed-on: https://webrtc-review.googlesource.com/84121 Reviewed-by: Sami Kalliomäki <sakal@webrtc.org> Commit-Queue: Magnus Jedvert <magjed@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23652}
This commit is contained in:

committed by
Commit Bot

parent
8a5edb2568
commit
c66613daf7
@ -210,60 +210,9 @@ public class VideoFrameBufferTest {
|
||||
return surfaceTextureHelper.createTextureBuffer(width, height,
|
||||
RendererCommon.convertMatrixToAndroidGraphicsMatrix(listener.transformMatrix));
|
||||
});
|
||||
renderThread.quit();
|
||||
|
||||
// Wrap |oesBuffer| to quit |renderThread| once |oesBuffer| is released.
|
||||
return new VideoFrame.TextureBuffer() {
|
||||
private final RefCountDelegate refCountDelegate = new RefCountDelegate(() -> {
|
||||
oesBuffer.release();
|
||||
renderThread.quit();
|
||||
});
|
||||
|
||||
@Override
|
||||
public void retain() {
|
||||
refCountDelegate.retain();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void release() {
|
||||
refCountDelegate.release();
|
||||
}
|
||||
|
||||
@Override
|
||||
public VideoFrame.TextureBuffer.Type getType() {
|
||||
return oesBuffer.getType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTextureId() {
|
||||
return oesBuffer.getTextureId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Matrix getTransformMatrix() {
|
||||
return oesBuffer.getTransformMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWidth() {
|
||||
return oesBuffer.getWidth();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHeight() {
|
||||
return oesBuffer.getHeight();
|
||||
}
|
||||
|
||||
@Override
|
||||
public VideoFrame.I420Buffer toI420() {
|
||||
return oesBuffer.toI420();
|
||||
}
|
||||
|
||||
@Override
|
||||
public VideoFrame.Buffer cropAndScale(
|
||||
int cropX, int cropY, int cropWidth, int cropHeight, int scaleWidth, int scaleHeight) {
|
||||
return oesBuffer.cropAndScale(cropX, cropY, cropWidth, cropHeight, scaleWidth, scaleHeight);
|
||||
}
|
||||
};
|
||||
return oesBuffer;
|
||||
}
|
||||
|
||||
/** Create an NV21Buffer with the same pixel content as the given I420 buffer. */
|
||||
|
Reference in New Issue
Block a user