VLC  4.0.0-dev
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
decoder.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * decoder.h: Input decoder functions
3  *****************************************************************************
4  * Copyright (C) 1998-2008 VLC authors and VideoLAN
5  * Copyright (C) 2008 Laurent Aimar
6  *
7  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
8  *
9  * This program is free software; you can redistribute it and/or modify it
10  * under the terms of the GNU Lesser General Public License as published by
11  * the Free Software Foundation; either version 2.1 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public License
20  * along with this program; if not, write to the Free Software Foundation,
21  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23 
24 #ifndef LIBVLC_INPUT_DECODER_H
25 #define LIBVLC_INPUT_DECODER_H 1
26 
27 #include <vlc_common.h>
28 #include <vlc_codec.h>
29 #include <vlc_mouse.h>
30 
32  /* notifications */
34  enum vlc_vout_order vout_order,
35  void *userdata);
37  void *userdata);
39  void *userdata);
40 
41  void (*on_new_video_stats)(vlc_input_decoder_t *decoder, unsigned decoded,
42  unsigned lost, unsigned displayed,
43  void *userdata);
44  void (*on_new_audio_stats)(vlc_input_decoder_t *decoder, unsigned decoded,
45  unsigned lost, unsigned played, void *userdata);
46 
47  /* requests */
49  input_attachment_t ***ppp_attachment,
50  void *userdata);
51 };
52 
55  input_resource_t *, sout_instance_t *, bool thumbnailing,
56  const struct vlc_input_decoder_callbacks *cbs,
57  void *userdata ) VLC_USED;
58 
59 /**
60  * This function changes the pause state.
61  * The date parameter MUST hold the exact date at which the change has been
62  * done for proper vout/aout pausing.
63  */
64 void vlc_input_decoder_ChangePause( vlc_input_decoder_t *, bool b_paused, vlc_tick_t i_date );
65 
66 /**
67  * Changes the decoder rate.
68  *
69  * This function changes rate of the intended playback speed to nominal speed.
70  * \param dec decoder
71  * \param rate playback rate (default is 1)
72  */
73 void vlc_input_decoder_ChangeRate( vlc_input_decoder_t *dec, float rate );
74 
75 /**
76  * This function changes the delay.
77  */
79 
80 /**
81  * This function makes the decoder start waiting for a valid data block from its fifo.
82  */
84 
85 /**
86  * This function waits for the decoder to actually receive data.
87  */
89 
90 /**
91  * This function exits the waiting mode of the decoder.
92  */
94 
95 /**
96  * This function returns true if the decoder fifo is empty and false otherwise.
97  */
99 
100 /**
101  * This function activates the request closed caption channel.
102  */
103 int vlc_input_decoder_SetCcState( vlc_input_decoder_t *, vlc_fourcc_t, int i_channel, bool b_decode );
104 
105 /**
106  * This function returns an error if the requested channel does not exist and
107  * set pb_decode to the channel status(active or not) otherwise.
108  */
109 int vlc_input_decoder_GetCcState( vlc_input_decoder_t *, vlc_fourcc_t, int i_channel, bool *pb_decode );
110 
111 /**
112  * This function get cc channels descriptions
113  */
115 
116 /**
117  * This function force the display of the next picture and fills the stream
118  * time consumed.
119  */
120 void vlc_input_decoder_FrameNext( vlc_input_decoder_t *p_dec, vlc_tick_t *pi_duration );
121 
122 /**
123  * This function will return true if the ES format or meta data have changed since
124  * the last call. In which case, it will do a copy of the current es_format_t if p_fmt
125  * is not NULL and will do a copy of the current description if pp_meta is non NULL.
126  * The es_format_t MUST be freed by es_format_Clean and *pp_meta MUST be freed by
127  * vlc_meta_Delete.
128  * Otherwise it will return false and will not initialize p_fmt and *pp_meta.
129  */
131 
132 /**
133  * This function returns the current size in bytes of the decoder fifo
134  */
136 
138 int vlc_input_decoder_SetVbiPage( vlc_input_decoder_t *, unsigned page );
140 
144 
145 #endif
Definition: vlc_input.h:160
Definition: resource.c:47
int vlc_input_decoder_SetCcState(vlc_input_decoder_t *, vlc_fourcc_t, int i_channel, bool b_decode)
This function activates the request closed caption channel.
Definition: decoder.c:2369
bool vlc_input_decoder_HasFormatChanged(vlc_input_decoder_t *p_dec, es_format_t *p_fmt, vlc_meta_t **pp_meta)
This function will return true if the ES format or meta data have changed since the last call...
Definition: decoder.c:2530
bool vlc_input_decoder_IsEmpty(vlc_input_decoder_t *)
This function returns true if the decoder fifo is empty and false otherwise.
Definition: decoder.c:2244
int(* get_attachments)(vlc_input_decoder_t *decoder, input_attachment_t ***ppp_attachment, void *userdata)
Definition: decoder.h:48
void(* vlc_mouse_event)(const vlc_mouse_t *mouse, void *user_data)
Mouse event callback.
Definition: vlc_mouse.h:62
Video picture.
Definition: vlc_picture.h:127
This file is a collection of common definitions and types.
vlc_input_decoder_t * vlc_input_decoder_New(vlc_object_t *parent, es_format_t *, vlc_clock_t *, input_resource_t *, sout_instance_t *, bool thumbnailing, const struct vlc_input_decoder_callbacks *cbs, void *userdata)
Spawns a new decoder thread from the input thread.
Definition: decoder.c:2136
Video subtitle.
Definition: vlc_subpicture.h:166
void vlc_input_decoder_StopWait(vlc_input_decoder_t *)
This function exits the waiting mode of the decoder.
Definition: decoder.c:2476
int vlc_input_decoder_GetCcState(vlc_input_decoder_t *, vlc_fourcc_t, int i_channel, bool *pb_decode)
This function returns an error if the requested channel does not exist and set pb_decode to the chann...
Definition: decoder.c:2424
void vlc_input_decoder_GetCcDesc(vlc_input_decoder_t *, decoder_cc_desc_t *)
This function get cc channels descriptions.
Definition: decoder.c:2340
Definition: vlc_codec.h:207
void vlc_input_decoder_SetVoutMouseEvent(vlc_input_decoder_t *, vlc_mouse_event, void *)
Definition: decoder.c:2591
Definition: decoder.c:65
int64_t vlc_tick_t
High precision date or time interval.
Definition: vlc_tick.h:45
uint32_t vlc_fourcc_t
Definition: fourcc_gen.c:33
Definition: clock.c:61
Definition: vlc_es.h:617
Video output thread descriptor.
Definition: vlc_vout.h:60
void vlc_input_decoder_FrameNext(vlc_input_decoder_t *p_dec, vlc_tick_t *pi_duration)
This function force the display of the next picture and fills the stream time consumed.
Definition: decoder.c:2510
int vlc_input_decoder_GetVbiPage(vlc_input_decoder_t *, bool *opaque)
Definition: decoder.c:2566
void vlc_input_decoder_StartWait(vlc_input_decoder_t *)
This function makes the decoder start waiting for a valid data block from its fifo.
Definition: decoder.c:2464
vlc_vout_order
vout or spu_channel order
Definition: vlc_vout.h:78
void(* on_new_audio_stats)(vlc_input_decoder_t *decoder, unsigned decoded, unsigned lost, unsigned played, void *userdata)
Definition: decoder.h:44
int vlc_input_decoder_DelVoutOverlay(vlc_input_decoder_t *, size_t)
Definition: decoder.c:2635
int vlc_input_decoder_SetVbiPage(vlc_input_decoder_t *, unsigned page)
Definition: decoder.c:2575
Definition: meta.c:39
void vlc_input_decoder_ChangeRate(vlc_input_decoder_t *dec, float rate)
Changes the decoder rate.
Definition: decoder.c:2450
void(* on_thumbnail_ready)(vlc_input_decoder_t *decoder, picture_t *pic, void *userdata)
Definition: decoder.h:38
void(* on_new_video_stats)(vlc_input_decoder_t *decoder, unsigned decoded, unsigned lost, unsigned displayed, void *userdata)
Definition: decoder.h:41
void vlc_input_decoder_ChangeDelay(vlc_input_decoder_t *, vlc_tick_t i_delay)
This function changes the delay.
Definition: decoder.c:2457
Stream output instance (FIXME: should be private to src/ to avoid invalid unsynchronized access) ...
Definition: vlc_sout.h:48
void(* on_vout_started)(vlc_input_decoder_t *decoder, vout_thread_t *vout, enum vlc_vout_order vout_order, void *userdata)
Definition: decoder.h:33
void(* on_vout_stopped)(vlc_input_decoder_t *decoder, vout_thread_t *vout, void *userdata)
Definition: decoder.h:36
Decoder and encoder modules interface.
VLC object common members.
Definition: vlc_objects.h:43
int vlc_input_decoder_AddVoutOverlay(vlc_input_decoder_t *, subpicture_t *, size_t *)
Definition: decoder.c:2605
Definition: decoder.h:31
#define VLC_USED
Definition: fourcc_gen.c:32
size_t vlc_input_decoder_GetFifoSize(vlc_input_decoder_t *p_dec)
This function returns the current size in bytes of the decoder fifo.
Definition: decoder.c:2555
void vlc_input_decoder_Wait(vlc_input_decoder_t *)
This function waits for the decoder to actually receive data.
Definition: decoder.c:2486
int vlc_input_decoder_SetVbiOpaque(vlc_input_decoder_t *, bool opaque)
Definition: decoder.c:2583
void vlc_input_decoder_ChangePause(vlc_input_decoder_t *, bool b_paused, vlc_tick_t i_date)
This function changes the pause state.
Definition: decoder.c:2436