Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(629)

Unified Diff: talk/app/webrtc/androidtests/src/org/webrtc/MediaCodecVideoEncoderTest.java

Issue 1461083002: Use EGL14 if supported on Android (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixed tests Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: talk/app/webrtc/androidtests/src/org/webrtc/MediaCodecVideoEncoderTest.java
diff --git a/talk/app/webrtc/androidtests/src/org/webrtc/MediaCodecVideoEncoderTest.java b/talk/app/webrtc/androidtests/src/org/webrtc/MediaCodecVideoEncoderTest.java
index ee62008010f62add44b6a59502fd3b148f03574a..f4021729058c2010af2ec5223b522d2e2565d271 100644
--- a/talk/app/webrtc/androidtests/src/org/webrtc/MediaCodecVideoEncoderTest.java
+++ b/talk/app/webrtc/androidtests/src/org/webrtc/MediaCodecVideoEncoderTest.java
@@ -38,8 +38,6 @@ import org.webrtc.MediaCodecVideoEncoder.OutputBufferInfo;
import java.nio.ByteBuffer;
-import javax.microedition.khronos.egl.EGL10;
-
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1)
public final class MediaCodecVideoEncoderTest extends ActivityTestCase {
final static String TAG = "MediaCodecVideoEncoderTest";
@@ -63,11 +61,13 @@ public final class MediaCodecVideoEncoderTest extends ActivityTestCase {
Log.i(TAG, "hardware does not support VP8 encoding, skipping testEncoderUsingTextures");
return;
}
+ Egl eglBase = Egl.create();
MediaCodecVideoEncoder encoder = new MediaCodecVideoEncoder();
assertTrue(encoder.initEncode(
MediaCodecVideoEncoder.VideoCodecType.VIDEO_CODEC_VP8, 640, 480, 300, 30,
- EGL10.EGL_NO_CONTEXT));
+ eglBase.getEglContext()));
encoder.release();
+ eglBase.release();
}
@SmallTest
@@ -81,10 +81,12 @@ public final class MediaCodecVideoEncoderTest extends ActivityTestCase {
MediaCodecVideoEncoder.VideoCodecType.VIDEO_CODEC_VP8, 640, 480, 300, 30,
null));
encoder.release();
+ Egl eglBase = Egl.create();
assertTrue(encoder.initEncode(
MediaCodecVideoEncoder.VideoCodecType.VIDEO_CODEC_VP8, 640, 480, 300, 30,
- EGL10.EGL_NO_CONTEXT));
+ eglBase.getEglContext()));
encoder.release();
+ eglBase.release();
}
@SmallTest
@@ -141,7 +143,7 @@ public final class MediaCodecVideoEncoderTest extends ActivityTestCase {
final int height = 480;
final long presentationTs = 2;
- final EglBase eglOesBase = new EglBase(EGL10.EGL_NO_CONTEXT, EglBase.ConfigType.PIXEL_BUFFER);
+ final Egl eglOesBase = Egl.create(null, Egl.ConfigType.PIXEL_BUFFER);
eglOesBase.createDummyPbufferSurface();
eglOesBase.makeCurrent();
int oesTextureId = GlUtil.generateTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES);
@@ -154,7 +156,7 @@ public final class MediaCodecVideoEncoderTest extends ActivityTestCase {
assertTrue(encoder.initEncode(
MediaCodecVideoEncoder.VideoCodecType.VIDEO_CODEC_VP8, width, height, 300, 30,
- eglOesBase.getContext()));
+ eglOesBase.getEglContext()));
assertTrue(encoder.encodeTexture(true, oesTextureId, RendererCommon.identityMatrix(),
presentationTs));
GlUtil.checkNoGLES2Error("encodeTexture");

Powered by Google App Engine
This is Rietveld 408576698