Class AbstractCallbackMedia

java.lang.Object
uk.co.caprica.vlcj.media.callback.AbstractCallbackMedia
All Implemented Interfaces:
CallbackMedia
Direct Known Subclasses:
DefaultCallbackMedia

public abstract class AbstractCallbackMedia extends Object implements CallbackMedia
Base implementation of media that uses the native media callbacks.

This implementation mostly encapsulates the native callbacks using template methods, with the exception of the onRead(Pointer, int) method. This particular method is used to read data and populate the native buffer. The reason this method exposes a native Pointer is so sub-classes can access the native buffer as efficiently as possible.

In most cases it is likely preferable to deal instead with a Java byte array buffer, for this purpose the DefaultCallbackMedia sub-class should be used instead of this class.

  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractCallbackMedia(boolean seekable)
    Create a new media instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    final uk.co.caprica.vlcj.binding.internal.libvlc_media_close_cb
    Get the native close media callback.
    final com.sun.jna.Pointer
    Get the native opaque handle.
    final uk.co.caprica.vlcj.binding.internal.libvlc_media_open_cb
    Get the native open media callback.
    final uk.co.caprica.vlcj.binding.internal.libvlc_media_read_cb
    Get the native read media callback.
    final uk.co.caprica.vlcj.binding.internal.libvlc_media_seek_cb
    Get the native seek media callback.
    final boolean
    Is the media seekable?

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AbstractCallbackMedia

      public AbstractCallbackMedia(boolean seekable)
      Create a new media instance.
      Parameters:
      seekable - true if the media is seekable; false if it is not
  • Method Details

    • isSeekable

      public final boolean isSeekable()
      Is the media seekable?
      Returns:
      true if the media is seekable; false if it is not
    • getOpen

      public final uk.co.caprica.vlcj.binding.internal.libvlc_media_open_cb getOpen()
      Description copied from interface: CallbackMedia
      Get the native open media callback.
      Specified by:
      getOpen in interface CallbackMedia
      Returns:
      open callback
    • getRead

      public final uk.co.caprica.vlcj.binding.internal.libvlc_media_read_cb getRead()
      Description copied from interface: CallbackMedia
      Get the native read media callback.
      Specified by:
      getRead in interface CallbackMedia
      Returns:
      read callback
    • getSeek

      public final uk.co.caprica.vlcj.binding.internal.libvlc_media_seek_cb getSeek()
      Description copied from interface: CallbackMedia
      Get the native seek media callback.
      Specified by:
      getSeek in interface CallbackMedia
      Returns:
      seek callback
    • getClose

      public final uk.co.caprica.vlcj.binding.internal.libvlc_media_close_cb getClose()
      Description copied from interface: CallbackMedia
      Get the native close media callback.
      Specified by:
      getClose in interface CallbackMedia
      Returns:
      close callback
    • getOpaque

      public final com.sun.jna.Pointer getOpaque()
      Description copied from interface: CallbackMedia
      Get the native opaque handle.
      Specified by:
      getOpaque in interface CallbackMedia
      Returns:
      opaque handle