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