]> git.sesse.net Git - vlc/blob - src/video_parser/video_fifo.c
Encore un commit venu tout droit des abysses de l'enfer, d�sol� pour
[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:
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 GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public
19  * License along with this program; if not, write to the
20  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  *****************************************************************************/
23
24 /*****************************************************************************
25  * Preamble
26  *****************************************************************************/
27 #include <sys/types.h>                        /* on BSD, uio.h needs types.h */
28 #include <sys/uio.h>                                             /* "input.h */
29
30 #include "config.h"
31 #include "common.h"
32 #include "mtime.h"
33 #include "threads.h"
34
35 #include "intf_msg.h"
36 #include "debug.h"                 /* XXX?? temporaire, requis par netlist.h */
37
38 #include "input.h"
39 #include "input_netlist.h"
40 #include "decoder_fifo.h"
41 #include "video.h"
42 #include "video_output.h"
43
44 #include "vdec_idct.h"
45 #include "video_decoder.h"
46 #include "vdec_motion.h"
47
48 #include "vpar_blocks.h"
49 #include "vpar_headers.h"
50 #include "vpar_synchro.h"
51 #include "video_parser.h"
52 #include "video_fifo.h"
53
54 /*****************************************************************************
55  * vpar_InitFIFO : initialize the video FIFO
56  *****************************************************************************/
57 void vpar_InitFIFO( vpar_thread_t * p_vpar )
58 {
59 #ifdef VDEC_SMP
60     int                 i_dummy;
61 #endif
62
63     p_vpar->vfifo.p_vpar = p_vpar;
64
65 #ifdef VDEC_SMP
66     /* Initialize mutex and cond */
67     vlc_mutex_init( &p_vpar->vfifo.lock );
68     vlc_cond_init( &p_vpar->vfifo.wait );
69     vlc_mutex_init( &p_vpar->vbuffer.lock );
70
71     /* Initialize FIFO properties */
72     p_vpar->vfifo.i_start = p_vpar->vfifo.i_end = 0;
73
74     /* Initialize buffer properties */
75     p_vpar->vbuffer.i_index = VFIFO_SIZE; /* all structures are available */
76     for( i_dummy = 0; i_dummy < VFIFO_SIZE + 1; i_dummy++ )
77     {
78         p_vpar->vbuffer.pp_mb_free[i_dummy] = p_vpar->vbuffer.p_macroblocks
79                                                + i_dummy;
80     }
81 #endif
82 }