vlc_vod.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * vlc_vod.h: interface for VoD server modules
00003  *****************************************************************************
00004  * Copyright (C) 2000, 2001 VLC authors and VideoLAN
00005  * $Id: 2f094338a9ca3ea9e8236863bda9f549abe53687 $
00006  *
00007  * Author: Gildas Bazin <gbazin@videolan.org>
00008  *
00009  * This program is free software; you can redistribute it and/or modify it
00010  * under the terms of the GNU Lesser General Public License as published by
00011  * the Free Software Foundation; either version 2.1 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00017  * GNU Lesser General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU Lesser General Public License
00020  * along with this program; if not, write to the Free Software Foundation,
00021  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00022  *****************************************************************************/
00023 
00024 #ifndef VLC_VOD_H
00025 #define VLC_VOD_H 1
00026 
00027 /**
00028  * \file
00029  * This file defines an interface for VOD server modules in vlc
00030  */
00031 
00032 /**
00033  * \defgroup vod Video On Demand (VOD)
00034  * \ingroup server
00035  * Video On Demand (VOD) functionality is provided from VLM.
00036  * @{
00037  */
00038 
00039 struct vod_t
00040 {
00041     VLC_COMMON_MEMBERS
00042 
00043     /* Module properties */
00044     module_t  *p_module;
00045     vod_sys_t *p_sys;
00046 
00047     vod_media_t * (*pf_media_new)   ( vod_t *, const char *, input_item_t * );
00048     void          (*pf_media_del)   ( vod_t *, vod_media_t * );
00049 
00050     /* Owner properties */
00051     int (*pf_media_control) ( void *, vod_media_t *, const char *, int, va_list );
00052     void *p_data;
00053 };
00054 
00055 static inline int vod_MediaControl( vod_t *p_vod, vod_media_t *p_media,
00056                                     const char *psz_id, int i_query, ... )
00057 {
00058     va_list args;
00059     int i_result;
00060 
00061     if( !p_vod->pf_media_control ) return VLC_EGENERIC;
00062 
00063     va_start( args, i_query );
00064     i_result = p_vod->pf_media_control( p_vod->p_data, p_media, psz_id,
00065                                         i_query, args );
00066     va_end( args );
00067     return i_result;
00068 }
00069 
00070 enum vod_query_e
00071 {
00072     VOD_MEDIA_PLAY,         /* arg1= char *, arg2= int64_t *, res=    */
00073     VOD_MEDIA_PAUSE,        /* arg1= int64_t *      res=    */
00074     VOD_MEDIA_STOP,         /* arg1=                res=can fail    */
00075     VOD_MEDIA_SEEK,         /* arg1= double         res=    */
00076     VOD_MEDIA_REWIND,       /* arg1= double         res=    */
00077     VOD_MEDIA_FORWARD,      /* arg1= double         res=    */
00078 };
00079 
00080 /**
00081  * @}
00082  */
00083 
00084 #endif
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines