Class TextureLoader
- java.lang.Object
-
- com.parrot.drone.groundsdk.stream.TextureLoader
-
public abstract class TextureLoader extends Object
Allows to bypass default GL texture loading step when rendering a stream usingGsdkStreamView
.Client code must
specify dimensions
for the GL texture that the renderer will provide.
Then, for each frame to be rendered,loadTexture(com.parrot.drone.groundsdk.stream.TextureLoader.TextureContext, com.parrot.drone.groundsdk.stream.TextureLoader.FrameContext)
will be called; client code must override this callback to fill the GL texture according to its needs.
The renderer will then scale, pad and render the loaded texture as appropriate.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
TextureLoader.FrameContext
Contextual information on a frame.static interface
TextureLoader.TextureContext
Contextual information on the texture.static class
TextureLoader.TextureSpec
Allows to specify GL texture dimensions.
-
Constructor Summary
Constructors Modifier Constructor Description protected
TextureLoader(TextureLoader.TextureSpec textureSpec)
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description TextureLoader.TextureSpec
getTextureSpec()
Retrieves configured texture specification.abstract boolean
loadTexture(TextureLoader.TextureContext textureContext, TextureLoader.FrameContext frameContext)
Loads GL texture.
-
-
-
Constructor Detail
-
TextureLoader
protected TextureLoader(@NonNull TextureLoader.TextureSpec textureSpec)
Constructor.- Parameters:
textureSpec
- texture specification
-
-
Method Detail
-
getTextureSpec
@NonNull public final TextureLoader.TextureSpec getTextureSpec()
Retrieves configured texture specification.- Returns:
- texture spec
-
loadTexture
public abstract boolean loadTexture(@NonNull TextureLoader.TextureContext textureContext, @NonNull TextureLoader.FrameContext frameContext)
Loads GL texture.Called on
GsdkStreamView
GL rendering thread.- Parameters:
textureContext
- contextual information about the texture where the frame is rendered, invalid after this method returnsframeContext
- contextual information about the frame to be rendered, invalid after this method returns- Returns:
true
to indicate that texture loading was successful, otherwisefalse
-
-