1 /*****************************************************************************
2  * chromecast_common.h: Chromecast common code between modules for vlc
3  *****************************************************************************
4  * Copyright © 2015-2016 VideoLAN
5  *
6  * Authors: Adrien Maglo <magsoft@videolan.org>
7  *          Jean-Baptiste Kempf <jb@videolan.org>
8  *          Steve Lhomme <robux4@videolabs.io>
9  *
10  * This program is free software; you can redistribute it and/or modify it
11  * under the terms of the GNU Lesser General Public License as published by
12  * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * along with this program; if not, write to the Free Software Foundation,
22  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24 
25 #ifndef VLC_CHROMECAST_COMMON_H
26 #define VLC_CHROMECAST_COMMON_H
27 
28 #include <vlc_input.h>
29 
30 # ifdef __cplusplus
31 extern "C" {
32 # endif
33 
34 #define CC_SHARED_VAR_NAME "cc_sout"
35 
36 #define CC_PACE_ERR        (-2)
37 #define CC_PACE_ERR_RETRY  (-1)
38 #define CC_PACE_OK          (0)
39 #define CC_PACE_OK_WAIT     (1)
40 #define CC_PACE_OK_ENDED    (2)
41 
42 enum cc_input_event
43 {
44     CC_INPUT_EVENT_EOF,
45     CC_INPUT_EVENT_RETRY,
46 };
47 
48 union cc_input_arg
49 {
50     bool eof;
51 };
52 
53 typedef void (*on_input_event_itf)( void *data, enum cc_input_event, union cc_input_arg );
54 
55 typedef void (*on_paused_changed_itf)( void *data, bool );
56 
57 typedef struct
58 {
59     void *p_opaque;
60 
61     void (*pf_set_demux_enabled)(void *, bool enabled, on_paused_changed_itf, void *);
62 
63     mtime_t (*pf_get_time)(void*);
64 
65     int (*pf_pace)(void*);
66 
67     void (*pf_send_input_event)(void*, enum cc_input_event, union cc_input_arg);
68 
69     void (*pf_set_pause_state)(void*, bool paused);
70 
71     void (*pf_set_meta)(void*, vlc_meta_t *p_meta);
72 
73 } chromecast_common;
74 
75 # ifdef __cplusplus
76 }
77 # endif
78 
79 #endif // VLC_CHROMECAST_COMMON_H
80 
81