| 83 | | /***************************************************************************** |
|---|
| 84 | | * VLC_Error: strerror() equivalent |
|---|
| 85 | | ***************************************************************************** |
|---|
| 86 | | * This function returns full version string (numeric version and codename). |
|---|
| 87 | | *****************************************************************************/ |
|---|
| 88 | | char const * VLC_Error( int i_err ) |
|---|
| 89 | | { |
|---|
| 90 | | return vlc_error( i_err ); |
|---|
| 91 | | } |
|---|
| 92 | | |
|---|
| 93 | | /***************************************************************************** |
|---|
| 94 | | * VLC_Create: allocate a libvlc instance and intialize global libvlc stuff if needed |
|---|
| 95 | | ***************************************************************************** |
|---|
| 96 | | * This function allocates a libvlc instance and returns a negative value |
|---|
| 97 | | * in case of failure. Also, the thread system is initialized. |
|---|
| 98 | | *****************************************************************************/ |
|---|
| 99 | | int VLC_Create( void ) |
|---|
| 100 | | { |
|---|
| 101 | | libvlc_int_t *p_object = libvlc_InternalCreate(); |
|---|
| 102 | | if( p_object ) return p_object->i_object_id; |
|---|
| 103 | | return VLC_ENOOBJ; |
|---|
| 104 | | } |
|---|
| 105 | | |
|---|
| 112 | | |
|---|
| 113 | | /***************************************************************************** |
|---|
| 114 | | * VLC_Init: initialize a libvlc instance |
|---|
| 115 | | ***************************************************************************** |
|---|
| 116 | | * This function initializes a previously allocated libvlc instance: |
|---|
| 117 | | * - CPU detection |
|---|
| 118 | | * - gettext initialization |
|---|
| 119 | | * - message queue, module bank and playlist initialization |
|---|
| 120 | | * - configuration and commandline parsing |
|---|
| 121 | | *****************************************************************************/ |
|---|
| 122 | | int VLC_Init( int i_object, int i_argc, const char *ppsz_argv[] ) |
|---|
| 123 | | { |
|---|
| 124 | | int i_ret; |
|---|
| 125 | | LIBVLC_FUNC; |
|---|
| 126 | | i_ret = libvlc_InternalInit( p_libvlc, i_argc, ppsz_argv ); |
|---|
| 127 | | LIBVLC_FUNC_END; |
|---|
| 128 | | return i_ret; |
|---|
| 129 | | } |
|---|
| 130 | | |
|---|
| 131 | | /***************************************************************************** |
|---|
| 132 | | * VLC_AddIntf: add an interface |
|---|
| 133 | | ***************************************************************************** |
|---|
| 134 | | * This function opens an interface plugin and runs it. If b_block is set |
|---|
| 135 | | * to 0, VLC_AddIntf will return immediately and let the interface run in a |
|---|
| 136 | | * separate thread. If b_block is set to 1, VLC_AddIntf will continue until |
|---|
| 137 | | * user requests to quit. If b_play is set to 1, VLC_AddIntf will start playing |
|---|
| 138 | | * the playlist when it is completely initialised. |
|---|
| 139 | | *****************************************************************************/ |
|---|
| 140 | | int VLC_AddIntf( int i_object, char const *psz_module, |
|---|
| 141 | | bool b_block, bool b_play ) |
|---|
| 142 | | { |
|---|
| 143 | | int i_ret; |
|---|
| 144 | | LIBVLC_FUNC; |
|---|
| 145 | | i_ret = libvlc_InternalAddIntf( p_libvlc, psz_module, b_block, b_play, |
|---|
| 146 | | 0, NULL ); |
|---|
| 147 | | LIBVLC_FUNC_END; |
|---|
| 148 | | return i_ret; |
|---|
| 149 | | } |
|---|
| 150 | | |
|---|
| 151 | | |
|---|
| 152 | | /***************************************************************************** |
|---|
| 153 | | * VLC_Die: ask vlc to die. |
|---|
| 154 | | ***************************************************************************** |
|---|
| 155 | | * This function sets p_libvlc->b_die to true, but does not do any other |
|---|
| 156 | | * task. It is your duty to call VLC_CleanUp and VLC_Destroy afterwards. |
|---|
| 157 | | *****************************************************************************/ |
|---|
| 158 | | int VLC_Die( int i_object ) |
|---|
| 159 | | { |
|---|
| 160 | | LIBVLC_FUNC; |
|---|
| 161 | | vlc_object_kill( p_libvlc ); |
|---|
| 162 | | LIBVLC_FUNC_END; |
|---|
| 163 | | return VLC_SUCCESS; |
|---|
| 164 | | } |
|---|
| 165 | | |
|---|
| 166 | | /***************************************************************************** |
|---|
| 167 | | * VLC_CleanUp: CleanUp all the intf, playlist, vout, aout |
|---|
| 168 | | *****************************************************************************/ |
|---|
| 169 | | int VLC_CleanUp( int i_object ) |
|---|
| 170 | | { |
|---|
| 171 | | int i_ret; |
|---|
| 172 | | LIBVLC_FUNC; |
|---|
| 173 | | i_ret = libvlc_InternalCleanup( p_libvlc ); |
|---|
| 174 | | LIBVLC_FUNC_END; |
|---|
| 175 | | return i_ret; |
|---|
| 176 | | } |
|---|
| 177 | | |
|---|
| 178 | | /***************************************************************************** |
|---|
| 179 | | * VLC_Destroy: Destroy everything. |
|---|
| 180 | | ***************************************************************************** |
|---|
| 181 | | * This function requests the running threads to finish, waits for their |
|---|
| 182 | | * termination, and destroys their structure. |
|---|
| 183 | | *****************************************************************************/ |
|---|
| 184 | | int VLC_Destroy( int i_object ) |
|---|
| 185 | | { |
|---|
| 186 | | LIBVLC_FUNC; |
|---|
| 187 | | return libvlc_InternalDestroy( p_libvlc, i_object ? true : false ); |
|---|
| 188 | | } |
|---|