]> git.sesse.net Git - vlc/blob - src/video_parser/video_fifo.c
D�but du portage BeOS. Beaucoup de fuchiers ont �t� modifi� car il a fallu
[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 "threads.h"
31 #include "config.h"
32 #include "common.h"
33 #include "mtime.h"
34 #include "plugins.h"
35
36 #include "intf_msg.h"
37 #include "debug.h"                 /* XXX?? temporaire, requis par netlist.h */
38
39 #include "input.h"
40 #include "input_netlist.h"
41 #include "decoder_fifo.h"
42 #include "video.h"
43 #include "video_output.h"
44
45 #include "vdec_idct.h"
46 #include "video_decoder.h"
47 #include "vdec_motion.h"
48
49 #include "vpar_blocks.h"
50 #include "vpar_headers.h"
51 #include "vpar_synchro.h"
52 #include "video_parser.h"
53 #include "video_fifo.h"
54
55 /*****************************************************************************
56  * vpar_InitFIFO : initialize the video FIFO
57  *****************************************************************************/
58 void vpar_InitFIFO( vpar_thread_t * p_vpar )
59 {
60 #ifdef VDEC_SMP
61     int                 i_dummy;
62 #endif
63
64     p_vpar->vfifo.p_vpar = p_vpar;
65
66 #ifdef VDEC_SMP
67     /* Initialize mutex and cond */
68     vlc_mutex_init( &p_vpar->vfifo.lock );
69     vlc_cond_init( &p_vpar->vfifo.wait );
70     vlc_mutex_init( &p_vpar->vbuffer.lock );
71
72     /* Initialize FIFO properties */
73     p_vpar->vfifo.i_start = p_vpar->vfifo.i_end = 0;
74
75     /* Initialize buffer properties */
76     p_vpar->vbuffer.i_index = VFIFO_SIZE; /* all structures are available */
77     for( i_dummy = 0; i_dummy < VFIFO_SIZE + 1; i_dummy++ )
78     {
79         p_vpar->vbuffer.pp_mb_free[i_dummy] = p_vpar->vbuffer.p_macroblocks
80                                                + i_dummy;
81     }
82 #endif
83 }