Loading core/java/android/view/TextureView.java +8 −0 Original line number Diff line number Diff line Loading @@ -717,6 +717,14 @@ public class TextureView extends View { if (surfaceTexture == null) { throw new NullPointerException("surfaceTexture must not be null"); } if (surfaceTexture == mSurface) { throw new IllegalArgumentException("Trying to setSurfaceTexture to " + "the same SurfaceTexture that's already set."); } if (surfaceTexture.isReleased()) { throw new IllegalArgumentException("Cannot setSurfaceTexture to a " + "released SurfaceTexture"); } if (mSurface != null) { mSurface.release(); } Loading core/jni/android/graphics/SurfaceTexture.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -341,6 +341,12 @@ static void SurfaceTexture_release(JNIEnv* env, jobject thiz) surfaceTexture->abandon(); } static jboolean SurfaceTexture_isReleased(JNIEnv* env, jobject thiz) { sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); return surfaceTexture->isAbandoned(); } // ---------------------------------------------------------------------------- static JNINativeMethod gSurfaceTextureMethods[] = { Loading @@ -355,6 +361,7 @@ static JNINativeMethod gSurfaceTextureMethods[] = { {"nativeGetTransformMatrix", "([F)V", (void*)SurfaceTexture_getTransformMatrix }, {"nativeGetTimestamp", "()J", (void*)SurfaceTexture_getTimestamp }, {"nativeRelease", "()V", (void*)SurfaceTexture_release }, {"nativeIsReleased", "()Z", (void*)SurfaceTexture_isReleased }, }; int register_android_graphics_SurfaceTexture(JNIEnv* env) Loading graphics/java/android/graphics/SurfaceTexture.java +9 −0 Original line number Diff line number Diff line Loading @@ -347,6 +347,14 @@ public class SurfaceTexture { nativeRelease(); } /** * Returns true if the SurfaceTexture was released * @hide */ public boolean isReleased() { return nativeIsReleased(); } @Override protected void finalize() throws Throwable { try { Loading Loading @@ -383,6 +391,7 @@ public class SurfaceTexture { private native int nativeAttachToGLContext(int texName); private native int nativeGetQueuedCount(); private native void nativeRelease(); private native boolean nativeIsReleased(); /* * We use a class initializer to allow the native code to cache some Loading Loading
core/java/android/view/TextureView.java +8 −0 Original line number Diff line number Diff line Loading @@ -717,6 +717,14 @@ public class TextureView extends View { if (surfaceTexture == null) { throw new NullPointerException("surfaceTexture must not be null"); } if (surfaceTexture == mSurface) { throw new IllegalArgumentException("Trying to setSurfaceTexture to " + "the same SurfaceTexture that's already set."); } if (surfaceTexture.isReleased()) { throw new IllegalArgumentException("Cannot setSurfaceTexture to a " + "released SurfaceTexture"); } if (mSurface != null) { mSurface.release(); } Loading
core/jni/android/graphics/SurfaceTexture.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -341,6 +341,12 @@ static void SurfaceTexture_release(JNIEnv* env, jobject thiz) surfaceTexture->abandon(); } static jboolean SurfaceTexture_isReleased(JNIEnv* env, jobject thiz) { sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); return surfaceTexture->isAbandoned(); } // ---------------------------------------------------------------------------- static JNINativeMethod gSurfaceTextureMethods[] = { Loading @@ -355,6 +361,7 @@ static JNINativeMethod gSurfaceTextureMethods[] = { {"nativeGetTransformMatrix", "([F)V", (void*)SurfaceTexture_getTransformMatrix }, {"nativeGetTimestamp", "()J", (void*)SurfaceTexture_getTimestamp }, {"nativeRelease", "()V", (void*)SurfaceTexture_release }, {"nativeIsReleased", "()Z", (void*)SurfaceTexture_isReleased }, }; int register_android_graphics_SurfaceTexture(JNIEnv* env) Loading
graphics/java/android/graphics/SurfaceTexture.java +9 −0 Original line number Diff line number Diff line Loading @@ -347,6 +347,14 @@ public class SurfaceTexture { nativeRelease(); } /** * Returns true if the SurfaceTexture was released * @hide */ public boolean isReleased() { return nativeIsReleased(); } @Override protected void finalize() throws Throwable { try { Loading Loading @@ -383,6 +391,7 @@ public class SurfaceTexture { private native int nativeAttachToGLContext(int texName); private native int nativeGetQueuedCount(); private native void nativeRelease(); private native boolean nativeIsReleased(); /* * We use a class initializer to allow the native code to cache some Loading