]> git.sesse.net Git - vlc/blob - src/input/input.h
0c7352552c9d7428fad1c5cb50bbc5dde85998db
[vlc] / src / input / input.h
1 /* Communication plugin -> input */
2
3 #define INPUT_READ_ONCE     7   /* We live in a world dominated by Ethernet. *
4                                  * Ethernet MTU is 1500 bytes, so in a UDP   *
5                                  * packet we can put : 1500/188 = 7 TS       *
6                                  * packets. Have a nice day and merry Xmas.  */
7
8 /*****************************************************************************
9  * input_capabilities_t
10  *****************************************************************************
11  * This structure gives pointers to the useful methods of the plugin
12  *****************************************************************************/
13 typedef struct input_capabilities_s
14 {
15     /* Plugin properties */
16     int                     i_weight; /* for a given stream type, the plugin *
17                                        * with higher weight will be used     */
18
19     /* Init/End */
20     int                  (* pf_probe)( struct input_thread_s * );
21     void                 (* pf_init)( struct input_thread_s * );
22     void                 (* pf_end)( struct input_thread_s * );
23
24     /* Read & Demultiplex */
25     void                 (* pf_read)( struct input_thread_s *,
26                           struct data_packet_s * pp_packets[INPUT_READ_ONCE] );
27     void                 (* pf_demux)( struct input_thread_s *,
28                                        struct data_packet_s * );
29
30     /* Packet management facilities */
31     struct data_packet_s *(* pf_new_packet)( void *, size_t );
32     struct pes_packet_s *(* pf_new_pes)( void * );
33     void                 (* pf_delete_packet)( void *,
34                                                struct data_packet_s * );
35     void                 (* pf_delete_pes)( void *, struct pes_packet_s * );
36
37     /* Stream control capabilities */
38     int                  (* pf_rewind)( struct input_thread_s * );
39                                            /* NULL if we don't support going *
40                                             * backwards (it's gonna be fun)  */
41     int                  (* pf_seek)( struct input_thread_s *, off_t );
42 } input_capabilities_t;
43
44 /*****************************************************************************
45  * Prototypes from input_ext-dec.c
46  *****************************************************************************/
47 void InitBitstream  ( struct bit_stream_s *, struct decoder_fifo_s * );
48 void NextDataPacket ( struct bit_stream_s * );
49
50 /*****************************************************************************
51  * Prototypes from input_programs.c
52  *****************************************************************************/
53 void input_InitStream( struct input_thread_s *, size_t );
54 struct pgrm_descriptor_s * input_AddProgram( struct input_thread_s *,
55                                              u16, size_t );
56 void input_DelProgram( struct input_thread_s *, u16 );
57 struct es_descriptor_s * input_AddES( struct input_thread_s *,
58                                       struct pgrm_descriptor_s *, u16,
59                                       size_t );
60 void input_DelES( struct input_thread_s *, u16 );
61 int input_SelectES( struct input_thread_s *, struct es_descriptor_s * );
62