Class MediaFactory

java.lang.Object
uk.co.caprica.vlcj.media.MediaFactory

public final class MediaFactory extends Object
Factory to create Media and MediaRef instances.

This factory is not intended for use by client applications.

  • Method Details

    • newMediaRef

      public static MediaRef newMediaRef(uk.co.caprica.vlcj.binding.internal.libvlc_instance_t libvlcInstance, uk.co.caprica.vlcj.binding.internal.libvlc_media_t mediaInstance, String... options)
      Create a new MediaRef for a native media instance.

      The client application must release the returned MediaRef when it no long has any use for it.

      Parameters:
      libvlcInstance - native library instance
      mediaInstance - native media instance
      options - options to add to the media
      Returns:
      media reference
    • newMediaRef

      public static MediaRef newMediaRef(uk.co.caprica.vlcj.binding.internal.libvlc_instance_t libvlcInstance, String mrl, String... options)
      Create a new MediaRef for a media resource locator.

      The caller must release the returned MediaRef when it has no further use for it.

      Parameters:
      libvlcInstance - native library instance
      mrl - media resource locator
      options - options to add to the media
      Returns:
      media reference
    • newMediaRef

      public static MediaRef newMediaRef(uk.co.caprica.vlcj.binding.internal.libvlc_instance_t libvlcInstance, CallbackMedia callbackMedia, String... options)
      Create a new MediaRef for callback media.

      The caller must release the returned MediaRef when it has no further use for it.

      Parameters:
      libvlcInstance - native library instance
      callbackMedia - callback media component
      options - options to add to the media
      Returns:
      media reference
    • newMediaRef

      public static MediaRef newMediaRef(uk.co.caprica.vlcj.binding.internal.libvlc_instance_t libvlcInstance, Media media, String... options)
      Create a new MediaRef for a Media.

      The caller must release the supplied Media when it has no further use for it.

      The caller must release the returned MediaRef when it has no further use for it.

      Parameters:
      libvlcInstance - native library instance
      media - media
      options - options to add to the media
      Returns:
      media reference
    • newMediaRef

      public static MediaRef newMediaRef(uk.co.caprica.vlcj.binding.internal.libvlc_instance_t libvlcInstance, MediaRef mediaRef, String... options)
      Create a new MediaRef for a MediaRef.

      The caller must release the supplied MediaRef when it has no further use for it.

      The caller must release the returned MediaRef when it has no further use for it.

      Parameters:
      libvlcInstance - native library instance
      mediaRef - media reference
      options - options to add to the media
      Returns:
      media reference
    • duplicateMediaRef

      public static MediaRef duplicateMediaRef(uk.co.caprica.vlcj.binding.internal.libvlc_instance_t libvlcInstance, MediaRef mediaRef, String... options)
      Create a duplicate MediaRef for a MediaRef.

      Unlike the "newMediaRef" functions, this function will duplicate the native media instance, meaning it is separate from the native media instance in this component and any changes made to it (such as adding new media options) will not be reflected on the original media.

      The caller must release the supplied MediaRef when it has no further use for it.

      The caller must release the returned MediaRef when it has no further use for it.

      Parameters:
      libvlcInstance - native library instance
      mediaRef - media reference
      options - options to add to the media
      Returns:
      duplicated media reference
    • newMedia

      public static Media newMedia(uk.co.caprica.vlcj.binding.internal.libvlc_instance_t libvlcInstance, uk.co.caprica.vlcj.binding.internal.libvlc_media_t mediaInstance, String... options)
      Create a new Media component for a native media instance.

      The caller must release the returned Media when it has no further use for it.

      Parameters:
      libvlcInstance - native library instance
      mediaInstance - native media instance
      options - options to add to the media
      Returns:
      media
    • newMedia

      public static Media newMedia(uk.co.caprica.vlcj.binding.internal.libvlc_instance_t libvlcInstance, String mrl, String... options)
      Create a new Media component for a media resource locator.

      The caller must release the returned Media when it has no further use for it.

      Parameters:
      libvlcInstance - native library instance
      mrl - media resource locator
      options - options to add to the media
      Returns:
      media
    • newMedia

      public static Media newMedia(uk.co.caprica.vlcj.binding.internal.libvlc_instance_t libvlcInstance, CallbackMedia callbackMedia, String... options)
      Create a new Media component for callback media.

      The caller must release the returned Media when it has no further use for it.

      Parameters:
      libvlcInstance - native library instance
      callbackMedia - callback media component
      options - options to add to the media
      Returns:
      media
    • newMedia

      public static Media newMedia(uk.co.caprica.vlcj.binding.internal.libvlc_instance_t libvlcInstance, MediaRef mediaRef, String... options)
      Create a new Media component for a MediaRef.

      The caller must release the supplied MediaRef when it has no further use for it.

      The caller must release the returned Media when it has no further use for it.

      Parameters:
      libvlcInstance - native library instance
      mediaRef - media reference
      options - options to add to the media
      Returns:
      media
    • newMedia

      public static Media newMedia(uk.co.caprica.vlcj.binding.internal.libvlc_instance_t libvlcInstance, Media media, String... options)
      Create a new Media component for a Media.

      The caller must release the supplied Media when it has no further use for it.

      The caller must release the returned Media when it has no further use for it.

      Parameters:
      libvlcInstance - native library instance
      media - media
      options - options to add to the media
      Returns:
      media
    • duplicateMedia

      public static Media duplicateMedia(uk.co.caprica.vlcj.binding.internal.libvlc_instance_t libvlcInstance, Media media, String... options)
      Create a duplicate Media for a Media.

      Unlike the "newMedia" functions, this function will duplicate the native media instance, meaning it is separate from the native media instance in this component and any changes made to it (such as adding new media options) will not be reflected on the original media.

      The caller must release the supplied Media when it has no further use for it.

      The caller must release the returned Media when it has no further use for it.

      Parameters:
      libvlcInstance - native library instance
      media - media
      options - options to add to the media
      Returns:
      duplicated media