(**
* 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.
*
* LibVLC may create threads. Therefore, any thread-unsafe process
* initialization must be performed before calling libvlc_new(). In particular
* and where applicable:
* - setlocale() and textdomain(),
* - setenv(), unsetenv() and putenv(),
* - with the X11 display system, XInitThreads()
* (see also libvlc_media_player_set_xwindow()) and
* - on Microsoft Windows, SetErrorMode().
* - sigprocmask() shall never be invoked; pthread_sigmask() can be used.
*
* On POSIX systems, the SIGCHLD signal MUST be ignored, i.e. the
* signal handler must set to SIG_DFL or a function pointer, not SIG_IGN.
* Also while LibVLC is active, the wait() function shall not be called, and
* any call to waitpid() shall use a strictly positive value for the first
* parameter (i.e. the PID). Failure to follow those rules may lead to a
* deadlock or a busy loop.
* Also on POSIX systems, it is recommended that the SIGPIPE signal be blocked,
* even if it is not, in principles, necessary, e.g.:
sigset_t set;
signal(SIGCHLD, SIG_DFL);
sigemptyset(&set);
sigaddset(&set, SIGPIPE);
pthread_sigmask(SIG_BLOCK, &set, NULL);
*
* On Microsoft Windows Vista/2008, the process error mode
* SEM_FAILCRITICALERRORS flag MUST be set before using LibVLC.
* On later versions, that is optional and unnecessary.
* Also on Microsoft Windows (Vista and any later version), setting the default
* DLL directories to SYSTEM32 exclusively is strongly recommended for
* security reasons:
SetErrorMode(SEM_FAILCRITICALERRORS);
SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_SYSTEM32);
*
* 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.
*
* 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.
*
* param argc the number of arguments (should be 0)
* param argv list of arguments (should be NULL)
* return the libvlc instance or NULL in case of error
*)
var
libvlc_new : function(
argc : Integer;
args : PPAnsiChar
) : libvlc_instance_t_ptr; cdecl;