00001 /***************************************************************************** 00002 * libvlc_vlm.h: libvlc_* new external API 00003 ***************************************************************************** 00004 * Copyright (C) 1998-2008 the VideoLAN team 00005 * $Id: f09dbe506ef2f21b2d894e9086d91e11672bf2b9 $ 00006 * 00007 * Authors: Clément Stenac <zorglub@videolan.org> 00008 * Jean-Paul Saman <jpsaman _at_ m2x _dot_ nl> 00009 * 00010 * This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU General Public License 00021 * along with this program; if not, write to the Free Software 00022 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 00023 *****************************************************************************/ 00024 00025 #ifndef LIBVLC_VLM_H 00026 #define LIBVLC_VLM_H 1 00027 00028 /** 00029 * \file 00030 * This file defines libvlc_vlm_* external API 00031 */ 00032 00033 # ifdef __cplusplus 00034 extern "C" { 00035 # endif 00036 00037 /***************************************************************************** 00038 * VLM 00039 *****************************************************************************/ 00040 /** \defgroup libvlc_vlm LibVLC VLM 00041 * \ingroup libvlc 00042 * @{ 00043 */ 00044 00045 00046 /** 00047 * Release the vlm instance related to the given libvlc_instance_t 00048 * 00049 * \param p_instance the instance 00050 */ 00051 VLC_PUBLIC_API void libvlc_vlm_release( libvlc_instance_t *p_instance ); 00052 00053 /** 00054 * Add a broadcast, with one input. 00055 * 00056 * \param p_instance the instance 00057 * \param psz_name the name of the new broadcast 00058 * \param psz_input the input MRL 00059 * \param psz_output the output MRL (the parameter to the "sout" variable) 00060 * \param i_options number of additional options 00061 * \param ppsz_options additional options 00062 * \param b_enabled boolean for enabling the new broadcast 00063 * \param b_loop Should this broadcast be played in loop ? 00064 * \return 0 on success, -1 on error 00065 */ 00066 VLC_PUBLIC_API int libvlc_vlm_add_broadcast( libvlc_instance_t *p_instance, 00067 const char *psz_name, const char *psz_input, 00068 const char *psz_output, int i_options, 00069 const char * const* ppsz_options, 00070 int b_enabled, int b_loop ); 00071 00072 /** 00073 * Add a vod, with one input. 00074 * 00075 * \param p_instance the instance 00076 * \param psz_name the name of the new vod media 00077 * \param psz_input the input MRL 00078 * \param i_options number of additional options 00079 * \param ppsz_options additional options 00080 * \param b_enabled boolean for enabling the new vod 00081 * \param psz_mux the muxer of the vod media 00082 * \return 0 on success, -1 on error 00083 */ 00084 VLC_PUBLIC_API int libvlc_vlm_add_vod( libvlc_instance_t * p_instance, 00085 const char *psz_name, const char *psz_input, 00086 int i_options, const char * const* ppsz_options, 00087 int b_enabled, const char *psz_mux ); 00088 00089 /** 00090 * Delete a media (VOD or broadcast). 00091 * 00092 * \param p_instance the instance 00093 * \param psz_name the media to delete 00094 * \return 0 on success, -1 on error 00095 */ 00096 VLC_PUBLIC_API int libvlc_vlm_del_media( libvlc_instance_t * p_instance, 00097 const char *psz_name ); 00098 00099 /** 00100 * Enable or disable a media (VOD or broadcast). 00101 * 00102 * \param p_instance the instance 00103 * \param psz_name the media to work on 00104 * \param b_enabled the new status 00105 * \return 0 on success, -1 on error 00106 */ 00107 VLC_PUBLIC_API int libvlc_vlm_set_enabled( libvlc_instance_t *p_instance, 00108 const char *psz_name, int b_enabled ); 00109 00110 /** 00111 * Set the output for a media. 00112 * 00113 * \param p_instance the instance 00114 * \param psz_name the media to work on 00115 * \param psz_output the output MRL (the parameter to the "sout" variable) 00116 * \return 0 on success, -1 on error 00117 */ 00118 VLC_PUBLIC_API int libvlc_vlm_set_output( libvlc_instance_t *p_instance, 00119 const char *psz_name, 00120 const char *psz_output ); 00121 00122 /** 00123 * Set a media's input MRL. This will delete all existing inputs and 00124 * add the specified one. 00125 * 00126 * \param p_instance the instance 00127 * \param psz_name the media to work on 00128 * \param psz_input the input MRL 00129 * \return 0 on success, -1 on error 00130 */ 00131 VLC_PUBLIC_API int libvlc_vlm_set_input( libvlc_instance_t *p_instance, 00132 const char *psz_name, 00133 const char *psz_input ); 00134 00135 /** 00136 * Add a media's input MRL. This will add the specified one. 00137 * 00138 * \param p_instance the instance 00139 * \param psz_name the media to work on 00140 * \param psz_input the input MRL 00141 * \return 0 on success, -1 on error 00142 */ 00143 VLC_PUBLIC_API int libvlc_vlm_add_input( libvlc_instance_t *p_instance, 00144 const char *psz_name, 00145 const char *psz_input ); 00146 00147 /** 00148 * Set a media's loop status. 00149 * 00150 * \param p_instance the instance 00151 * \param psz_name the media to work on 00152 * \param b_loop the new status 00153 * \return 0 on success, -1 on error 00154 */ 00155 VLC_PUBLIC_API int libvlc_vlm_set_loop( libvlc_instance_t *p_instance, 00156 const char *psz_name, 00157 int b_loop ); 00158 00159 /** 00160 * Set a media's vod muxer. 00161 * 00162 * \param p_instance the instance 00163 * \param psz_name the media to work on 00164 * \param psz_mux the new muxer 00165 * \return 0 on success, -1 on error 00166 */ 00167 VLC_PUBLIC_API int libvlc_vlm_set_mux( libvlc_instance_t *p_instance, 00168 const char *psz_name, 00169 const char *psz_mux ); 00170 00171 /** 00172 * Edit the parameters of a media. This will delete all existing inputs and 00173 * add the specified one. 00174 * 00175 * \param p_instance the instance 00176 * \param psz_name the name of the new broadcast 00177 * \param psz_input the input MRL 00178 * \param psz_output the output MRL (the parameter to the "sout" variable) 00179 * \param i_options number of additional options 00180 * \param ppsz_options additional options 00181 * \param b_enabled boolean for enabling the new broadcast 00182 * \param b_loop Should this broadcast be played in loop ? 00183 * \return 0 on success, -1 on error 00184 */ 00185 VLC_PUBLIC_API int libvlc_vlm_change_media( libvlc_instance_t *p_instance, 00186 const char *psz_name, const char *psz_input, 00187 const char *psz_output, int i_options, 00188 const char * const *ppsz_options, 00189 int b_enabled, int b_loop ); 00190 00191 /** 00192 * Play the named broadcast. 00193 * 00194 * \param p_instance the instance 00195 * \param psz_name the name of the broadcast 00196 * \return 0 on success, -1 on error 00197 */ 00198 VLC_PUBLIC_API int libvlc_vlm_play_media ( libvlc_instance_t *p_instance, 00199 const char *psz_name ); 00200 00201 /** 00202 * Stop the named broadcast. 00203 * 00204 * \param p_instance the instance 00205 * \param psz_name the name of the broadcast 00206 * \return 0 on success, -1 on error 00207 */ 00208 VLC_PUBLIC_API int libvlc_vlm_stop_media ( libvlc_instance_t *p_instance, 00209 const char *psz_name ); 00210 00211 /** 00212 * Pause the named broadcast. 00213 * 00214 * \param p_instance the instance 00215 * \param psz_name the name of the broadcast 00216 * \return 0 on success, -1 on error 00217 */ 00218 VLC_PUBLIC_API int libvlc_vlm_pause_media( libvlc_instance_t *p_instance, 00219 const char *psz_name ); 00220 00221 /** 00222 * Seek in the named broadcast. 00223 * 00224 * \param p_instance the instance 00225 * \param psz_name the name of the broadcast 00226 * \param f_percentage the percentage to seek to 00227 * \return 0 on success, -1 on error 00228 */ 00229 VLC_PUBLIC_API int libvlc_vlm_seek_media( libvlc_instance_t *p_instance, 00230 const char *psz_name, 00231 float f_percentage ); 00232 00233 /** 00234 * Return information about the named media as a JSON 00235 * string representation. 00236 * 00237 * This function is mainly intended for debugging use, 00238 * if you want programmatic access to the state of 00239 * a vlm_media_instance_t, please use the corresponding 00240 * libvlc_vlm_get_media_instance_xxx -functions. 00241 * Currently there are no such functions available for 00242 * vlm_media_t though. 00243 * 00244 * \param p_instance the instance 00245 * \param psz_name the name of the media, 00246 * if the name is an empty string, all media is described 00247 * \return string with information about named media, or NULL on error 00248 */ 00249 VLC_PUBLIC_API const char* libvlc_vlm_show_media( libvlc_instance_t *p_instance, 00250 const char *psz_name ); 00251 00252 /** 00253 * Get vlm_media instance position by name or instance id 00254 * 00255 * \param p_instance a libvlc instance 00256 * \param psz_name name of vlm media instance 00257 * \param i_instance instance id 00258 * \return position as float or -1. on error 00259 */ 00260 VLC_PUBLIC_API float libvlc_vlm_get_media_instance_position( libvlc_instance_t *p_instance, 00261 const char *psz_name, 00262 int i_instance ); 00263 00264 /** 00265 * Get vlm_media instance time by name or instance id 00266 * 00267 * \param p_instance a libvlc instance 00268 * \param psz_name name of vlm media instance 00269 * \param i_instance instance id 00270 * \return time as integer or -1 on error 00271 */ 00272 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_time( libvlc_instance_t *p_instance, 00273 const char *psz_name, 00274 int i_instance ); 00275 00276 /** 00277 * Get vlm_media instance length by name or instance id 00278 * 00279 * \param p_instance a libvlc instance 00280 * \param psz_name name of vlm media instance 00281 * \param i_instance instance id 00282 * \return length of media item or -1 on error 00283 */ 00284 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_length( libvlc_instance_t *p_instance, 00285 const char *psz_name, 00286 int i_instance ); 00287 00288 /** 00289 * Get vlm_media instance playback rate by name or instance id 00290 * 00291 * \param p_instance a libvlc instance 00292 * \param psz_name name of vlm media instance 00293 * \param i_instance instance id 00294 * \return playback rate or -1 on error 00295 */ 00296 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_rate( libvlc_instance_t *p_instance, 00297 const char *psz_name, 00298 int i_instance ); 00299 #if 0 00300 /** 00301 * Get vlm_media instance title number by name or instance id 00302 * \bug will always return 0 00303 * \param p_instance a libvlc instance 00304 * \param psz_name name of vlm media instance 00305 * \param i_instance instance id 00306 * \return title as number or -1 on error 00307 */ 00308 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_title( libvlc_instance_t *, 00309 const char *, int ); 00310 00311 /** 00312 * Get vlm_media instance chapter number by name or instance id 00313 * \bug will always return 0 00314 * \param p_instance a libvlc instance 00315 * \param psz_name name of vlm media instance 00316 * \param i_instance instance id 00317 * \return chapter as number or -1 on error 00318 */ 00319 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_chapter( libvlc_instance_t *, 00320 const char *, int ); 00321 00322 /** 00323 * Is libvlc instance seekable ? 00324 * \bug will always return 0 00325 * \param p_instance a libvlc instance 00326 * \param psz_name name of vlm media instance 00327 * \param i_instance instance id 00328 * \return 1 if seekable, 0 if not, -1 if media does not exist 00329 */ 00330 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_seekable( libvlc_instance_t *, 00331 const char *, int ); 00332 #endif 00333 /** 00334 * Get libvlc_event_manager from a vlm media. 00335 * The p_event_manager is immutable, so you don't have to hold the lock 00336 * 00337 * \param p_instance a libvlc instance 00338 * \return libvlc_event_manager 00339 */ 00340 VLC_PUBLIC_API libvlc_event_manager_t * 00341 libvlc_vlm_get_event_manager( libvlc_instance_t *p_instance ); 00342 00343 /** @} */ 00344 00345 # ifdef __cplusplus 00346 } 00347 # endif 00348 00349 #endif /* <vlc/libvlc_vlm.h> */
1.5.6