Class MediaList

    • Constructor Detail

      • MediaList

        public MediaList​(ILibVLC ILibVLC)
        Create a MediaList from libVLC
        Parameters:
        ILibVLC - a valid libVLC
      • MediaList

        protected MediaList​(MediaDiscoverer md)
        Parameters:
        md - Should not be released
      • MediaList

        protected MediaList​(IMedia m)
        Parameters:
        m - Should not be released
    • Method Detail

      • onEventNative

        protected IMediaList.Event onEventNative​(int eventType,
                                                 long arg1,
                                                 long arg2,
                                                 float argf1,
                                                 @Nullable
                                                 String args1)
        Called when libvlc send events.
        Parameters:
        eventType - event type
        arg1 - first argument
        arg2 - second argument
        argf1 - first float argument
        Returns:
        Event that will be dispatched to listeners
      • getCount

        public int getCount()
        Get the number of Media.
        Specified by:
        getCount in interface IMediaList
      • getMediaAt

        public IMedia getMediaAt​(int index)
        Get a Media at specified index.
        Specified by:
        getMediaAt in interface IMediaList
        Parameters:
        index - index of the media
        Returns:
        Media hold by MediaList. This Media should be released with IVLCObject.release().
      • onReleaseNative

        public void onReleaseNative()
        Called when native object is released (refcount is 0). This is where you must release native resources.
      • retain

        public final boolean retain()
        Increment internal ref count of the native object.
        Specified by:
        retain in interface IVLCObject<T extends AbstractVLCEvent>
        Returns:
        true if media is retained
      • release

        public final void release()
        Release the native object if ref count is 1. After this call, native calls are not possible anymore. You can still call others methods to retrieve cached values. For example: if you parse, then release a media, you'll still be able to retrieve all Metas or Tracks infos.
        Specified by:
        release in interface IVLCObject<T extends AbstractVLCEvent>
      • finalize

        protected void finalize()
        Overrides:
        finalize in class Object
      • setEventListener

        protected void setEventListener​(AbstractVLCEvent.Listener<T> listener,
                                        Handler handler)
        Set an event listener and an executor Handler
        Parameters:
        listener - see AbstractVLCEvent.Listener
        handler - Handler in which events are sent. If null, a handler will be created running on the main thread
      • getInstance

        public long getInstance()