1 /*****************************************************************************
2 * video_fifo.c : video FIFO management
3 *****************************************************************************
4 * Copyright (C) 1999, 2000 VideoLAN
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.
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.
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 *****************************************************************************/
24 /*****************************************************************************
26 *****************************************************************************/
27 #include <sys/types.h> /* on BSD, uio.h needs types.h */
28 #include <sys/uio.h> /* "input.h */
37 #include "debug.h" /* XXX?? temporaire, requis par netlist.h */
40 #include "input_netlist.h"
41 #include "decoder_fifo.h"
43 #include "video_output.h"
45 #include "vdec_idct.h"
46 #include "video_decoder.h"
47 #include "vdec_motion.h"
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"
55 /*****************************************************************************
56 * vpar_InitFIFO : initialize the video FIFO
57 *****************************************************************************/
58 void vpar_InitFIFO( vpar_thread_t * p_vpar )
64 p_vpar->vfifo.p_vpar = p_vpar;
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 );
72 /* Initialize FIFO properties */
73 p_vpar->vfifo.i_start = p_vpar->vfifo.i_end = 0;
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++ )
79 p_vpar->vbuffer.pp_mb_free[i_dummy] = p_vpar->vbuffer.p_macroblocks