Interface ITextureView
interface ITextureView
Extends IView3
ITextureView displays hardware-accelerated texture content on screen,
acting as a consumer endpoint for texture-based rendering.
Hardware Acceleration Requirement:
ITextureView only functions when hardware-accelerated rendering is enabled.
Software rendering does not support texture-based buffer sharing.
Consumer-Only Model:
ITextureView serves exclusively as a consumer endpoint. It is the application
developer’s responsibility to create the producer through appropriate abstractions
and provide the surface ID to TextureView.
Surface ID Management:
The surface ID provided to setSurfaceId() can be used to create the corresponding
Surface producer using the same identifier, enabling seamless producer-consumer
coordination regardless of whether they operate in-process or across processes.
Methods
setSurfaceTextureListener()
Sets the ISurfaceTextureListener to receive surface events and returns a subscription object related to it. Only one listener can be set at a time. Calling this method multiple times will replace the previous listener.com.amazon.apmf.ISubscription*setSurfaceTextureListener(ISurfaceTextureListener*listener)
Parameters
listener
ISurfaceTextureListener* — Required
The listener to set
Returns
com.amazon.apmf.ISubscription*
ISubscription object related to the listener
setScaleType()
Sets how the texture content should be scaled within the view bounds.voidsetScaleType(TextureScaleTypescaleType)
Parameters
scaleType
TextureScaleType — Required
The scaling mode to use
getScaleType()
TextureScaleType getScaleType()
Gets the current scale type.
Returns
TextureScaleType
The current scale type
setSurfaceId()
Sets the surface ID to connect to an existing producer surface. Behavior:voidsetSurfaceId(stringsurfaceId)
- Creates or recreates the underlying surface texture connection
- Triggers onSurfaceTextureDestroyed() for any existing surface (if applicable)
- Triggers onSurfaceTextureAvailable() when the new connection is established
- Multiple calls with different surface IDs will switch between producers
Parameters
surfaceId
string — Required
The surface identifier to connect to
Throws
InvalidArgumentError— if surfaceId is empty or invalid

