1 /*****************************************************************************
2 * input.h: structures of the input not exported to other modules
3 *****************************************************************************
4 * Copyright (C) 1999, 2000 VideoLAN
5 * $Id: input.h,v 1.4 2000/12/20 16:04:31 massiot Exp $
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
22 *****************************************************************************/
25 * Communication plugin -> input
28 /* FIXME: you've gotta move this move this, you've gotta move this move this */
29 #define INPUT_READ_ONCE 7 /* We live in a world dominated by Ethernet. *
30 * Ethernet MTU is 1500 bytes, so in a UDP *
31 * packet we can put : 1500/188 = 7 TS *
32 * packets. Have a nice day and merry Xmas. */
34 /*****************************************************************************
35 * input_capabilities_t
36 *****************************************************************************
37 * This structure gives pointers to the useful methods of the plugin
38 *****************************************************************************/
39 typedef struct input_capabilities_s
41 /* Plugin properties */
42 int i_weight; /* for a given stream type, the plugin *
43 * with higher weight will be used */
46 int (* pf_probe)( struct input_thread_s * );
47 void (* pf_init)( struct input_thread_s * );
48 void (* pf_end)( struct input_thread_s * );
50 /* Read & Demultiplex */
51 int (* pf_read)( struct input_thread_s *,
52 struct data_packet_s * pp_packets[INPUT_READ_ONCE] );
53 void (* pf_demux)( struct input_thread_s *,
54 struct data_packet_s * );
56 /* Packet management facilities */
57 struct data_packet_s *(* pf_new_packet)( void *, size_t );
58 struct pes_packet_s *(* pf_new_pes)( void * );
59 void (* pf_delete_packet)( void *,
60 struct data_packet_s * );
61 void (* pf_delete_pes)( void *, struct pes_packet_s * );
63 /* Stream control capabilities */
64 int (* pf_rewind)( struct input_thread_s * );
65 /* NULL if we don't support going *
66 * backwards (it's gonna be fun) */
67 int (* pf_seek)( struct input_thread_s *, off_t );
68 } input_capabilities_t;
70 /*****************************************************************************
71 * Prototypes from input_ext-dec.c
72 *****************************************************************************/
73 void InitBitstream ( struct bit_stream_s *, struct decoder_fifo_s * );
74 void NextDataPacket ( struct bit_stream_s * );
76 /*****************************************************************************
77 * Prototypes from input_programs.c
78 *****************************************************************************/
79 void input_InitStream( struct input_thread_s *, size_t );
80 struct pgrm_descriptor_s * input_AddProgram( struct input_thread_s *,
82 void input_DelProgram( struct input_thread_s *, u16 );
83 void input_DumpStream( struct input_thread_s * );
84 struct es_descriptor_s * input_AddES( struct input_thread_s *,
85 struct pgrm_descriptor_s *, u16,
87 void input_DelES( struct input_thread_s *, u16 );
88 int input_SelectES( struct input_thread_s *, struct es_descriptor_s * );