]> git.sesse.net Git - vlc/blob - src/input/vlm_internal.h
Start cleaning up VLM + fixed vlm_New() race condition.
[vlc] / src / input / vlm_internal.h
1 /*****************************************************************************
2  * vlm_internal.h: Internal vlm structures
3  *****************************************************************************
4  * Copyright (C) 1998-2006 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
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 #ifndef _VLM_INTERNAL_H
25 #define _VLM_INTERNAL_H 1
26
27 #include <vlc_vlm.h>
28
29
30 enum
31 {
32         VOD_TYPE = 0,
33         BROADCAST_TYPE,
34         SCHEDULE_TYPE,
35 };
36
37 typedef struct
38 {
39     /* instance name */
40     char *psz_name;
41
42     /* "playlist" index */
43     int i_index;
44
45     input_item_t   item;
46     input_thread_t *p_input;
47
48 } vlm_media_instance_t;
49
50 struct vlm_media_t
51 {
52     vlc_bool_t b_enabled;
53     int      i_type;
54
55     /* name "media" is reserved */
56     char    *psz_name;
57     input_item_t item;
58
59     /* "playlist" */
60     int     i_input;
61     char    **input;
62
63     int     i_option;
64     char    **option;
65
66     char    *psz_output;
67
68     /* only for broadcast */
69     vlc_bool_t b_loop;
70
71     /* only for vod */
72     vod_media_t *vod_media;
73     char *psz_vod_output;
74     char *psz_mux;
75
76     /* actual input instances */
77     int                  i_instance;
78     vlm_media_instance_t **instance;
79 };
80
81 struct vlm_schedule_t
82 {
83     /* names "schedule" is reserved */
84     char    *psz_name;
85     vlc_bool_t b_enabled;
86     /* list of commands to execute on date */
87     int i_command;
88     char **command;
89
90     /* the date of 1st execution */
91     mtime_t i_date;
92
93     /* if != 0 repeat schedule every (period) */
94     mtime_t i_period;
95     /* number of times you have to repeat
96        i_repeat < 0 : endless repeat     */
97     int i_repeat;
98 };
99
100
101 struct vlm_t
102 {
103     VLC_COMMON_MEMBERS
104
105     vlc_mutex_t lock;
106
107     int            i_media;
108     vlm_media_t    **media;
109
110     int            i_vod;
111     vod_t          *vod;
112
113     int            i_schedule;
114     vlm_schedule_t **schedule;
115 };
116
117 vlm_media_t *vlm_MediaNew( vlm_t *, const char *, int );
118 void             vlm_MediaDelete( vlm_t *, vlm_media_t *, const char * );
119 int                      vlm_MediaSetup( vlm_t *, vlm_media_t *, const char *, const char * );
120 int                      vlm_MediaControl( vlm_t *, vlm_media_t *, const char *, const char *, const char * );
121 vlm_media_t *vlm_MediaSearch( vlm_t *, const char *);
122
123 #endif