vlc_vod.h 2.56 KB
Newer Older
1 2 3
/*****************************************************************************
 * vlc_vod.h: interface for VoD server modules
 *****************************************************************************
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
4
 * Copyright (C) 2000, 2001 VLC authors and VideoLAN
5 6 7 8
 * $Id$
 *
 * Author: Gildas Bazin <gbazin@videolan.org>
 *
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
9 10 11
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or
12 13 14 15
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
16 17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
18
 *
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
19 20 21
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 23
 *****************************************************************************/

24 25
#ifndef VLC_VOD_H
#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 33
 * \file
 * VLC VoD module interface
34 35
 */

36 37 38 39 40 41 42 43
struct vod_t
{
    VLC_COMMON_MEMBERS

    /* Module properties */
    module_t  *p_module;
    vod_sys_t *p_sys;

44
    vod_media_t * (*pf_media_new)   ( vod_t *, const char *, input_item_t * );
45 46
    void          (*pf_media_del)   ( vod_t *, vod_media_t * );

47
    /* Owner properties */
48
    int (*pf_media_control) ( void *, vod_media_t *, const char *, int, va_list );
49 50 51 52
    void *p_data;
};

static inline int vod_MediaControl( vod_t *p_vod, vod_media_t *p_media,
53
                                    const char *psz_id, int i_query, ... )
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
{
    va_list args;
    int i_result;

    if( !p_vod->pf_media_control ) return VLC_EGENERIC;

    va_start( args, i_query );
    i_result = p_vod->pf_media_control( p_vod->p_data, p_media, psz_id,
                                        i_query, args );
    va_end( args );
    return i_result;
}

enum vod_query_e
{
69 70
    VOD_MEDIA_PLAY,         /* arg1= char *, arg2= int64_t *, res=    */
    VOD_MEDIA_PAUSE,        /* arg1= int64_t *      res=    */
71 72 73 74
    VOD_MEDIA_STOP,         /* arg1=                res=can fail    */
    VOD_MEDIA_SEEK,         /* arg1= double         res=    */
    VOD_MEDIA_REWIND,       /* arg1= double         res=    */
    VOD_MEDIA_FORWARD,      /* arg1= double         res=    */
75 76
};

77 78 79
/**
 * @}
 */
80

81
#endif