]> git.sesse.net Git - vlc/blob - src/video_parser/video_fifo.c
0c625def24daaddd940af6f26424c54f7adf1cbf
[vlc] / src / video_parser / video_fifo.c
1 /*****************************************************************************
2  * video_fifo.c : video FIFO management
3  * (c)1999 VideoLAN
4  *****************************************************************************/
5
6 /*****************************************************************************
7  * Preamble
8  *****************************************************************************/
9 #include <errno.h>
10 #include <stdlib.h>
11 #include <stdio.h>
12 #include <unistd.h>
13 #include <string.h>
14 #include <sys/uio.h>
15
16 #include "config.h"
17 #include "common.h"
18 #include "mtime.h"
19 #include "vlc_thread.h"
20
21 #include "intf_msg.h"
22 #include "debug.h"                 /* XXX?? temporaire, requis par netlist.h */
23
24 #include "input.h"
25 #include "input_netlist.h"
26 #include "decoder_fifo.h"
27 #include "video.h"
28 #include "video_output.h"
29
30 #include "vdec_idct.h"
31 #include "video_decoder.h"
32 #include "vdec_motion.h"
33
34 #include "vpar_blocks.h"
35 #include "vpar_headers.h"
36 #include "vpar_synchro.h"
37 #include "video_parser.h"
38 #include "video_fifo.h"
39
40 /*****************************************************************************
41  * vpar_InitFIFO : initialize the video FIFO
42  *****************************************************************************/
43 void vpar_InitFIFO( vpar_thread_t * p_vpar )
44 {
45 #ifdef VDEC_SMP
46     int                 i_dummy;
47 #endif
48
49     p_vpar->vfifo.p_vpar = p_vpar;
50
51 #ifdef VDEC_SMP
52     /* Initialize mutex and cond */
53     vlc_mutex_init( &p_vpar->vfifo.lock );
54     vlc_cond_init( &p_vpar->vfifo.wait );
55     vlc_mutex_init( &p_vpar->vbuffer.lock );
56
57     /* Initialize FIFO properties */
58     p_vpar->vfifo.i_start = p_vpar->vfifo.i_end = 0;
59
60     /* Initialize buffer properties */
61     p_vpar->vbuffer.i_index = VFIFO_SIZE; /* all structures are available */
62     for( i_dummy = 0; i_dummy < VFIFO_SIZE + 1; i_dummy++ )
63     {
64         p_vpar->vbuffer.pp_mb_free[i_dummy] = p_vpar->vbuffer.p_macroblocks
65                                                + i_dummy;
66     }
67 #endif
68 }