1 /*****************************************************************************
2 * modules_export.h: macros for exporting vlc symbols to plugins
3 *****************************************************************************
4 * Copyright (C) 2001 VideoLAN
6 * Authors: Samuel Hocevar <sam@zoy.org>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
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 General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
21 *****************************************************************************/
23 typedef struct module_symbols_s
25 struct main_s* p_main;
26 struct aout_bank_s* p_aout_bank;
27 struct vout_bank_s* p_vout_bank;
29 int ( * main_GetIntVariable ) ( char *, int );
30 char * ( * main_GetPszVariable ) ( char *, char * );
31 void ( * main_PutIntVariable ) ( char *, int );
32 void ( * main_PutPszVariable ) ( char *, char * );
34 int ( * TestProgram ) ( char * );
35 int ( * TestMethod ) ( char *, char * );
36 int ( * TestCPU ) ( int );
38 int ( * intf_ProcessKey ) ( struct intf_thread_s *, int );
39 void ( * intf_AssignKey ) ( struct intf_thread_s *, int, int, int );
41 void ( * intf_Msg ) ( char *, ... );
42 void ( * intf_ErrMsg ) ( char *, ... );
43 void ( * intf_WarnMsg ) ( int, char *, ... );
44 void ( * intf_WarnMsgImm ) ( int, char *, ... );
46 void ( * intf_DbgMsg ) ( char *, char *, int, char *, ... );
47 void ( * intf_DbgMsgImm ) ( char *, char *, int, char *, ... );
50 int ( * intf_PlaylistAdd ) ( struct playlist_s *, int, const char* );
51 int ( * intf_PlaylistDelete ) ( struct playlist_s *, int );
52 void ( * intf_PlaylistNext ) ( struct playlist_s * );
53 void ( * intf_PlaylistPrev ) ( struct playlist_s * );
54 void ( * intf_PlaylistDestroy ) ( struct playlist_s * );
55 void ( * intf_PlaylistJumpto ) ( struct playlist_s *, int );
56 void ( * intf_UrlDecode ) ( char * );
58 void ( * msleep ) ( mtime_t );
59 mtime_t ( * mdate ) ( void );
61 int ( * network_ChannelCreate )( void );
62 int ( * network_ChannelJoin ) ( int );
64 void ( * input_SetStatus ) ( struct input_thread_s *, int );
65 void ( * input_Seek ) ( struct input_thread_s *, off_t );
66 void ( * input_DumpStream ) ( struct input_thread_s * );
67 char * ( * input_OffsetToTime ) ( struct input_thread_s *, char *, off_t );
68 int ( * input_ChangeES ) ( struct input_thread_s *,
69 struct es_descriptor_s *, u8 );
70 int ( * input_ToggleES ) ( struct input_thread_s *,
71 struct es_descriptor_s *, boolean_t );
72 int ( * input_ChangeArea ) ( struct input_thread_s *,
73 struct input_area_s * );
74 struct es_descriptor_s * ( * input_FindES ) ( struct input_thread_s *,
76 struct es_descriptor_s * ( * input_AddES ) ( struct input_thread_s *,
77 struct pgrm_descriptor_s *, u16, size_t );
78 void ( * input_DelES ) ( struct input_thread_s *,
79 struct es_descriptor_s * );
80 int ( * input_SelectES ) ( struct input_thread_s *,
81 struct es_descriptor_s * );
82 int ( * input_UnselectES ) ( struct input_thread_s *,
83 struct es_descriptor_s * );
84 struct pgrm_descriptor_s* ( * input_AddProgram ) ( struct input_thread_s *,
86 void ( * input_DelProgram ) ( struct input_thread_s *,
87 struct pgrm_descriptor_s * );
88 struct input_area_s * ( * input_AddArea ) ( struct input_thread_s * );
89 void ( * input_DelArea ) ( struct input_thread_s *,
90 struct input_area_s * );
92 void ( * InitBitstream ) ( struct bit_stream_s *,
93 struct decoder_fifo_s *,
94 void ( * ) ( struct bit_stream_s *,
97 int ( * input_InitStream ) ( struct input_thread_s *, size_t );
98 void ( * input_EndStream ) ( struct input_thread_s * );
100 void ( * input_ParsePES ) ( struct input_thread_s *,
101 struct es_descriptor_s * );
102 void ( * input_GatherPES ) ( struct input_thread_s *,
103 struct data_packet_s *,
104 struct es_descriptor_s *,
105 boolean_t, boolean_t );
106 void ( * input_DecodePES ) ( struct decoder_fifo_s *,
107 struct pes_packet_s * );
108 struct es_descriptor_s * ( * input_ParsePS ) ( struct input_thread_s *,
109 struct data_packet_s * );
110 void ( * input_DemuxPS ) ( struct input_thread_s *,
111 struct data_packet_s * );
112 void ( * input_DemuxTS ) ( struct input_thread_s *,
113 struct data_packet_s * );
114 void ( * input_DemuxPSI ) ( struct input_thread_s *,
115 struct data_packet_s *,
116 struct es_descriptor_s *,
117 boolean_t, boolean_t );
119 int ( * input_ClockManageControl ) ( struct input_thread_s *,
120 struct pgrm_descriptor_s *,
123 int ( * input_NetlistInit ) ( struct input_thread_s *,
124 int, int, size_t, int );
125 struct iovec * ( * input_NetlistGetiovec ) ( void * p_method_data );
126 void ( * input_NetlistMviovec ) ( void * , size_t,
127 struct data_packet_s **);
128 struct data_packet_s * ( * input_NetlistNewPacket ) ( void *, size_t );
129 struct pes_packet_s * ( * input_NetlistNewPES ) ( void * );
130 void ( * input_NetlistDeletePacket ) ( void *, struct data_packet_s * );
131 void ( * input_NetlistDeletePES ) ( void *, struct pes_packet_s * );
132 void ( * input_NetlistEnd ) ( struct input_thread_s * );
136 #define STORE_SYMBOLS( p_symbols ) \
137 (p_symbols)->p_main = p_main; \
138 (p_symbols)->p_aout_bank = p_aout_bank; \
139 (p_symbols)->p_vout_bank = p_vout_bank; \
140 (p_symbols)->main_GetIntVariable = main_GetIntVariable; \
141 (p_symbols)->main_GetPszVariable = main_GetPszVariable; \
142 (p_symbols)->main_PutIntVariable = main_PutIntVariable; \
143 (p_symbols)->main_PutPszVariable = main_PutPszVariable; \
144 (p_symbols)->TestProgram = TestProgram; \
145 (p_symbols)->TestMethod = TestMethod; \
146 (p_symbols)->TestCPU = TestCPU; \
147 (p_symbols)->intf_AssignKey = intf_AssignKey; \
148 (p_symbols)->intf_ProcessKey = intf_ProcessKey; \
149 (p_symbols)->intf_Msg = intf_Msg; \
150 (p_symbols)->intf_ErrMsg = intf_ErrMsg; \
151 (p_symbols)->intf_WarnMsg = intf_WarnMsg; \
152 (p_symbols)->intf_WarnMsgImm = intf_WarnMsgImm; \
153 (p_symbols)->intf_PlaylistAdd = intf_PlaylistAdd; \
154 (p_symbols)->intf_PlaylistDelete = intf_PlaylistDelete; \
155 (p_symbols)->intf_PlaylistNext = intf_PlaylistNext; \
156 (p_symbols)->intf_PlaylistPrev = intf_PlaylistPrev; \
157 (p_symbols)->intf_PlaylistDestroy = intf_PlaylistDestroy; \
158 (p_symbols)->intf_PlaylistJumpto = intf_PlaylistJumpto; \
159 (p_symbols)->intf_UrlDecode = intf_UrlDecode; \
160 (p_symbols)->msleep = msleep; \
161 (p_symbols)->mdate = mdate; \
162 (p_symbols)->network_ChannelCreate = network_ChannelCreate; \
163 (p_symbols)->network_ChannelJoin = network_ChannelJoin; \
164 (p_symbols)->input_SetStatus = input_SetStatus; \
165 (p_symbols)->input_Seek = input_Seek; \
166 (p_symbols)->input_DumpStream = input_DumpStream; \
167 (p_symbols)->input_OffsetToTime = input_OffsetToTime; \
168 (p_symbols)->input_ChangeES = input_ChangeES; \
169 (p_symbols)->input_ToggleES = input_ToggleES; \
170 (p_symbols)->input_ChangeArea = input_ChangeArea; \
171 (p_symbols)->input_FindES = input_FindES; \
172 (p_symbols)->input_AddES = input_AddES; \
173 (p_symbols)->input_DelES = input_DelES; \
174 (p_symbols)->input_SelectES = input_SelectES; \
175 (p_symbols)->input_UnselectES = input_UnselectES; \
176 (p_symbols)->input_AddProgram = input_AddProgram; \
177 (p_symbols)->input_DelProgram = input_DelProgram; \
178 (p_symbols)->input_AddArea = input_AddArea; \
179 (p_symbols)->input_DelArea = input_DelArea; \
180 (p_symbols)->InitBitstream = InitBitstream; \
181 (p_symbols)->input_InitStream = input_InitStream; \
182 (p_symbols)->input_EndStream = input_EndStream; \
183 (p_symbols)->input_ParsePES = input_ParsePES; \
184 (p_symbols)->input_GatherPES = input_GatherPES; \
185 (p_symbols)->input_DecodePES = input_DecodePES; \
186 (p_symbols)->input_ParsePS = input_ParsePS; \
187 (p_symbols)->input_DemuxPS = input_DemuxPS; \
188 (p_symbols)->input_DemuxTS = input_DemuxTS; \
189 (p_symbols)->input_DemuxPSI = input_DemuxPSI; \
190 (p_symbols)->input_ClockManageControl = input_ClockManageControl; \
191 (p_symbols)->input_NetlistInit = input_NetlistInit; \
192 (p_symbols)->input_NetlistGetiovec = input_NetlistGetiovec; \
193 (p_symbols)->input_NetlistMviovec = input_NetlistMviovec; \
194 (p_symbols)->input_NetlistNewPacket = input_NetlistNewPacket; \
195 (p_symbols)->input_NetlistNewPES = input_NetlistNewPES; \
196 (p_symbols)->input_NetlistDeletePacket = input_NetlistDeletePacket; \
197 (p_symbols)->input_NetlistDeletePES = input_NetlistDeletePES; \
198 (p_symbols)->input_NetlistEnd = input_NetlistEnd;
200 #define STORE_TRACE_SYMBOLS( p_symbols ) \
201 (p_symbols)->intf_DbgMsg = _intf_DbgMsg; \
202 (p_symbols)->intf_DbgMsgImm = _intf_DbgMsgImm;
205 extern module_symbols_t* p_symbols;
207 # define p_main (p_symbols->p_main)
208 # define p_aout_bank (p_symbols->p_aout_bank)
209 # define p_vout_bank (p_symbols->p_vout_bank)
211 # define main_GetIntVariable(a,b) p_symbols->main_GetIntVariable(a,b)
212 # define main_PutIntVariable(a,b) p_symbols->main_PutIntVariable(a,b)
213 # define main_GetPszVariable(a,b) p_symbols->main_GetPszVariable(a,b)
214 # define main_PutPszVariable(a,b) p_symbols->main_PutPszVariable(a,b)
216 # define TestProgram(a) p_symbols->TestProgram(a)
217 # define TestMethod(a,b) p_symbols->TestMethod(a,b)
218 # define TestCPU(a) p_symbols->TestCPU(a)
220 # define intf_AssignKey(a,b,c,d) p_symbols->intf_AssignKey(a,b,c,d)
221 # define intf_ProcessKey(a,b) p_symbols->intf_ProcessKey(a,b)
223 # define intf_Msg p_symbols->intf_Msg
224 # define intf_ErrMsg p_symbols->intf_ErrMsg
225 # define intf_WarnMsg p_symbols->intf_WarnMsg
226 # define intf_WarnMsgImm p_symbols->intf_WarnMsgImm
229 # undef intf_DbgMsgImm
230 # define intf_DbgMsg( format, args... ) \
231 p_symbols->intf_DbgMsg( __FILE__, __FUNCTION__, \
232 __LINE__, format, ## args )
233 # define intf_DbgMsgImm( format, args... ) \
234 p_symbols->intf_DbgMsgImm( __FILE__, __FUNCTION__, \
235 __LINE__, format, ## args )
238 # define intf_PlaylistAdd(a,b,c) p_symbols->intf_PlaylistAdd(a,b,c)
239 # define intf_PlaylistDelete(a,b) p_symbols->intf_PlaylistDelete(a,b)
240 # define intf_PlaylistNext(a) p_symbols->intf_PlaylistNext(a)
241 # define intf_PlaylistPrev(a) p_symbols->intf_PlaylistPrev(a)
242 # define intf_PlaylistDestroy(a) p_symbols->intf_PlaylistDestroy(a)
243 # define intf_PlaylistJumpto(a,b) p_symbols->intf_PlaylistJumpto(a,b)
244 # define intf_UrlDecode(a) p_symbols->intf_UrlDecode(a)
246 # define msleep(a) p_symbols->msleep(a)
247 # define mdate() p_symbols->mdate()
249 # define network_ChannelCreate() p_symbols->network_ChannelCreate()
250 # define network_ChannelJoin(a) p_symbols->network_ChannelJoin(a)
252 # define input_SetStatus(a,b) p_symbols->input_SetStatus(a,b)
253 # define input_Seek(a,b) p_symbols->input_Seek(a,b)
254 # define input_DumpStream(a) p_symbols->input_DumpStream(a)
255 # define input_OffsetToTime(a,b,c) p_symbols->input_OffsetToTime(a,b,c)
256 # define input_ChangeES(a,b,c) p_symbols->input_ChangeES(a,b,c)
257 # define input_ToggleES(a,b,c) p_symbols->input_ToggleES(a,b,c)
258 # define input_ChangeArea(a,b) p_symbols->input_ChangeArea(a,b)
259 # define input_FindES p_symbols->input_FindES
260 # define input_AddES p_symbols->input_AddES
261 # define input_DelES p_symbols->input_DelES
262 # define input_SelectES p_symbols->input_SelectES
263 # define input_UnselectES p_symbols->input_UnselectES
264 # define input_AddProgram p_symbols->input_AddProgram
265 # define input_DelProgram p_symbols->input_DelProgram
266 # define input_AddArea p_symbols->input_AddArea
267 # define input_DelArea p_symbols->input_DelArea
269 # define InitBitstream p_symbols->InitBitstream
270 # define input_InitStream p_symbols->input_InitStream
271 # define input_EndStream p_symbols->input_EndStream
273 # define input_ParsePES p_symbols->input_ParsePES
274 # define input_GatherPES p_symbols->input_GatherPES
275 # define input_DecodePES p_symbols->input_DecodePES
276 # define input_ParsePS p_symbols->input_ParsePS
277 # define input_DemuxPS p_symbols->input_DemuxPS
278 # define input_DemuxTS p_symbols->input_DemuxTS
279 # define input_DemuxPSI p_symbols->input_DemuxPSI
281 # define input_ClockManageControl p_symbols->input_ClockManageControl
283 # define input_NetlistInit p_symbols->input_NetlistInit
284 # define input_NetlistGetiovec p_symbols->input_NetlistGetiovec
285 # define input_NetlistMviovec p_symbols->input_NetlistMviovec
286 # define input_NetlistNewPacket p_symbols->input_NetlistNewPacket
287 # define input_NetlistNewPES p_symbols->input_NetlistNewPES
288 # define input_NetlistDeletePacket p_symbols->input_NetlistDeletePacket
289 # define input_NetlistDeletePES p_symbols->input_NetlistDeletePES
290 # define input_NetlistEnd p_symbols->input_NetlistEnd