java.lang.Object
uk.co.caprica.vlcj.player.embedded.videosurface.callback.RenderCallbackAdapter
All Implemented Interfaces:
RenderCallback

public abstract class RenderCallbackAdapter extends Object implements RenderCallback
A render callback adapter implementation that fills an array of integer data for an entire video frame.

If you simply want access to the native memory buffer you should consider implementing RenderCallback directly rather than using this class.

This is probably not the most efficient implementation possible of a render callback, ideally the native video data would be written directly to some other construct (like a texture).

Having said that, the supplied buffer could be a buffer direct from an image raster, in which case it should be quite quick.

  • Constructor Details

    • RenderCallbackAdapter

      public RenderCallbackAdapter(int[] buffer)
      Create a new render callback.

      The caller must ensure the supplied data buffer is large enough to hold the video frame data.

      Parameters:
      buffer - video data buffer
    • RenderCallbackAdapter

      public RenderCallbackAdapter()
      Create a new render callback.

      The video frame buffer must subsequently by set via setBuffer(int[]).

  • Method Details

    • setBuffer

      public final void setBuffer(int[] buffer)
      Set the buffer to use for the video frame data.

      The caller must ensure the supplied data buffer is large enough to hold the video frame data.

      Parameters:
      buffer - buffer
    • display

      public final void display(MediaPlayer mediaPlayer, ByteBuffer[] nativeBuffers, BufferFormat bufferFormat)
      Description copied from interface: RenderCallback
      Call-back when ready to display a video frame.

      Implementations of this method must execute as quickly as possible.

      Specified by:
      display in interface RenderCallback
      Parameters:
      mediaPlayer - media player to which the event relates
      nativeBuffers - video data for one frame
      bufferFormat - information about the format of the buffer used