]> git.sesse.net Git - vlc/blob - src/input/input_ext-intf.c
* Functional fast forward and slow motion API ;
[vlc] / src / input / input_ext-intf.c
1 /*****************************************************************************
2  * input_ext-intf.c: services to the interface
3  *****************************************************************************
4  * Copyright (C) 1998, 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
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 "config.h"
29 #include "common.h"
30 #include "threads.h"
31 #include "mtime.h"
32
33 #include "intf_msg.h"
34
35 #include "stream_control.h"
36 #include "input_ext-dec.h"
37 #include "input_ext-intf.h"
38
39 #include "input.h"
40
41 /*****************************************************************************
42  * input_Play: comes back to the normal pace of reading
43  *****************************************************************************/
44 void input_Play( input_thread_t * p_input )
45 {
46     intf_Msg( "Playing normally" );
47     vlc_mutex_lock( &p_input->stream.stream_lock );
48     p_input->stream.i_new_status = PLAYING_S;
49     vlc_mutex_unlock( &p_input->stream.stream_lock );
50 }
51
52 /*****************************************************************************
53  * input_Forward: manages fast forward and slow motion
54  *****************************************************************************
55  * Note that if i_rate > DEFAULT_RATE, the pace is slower.
56  *****************************************************************************/
57 void input_Forward( input_thread_t * p_input, int i_rate )
58 {
59     intf_Msg( "Forward enabled" );
60     vlc_mutex_lock( &p_input->stream.stream_lock );
61     p_input->stream.i_new_status = FORWARD_S;
62     p_input->stream.i_new_rate = i_rate;
63     vlc_mutex_unlock( &p_input->stream.stream_lock );
64 }