X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=include%2Fvlc%2Flibvlc_vlm.h;h=f09dbe506ef2f21b2d894e9086d91e11672bf2b9;hb=fd3ef9055df9088e6c1fd544a9d26a71f465d0cb;hp=6f09f04daee60565165f3ff12188ee17b1fc9a78;hpb=e0105d9b23a08eeedf89b869628644e38df4e8dd;p=vlc diff --git a/include/vlc/libvlc_vlm.h b/include/vlc/libvlc_vlm.h index 6f09f04dae..f09dbe506e 100644 --- a/include/vlc/libvlc_vlm.h +++ b/include/vlc/libvlc_vlm.h @@ -1,7 +1,7 @@ /***************************************************************************** * libvlc_vlm.h: libvlc_* new external API ***************************************************************************** - * Copyright (C) 1998-2005 the VideoLAN team + * Copyright (C) 1998-2008 the VideoLAN team * $Id$ * * Authors: Clément Stenac @@ -22,8 +22,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ -#ifndef _LIBVLC_VLM_H -#define _LIBVLC_VLM_H 1 +#ifndef LIBVLC_VLM_H +#define LIBVLC_VLM_H 1 + +/** + * \file + * This file defines libvlc_vlm_* external API + */ # ifdef __cplusplus extern "C" { @@ -32,12 +37,19 @@ extern "C" { /***************************************************************************** * VLM *****************************************************************************/ -/** \defgroup libvlc_vlm VLM +/** \defgroup libvlc_vlm LibVLC VLM * \ingroup libvlc - * LibVLC VLM * @{ */ + +/** + * Release the vlm instance related to the given libvlc_instance_t + * + * \param p_instance the instance + */ +VLC_PUBLIC_API void libvlc_vlm_release( libvlc_instance_t *p_instance ); + /** * Add a broadcast, with one input. * @@ -49,19 +61,40 @@ extern "C" { * \param ppsz_options additional options * \param b_enabled boolean for enabling the new broadcast * \param b_loop Should this broadcast be played in loop ? - * \param p_e an initialized exception pointer + * \return 0 on success, -1 on error */ -VLC_PUBLIC_API void libvlc_vlm_add_broadcast( libvlc_instance_t *, char *, char *, char* , - int, char **, int, int, libvlc_exception_t * ); +VLC_PUBLIC_API int libvlc_vlm_add_broadcast( libvlc_instance_t *p_instance, + const char *psz_name, const char *psz_input, + const char *psz_output, int i_options, + const char * const* ppsz_options, + int b_enabled, int b_loop ); + +/** + * Add a vod, with one input. + * + * \param p_instance the instance + * \param psz_name the name of the new vod media + * \param psz_input the input MRL + * \param i_options number of additional options + * \param ppsz_options additional options + * \param b_enabled boolean for enabling the new vod + * \param psz_mux the muxer of the vod media + * \return 0 on success, -1 on error + */ +VLC_PUBLIC_API int libvlc_vlm_add_vod( libvlc_instance_t * p_instance, + const char *psz_name, const char *psz_input, + int i_options, const char * const* ppsz_options, + int b_enabled, const char *psz_mux ); /** * Delete a media (VOD or broadcast). * * \param p_instance the instance * \param psz_name the media to delete - * \param p_e an initialized exception pointer + * \return 0 on success, -1 on error */ -VLC_PUBLIC_API void libvlc_vlm_del_media( libvlc_instance_t *, char *, libvlc_exception_t * ); +VLC_PUBLIC_API int libvlc_vlm_del_media( libvlc_instance_t * p_instance, + const char *psz_name ); /** * Enable or disable a media (VOD or broadcast). @@ -69,10 +102,10 @@ VLC_PUBLIC_API void libvlc_vlm_del_media( libvlc_instance_t *, char *, libvlc_ex * \param p_instance the instance * \param psz_name the media to work on * \param b_enabled the new status - * \param p_e an initialized exception pointer + * \return 0 on success, -1 on error */ -VLC_PUBLIC_API void libvlc_vlm_set_enabled( libvlc_instance_t *, char *, int, - libvlc_exception_t *); +VLC_PUBLIC_API int libvlc_vlm_set_enabled( libvlc_instance_t *p_instance, + const char *psz_name, int b_enabled ); /** * Set the output for a media. @@ -80,10 +113,11 @@ VLC_PUBLIC_API void libvlc_vlm_set_enabled( libvlc_instance_t *, char *, int, * \param p_instance the instance * \param psz_name the media to work on * \param psz_output the output MRL (the parameter to the "sout" variable) - * \param p_e an initialized exception pointer + * \return 0 on success, -1 on error */ -VLC_PUBLIC_API void libvlc_vlm_set_output( libvlc_instance_t *, char *, char*, - libvlc_exception_t *); +VLC_PUBLIC_API int libvlc_vlm_set_output( libvlc_instance_t *p_instance, + const char *psz_name, + const char *psz_output ); /** * Set a media's input MRL. This will delete all existing inputs and @@ -92,10 +126,11 @@ VLC_PUBLIC_API void libvlc_vlm_set_output( libvlc_instance_t *, char *, char*, * \param p_instance the instance * \param psz_name the media to work on * \param psz_input the input MRL - * \param p_e an initialized exception pointer + * \return 0 on success, -1 on error */ -VLC_PUBLIC_API void libvlc_vlm_set_input( libvlc_instance_t *, char *, char*, - libvlc_exception_t *); +VLC_PUBLIC_API int libvlc_vlm_set_input( libvlc_instance_t *p_instance, + const char *psz_name, + const char *psz_input ); /** * Add a media's input MRL. This will add the specified one. @@ -103,20 +138,35 @@ VLC_PUBLIC_API void libvlc_vlm_set_input( libvlc_instance_t *, char *, char*, * \param p_instance the instance * \param psz_name the media to work on * \param psz_input the input MRL - * \param p_e an initialized exception pointer + * \return 0 on success, -1 on error */ -VLC_PUBLIC_API void libvlc_vlm_add_input( libvlc_instance_t *, char *, char *, - libvlc_exception_t *p_exception ); +VLC_PUBLIC_API int libvlc_vlm_add_input( libvlc_instance_t *p_instance, + const char *psz_name, + const char *psz_input ); + /** * Set a media's loop status. * * \param p_instance the instance * \param psz_name the media to work on * \param b_loop the new status - * \param p_e an initialized exception pointer + * \return 0 on success, -1 on error + */ +VLC_PUBLIC_API int libvlc_vlm_set_loop( libvlc_instance_t *p_instance, + const char *psz_name, + int b_loop ); + +/** + * Set a media's vod muxer. + * + * \param p_instance the instance + * \param psz_name the media to work on + * \param psz_mux the new muxer + * \return 0 on success, -1 on error */ -VLC_PUBLIC_API void libvlc_vlm_set_loop( libvlc_instance_t *, char *, int, - libvlc_exception_t *); +VLC_PUBLIC_API int libvlc_vlm_set_mux( libvlc_instance_t *p_instance, + const char *psz_name, + const char *psz_mux ); /** * Edit the parameters of a media. This will delete all existing inputs and @@ -130,37 +180,43 @@ VLC_PUBLIC_API void libvlc_vlm_set_loop( libvlc_instance_t *, char *, int, * \param ppsz_options additional options * \param b_enabled boolean for enabling the new broadcast * \param b_loop Should this broadcast be played in loop ? - * \param p_e an initialized exception pointer + * \return 0 on success, -1 on error */ -VLC_PUBLIC_API void libvlc_vlm_change_media( libvlc_instance_t *, char *, char *, char* , - int, char **, int, int, libvlc_exception_t * ); +VLC_PUBLIC_API int libvlc_vlm_change_media( libvlc_instance_t *p_instance, + const char *psz_name, const char *psz_input, + const char *psz_output, int i_options, + const char * const *ppsz_options, + int b_enabled, int b_loop ); /** * Play the named broadcast. * * \param p_instance the instance * \param psz_name the name of the broadcast - * \param p_e an initialized exception pointer + * \return 0 on success, -1 on error */ -VLC_PUBLIC_API void libvlc_vlm_play_media ( libvlc_instance_t *, char *, libvlc_exception_t * ); +VLC_PUBLIC_API int libvlc_vlm_play_media ( libvlc_instance_t *p_instance, + const char *psz_name ); /** * Stop the named broadcast. * * \param p_instance the instance * \param psz_name the name of the broadcast - * \param p_e an initialized exception pointer + * \return 0 on success, -1 on error */ -VLC_PUBLIC_API void libvlc_vlm_stop_media ( libvlc_instance_t *, char *, libvlc_exception_t * ); +VLC_PUBLIC_API int libvlc_vlm_stop_media ( libvlc_instance_t *p_instance, + const char *psz_name ); /** * Pause the named broadcast. * * \param p_instance the instance * \param psz_name the name of the broadcast - * \param p_e an initialized exception pointer + * \return 0 on success, -1 on error */ -VLC_PUBLIC_API void libvlc_vlm_pause_media( libvlc_instance_t *, char *, libvlc_exception_t * ); +VLC_PUBLIC_API int libvlc_vlm_pause_media( libvlc_instance_t *p_instance, + const char *psz_name ); /** * Seek in the named broadcast. @@ -168,33 +224,121 @@ VLC_PUBLIC_API void libvlc_vlm_pause_media( libvlc_instance_t *, char *, libvlc_ * \param p_instance the instance * \param psz_name the name of the broadcast * \param f_percentage the percentage to seek to - * \param p_e an initialized exception pointer + * \return 0 on success, -1 on error */ -VLC_PUBLIC_API void libvlc_vlm_seek_media( libvlc_instance_t *, char *, - float, libvlc_exception_t * ); +VLC_PUBLIC_API int libvlc_vlm_seek_media( libvlc_instance_t *p_instance, + const char *psz_name, + float f_percentage ); /** - * Return information about the named broadcast. + * Return information about the named media as a JSON + * string representation. + * + * This function is mainly intended for debugging use, + * if you want programmatic access to the state of + * a vlm_media_instance_t, please use the corresponding + * libvlc_vlm_get_media_instance_xxx -functions. + * Currently there are no such functions available for + * vlm_media_t though. * * \param p_instance the instance - * \param psz_name the name of the broadcast - * \param p_e an initialized exception pointer + * \param psz_name the name of the media, + * if the name is an empty string, all media is described + * \return string with information about named media, or NULL on error */ -VLC_PUBLIC_API char* libvlc_vlm_show_media( libvlc_instance_t *, char *, libvlc_exception_t * ); +VLC_PUBLIC_API const char* libvlc_vlm_show_media( libvlc_instance_t *p_instance, + const char *psz_name ); -#define LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( attr, returnType, getType, default)\ -returnType libvlc_vlm_get_media_## attr( libvlc_instance_t *, \ - char *, int , libvlc_exception_t * ); +/** + * Get vlm_media instance position by name or instance id + * + * \param p_instance a libvlc instance + * \param psz_name name of vlm media instance + * \param i_instance instance id + * \return position as float or -1. on error + */ +VLC_PUBLIC_API float libvlc_vlm_get_media_instance_position( libvlc_instance_t *p_instance, + const char *psz_name, + int i_instance ); -VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( position, float, Float, -1); -VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( time, int, Integer, -1); -VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( length, int, Integer, -1); -VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( rate, int, Integer, -1); -VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( title, int, Integer, 0); -VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( chapter, int, Integer, 0); -VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( seekable, int, Bool, 0); +/** + * Get vlm_media instance time by name or instance id + * + * \param p_instance a libvlc instance + * \param psz_name name of vlm media instance + * \param i_instance instance id + * \return time as integer or -1 on error + */ +VLC_PUBLIC_API int libvlc_vlm_get_media_instance_time( libvlc_instance_t *p_instance, + const char *psz_name, + int i_instance ); -#undef LIBVLC_VLM_GET_MEDIA_ATTRIBUTE +/** + * Get vlm_media instance length by name or instance id + * + * \param p_instance a libvlc instance + * \param psz_name name of vlm media instance + * \param i_instance instance id + * \return length of media item or -1 on error + */ +VLC_PUBLIC_API int libvlc_vlm_get_media_instance_length( libvlc_instance_t *p_instance, + const char *psz_name, + int i_instance ); + +/** + * Get vlm_media instance playback rate by name or instance id + * + * \param p_instance a libvlc instance + * \param psz_name name of vlm media instance + * \param i_instance instance id + * \return playback rate or -1 on error + */ +VLC_PUBLIC_API int libvlc_vlm_get_media_instance_rate( libvlc_instance_t *p_instance, + const char *psz_name, + int i_instance ); +#if 0 +/** + * Get vlm_media instance title number by name or instance id + * \bug will always return 0 + * \param p_instance a libvlc instance + * \param psz_name name of vlm media instance + * \param i_instance instance id + * \return title as number or -1 on error + */ +VLC_PUBLIC_API int libvlc_vlm_get_media_instance_title( libvlc_instance_t *, + const char *, int ); + +/** + * Get vlm_media instance chapter number by name or instance id + * \bug will always return 0 + * \param p_instance a libvlc instance + * \param psz_name name of vlm media instance + * \param i_instance instance id + * \return chapter as number or -1 on error + */ +VLC_PUBLIC_API int libvlc_vlm_get_media_instance_chapter( libvlc_instance_t *, + const char *, int ); + +/** + * Is libvlc instance seekable ? + * \bug will always return 0 + * \param p_instance a libvlc instance + * \param psz_name name of vlm media instance + * \param i_instance instance id + * \return 1 if seekable, 0 if not, -1 if media does not exist + */ +VLC_PUBLIC_API int libvlc_vlm_get_media_instance_seekable( libvlc_instance_t *, + const char *, int ); +#endif +/** + * Get libvlc_event_manager from a vlm media. + * The p_event_manager is immutable, so you don't have to hold the lock + * + * \param p_instance a libvlc instance + * \return libvlc_event_manager + */ +VLC_PUBLIC_API libvlc_event_manager_t * + libvlc_vlm_get_event_manager( libvlc_instance_t *p_instance ); /** @} */ @@ -202,4 +346,4 @@ VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( seekable, int, Bool, 0); } # endif -#endif /* */ +#endif /* */