Interface SurfaceTextureListener

  • All Implemented Interfaces:

    
    public interface SurfaceTextureListener
    
                        

    Interface for handling surface texture lifecycle events in video playback.

    This listener provides callbacks for key surface texture events that occur during video rendering, allowing the video player to respond to surface availability and destruction events.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Unit onSurfaceTextureAvailable(SurfaceTexture surface) Called when the surface texture becomes available for rendering.
      abstract Unit onSurfaceTextureDestroyed() Called when the surface texture is about to be destroyed.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • onSurfaceTextureAvailable

         abstract Unit onSurfaceTextureAvailable(SurfaceTexture surface)

        Called when the surface texture becomes available for rendering.

        This method is invoked when the underlying surface is ready to receive video frames. The video player should attach the media player to this surface to start rendering video content.

        Parameters:
        surface - The SurfaceTexture that is now available for video rendering
      • onSurfaceTextureDestroyed

         abstract Unit onSurfaceTextureDestroyed()

        Called when the surface texture is about to be destroyed.

        This method is invoked when the surface is no longer available for rendering. The video player should detach the media player from the surface and clean up any resources associated with the surface to prevent memory leaks.