decoder.h 3.79 KB
Newer Older
1
/*****************************************************************************
2
 * decoder.h: Input decoder functions
3
 *****************************************************************************
Jean-Baptiste Kempf's avatar
LGPL  
Jean-Baptiste Kempf committed
4
 * Copyright (C) 1998-2008 VLC authors and VideoLAN
5 6 7 8 9
 * Copyright (C) 2008 Laurent Aimar
 * $Id$
 *
 * Authors: Laurent Aimar <fenrir@via.ecp.fr>
 *
Jean-Baptiste Kempf's avatar
LGPL  
Jean-Baptiste Kempf committed
10 11 12
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or
13 14 15 16
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Jean-Baptiste Kempf's avatar
LGPL  
Jean-Baptiste Kempf committed
17 18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
19
 *
Jean-Baptiste Kempf's avatar
LGPL  
Jean-Baptiste Kempf committed
20 21 22
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 24
 *****************************************************************************/

25 26
#ifndef LIBVLC_INPUT_DECODER_H
#define LIBVLC_INPUT_DECODER_H 1
27 28 29 30

#include <vlc_common.h>
#include <vlc_codec.h>

31
decoder_t *input_DecoderNew( input_thread_t *, es_format_t *, input_clock_t *,
32
                             sout_instance_t * ) VLC_USED;
33

34
/**
35
 * This function changes the pause state.
36
 * The date parameter MUST hold the exact date at which the change has been
37 38 39 40
 * done for proper vout/aout pausing.
 */
void input_DecoderChangePause( decoder_t *, bool b_paused, mtime_t i_date );

41 42 43 44 45
/**
 * This function changes the delay.
 */
void input_DecoderChangeDelay( decoder_t *, mtime_t i_delay );

46
/**
47
 * This function makes the decoder start waiting for a valid data block from its fifo.
48
 */
49
void input_DecoderStartWait( decoder_t * );
Laurent Aimar's avatar
Laurent Aimar committed
50

51
/**
52
 * This function waits for the decoder to actually receive data.
53
 */
54
void input_DecoderWait( decoder_t * );
55

Laurent Aimar's avatar
Laurent Aimar committed
56
/**
57
 * This function exits the waiting mode of the decoder.
Laurent Aimar's avatar
Laurent Aimar committed
58
 */
59
void input_DecoderStopWait( decoder_t * );
60 61 62 63

/**
 * This function returns true if the decoder fifo is empty and false otherwise.
 */
64
bool input_DecoderIsEmpty( decoder_t * );
65 66 67 68

/**
 * This function activates the request closed caption channel.
 */
69 70
int input_DecoderSetCcState( decoder_t *, bool b_decode, int i_channel );

71 72 73 74
/**
 * This function returns an error if the requested channel does not exist and
 * set pb_decode to the channel status(active or not) otherwise.
 */
75
int input_DecoderGetCcState( decoder_t *, bool *pb_decode, int i_channel );
76 77 78 79 80

/**
 * This function set each pb_present entry to true if the corresponding channel
 * exists or false otherwise.
 */
81
void input_DecoderIsCcPresent( decoder_t *, bool pb_present[4] );
82

83 84 85 86 87 88
/**
 * This function force the display of the next picture and fills the stream
 * time consumed.
 */
void input_DecoderFrameNext( decoder_t *p_dec, mtime_t *pi_duration );

89
/**
Laurent Aimar's avatar
Laurent Aimar committed
90 91 92 93 94 95
 * This function will return true if the ES format or meta data have changed since
 * the last call. In which case, it will do a copy of the current es_format_t if p_fmt
 * is not NULL and will do a copy of the current description if pp_meta is non NULL.
 * The es_format_t MUST be freed by es_format_Clean and *pp_meta MUST be freed by
 * vlc_meta_Delete.
 * Otherwise it will return false and will not initialize p_fmt and *pp_meta.
96
 */
Laurent Aimar's avatar
Laurent Aimar committed
97
bool input_DecoderHasFormatChanged( decoder_t *p_dec, es_format_t *p_fmt, vlc_meta_t **pp_meta );
98

99 100 101 102 103
/**
 * This function returns the current size in bytes of the decoder fifo
 */
size_t input_DecoderGetFifoSize( decoder_t *p_dec );

104 105 106 107 108
/**
 * This function returns the objects associated to a decoder
 *
 * They must be released using vlc_object_release().
 */
109
void input_DecoderGetObjects( decoder_t *, vout_thread_t **, audio_output_t ** );
110

111
#endif