]> git.sesse.net Git - vlc/blob - include/vlc_vod.h
Added missing const qualifier to vod_MediaControl.
[vlc] / include / vlc_vod.h
1 /*****************************************************************************
2  * vlc_vod.h: interface for VoD server modules
3  *****************************************************************************
4  * Copyright (C) 2000, 2001 the VideoLAN team
5  * $Id$
6  *
7  * Author: Gildas Bazin <gbazin@videolan.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 #if !defined( __LIBVLC__ )
25   #error You are not libvlc or one of its plugins. You cannot include this file
26 #endif
27
28 #ifndef _VLC_VOD_H
29 #define _VLC_VOD_H 1
30
31 struct vod_t
32 {
33     VLC_COMMON_MEMBERS
34
35     /* Module properties */
36     module_t  *p_module;
37     vod_sys_t *p_sys;
38
39     vod_media_t * (*pf_media_new)   ( vod_t *, const char *, input_item_t * );
40     void          (*pf_media_del)   ( vod_t *, vod_media_t * );
41     int           (*pf_media_add_es)( vod_t *, vod_media_t *, es_format_t * );
42     void          (*pf_media_del_es)( vod_t *, vod_media_t *, es_format_t * );
43
44     /* Owner properties */
45     int (*pf_media_control) ( void *, vod_media_t *, const char *, int, va_list );
46     void *p_data;
47 };
48
49 static inline int vod_MediaControl( vod_t *p_vod, vod_media_t *p_media,
50                                     const char *psz_id, int i_query, ... )
51 {
52     va_list args;
53     int i_result;
54
55     if( !p_vod->pf_media_control ) return VLC_EGENERIC;
56
57     va_start( args, i_query );
58     i_result = p_vod->pf_media_control( p_vod->p_data, p_media, psz_id,
59                                         i_query, args );
60     va_end( args );
61     return i_result;
62 }
63
64 enum vod_query_e
65 {
66     VOD_MEDIA_PLAY,         /* arg1= char *         res=    */
67     VOD_MEDIA_PAUSE,        /* arg1=                res=    */
68     VOD_MEDIA_STOP,         /* arg1=                res=can fail    */
69     VOD_MEDIA_SEEK,         /* arg1= double         res=    */
70     VOD_MEDIA_REWIND,       /* arg1= double         res=    */
71     VOD_MEDIA_FORWARD,      /* arg1= double         res=    */
72 };
73
74 #endif