VLC  4.0.0-dev
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  *
6  * Author: Gildas Bazin <gbazin@videolan.org>
7  *
8  * This program is free software; you can redistribute it and/or modify it
9  * under the terms of the GNU Lesser General Public License as published by
10  * the Free Software Foundation; either version 2.1 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this program; if not, write to the Free Software Foundation,
20  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
21  *****************************************************************************/
22 
23 #ifndef VLC_VOD_H
24 #define VLC_VOD_H 1
25 
26 /**
27  * \defgroup vod Video on Demand (VoD)
28  * \ingroup server
29  * Video on Demand (VOD) functionality provided by VLM
30  * @{
31  * \file
32  * VLC VoD module interface
33  */
34 
35 struct vod_t
36 {
37  struct vlc_object_t obj;
38 
39  /* Module properties */
41  void *p_sys;
42 
43  vod_media_t * (*pf_media_new) ( vod_t *, const char *, input_item_t * );
44  void (*pf_media_del) ( vod_t *, vod_media_t * );
45 
46  /* Owner properties */
47  int (*pf_media_control) ( void *, vod_media_t *, const char *, int, va_list );
48  void *p_data;
49 };
50 
51 static inline int vod_MediaControl( vod_t *p_vod, vod_media_t *p_media,
52  const char *psz_id, int i_query, ... )
53 {
54  va_list args;
55  int i_result;
56 
57  if( !p_vod->pf_media_control ) return VLC_EGENERIC;
58 
59  va_start( args, i_query );
60  i_result = p_vod->pf_media_control( p_vod->p_data, p_media, psz_id,
61  i_query, args );
62  va_end( args );
63  return i_result;
64 }
65 
66 enum vod_query_e
67 {
68  VOD_MEDIA_PLAY, /* arg1= char *, arg2= int64_t *, res= */
69  VOD_MEDIA_PAUSE, /* arg1= int64_t * res= */
70  VOD_MEDIA_STOP, /* arg1= res=can fail */
71  VOD_MEDIA_SEEK, /* arg1= double res= */
72  VOD_MEDIA_REWIND, /* arg1= double res= */
73  VOD_MEDIA_FORWARD, /* arg1= double res= */
74 };
75 
76 /**
77  * @}
78  */
79 
80 #endif
Definition: vlc_vod.h:36
Definition: vlc_vod.h:72
void(* pf_media_del)(vod_t *, vod_media_t *)
Definition: vlc_vod.h:45
struct vod_media_t vod_media_t
Definition: vlc_common.h:438
Describes an input and is used to spawn input_thread_t objects.
Definition: vlc_input_item.h:77
Definition: vlc_vod.h:73
Internal module descriptor.
Definition: modules.h:75
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_query_e
Definition: vlc_vod.h:67
Definition: vlc_vod.h:71
#define VLC_EGENERIC
Unspecified error.
Definition: vlc_common.h:472
module_t * p_module
Definition: vlc_vod.h:41
void * p_sys
Definition: vlc_vod.h:42
Definition: vlc_vod.h:69
Definition: vlc_vod.h:74
void * p_data
Definition: vlc_vod.h:49
Definition: vlc_vod.h:70
VLC object common members.
Definition: vlc_objects.h:43
int(* pf_media_control)(void *, vod_media_t *, const char *, int, va_list)
Definition: vlc_vod.h:48