vlmshell: convert seconds to ticks using vlc_tick_from_sec()
[vlc.git] / src / input / decoder.h
blob2cfda8cc54f2e550610e4d1ca994fa03cca8806c
1 /*****************************************************************************
2 * decoder.h: Input decoder functions
3 *****************************************************************************
4 * Copyright (C) 1998-2008 VLC authors and VideoLAN
5 * Copyright (C) 2008 Laurent Aimar
6 * $Id$
8 * Authors: Laurent Aimar <fenrir@via.ecp.fr>
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU Lesser General Public License as published by
12 * the Free Software Foundation; either version 2.1 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with this program; if not, write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 #ifndef LIBVLC_INPUT_DECODER_H
26 #define LIBVLC_INPUT_DECODER_H 1
28 #include <vlc_common.h>
29 #include <vlc_codec.h>
31 decoder_t *input_DecoderNew( input_thread_t *, es_format_t *, input_clock_t *,
32 sout_instance_t * ) VLC_USED;
34 /**
35 * This function changes the pause state.
36 * The date parameter MUST hold the exact date at which the change has been
37 * done for proper vout/aout pausing.
39 void input_DecoderChangePause( decoder_t *, bool b_paused, vlc_tick_t i_date );
41 /**
42 * Changes the decoder rate.
44 * This function changes rate of the intended playback speed to nominal speed.
45 * \param dec decoder
46 * \param rate playback rate (default is 1)
48 void input_DecoderChangeRate( decoder_t *dec, float rate );
50 /**
51 * This function changes the delay.
53 void input_DecoderChangeDelay( decoder_t *, vlc_tick_t i_delay );
55 /**
56 * This function makes the decoder start waiting for a valid data block from its fifo.
58 void input_DecoderStartWait( decoder_t * );
60 /**
61 * This function waits for the decoder to actually receive data.
63 void input_DecoderWait( decoder_t * );
65 /**
66 * This function exits the waiting mode of the decoder.
68 void input_DecoderStopWait( decoder_t * );
70 /**
71 * This function returns true if the decoder fifo is empty and false otherwise.
73 bool input_DecoderIsEmpty( decoder_t * );
75 /**
76 * This function activates the request closed caption channel.
78 int input_DecoderSetCcState( decoder_t *, vlc_fourcc_t, int i_channel, bool b_decode );
80 /**
81 * This function returns an error if the requested channel does not exist and
82 * set pb_decode to the channel status(active or not) otherwise.
84 int input_DecoderGetCcState( decoder_t *, vlc_fourcc_t, int i_channel, bool *pb_decode );
86 /**
87 * This function get cc channels descriptions
89 void input_DecoderGetCcDesc( decoder_t *, decoder_cc_desc_t * );
91 /**
92 * This function force the display of the next picture and fills the stream
93 * time consumed.
95 void input_DecoderFrameNext( decoder_t *p_dec, vlc_tick_t *pi_duration );
97 /**
98 * This function will return true if the ES format or meta data have changed since
99 * the last call. In which case, it will do a copy of the current es_format_t if p_fmt
100 * is not NULL and will do a copy of the current description if pp_meta is non NULL.
101 * The es_format_t MUST be freed by es_format_Clean and *pp_meta MUST be freed by
102 * vlc_meta_Delete.
103 * Otherwise it will return false and will not initialize p_fmt and *pp_meta.
105 bool input_DecoderHasFormatChanged( decoder_t *p_dec, es_format_t *p_fmt, vlc_meta_t **pp_meta );
108 * This function returns the current size in bytes of the decoder fifo
110 size_t input_DecoderGetFifoSize( decoder_t *p_dec );
113 * This function returns the objects associated to a decoder
115 * They must be released using vlc_object_release().
117 void input_DecoderGetObjects( decoder_t *, vout_thread_t **, audio_output_t ** );
119 #endif