VLC  3.0.15
vlc_vod.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * vlc_vod.h: interface for VoD server modules
3  *****************************************************************************
4  * Copyright (C) 2000, 2001 VLC authors and VideoLAN
5  * $Id: 382108acf1a751e28436ee6b9f84c4763a4b5f5c $
6  *
7  * Author: Gildas Bazin <gbazin@videolan.org>
8  *
9  * This program is free software; you can redistribute it and/or modify it
10  * under the terms of the GNU Lesser General Public License as published by
11  * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public License
20  * along with this program; if not, write to the Free Software Foundation,
21  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23 
24 #ifndef VLC_VOD_H
25 #define VLC_VOD_H 1
26 
27 /**
28  * \defgroup vod Video on Demand (VoD)
29  * \ingroup server
30  * Video on Demand (VOD) functionality provided by VLM
31  * @{
32  * \file
33  * VLC VoD module interface
34  */
35 
36 struct vod_t
37 {
39 
40  /* Module properties */
43 
44  vod_media_t * (*pf_media_new) ( vod_t *, const char *, input_item_t * );
45  void (*pf_media_del) ( vod_t *, vod_media_t * );
46 
47  /* Owner properties */
48  int (*pf_media_control) ( void *, vod_media_t *, const char *, int, va_list );
49  void *p_data;
50 };
51 
52 static inline int vod_MediaControl( vod_t *p_vod, vod_media_t *p_media,
53  const char *psz_id, int i_query, ... )
54 {
55  va_list args;
56  int i_result;
57 
58  if( !p_vod->pf_media_control ) return VLC_EGENERIC;
59 
60  va_start( args, i_query );
61  i_result = p_vod->pf_media_control( p_vod->p_data, p_media, psz_id,
62  i_query, args );
63  va_end( args );
64  return i_result;
65 }
66 
68 {
69  VOD_MEDIA_PLAY, /* arg1= char *, arg2= int64_t *, res= */
70  VOD_MEDIA_PAUSE, /* arg1= int64_t * res= */
71  VOD_MEDIA_STOP, /* arg1= res=can fail */
72  VOD_MEDIA_SEEK, /* arg1= double res= */
73  VOD_MEDIA_REWIND, /* arg1= double res= */
74  VOD_MEDIA_FORWARD, /* arg1= double res= */
75 };
76 
77 /**
78  * @}
79  */
80 
81 #endif
VLC_COMMON_MEMBERS
#define VLC_COMMON_MEMBERS
Backward compatibility macro.
Definition: vlc_common.h:453
vod_t::pf_media_control
int(* pf_media_control)(void *, vod_media_t *, const char *, int, va_list)
Definition: vlc_vod.h:48
vlc_common.h
input_item_t
Describes an input and is used to spawn input_thread_t objects.
Definition: vlc_input_item.h:58
VOD_MEDIA_SEEK
Definition: vlc_vod.h:72
vod_t::pf_media_del
void(* pf_media_del)(vod_t *, vod_media_t *)
Definition: vlc_vod.h:45
vod_query_e
vod_query_e
Definition: vlc_vod.h:67
VLC_EGENERIC
#define VLC_EGENERIC
Unspecified error.
Definition: vlc_common.h:350
vod_sys_t
struct vod_sys_t vod_sys_t
Definition: vlc_common.h:307
VOD_MEDIA_FORWARD
Definition: vlc_vod.h:74
vod_t::p_module
module_t * p_module
Definition: vlc_vod.h:41
VOD_MEDIA_STOP
Definition: vlc_vod.h:71
VOD_MEDIA_PLAY
Definition: vlc_vod.h:69
VOD_MEDIA_PAUSE
Definition: vlc_vod.h:70
module_t
Internal module descriptor.
Definition: modules.h:79
vod_t::p_data
void * p_data
Definition: vlc_vod.h:49
VOD_MEDIA_REWIND
Definition: vlc_vod.h:73
vod_t::p_sys
vod_sys_t * p_sys
Definition: vlc_vod.h:42
vod_MediaControl
static int vod_MediaControl(vod_t *p_vod, vod_media_t *p_media, const char *psz_id, int i_query,...)
Definition: vlc_vod.h:52
vod_media_t
struct vod_media_t vod_media_t
Definition: vlc_common.h:308
vod_t
Definition: vlc_vod.h:36