Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -8454,6 +8454,7 @@ package android.graphics { ctor public SurfaceTexture(int, boolean); method public long getTimestamp(); method public void getTransformMatrix(float[]); method public void release(); method public void setOnFrameAvailableListener(android.graphics.SurfaceTexture.OnFrameAvailableListener); method public void updateTexImage(); } core/java/android/view/TextureView.java +1 −0 Original line number Diff line number Diff line Loading @@ -204,6 +204,7 @@ public class TextureView extends View { } mLayer.destroy(); mSurface.release(); mSurface = null; mLayer = null; } Loading core/jni/android/graphics/SurfaceTexture.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -233,6 +233,12 @@ static jlong SurfaceTexture_getTimestamp(JNIEnv* env, jobject thiz) return surfaceTexture->getTimestamp(); } static void SurfaceTexture_release(JNIEnv* env, jobject thiz) { sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); surfaceTexture->abandon(); } // ---------------------------------------------------------------------------- static JNINativeMethod gSurfaceTextureMethods[] = { Loading @@ -243,6 +249,7 @@ static JNINativeMethod gSurfaceTextureMethods[] = { {"nativeUpdateTexImage", "()V", (void*)SurfaceTexture_updateTexImage }, {"nativeGetTransformMatrix", "([F)V", (void*)SurfaceTexture_getTransformMatrix }, {"nativeGetTimestamp", "()J", (void*)SurfaceTexture_getTimestamp }, {"nativeRelease", "()V", (void*)SurfaceTexture_release }, }; int register_android_graphics_SurfaceTexture(JNIEnv* env) Loading graphics/java/android/graphics/SurfaceTexture.java +20 −0 Original line number Diff line number Diff line Loading @@ -187,6 +187,25 @@ public class SurfaceTexture { return nativeGetTimestamp(); } /** * release() frees all the buffers and puts the SurfaceTexture into the * 'abandoned' state. Once put in this state the SurfaceTexture can never * leave it. When in the 'abandoned' state, all methods of the * ISurfaceTexture interface will fail with the NO_INIT error. * * Note that while calling this method causes all the buffers to be freed * from the perspective of the the SurfaceTexture, if there are additional * references on the buffers (e.g. if a buffer is referenced by a client or * by OpenGL ES as a texture) then those buffer will remain allocated. * * Always call this method when you are done with SurfaceTexture. Failing * to do so may delay resource deallocation for a significant amount of * time. */ public void release() { nativeRelease(); } protected void finalize() throws Throwable { try { nativeFinalize(); Loading Loading @@ -232,6 +251,7 @@ public class SurfaceTexture { private native void nativeSetDefaultBufferSize(int width, int height); private native void nativeUpdateTexImage(); private native int nativeGetQueuedCount(); private native void nativeRelease(); /* * We use a class initializer to allow the native code to cache some Loading libs/gui/SurfaceTexture.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -910,6 +910,7 @@ void SurfaceTexture::abandon() { Mutex::Autolock lock(mMutex); freeAllBuffers(); mAbandoned = true; mCurrentTextureBuf.clear(); mDequeueCondition.signal(); } Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -8454,6 +8454,7 @@ package android.graphics { ctor public SurfaceTexture(int, boolean); method public long getTimestamp(); method public void getTransformMatrix(float[]); method public void release(); method public void setOnFrameAvailableListener(android.graphics.SurfaceTexture.OnFrameAvailableListener); method public void updateTexImage(); }
core/java/android/view/TextureView.java +1 −0 Original line number Diff line number Diff line Loading @@ -204,6 +204,7 @@ public class TextureView extends View { } mLayer.destroy(); mSurface.release(); mSurface = null; mLayer = null; } Loading
core/jni/android/graphics/SurfaceTexture.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -233,6 +233,12 @@ static jlong SurfaceTexture_getTimestamp(JNIEnv* env, jobject thiz) return surfaceTexture->getTimestamp(); } static void SurfaceTexture_release(JNIEnv* env, jobject thiz) { sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); surfaceTexture->abandon(); } // ---------------------------------------------------------------------------- static JNINativeMethod gSurfaceTextureMethods[] = { Loading @@ -243,6 +249,7 @@ static JNINativeMethod gSurfaceTextureMethods[] = { {"nativeUpdateTexImage", "()V", (void*)SurfaceTexture_updateTexImage }, {"nativeGetTransformMatrix", "([F)V", (void*)SurfaceTexture_getTransformMatrix }, {"nativeGetTimestamp", "()J", (void*)SurfaceTexture_getTimestamp }, {"nativeRelease", "()V", (void*)SurfaceTexture_release }, }; int register_android_graphics_SurfaceTexture(JNIEnv* env) Loading
graphics/java/android/graphics/SurfaceTexture.java +20 −0 Original line number Diff line number Diff line Loading @@ -187,6 +187,25 @@ public class SurfaceTexture { return nativeGetTimestamp(); } /** * release() frees all the buffers and puts the SurfaceTexture into the * 'abandoned' state. Once put in this state the SurfaceTexture can never * leave it. When in the 'abandoned' state, all methods of the * ISurfaceTexture interface will fail with the NO_INIT error. * * Note that while calling this method causes all the buffers to be freed * from the perspective of the the SurfaceTexture, if there are additional * references on the buffers (e.g. if a buffer is referenced by a client or * by OpenGL ES as a texture) then those buffer will remain allocated. * * Always call this method when you are done with SurfaceTexture. Failing * to do so may delay resource deallocation for a significant amount of * time. */ public void release() { nativeRelease(); } protected void finalize() throws Throwable { try { nativeFinalize(); Loading Loading @@ -232,6 +251,7 @@ public class SurfaceTexture { private native void nativeSetDefaultBufferSize(int width, int height); private native void nativeUpdateTexImage(); private native int nativeGetQueuedCount(); private native void nativeRelease(); /* * We use a class initializer to allow the native code to cache some Loading
libs/gui/SurfaceTexture.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -910,6 +910,7 @@ void SurfaceTexture::abandon() { Mutex::Autolock lock(mMutex); freeAllBuffers(); mAbandoned = true; mCurrentTextureBuf.clear(); mDequeueCondition.signal(); } Loading