]> git.sesse.net Git - vlc/blob - plugins/dvd/dvd_netlist.h
-New function for DVD reading, that is able to read multiple blocks
[vlc] / plugins / dvd / dvd_netlist.h
1 /*****************************************************************************
2  * dvd_netlist.h: Specific netlist structures for DVD packets
3  *****************************************************************************
4  * Copyright (C) 1998, 1999, 2000, 2001 VideoLAN
5  * $Id: dvd_netlist.h,v 1.1 2001/03/02 03:32:46 stef Exp $
6  *
7  * Authors: Henri Fallon <henri@videolan.org>
8  *          Stéphane Borel <stef@videolan.org>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  * 
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
23  *****************************************************************************/
24
25 /*****************************************************************************
26  * netlist_t: structure to manage a netlist
27  *****************************************************************************/
28 typedef struct netlist_s
29 {
30     vlc_mutex_t             lock;
31
32     size_t                  i_buffer_size;
33
34     /* Buffers */
35     byte_t *                p_buffers;                 /* Big malloc'ed area */
36     data_packet_t *         p_data;                        /* malloc'ed area */
37     pes_packet_t *          p_pes;                         /* malloc'ed area */
38
39     /* FIFOs of free packets */
40     data_packet_t **        pp_free_data;
41     pes_packet_t **         pp_free_pes;
42     struct iovec *          p_free_iovec;
43     
44     /* FIFO size */
45     unsigned int            i_nb_iovec;
46     unsigned int            i_nb_pes;
47     unsigned int            i_nb_data;
48
49     /* Index */
50     unsigned int            i_iovec_start, i_iovec_end;
51     unsigned int            i_data_start, i_data_end;
52     unsigned int            i_pes_start, i_pes_end;
53
54     /* Reference counters for iovec */
55     unsigned int *          pi_refcount;
56
57     /* Nb of packets read once */
58     unsigned int            i_read_once;
59
60 } netlist_t;
61
62 /*****************************************************************************
63  * Prototypes
64  *****************************************************************************/
65 int                     DVDNetlistInit( struct input_thread_s *,
66                                         int , int, int, size_t, int );
67
68 struct iovec *          DVDGetiovec( void * p_method_data );
69 void                    DVDMviovec( void * , int, struct data_packet_s **);
70 struct data_packet_s *  DVDNewPtr( void * );
71 struct data_packet_s *  DVDNewPacket( void *, size_t );
72 struct pes_packet_s *   DVDNewPES( void * );
73 void                    DVDDeletePacket( void *, struct data_packet_s * );
74 void                    DVDDeletePES( void *, struct pes_packet_s * );
75 void                    DVDNetlistEnd( struct input_thread_s * );