Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cf559377 authored by Grace Kloba's avatar Grace Kloba
Browse files

Add onSurfaceTextureUpdated to the TextureView listener.

The app needs a way to throttle the producer side. Expose this to enable it.

Change-Id: I04b6a3fc444117a9fc2449fb87c3c834247c8ef1
parent ea5f5190
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -21643,6 +21643,7 @@ package android.view {
    method public abstract void onSurfaceTextureAvailable(android.graphics.SurfaceTexture, int, int);
    method public abstract void onSurfaceTextureDestroyed(android.graphics.SurfaceTexture);
    method public abstract void onSurfaceTextureSizeChanged(android.graphics.SurfaceTexture, int, int);
    method public abstract void onSurfaceTextureUpdated(android.graphics.SurfaceTexture);
  }
  public class TouchDelegate {
+18 −2
Original line number Diff line number Diff line
@@ -76,6 +76,10 @@ import android.util.Log;
 *          mCamera.stopPreview();
 *          mCamera.release();
 *      }
 *
 *      public void onSurfaceTextureUpdated(SurfaceTexture surface) {
 *          // Ignored
 *      }
 *  }
 * </pre>
 * 
@@ -315,6 +319,10 @@ public class TextureView extends View {

        mAttachInfo.mHardwareRenderer.updateTextureLayer(mLayer, getWidth(), getHeight(), mOpaque);

        if (mListener != null) {
            mListener.onSurfaceTextureUpdated(mSurface);
        }

        invalidate();
    }

@@ -474,6 +482,14 @@ public class TextureView extends View {
         * @param surface The surface about to be destroyed
         */
        public void onSurfaceTextureDestroyed(SurfaceTexture surface);

        /**
         * Invoked when the specified {@link SurfaceTexture} is updated through
         * {@link SurfaceTexture#updateTexImage()}.
         * 
         * @param surface The surface just updated
         */
        public void onSurfaceTextureUpdated(SurfaceTexture surface);
    }

    private static native void nSetDefaultBufferSize(SurfaceTexture surfaceTexture,
+6 −0
Original line number Diff line number Diff line
@@ -94,6 +94,12 @@ public class RSTextureView extends TextureView implements TextureView.SurfaceTex
        }
    }

    @Override
    public void onSurfaceTextureUpdated(SurfaceTexture surface) {
        //Log.e(RenderScript.LOG_TAG, "onSurfaceTextureUpdated");
        mSurfaceTexture = surface;
    }

   /**
     * Inform the view that the activity is paused. The owner of this view must
     * call this method when the activity is paused. Calling this method will
+4 −0
Original line number Diff line number Diff line
@@ -85,6 +85,10 @@ public class GLTextureViewActivity extends Activity implements TextureView.Surfa
        }
    }

    @Override
    public void onSurfaceTextureUpdated(SurfaceTexture surface) {
    }

    private static class RenderThread extends Thread {
        private static final String LOG_TAG = "GLTextureView";

+5 −0
Original line number Diff line number Diff line
@@ -100,4 +100,9 @@ public class GetBitmapActivity extends Activity implements TextureView.SurfaceTe
        mCamera.stopPreview();
        mCamera.release();
    }

    @Override
    public void onSurfaceTextureUpdated(SurfaceTexture surface) {
        // Ignored
    }
}
Loading