]> git.sesse.net Git - vlc/blob - include/common.h
* IPv6 network module, courtesy of Alexis Guillard <alexis.guillard@bt.com>,
[vlc] / include / common.h
1 /*****************************************************************************
2  * common.h: common definitions
3  * Collection of useful common types and macros definitions
4  *****************************************************************************
5  * Copyright (C) 1998, 1999, 2000 VideoLAN
6  * $Id: common.h,v 1.84 2002/03/04 23:56:37 massiot Exp $
7  *
8  * Authors: Samuel Hocevar <sam@via.ecp.fr>
9  *          Vincent Seguin <seguin@via.ecp.fr>
10  *          Gildas Bazin <gbazin@netcourrier.com>
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2 of the License, or
15  * (at your option) any later version.
16  * 
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
25  *****************************************************************************/
26
27 /*****************************************************************************
28  * Required system headers
29  *****************************************************************************/
30 #include <string.h>                                            /* strerror() */
31 #include <sys/types.h>
32
33 /*****************************************************************************
34  * Basic types definitions
35  *****************************************************************************/
36
37 typedef unsigned char       u8;
38 typedef signed char         s8;
39
40 typedef unsigned short      u16;
41 typedef signed short        s16;
42
43 typedef unsigned int        u32;
44 typedef signed int          s32;
45
46 #if defined( _MSC_VER ) || ( defined( WIN32 ) && !defined( __MINGW32__ ) )
47 typedef unsigned __int64    u64;
48 typedef signed __int64      s64;
49 #else
50 typedef unsigned long long  u64;
51 typedef signed long long    s64;
52 #endif
53
54 typedef u8                  byte_t;
55
56 /* Boolean type */
57 #ifdef BOOLEAN_T_IN_SYS_TYPES_H
58     /* <sys/types.h> already included */
59 #elif defined(BOOLEAN_T_IN_PTHREAD_H)
60 #   include <pthread.h>
61 #elif defined(BOOLEAN_T_IN_CTHREADS_H)
62 #   include <cthreads.h>
63 #else
64 typedef int                 boolean_t;
65 #endif
66 #ifdef SYS_GNU
67 #   define _MACH_I386_BOOLEAN_H_
68 #endif
69
70 /* ptrdiff_t definition */
71 #ifdef HAVE_STDDEF_H
72 #   include <stddef.h>
73 #else
74 #   include <malloc.h>
75 #   ifndef _PTRDIFF_T
76 #       define _PTRDIFF_T
77 /* Not portable in a 64-bit environment. */
78 typedef int                 ptrdiff_t;
79 #   endif
80 #endif
81
82 #if defined( WIN32 )
83 typedef int                 ssize_t;
84 #endif
85
86 /* Counter for statistics and profiling */
87 typedef unsigned long       count_t;
88
89 /* DCT elements types */
90 typedef s16                 dctelem_t;
91
92 /* Video buffer types */
93 typedef u8                  yuv_data_t;
94
95 /*****************************************************************************
96  * mtime_t: high precision date or time interval
97  *****************************************************************************
98  * Store an high precision date or time interval. The maximum precision is the
99  * micro-second, and a 64 bits integer is used to avoid any overflow (maximum
100  * time interval is then 292271 years, which should be long enough for any
101  * video). Date are stored as a time interval since a common date.
102  * Note that date and time intervals can be manipulated using regular
103  * arithmetic operators, and that no special functions are required.
104  *****************************************************************************/
105 typedef s64 mtime_t;
106
107 /*****************************************************************************
108  * Classes declaration
109  *****************************************************************************/
110
111 /* Plugins */
112 struct plugin_bank_s;
113 struct plugin_info_s;
114
115 typedef struct plugin_bank_s *          p_plugin_bank_t;
116 typedef struct plugin_info_s *          p_plugin_info_t;
117
118 /* Plugins */
119 struct playlist_s;
120 struct playlist_item_s;
121 struct module_s;
122 struct module_config_s;
123
124 typedef struct playlist_s *             p_playlist_t;
125 typedef struct playlist_item_s *        p_playlist_item_t;
126 typedef struct module_s *               p_module_t;
127 typedef struct module_config_s *        p_module_config_t;
128
129 /* Interface */
130 struct intf_thread_s;
131 struct intf_sys_s;
132 struct intf_console_s;
133 struct intf_msg_s;
134 struct intf_channel_s;
135
136 typedef struct intf_thread_s *          p_intf_thread_t;
137 typedef struct intf_sys_s *             p_intf_sys_t;
138 typedef struct intf_console_s *         p_intf_console_t;
139 typedef struct intf_msg_s *             p_intf_msg_t;
140 typedef struct intf_channel_s *         p_intf_channel_t;
141
142 /* Input */
143 struct input_thread_s;
144 struct input_channel_s;
145 struct input_cfg_s;
146 struct input_area_s;
147
148 typedef struct input_thread_s *         p_input_thread_t;
149 typedef struct input_channel_s *        p_input_channel_t;
150 typedef struct input_cfg_s *            p_input_cfg_t;
151 typedef struct input_area_s *           p_input_area_t;
152
153 /* Audio */
154 struct aout_thread_s;
155 struct aout_sys_s;
156
157 typedef struct aout_thread_s *          p_aout_thread_t;
158 typedef struct aout_sys_s *             p_aout_sys_t;
159
160 /* Video */
161 struct vout_thread_s;
162 struct vout_font_s;
163 struct vout_sys_s;
164 struct chroma_sys_s;
165 struct vdec_thread_s;
166 struct vpar_thread_s;
167 struct video_parser_s;
168
169 typedef struct vout_thread_s *          p_vout_thread_t;
170 typedef struct vout_font_s *            p_vout_font_t;
171 typedef struct vout_sys_s *             p_vout_sys_t;
172 typedef struct chroma_sys_s *           p_chroma_sys_t;
173 typedef struct vdec_thread_s *          p_vdec_thread_t;
174 typedef struct vpar_thread_s *          p_vpar_thread_t;
175 typedef struct video_parser_s *         p_video_parser_t;
176
177 /* Decoders */
178 struct decoder_config_s;
179 struct decoder_fifo_s;
180
181 /* Misc */
182 struct macroblock_s;
183 struct data_packet_s;
184 struct imdct_s;
185 struct complex_s;
186 struct dm_par_s;
187 struct picture_s;
188 struct picture_sys_s;
189 struct picture_heap_s;
190 struct es_descriptor_s;
191 struct pgrm_descriptor_s;
192 struct pes_packet_s;
193 struct input_area_s;
194 struct bit_stream_s;
195 struct input_buffers_s;
196 struct network_socket_s;
197 struct intf_subscription_s;
198
199 /*****************************************************************************
200  * Macros and inline functions
201  *****************************************************************************/
202 #ifdef NTOHL_IN_SYS_PARAM_H
203 #   include <sys/param.h>
204
205 #elif defined(WIN32)
206 /* Swap bytes in 16 bit value.  */
207 #   define __bswap_constant_16(x) \
208      ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))
209
210 #   if defined __GNUC__ && __GNUC__ >= 2
211 #       define __bswap_16(x) \
212             (__extension__                                                    \
213              ({ register unsigned short int __v;                              \
214                 if (__builtin_constant_p (x))                                 \
215                   __v = __bswap_constant_16 (x);                              \
216                 else                                                          \
217                   __asm__ __volatile__ ("rorw $8, %w0"                        \
218                                         : "=r" (__v)                          \
219                                         : "0" ((unsigned short int) (x))      \
220                                         : "cc");                              \
221                 __v; }))
222 #   else
223 /* This is better than nothing.  */
224 #       define __bswap_16(x) __bswap_constant_16 (x)
225 #   endif
226
227 /* Swap bytes in 32 bit value.  */
228 #   define __bswap_constant_32(x) \
229         ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >>  8) |            \
230          (((x) & 0x0000ff00) <<  8) | (((x) & 0x000000ff) << 24))
231
232 #   if defined __GNUC__ && __GNUC__ >= 2
233 /* To swap the bytes in a word the i486 processors and up provide the
234    `bswap' opcode.  On i386 we have to use three instructions.  */
235 #       if !defined __i486__ && !defined __pentium__ && !defined __pentiumpro__
236 #           define __bswap_32(x) \
237                 (__extension__                                                \
238                  ({ register unsigned int __v;                                \
239                     if (__builtin_constant_p (x))                             \
240                       __v = __bswap_constant_32 (x);                          \
241                     else                                                      \
242                       __asm__ __volatile__ ("rorw $8, %w0;"                   \
243                                             "rorl $16, %0;"                   \
244                                             "rorw $8, %w0"                    \
245                                             : "=r" (__v)                      \
246                                             : "0" ((unsigned int) (x))        \
247                                             : "cc");                          \
248                     __v; }))
249 #       else
250 #           define __bswap_32(x) \
251                 (__extension__                                                \
252                  ({ register unsigned int __v;                                \
253                     if (__builtin_constant_p (x))                             \
254                       __v = __bswap_constant_32 (x);                          \
255                     else                                                      \
256                       __asm__ __volatile__ ("bswap %0"                        \
257                                             : "=r" (__v)                      \
258                                             : "0" ((unsigned int) (x)));      \
259                     __v; }))
260 #       endif
261 #   else
262 #       define __bswap_32(x) __bswap_constant_32 (x)
263 #   endif
264
265 #   if defined __GNUC__ && __GNUC__ >= 2
266 /* Swap bytes in 64 bit value.  */
267 #       define __bswap_constant_64(x) \
268             ((((x) & 0xff00000000000000ull) >> 56)                            \
269              | (((x) & 0x00ff000000000000ull) >> 40)                          \
270              | (((x) & 0x0000ff0000000000ull) >> 24)                          \
271              | (((x) & 0x000000ff00000000ull) >> 8)                           \
272              | (((x) & 0x00000000ff000000ull) << 8)                           \
273              | (((x) & 0x0000000000ff0000ull) << 24)                          \
274              | (((x) & 0x000000000000ff00ull) << 40)                          \
275              | (((x) & 0x00000000000000ffull) << 56))
276
277 #       define __bswap_64(x) \
278             (__extension__                                                    \
279              ({ union { __extension__ unsigned long long int __ll;            \
280                         unsigned long int __l[2]; } __w, __r;                 \
281                 if (__builtin_constant_p (x))                                 \
282                   __r.__ll = __bswap_constant_64 (x);                         \
283                 else                                                          \
284                   {                                                           \
285                     __w.__ll = (x);                                           \
286                     __r.__l[0] = __bswap_32 (__w.__l[1]);                     \
287                     __r.__l[1] = __bswap_32 (__w.__l[0]);                     \
288                   }                                                           \
289                 __r.__ll; }))
290 #   endif
291
292 #else /* NTOHL_IN_SYS_PARAM_H || WIN32 */
293 #   include <netinet/in.h>
294
295 #endif /* NTOHL_IN_SYS_PARAM_H || WIN32 */
296
297 /* CEIL: division with round to nearest greater integer */
298 #define CEIL(n, d)  ( ((n) / (d)) + ( ((n) % (d)) ? 1 : 0) )
299
300 /* PAD: PAD(n, d) = CEIL(n ,d) * d */
301 #define PAD(n, d)   ( ((n) % (d)) ? ((((n) / (d)) + 1) * (d)) : (n) )
302
303 /* __MAX and __MIN: self explanatory */
304 #ifndef __MAX
305 #   define __MAX(a, b)   ( ((a) > (b)) ? (a) : (b) )
306 #endif
307 #ifndef __MIN
308 #   define __MIN(a, b)   ( ((a) < (b)) ? (a) : (b) )
309 #endif
310
311 /* MSB (big endian)/LSB (little endian) conversions - network order is always
312  * MSB, and should be used for both network communications and files. Note that
313  * byte orders other than little and big endians are not supported, but only
314  * the VAX seems to have such exotic properties - note that these 'functions'
315  * needs <netinet/in.h> or the local equivalent. */
316 #if !defined( WIN32 )
317 #if WORDS_BIGENDIAN
318 #   define hton16      htons
319 #   define hton32      htonl
320 #   define hton64(i)   ( i )
321 #   define ntoh16      ntohs
322 #   define ntoh32      ntohl
323 #   define ntoh64(i)   ( i )
324 #else
325 #   define hton16      htons
326 #   define hton32      htonl
327     static __inline__ u64 __hton64( u64 i )
328     {
329         return ((u64)(htonl((i) & 0xffffffff)) << 32)
330                 | htonl(((i) >> 32) & 0xffffffff );
331     }
332 #   define hton64(i)   __hton64( i )
333 #   define ntoh16      ntohs
334 #   define ntoh32      ntohl
335 #   define ntoh64      hton64
336 #endif
337 #endif /* !defined( WIN32 ) */
338
339 /* Macros with automatic casts */
340 #define U64_AT(p)   ( ntoh64 ( *( (u64 *)(p) ) ) )
341 #define U32_AT(p)   ( ntoh32 ( *( (u32 *)(p) ) ) )
342 #define U16_AT(p)   ( ntoh16 ( *( (u16 *)(p) ) ) )
343
344 /* Alignment of critical static data structures */
345 #ifdef ATTRIBUTE_ALIGNED_MAX
346 #   define ATTR_ALIGN(align) __attribute__ ((__aligned__ ((ATTRIBUTE_ALIGNED_MAX < align) ? ATTRIBUTE_ALIGNED_MAX : align)))
347 #else
348 #   define ATTR_ALIGN(align)
349 #endif
350
351 /* Alignment of critical dynamic data structure */
352 #ifdef HAVE_MEMALIGN
353     /* Some systems have memalign() but no declaration for it */
354     void * memalign( size_t align, size_t size );
355 #else
356 #   ifdef HAVE_VALLOC
357         /* That's like using a hammer to kill a fly, but eh... */
358 #       include <unistd.h>
359 #       define memalign(align,size) valloc(size)
360 #   else
361         /* Assume malloc alignment is sufficient */
362 #       define memalign(align,size) malloc(size)
363 #   endif    
364 #endif
365
366 #define I64C(x)         x##LL
367
368
369 #if defined( WIN32 )
370 /* The ntoh* and hton* bytes swapping functions are provided by winsock
371  * but for conveniency and speed reasons it is better to implement them
372  * ourselves. ( several plugins use them and it is too much hassle to link
373  * winsock with each of them ;-)
374  */
375 #   ifdef WORDS_BIGENDIAN
376 #       define ntoh32(x)       (x)
377 #       define ntoh16(x)       (x)
378 #       define ntoh64(x)       (x)
379 #       define hton32(x)       (x)
380 #       define hton16(x)       (x)
381 #       define hton64(x)       (x)
382 #   else
383 #       define ntoh32(x)     __bswap_32 (x)
384 #       define ntoh16(x)     __bswap_16 (x)
385 #       define ntoh64(x)     __bswap_32 (x)
386 #       define hton32(x)     __bswap_32 (x)
387 #       define hton16(x)     __bswap_16 (x)
388 #       define hton64(x)     __bswap_64 (x)
389 #   endif
390
391 /* win32, cl and icl support */
392 #   if defined( _MSC_VER ) || !defined( __MINGW32__ )
393 #       define __attribute__(x)
394 #       define __inline__      __inline
395 #       define strncasecmp     strnicmp
396 #       define strcasecmp      stricmp
397 #       define S_ISBLK(m)      (0)
398 #       define S_ISCHR(m)      (0)
399 #       define S_ISFIFO(m)     (((m)&_S_IFMT) == _S_IFIFO)
400 #       define S_ISREG(m)      (((m)&_S_IFMT) == _S_IFREG)
401 #       undef I64C(x)
402 #       define I64C(x)         x##i64
403 #   endif
404
405 /* several type definitions */
406 #   if defined( __MINGW32__ )
407 #       if !defined( _OFF_T_ )
408 typedef long long _off_t;
409 typedef _off_t off_t;
410 #           define _OFF_T_
411 #       else
412 #           define off_t long long
413 #       endif
414 #   endif
415
416 #   if defined( _MSC_VER )
417 #       if !defined( _OFF_T_DEFINED )
418 typedef __int64 off_t;
419 #           define _OFF_T_DEFINED
420 #       else
421 #           define off_t __int64
422 #       endif
423 #       define stat _stati64
424 #   endif
425
426 #   ifndef O_NONBLOCK
427 #       define O_NONBLOCK 0
428 #   endif
429
430 #   ifndef snprintf
431 #       define snprintf _snprintf  /* snprintf not defined in mingw32 (bug?) */
432 #   endif
433
434 #endif
435
436 /*****************************************************************************
437  * CPU capabilities
438  *****************************************************************************/
439 #define CPU_CAPABILITY_NONE    0
440 #define CPU_CAPABILITY_486     (1<<0)
441 #define CPU_CAPABILITY_586     (1<<1)
442 #define CPU_CAPABILITY_PPRO    (1<<2)
443 #define CPU_CAPABILITY_MMX     (1<<3)
444 #define CPU_CAPABILITY_3DNOW   (1<<4)
445 #define CPU_CAPABILITY_MMXEXT  (1<<5)
446 #define CPU_CAPABILITY_SSE     (1<<6)
447 #define CPU_CAPABILITY_ALTIVEC (1<<16)
448 #define CPU_CAPABILITY_FPU     (1<<31)
449
450 /*****************************************************************************
451  * I18n stuff
452  *****************************************************************************/
453 #if defined( ENABLE_NLS ) && defined ( HAVE_GETTEXT )
454 #   include <libintl.h>
455 #else
456 #   define _(String) (String)
457 #   define N_(String) (String)
458 #endif
459
460 /*****************************************************************************
461  * Plug-in stuff
462  *****************************************************************************/
463 typedef struct module_symbols_s
464 {
465     struct main_s* p_main;
466     struct input_bank_s* p_input_bank;
467     struct aout_bank_s*  p_aout_bank;
468     struct vout_bank_s*  p_vout_bank;
469
470     int    ( * config_GetIntVariable ) ( const char * );
471     char * ( * config_GetPszVariable ) ( const char * );
472     void   ( * config_PutIntVariable ) ( const char *, int );
473     void   ( * config_PutPszVariable ) ( const char *, char * );
474     struct module_config_s * ( * config_FindConfig ) ( const char * );
475     struct module_config_s * ( * config_Duplicate ) ( struct module_config_s *,
476                                                       int );
477
478     struct intf_subscription_s * ( * intf_MsgSub ) ( void );
479     void ( * intf_MsgUnsub )   ( struct intf_subscription_s * );
480
481     void ( * intf_Msg )        ( char *, ... );
482     void ( * intf_ErrMsg )     ( char *, ... );
483     void ( * intf_StatMsg )    ( char *, ... );
484     void ( * intf_WarnMsg )    ( int, char *, ... );
485
486     int  ( * intf_PlaylistAdd )     ( struct playlist_s *, int, const char* );
487     int  ( * intf_PlaylistDelete )  ( struct playlist_s *, int );
488     void ( * intf_PlaylistNext )    ( struct playlist_s * );
489     void ( * intf_PlaylistPrev )    ( struct playlist_s * );
490     void ( * intf_PlaylistDestroy ) ( struct playlist_s * );
491     void ( * intf_PlaylistJumpto )  ( struct playlist_s *, int );
492     void ( * intf_UrlDecode )       ( char * );
493     int  ( * intf_Eject )           ( const char * );
494
495     void    ( * msleep )            ( mtime_t );
496     mtime_t ( * mdate )             ( void );
497     char  * ( * mstrtime )          ( char *, mtime_t );
498
499     int  ( * network_ChannelCreate )( void );
500     int  ( * network_ChannelJoin )  ( int );
501
502     int  ( * input_SetProgram )     ( struct input_thread_s *,
503                                       struct pgrm_descriptor_s * );
504     void ( * input_SetStatus )      ( struct input_thread_s *, int );
505     void ( * input_Seek )           ( struct input_thread_s *, off_t );
506     void ( * input_DumpStream )     ( struct input_thread_s * );
507     char * ( * input_OffsetToTime ) ( struct input_thread_s *, char *, off_t );
508     int  ( * input_ChangeES )       ( struct input_thread_s *,
509                                       struct es_descriptor_s *, u8 );
510     int  ( * input_ToggleES )       ( struct input_thread_s *,
511                                       struct es_descriptor_s *, boolean_t );
512     int  ( * input_ChangeArea )     ( struct input_thread_s *,
513                                       struct input_area_s * );
514     int  ( * input_ChangeProgram )  ( struct input_thread_s *, u16 );
515     struct es_descriptor_s * ( * input_FindES ) ( struct input_thread_s *,
516                                                   u16 );
517     struct es_descriptor_s * ( * input_AddES ) ( struct input_thread_s *,
518                                       struct pgrm_descriptor_s *, u16, size_t );
519     void ( * input_DelES )          ( struct input_thread_s *,
520                                       struct es_descriptor_s * );
521     int  ( * input_SelectES )       ( struct input_thread_s *,
522                                       struct es_descriptor_s * );
523     int  ( * input_UnselectES )     ( struct input_thread_s *,
524                                       struct es_descriptor_s * );
525     struct pgrm_descriptor_s* ( * input_AddProgram ) ( struct input_thread_s *,
526                                                        u16, size_t );
527     void ( * input_DelProgram )     ( struct input_thread_s *,
528                                       struct pgrm_descriptor_s * );
529     struct input_area_s * ( * input_AddArea ) ( struct input_thread_s * );
530     void ( * input_DelArea )        ( struct input_thread_s *,
531                                       struct input_area_s * );
532
533     void ( * InitBitstream )        ( struct bit_stream_s *,
534                                       struct decoder_fifo_s *,
535                                       void ( * ) ( struct bit_stream_s *,
536                                                    boolean_t ),
537                                       void * );
538     void ( * BitstreamNextDataPacket )( struct bit_stream_s * );
539     boolean_t ( * NextDataPacket )  ( struct decoder_fifo_s *,
540                                       struct data_packet_s ** );
541     void ( * DecoderError )         ( struct decoder_fifo_s * p_fifo );
542     int  ( * input_InitStream )     ( struct input_thread_s *, size_t );
543     void ( * input_EndStream )      ( struct input_thread_s * );
544
545     void ( * input_ParsePES )       ( struct input_thread_s *,
546                                       struct es_descriptor_s * );
547     void ( * input_GatherPES )      ( struct input_thread_s *,
548                                       struct data_packet_s *,
549                                       struct es_descriptor_s *,
550                                       boolean_t, boolean_t );
551     void ( * input_DecodePES )      ( struct decoder_fifo_s *,
552                                       struct pes_packet_s * );
553     struct es_descriptor_s * ( * input_ParsePS ) ( struct input_thread_s *,
554                                                    struct data_packet_s * );
555     ssize_t ( * input_ReadPS )      ( struct input_thread_s *,
556                                       struct data_packet_s ** );
557     void ( * input_DemuxPS )        ( struct input_thread_s *,
558                                       struct data_packet_s * );
559     ssize_t ( * input_ReadTS )      ( struct input_thread_s *,
560                                       struct data_packet_s ** );
561     void ( * input_DemuxTS )        ( struct input_thread_s *,
562                                       struct data_packet_s * );
563     void ( * input_DemuxPSI )       ( struct input_thread_s *,
564                                       struct data_packet_s *,
565                                       struct es_descriptor_s *, 
566                                       boolean_t, boolean_t );
567     int ( * input_ClockManageControl )   ( struct input_thread_s *,
568                                            struct pgrm_descriptor_s *,
569                                            mtime_t );
570     void ( * input_FDSeek )         ( struct input_thread_s *, off_t );
571     void ( * input_FDClose )        ( struct input_thread_s * );
572     ssize_t ( * input_FDRead )          ( struct input_thread_s *, byte_t *,
573                                       size_t );
574     ssize_t ( * input_FDNetworkRead )   ( struct input_thread_s *, byte_t *,
575                                       size_t );
576
577     void * ( * input_BuffersInit )( void );
578     void ( * input_BuffersEnd )( struct input_buffers_s * );
579     struct data_buffer_s * ( * input_NewBuffer )( struct input_buffers_s *, size_t );
580     void ( * input_ReleaseBuffer )( struct input_buffers_s *, struct data_buffer_s * );
581     struct data_packet_s * ( * input_ShareBuffer )( struct input_buffers_s *,
582                                               struct data_buffer_s * );
583     struct data_packet_s * ( * input_NewPacket )( struct input_buffers_s *, size_t );
584     void ( * input_DeletePacket )( struct input_buffers_s *, struct data_packet_s * );
585     struct pes_packet_s * ( * input_NewPES )( struct input_buffers_s * );
586     void ( * input_DeletePES )( struct input_buffers_s *, struct pes_packet_s * );
587     ssize_t ( * input_FillBuffer )( struct input_thread_s * );
588     ssize_t ( * input_Peek )( struct input_thread_s *, byte_t **, size_t );
589     ssize_t ( * input_SplitBuffer )( struct input_thread_s *, struct data_packet_s **, size_t );
590     int ( * input_AccessInit )( struct input_thread_s * );
591     void ( * input_AccessReinit )( struct input_thread_s * );
592     void ( * input_AccessEnd )( struct input_thread_s * );
593
594     struct aout_fifo_s * ( * aout_CreateFifo ) ( int, int, int, int, void * );
595     void ( * aout_DestroyFifo )     ( struct aout_fifo_s * );
596
597     struct vout_thread_s * (* vout_CreateThread) ( int *, int, int, u32, int );
598     void  ( * vout_DestroyThread )  ( struct vout_thread_s *, int * );
599
600     struct picture_s * ( * vout_CreatePicture )
601                                     ( struct vout_thread_s *,
602                                       boolean_t, boolean_t, boolean_t ); 
603     void  ( * vout_AllocatePicture )( struct picture_s *, int, int, u32 );
604     void  ( * vout_DisplayPicture ) ( struct vout_thread_s *, 
605                                       struct picture_s * );
606     void  ( * vout_DestroyPicture ) ( struct vout_thread_s *,
607                                       struct picture_s * );
608     void  ( * vout_LinkPicture )    ( struct vout_thread_s *,
609                                       struct picture_s * );
610     void  ( * vout_UnlinkPicture )  ( struct vout_thread_s *,
611                                       struct picture_s * );
612     void  ( * vout_DatePicture )    ( struct vout_thread_s *, 
613                                       struct picture_s *, mtime_t );
614     void  ( * vout_PlacePicture )   ( struct vout_thread_s *, int, int,
615                                       int *, int *, int *, int * );
616
617     struct subpicture_s * (* vout_CreateSubPicture)
618                                         ( struct vout_thread_s *, int, int );
619     void  ( * vout_DestroySubPicture )  ( struct vout_thread_s *, 
620                                           struct subpicture_s * );
621     void  ( * vout_DisplaySubPicture )  ( struct vout_thread_s *, 
622                                           struct subpicture_s * );
623     
624     u32  ( * UnalignedShowBits )    ( struct bit_stream_s *, unsigned int );
625     void ( * UnalignedRemoveBits )  ( struct bit_stream_s * );
626     u32  ( * UnalignedGetBits )     ( struct bit_stream_s *, unsigned int );
627     void ( * CurrentPTS )           ( struct bit_stream_s *, mtime_t *,
628                                       mtime_t * );
629
630     char * ( * DecodeLanguage ) ( u16 );
631
632     struct module_s * ( * module_Need )   ( int, char *, void * );
633     void              ( * module_Unneed ) ( struct module_s * );
634
635 } module_symbols_t;
636
637 #ifdef PLUGIN
638 extern module_symbols_t* p_symbols;
639 #endif
640