Class MediaRef

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

public final class MediaRef extends Object
An opaque reference to media.

This is used to pass around media references without requiring the full-blown Media component.

  • Constructor Details

    • MediaRef

      public MediaRef(uk.co.caprica.vlcj.binding.internal.libvlc_instance_t libvlcInstance, uk.co.caprica.vlcj.binding.internal.libvlc_media_t mediaInstance)
      Create a new media reference.
      Parameters:
      libvlcInstance - native library instance
      mediaInstance - native media instance
  • Method Details

    • newMedia

      public Media newMedia()
      Return a new Media component for this MediaRef.

      The returned media component shares the native media instance with any others that may be created subsequently.

      The caller must release the returned media when it is of no further use.

      Returns:
      media
    • newMediaRef

      public MediaRef newMediaRef()
      Return a new MediaRef for this MediaRef.

      The returned media reference shares the native media instance with any others that may be created subsequently.

      The caller must release the returned media reference when it is of no further use.

      Returns:
      media reference
    • duplicateMedia

      public Media duplicateMedia()
      Return a duplicate Media component for this MediaRef.

      Unlike newMedia(), 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 returned media when it is of no further use.

      Returns:
      duplicated media
    • duplicateMediaRef

      public MediaRef duplicateMediaRef()
      Return a duplicate MediaRef for this MediaRef.

      Unlike newMediaRef(), 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 returned Media when it has no further use for it.

      Returns:
      duplicated media reference
    • release

      public void release()
      Release this component and the associated native resources.

      The component must no longer be used.

    • mediaInstance

      public uk.co.caprica.vlcj.binding.internal.libvlc_media_t mediaInstance()
      Get the native media instance.
      Returns:
      media instance