Skip to content

Commit 2aafe74

Browse files
author
Jamie Gennis
committed
SurfaceTexture: unhide setDefaultBufferSize
Change-Id: Ia4d3e1829339acaecaa7f10023945a432c581d72
1 parent 62015f5 commit 2aafe74

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

api/current.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8792,6 +8792,7 @@ package android.graphics {
87928792
method public long getTimestamp();
87938793
method public void getTransformMatrix(float[]);
87948794
method public void release();
8795+
method public void setDefaultBufferSize(int, int);
87958796
method public void setOnFrameAvailableListener(android.graphics.SurfaceTexture.OnFrameAvailableListener);
87968797
method public void updateTexImage();
87978798
}

graphics/java/android/graphics/SurfaceTexture.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,17 @@ public void setOnFrameAvailableListener(OnFrameAvailableListener l) {
130130
}
131131

132132
/**
133-
* Set the size of buffers returned by requestBuffers when a width and height
134-
* of zero is requested.
133+
* Set the default size of the image buffers. The image producer may override the buffer size,
134+
* in which case the producer-set buffer size will be used, not the default size set by this
135+
* method. Both video and camera based image producers do override the size. This method may
136+
* be used to set the image size when producing images with {@link android.graphics.Canvas} (via
137+
* {@link android.view.Surface#lockCanvas}), or OpenGL ES (via an EGLSurface).
135138
*
136-
* @hide Pending approval by API council.
139+
* The new default buffer size will take effect the next time the image producer requests a
140+
* buffer to fill. For {@link android.graphics.Canvas} this will be the next time {@link
141+
* android.view.Surface#lockCanvas} is called. For OpenGL ES, the EGLSurface should be
142+
* destroyed (via eglDestroySurface), made not-current (via eglMakeCurrent), and then recreated
143+
* (via eglCreateWindowSurface) to ensure that the new default size has taken effect.
137144
*/
138145
public void setDefaultBufferSize(int width, int height) {
139146
nativeSetDefaultBufferSize(width, height);

0 commit comments

Comments
 (0)