]> git.sesse.net Git - vlc/blob - src/video_parser/video_fifo.c
The input-II. (more info by mail in about an hour)
[vlc] / src / video_parser / video_fifo.c
1 /*****************************************************************************
2  * video_fifo.c : video FIFO management
3  *****************************************************************************
4  * Copyright (C) 1999, 2000 VideoLAN
5  *
6  * Authors: Christophe Massiot <massiot@via.ecp.fr>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  * 
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
21  *****************************************************************************/
22
23 /*****************************************************************************
24  * Preamble
25  *****************************************************************************/
26 #include "defs.h"
27
28 #include <sys/types.h>                        /* on BSD, uio.h needs types.h */
29 #include <sys/uio.h>                                             /* "input.h */
30
31 #include "config.h"
32 #include "common.h"
33 #include "threads.h"
34 #include "mtime.h"
35 #include "plugins.h"
36
37 #include "intf_msg.h"
38 #include "debug.h"                 /* XXX?? temporaire, requis par netlist.h */
39
40 #include "stream_control.h"
41 #include "input_ext-dec.h"
42
43 #include "video.h"
44 #include "video_output.h"
45
46 #include "vdec_idct.h"
47 #include "video_decoder.h"
48 #include "vdec_motion.h"
49
50 #include "vpar_blocks.h"
51 #include "vpar_headers.h"
52 #include "vpar_synchro.h"
53 #include "video_parser.h"
54 #include "video_fifo.h"
55
56 /*****************************************************************************
57  * vpar_InitFIFO : initialize the video FIFO
58  *****************************************************************************/
59 void vpar_InitFIFO( vpar_thread_t * p_vpar )
60 {
61 #ifdef VDEC_SMP
62     int                 i_dummy;
63 #endif
64
65     p_vpar->vfifo.p_vpar = p_vpar;
66
67 #ifdef VDEC_SMP
68     /* Initialize mutex and cond */
69     vlc_mutex_init( &p_vpar->vfifo.lock );
70     vlc_cond_init( &p_vpar->vfifo.wait );
71     vlc_mutex_init( &p_vpar->vbuffer.lock );
72
73     /* Initialize FIFO properties */
74     p_vpar->vfifo.i_start = p_vpar->vfifo.i_end = 0;
75
76     /* Initialize buffer properties */
77     p_vpar->vbuffer.i_index = VFIFO_SIZE; /* all structures are available */
78     for( i_dummy = 0; i_dummy < VFIFO_SIZE + 1; i_dummy++ )
79     {
80         p_vpar->vbuffer.pp_mb_free[i_dummy] = p_vpar->vbuffer.p_macroblocks
81                                                + i_dummy;
82     }
83 #endif
84 }