Interface LibVlc

  • All Superinterfaces:
    com.sun.jna.Library

    public interface LibVlc
    extends com.sun.jna.Library
    JNA interface to the libvlc native library.

    This is not a complete interface to libvlc, although most functions are present.

    This interface specifies the exposed methods only, the types and structures are all factored out separately in the "internal" sub-package.

    This code and that in the internal sub-package is structured out of necessity to interoperate with the libvlc native library. This code was originally derived (but has now been completely re-written) from the original JVLC source code, the copyright of which belongs to the VideoLAN team, which was distributed under GPL version 2 or later.

    This binding is for version 1.1 and later of vlc. Earlier versions of vlc are radically different and will not work with these bindings.

    Some functions are only available after version 1.1.0 of libvlc.

    Some functions are only available after version 2.0.0 of libvlc.

    Some functions are only available after version 2.1.0 of libvlc.

    Some functions are only available after version 2.2.0 of libvlc.

    Some functions are only available after version 3.0.0 of libvlc.

    This system property may be useful for debugging:

     -Djna.dump_memory=true
     
    In the native header file, generally "char*" types must be freed, but "const char*" need (must) not.

    This interface is essentially a translation of the LibVLC header files to Java, with changes for JNA/Java types. The documentation in that VLC header file is reproduced here for convenience, with the appropriate Javadoc documentation convention changes, the copyright of which (mostly) belongs to the VLC authors.

    • Method Detail

      • libvlc_errmsg

        String libvlc_errmsg()
        A human-readable error message for the last LibVLC error in the calling thread. The resulting string is valid until another error occurs (at least until the next LibVLC call).

        This will be NULL if there was no error.

        Returns:
        error message, or NULL
      • libvlc_clearerr

        void libvlc_clearerr()
        Clears the LibVLC error status for the current thread. This is optional. By default, the error status is automatically overridden when a new error occurs, and destroyed when the thread exits.
      • libvlc_new

        libvlc_instance_t libvlc_new​(int argc,
                                     String[] argv)
        Create and initialize a libvlc instance.
        Parameters:
        argc - the number of arguments
        argv - command-line-type arguments
        Returns:
        the libvlc instance or NULL in case of error
      • libvlc_new_with_builtins

        libvlc_instance_t libvlc_new_with_builtins​(int argc,
                                                   String[] argv,
                                                   com.sun.jna.Pointer[] builtins)
        Create and initialize a libvlc instance.
        Parameters:
        argc - the number of arguments
        argv - command-line-type arguments
        builtins - a NULL terminated array of @see vlc_plugin.
        Returns:
        the libvlc instance or NULL in case of error
         {
             vlc_declare_plugin(mp4);
             vlc_declare_plugin(dummy);
             const void **builtins = { vlc_plugin(mp4), vlc_plugin(dummy), NULL };
             libvlc_instance_t *vlc = libvlc_new_with_builtins(argc, argv, builtins);
         }
         
      • libvlc_release

        void libvlc_release​(libvlc_instance_t p_instance)
        Decrement the reference count of a libvlc instance, and destroy it if it reaches zero.
        Parameters:
        p_instance - the instance to destroy
      • libvlc_retain

        void libvlc_retain​(libvlc_instance_t p_instance)
        Increments the reference count of a libvlc instance. The initial reference count is 1 after libvlc_new() returns.
        Parameters:
        p_instance - the instance to reference
      • libvlc_add_intf

        int libvlc_add_intf​(libvlc_instance_t p_instance,
                            String name)
        Try to start a user interface for the libvlc instance.
        Parameters:
        p_instance - the instance
        name - interface name, or NULL for default
        Returns:
        0 on success, -1 on error.
      • libvlc_wait

        void libvlc_wait​(libvlc_instance_t p_instance)
        Waits until an interface causes the instance to exit. You should start at least one interface first, using libvlc_add_intf().
        Parameters:
        p_instance - the instance
      • libvlc_set_user_agent

        void libvlc_set_user_agent​(libvlc_instance_t p_instance,
                                   String name,
                                   String http)
        Sets the application name. LibVLC passes this as the user agent string when a protocol requires it.
        Parameters:
        p_instance - LibVLC instance
        name - human-readable application name, e.g. "FooBar player 1.2.3"
        http - HTTP User Agent, e.g. "FooBar/1.2.3 Python/2.6.0"
        Since:
        LibVLC 1.1.1
      • libvlc_set_app_id

        void libvlc_set_app_id​(libvlc_instance_t p_instance,
                               String id,
                               String version,
                               String icon)
        Sets some meta-informations about the application.

        See also libvlc_set_user_agent(libvlc_instance_t, String, String).

        Parameters:
        p_instance - LibVLC instance
        id - Java-style application identifier, e.g. "com.acme.foobar"
        version - application version numbers, e.g. "1.2.3"
        icon - application icon name, e.g. "foobar"
        Since:
        LibVLC 2.1.0
      • libvlc_get_version

        String libvlc_get_version()
        Retrieve libvlc version. Example: "1.1.0-git The Luggage"
        Returns:
        a string containing the libvlc version
      • libvlc_get_compiler

        String libvlc_get_compiler()
        Retrieve libvlc compiler version. Example: "gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu6)"
        Returns:
        a string containing the libvlc compiler version
      • libvlc_get_changeset

        String libvlc_get_changeset()
        Retrieve libvlc changeset. Example: "aa9bce0bc4"
        Returns:
        a string containing the libvlc changeset
      • libvlc_free

        void libvlc_free​(com.sun.jna.Pointer ptr)
        Frees an heap allocation returned by a LibVLC function. If you know you're using the same underlying C run-time as the LibVLC implementation, then you can call ANSI C free() directly instead.
        Parameters:
        ptr - the pointer
      • libvlc_event_attach

        int libvlc_event_attach​(libvlc_event_manager_t p_event_manager,
                                int i_event_type,
                                libvlc_callback_t f_callback,
                                com.sun.jna.Pointer user_data)
        Register for an event notification.
        Parameters:
        p_event_manager - the event manager to which you want to attach to. Generally it is obtained by vlc_my_object_event_manager() where my_object is the object you want to listen to.
        i_event_type - the desired event to which we want to listen
        f_callback - the function to call when i_event_type occurs
        user_data - user provided data to carry with the event
        Returns:
        0 on success, ENOMEM on error
      • libvlc_event_detach

        void libvlc_event_detach​(libvlc_event_manager_t p_event_manager,
                                 int i_event_type,
                                 libvlc_callback_t f_callback,
                                 com.sun.jna.Pointer p_user_data)
        Unregister an event notification.
        Parameters:
        p_event_manager - the event manager
        i_event_type - the desired event to which we want to unregister
        f_callback - the function to call when i_event_type occurs
        p_user_data - user provided data to carry with the event
      • libvlc_log_get_context

        void libvlc_log_get_context​(libvlc_log_t ctx,
                                    com.sun.jna.ptr.PointerByReference module,
                                    com.sun.jna.ptr.PointerByReference file,
                                    com.sun.jna.ptr.IntByReference line)
        Gets debugging informations about a log message: the name of the VLC module emitting the message and the message location within the source code.

        The returned module name and file name will be NULL if unknown.

        The returned line number will similarly be zero if unknown.

        The returned module name and source code file name, if non-NULL, are only valid until the logging callback returns.*

        Parameters:
        ctx - message context (as passed to the libvlc_log_cb)
        module - module name storage (or NULL) [OUT]
        file - source code file name storage (or NULL) [OUT]
        line - source code file line number storage (or NULL) [OUT]
        Since:
        LibVLC 2.1.0 or later
      • libvlc_log_get_object

        void libvlc_log_get_object​(libvlc_log_t ctx,
                                   com.sun.jna.ptr.PointerByReference name,
                                   com.sun.jna.ptr.PointerByReference header,
                                   com.sun.jna.ptr.IntByReference id)
        Gets VLC object informations about a log message: the type name of the VLC object emitting the message, the object header if any and a temporaly-unique object identifier. These informations are mainly meant for manual troubleshooting.

        The returned type name may be "generic" if unknown, but it cannot be NULL.

        The returned header will be NULL if unset; in current versions, the header is used to distinguish for VLM inputs.

        The returned object ID will be zero if the message is not associated with any VLC object.

        The returned module name and source code file name, if non-NULL, are only valid until the logging callback returns.

        Parameters:
        ctx - message context (as passed to the libvlc_log_cb)
        name - object name storage (or NULL) [OUT]
        header - object header (or NULL) [OUT]
        id - source code file line number storage (or NULL) [OUT]
        Since:
        LibVLC 2.1.0 or later
      • libvlc_log_unset

        void libvlc_log_unset​(libvlc_instance_t p_instance)
        Unsets the logging callback for a LibVLC instance. This is rarely needed: the callback is implicitly unset when the instance is destroyed.

        This function will wait for any pending callbacks invocation to complete (causing a deadlock if called from within the callback).

        Parameters:
        p_instance - the instance
        Since:
        LibVLC 2.1.0 or later
      • libvlc_log_set

        void libvlc_log_set​(libvlc_instance_t p_instance,
                            libvlc_log_cb cb,
                            com.sun.jna.Pointer data)
        Sets the logging callback for a LibVLC instance.

        This function is thread-safe: it will wait for any pending callbacks invocation to complete.

        Some log messages (especially debug) are emitted by LibVLC while is being initialized. These messages cannot be captured with this interface.

        A deadlock may occur if this function is called from the callback.

        Parameters:
        p_instance - the instance
        cb - callback function pointer
        data - opaque data pointer for the callback function
        Since:
        LibVLC 2.1.0 or later
      • libvlc_module_description_list_release

        void libvlc_module_description_list_release​(com.sun.jna.Pointer p_list)
        Release a list of module descriptions.
        Parameters:
        p_list - the list to be released
      • libvlc_clock

        long libvlc_clock()
        Return the current time as defined by LibVLC. The unit is the microsecond. Time increases monotonically (regardless of time zone changes and RTC adjustments). The origin is arbitrary but consistent across the whole system (e.g. the system uptime, the time since the system was booted). \note On systems that support it, the POSIX monotonic clock is used.
        Returns:
        clock value
      • libvlc_media_new_callbacks

        libvlc_media_t libvlc_media_new_callbacks​(libvlc_instance_t instance,
                                                  libvlc_media_open_cb open_cb,
                                                  libvlc_media_read_cb read_cb,
                                                  libvlc_media_seek_cb seek_cb,
                                                  libvlc_media_close_cb close_cb,
                                                  com.sun.jna.Pointer opaque)
        Create a media with custom callbacks to read the data from.

        If open_cb is NULL, the opaque pointer will be passed to read_cb, seek_cb and close_cb, and the stream size will be treated as unknown.

        The callbacks may be called asynchronously (from another thread). A single stream instance need not be reentrant. However the open_cb needs to be reentrant if the media is used by multiple player instances.

        The callbacks may be used until all or any player instances that were supplied the media item are stopped.

        Parameters:
        instance - LibVLC instance
        open_cb - callback to open the custom bitstream input media
        read_cb - callback to read data (must not be NULL)
        seek_cb - callback to seek, or NULL if seeking is not supported
        close_cb - callback to close the media, or NULL if unnecessary
        opaque - data pointer for the open callback
        Returns:
        the newly created media or NULL on error
        Since:
        LibVLC 3.0.0 and later.
        See Also:
        libvlc_media_release(libvlc_media_t)
      • libvlc_media_add_option

        void libvlc_media_add_option​(libvlc_media_t p_md,
                                     String ppsz_options)
        Add an option to the media. This option will be used to determine how the media_player will read the media. This allows to use VLC's advanced reading/streaming options on a per-media basis. The options are detailed in vlc --long-help, for instance "--sout-all"
        Parameters:
        p_md - the media descriptor
        ppsz_options - the options (as a string)
      • libvlc_media_add_option_flag

        void libvlc_media_add_option_flag​(libvlc_media_t p_md,
                                          String ppsz_options,
                                          int i_flags)
        Add an option to the media with configurable flags. This option will be used to determine how the media_player will read the media. This allows to use VLC's advanced reading/streaming options on a per-media basis. The options are detailed in vlc --long-help, for instance "--sout-all"
        Parameters:
        p_md - the media descriptor
        ppsz_options - the options (as a string)
        i_flags - the flags for this option
      • libvlc_media_retain

        void libvlc_media_retain​(libvlc_media_t p_md)
        Retain a reference to a media descriptor object (libvlc_media_t). Use libvlc_media_release() to decrement the reference count of a media descriptor object.
        Parameters:
        p_md - the media descriptor
      • libvlc_media_release

        void libvlc_media_release​(libvlc_media_t p_md)
        Decrement the reference count of a media descriptor object. If the reference count is 0, then libvlc_media_release() will release the media descriptor object. It will send out an libvlc_MediaFreed event to all listeners. If the media descriptor object has been released it should not be used again.
        Parameters:
        p_md - the media descriptor
      • libvlc_media_get_mrl

        com.sun.jna.Pointer libvlc_media_get_mrl​(libvlc_media_t p_md)
        Get the media resource locator (mrl) from a media descriptor object
        Parameters:
        p_md - a media descriptor object
        Returns:
        string with mrl of media descriptor object
      • libvlc_media_duplicate

        libvlc_media_t libvlc_media_duplicate​(libvlc_media_t p_md)
        Duplicate a media descriptor object.
        Parameters:
        p_md - a media descriptor object.
        Returns:
        duplicated media descriptor
      • libvlc_media_set_meta

        void libvlc_media_set_meta​(libvlc_media_t p_md,
                                   int e_meta,
                                   String psz_value)
        Set the meta of the media (this function will not save the meta, call libvlc_media_save_meta in order to save the meta)
        Parameters:
        p_md - the media descriptor
        e_meta - the meta to write
        psz_value - the media's meta
      • libvlc_media_save_meta

        int libvlc_media_save_meta​(libvlc_media_t p_md)
        Save the meta previously set
        Parameters:
        p_md - the media desriptor
        Returns:
        true if the write operation was successfull
      • libvlc_media_get_state

        int libvlc_media_get_state​(libvlc_media_t p_meta_desc)
        Get current state of media descriptor object. Possible media states are defined in libvlc_structures.c (libvlc_NothingSpecial=0, libvlc_Opening, libvlc_Buffering, libvlc_Playing, libvlc_Paused, libvlc_Stopped, libvlc_Ended, libvlc_Error).
        Parameters:
        p_meta_desc - a media descriptor object
        Returns:
        state of media descriptor object
      • libvlc_media_get_stats

        int libvlc_media_get_stats​(libvlc_media_t p_md,
                                   libvlc_media_stats_t p_stats)
        get the current statistics about the media
        Parameters:
        p_md - media descriptor object
        p_stats - structure that contain the statistics about the media (this structure must be allocated by the caller)
        Returns:
        true if the statistics are available, false otherwise
      • libvlc_media_subitems

        libvlc_media_list_t libvlc_media_subitems​(libvlc_media_t p_md)
        Get subitems of media descriptor object. This will increment the reference count of supplied media descriptor object. Use libvlc_media_list_release() to decrement the reference counting.
        Parameters:
        p_md - media descriptor object
        Returns:
        list of media descriptor subitems or NULL This method uses libvlc_media_list_t, however, media_list usage is optional and this is here for convenience
      • libvlc_media_event_manager

        libvlc_event_manager_t libvlc_media_event_manager​(libvlc_media_t p_md)
        Get event manager from media descriptor object. NOTE: this function doesn't increment reference counting.
        Parameters:
        p_md - a media descriptor object
        Returns:
        event manager object
      • libvlc_media_get_duration

        long libvlc_media_get_duration​(libvlc_media_t p_md)
        Get duration (in ms) of media descriptor object item.
        Parameters:
        p_md - media descriptor object
        Returns:
        duration of media item or -1 on error
      • libvlc_media_parse_with_options

        int libvlc_media_parse_with_options​(libvlc_media_t p_md,
                                            int parse_flag,
                                            int timeout)
        Parse the media asynchronously with options. This fetches (local or network) art, meta data and/or tracks information. This method is the extended version of libvlc_media_parse_with_options(). To track when this is over you can listen to libvlc_MediaParsedChanged event. However if this functions returns an error, you will not receive any events. It uses a flag to specify parse options. All these flags can be combined. By default, media is parsed if it's a local file. Parsing can be aborted with libvlc_media_parse_stop().
        Parameters:
        p_md - media descriptor object
        parse_flag - parse options
        timeout - maximum time allowed to preparse the media. If -1, the default "preparse-timeout" option will be used as a timeout. If 0, it will wait indefinitely. If > 0, the timeout will be used (in milliseconds).
        Returns:
        -1 in case of error, 0 otherwise
        Since:
        LibVLC 3.0.0 or later
        See Also:
        libvlc_event_e.libvlc_MediaParsedChanged, libvlc_media_get_meta(libvlc_media_t, int), libvlc_media_tracks_get(libvlc_media_t, PointerByReference)
      • libvlc_media_parse_stop

        void libvlc_media_parse_stop​(libvlc_media_t p_md)
        Stop the parsing of the media When the media parsing is stopped, the libvlc_MediaParsedChanged event will be sent with the libvlc_media_parsed_status_timeout status.
        Parameters:
        p_md - media descriptor object
        See Also:
        libvlc_media_parse_with_options(libvlc_media_t, int, int)
      • libvlc_media_get_parsed_status

        int libvlc_media_get_parsed_status​(libvlc_media_t p_md)
        Get Parsed status for media descriptor object.
        Parameters:
        p_md - media descriptor object
        Returns:
        a value of the libvlc_media_parsed_status_t enum
        Since:
        LibVLC 3.0.0 or later
      • libvlc_media_set_user_data

        void libvlc_media_set_user_data​(libvlc_media_t p_md,
                                        com.sun.jna.Pointer p_new_user_data)
        Sets media descriptor's user_data. user_data is specialized data accessed by the host application, VLC.framework uses it as a pointer to an native object that references a libvlc_media_t pointer
        Parameters:
        p_md - media descriptor object
        p_new_user_data - pointer to user data
      • libvlc_media_get_user_data

        com.sun.jna.Pointer libvlc_media_get_user_data​(libvlc_media_t p_md)
        Get media descriptor's user_data. user_data is specialized data accessed by the host application, VLC.framework uses it as a pointer to an native object that references a libvlc_media_t pointer
        Parameters:
        p_md - media descriptor object
        Returns:
        user-data pointer
      • libvlc_media_tracks_get

        int libvlc_media_tracks_get​(libvlc_media_t p_md,
                                    com.sun.jna.ptr.PointerByReference tracks)
        Get media descriptor's elementary streams description

        Note, you need to parse or play the media at least once before calling this function.

        Not doing this will result in an empty array.

        Parameters:
        p_md - media descriptor object
        tracks - address to store an allocated array of Elementary Streams descriptions (must be freed with libvlc_media_tracks_release by the caller) [OUT]
        Returns:
        the number of Elementary Streams (zero on error)
        Since:
        LibVLC 2.1.0 and later.
      • libvlc_media_tracks_release

        void libvlc_media_tracks_release​(com.sun.jna.Pointer p_tracks,
                                         int i_count)
        Release media descriptor's elementary streams description array
        Parameters:
        p_tracks - tracks info array to release
        i_count - number of elements in the array
        Since:
        LibVLC 2.1.0 and later.
      • libvlc_media_get_type

        int libvlc_media_get_type​(libvlc_media_t p_md)
        Get the media type of the media descriptor object.
        Parameters:
        p_md - media descriptor object
        Returns:
        media type
        Since:
        LibVLC 3.0.0 and later.
      • libvlc_media_thumbnail_request_by_time

        libvlc_media_thumbnail_request_t libvlc_media_thumbnail_request_by_time​(libvlc_media_t md,
                                                                                long time,
                                                                                int speed,
                                                                                int width,
                                                                                int height,
                                                                                int picture_type,
                                                                                long timeout)
        Start an asynchronous thumbnail generation If the request is successfuly queued, the libvlc_MediaThumbnailGenerated is guaranteed to be emited.
        Parameters:
        md - media descriptor object
        time - The time at which the thumbnail should be generated
        speed - The seeking speed \sa{libvlc_thumbnailer_seek_speed_t}
        width - The thumbnail width
        height - the thumbnail height
        picture_type - The thumbnail picture type \sa{libvlc_picture_type_t}
        timeout - A timeout value in ms, or 0 to disable timeout
        Returns:
        A valid opaque request object, or NULL in case of failure.
        Since:
        libvlc 4.0 or later
        See Also:
        libvlc_picture_t
      • libvlc_media_thumbnail_request_by_pos

        libvlc_media_thumbnail_request_t libvlc_media_thumbnail_request_by_pos​(libvlc_media_t md,
                                                                               float pos,
                                                                               int speed,
                                                                               int width,
                                                                               int height,
                                                                               int picture_type,
                                                                               long timeout)
        Start an asynchronous thumbnail generation If the request is successfuly queued, the libvlc_MediaThumbnailGenerated is guaranteed to be emited.
        Parameters:
        md - media descriptor object
        pos - The position at which the thumbnail should be generated
        speed - The seeking speed \sa{libvlc_thumbnailer_seek_speed_t}
        width - The thumbnail width
        height - the thumbnail height
        picture_type - The thumbnail picture type \sa{libvlc_picture_type_t}
        timeout - A timeout value in ms, or 0 to disable timeout
        Returns:
        A valid opaque request object, or NULL in case of failure.
        Since:
        libvlc 4.0 or later
        See Also:
        libvlc_picture_t
      • libvlc_media_thumbnail_cancel

        void libvlc_media_thumbnail_cancel​(libvlc_media_thumbnail_request_t p_req)
        Parameters:
        p_req - An opaque thumbnail request object. Cancelling the request will still cause libvlc_MediaThumbnailGenerated event to be emited, with a NULL libvlc_picture_t If the request is cancelled after its completion, the behavior is undefined.
      • libvlc_media_get_codec_description

        String libvlc_media_get_codec_description​(int i_type,
                                                  int i_codec)
        Get codec description from media elementary stream.
        Parameters:
        i_type - i_type from libvlc_media_track_t
        i_codec - i_codec or i_original_fourcc from libvlc_media_track_t
        Returns:
        codec description
        Since:
        LibVLC 3.0.0 and later.
      • libvlc_media_slaves_add

        int libvlc_media_slaves_add​(libvlc_media_t p_md,
                                    int i_type,
                                    int i_priority,
                                    String psz_uri)
        Add a slave to the current media. A slave is an external input source that may contains an additional subtitle track (like a .srt) or an additional audio track (like a .ac3). \note This function must be called before the media is parsed (via libvlc_media_parse_with_options()) or before the media is played (via libvlc_media_player_play())
        Parameters:
        p_md - media descriptor object
        i_type - subtitle or audio
        i_priority - from 0 (low priority) to 4 (high priority)
        psz_uri - Uri of the slave (should contain a valid scheme).
        Returns:
        0 on success, -1 on error.
        Since:
        LibVLC 3.0.0 and later.
      • libvlc_media_slaves_clear

        void libvlc_media_slaves_clear​(libvlc_media_t p_md)
        Clear all slaves previously added by libvlc_media_slaves_add() or internally.
        Parameters:
        p_md - media descriptor object
        Since:
        LibVLC 3.0.0 and later.
      • libvlc_media_slaves_get

        int libvlc_media_slaves_get​(libvlc_media_t p_md,
                                    com.sun.jna.ptr.PointerByReference ppp_slaves)
        Get a media descriptor's slave list The list will contain slaves parsed by VLC or previously added by libvlc_media_slaves_add(). The typical use case of this function is to save a list of slave in a database for a later use.
        Parameters:
        p_md - media descriptor object
        ppp_slaves - address to store an allocated array of slaves (must be freed with libvlc_media_slaves_release()) [OUT]
        Returns:
        the number of slaves (zero on error)
        Since:
        LibVLC 3.0.0 and later.
      • libvlc_media_slaves_release

        void libvlc_media_slaves_release​(com.sun.jna.Pointer pp_slaves,
                                         int i_count)
        Release a media descriptor's slave list
        Parameters:
        pp_slaves - slave array to release
        i_count - number of elements in the array
        Since:
        LibVLC 3.0.0 and later.
      • libvlc_media_player_new

        libvlc_media_player_t libvlc_media_player_new​(libvlc_instance_t p_libvlc_instance)
        Create an empty Media Player object
        Parameters:
        p_libvlc_instance - the libvlc instance in which the Media Player should be created.
        Returns:
        a new media player object, or NULL on error.
      • libvlc_media_player_new_from_media

        libvlc_media_player_t libvlc_media_player_new_from_media​(libvlc_media_t p_md)
        Create a Media Player object from a Media
        Parameters:
        p_md - the media. Afterwards the p_md can be safely destroyed.
        Returns:
        a new media player object, or NULL on error.
      • libvlc_media_player_release

        void libvlc_media_player_release​(libvlc_media_player_t p_mi)
        Release a media_player after use Decrement the reference count of a media player object. If the reference count is 0, then libvlc_media_player_release() will release the media player object. If the media player object has been released, then it should not be used again.
        Parameters:
        p_mi - the Media Player to free
      • libvlc_media_player_retain

        void libvlc_media_player_retain​(libvlc_media_player_t p_mi)
        Retain a reference to a media player object. Use libvlc_media_player_release() to decrement reference count.
        Parameters:
        p_mi - media player object
      • libvlc_media_player_set_media

        void libvlc_media_player_set_media​(libvlc_media_player_t p_mi,
                                           libvlc_media_t p_md)
        Set the media that will be used by the media_player. If any, previous md will be released.
        Parameters:
        p_mi - the Media Player
        p_md - the Media. Afterwards the p_md can be safely destroyed.
      • libvlc_media_player_get_media

        libvlc_media_t libvlc_media_player_get_media​(libvlc_media_player_t p_mi)
        Get the media used by the media_player.

        You do not need to invoke libvlc_media_player_release().

        Parameters:
        p_mi - the Media Player
        Returns:
        the media associated with p_mi, or NULL if no media is associated
      • libvlc_media_player_event_manager

        libvlc_event_manager_t libvlc_media_player_event_manager​(libvlc_media_player_t p_mi)
        Get the Event Manager from which the media player send event.
        Parameters:
        p_mi - the Media Player
        Returns:
        the event manager associated with p_mi
      • libvlc_media_player_is_playing

        int libvlc_media_player_is_playing​(libvlc_media_player_t p_mi)
        is_playing
        Parameters:
        p_mi - the Media Player
        Returns:
        1 if the media player is playing, 0 otherwise
      • libvlc_media_player_play

        int libvlc_media_player_play​(libvlc_media_player_t p_mi)
        Play
        Parameters:
        p_mi - the Media Player
        Returns:
        0 if playback started (and was already started), or -1 on error.
      • libvlc_media_player_set_pause

        void libvlc_media_player_set_pause​(libvlc_media_player_t mp,
                                           int do_pause)
        Pause or resume (no effect if there is no media)
        Parameters:
        mp - the Media Player
        do_pause - play/resume if zero, pause if non-zero
        Since:
        LibVLC 1.1.1
      • libvlc_media_player_pause

        void libvlc_media_player_pause​(libvlc_media_player_t p_mi)
        Toggle pause (no effect if there is no media)
        Parameters:
        p_mi - the Media Player
      • libvlc_media_player_stop

        void libvlc_media_player_stop​(libvlc_media_player_t p_mi)
        Stop (no effect if there is no media)
        Parameters:
        p_mi - the Media Player
      • libvlc_video_set_callbacks

        void libvlc_video_set_callbacks​(libvlc_media_player_t mp,
                                        libvlc_lock_callback_t lock,
                                        libvlc_unlock_callback_t unlock,
                                        libvlc_display_callback_t display,
                                        com.sun.jna.Pointer opaque)
        Set callbacks and private data to render decoded video to a custom area in memory.

        Use libvlc_video_set_format() or libvlc_video_set_format_callbacks() to configure the decoded format.

        Parameters:
        mp - the media player
        lock - callback to allocate video memory
        unlock - callback to release video memory
        display - callback when ready to display a video frame
        opaque - private pointer for the three callbacks (as first parameter)
        Since:
        LibVLC 1.1.1
      • libvlc_video_set_format

        void libvlc_video_set_format​(libvlc_media_player_t mp,
                                     String chroma,
                                     int width,
                                     int height,
                                     int pitch)
        Set decoded video chroma and dimensions.

        This only works in combination with libvlc_video_set_callbacks(), and is mutually exclusive with libvlc_video_set_format_callbacks().

        Parameters:
        mp - the media player
        chroma - a four-characters string identifying the chroma (e.g. "RV32" or "YUYV")
        width - pixel width
        height - pixel height
        pitch - line pitch (in bytes)
        Since:
        LibVLC 1.1.1 bug: All pixel planes are expected to have the same pitch. To use the YCbCr color space with chrominance subsampling, consider using libvlc_video_set_format_callback() instead.
      • libvlc_video_set_format_callbacks

        void libvlc_video_set_format_callbacks​(libvlc_media_player_t mp,
                                               libvlc_video_format_cb setup,
                                               libvlc_video_cleanup_cb cleanup)
        Set decoded video chroma and dimensions. This only works in combination with libvlc_video_set_callbacks().
        Parameters:
        mp - the media player
        setup - callback to select the video format (cannot be NULL)
        cleanup - callback to release any allocated resources (or NULL)
        Since:
        LibVLC 2.0.0 or later
      • libvlc_media_player_set_nsobject

        void libvlc_media_player_set_nsobject​(libvlc_media_player_t p_mi,
                                              long drawable)
        Set the NSView handler where the media player should render its video output. Use the vout called "macosx". The drawable is an NSObject that follow the VLCOpenGLVideoViewEmbedding protocol:
             \@protocol VLCOpenGLVideoViewEmbedding <NSObject> - (void)addVoutSubview:(NSView*)view; - (void)removeVoutSubview:(NSView *)view; \@end
         
        Or it can be an NSView object. If you want to use it along with Qt4 see the QMacCocoaViewContainer. Then the following code should work:
         {
             NSView *video = [[NSView alloc] init];
             QMacCocoaViewContainer *container = new QMacCocoaViewContainer(video, parent);
             libvlc_media_player_set_nsobject(mp, video);
             [video release];
         }
         
        You can find a live example in VLCVideoView in VLCKit.framework.
        Parameters:
        p_mi - the Media Player
        drawable - the drawable that is either an NSView or an object following the VLCOpenGLVideoViewEmbedding protocol.
      • libvlc_media_player_get_nsobject

        com.sun.jna.Pointer libvlc_media_player_get_nsobject​(libvlc_media_player_t p_mi)
        Get the NSView handler previously set with libvlc_media_player_set_nsobject().
        Parameters:
        p_mi - the Media Player
        Returns:
        the NSView handler or 0 if none where set
      • libvlc_media_player_set_xwindow

        void libvlc_media_player_set_xwindow​(libvlc_media_player_t p_mi,
                                             int drawable)
        Set an X Window System drawable where the media player should render its video output. If LibVLC was built without X11 output support, then this has no effects. The specified identifier must correspond to an existing Input/Output class X11 window. Pixmaps are not supported. The caller shall ensure that the X11 server is the same as the one the VLC instance has been configured with.
        Parameters:
        p_mi - the Media Player
        drawable - the ID of the X window
      • libvlc_media_player_get_xwindow

        int libvlc_media_player_get_xwindow​(libvlc_media_player_t p_mi)
        Get the X Window System window identifier previously set with libvlc_media_player_set_xwindow(). Note that this will return the identifier even if VLC is not currently using it (for instance if it is playing an audio-only input).
        Parameters:
        p_mi - the Media Player
        Returns:
        an X window ID, or 0 if none where set.
      • libvlc_media_player_set_hwnd

        void libvlc_media_player_set_hwnd​(libvlc_media_player_t p_mi,
                                          com.sun.jna.Pointer drawable)
        Set a Win32/Win64 API window handle (HWND) where the media player should render its video output. If LibVLC was built without Win32/Win64 API output support, then this has no effects.
        Parameters:
        p_mi - the Media Player
        drawable - windows handle of the drawable
      • libvlc_media_player_get_hwnd

        com.sun.jna.Pointer libvlc_media_player_get_hwnd​(libvlc_media_player_t p_mi)
        Get the Windows API window handle (HWND) previously set with libvlc_media_player_set_hwnd(). The handle will be returned even if LibVLC is not currently outputting any video to it.
        Parameters:
        p_mi - the Media Player
        Returns:
        a window handle or NULL if there are none.
      • libvlc_audio_set_callbacks

        void libvlc_audio_set_callbacks​(libvlc_media_player_t mp,
                                        libvlc_audio_play_cb play,
                                        libvlc_audio_pause_cb pause,
                                        libvlc_audio_resume_cb resume,
                                        libvlc_audio_flush_cb flush,
                                        libvlc_audio_drain_cb drain,
                                        com.sun.jna.Pointer opaque)
        Set callbacks and private data for decoded audio.

        Use libvlc_audio_set_format() or libvlc_audio_set_format_callbacks() to configure the decoded audio format.

        Parameters:
        mp - the media player
        play - callback to play audio samples (must not be NULL)
        pause - callback to pause playback (or NULL to ignore)
        resume - callback to resume playback (or NULL to ignore)
        flush - callback to flush audio buffers (or NULL to ignore)
        drain - callback to drain audio buffers (or NULL to ignore)
        opaque - private pointer for the audio callbacks (as first parameter)
        Since:
        LibVLC 2.0.0 or later
      • libvlc_audio_set_volume_callback

        void libvlc_audio_set_volume_callback​(libvlc_media_player_t mp,
                                              libvlc_audio_set_volume_cb set_volume)
        Set callbacks and private data for decoded audio. Use libvlc_audio_set_format() or libvlc_audio_set_format_callbacks() to configure the decoded audio format.
        Parameters:
        mp - the media player
        set_volume - callback to apply audio volume, or NULL to apply volume in software
        Since:
        LibVLC 2.0.0 or later
      • libvlc_audio_set_format_callbacks

        void libvlc_audio_set_format_callbacks​(libvlc_media_player_t mp,
                                               libvlc_audio_setup_cb setup,
                                               libvlc_audio_cleanup_cb cleanup)
        Set decoded audio format. This only works in combination with libvlc_audio_set_callbacks().
        Parameters:
        mp - the media player
        setup - callback to select the audio format (cannot be NULL)
        cleanup - callback to release any allocated resources (or NULL)
        Since:
        LibVLC 2.0.0 or later
      • libvlc_audio_set_format

        void libvlc_audio_set_format​(libvlc_media_player_t mp,
                                     String format,
                                     int rate,
                                     int channels)
        Set decoded audio format. This only works in combination with libvlc_audio_set_callbacks(), and is mutually exclusive with libvlc_audio_set_format_callbacks().
        Parameters:
        mp - the media player
        format - a four-characters string identifying the sample format (e.g. "S16N" or "f32l")
        rate - sample rate (expressed in Hz)
        channels - channels count
        Since:
        LibVLC 2.0.0 or later
      • libvlc_media_player_get_length

        long libvlc_media_player_get_length​(libvlc_media_player_t p_mi)
        Get the current movie length (in ms).
        Parameters:
        p_mi - the Media Player
        Returns:
        the movie length (in ms), or -1 if there is no media.
      • libvlc_media_player_get_time

        long libvlc_media_player_get_time​(libvlc_media_player_t p_mi)
        Get the current movie time (in ms).
        Parameters:
        p_mi - the Media Player
        Returns:
        the movie time (in ms), or -1 if there is no media.
      • libvlc_media_player_set_time

        void libvlc_media_player_set_time​(libvlc_media_player_t p_mi,
                                          long i_time)
        Set the movie time (in ms).

        This has no effect if no media is being played.

        Not all formats and protocols support this.

        Parameters:
        p_mi - the Media Player
        i_time - the movie time (in ms).
      • libvlc_media_player_get_position

        float libvlc_media_player_get_position​(libvlc_media_player_t p_mi)
        Get movie position.
        Parameters:
        p_mi - the Media Player
        Returns:
        movie position, or -1. in case of error
      • libvlc_media_player_set_position

        void libvlc_media_player_set_position​(libvlc_media_player_t p_mi,
                                              float f_pos)
        Set movie position as percentage between 0.0 and 1.0.

        This has no effect if playback is not enabled.

        This might not work depending on the underlying input format and protocol.

        Parameters:
        p_mi - the Media Player
        f_pos - the position
      • libvlc_media_player_set_chapter

        void libvlc_media_player_set_chapter​(libvlc_media_player_t p_mi,
                                             int i_chapter)
        Set movie chapter (if applicable).
        Parameters:
        p_mi - the Media Player
        i_chapter - chapter number to play
      • libvlc_media_player_get_chapter

        int libvlc_media_player_get_chapter​(libvlc_media_player_t p_mi)
        Get movie chapter.
        Parameters:
        p_mi - the Media Player
        Returns:
        chapter number currently playing, or -1 if there is no media.
      • libvlc_media_player_get_chapter_count

        int libvlc_media_player_get_chapter_count​(libvlc_media_player_t p_mi)
        Get movie chapter count
        Parameters:
        p_mi - the Media Player
        Returns:
        number of chapters in movie, or -1.
      • libvlc_media_player_will_play

        int libvlc_media_player_will_play​(libvlc_media_player_t p_mi)
        Is the player able to play
        Parameters:
        p_mi - the Media Player
        Returns:
        boolean
      • libvlc_media_player_get_chapter_count_for_title

        int libvlc_media_player_get_chapter_count_for_title​(libvlc_media_player_t p_mi,
                                                            int i_title)
        Get title chapter count
        Parameters:
        p_mi - the Media Player
        i_title - title
        Returns:
        number of chapters in title, or -1
      • libvlc_media_player_set_title

        void libvlc_media_player_set_title​(libvlc_media_player_t p_mi,
                                           int i_title)
        Set movie title
        Parameters:
        p_mi - the Media Player
        i_title - title number to play
      • libvlc_media_player_get_title

        int libvlc_media_player_get_title​(libvlc_media_player_t p_mi)
        Get movie title
        Parameters:
        p_mi - the Media Player
        Returns:
        title number currently playing, or -1
      • libvlc_media_player_get_title_count

        int libvlc_media_player_get_title_count​(libvlc_media_player_t p_mi)
        Get movie title count
        Parameters:
        p_mi - the Media Player
        Returns:
        title number count, or -1
      • libvlc_media_player_previous_chapter

        void libvlc_media_player_previous_chapter​(libvlc_media_player_t p_mi)
        Set previous chapter (if applicable)
        Parameters:
        p_mi - the Media Player
      • libvlc_media_player_next_chapter

        void libvlc_media_player_next_chapter​(libvlc_media_player_t p_mi)
        Set next chapter (if applicable)
        Parameters:
        p_mi - the Media Player
      • libvlc_media_player_get_rate

        float libvlc_media_player_get_rate​(libvlc_media_player_t p_mi)
        Get the requested movie play rate.

        Depending on the underlying media, the requested rate may be different from the real playback rate.

        Parameters:
        p_mi - the Media Player
        Returns:
        movie play rate
      • libvlc_media_player_set_rate

        int libvlc_media_player_set_rate​(libvlc_media_player_t p_mi,
                                         float rate)
        Set movie play rate
        Parameters:
        p_mi - the Media Player
        rate - movie play rate to set
        Returns:
        -1 if an error was detected, 0 otherwise (but even then, it might not actually work depending on the underlying media protocol)
      • libvlc_media_player_get_state

        int libvlc_media_player_get_state​(libvlc_media_player_t p_mi)
        Get current movie state
        Parameters:
        p_mi - the Media Player
        Returns:
        the current state of the media player (playing, paused, ...) @see State
      • libvlc_media_player_has_vout

        int libvlc_media_player_has_vout​(libvlc_media_player_t p_mi)
        How many video outputs does this media player have?
        Parameters:
        p_mi - the media player
        Returns:
        the number of video outputs
      • libvlc_media_player_is_seekable

        int libvlc_media_player_is_seekable​(libvlc_media_player_t p_mi)
        Is this media player seekable?
        Parameters:
        p_mi - the media player
        Returns:
        true if the media player can seek
      • libvlc_media_player_can_pause

        int libvlc_media_player_can_pause​(libvlc_media_player_t p_mi)
        Can this media player be paused?
        Parameters:
        p_mi - the media player
        Returns:
        true if the media player can pause
      • libvlc_media_player_program_scrambled

        int libvlc_media_player_program_scrambled​(libvlc_media_player_t p_mi)
        Is the current program scrambled?
        Parameters:
        p_mi - the media player
        Returns:
        true if the current program is scrambled
        Since:
        libVLC 2.2.0
      • libvlc_media_player_next_frame

        void libvlc_media_player_next_frame​(libvlc_media_player_t p_mi)
        Display the next frame (if supported)
        Parameters:
        p_mi - the media player
      • libvlc_media_player_navigate

        void libvlc_media_player_navigate​(libvlc_media_player_t p_mi,
                                          int navigate)
        Navigate through DVD Menu
        Parameters:
        p_mi - the Media Player
        navigate - the Navigation mode
        Since:
        libVLC 2.0.0
      • libvlc_media_player_set_video_title_display

        void libvlc_media_player_set_video_title_display​(libvlc_media_player_t p_mi,
                                                         int position,
                                                         int timeout)
        Set if, and how, the video title will be shown when media is played.
        Parameters:
        p_mi - the media player
        position - position at which to display the title, or libvlc_position_disable to prevent the title from being displayed
        timeout - title display timeout in milliseconds (ignored if libvlc_position_disable)
        Since:
        libVLC 2.1.0 or later
      • libvlc_media_player_add_slave

        int libvlc_media_player_add_slave​(libvlc_media_player_t p_mi,
                                          int i_type,
                                          String psz_uri,
                                          int b_select)
        Add a slave to the current media player. If the player is playing, the slave will be added directly. This call will also update the slave list of the attached libvlc_media_t.
        Parameters:
        p_mi - the media player
        i_type - subtitle or audio
        psz_uri - Uri of the slave (should contain a valid scheme).
        b_select - True if this slave should be selected when it's loaded
        Returns:
        0 on success, -1 on error.
        Since:
        LibVLC 3.0.0 and later.
        See Also:
        libvlc_media_slaves_add(libvlc_media_t, int, int, String)
      • libvlc_track_description_list_release

        void libvlc_track_description_list_release​(com.sun.jna.Pointer p_track_description)
        Release (free) libvlc_track_description_t
        Parameters:
        p_track_description - the structure to release
      • libvlc_toggle_fullscreen

        void libvlc_toggle_fullscreen​(libvlc_media_player_t p_mi)
        Toggle fullscreen status on non-embedded video outputs.

        The same limitations applies to this function as to libvlc_set_fullscreen().

        Parameters:
        p_mi - the media player
      • libvlc_set_fullscreen

        void libvlc_set_fullscreen​(libvlc_media_player_t p_mi,
                                   int b_fullscreen)
        Enable or disable fullscreen.

        With most window managers, only a top-level windows can be in full-screen mode. Hence, this function will not operate properly if libvlc_media_player_set_xid() was used to embed the video in a non-top-level window. In that case, the embedding window must be reparented to the root window before fullscreen mode is enabled. You will want to reparent it back to its normal parent when disabling fullscreen.

        Parameters:
        p_mi - the media player
        b_fullscreen - boolean for fullscreen status
      • libvlc_get_fullscreen

        int libvlc_get_fullscreen​(libvlc_media_player_t p_mi)
        Get current fullscreen status.
        Parameters:
        p_mi - the media player
        Returns:
        the fullscreen status (boolean)
      • libvlc_video_set_key_input

        void libvlc_video_set_key_input​(libvlc_media_player_t p_mi,
                                        int on)
        Enable or disable key press events handling, according to the LibVLC hotkeys configuration. By default and for historical reasons, keyboard events are handled by the LibVLC video widget.

        On X11, there can be only one subscriber for key press and mouse click events per window. If your application has subscribed to those events for the X window ID of the video widget, then LibVLC will not be able to handle key presses and mouse clicks in any case.

        This function is only implemented for X11 and Win32 at the moment.

        Parameters:
        p_mi - the media player
        on - true to handle key press events, false to ignore them.
      • libvlc_video_set_mouse_input

        void libvlc_video_set_mouse_input​(libvlc_media_player_t p_mi,
                                          int on)
        Enable or disable mouse click events handling. By default, those events are handled. This is needed for DVD menus to work, as well as a few video filters such as "puzzle".

        See also libvlc_video_set_key_input().

        This function is only implemented for X11 and Win32 at the moment.

        Parameters:
        p_mi - the media player
        on - true to handle mouse click events, false to ignore them.
      • libvlc_video_get_size

        int libvlc_video_get_size​(libvlc_media_player_t p_mi,
                                  int num,
                                  com.sun.jna.ptr.IntByReference px,
                                  com.sun.jna.ptr.IntByReference py)
        Get the pixel dimensions of a video.
        Parameters:
        p_mi - media player
        num - number of the video (starting from, and most commonly 0)
        px - pointer to get the pixel width [OUT]
        py - pointer to get the pixel height [OUT]
        Returns:
        0 on success, -1 if the specified video does not exist
      • libvlc_video_get_cursor

        int libvlc_video_get_cursor​(libvlc_media_player_t p_mi,
                                    int num,
                                    com.sun.jna.Pointer px,
                                    com.sun.jna.Pointer py)
        Get the mouse pointer coordinates over a video. Coordinates are expressed in terms of the decoded video resolution, not in terms of pixels on the screen/viewport (to get the latter, you can query your windowing system directly). Either of the coordinates may be negative or larger than the corresponding dimension of the video, if the cursor is outside the rendering area.

        The coordinates may be out-of-date if the pointer is not located on the video rendering area. LibVLC does not track the pointer if it is outside of the video widget.

        LibVLC does not support multiple pointers (it does of course support multiple input devices sharing the same pointer) at the moment.

        Parameters:
        p_mi - media player
        num - number of the video (starting from, and most commonly 0)
        px - pointer to get the abscissa [OUT]
        py - pointer to get the ordinate [OUT]
        Returns:
        0 on success, -1 if the specified video does not exist
      • libvlc_video_get_scale

        float libvlc_video_get_scale​(libvlc_media_player_t p_mi)
        Get the current video scaling factor. See also libvlc_video_set_scale().
        Parameters:
        p_mi - the media player
        Returns:
        the currently configured zoom factor, or 0. if the video is set to fit to the output window/drawable automatically.
      • libvlc_video_set_scale

        void libvlc_video_set_scale​(libvlc_media_player_t p_mi,
                                    float f_factor)
        Set the video scaling factor. That is the ratio of the number of pixels on screen to the number of pixels in the original decoded video in each dimension. Zero is a special value; it will adjust the video to the output window/drawable (in windowed mode) or the entire screen. Note that not all video outputs support scaling.
        Parameters:
        p_mi - the media player
        f_factor - the scaling factor, or zero
      • libvlc_video_get_aspect_ratio

        com.sun.jna.Pointer libvlc_video_get_aspect_ratio​(libvlc_media_player_t p_mi)
        Get current video aspect ratio.
        Parameters:
        p_mi - the media player
        Returns:
        the video aspect ratio or NULL if unspecified (the result must be released with free()).
      • libvlc_video_set_aspect_ratio

        void libvlc_video_set_aspect_ratio​(libvlc_media_player_t p_mi,
                                           String psz_aspect)
        Set new video aspect ratio. Note: invalid aspect ratios are ignored.
        Parameters:
        p_mi - the media player
        psz_aspect - new video aspect-ratio or NULL to reset to default
      • libvlc_video_new_viewpoint

        libvlc_video_viewpoint_t libvlc_video_new_viewpoint()
        Create a video viewpoint structure.
        Returns:
        video viewpoint or NULL (the result must be released with free() or libvlc_free()).
        Since:
        LibVLC 3.0.0 and later
      • libvlc_video_update_viewpoint

        int libvlc_video_update_viewpoint​(libvlc_media_player_t p_mi,
                                          libvlc_video_viewpoint_t p_viewpoint,
                                          int b_absolute)
        Update the video viewpoint information.

        It is safe to call this function before the media player is started.

        The values are set asynchronously, it will be used by the next frame displayed.

        Parameters:
        p_mi - the media player
        p_viewpoint - video viewpoint allocated via libvlc_video_new_viewpoint()
        b_absolute - if true replace the old viewpoint with the new one. If false, increase/decrease it.
        Returns:
        -1 in case of error, 0 otherwise
        Since:
        LibVLC 3.0.0 and later
      • libvlc_video_get_spu

        int libvlc_video_get_spu​(libvlc_media_player_t p_mi)
        Get current video subtitle.
        Parameters:
        p_mi - the media player
        Returns:
        the video subtitle selected, or -1 if none
      • libvlc_video_get_spu_count

        int libvlc_video_get_spu_count​(libvlc_media_player_t p_mi)
        Get the number of available video subtitles.
        Parameters:
        p_mi - the media player
        Returns:
        the number of available video subtitles
      • libvlc_video_get_spu_description

        libvlc_track_description_t libvlc_video_get_spu_description​(libvlc_media_player_t p_mi)
        Get the description of available video subtitles.
        Parameters:
        p_mi - the media player
        Returns:
        list containing description of available video subtitles
      • libvlc_video_set_spu

        int libvlc_video_set_spu​(libvlc_media_player_t p_mi,
                                 int i_spu)
        Set new video subtitle.
        Parameters:
        p_mi - the media player
        i_spu - new video subtitle to select
        Returns:
        0 on success, -1 if out of range
      • libvlc_video_get_spu_delay

        long libvlc_video_get_spu_delay​(libvlc_media_player_t p_mi)
        Get the current subtitle delay. Positive values means subtitles are being displayed later, negative values earlier.
        Parameters:
        p_mi - media player
        Returns:
        time (in microseconds) the display of subtitles is being delayed
        Since:
        LibVLC 2.0.0 or later
      • libvlc_video_set_spu_delay

        int libvlc_video_set_spu_delay​(libvlc_media_player_t p_mi,
                                       long i_delay)
        Set the subtitle delay. This affects the timing of when the subtitle will be displayed. Positive values result in subtitles being displayed later, while negative values will result in subtitles being displayed earlier. The subtitle delay will be reset to zero each time the media changes.
        Parameters:
        p_mi - media player
        i_delay - time (in microseconds) the display of subtitles should be delayed
        Returns:
        0 on success, -1 on error
        Since:
        LibVLC 2.0.0 or later
      • libvlc_media_player_get_full_title_descriptions

        int libvlc_media_player_get_full_title_descriptions​(libvlc_media_player_t p_mi,
                                                            com.sun.jna.ptr.PointerByReference titles)
        Get the full description of available titles
        Parameters:
        p_mi - the media player
        titles - address to store an allocated array of title descriptions descriptions (must be freed with libvlc_title_descriptions_release() by the caller) [OUT]
        Returns:
        the number of titles (-1 on error)
        Since:
        LibVLC 3.0.0 and later.
      • libvlc_title_descriptions_release

        void libvlc_title_descriptions_release​(com.sun.jna.Pointer p_titles,
                                               int i_count)
        Release title descriptions.
        Parameters:
        p_titles - title description array to release
        i_count - number of title descriptions to release
        Since:
        LibVLC 3.0.0 and later
      • libvlc_media_player_get_full_chapter_descriptions

        int libvlc_media_player_get_full_chapter_descriptions​(libvlc_media_player_t p_mi,
                                                              int i_chapters_of_title,
                                                              com.sun.jna.ptr.PointerByReference pp_chapters)
        Get the full description of available chapters.
        Parameters:
        p_mi - the media player
        i_chapters_of_title - index of the title to query for chapters (uses current title if set to -1)
        pp_chapters - address to store an allocated array of chapter descriptions descriptions (must be freed with libvlc_chapter_descriptions_release() by the caller) [OUT]
        Returns:
        the number of chapters (-1 on error)
        Since:
        LibVLC 3.0.0 and later.
      • libvlc_chapter_descriptions_release

        void libvlc_chapter_descriptions_release​(com.sun.jna.Pointer p_chapters,
                                                 int i_count)
        Release chapter descriptions.
        Parameters:
        p_chapters - chapter description array to release
        i_count - number of chapter descriptions to release
        Since:
        LibVLC 3.0.0 and later
      • libvlc_video_get_crop_geometry

        com.sun.jna.Pointer libvlc_video_get_crop_geometry​(libvlc_media_player_t p_mi)
        Get current crop filter geometry.
        Parameters:
        p_mi - the media player
        Returns:
        the crop filter geometry or NULL if unset
      • libvlc_video_set_crop_geometry

        void libvlc_video_set_crop_geometry​(libvlc_media_player_t p_mi,
                                            String psz_geometry)
        Set new crop filter geometry.
        Parameters:
        p_mi - the media player
        psz_geometry - new crop filter geometry (NULL to unset)
      • libvlc_video_get_teletext

        int libvlc_video_get_teletext​(libvlc_media_player_t p_mi)
        Get current teletext page requested or 0 if it's disabled.
        Parameters:
        p_mi - the media player
        Returns:
        the current teletext page requested.
      • libvlc_video_set_teletext

        void libvlc_video_set_teletext​(libvlc_media_player_t p_mi,
                                       int i_page)
        Set new teletext page to retrieve.
        Parameters:
        p_mi - the media player
        i_page - teletex page number requested. This value can be 0 to disable teletext or a number in the range 0 to 1000 to show the requested page or a TeletextKey. 100 is the default teletext page.
      • libvlc_video_get_track_count

        int libvlc_video_get_track_count​(libvlc_media_player_t p_mi)
        Get number of available video tracks.
        Parameters:
        p_mi - media player
        Returns:
        the number of available video tracks (int)
      • libvlc_video_get_track_description

        libvlc_track_description_t libvlc_video_get_track_description​(libvlc_media_player_t p_mi)
        Get the description of available video tracks.
        Parameters:
        p_mi - media player
        Returns:
        list with description of available video tracks, or NULL on error
      • libvlc_video_get_track

        int libvlc_video_get_track​(libvlc_media_player_t p_mi)
        Get current video track.
        Parameters:
        p_mi - media player
        Returns:
        the video track ID (int) or -1 if no active input
      • libvlc_video_set_track

        int libvlc_video_set_track​(libvlc_media_player_t p_mi,
                                   int i_track)
        Set video track.
        Parameters:
        p_mi - media player
        i_track - the track ID (i_id field from track description)
        Returns:
        0 on success, -1 if out of range
      • libvlc_video_take_snapshot

        int libvlc_video_take_snapshot​(libvlc_media_player_t p_mi,
                                       int num,
                                       String psz_filepath,
                                       int i_width,
                                       int i_height)
        Take a snapshot of the current video window. If i_width AND i_height is 0, original size is used. If i_width XOR i_height is 0, original aspect-ratio is preserved.
        Parameters:
        p_mi - media player instance
        num - number of video output (typically 0 for the first/only one)
        psz_filepath - the path where to save the screenshot to
        i_width - the snapshot's width
        i_height - the snapshot's height
        Returns:
        0 on success, -1 if the video was not found
      • libvlc_video_set_deinterlace

        void libvlc_video_set_deinterlace​(libvlc_media_player_t p_mi,
                                          String psz_mode)
        Enable or disable deinterlace filter
        Parameters:
        p_mi - libvlc media player
        psz_mode - type of deinterlace filter, NULL to disable
      • libvlc_video_get_marquee_int

        int libvlc_video_get_marquee_int​(libvlc_media_player_t p_mi,
                                         int option)
        Get an integer marquee option value
        Parameters:
        p_mi - libvlc media player
        option - marq option to get @see libvlc_video_marquee_int_option_t
        Returns:
        marquee option value
      • libvlc_video_get_marquee_string

        com.sun.jna.Pointer libvlc_video_get_marquee_string​(libvlc_media_player_t p_mi,
                                                            int option)
        Get a string marquee option value
        Parameters:
        p_mi - libvlc media player
        option - marq option to get @see libvlc_video_marquee_string_option_t
        Returns:
        marquee option value
      • libvlc_video_set_marquee_int

        void libvlc_video_set_marquee_int​(libvlc_media_player_t p_mi,
                                          int option,
                                          int i_val)
        Enable, disable or set an integer marquee option Setting libvlc_marquee_Enable has the side effect of enabling (arg !0) or disabling (arg 0) the marq filter.
        Parameters:
        p_mi - libvlc media player
        option - marq option to set @see libvlc_video_marquee_int_option_t
        i_val - marq option value
      • libvlc_video_set_marquee_string

        void libvlc_video_set_marquee_string​(libvlc_media_player_t p_mi,
                                             int option,
                                             String psz_text)
        Set a marquee string option
        Parameters:
        p_mi - libvlc media player
        option - marq option to set @see libvlc_video_marquee_string_option_t
        psz_text - marq option value
      • libvlc_video_get_logo_int

        int libvlc_video_get_logo_int​(libvlc_media_player_t p_mi,
                                      int option)
        Get integer logo option.
        Parameters:
        p_mi - libvlc media player instance
        option - logo option to get, values of libvlc_video_logo_option_t
        Returns:
        logo option value
      • libvlc_video_set_logo_int

        void libvlc_video_set_logo_int​(libvlc_media_player_t p_mi,
                                       int option,
                                       int value)
        Set logo option as integer. Options that take a different type value are ignored. Passing libvlc_logo_enable as option value has the side effect of starting (arg !0) or stopping (arg 0) the logo filter.
        Parameters:
        p_mi - libvlc media player instance
        option - logo option to set, values of libvlc_video_logo_option_t
        value - logo option value
      • libvlc_video_set_logo_string

        void libvlc_video_set_logo_string​(libvlc_media_player_t p_mi,
                                          int option,
                                          String psz_value)
        Set logo option as string. Options that take a different type value are ignored.
        Parameters:
        p_mi - libvlc media player instance
        option - logo option to set, values of libvlc_video_logo_option_t
        psz_value - logo option value
      • libvlc_video_get_adjust_int

        int libvlc_video_get_adjust_int​(libvlc_media_player_t p_mi,
                                        int option)
        Get integer adjust option.
        Parameters:
        p_mi - libvlc media player instance
        option - adjust option to get, values of libvlc_video_adjust_option_t
        Returns:
        value
        Since:
        LibVLC 1.1.1
      • libvlc_video_set_adjust_int

        void libvlc_video_set_adjust_int​(libvlc_media_player_t p_mi,
                                         int option,
                                         int value)
        Set adjust option as integer. Options that take a different type value are ignored. Passing libvlc_adjust_enable as option value has the side effect of starting (arg !0) or stopping (arg 0) the adjust filter.
        Parameters:
        p_mi - libvlc media player instance
        option - adust option to set, values of libvlc_video_adjust_option_t
        value - adjust option value
        Since:
        LibVLC 1.1.1
      • libvlc_video_get_adjust_float

        float libvlc_video_get_adjust_float​(libvlc_media_player_t p_mi,
                                            int option)
        Get float adjust option.
        Parameters:
        p_mi - libvlc media player instance
        option - adjust option to get, values of libvlc_video_adjust_option_t
        Returns:
        value
        Since:
        LibVLC 1.1.1
      • libvlc_video_set_adjust_float

        void libvlc_video_set_adjust_float​(libvlc_media_player_t p_mi,
                                           int option,
                                           float value)
        Set adjust option as float. Options that take a different type value are ignored.
        Parameters:
        p_mi - libvlc media player instance
        option - adust option to set, values of libvlc_video_adjust_option_t
        value - adjust option value
        Since:
        LibVLC 1.1.1
      • libvlc_audio_output_list_release

        void libvlc_audio_output_list_release​(com.sun.jna.Pointer p_list)
        Frees the list of available audio outputs
        Parameters:
        p_list - list with audio outputs for release
      • libvlc_audio_output_set

        int libvlc_audio_output_set​(libvlc_media_player_t p_mi,
                                    String psz_name)
        Sets the audio output.

        Note: Any change will take be effect only after playback is stopped and restarted. Audio output cannot be changed while playing.

        Parameters:
        p_mi - media player
        psz_name - name of audio output, use psz_name of @see libvlc_audio_output_t
        Returns:
        0 if function succeded, -1 on error
      • libvlc_audio_output_device_list_get

        libvlc_audio_output_device_t libvlc_audio_output_device_list_get​(libvlc_instance_t p_instance,
                                                                         String psz_aout)
        Gets a list of audio output devices for a given audio output.

        See libvlc_audio_output_device_set(libvlc_media_player_t, String, String).

        Not all audio outputs support this. In particular, an empty (NULL) list of devices does not imply that the specified audio output does not work.

        The list might not be exhaustive.

        Some audio output devices in the list might not actually work in some circumstances. By default, it is recommended to not specify any explicit audio device.

        Parameters:
        p_instance - libvlc instance
        psz_aout - audio output name (as returned by libvlc_audio_output_list_get())
        Returns:
        A NULL-terminated linked list of potential audio output devices. It must be freed it with libvlc_audio_output_device_list_release()
        Since:
        LibVLC 2.1.0 or later.
      • libvlc_audio_output_device_list_release

        void libvlc_audio_output_device_list_release​(com.sun.jna.Pointer p_list)
        Frees a list of available audio output devices.
        Parameters:
        p_list - list with audio outputs for release
        Since:
        LibVLC 2.1.0 or later.
      • libvlc_audio_output_device_set

        void libvlc_audio_output_device_set​(libvlc_media_player_t p_mi,
                                            String psz_audio_output,
                                            String psz_device_id)
        Configures an explicit audio output device.

        If the module parameter is NULL, audio output will be moved to the device specified by the device identifier string immediately. This is the recommended usage.

        A list of adequate potential device strings can be obtained with libvlc_audio_output_device_enum(). // FIXME

        However passing NULL is supported in LibVLC version 2.2.0 and later only; in earlier versions, this function would have no effects when the module parameter was NULL.

        If the module parameter is not NULL, the device parameter of the corresponding audio output, if it exists, will be set to the specified string. Note that some audio output modules do not have such a parameter (notably MMDevice and PulseAudio).

        A list of adequate potential device strings can be obtained with libvlc_audio_output_device_list_get().

        This function does not select the specified audio output plugin. libvlc_audio_output_set() is used for that purpose.

        The syntax for the device parameter depends on the audio output.

        Some audio output modules require further parameters (e.g. a channels map in the case of ALSA).

        Parameters:
        p_mi - media player
        psz_audio_output - if NULL, current audio output module; if non-NULL, name of audio output module (@see libvlc_audio_output_t)
        psz_device_id - device identifier string
      • libvlc_audio_output_device_get

        com.sun.jna.Pointer libvlc_audio_output_device_get​(libvlc_media_player_t mp)
        Get the current audio output device identifier. This complements libvlc_audio_output_device_set(). The initial value for the current audio output device identifier may not be set or may be some unknown value. A LibVLC application should compare this value against the known device identifiers (e.g. those that were previously retrieved by a call to libvlc_audio_output_device_enum or libvlc_audio_output_device_list_get) to find the current audio output device. It is possible that the selected audio output device changes (an external change) without a call to libvlc_audio_output_device_set. That may make this method unsuitable to use if a LibVLC application is attempting to track dynamic audio device changes as they happen.
        Parameters:
        mp - media player
        Returns:
        the current audio output device identifier NULL if no device is selected or in case of error (the result must be released with free() or libvlc_free()).
        Since:
        LibVLC 3.0.0 or later.
      • libvlc_audio_toggle_mute

        void libvlc_audio_toggle_mute​(libvlc_media_player_t p_mi)
        Toggle mute status.
        Parameters:
        p_mi - media player
      • libvlc_audio_get_mute

        int libvlc_audio_get_mute​(libvlc_media_player_t p_mi)
        Get current mute status.
        Parameters:
        p_mi - media player
        Returns:
        the mute status (boolean)
      • libvlc_audio_set_mute

        void libvlc_audio_set_mute​(libvlc_media_player_t p_mi,
                                   int status)
        Set mute status.
        Parameters:
        p_mi - media player
        status - If status is true then mute, otherwise unmute
      • libvlc_audio_get_volume

        int libvlc_audio_get_volume​(libvlc_media_player_t p_mi)
        Get current software audio volume.
        Parameters:
        p_mi - media player
        Returns:
        the software volume in percents (0 = mute, 100 = nominal / 0dB)
      • libvlc_audio_set_volume

        int libvlc_audio_set_volume​(libvlc_media_player_t p_mi,
                                    int i_volume)
        Set current software audio volume.
        Parameters:
        p_mi - media player
        i_volume - the volume in percents (0 = mute, 100 = 0dB)
        Returns:
        0 if the volume was set, -1 if it was out of range
      • libvlc_audio_get_track_count

        int libvlc_audio_get_track_count​(libvlc_media_player_t p_mi)
        Get number of available audio tracks.
        Parameters:
        p_mi - media player
        Returns:
        the number of available audio tracks (int), or -1 if unavailable
      • libvlc_audio_get_track_description

        libvlc_track_description_t libvlc_audio_get_track_description​(libvlc_media_player_t p_mi)
        Get the description of available audio tracks.
        Parameters:
        p_mi - media player
        Returns:
        list with description of available audio tracks, or NULL
      • libvlc_audio_get_track

        int libvlc_audio_get_track​(libvlc_media_player_t p_mi)
        Get current audio track.
        Parameters:
        p_mi - media player
        Returns:
        the audio track ID or -1 if no active input.
      • libvlc_audio_set_track

        int libvlc_audio_set_track​(libvlc_media_player_t p_mi,
                                   int i_track)
        Set current audio track.
        Parameters:
        p_mi - media player
        i_track - the track ID (i_id field from track description)
        Returns:
        0 on success, -1 on error
      • libvlc_audio_get_channel

        int libvlc_audio_get_channel​(libvlc_media_player_t p_mi)
        Get current audio channel.
        Parameters:
        p_mi - media player
        Returns:
        the audio channel @see AudioChannel
      • libvlc_audio_set_channel

        int libvlc_audio_set_channel​(libvlc_media_player_t p_mi,
                                     int channel)
        Set current audio channel.
        Parameters:
        p_mi - media player
        channel - the audio channel, @see AudioChannel
        Returns:
        0 on success, -1 on error
      • libvlc_audio_get_delay

        long libvlc_audio_get_delay​(libvlc_media_player_t p_mi)
        Get current audio delay.
        Parameters:
        p_mi - media player
        Returns:
        amount audio is being delayed by, in microseconds
        Since:
        LibVLC 1.1.1
      • libvlc_audio_set_delay

        int libvlc_audio_set_delay​(libvlc_media_player_t p_mi,
                                   long i_delay)
        Set current audio delay. The delay is only active for the current media item and will be reset to zero each time the media changes.
        Parameters:
        p_mi - media player
        i_delay - amount to delay audio by, in microseconds
        Returns:
        0 on success, -1 on error
        Since:
        LibVLC 1.1.1
      • libvlc_audio_equalizer_get_preset_count

        int libvlc_audio_equalizer_get_preset_count()
        Get the number of equalizer presets.
        Returns:
        number of presets
        Since:
        LibVLC 2.2.0 or later
      • libvlc_audio_equalizer_get_preset_name

        String libvlc_audio_equalizer_get_preset_name​(int u_index)
        Get the name of a particular equalizer preset.

        This name can be used, for example, to prepare a preset label or menu in a user interface.

        Parameters:
        u_index - index of the preset, counting from zero
        Returns:
        preset name, or NULL if there is no such preset
        Since:
        LibVLC 2.2.0 or later
      • libvlc_audio_equalizer_get_band_count

        int libvlc_audio_equalizer_get_band_count()
        Get the number of distinct frequency bands for an equalizer.
        Returns:
        number of frequency bands
        Since:
        LibVLC 2.2.0 or later
      • libvlc_audio_equalizer_get_band_frequency

        float libvlc_audio_equalizer_get_band_frequency​(int u_index)
        Get a particular equalizer band frequency.

        This value can be used, for example, to create a label for an equalizer band control in a user interface.

        Parameters:
        u_index - index of the band, counting from zero
        Returns:
        equalizer band frequency (Hz), or -1 if there is no such band
        Since:
        LibVLC 2.2.0 or later
      • libvlc_audio_equalizer_new

        libvlc_equalizer_t libvlc_audio_equalizer_new()
        Create a new default equalizer, with all frequency values zeroed.

        The new equalizer can subsequently be applied to a media player by invoking libvlc_media_player_set_equalizer().

        The returned handle should be freed via libvlc_audio_equalizer_release() when it is no longer needed.

        Returns:
        opaque equalizer handle, or NULL on error
        Since:
        LibVLC 2.2.0 or later
      • libvlc_audio_equalizer_new_from_preset

        libvlc_equalizer_t libvlc_audio_equalizer_new_from_preset​(int u_index)
        Create a new equalizer, with initial frequency values copied from an existing preset.

        The new equalizer can subsequently be applied to a media player by invoking libvlc_media_player_set_equalizer().

        The returned handle should be freed via libvlc_audio_equalizer_release() when it is no longer needed.

        Parameters:
        u_index - index of the preset, counting from zero
        Returns:
        opaque equalizer handle, or NULL on error
        Since:
        LibVLC 2.2.0 or later
      • libvlc_audio_equalizer_release

        void libvlc_audio_equalizer_release​(libvlc_equalizer_t p_equalizer)
        Release a previously created equalizer instance.

        The equalizer was previously created by using libvlc_audio_equalizer_new() or libvlc_audio_equalizer_new_from_preset().

        It is safe to invoke this method with a NULL p_equalizer parameter for no effect.

        Parameters:
        p_equalizer - opaque equalizer handle, or NULL
        Since:
        LibVLC 2.2.0 or later
      • libvlc_audio_equalizer_set_preamp

        int libvlc_audio_equalizer_set_preamp​(libvlc_equalizer_t p_equalizer,
                                              float f_preamp)
        Set a new pre-amplification value for an equalizer.

        The new equalizer settings are subsequently applied to a media player by invoking libvlc_media_player_set_equalizer().

        Parameters:
        p_equalizer - valid equalizer handle, must not be NULL
        f_preamp - preamp value (-20.0 to 20.0 Hz)
        Returns:
        zero on success, -1 on error
        Since:
        LibVLC 2.2.0 or later
      • libvlc_audio_equalizer_get_preamp

        float libvlc_audio_equalizer_get_preamp​(libvlc_equalizer_t p_equalizer)
        Get the current pre-amplification value from an equalizer.
        Parameters:
        p_equalizer - valid equalizer handle, must not be NULL
        Returns:
        preamp value (Hz)
        Since:
        LibVLC 2.2.0 or later
      • libvlc_audio_equalizer_set_amp_at_index

        int libvlc_audio_equalizer_set_amp_at_index​(libvlc_equalizer_t p_equalizer,
                                                    float f_amp,
                                                    int u_band)
        Set a new amplification value for a particular equalizer frequency band.

        The new equalizer settings are subsequently applied to a media player by invoking libvlc_media_player_set_equalizer().

        Parameters:
        p_equalizer - valid equalizer handle, must not be NULL
        f_amp - amplification value (-20.0 to 20.0 Hz)
        u_band - index, counting from zero, of the frequency band to set
        Returns:
        zero on success, -1 on error
        Since:
        LibVLC 2.2.0 or later
      • libvlc_audio_equalizer_get_amp_at_index

        float libvlc_audio_equalizer_get_amp_at_index​(libvlc_equalizer_t p_equalizer,
                                                      int u_band)
        Get the amplification value for a particular equalizer frequency band.
        Parameters:
        p_equalizer - valid equalizer handle, must not be NULL
        u_band - index, counting from zero, of the frequency band to get
        Returns:
        amplification value (Hz); zero if there is no such frequency band
        Since:
        LibVLC 2.2.0 or later
      • libvlc_media_player_set_equalizer

        int libvlc_media_player_set_equalizer​(libvlc_media_player_t p_mi,
                                              libvlc_equalizer_t p_equalizer)
        Apply new equalizer settings to a media player.

        The equalizer is first created by invoking libvlc_audio_equalizer_new() or libvlc_audio_equalizer_new_from_preset().

        It is possible to apply new equalizer settings to a media player whether the media player is currently playing media or not.

        Invoking this method will immediately apply the new equalizer settings to the audio output of the currently playing media if there is any.

        If there is no currently playing media, the new equalizer settings will be applied later if and when new media is played.

        Equalizer settings will automatically be applied to subsequently played media.

        To disable the equalizer for a media player invoke this method passing NULL for the p_equalizer parameter.

        The media player does not keep a reference to the supplied equalizer so it is safe for an application to release the equalizer reference any time after this method returns.

        Parameters:
        p_mi - opaque media player handle
        p_equalizer - opaque equalizer handle, or NULL to disable the equalizer for this media player
        Returns:
        zero on success, -1 on error
        Since:
        LibVLC 2.2.0 or later
      • libvlc_media_player_get_role

        int libvlc_media_player_get_role​(libvlc_media_player_t p_mi)
        Gets the media role.
        Parameters:
        p_mi - opaque media player handle
        Returns:
        the media player role (MediaPlayerRole)
        Since:
        LibVLC 3.0.0 or later
      • libvlc_media_player_set_role

        int libvlc_media_player_set_role​(libvlc_media_player_t p_mi,
                                         int role)
        Sets the media role.
        Parameters:
        p_mi - opaque media player handle
        role - the media player role (MediaPlayerRole)
        Returns:
        0 on success, -1 on error
        Since:
        LibVLC 3.0.0 or later
      • libvlc_media_list_new

        libvlc_media_list_t libvlc_media_list_new​(libvlc_instance_t p_instance)
        Create an empty media list.
        Parameters:
        p_instance - libvlc instance
        Returns:
        empty media list, or NULL on error
      • libvlc_media_list_release

        void libvlc_media_list_release​(libvlc_media_list_t p_ml)
        Release media list created with libvlc_media_list_new().
        Parameters:
        p_ml - a media list created with libvlc_media_list_new()
      • libvlc_media_list_retain

        void libvlc_media_list_retain​(libvlc_media_list_t p_ml)
        Retain reference to a media list
        Parameters:
        p_ml - a media list created with libvlc_media_list_new()
      • libvlc_media_list_set_media

        void libvlc_media_list_set_media​(libvlc_media_list_t p_ml,
                                         libvlc_media_t p_md)
        Associate media instance with this media list instance. If another media instance was present it will be released. The libvlc_media_list_lock should NOT be held upon entering this function.
        Parameters:
        p_ml - a media list instance
        p_md - media instance to add
      • libvlc_media_list_media

        libvlc_media_t libvlc_media_list_media​(libvlc_media_list_t p_ml)
        Get media instance from this media list instance. This action will increase the refcount on the media instance. The libvlc_media_list_lock should NOT be held upon entering this function.
        Parameters:
        p_ml - a media list instance
        Returns:
        media instance
      • libvlc_media_list_add_media

        int libvlc_media_list_add_media​(libvlc_media_list_t p_ml,
                                        libvlc_media_t p_md)
        Add media instance to media list The libvlc_media_list_lock should be held upon entering this function.
        Parameters:
        p_ml - a media list instance
        p_md - a media instance
        Returns:
        0 on success, -1 if the media list is read-only
      • libvlc_media_list_insert_media

        int libvlc_media_list_insert_media​(libvlc_media_list_t p_ml,
                                           libvlc_media_t p_md,
                                           int i_pos)
        Insert media instance in media list on a position The libvlc_media_list_lock should be held upon entering this function.
        Parameters:
        p_ml - a media list instance
        p_md - a media instance
        i_pos - position in array where to insert
        Returns:
        0 on success, -1 if the media list si read-only
      • libvlc_media_list_remove_index

        int libvlc_media_list_remove_index​(libvlc_media_list_t p_ml,
                                           int i_pos)
        Remove media instance from media list on a position The libvlc_media_list_lock should be held upon entering this function.
        Parameters:
        p_ml - a media list instance
        i_pos - position in array where to insert
        Returns:
        0 on success, -1 if the list is read-only or the item was not found
      • libvlc_media_list_count

        int libvlc_media_list_count​(libvlc_media_list_t p_ml)
        Get count on media list items The libvlc_media_list_lock should be held upon entering this function.
        Parameters:
        p_ml - a media list instance
        Returns:
        number of items in media list
      • libvlc_media_list_item_at_index

        libvlc_media_t libvlc_media_list_item_at_index​(libvlc_media_list_t p_ml,
                                                       int i_pos)
        List media instance in media list at a position The libvlc_media_list_lock should be held upon entering this function.
        Parameters:
        p_ml - a media list instance
        i_pos - position in array where to insert
        Returns:
        media instance at position i_pos, or NULL if not found. In case of success, libvlc_media_retain() is called to increase the refcount on the media.
      • libvlc_media_list_index_of_item

        int libvlc_media_list_index_of_item​(libvlc_media_list_t p_ml,
                                            libvlc_media_t p_md)
        Find index position of List media instance in media list. Warning: the function will return the first matched position. The libvlc_media_list_lock should be held upon entering this function.
        Parameters:
        p_ml - a media list instance
        p_md - media list instance
        Returns:
        position of media instance
      • libvlc_media_list_is_readonly

        int libvlc_media_list_is_readonly​(libvlc_media_list_t p_ml)
        This indicates if this media list is read-only from a user point of view
        Parameters:
        p_ml - media list instance
        Returns:
        0 on readonly, 1 on readwrite FIXME I am pretty sure the documented return values are the wrong way around
      • libvlc_media_list_lock

        void libvlc_media_list_lock​(libvlc_media_list_t p_ml)
        Get lock on media list items
        Parameters:
        p_ml - a media list instance
      • libvlc_media_list_unlock

        void libvlc_media_list_unlock​(libvlc_media_list_t p_ml)
        Release lock on media list items The libvlc_media_list_lock should be held upon entering this function.
        Parameters:
        p_ml - a media list instance
      • libvlc_media_list_event_manager

        libvlc_event_manager_t libvlc_media_list_event_manager​(libvlc_media_list_t p_ml)
        Get libvlc_event_manager from this media list instance. The p_event_manager is immutable, so you don't have to hold the lock
        Parameters:
        p_ml - a media list instance
        Returns:
        libvlc_event_manager
      • libvlc_media_list_player_new

        libvlc_media_list_player_t libvlc_media_list_player_new​(libvlc_instance_t p_instance)
        Create new media_list_player.
        Parameters:
        p_instance - libvlc instance
        Returns:
        media list player instance or NULL on error
      • libvlc_media_list_player_release

        void libvlc_media_list_player_release​(libvlc_media_list_player_t p_mlp)
        Release a media_list_player after use. Decrement the reference count of a* media player object. If the reference count is 0, then libvlc_media_list_player_release() will release the media player object. If the media player object has been released, then it should not be used again.
        Parameters:
        p_mlp - media list player instance
      • libvlc_media_list_player_retain

        void libvlc_media_list_player_retain​(libvlc_media_list_player_t p_mlp)
        Retain a reference to a media player list object. Use libvlc_media_list_player_release() to decrement reference count.
        Parameters:
        p_mlp - media player list object
      • libvlc_media_list_player_event_manager

        libvlc_event_manager_t libvlc_media_list_player_event_manager​(libvlc_media_list_player_t p_mlp)
        Return the event manager of this media_list_player.
        Parameters:
        p_mlp - media list player instance
        Returns:
        the event manager
      • libvlc_media_list_player_set_media_player

        void libvlc_media_list_player_set_media_player​(libvlc_media_list_player_t p_mlp,
                                                       libvlc_media_player_t p_mi)
        Replace media player in media_list_player with this instance.
        Parameters:
        p_mlp - media list player instance
        p_mi - media player instance
      • libvlc_media_list_player_get_media_player

        libvlc_media_player_t libvlc_media_list_player_get_media_player​(libvlc_media_list_player_t p_mlp)
        Get media player of the media_list_player instance.

        Note: the caller is responsible for releasing the returned instance.

        Parameters:
        p_mlp - media list player instance
        Returns:
        media player instance
        Since:
        LibVLC 3.0.0
      • libvlc_media_list_player_set_media_list

        void libvlc_media_list_player_set_media_list​(libvlc_media_list_player_t p_mlp,
                                                     libvlc_media_list_t p_mlist)
        Set the media list associated with the player
        Parameters:
        p_mlp - media list player instance
        p_mlist - list of media
      • libvlc_media_list_player_play

        void libvlc_media_list_player_play​(libvlc_media_list_player_t p_mlp)
        Play media list
        Parameters:
        p_mlp - media list player instance
      • libvlc_media_list_player_pause

        void libvlc_media_list_player_pause​(libvlc_media_list_player_t p_mlp)
        Pause media list
        Parameters:
        p_mlp - media list player instance
      • libvlc_media_list_player_set_pause

        void libvlc_media_list_player_set_pause​(libvlc_media_list_player_t p_mlp,
                                                int do_pause)
        Pause or resume media list
        Parameters:
        p_mlp - media list player instance
        do_pause - play/resume if zero, pause if non-zero
        Since:
        LibVLC 3.0.0 or later
      • libvlc_media_list_player_is_playing

        int libvlc_media_list_player_is_playing​(libvlc_media_list_player_t p_mlp)
        Is media list playing?
        Parameters:
        p_mlp - media list player instance
        Returns:
        true for playing and false for not playing
      • libvlc_media_list_player_get_state

        int libvlc_media_list_player_get_state​(libvlc_media_list_player_t p_mlp)
        Get current libvlc_state of media list player
        Parameters:
        p_mlp - media list player instance
        Returns:
        State for media list player
      • libvlc_media_list_player_play_item_at_index

        int libvlc_media_list_player_play_item_at_index​(libvlc_media_list_player_t p_mlp,
                                                        int i_index)
        Play media list item at position index
        Parameters:
        p_mlp - media list player instance
        i_index - index in media list to play
        Returns:
        0 upon success -1 if the item wasn't found
      • libvlc_media_list_player_play_item

        int libvlc_media_list_player_play_item​(libvlc_media_list_player_t p_mlp,
                                               libvlc_media_t p_md)
        Play the given media item
        Parameters:
        p_mlp - media list player instance
        p_md - the media instance
        Returns:
        0 upon success, -1 if the media is not part of the media list
      • libvlc_media_list_player_stop

        void libvlc_media_list_player_stop​(libvlc_media_list_player_t p_mlp)
        Stop playing media list
        Parameters:
        p_mlp - media list player instance
      • libvlc_media_list_player_next

        int libvlc_media_list_player_next​(libvlc_media_list_player_t p_mlp)
        Play next item from media list
        Parameters:
        p_mlp - media list player instance
        Returns:
        0 upon success -1 if there is no next item
      • libvlc_media_list_player_previous

        int libvlc_media_list_player_previous​(libvlc_media_list_player_t p_mlp)
        Play previous item from media list
        Parameters:
        p_mlp - media list player instance
        Returns:
        0 upon success -1 if there is no previous item
      • libvlc_media_list_player_set_playback_mode

        void libvlc_media_list_player_set_playback_mode​(libvlc_media_list_player_t p_mlp,
                                                        int e_mode)
        Sets the playback mode for the playlist
        Parameters:
        p_mlp - media list player instance
        e_mode - playback mode specification
      • libvlc_dialog_set_callbacks

        void libvlc_dialog_set_callbacks​(libvlc_instance_t p_instance,
                                         libvlc_dialog_cbs p_cbs,
                                         com.sun.jna.Pointer p_data)
        Register callbacks in order to handle VLC dialogs.
        Parameters:
        p_instance - the instance
        p_cbs - a pointer to callbacks, or NULL to unregister callbacks.
        p_data - opaque pointer for the callback
        Since:
        LibVLC 3.0.0 and later.
      • libvlc_dialog_set_context

        void libvlc_dialog_set_context​(libvlc_dialog_id p_id,
                                       com.sun.jna.Pointer p_context)
        Associate an opaque pointer with the dialog id.
        Parameters:
        p_id - id of the dialog
        p_context - opaque pointer associated with the dialog id
        Since:
        LibVLC 3.0.0 and later.
      • libvlc_dialog_get_context

        com.sun.jna.Pointer libvlc_dialog_get_context​(libvlc_dialog_id p_id)
        Return the opaque pointer associated with the dialog id.
        Parameters:
        p_id - id of the dialog
        Returns:
        opaque pointer associated with the dialog id
        Since:
        LibVLC 3.0.0 and later.
      • libvlc_dialog_post_login

        int libvlc_dialog_post_login​(libvlc_dialog_id p_id,
                                     String psz_username,
                                     String psz_password,
                                     int b_store)
        Post a login answer.

        After this call, p_id won't be valid anymore

        Parameters:
        p_id - id of the dialog
        psz_username - valid and non empty string
        psz_password - valid string (can be empty)
        b_store - if true, store the credentials
        Returns:
        0 on success, or -1 on error
        Since:
        LibVLC 3.0.0 and later.
        See Also:
        libvlc_dialog_cbs.pf_display_login
      • libvlc_dialog_post_action

        int libvlc_dialog_post_action​(libvlc_dialog_id p_id,
                                      int i_action)
        Post a question answer.

        After this call, p_id won't be valid anymore

        Parameters:
        p_id - id of the dialog
        i_action - 1 for action1, 2 for action2
        Returns:
        0 on success, or -1 on error
        Since:
        LibVLC 3.0.0 and later.
        See Also:
        libvlc_dialog_cbs.pf_display_question
      • libvlc_dialog_dismiss

        int libvlc_dialog_dismiss​(libvlc_dialog_id p_id)
        Dismiss a dialog.

        After this call, p_id won't be valid anymore

        Parameters:
        p_id - id of the dialog
        Returns:
        0 on success, or -1 on error
        Since:
        LibVLC 3.0.0 and later.
        See Also:
        libvlc_dialog_cbs.pf_cancel
      • libvlc_media_discoverer_start

        int libvlc_media_discoverer_start​(libvlc_media_discoverer_t p_mdis)
        Start media discovery. To stop it, call libvlc_media_discoverer_stop() or libvlc_media_discoverer_release() directly.
        Parameters:
        p_mdis - media discover object
        Returns:
        -1 in case of error, 0 otherwise
        Since:
        LibVLC 3.0.0 or later
        See Also:
        libvlc_media_discoverer_stop(libvlc_media_discoverer_t)
      • libvlc_media_discoverer_release

        void libvlc_media_discoverer_release​(libvlc_media_discoverer_t p_mdis)
        Release media discover object. If the reference count reaches 0, then the object will be released.
        Parameters:
        p_mdis - media service discover object
      • libvlc_media_discoverer_media_list

        libvlc_media_list_t libvlc_media_discoverer_media_list​(libvlc_media_discoverer_t p_mdis)
        Get media service discover media list.
        Parameters:
        p_mdis - media service discover object
        Returns:
        list of media items
      • libvlc_media_discoverer_is_running

        int libvlc_media_discoverer_is_running​(libvlc_media_discoverer_t p_mdis)
        Query if media service discover object is running.
        Parameters:
        p_mdis - media service discover object
        Returns:
        true if running, false if not
      • libvlc_media_discoverer_list_get

        size_t libvlc_media_discoverer_list_get​(libvlc_instance_t p_inst,
                                                int i_cat,
                                                com.sun.jna.ptr.PointerByReference ppp_services)
        Get media discoverer services by category
        Parameters:
        p_inst - libvlc instance
        i_cat - category of services to fetch
        ppp_services - address to store an allocated array of media discoverer services (must be freed with libvlc_media_discoverer_list_release() by the caller) [OUT]
        Returns:
        the number of media discoverer services (0 on error)
        Since:
        LibVLC 3.0.0 and later.
      • libvlc_renderer_item_hold

        libvlc_renderer_item_t libvlc_renderer_item_hold​(libvlc_renderer_item_t p_item)
        Hold a renderer item, i.e. creates a new reference This functions need to called from the libvlc_RendererDiscovererItemAdded callback if the libvlc user wants to use this item after. (for display or for passing it to the mediaplayer for example).
        Returns:
        the current item
        Since:
        LibVLC 3.0.0 or later
      • libvlc_renderer_item_release

        void libvlc_renderer_item_release​(libvlc_renderer_item_t p_item)
        Releases a renderer item, i.e. decrements its reference counter
        Since:
        LibVLC 3.0.0 or later
      • libvlc_renderer_item_name

        String libvlc_renderer_item_name​(libvlc_renderer_item_t p_item)
        Get the human readable name of a renderer item
        Returns:
        the name of the item (can't be NULL, must *not* be freed)
        Since:
        LibVLC 3.0.0 or later
      • libvlc_renderer_item_type

        String libvlc_renderer_item_type​(libvlc_renderer_item_t p_item)
        Get the type (not translated) of a renderer item. For now, the type can only be "chromecast" ("upnp", "airplay" may come later).
        Returns:
        the type of the item (can't be NULL, must *not* be freed)
        Since:
        LibVLC 3.0.0 or later
      • libvlc_renderer_item_icon_uri

        String libvlc_renderer_item_icon_uri​(libvlc_renderer_item_t p_item)
        Get the icon uri of a renderer item
        Returns:
        the uri of the item's icon (can be NULL, must *not* be freed)
        Since:
        LibVLC 3.0.0 or later
      • libvlc_renderer_item_flags

        int libvlc_renderer_item_flags​(libvlc_renderer_item_t p_item)
        Get the flags of a renderer item
        Returns:
        bitwise flag: capabilities of the renderer, see
        Since:
        LibVLC 3.0.0 or later
      • libvlc_renderer_discoverer_release

        void libvlc_renderer_discoverer_release​(libvlc_renderer_discoverer_t p_rd)
        Release a renderer discoverer object
        Parameters:
        p_rd - renderer discoverer object
        Since:
        LibVLC 3.0.0 or later
      • libvlc_renderer_discoverer_list_get

        size_t libvlc_renderer_discoverer_list_get​(libvlc_instance_t p_inst,
                                                   com.sun.jna.ptr.PointerByReference ppp_services)
        Get media discoverer services
        Parameters:
        p_inst - libvlc instance
        ppp_services - address to store an allocated array of renderer discoverer services (must be freed with libvlc_renderer_list_release() by the caller) [OUT]
        Returns:
        the number of media discoverer services (0 on error)
        Since:
        LibVLC 3.0.0 and later
        See Also:
        libvlc_renderer_discoverer_list_release(Pointer, size_t)
      • libvlc_picture_release

        void libvlc_picture_release​(libvlc_picture_t pic)
        Decrement the reference count of this picture. When the reference count reaches 0, the picture will be released. The picture must not be accessed after calling this function.
        Parameters:
        pic - A picture object
        See Also:
        libvlc_picture_retain(libvlc_picture_t)
      • libvlc_picture_save

        int libvlc_picture_save​(libvlc_picture_t pic,
                                String path)
        Saves this picture to a file. The image format is the same as the one returned by \link libvlc_picture_type \endlink
        Parameters:
        pic - A picture object
        path - The path to the generated file
        Returns:
        0 in case of success, -1 otherwise
      • libvlc_picture_get_buffer

        com.sun.jna.Pointer libvlc_picture_get_buffer​(libvlc_picture_t pic,
                                                      size_tByReference size)
        Returns the image internal buffer, including potential padding. The libvlc_picture_t owns the returned buffer, which must not be modified nor freed.
        Parameters:
        pic - A picture object
        size - A pointer to a size_t that will hold the size of the buffer [required]
        Returns:
        A pointer to the internal buffer.
      • libvlc_picture_type

        int libvlc_picture_type​(libvlc_picture_t pic)
        Returns the picture type
        Parameters:
        pic - A picture object
      • libvlc_picture_get_stride

        int libvlc_picture_get_stride​(libvlc_picture_t pic)
        Returns the image stride, ie. the number of bytes per line. This can only be called on images of type libvlc_picture_Argb
        Parameters:
        pic - A picture object
      • libvlc_picture_get_width

        int libvlc_picture_get_width​(libvlc_picture_t pic)
        Returns the width of the image in pixels
        Parameters:
        pic - A picture object
      • libvlc_picture_get_height

        int libvlc_picture_get_height​(libvlc_picture_t pic)
        Returns the height of the image in pixels
        Parameters:
        pic - A picture object
      • libvlc_picture_get_time

        long libvlc_picture_get_time​(libvlc_picture_t pic)
        Returns the time at which this picture was generated, in milliseconds
        Parameters:
        pic - A picture object