Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

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()

com.amazon.apmf.ISubscription* setSurfaceTextureListener(ISurfaceTextureListener* listener)
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.

Parameters

listener
ISurfaceTextureListener* — Required The listener to set

Returns

com.amazon.apmf.ISubscription* ISubscription object related to the listener

setScaleType()

void setScaleType(TextureScaleType scaleType)
Sets how the texture content should be scaled within the view bounds.

Parameters

scaleType
TextureScaleType — Required The scaling mode to use

getScaleType()

TextureScaleType getScaleType()
Gets the current scale type.

Returns

TextureScaleType The current scale type

setSurfaceId()

void setSurfaceId(string surfaceId)
Sets the surface ID to connect to an existing producer surface. Behavior:
  • 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
Producer Creation: The same surface ID should be used by the application to create the corresponding producer Surface through an appropriate abstraction. Error Handling: If the surface ID is invalid or the connection fails, onSurfaceTextureAvailable() will not be called.

Parameters

surfaceId
string — Required The surface identifier to connect to

Throws


Last modified on October 29, 2026