]> git.sesse.net Git - vlc/blob - plugins/dvd/dvd_netlist.h
9d7579c833fedcc3328d22d30145938c15bc69d1
[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.2 2001/03/03 07:07:01 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 dvd_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 } dvd_netlist_t;
61
62 /*****************************************************************************
63  * Prototypes
64  *****************************************************************************/
65 struct dvd_netlist_s *  DVDNetlistInit( int , int, int, size_t, int );
66 struct iovec *          DVDGetiovec( void * p_method_data );
67 void                    DVDMviovec( void * , int, struct data_packet_s **);
68 struct data_packet_s *  DVDNewPtr( void * );
69 struct data_packet_s *  DVDNewPacket( void *, size_t );
70 struct pes_packet_s *   DVDNewPES( void * );
71 void                    DVDDeletePacket( void *, struct data_packet_s * );
72 void                    DVDDeletePES( void *, struct pes_packet_s * );
73 void                    DVDNetlistEnd( struct dvd_netlist_s * );