VLC  3.0.15
vlm_internal.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * vlm_internal.h: Internal vlm structures
3  *****************************************************************************
4  * Copyright (C) 1998-2006 VLC authors and VideoLAN
5  * $Id: 8c2a25b0b06255d7e746cd1ade47ae819921ca2c $
6  *
7  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
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 LIBVLC_VLM_INTERNAL_H
25 #define LIBVLC_VLM_INTERNAL_H 1
26 
27 #include <vlc_vlm.h>
28 #include "input_interface.h"
29 
30 /* Private */
31 typedef struct
32 {
33  /* instance name */
34  char *psz_name;
35 
36  /* "playlist" index */
37  int i_index;
38 
39  bool b_sout_keep;
40 
41  vlc_object_t *p_parent;
42  input_item_t *p_item;
43  input_thread_t *p_input;
44  input_resource_t *p_input_resource;
45 
47 
48 
49 typedef struct
50 {
51  vlm_media_t cfg;
52 
53  struct
54  {
55  input_item_t *p_item;
56  vod_media_t *p_media;
57  } vod;
58 
59  /* actual input instances */
60  int i_instance;
63 
64 typedef struct
65 {
66  /* names "schedule" is reserved */
67  char *psz_name;
68  bool b_enabled;
69  /* list of commands to execute on date */
70  int i_command;
71  char **command;
72 
73  /* the date of 1st execution */
74  time_t date;
75 
76  /* if != 0, repeat period in seconds */
77  unsigned period;
78  /* number of times you have to repeat
79  i_repeat < 0 : endless repeat */
80  int i_repeat;
82 
83 
84 struct vlm_t
85 {
87 
89 
90  /* a separate mutex is needed: "lock" must remain locked while waiting */
93 
97  unsigned users;
98 
99  /* tell vlm thread there is work to do */
100  bool input_state_changed;
101  /* */
102  int64_t i_id;
103 
104  /* Vod server (used by media) */
105  vod_t *p_vod;
106 
107  /* Media list */
108  int i_media;
110 
111  /* Schedule list */
114 
115  unsigned i_consecutive_errors;
116 };
117 
118 int vlm_ControlInternal( vlm_t *p_vlm, int i_query, ... );
119 int ExecuteCommand( vlm_t *, const char *, vlm_message_t ** );
120 void vlm_ScheduleDelete( vlm_t *vlm, vlm_schedule_sys_t *sched );
121 
122 #endif
vlm_t::wait_delete
vlc_cond_t wait_delete
Definition: vlm_internal.h:91
vlm_media_instance_sys_t
Definition: vlm_internal.h:30
VLC_COMMON_MEMBERS
#define VLC_COMMON_MEMBERS
Backward compatibility macro.
Definition: vlc_common.h:453
vlm_t::i_media
int i_media
Definition: vlm_internal.h:107
vlm_t::lock_delete
vlc_mutex_t lock_delete
Definition: vlm_internal.h:90
vlm_t::i_consecutive_errors
unsigned i_consecutive_errors
Definition: vlm_internal.h:114
vlc_vlm.h
vlm_schedule_sys_t
Definition: vlm_internal.h:63
input_item_t
Describes an input and is used to spawn input_thread_t objects.
Definition: vlc_input_item.h:58
vlc_cond_t
pthread_cond_t vlc_cond_t
Condition variable.
Definition: vlc_threads.h:279
vlm_t::users
unsigned users
Definition: vlm_internal.h:96
vlm_t::schedule
vlm_schedule_sys_t ** schedule
Definition: vlm_internal.h:112
vlm_t::input_state_changed
bool input_state_changed
Definition: vlm_internal.h:99
vlm_media_t
VLM media.
Definition: vlc_vlm.h:43
vlm_t::p_vod
vod_t * p_vod
Definition: vlm_internal.h:104
vlm_t
Definition: vlm_internal.h:83
psz_name
const char * psz_name
Definition: vlc_codecs.h:315
vlc_thread_t
Thread handle.
Definition: vlc_threads.h:252
vlm_t::media
vlm_media_sys_t ** media
Definition: vlm_internal.h:108
vlc_object_t
The main vlc_object_t structure.
Definition: vlc_objects.h:39
vlm_t::i_schedule
int i_schedule
Definition: vlm_internal.h:111
vlm_t::thread
vlc_thread_t thread
Definition: vlm_internal.h:93
vlc_mutex_t
pthread_mutex_t vlc_mutex_t
Mutex.
Definition: vlc_threads.h:267
input_interface.h
ExecuteCommand
int ExecuteCommand(vlm_t *, const char *, vlm_message_t **)
vlm_t::lock_manage
vlc_mutex_t lock_manage
Definition: vlm_internal.h:94
vlm_ControlInternal
int vlm_ControlInternal(vlm_t *p_vlm, int i_query,...)
Definition: vlm.c:1309
vlm_t::wait_manage
vlc_cond_t wait_manage
Definition: vlm_internal.h:95
vlm_media_sys_t
Definition: vlm_internal.h:48
vlm_ScheduleDelete
void vlm_ScheduleDelete(vlm_t *vlm, vlm_schedule_sys_t *sched)
vlm_t::i_id
int64_t i_id
Definition: vlm_internal.h:101
vlm_message_t
Definition: vlc_vlm.h:172
vod_media_t
struct vod_media_t vod_media_t
Definition: vlc_common.h:308
vod_t
Definition: vlc_vod.h:36
vlm_t::lock
vlc_mutex_t lock
Definition: vlm_internal.h:87
input_thread_t
Main structure representing an input thread.
Definition: vlc_input.h:221
input_resource_t
Definition: resource.c:44