]> git.sesse.net Git - vlc/blob - include/common.h
* ./include/common.h: fixed the compilation fix for Borland C++ :)
[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.88 2002/03/19 04:22:02 ipkiss 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 #   if defined( __BORLANDC__ )
427 #       undef off_t
428 #       define off_t __int64
429 #   endif
430
431 #   ifndef O_NONBLOCK
432 #       define O_NONBLOCK 0
433 #   endif
434
435 #   ifndef snprintf
436 #       define snprintf _snprintf  /* snprintf not defined in mingw32 (bug?) */
437 #   endif
438
439 #endif
440
441 /*****************************************************************************
442  * CPU capabilities
443  *****************************************************************************/
444 #define CPU_CAPABILITY_NONE    0
445 #define CPU_CAPABILITY_486     (1<<0)
446 #define CPU_CAPABILITY_586     (1<<1)
447 #define CPU_CAPABILITY_PPRO    (1<<2)
448 #define CPU_CAPABILITY_MMX     (1<<3)
449 #define CPU_CAPABILITY_3DNOW   (1<<4)
450 #define CPU_CAPABILITY_MMXEXT  (1<<5)
451 #define CPU_CAPABILITY_SSE     (1<<6)
452 #define CPU_CAPABILITY_ALTIVEC (1<<16)
453 #define CPU_CAPABILITY_FPU     (1<<31)
454
455 /*****************************************************************************
456  * I18n stuff
457  *****************************************************************************/
458 #if defined( ENABLE_NLS ) && defined ( HAVE_GETTEXT )
459 #   include <libintl.h>
460 #else
461 #   define _(String) (String)
462 #   define N_(String) (String)
463 #endif
464
465 /*****************************************************************************
466  * Plug-in stuff
467  *****************************************************************************/
468 typedef struct module_symbols_s
469 {
470     struct main_s* p_main;
471     struct module_bank_s* p_module_bank;
472     struct input_bank_s* p_input_bank;
473     struct aout_bank_s*  p_aout_bank;
474     struct vout_bank_s*  p_vout_bank;
475
476     int    ( * config_GetIntVariable ) ( const char * );
477     char * ( * config_GetPszVariable ) ( const char * );
478     void   ( * config_PutIntVariable ) ( const char *, int );
479     void   ( * config_PutPszVariable ) ( const char *, char * );
480     int    ( * config_LoadConfigFile ) ( const char * );
481     int    ( * config_SaveConfigFile ) ( const char * );
482     struct module_config_s * ( * config_FindConfig ) ( const char * );
483     struct module_config_s * ( * config_Duplicate ) ( struct module_s * );
484
485     struct intf_subscription_s * ( * intf_MsgSub ) ( void );
486     void ( * intf_MsgUnsub )   ( struct intf_subscription_s * );
487
488     void ( * intf_Msg )        ( char *, ... );
489     void ( * intf_ErrMsg )     ( char *, ... );
490     void ( * intf_StatMsg )    ( char *, ... );
491     void ( * intf_WarnMsg )    ( int, char *, ... );
492
493     int  ( * intf_PlaylistAdd )     ( struct playlist_s *, int, const char* );
494     int  ( * intf_PlaylistDelete )  ( struct playlist_s *, int );
495     void ( * intf_PlaylistNext )    ( struct playlist_s * );
496     void ( * intf_PlaylistPrev )    ( struct playlist_s * );
497     void ( * intf_PlaylistDestroy ) ( struct playlist_s * );
498     void ( * intf_PlaylistJumpto )  ( struct playlist_s *, int );
499     void ( * intf_UrlDecode )       ( char * );
500     int  ( * intf_Eject )           ( const char * );
501
502     void    ( * msleep )            ( mtime_t );
503     mtime_t ( * mdate )             ( void );
504     char  * ( * mstrtime )          ( char *, mtime_t );
505
506     int  ( * network_ChannelCreate )( void );
507     int  ( * network_ChannelJoin )  ( int );
508
509     int  ( * input_SetProgram )     ( struct input_thread_s *,
510                                       struct pgrm_descriptor_s * );
511     void ( * input_SetStatus )      ( struct input_thread_s *, int );
512     void ( * input_Seek )           ( struct input_thread_s *, off_t );
513     void ( * input_DumpStream )     ( struct input_thread_s * );
514     char * ( * input_OffsetToTime ) ( struct input_thread_s *, char *, off_t );
515     int  ( * input_ChangeES )       ( struct input_thread_s *,
516                                       struct es_descriptor_s *, u8 );
517     int  ( * input_ToggleES )       ( struct input_thread_s *,
518                                       struct es_descriptor_s *, boolean_t );
519     int  ( * input_ChangeArea )     ( struct input_thread_s *,
520                                       struct input_area_s * );
521     int  ( * input_ChangeProgram )  ( struct input_thread_s *, u16 );
522     struct es_descriptor_s * ( * input_FindES ) ( struct input_thread_s *,
523                                                   u16 );
524     struct es_descriptor_s * ( * input_AddES ) ( struct input_thread_s *,
525                                       struct pgrm_descriptor_s *, u16, size_t );
526     void ( * input_DelES )          ( struct input_thread_s *,
527                                       struct es_descriptor_s * );
528     int  ( * input_SelectES )       ( struct input_thread_s *,
529                                       struct es_descriptor_s * );
530     int  ( * input_UnselectES )     ( struct input_thread_s *,
531                                       struct es_descriptor_s * );
532     struct pgrm_descriptor_s* ( * input_AddProgram ) ( struct input_thread_s *,
533                                                        u16, size_t );
534     void ( * input_DelProgram )     ( struct input_thread_s *,
535                                       struct pgrm_descriptor_s * );
536     struct input_area_s * ( * input_AddArea ) ( struct input_thread_s * );
537     void ( * input_DelArea )        ( struct input_thread_s *,
538                                       struct input_area_s * );
539
540     void ( * InitBitstream )        ( struct bit_stream_s *,
541                                       struct decoder_fifo_s *,
542                                       void ( * ) ( struct bit_stream_s *,
543                                                    boolean_t ),
544                                       void * );
545     void ( * BitstreamNextDataPacket )( struct bit_stream_s * );
546     boolean_t ( * NextDataPacket )  ( struct decoder_fifo_s *,
547                                       struct data_packet_s ** );
548     void ( * DecoderError )         ( struct decoder_fifo_s * p_fifo );
549     int  ( * input_InitStream )     ( struct input_thread_s *, size_t );
550     void ( * input_EndStream )      ( struct input_thread_s * );
551
552     void ( * input_ParsePES )       ( struct input_thread_s *,
553                                       struct es_descriptor_s * );
554     void ( * input_GatherPES )      ( struct input_thread_s *,
555                                       struct data_packet_s *,
556                                       struct es_descriptor_s *,
557                                       boolean_t, boolean_t );
558     void ( * input_DecodePES )      ( struct decoder_fifo_s *,
559                                       struct pes_packet_s * );
560     struct es_descriptor_s * ( * input_ParsePS ) ( struct input_thread_s *,
561                                                    struct data_packet_s * );
562     ssize_t ( * input_ReadPS )      ( struct input_thread_s *,
563                                       struct data_packet_s ** );
564     void ( * input_DemuxPS )        ( struct input_thread_s *,
565                                       struct data_packet_s * );
566     ssize_t ( * input_ReadTS )      ( struct input_thread_s *,
567                                       struct data_packet_s ** );
568     void ( * input_DemuxTS )        ( struct input_thread_s *,
569                                       struct data_packet_s * );
570     void ( * input_DemuxPSI )       ( struct input_thread_s *,
571                                       struct data_packet_s *,
572                                       struct es_descriptor_s *, 
573                                       boolean_t, boolean_t );
574     int ( * input_ClockManageControl )   ( struct input_thread_s *,
575                                            struct pgrm_descriptor_s *,
576                                            mtime_t );
577     void ( * input_FDSeek )         ( struct input_thread_s *, off_t );
578     void ( * input_FDClose )        ( struct input_thread_s * );
579     ssize_t ( * input_FDRead )          ( struct input_thread_s *, byte_t *,
580                                       size_t );
581     ssize_t ( * input_FDNetworkRead )   ( struct input_thread_s *, byte_t *,
582                                       size_t );
583
584     void * ( * input_BuffersInit )( void );
585     void ( * input_BuffersEnd )( struct input_buffers_s * );
586     struct data_buffer_s * ( * input_NewBuffer )( struct input_buffers_s *, size_t );
587     void ( * input_ReleaseBuffer )( struct input_buffers_s *, struct data_buffer_s * );
588     struct data_packet_s * ( * input_ShareBuffer )( struct input_buffers_s *,
589                                               struct data_buffer_s * );
590     struct data_packet_s * ( * input_NewPacket )( struct input_buffers_s *, size_t );
591     void ( * input_DeletePacket )( struct input_buffers_s *, struct data_packet_s * );
592     struct pes_packet_s * ( * input_NewPES )( struct input_buffers_s * );
593     void ( * input_DeletePES )( struct input_buffers_s *, struct pes_packet_s * );
594     ssize_t ( * input_FillBuffer )( struct input_thread_s * );
595     ssize_t ( * input_Peek )( struct input_thread_s *, byte_t **, size_t );
596     ssize_t ( * input_SplitBuffer )( struct input_thread_s *, struct data_packet_s **, size_t );
597     int ( * input_AccessInit )( struct input_thread_s * );
598     void ( * input_AccessReinit )( struct input_thread_s * );
599     void ( * input_AccessEnd )( struct input_thread_s * );
600
601     struct aout_fifo_s * ( * aout_CreateFifo ) ( int, int, int, int, void * );
602     void ( * aout_DestroyFifo )     ( struct aout_fifo_s * );
603
604     struct vout_thread_s * (* vout_CreateThread) ( int *, int, int, u32, int );
605     void  ( * vout_DestroyThread )  ( struct vout_thread_s *, int * );
606
607     struct picture_s * ( * vout_CreatePicture )
608                                     ( struct vout_thread_s *,
609                                       boolean_t, boolean_t, boolean_t ); 
610     void  ( * vout_AllocatePicture )( struct picture_s *, int, int, u32 );
611     void  ( * vout_DisplayPicture ) ( struct vout_thread_s *, 
612                                       struct picture_s * );
613     void  ( * vout_DestroyPicture ) ( struct vout_thread_s *,
614                                       struct picture_s * );
615     void  ( * vout_LinkPicture )    ( struct vout_thread_s *,
616                                       struct picture_s * );
617     void  ( * vout_UnlinkPicture )  ( struct vout_thread_s *,
618                                       struct picture_s * );
619     void  ( * vout_DatePicture )    ( struct vout_thread_s *, 
620                                       struct picture_s *, mtime_t );
621     void  ( * vout_PlacePicture )   ( struct vout_thread_s *, int, int,
622                                       int *, int *, int *, int * );
623
624     struct subpicture_s * (* vout_CreateSubPicture)
625                                         ( struct vout_thread_s *, int, int );
626     void  ( * vout_DestroySubPicture )  ( struct vout_thread_s *, 
627                                           struct subpicture_s * );
628     void  ( * vout_DisplaySubPicture )  ( struct vout_thread_s *, 
629                                           struct subpicture_s * );
630     
631     u32  ( * UnalignedShowBits )    ( struct bit_stream_s *, unsigned int );
632     void ( * UnalignedRemoveBits )  ( struct bit_stream_s * );
633     u32  ( * UnalignedGetBits )     ( struct bit_stream_s *, unsigned int );
634     void ( * CurrentPTS )           ( struct bit_stream_s *, mtime_t *,
635                                       mtime_t * );
636
637     char * ( * DecodeLanguage ) ( u16 );
638
639     struct module_s * ( * module_Need )   ( int, char *, void * );
640     void              ( * module_Unneed ) ( struct module_s * );
641
642 } module_symbols_t;
643
644 #ifdef PLUGIN
645 extern module_symbols_t* p_symbols;
646 #endif
647