]> git.sesse.net Git - vlc/blob - include/modules_export.h
All decoders (audio, video, subtitles) are now modules.
[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 struct module_t;
23
24 typedef struct module_symbols_s
25 {
26     struct main_s* p_main;
27     struct aout_bank_s* p_aout_bank;
28     struct vout_bank_s* p_vout_bank;
29
30     int    ( * main_GetIntVariable ) ( char *, int );
31     char * ( * main_GetPszVariable ) ( char *, char * );
32     void   ( * main_PutIntVariable ) ( char *, int );
33     void   ( * main_PutPszVariable ) ( char *, char * );
34
35     int  ( * TestProgram )  ( char * );
36     int  ( * TestMethod )   ( char *, char * );
37     int  ( * TestCPU )      ( int );
38
39     int  ( * intf_ProcessKey ) ( struct intf_thread_s *, int );
40     void ( * intf_AssignKey )  ( struct intf_thread_s *, int, int, int );
41
42     void ( * intf_Msg )        ( char *, ... );
43     void ( * intf_ErrMsg )     ( char *, ... );
44     void ( * intf_StatMsg )    ( char *, ... );
45     void ( * intf_WarnMsg )    ( int, char *, ... );
46     void ( * intf_WarnMsgImm ) ( int, char *, ... );
47 #ifdef TRACE
48     void ( * intf_DbgMsg )     ( char *, char *, int, char *, ... );
49     void ( * intf_DbgMsgImm )  ( char *, char *, int, char *, ... );
50 #endif
51
52     int  ( * intf_PlaylistAdd )     ( struct playlist_s *, int, const char* );
53     int  ( * intf_PlaylistDelete )  ( struct playlist_s *, int );
54     void ( * intf_PlaylistNext )    ( struct playlist_s * );
55     void ( * intf_PlaylistPrev )    ( struct playlist_s * );
56     void ( * intf_PlaylistDestroy ) ( struct playlist_s * );
57     void ( * intf_PlaylistJumpto )  ( struct playlist_s *, int );
58     void ( * intf_UrlDecode )       ( char * );
59
60     void    ( * msleep )         ( mtime_t );
61     mtime_t ( * mdate )          ( void );
62
63     int  ( * network_ChannelCreate )( void );
64     int  ( * network_ChannelJoin )  ( int );
65
66     void ( * input_SetStatus )      ( struct input_thread_s *, int );
67     void ( * input_Seek )           ( struct input_thread_s *, off_t );
68     void ( * input_DumpStream )     ( struct input_thread_s * );
69     char * ( * input_OffsetToTime ) ( struct input_thread_s *, char *, off_t );
70     int  ( * input_ChangeES )       ( struct input_thread_s *,
71                                       struct es_descriptor_s *, u8 );
72     int  ( * input_ToggleES )       ( struct input_thread_s *,
73                                       struct es_descriptor_s *, boolean_t );
74     int  ( * input_ChangeArea )     ( struct input_thread_s *,
75                                       struct input_area_s * );
76     struct es_descriptor_s * ( * input_FindES ) ( struct input_thread_s *,
77                                                   u16 );
78     struct es_descriptor_s * ( * input_AddES ) ( struct input_thread_s *,
79                                       struct pgrm_descriptor_s *, u16, size_t );
80     void ( * input_DelES )          ( struct input_thread_s *,
81                                       struct es_descriptor_s * );
82     int  ( * input_SelectES )       ( struct input_thread_s *,
83                                       struct es_descriptor_s * );
84     int  ( * input_UnselectES )     ( struct input_thread_s *,
85                                       struct es_descriptor_s * );
86     struct pgrm_descriptor_s* ( * input_AddProgram ) ( struct input_thread_s *,
87                                                        u16, size_t );
88     void ( * input_DelProgram )     ( struct input_thread_s *,
89                                       struct pgrm_descriptor_s * );
90     struct input_area_s * ( * input_AddArea ) ( struct input_thread_s * );
91     void ( * input_DelArea )        ( struct input_thread_s *,
92                                       struct input_area_s * );
93
94     void ( * InitBitstream )        ( struct bit_stream_s *,
95                                       struct decoder_fifo_s *,
96                                       void ( * ) ( struct bit_stream_s *,
97                                                    boolean_t ),
98                                       void * );
99     int  ( * input_InitStream )     ( struct input_thread_s *, size_t );
100     void ( * input_EndStream )      ( struct input_thread_s * );
101
102     void ( * input_ParsePES )       ( struct input_thread_s *,
103                                       struct es_descriptor_s * );
104     void ( * input_GatherPES )      ( struct input_thread_s *,
105                                       struct data_packet_s *,
106                                       struct es_descriptor_s *,
107                                       boolean_t, boolean_t );
108     void ( * input_DecodePES )      ( struct decoder_fifo_s *,
109                                       struct pes_packet_s * );
110     struct es_descriptor_s * ( * input_ParsePS ) ( struct input_thread_s *,
111                                                    struct data_packet_s * );
112     void ( * input_DemuxPS )        ( struct input_thread_s *,
113                                       struct data_packet_s * );
114     void ( * input_DemuxTS )        ( struct input_thread_s *,
115                                       struct data_packet_s * );
116     void ( * input_DemuxPSI )       ( struct input_thread_s *,
117                                       struct data_packet_s *,
118                                       struct es_descriptor_s *, 
119                                       boolean_t, boolean_t );
120
121     int ( * input_ClockManageControl )   ( struct input_thread_s *,
122                                            struct pgrm_descriptor_s *,
123                                            mtime_t );
124
125     int ( * input_NetlistInit )          ( struct input_thread_s *,
126                                            int, int, int, size_t, int );
127     struct iovec * ( * input_NetlistGetiovec ) ( void * p_method_data );
128     void ( * input_NetlistMviovec )      ( void * , int,
129                                            struct data_packet_s **);
130     struct data_packet_s * ( * input_NetlistNewPacket ) ( void *, size_t );
131     struct data_packet_s * ( * input_NetlistNewPtr ) ( void * );
132     struct pes_packet_s * ( * input_NetlistNewPES ) ( void * );
133     void ( * input_NetlistDeletePacket ) ( void *, struct data_packet_s * );
134     void ( * input_NetlistDeletePES )    ( void *, struct pes_packet_s * );
135     void ( * input_NetlistEnd )          ( struct input_thread_s * );
136
137     struct aout_fifo_s * ( * aout_CreateFifo ) 
138                                        ( int, int, long, long, long, void * );
139     void ( * aout_DestroyFifo )     ( struct aout_fifo_s * );
140
141     struct vout_thread_s * (* vout_CreateThread) ( int *, int, int );
142     struct subpicture_s * (* vout_CreateSubPicture) ( struct vout_thread_s *, 
143                                                       int, int );
144     struct picture_s * ( * vout_CreatePicture ) ( struct vout_thread_s *, 
145                                                   int, int, int );
146
147     void  ( * vout_DestroySubPicture )  ( struct vout_thread_s *, 
148                                           struct subpicture_s * );
149     void  ( * vout_DisplaySubPicture )  ( struct vout_thread_s *, 
150                                           struct subpicture_s * );
151     void  ( * vout_DisplayPicture ) ( struct vout_thread_s *, 
152                                       struct picture_s * );
153     void  ( * vout_DestroyPicture ) ( struct vout_thread_s *,
154                                       struct picture_s * );
155     void  ( * vout_LinkPicture )    ( struct vout_thread_s *,
156                                       struct picture_s * );
157     void  ( * vout_UnlinkPicture )    ( struct vout_thread_s *,
158                                       struct picture_s * );
159     void  ( * vout_DatePicture )    ( struct vout_thread_s *p_vout, 
160                                       struct picture_s *p_pic, mtime_t );
161     
162     
163     u32  ( * UnalignedShowBits )    ( struct bit_stream_s *, unsigned int );
164     void ( * UnalignedRemoveBits )  ( struct bit_stream_s * );
165     u32  ( * UnalignedGetBits )     ( struct bit_stream_s *, unsigned int );
166
167     struct module_s * ( * module_Need )    ( int, void * );
168     void ( * module_Unneed )        ( struct module_s * );
169 } module_symbols_t;
170
171 #define STORE_SYMBOLS( p_symbols ) \
172     (p_symbols)->p_main = p_main; \
173     (p_symbols)->p_aout_bank = p_aout_bank; \
174     (p_symbols)->p_vout_bank = p_vout_bank; \
175     (p_symbols)->main_GetIntVariable = main_GetIntVariable; \
176     (p_symbols)->main_GetPszVariable = main_GetPszVariable; \
177     (p_symbols)->main_PutIntVariable = main_PutIntVariable; \
178     (p_symbols)->main_PutPszVariable = main_PutPszVariable; \
179     (p_symbols)->TestProgram = TestProgram; \
180     (p_symbols)->TestMethod = TestMethod; \
181     (p_symbols)->TestCPU = TestCPU; \
182     (p_symbols)->intf_AssignKey = intf_AssignKey; \
183     (p_symbols)->intf_ProcessKey = intf_ProcessKey; \
184     (p_symbols)->intf_Msg = intf_Msg; \
185     (p_symbols)->intf_ErrMsg = intf_ErrMsg; \
186     (p_symbols)->intf_StatMsg = intf_StatMsg;\
187     (p_symbols)->intf_WarnMsg = intf_WarnMsg; \
188     (p_symbols)->intf_WarnMsgImm = intf_WarnMsgImm; \
189     (p_symbols)->intf_PlaylistAdd = intf_PlaylistAdd; \
190     (p_symbols)->intf_PlaylistDelete = intf_PlaylistDelete; \
191     (p_symbols)->intf_PlaylistNext = intf_PlaylistNext; \
192     (p_symbols)->intf_PlaylistPrev = intf_PlaylistPrev; \
193     (p_symbols)->intf_PlaylistDestroy = intf_PlaylistDestroy; \
194     (p_symbols)->intf_PlaylistJumpto = intf_PlaylistJumpto; \
195     (p_symbols)->intf_UrlDecode = intf_UrlDecode; \
196     (p_symbols)->msleep = msleep; \
197     (p_symbols)->mdate = mdate; \
198     (p_symbols)->network_ChannelCreate = network_ChannelCreate; \
199     (p_symbols)->network_ChannelJoin = network_ChannelJoin; \
200     (p_symbols)->input_SetStatus = input_SetStatus; \
201     (p_symbols)->input_Seek = input_Seek; \
202     (p_symbols)->input_DumpStream = input_DumpStream; \
203     (p_symbols)->input_OffsetToTime = input_OffsetToTime; \
204     (p_symbols)->input_ChangeES = input_ChangeES; \
205     (p_symbols)->input_ToggleES = input_ToggleES; \
206     (p_symbols)->input_ChangeArea = input_ChangeArea; \
207     (p_symbols)->input_FindES = input_FindES; \
208     (p_symbols)->input_AddES = input_AddES; \
209     (p_symbols)->input_DelES = input_DelES; \
210     (p_symbols)->input_SelectES = input_SelectES; \
211     (p_symbols)->input_UnselectES = input_UnselectES; \
212     (p_symbols)->input_AddProgram = input_AddProgram; \
213     (p_symbols)->input_DelProgram = input_DelProgram; \
214     (p_symbols)->input_AddArea = input_AddArea; \
215     (p_symbols)->input_DelArea = input_DelArea; \
216     (p_symbols)->InitBitstream = InitBitstream; \
217     (p_symbols)->input_InitStream = input_InitStream; \
218     (p_symbols)->input_EndStream = input_EndStream; \
219     (p_symbols)->input_ParsePES = input_ParsePES; \
220     (p_symbols)->input_GatherPES = input_GatherPES; \
221     (p_symbols)->input_DecodePES = input_DecodePES; \
222     (p_symbols)->input_ParsePS = input_ParsePS; \
223     (p_symbols)->input_DemuxPS = input_DemuxPS; \
224     (p_symbols)->input_DemuxTS = input_DemuxTS; \
225     (p_symbols)->input_DemuxPSI = input_DemuxPSI; \
226     (p_symbols)->input_ClockManageControl = input_ClockManageControl; \
227     (p_symbols)->input_NetlistInit = input_NetlistInit; \
228     (p_symbols)->input_NetlistGetiovec = input_NetlistGetiovec; \
229     (p_symbols)->input_NetlistMviovec = input_NetlistMviovec; \
230     (p_symbols)->input_NetlistNewPacket = input_NetlistNewPacket; \
231     (p_symbols)->input_NetlistNewPtr = input_NetlistNewPtr; \
232     (p_symbols)->input_NetlistNewPES = input_NetlistNewPES; \
233     (p_symbols)->input_NetlistDeletePacket = input_NetlistDeletePacket; \
234     (p_symbols)->input_NetlistDeletePES = input_NetlistDeletePES; \
235     (p_symbols)->input_NetlistEnd = input_NetlistEnd; \
236     (p_symbols)->aout_CreateFifo = aout_CreateFifo; \
237     (p_symbols)->aout_DestroyFifo = aout_DestroyFifo; \
238     (p_symbols)->vout_CreateThread = vout_CreateThread; \
239     (p_symbols)->vout_CreateSubPicture = vout_CreateSubPicture; \
240     (p_symbols)->vout_DestroySubPicture = vout_DestroySubPicture; \
241     (p_symbols)->vout_DisplaySubPicture = vout_DisplaySubPicture; \
242     (p_symbols)->vout_CreatePicture = vout_CreatePicture; \
243     (p_symbols)->vout_DisplayPicture = vout_DisplayPicture; \
244     (p_symbols)->vout_DestroyPicture = vout_DestroyPicture; \
245     (p_symbols)->vout_DatePicture = vout_DatePicture; \
246     (p_symbols)->vout_LinkPicture = vout_LinkPicture; \
247     (p_symbols)->vout_UnlinkPicture = vout_UnlinkPicture; \
248     (p_symbols)->UnalignedGetBits = UnalignedGetBits; \
249     (p_symbols)->UnalignedRemoveBits = UnalignedRemoveBits; \
250     (p_symbols)->UnalignedShowBits = UnalignedShowBits; \
251     (p_symbols)->module_Need = module_Need; \
252     (p_symbols)->module_Unneed = module_Unneed;
253     
254 #define STORE_TRACE_SYMBOLS( p_symbols ) \
255     (p_symbols)->intf_DbgMsg = _intf_DbgMsg; \
256     (p_symbols)->intf_DbgMsgImm = _intf_DbgMsgImm;
257
258 #ifdef PLUGIN
259 extern module_symbols_t* p_symbols;
260
261 #   define p_main (p_symbols->p_main)
262 #   define p_aout_bank (p_symbols->p_aout_bank)
263 #   define p_vout_bank (p_symbols->p_vout_bank)
264
265 #   define main_GetIntVariable(a,b) p_symbols->main_GetIntVariable(a,b)
266 #   define main_PutIntVariable(a,b) p_symbols->main_PutIntVariable(a,b)
267 #   define main_GetPszVariable(a,b) p_symbols->main_GetPszVariable(a,b)
268 #   define main_PutPszVariable(a,b) p_symbols->main_PutPszVariable(a,b)
269
270 #   define TestProgram(a) p_symbols->TestProgram(a)
271 #   define TestMethod(a,b) p_symbols->TestMethod(a,b)
272 #   define TestCPU(a) p_symbols->TestCPU(a)
273
274 #   define intf_AssignKey(a,b,c,d) p_symbols->intf_AssignKey(a,b,c,d)
275 #   define intf_ProcessKey(a,b) p_symbols->intf_ProcessKey(a,b)
276
277 #   define intf_Msg p_symbols->intf_Msg
278 #   define intf_ErrMsg p_symbols->intf_ErrMsg
279 #   define intf_StatMsg p_symbols->intf_StatMsg
280 #   define intf_WarnMsg p_symbols->intf_WarnMsg
281 #   define intf_WarnMsgImm p_symbols->intf_WarnMsgImm
282 #ifdef TRACE
283 #   undef  intf_DbgMsg
284 #   undef  intf_DbgMsgImm
285 #   define intf_DbgMsg( format, args... ) \
286     p_symbols->intf_DbgMsg( __FILE__, __FUNCTION__, \
287                             __LINE__, format, ## args )
288 #   define intf_DbgMsgImm( format, args... ) \
289     p_symbols->intf_DbgMsgImm( __FILE__, __FUNCTION__, \
290                                __LINE__, format, ## args )
291 #endif
292
293 #   define intf_PlaylistAdd(a,b,c) p_symbols->intf_PlaylistAdd(a,b,c)
294 #   define intf_PlaylistDelete(a,b) p_symbols->intf_PlaylistDelete(a,b)
295 #   define intf_PlaylistNext(a) p_symbols->intf_PlaylistNext(a)
296 #   define intf_PlaylistPrev(a) p_symbols->intf_PlaylistPrev(a)
297 #   define intf_PlaylistDestroy(a) p_symbols->intf_PlaylistDestroy(a)
298 #   define intf_PlaylistJumpto(a,b) p_symbols->intf_PlaylistJumpto(a,b)
299 #   define intf_UrlDecode(a) p_symbols->intf_UrlDecode(a)
300
301 #   define msleep(a) p_symbols->msleep(a)
302 #   define mdate() p_symbols->mdate()
303
304 #   define network_ChannelCreate() p_symbols->network_ChannelCreate()
305 #   define network_ChannelJoin(a) p_symbols->network_ChannelJoin(a)
306
307 #   define input_SetStatus(a,b) p_symbols->input_SetStatus(a,b)
308 #   define input_Seek(a,b) p_symbols->input_Seek(a,b)
309 #   define input_DumpStream(a) p_symbols->input_DumpStream(a)
310 #   define input_OffsetToTime(a,b,c) p_symbols->input_OffsetToTime(a,b,c)
311 #   define input_ChangeES(a,b,c) p_symbols->input_ChangeES(a,b,c)
312 #   define input_ToggleES(a,b,c) p_symbols->input_ToggleES(a,b,c)
313 #   define input_ChangeArea(a,b) p_symbols->input_ChangeArea(a,b)
314 #   define input_FindES p_symbols->input_FindES
315 #   define input_AddES p_symbols->input_AddES
316 #   define input_DelES p_symbols->input_DelES
317 #   define input_SelectES p_symbols->input_SelectES
318 #   define input_UnselectES p_symbols->input_UnselectES
319 #   define input_AddProgram p_symbols->input_AddProgram
320 #   define input_DelProgram p_symbols->input_DelProgram
321 #   define input_AddArea p_symbols->input_AddArea
322 #   define input_DelArea p_symbols->input_DelArea
323
324 #   define InitBitstream p_symbols->InitBitstream
325 #   define input_InitStream p_symbols->input_InitStream
326 #   define input_EndStream p_symbols->input_EndStream
327
328 #   define input_ParsePES p_symbols->input_ParsePES
329 #   define input_GatherPES p_symbols->input_GatherPES
330 #   define input_DecodePES p_symbols->input_DecodePES
331 #   define input_ParsePS p_symbols->input_ParsePS
332 #   define input_DemuxPS p_symbols->input_DemuxPS
333 #   define input_DemuxTS p_symbols->input_DemuxTS
334 #   define input_DemuxPSI p_symbols->input_DemuxPSI
335
336 #   define input_ClockManageControl p_symbols->input_ClockManageControl
337
338 #   define input_NetlistInit p_symbols->input_NetlistInit
339 #   define input_NetlistGetiovec p_symbols->input_NetlistGetiovec
340 #   define input_NetlistMviovec p_symbols->input_NetlistMviovec
341 #   define input_NetlistNewPacket p_symbols->input_NetlistNewPacket
342 #   define input_NetlistNewPES p_symbols->input_NetlistNewPES
343 #   define input_NetlistDeletePacket p_symbols->input_NetlistDeletePacket
344 #   define input_NetlistDeletePES p_symbols->input_NetlistDeletePES
345 #   define input_NetlistEnd p_symbols->input_NetlistEnd
346
347 #   define aout_CreateFifo p_symbols->aout_CreateFifo
348 #   define aout_DestroyFifo p_symbols->aout_DestroyFifo
349
350 #   define vout_CreateThread p_symbols->vout_CreateThread
351 #   define vout_CreateSubPicture p_symbols->vout_CreateSubPicture
352 #   define vout_DestroySubPicture p_symbols->vout_DestroySubPicture
353 #   define vout_DisplaySubPicture p_symbols->vout_DisplaySubPicture
354 #   define vout_CreatePicture p_symbols->vout_CreatePicture
355 #   define vout_DisplayPicture p_symbols->vout_DisplayPicture
356 #   define vout_DestroyPicture p_symbols->vout_DestroyPicture
357 #   define vout_DatePicture p_symbols->vout_DatePicture
358 #   define vout_LinkPicture p_symbols->vout_LinkPicture
359 #   define vout_UnlinkPicture p_symbols->vout_UnlinkPicture
360     
361 #   define UnalignedShowBits p_symbols->UnalignedShowBits
362 #   define UnalignedRemoveBits p_symbols->UnalignedRemoveBits
363 #   define UnalignedGetBits p_symbols->UnalignedGetBits   
364 #   define module_Need p_symbols->module_Need
365 #   define module_Unneed p_symbols->module_Unneed
366     
367 #endif
368