diff --git a/sdk/android/api/org/webrtc/SurfaceTextureHelper.java b/sdk/android/api/org/webrtc/SurfaceTextureHelper.java index dbdf2684d6..fc5eb37661 100644 --- a/sdk/android/api/org/webrtc/SurfaceTextureHelper.java +++ b/sdk/android/api/org/webrtc/SurfaceTextureHelper.java @@ -18,13 +18,9 @@ import android.opengl.GLES20; import android.os.Build; import android.os.Handler; import android.os.HandlerThread; -import android.os.SystemClock; import java.nio.ByteBuffer; -import java.nio.FloatBuffer; import java.util.concurrent.Callable; -import java.util.concurrent.TimeUnit; import org.webrtc.EglBase; -import org.webrtc.VideoFrame.I420Buffer; import org.webrtc.VideoFrame.TextureBuffer; /** @@ -256,14 +252,9 @@ public class SurfaceTextureHelper { } /** - * Posts to the correct thread to convert |textureBuffer| to I420. Must only be called with - * textures generated by this SurfaceTextureHelper. + * Posts to the correct thread to convert |textureBuffer| to I420. */ public VideoFrame.I420Buffer textureToYuv(final TextureBuffer textureBuffer) { - if (textureBuffer.getTextureId() != oesTextureId) { - throw new IllegalStateException("textureToByteBuffer called with unexpected textureId"); - } - final VideoFrame.I420Buffer[] result = new VideoFrame.I420Buffer[1]; ThreadUtils.invokeAtFrontUninterruptibly(handler, () -> { if (yuvConverter == null) { diff --git a/sdk/android/api/org/webrtc/YuvConverter.java b/sdk/android/api/org/webrtc/YuvConverter.java index 268e4d2885..844ab58bfe 100644 --- a/sdk/android/api/org/webrtc/YuvConverter.java +++ b/sdk/android/api/org/webrtc/YuvConverter.java @@ -216,6 +216,7 @@ public class YuvConverter { if (textureType != shaderTextureType) { initShader(textureType); } + shader.useProgram(); // We draw into a buffer laid out like //