VLC 4.0.0-dev
Loading...
Searching...
No Matches
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_decoder.h>
29#include <vlc_codec.h>
30#include <vlc_mouse.h>
31
32#include "input_internal.h"
33
34struct vlc_clock_t;
35
37 /* notifications */
39 enum vlc_vout_order vout_order,
40 void *userdata);
42 void *userdata);
43 void (*on_output_paused)(vlc_input_decoder_t *decoder, bool paused,
44 vlc_tick_t pause_date,
45 void *userdata);
46
48 void *userdata);
49
50 void (*on_new_video_stats)(vlc_input_decoder_t *decoder, unsigned decoded,
51 unsigned lost, unsigned displayed, unsigned late,
52 void *userdata);
53 void (*on_new_audio_stats)(vlc_input_decoder_t *decoder, unsigned decoded,
54 unsigned lost, unsigned played, void *userdata);
55 void (*frame_next_status)(vlc_input_decoder_t *decoder, int status,
56 void *userdata);
57 void (*frame_previous_status)(vlc_input_decoder_t *decoder, int status,
58 void *userdata);
60 unsigned frame_rate, unsigned frame_rate_base,
61 int steps, bool failed, void *userdata);
62 /* requests */
64 input_attachment_t ***ppp_attachment,
65 void *userdata);
66};
67
81
84 const struct vlc_input_decoder_cfg *cfg );
85
86/**
87 * This function changes the pause state.
88 * The date parameter MUST hold the exact date at which the change has been
89 * done for proper vout/aout pausing.
90 */
91void vlc_input_decoder_ChangePause( vlc_input_decoder_t *, bool b_paused, vlc_tick_t i_date );
92
93/**
94 * Changes the decoder rate.
95 *
96 * This function changes rate of the intended playback speed to nominal speed.
97 * \param dec decoder
98 * \param rate playback rate (default is 1)
99 */
101
102/**
103 * This function makes the decoder start waiting for a valid data block from its fifo.
104 */
106
107/**
108 * This function waits for the decoder to actually receive data.
109 */
111
112/**
113 * This function exits the waiting mode of the decoder.
114 */
116
117/**
118 * This function returns true if the decoder fifo is empty and false otherwise.
119 */
121
122/**
123 * This function forces the display of the next picture
124 */
126
127/**
128 * This function forces the display of the previous picture
129 */
131
132/*
133 * This function reset the decoder for normal playback after a previous or a
134 * next frame call.
135 */
137
138/**
139 * This function Creates and adds the requested SubDec.
140 *
141 * The sub decoder returned by this function must be deleted with
142 * vlc_input_decoder_Delete() before the parent is deleted.
143 */
146 const struct vlc_input_decoder_cfg *cfg);
147
153
154void vlc_subdec_desc_Clean(struct vlc_subdec_desc *desc);
155
156
158{
159 struct {
160 /* True if the ES format or meta data have changed since the last call.
161 * */
163 /* If changed is true, a copy of the current es_format_t, MUST be freed
164 * with es_format_Clean() */
166 /* If changed is true, a copy of the current description, can be NULL,
167 * MUST be freed with vlc_meta_Delete.() */
170
172};
173
174/**
175 * Get the last status of the decoder.
176 */
178 vlc_frame_t *frame, bool do_pace,
179 struct vlc_input_decoder_status *status);
180
181/**
182 * This function returns the current size in bytes of the decoder fifo
183 */
185
189
193
194#endif
void vlc_input_decoder_StopWait(vlc_input_decoder_t *)
This function exits the waiting mode of the decoder.
Definition decoder.c:2820
int vlc_input_decoder_DelVoutOverlay(vlc_input_decoder_t *, size_t)
Definition decoder.c:3016
void vlc_subdec_desc_Clean(struct vlc_subdec_desc *desc)
Definition decoder.c:2450
void vlc_input_decoder_DecodeWithStatus(vlc_input_decoder_t *p_dec, vlc_frame_t *frame, bool do_pace, struct vlc_input_decoder_status *status)
Get the last status of the decoder.
Definition decoder.c:2539
vlc_input_decoder_t * vlc_input_decoder_CreateSubDec(vlc_input_decoder_t *dec, const struct vlc_input_decoder_cfg *cfg)
This function Creates and adds the requested SubDec.
Definition decoder.c:2747
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:2805
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:2776
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:2936
void vlc_input_decoder_FramePrevious(vlc_input_decoder_t *p_dec)
This function forces the display of the previous picture.
Definition decoder.c:2902
void vlc_input_decoder_FrameNext(vlc_input_decoder_t *p_dec)
This function forces the display of the next picture.
Definition decoder.c:2871
vlc_input_decoder_t * vlc_input_decoder_New(vlc_object_t *parent, const struct vlc_input_decoder_cfg *cfg)
Spawns a new decoder thread from the input thread.
Definition decoder.c:2382
int vlc_input_decoder_AddVoutOverlay(vlc_input_decoder_t *, subpicture_t *, size_t *)
Definition decoder.c:2986
void vlc_input_decoder_StopFrameNext(vlc_input_decoder_t *p_dec)
Definition decoder.c:2864
int vlc_input_decoder_GetVbiPage(vlc_input_decoder_t *, bool *opaque)
Definition decoder.c:2947
void vlc_input_decoder_Wait(vlc_input_decoder_t *)
This function waits for the decoder to actually receive data.
Definition decoder.c:2832
void vlc_input_decoder_ChangeRate(vlc_input_decoder_t *dec, float rate)
Changes the decoder rate.
Definition decoder.c:2791
void vlc_input_decoder_SetVoutMouseEvent(vlc_input_decoder_t *, vlc_mouse_event, void *)
Definition decoder.c:2972
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:2628
int vlc_input_decoder_SetVbiOpaque(vlc_input_decoder_t *, bool opaque)
Definition decoder.c:2964
int vlc_input_decoder_SetVbiPage(vlc_input_decoder_t *, unsigned page)
Definition decoder.c:2956
vlc_vout_order
vout or spu_channel order
Definition vlc_vout.h:70
input_type
Definition input_internal.h:52
Definition vlc_es.h:614
Definition vlc_input.h:168
Definition resource.c:58
Video picture.
Definition vlc_picture.h:128
Definition vlc_sout.h:274
Video subtitle.
Definition vlc_subpicture.h:248
Definition clock.c:128
Definition vlc_frame.h:122
Definition decoder.h:36
void(* on_output_paused)(vlc_input_decoder_t *decoder, bool paused, vlc_tick_t pause_date, void *userdata)
Definition decoder.h:43
void(* on_new_video_stats)(vlc_input_decoder_t *decoder, unsigned decoded, unsigned lost, unsigned displayed, unsigned late, void *userdata)
Definition decoder.h:50
int(* get_attachments)(vlc_input_decoder_t *decoder, input_attachment_t ***ppp_attachment, void *userdata)
Definition decoder.h:63
void(* frame_previous_status)(vlc_input_decoder_t *decoder, int status, void *userdata)
Definition decoder.h:57
void(* on_vout_started)(vlc_input_decoder_t *decoder, vout_thread_t *vout, enum vlc_vout_order vout_order, void *userdata)
Definition decoder.h:38
void(* on_new_audio_stats)(vlc_input_decoder_t *decoder, unsigned decoded, unsigned lost, unsigned played, void *userdata)
Definition decoder.h:53
void(* frame_previous_seek)(vlc_input_decoder_t *decoder, vlc_tick_t pts, unsigned frame_rate, unsigned frame_rate_base, int steps, bool failed, void *userdata)
Definition decoder.h:59
void(* frame_next_status)(vlc_input_decoder_t *decoder, int status, void *userdata)
Definition decoder.h:55
void(* on_vout_stopped)(vlc_input_decoder_t *decoder, vout_thread_t *vout, void *userdata)
Definition decoder.h:41
void(* on_thumbnail_ready)(vlc_input_decoder_t *decoder, picture_t *pic, void *userdata)
Definition decoder.h:47
Definition decoder.h:69
const es_format_t * fmt
Definition decoder.h:70
struct vlc_clock_t * clock
Definition decoder.h:72
input_resource_t * resource
Definition decoder.h:73
unsigned cc_decoder
Definition decoder.h:77
sout_stream_t * sout
Definition decoder.h:74
const struct vlc_input_decoder_callbacks * cbs
Definition decoder.h:78
const char * str_id
Definition decoder.h:71
enum input_type input_type
Definition decoder.h:75
void * cbs_data
Definition decoder.h:79
bool hw_dec
Definition decoder.h:76
Definition decoder.h:158
es_format_t fmt
Definition decoder.h:165
vlc_meta_t * meta
Definition decoder.h:168
bool changed
Definition decoder.h:162
struct vlc_subdec_desc subdec_desc
Definition decoder.h:171
struct vlc_input_decoder_status::@19 format
Definition decoder.c:153
Definition meta.c:46
VLC object common members.
Definition vlc_objects.h:53
Definition decoder.h:149
size_t fmt_count
Definition decoder.h:151
es_format_t * fmt_array
Definition decoder.h:150
Video output thread descriptor.
Definition vlc_vout.h:54
Decoder and encoder modules interface.
This file is a collection of common definitions and types.
void(* vlc_mouse_event)(const vlc_mouse_t *mouse, void *user_data)
Mouse event callback.
Definition vlc_mouse.h:62
int64_t vlc_tick_t
High precision date or time interval.
Definition vlc_tick.h:48