am 3c0f91b0: Merge "Add docs about threading to SurfaceTexture." into honeycomb

* commit '3c0f91b0e1312287a271ba890d52cdb8bb75e52d':
  Add docs about threading to SurfaceTexture.
This commit is contained in:
Jamie Gennis
2011-01-28 10:44:44 -08:00
committed by Android Git Automerger

View File

@@ -24,9 +24,9 @@ import android.os.Message;
/** /**
* Captures frames from an image stream as an OpenGL ES texture. * Captures frames from an image stream as an OpenGL ES texture.
* *
* <p>The image stream may come from either video playback or camera preview. A SurfaceTexture may * <p>The image stream may come from either camera preview. A SurfaceTexture may be used in place
* be used in place of a SurfaceHolder when specifying the output destination of a MediaPlayer or * of a SurfaceHolder when specifying the output destination of a {@link android.hardware.Camera}
* Camera object. This will cause all the frames from that image stream to be sent to the * object. Doing so will cause all the frames from the image stream to be sent to the
* SurfaceTexture object rather than to the device's display. When {@link #updateTexImage} is * SurfaceTexture object rather than to the device's display. When {@link #updateTexImage} is
* called, the contents of the texture object specified when the SurfaceTexture was created is * called, the contents of the texture object specified when the SurfaceTexture was created is
* updated to contain the most recent image from the image stream. This may cause some frames of * updated to contain the most recent image from the image stream. This may cause some frames of
@@ -34,6 +34,11 @@ import android.os.Message;
* *
* <p>The texture object uses the GL_TEXTURE_EXTERNAL_OES texture target, which is defined by the * <p>The texture object uses the GL_TEXTURE_EXTERNAL_OES texture target, which is defined by the
* OES_EGL_image_external OpenGL ES extension. This limits how the texture may be used. * OES_EGL_image_external OpenGL ES extension. This limits how the texture may be used.
*
* <p>SurfaceTexture objects may be created on any thread. {@link #updateTexImage} may only be
* called on the thread with the OpenGL ES context that contains the texture object. The
* frame-available callback is called on an arbitrary thread, so unless special care is taken {@link
* #updateTexImage} should not be called directly from the callback.
*/ */
public class SurfaceTexture { public class SurfaceTexture {