]> git.sesse.net Git - vlc/blob - src/input/es_out.h
Fix meta writing (inverted logic in the core).
[vlc] / src / input / es_out.h
1 /*****************************************************************************
2  * es_out.h: Input es_out functions
3  *****************************************************************************
4  * Copyright (C) 1998-2008 the VideoLAN team
5  * Copyright (C) 2008 Laurent Aimar
6  * $Id$
7  *
8  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
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 General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24
25 #if defined(__PLUGIN__) || defined(__BUILTIN__) || !defined(__LIBVLC__)
26 # error This header file can only be included from LibVLC.
27 #endif
28
29 #ifndef _INPUT_ES_OUT_H
30 #define _INPUT_ES_OUT_H 1
31
32 #include <vlc_common.h>
33
34 enum es_out_mode_e
35 {
36     ES_OUT_MODE_NONE,   /* don't select anything */
37     ES_OUT_MODE_ALL,    /* eg for stream output */
38     ES_OUT_MODE_AUTO,   /* best audio/video or for input follow audio-track, sub-track */
39     ES_OUT_MODE_PARTIAL /* select programs given after --programs */
40 };
41
42 enum es_out_query_private_e
43 {
44
45     /* activate application of mode */
46     ES_OUT_SET_ACTIVE = ES_OUT_PRIVATE_START,       /* arg1= bool                     */
47
48     /* set/get mode */
49     ES_OUT_SET_MODE,                                /* arg1= int                            */
50
51     /* Get date to wait before demuxing more data */
52     ES_OUT_GET_WAKE_UP,                             /* arg1=mtime_t*            res=cannot fail */
53
54     /* Wrapper for some ES command to work with id */
55     ES_OUT_SET_ES_BY_ID,
56     ES_OUT_RESTART_ES_BY_ID,
57     ES_OUT_SET_ES_DEFAULT_BY_ID,
58
59     /* Get buffering state */
60     ES_OUT_GET_BUFFERING,                           /* arg1=bool*               res=cannot fail */
61
62     /* Set delay for a ES category */
63     ES_OUT_SET_DELAY,                               /* arg1=es_category_e,      res=can fail */
64
65     /* Set record state */
66     ES_OUT_SET_RECORD_STATE,                        /* arg1=bool                res=can fail */
67
68     /* Set pause state */
69     ES_OUT_SET_PAUSE_STATE,                         /* arg1=bool b_source_paused, bool b_paused arg2=mtime_t   res=can fail */
70
71     /* Set rate */
72     ES_OUT_SET_RATE,                                /* arg1=int i_source_rate arg2=int i_rate                  res=can fail */
73
74     /* Set a new time */
75     ES_OUT_SET_TIME,                                /* arg1=mtime_t             res=can fail */
76
77     /* Set next frame */
78     ES_OUT_SET_FRAME_NEXT,                          /*                          res=can fail */
79
80     /* Set position/time/length */
81     ES_OUT_SET_TIMES,                               /* arg1=double f_position arg2=mtime_t i_time arg3=mtime_t i_length res=cannot fail */
82
83     /* Set jitter */
84     ES_OUT_SET_JITTER,                              /* arg1=mtime_t i_pts_delay arg2=int i_cr_average res=cannot fail */
85 };
86
87 static inline mtime_t es_out_GetWakeup( es_out_t *p_out )
88 {
89     mtime_t i_wu;
90     int i_ret = es_out_Control( p_out, ES_OUT_GET_WAKE_UP, &i_wu );
91
92     assert( !i_ret );
93     return i_wu;
94 }
95 static inline bool es_out_GetBuffering( es_out_t *p_out )
96 {
97     bool b;
98     int i_ret = es_out_Control( p_out, ES_OUT_GET_BUFFERING, &b );
99
100     assert( !i_ret );
101     return b;
102 }
103 static inline bool es_out_GetEmpty( es_out_t *p_out )
104 {
105     bool b;
106     int i_ret = es_out_Control( p_out, ES_OUT_GET_EMPTY, &b );
107
108     assert( !i_ret );
109     return b;
110 }
111 static inline int es_out_SetDelay( es_out_t *p_out, int i_cat, mtime_t i_delay )
112 {
113     return es_out_Control( p_out, ES_OUT_SET_DELAY, i_cat, i_delay );
114 }
115 static inline int es_out_SetRecordState( es_out_t *p_out, bool b_record )
116 {
117     return es_out_Control( p_out, ES_OUT_SET_RECORD_STATE, b_record );
118 }
119 static inline int es_out_SetPauseState( es_out_t *p_out, bool b_source_paused, bool b_paused, mtime_t i_date )
120 {
121     return es_out_Control( p_out, ES_OUT_SET_PAUSE_STATE, b_source_paused, b_paused, i_date );
122 }
123 static inline int es_out_SetRate( es_out_t *p_out, int i_source_rate, int i_rate )
124 {
125     return es_out_Control( p_out, ES_OUT_SET_RATE, i_source_rate, i_rate );
126 }
127 static inline int es_out_SetTime( es_out_t *p_out, mtime_t i_date )
128 {
129     return es_out_Control( p_out, ES_OUT_SET_TIME, i_date );
130 }
131 static inline int es_out_SetFrameNext( es_out_t *p_out )
132 {
133     return es_out_Control( p_out, ES_OUT_SET_FRAME_NEXT );
134 }
135 static inline void es_out_SetTimes( es_out_t *p_out, double f_position, mtime_t i_time, mtime_t i_length )
136 {
137     int i_ret = es_out_Control( p_out, ES_OUT_SET_TIMES, f_position, i_time, i_length );
138     assert( !i_ret );
139 }
140 static inline void es_out_SetJitter( es_out_t *p_out, mtime_t i_pts_delay, int i_cr_average )
141 {
142     int i_ret = es_out_Control( p_out, ES_OUT_SET_JITTER, i_pts_delay, i_cr_average );
143     assert( !i_ret );
144 }
145
146 es_out_t  *input_EsOutNew( input_thread_t *, int i_rate );
147
148 #endif