diff options
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/java/android/graphics/SurfaceTexture.java | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/graphics/java/android/graphics/SurfaceTexture.java b/graphics/java/android/graphics/SurfaceTexture.java index cd878c5a77cb..228d03a1dd10 100644 --- a/graphics/java/android/graphics/SurfaceTexture.java +++ b/graphics/java/android/graphics/SurfaceTexture.java @@ -120,7 +120,7 @@ public class SurfaceTexture { /** * Construct a new SurfaceTexture to stream images to a given OpenGL texture. - * + * <p> * In single buffered mode the application is responsible for serializing access to the image * content buffer. Each time the image content is to be updated, the * {@link #releaseTexImage()} method must be called before the image content producer takes @@ -143,7 +143,7 @@ public class SurfaceTexture { /** * Construct a new SurfaceTexture to stream images to a given OpenGL texture. - * + * <p> * In single buffered mode the application is responsible for serializing access to the image * content buffer. Each time the image content is to be updated, the * {@link #releaseTexImage()} method must be called before the image content producer takes @@ -152,7 +152,7 @@ public class SurfaceTexture { * must be called before each ANativeWindow_lock, or that call will fail. When producing * image content with OpenGL ES, {@link #releaseTexImage()} must be called before the first * OpenGL ES function call each frame. - * + * <p> * Unlike {@link #SurfaceTexture(int, boolean)}, which takes an OpenGL texture object name, * this constructor creates the SurfaceTexture in detached mode. A texture name must be passed * in using {@link #attachToGLContext} before calling {@link #releaseTexImage()} and producing @@ -222,15 +222,15 @@ public class SurfaceTexture { * method. Both video and camera based image producers do override the size. This method may * be used to set the image size when producing images with {@link android.graphics.Canvas} (via * {@link android.view.Surface#lockCanvas}), or OpenGL ES (via an EGLSurface). - * + * <p> * The new default buffer size will take effect the next time the image producer requests a * buffer to fill. For {@link android.graphics.Canvas} this will be the next time {@link * android.view.Surface#lockCanvas} is called. For OpenGL ES, the EGLSurface should be * destroyed (via eglDestroySurface), made not-current (via eglMakeCurrent), and then recreated - * (via eglCreateWindowSurface) to ensure that the new default size has taken effect. - * + * (via {@code eglCreateWindowSurface}) to ensure that the new default size has taken effect. + * <p> * The width and height parameters must be no greater than the minimum of - * GL_MAX_VIEWPORT_DIMS and GL_MAX_TEXTURE_SIZE (see + * {@code GL_MAX_VIEWPORT_DIMS} and {@code GL_MAX_TEXTURE_SIZE} (see * {@link javax.microedition.khronos.opengles.GL10#glGetIntegerv glGetIntegerv}). * An error due to invalid dimensions might not be reported until * updateTexImage() is called. @@ -242,7 +242,7 @@ public class SurfaceTexture { /** * Update the texture image to the most recent frame from the image stream. This may only be * called while the OpenGL ES context that owns the texture is current on the calling thread. - * It will implicitly bind its texture to the GL_TEXTURE_EXTERNAL_OES texture target. + * It will implicitly bind its texture to the {@code GL_TEXTURE_EXTERNAL_OES} texture target. */ public void updateTexImage() { nativeUpdateTexImage(); @@ -251,6 +251,7 @@ public class SurfaceTexture { /** * Releases the the texture content. This is needed in single buffered mode to allow the image * content producer to take ownership of the image buffer. + * <p> * For more information see {@link #SurfaceTexture(int, boolean)}. */ public void releaseTexImage() { @@ -263,7 +264,7 @@ public class SurfaceTexture { * ES texture object will be deleted as a result of this call. After calling this method all * calls to {@link #updateTexImage} will throw an {@link java.lang.IllegalStateException} until * a successful call to {@link #attachToGLContext} is made. - * + * <p> * This can be used to access the SurfaceTexture image contents from multiple OpenGL ES * contexts. Note, however, that the image contents are only accessible from one OpenGL ES * context at a time. @@ -279,8 +280,8 @@ public class SurfaceTexture { * Attach the SurfaceTexture to the OpenGL ES context that is current on the calling thread. A * new OpenGL ES texture object is created and populated with the SurfaceTexture image frame * that was current at the time of the last call to {@link #detachFromGLContext}. This new - * texture is bound to the GL_TEXTURE_EXTERNAL_OES texture target. - * + * texture is bound to the {@code GL_TEXTURE_EXTERNAL_OES} texture target. + * <p> * This can be used to access the SurfaceTexture image contents from multiple OpenGL ES * contexts. Note, however, that the image contents are only accessible from one OpenGL ES * context at a time. @@ -297,16 +298,16 @@ public class SurfaceTexture { /** * Retrieve the 4x4 texture coordinate transform matrix associated with the texture image set by - * the most recent call to updateTexImage. - * + * the most recent call to {@link #updateTexImage}. + * <p> * This transform matrix maps 2D homogeneous texture coordinates of the form (s, t, 0, 1) with s * and t in the inclusive range [0, 1] to the texture coordinate that should be used to sample * that location from the texture. Sampling the texture outside of the range of this transform * is undefined. - * + * <p> * The matrix is stored in column-major order so that it may be passed directly to OpenGL ES via - * the glLoadMatrixf or glUniformMatrix4fv functions. - * + * the {@code glLoadMatrixf} or {@code glUniformMatrix4fv} functions. + * <p> * If the underlying buffer has a crop associated with it, the transformation will also include * a slight scale to cut off a 1-texel border around the edge of the crop. This ensures that * when the texture is bilinear sampled that no texels outside of the buffer's valid region @@ -326,7 +327,7 @@ public class SurfaceTexture { /** * Retrieve the timestamp associated with the texture image set by the most recent call to - * updateTexImage. + * {@link #updateTexImage}. * * <p>This timestamp is in nanoseconds, and is normally monotonically increasing. The timestamp * should be unaffected by time-of-day adjustments. The specific meaning and zero point of the @@ -337,8 +338,8 @@ public class SurfaceTexture { * * <p>For camera sources, timestamps should be strictly monotonic. Timestamps from MediaPlayer * sources may be reset when the playback position is set. For EGL and Vulkan producers, the - * timestamp is the desired present time set with the EGL_ANDROID_presentation_time or - * VK_GOOGLE_display_timing extensions.</p> + * timestamp is the desired present time set with the {@code EGL_ANDROID_presentation_time} or + * {@code VK_GOOGLE_display_timing} extensions.</p> */ public long getTimestamp() { @@ -346,16 +347,17 @@ public class SurfaceTexture { } /** - * release() frees all the buffers and puts the SurfaceTexture into the + * {@code 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 - * IGraphicBufferProducer interface will fail with the NO_INIT error. - * + * {@code IGraphicBufferProducer} interface will fail with the {@code NO_INIT} + * error. + * <p> * 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. - * + * <p> * Always call this method when you are done with SurfaceTexture. Failing * to do so may delay resource deallocation for a significant amount of * time. @@ -367,7 +369,7 @@ public class SurfaceTexture { } /** - * Returns true if the SurfaceTexture was released. + * Returns {@code true} if the SurfaceTexture was released. * * @see #release() */ @@ -400,7 +402,7 @@ public class SurfaceTexture { } /** - * Returns true if the SurfaceTexture is single-buffered + * Returns {@code true} if the SurfaceTexture is single-buffered. * @hide */ public boolean isSingleBuffered() { |