]> git.sesse.net Git - vlc/blob - src/input/es_out.h
Revert "Hide es out timeshift delay from time display."
[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_query_private_e
35 {
36
37     /* activate application of mode */
38     ES_OUT_SET_ACTIVE = ES_OUT_PRIVATE_START,       /* arg1= bool                     */
39
40     /* set/get mode */
41     ES_OUT_SET_MODE,                                /* arg1= int                            */
42
43     /* Get date to wait before demuxing more data */
44     ES_OUT_GET_WAKE_UP,                             /* arg1=mtime_t*            res=cannot fail */
45
46     /* Wrapper for some ES command to work with id */
47     ES_OUT_SET_ES_BY_ID,
48     ES_OUT_RESTART_ES_BY_ID,
49     ES_OUT_SET_ES_DEFAULT_BY_ID,
50
51     /* Get buffering state */
52     ES_OUT_GET_BUFFERING,                           /* arg1=bool*               res=cannot fail */
53
54     /* Check if es_out has still data to play */
55     ES_OUT_GET_EMPTY,                               /* arg1=bool*               res=cannot fail */
56
57     /* Set delay for a ES category */
58     ES_OUT_SET_DELAY,                               /* arg1=es_category_e,      res=can fail */
59
60     /* Set record state */
61     ES_OUT_SET_RECORD_STATE,                        /* arg1=bool                res=can fail */
62
63     /* Set pause state */
64     ES_OUT_SET_PAUSE_STATE,                         /* arg1=bool b_source_paused, bool b_paused arg2=mtime_t   res=can fail */
65
66     /* Set rate */
67     ES_OUT_SET_RATE,                                /* arg1=int i_source_rate arg2=int i_rate                  res=can fail */
68
69     /* Set a new time */
70     ES_OUT_SET_TIME,                                /* arg1=mtime_t             res=can fail */
71
72     /* Set next frame */
73     ES_OUT_SET_FRAME_NEXT,                          /*                          res=can fail */
74 };
75
76 static inline mtime_t es_out_GetWakeup( es_out_t *p_out )
77 {
78     mtime_t i_wu;
79     int i_ret = es_out_Control( p_out, ES_OUT_GET_WAKE_UP, &i_wu );
80
81     assert( !i_ret );
82     return i_wu;
83 }
84 static inline bool es_out_GetBuffering( es_out_t *p_out )
85 {
86     bool b;
87     int i_ret = es_out_Control( p_out, ES_OUT_GET_BUFFERING, &b );
88
89     assert( !i_ret );
90     return b;
91 }
92 static inline bool es_out_GetEmpty( es_out_t *p_out )
93 {
94     bool b;
95     int i_ret = es_out_Control( p_out, ES_OUT_GET_EMPTY, &b );
96
97     assert( !i_ret );
98     return b;
99 }
100 static inline int es_out_SetDelay( es_out_t *p_out, int i_cat, mtime_t i_delay )
101 {
102     return es_out_Control( p_out, ES_OUT_SET_DELAY, i_cat, i_delay );
103 }
104 static inline int es_out_SetRecordState( es_out_t *p_out, bool b_record )
105 {
106     return es_out_Control( p_out, ES_OUT_SET_RECORD_STATE, b_record );
107 }
108 static inline int es_out_SetPauseState( es_out_t *p_out, bool b_source_paused, bool b_paused, mtime_t i_date )
109 {
110     return es_out_Control( p_out, ES_OUT_SET_PAUSE_STATE, b_source_paused, b_paused, i_date );
111 }
112 static inline int es_out_SetRate( es_out_t *p_out, int i_source_rate, int i_rate )
113 {
114     return es_out_Control( p_out, ES_OUT_SET_RATE, i_source_rate, i_rate );
115 }
116 static inline int es_out_SetTime( es_out_t *p_out, mtime_t i_date )
117 {
118     return es_out_Control( p_out, ES_OUT_SET_TIME, i_date );
119 }
120 static inline int es_out_SetFrameNext( es_out_t *p_out )
121 {
122     return es_out_Control( p_out, ES_OUT_SET_FRAME_NEXT );
123 }
124
125 es_out_t  *input_EsOutNew( input_thread_t *, int i_rate );
126
127 #endif