Package com.google.android.filament
Class Stream.Builder
- java.lang.Object
-
- com.google.android.filament.Stream.Builder
-
- Enclosing class:
- Stream
public static class Stream.Builder extends java.lang.ObjectUseBuilderto construct an Stream object instance. By default, Stream objects areACQUIREDand must have external images pushed to them viaStream.setAcquiredImage(java.lang.Object, java.lang.Object, java.lang.Runnable). To create aNATIVEorTEXTURE_IDstream, call one of thestream
methods on the builder.
-
-
Constructor Summary
Constructors Constructor Description Builder()UseBuilderto construct an Stream object instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Streambuild(Engine engine)Creates a newStreamobject instance.Stream.Builderheight(int height)Stream.Builderstream(long externalTextureId)Deprecated.this method existed only for ARCore which doesn't need this anymore, useTexture.Builder.importTexture(long)instead.Stream.Builderstream(java.lang.Object streamSource)Creates aNATIVEstream.Stream.Builderwidth(int width)
-
-
-
Method Detail
-
stream
@NonNull public Stream.Builder stream(@NonNull java.lang.Object streamSource)
Creates aNATIVEstream. Native streams can sample data directly from an opaque platform object such as aSurfaceTextureon Android.- Parameters:
streamSource- an opaque native stream handle, e.g.: on Android this must be aSurfaceTextureobject- Returns:
- This Builder, for chaining calls.
- See Also:
Texture.setExternalStream(com.google.android.filament.Engine, com.google.android.filament.Stream)
-
stream
@Deprecated @NonNull public Stream.Builder stream(long externalTextureId)
Deprecated.this method existed only for ARCore which doesn't need this anymore, useTexture.Builder.importTexture(long)instead.Creates aTEXTURE_IDstream. A copy stream will sample data from the supplied external texture and copy it into an internal private texture.Currently only OpenGL external texture ids are supported.
- Parameters:
externalTextureId- An opaque texture id (typically a GLuint created withglGenTextures()) in a context shared with filament -- in that case this texture's target must beGL_TEXTURE_EXTERNAL_OES.- Returns:
- This Builder, for chaining calls.
- See Also:
Texture.setExternalStream(com.google.android.filament.Engine, com.google.android.filament.Stream)
-
width
@NonNull public Stream.Builder width(int width)
- Parameters:
width- initial width of the incoming stream. Whether this value is used is stream dependent. On Android, it must be set when usingstream(long)- Returns:
- This Builder, for chaining calls.
-
height
@NonNull public Stream.Builder height(int height)
- Parameters:
height- initial height of the incoming stream. Whether this value is used is stream dependent. On Android, it must be set when usingstream(long)- Returns:
- This Builder, for chaining calls.
-
-