Before it can do anything useful, LibVLC must be initialized. You can create one (or more) instance(s) of LibVLC in a given process, with libvlc_new() and destroy them with libvlc_release().
- Version
- Unless otherwise stated, these functions are available from LibVLC versions numbered 1.1.0 or more. Earlier versions (0.9.x and 1.0.x) are not compatible.
This structure is opaque. It represents a libvlc instance
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_API void libvlc_free |
( |
void * |
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
-
LIBVLC_API const char* libvlc_get_changeset |
( |
void |
| ) |
|
Retrieve libvlc changeset.
Example: "aa9bce0bc4"
- Returns
- a string containing the libvlc changeset
LIBVLC_API const char* libvlc_get_compiler |
( |
void |
| ) |
|
Retrieve libvlc compiler version.
Example: "gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu6)"
- Returns
- a string containing the libvlc compiler version
LIBVLC_API const char* libvlc_get_version |
( |
void |
| ) |
|
Retrieve libvlc version.
Example: "1.1.0-git The Luggage"
- Returns
- a string containing the libvlc version
Release a list of module descriptions.
- Parameters
-
p_list | the list to be released |
Create and initialize a libvlc instance. This functions accept a list of "command line" arguments similar to the main(). These arguments affect the LibVLC instance default configuration.
- Version
- Arguments are meant to be passed from the command line to LibVLC, just like VLC media player does. The list of valid arguments depends on the LibVLC version, the operating system and platform, and set of available LibVLC plugins. Invalid or unsupported arguments will cause the function to fail (i.e. return NULL). Also, some arguments may alter the behaviour or otherwise interfere with other LibVLC functions.
- Warning
- There is absolutely no warranty or promise of forward, backward and cross-platform compatibility with regards to libvlc_new() arguments. We recommend that you do not use them, other than when debugging.
- Parameters
-
argc | the number of arguments (should be 0) |
argv | list of arguments (should be NULL) |
- Returns
- the libvlc instance or NULL in case of error
Decrement the reference count of a libvlc instance, and destroy it if it reaches zero.
- Parameters
-
p_instance | the instance to destroy |
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_API void libvlc_set_app_id |
( |
libvlc_instance_t * |
p_instance, |
|
|
const char * |
id, |
|
|
const char * |
version, |
|
|
const char * |
icon |
|
) |
| |
Sets some meta-informations about the application. See also libvlc_set_user_agent().
- 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" |
- Version
- LibVLC 2.1.0 or later.
LIBVLC_API void libvlc_set_exit_handler |
( |
libvlc_instance_t * |
p_instance, |
|
|
void(*)(void *) |
cb, |
|
|
void * |
opaque |
|
) |
| |
Registers a callback for the LibVLC exit event. This is mostly useful if the VLC playlist and/or at least one interface are started with libvlc_playlist_play() or libvlc_add_intf() respectively. Typically, this function will wake up your application main loop (from another thread).
- Note
- This function should be called before the playlist or interface are started. Otherwise, there is a small race condition: the exit event could be raised before the handler is registered.
- Parameters
-
p_instance | LibVLC instance |
cb | callback to invoke when LibVLC wants to exit, or NULL to disable the exit handler (as by default) |
opaque | data pointer for the callback |
- Warning
- This function and libvlc_wait() cannot be used at the same time.
LIBVLC_API void libvlc_set_user_agent |
( |
libvlc_instance_t * |
p_instance, |
|
|
const char * |
name, |
|
|
const char * |
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" |
- Version
- LibVLC 1.1.1 or later
Waits until an interface causes the instance to exit. You should start at least one interface first, using libvlc_add_intf().
- Parameters
-
- Warning
- This function wastes one thread doing basically nothing. libvlc_set_exit_handler() should be used instead.