]> git.sesse.net Git - vlc/blob - include/modules_export.h
-Merged DVD netlist with input netlist to remove duplicated code.
[vlc] / include / modules_export.h
1 /*****************************************************************************
2  * modules_export.h: macros for exporting vlc symbols to plugins
3  *****************************************************************************
4  * Copyright (C) 2001 VideoLAN
5  *
6  * Authors: Samuel Hocevar <sam@zoy.org>
7  *
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.
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 General Public License for more details.
17  *
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  *****************************************************************************/
22
23 typedef struct module_symbols_s
24 {
25     struct main_s* p_main;
26     struct aout_bank_s* p_aout_bank;
27     struct vout_bank_s* p_vout_bank;
28
29     int    ( * main_GetIntVariable ) ( char *, int );
30     char * ( * main_GetPszVariable ) ( char *, char * );
31     void   ( * main_PutIntVariable ) ( char *, int );
32     void   ( * main_PutPszVariable ) ( char *, char * );
33
34     int  ( * TestProgram )  ( char * );
35     int  ( * TestMethod )   ( char *, char * );
36     int  ( * TestCPU )      ( int );
37
38     int  ( * intf_ProcessKey ) ( struct intf_thread_s *, int );
39     void ( * intf_AssignKey )  ( struct intf_thread_s *, int, int, int );
40
41     void ( * intf_Msg )        ( char *, ... );
42     void ( * intf_ErrMsg )     ( char *, ... );
43     void ( * intf_WarnMsg )    ( int, char *, ... );
44     void ( * intf_WarnMsgImm ) ( int, char *, ... );
45 #ifdef TRACE
46     void ( * intf_DbgMsg )     ( char *, char *, int, char *, ... );
47     void ( * intf_DbgMsgImm )  ( char *, char *, int, char *, ... );
48 #endif
49
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 * );
57
58     void    ( * msleep )         ( mtime_t );
59     mtime_t ( * mdate )          ( void );
60
61     int  ( * network_ChannelCreate )( void );
62     int  ( * network_ChannelJoin )  ( int );
63
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 *,
75                                                   u16 );
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 *,
85                                                        u16, size_t );
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 * );
91
92     void ( * InitBitstream )        ( struct bit_stream_s *,
93                                       struct decoder_fifo_s *,
94                                       void ( * ) ( struct bit_stream_s *,
95                                                    boolean_t ),
96                                       void * );
97     int  ( * input_InitStream )     ( struct input_thread_s *, size_t );
98     void ( * input_EndStream )      ( struct input_thread_s * );
99
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 );
118
119     int ( * input_ClockManageControl )   ( struct input_thread_s *,
120                                            struct pgrm_descriptor_s *,
121                                            mtime_t );
122
123     int ( * input_NetlistInit )          ( struct input_thread_s *,
124                                            int, int, int, size_t, int );
125     struct iovec * ( * input_NetlistGetiovec ) ( void * p_method_data );
126     void ( * input_NetlistMviovec )      ( void * , int,
127                                            struct data_packet_s **);
128     struct data_packet_s * ( * input_NetlistNewPacket ) ( void *, size_t );
129     struct data_packet_s * ( * input_NetlistNewPtr ) ( void * );
130     struct pes_packet_s * ( * input_NetlistNewPES ) ( void * );
131     void ( * input_NetlistDeletePacket ) ( void *, struct data_packet_s * );
132     void ( * input_NetlistDeletePES )    ( void *, struct pes_packet_s * );
133     void ( * input_NetlistEnd )          ( struct input_thread_s * );
134
135 } module_symbols_t;
136
137 #define STORE_SYMBOLS( p_symbols ) \
138     (p_symbols)->p_main = p_main; \
139     (p_symbols)->p_aout_bank = p_aout_bank; \
140     (p_symbols)->p_vout_bank = p_vout_bank; \
141     (p_symbols)->main_GetIntVariable = main_GetIntVariable; \
142     (p_symbols)->main_GetPszVariable = main_GetPszVariable; \
143     (p_symbols)->main_PutIntVariable = main_PutIntVariable; \
144     (p_symbols)->main_PutPszVariable = main_PutPszVariable; \
145     (p_symbols)->TestProgram = TestProgram; \
146     (p_symbols)->TestMethod = TestMethod; \
147     (p_symbols)->TestCPU = TestCPU; \
148     (p_symbols)->intf_AssignKey = intf_AssignKey; \
149     (p_symbols)->intf_ProcessKey = intf_ProcessKey; \
150     (p_symbols)->intf_Msg = intf_Msg; \
151     (p_symbols)->intf_ErrMsg = intf_ErrMsg; \
152     (p_symbols)->intf_WarnMsg = intf_WarnMsg; \
153     (p_symbols)->intf_WarnMsgImm = intf_WarnMsgImm; \
154     (p_symbols)->intf_PlaylistAdd = intf_PlaylistAdd; \
155     (p_symbols)->intf_PlaylistDelete = intf_PlaylistDelete; \
156     (p_symbols)->intf_PlaylistNext = intf_PlaylistNext; \
157     (p_symbols)->intf_PlaylistPrev = intf_PlaylistPrev; \
158     (p_symbols)->intf_PlaylistDestroy = intf_PlaylistDestroy; \
159     (p_symbols)->intf_PlaylistJumpto = intf_PlaylistJumpto; \
160     (p_symbols)->intf_UrlDecode = intf_UrlDecode; \
161     (p_symbols)->msleep = msleep; \
162     (p_symbols)->mdate = mdate; \
163     (p_symbols)->network_ChannelCreate = network_ChannelCreate; \
164     (p_symbols)->network_ChannelJoin = network_ChannelJoin; \
165     (p_symbols)->input_SetStatus = input_SetStatus; \
166     (p_symbols)->input_Seek = input_Seek; \
167     (p_symbols)->input_DumpStream = input_DumpStream; \
168     (p_symbols)->input_OffsetToTime = input_OffsetToTime; \
169     (p_symbols)->input_ChangeES = input_ChangeES; \
170     (p_symbols)->input_ToggleES = input_ToggleES; \
171     (p_symbols)->input_ChangeArea = input_ChangeArea; \
172     (p_symbols)->input_FindES = input_FindES; \
173     (p_symbols)->input_AddES = input_AddES; \
174     (p_symbols)->input_DelES = input_DelES; \
175     (p_symbols)->input_SelectES = input_SelectES; \
176     (p_symbols)->input_UnselectES = input_UnselectES; \
177     (p_symbols)->input_AddProgram = input_AddProgram; \
178     (p_symbols)->input_DelProgram = input_DelProgram; \
179     (p_symbols)->input_AddArea = input_AddArea; \
180     (p_symbols)->input_DelArea = input_DelArea; \
181     (p_symbols)->InitBitstream = InitBitstream; \
182     (p_symbols)->input_InitStream = input_InitStream; \
183     (p_symbols)->input_EndStream = input_EndStream; \
184     (p_symbols)->input_ParsePES = input_ParsePES; \
185     (p_symbols)->input_GatherPES = input_GatherPES; \
186     (p_symbols)->input_DecodePES = input_DecodePES; \
187     (p_symbols)->input_ParsePS = input_ParsePS; \
188     (p_symbols)->input_DemuxPS = input_DemuxPS; \
189     (p_symbols)->input_DemuxTS = input_DemuxTS; \
190     (p_symbols)->input_DemuxPSI = input_DemuxPSI; \
191     (p_symbols)->input_ClockManageControl = input_ClockManageControl; \
192     (p_symbols)->input_NetlistInit = input_NetlistInit; \
193     (p_symbols)->input_NetlistGetiovec = input_NetlistGetiovec; \
194     (p_symbols)->input_NetlistMviovec = input_NetlistMviovec; \
195     (p_symbols)->input_NetlistNewPacket = input_NetlistNewPacket; \
196     (p_symbols)->input_NetlistNewPtr = input_NetlistNewPtr; \
197     (p_symbols)->input_NetlistNewPES = input_NetlistNewPES; \
198     (p_symbols)->input_NetlistDeletePacket = input_NetlistDeletePacket; \
199     (p_symbols)->input_NetlistDeletePES = input_NetlistDeletePES; \
200     (p_symbols)->input_NetlistEnd = input_NetlistEnd;
201     
202 #define STORE_TRACE_SYMBOLS( p_symbols ) \
203     (p_symbols)->intf_DbgMsg = _intf_DbgMsg; \
204     (p_symbols)->intf_DbgMsgImm = _intf_DbgMsgImm;
205
206 #ifdef PLUGIN
207 extern module_symbols_t* p_symbols;
208
209 #   define p_main (p_symbols->p_main)
210 #   define p_aout_bank (p_symbols->p_aout_bank)
211 #   define p_vout_bank (p_symbols->p_vout_bank)
212
213 #   define main_GetIntVariable(a,b) p_symbols->main_GetIntVariable(a,b)
214 #   define main_PutIntVariable(a,b) p_symbols->main_PutIntVariable(a,b)
215 #   define main_GetPszVariable(a,b) p_symbols->main_GetPszVariable(a,b)
216 #   define main_PutPszVariable(a,b) p_symbols->main_PutPszVariable(a,b)
217
218 #   define TestProgram(a) p_symbols->TestProgram(a)
219 #   define TestMethod(a,b) p_symbols->TestMethod(a,b)
220 #   define TestCPU(a) p_symbols->TestCPU(a)
221
222 #   define intf_AssignKey(a,b,c,d) p_symbols->intf_AssignKey(a,b,c,d)
223 #   define intf_ProcessKey(a,b) p_symbols->intf_ProcessKey(a,b)
224
225 #   define intf_Msg p_symbols->intf_Msg
226 #   define intf_ErrMsg p_symbols->intf_ErrMsg
227 #   define intf_WarnMsg p_symbols->intf_WarnMsg
228 #   define intf_WarnMsgImm p_symbols->intf_WarnMsgImm
229 #ifdef TRACE
230 #   undef  intf_DbgMsg
231 #   undef  intf_DbgMsgImm
232 #   define intf_DbgMsg( format, args... ) \
233     p_symbols->intf_DbgMsg( __FILE__, __FUNCTION__, \
234                             __LINE__, format, ## args )
235 #   define intf_DbgMsgImm( format, args... ) \
236     p_symbols->intf_DbgMsgImm( __FILE__, __FUNCTION__, \
237                                __LINE__, format, ## args )
238 #endif
239
240 #   define intf_PlaylistAdd(a,b,c) p_symbols->intf_PlaylistAdd(a,b,c)
241 #   define intf_PlaylistDelete(a,b) p_symbols->intf_PlaylistDelete(a,b)
242 #   define intf_PlaylistNext(a) p_symbols->intf_PlaylistNext(a)
243 #   define intf_PlaylistPrev(a) p_symbols->intf_PlaylistPrev(a)
244 #   define intf_PlaylistDestroy(a) p_symbols->intf_PlaylistDestroy(a)
245 #   define intf_PlaylistJumpto(a,b) p_symbols->intf_PlaylistJumpto(a,b)
246 #   define intf_UrlDecode(a) p_symbols->intf_UrlDecode(a)
247
248 #   define msleep(a) p_symbols->msleep(a)
249 #   define mdate() p_symbols->mdate()
250
251 #   define network_ChannelCreate() p_symbols->network_ChannelCreate()
252 #   define network_ChannelJoin(a) p_symbols->network_ChannelJoin(a)
253
254 #   define input_SetStatus(a,b) p_symbols->input_SetStatus(a,b)
255 #   define input_Seek(a,b) p_symbols->input_Seek(a,b)
256 #   define input_DumpStream(a) p_symbols->input_DumpStream(a)
257 #   define input_OffsetToTime(a,b,c) p_symbols->input_OffsetToTime(a,b,c)
258 #   define input_ChangeES(a,b,c) p_symbols->input_ChangeES(a,b,c)
259 #   define input_ToggleES(a,b,c) p_symbols->input_ToggleES(a,b,c)
260 #   define input_ChangeArea(a,b) p_symbols->input_ChangeArea(a,b)
261 #   define input_FindES p_symbols->input_FindES
262 #   define input_AddES p_symbols->input_AddES
263 #   define input_DelES p_symbols->input_DelES
264 #   define input_SelectES p_symbols->input_SelectES
265 #   define input_UnselectES p_symbols->input_UnselectES
266 #   define input_AddProgram p_symbols->input_AddProgram
267 #   define input_DelProgram p_symbols->input_DelProgram
268 #   define input_AddArea p_symbols->input_AddArea
269 #   define input_DelArea p_symbols->input_DelArea
270
271 #   define InitBitstream p_symbols->InitBitstream
272 #   define input_InitStream p_symbols->input_InitStream
273 #   define input_EndStream p_symbols->input_EndStream
274
275 #   define input_ParsePES p_symbols->input_ParsePES
276 #   define input_GatherPES p_symbols->input_GatherPES
277 #   define input_DecodePES p_symbols->input_DecodePES
278 #   define input_ParsePS p_symbols->input_ParsePS
279 #   define input_DemuxPS p_symbols->input_DemuxPS
280 #   define input_DemuxTS p_symbols->input_DemuxTS
281 #   define input_DemuxPSI p_symbols->input_DemuxPSI
282
283 #   define input_ClockManageControl p_symbols->input_ClockManageControl
284
285 #   define input_NetlistInit p_symbols->input_NetlistInit
286 #   define input_NetlistGetiovec p_symbols->input_NetlistGetiovec
287 #   define input_NetlistMviovec p_symbols->input_NetlistMviovec
288 #   define input_NetlistNewPacket p_symbols->input_NetlistNewPacket
289 #   define input_NetlistNewPES p_symbols->input_NetlistNewPES
290 #   define input_NetlistDeletePacket p_symbols->input_NetlistDeletePacket
291 #   define input_NetlistDeletePES p_symbols->input_NetlistDeletePES
292 #   define input_NetlistEnd p_symbols->input_NetlistEnd
293
294 #endif
295