1 /*
2  * This file is part of MPlayer.
3  *
4  * MPlayer is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * MPlayer is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with MPlayer; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef MPLAYER_MPCOMMON_H
20 #define MPLAYER_MPCOMMON_H
21 
22 #include "m_config.h"
23 #include "m_option.h"
24 #include "sub/subreader.h"
25 #include "libmpdemux/demuxer.h"
26 #include "sub/ass_mp.h"
27 
28 #define ROUND(x) ((int)((x) < 0 ? (x) - 0.5 : (x) + 0.5))
29 
30 struct stream;
31 struct sh_audio;
32 struct sh_video;
33 struct sh_sub;
34 
35 extern double sub_last_pts;
36 extern ASS_Track *ass_track;
37 extern subtitle *vo_sub_last;
38 extern char *spudec_ifo;
39 extern int forced_subs_only;
40 
41 extern int sub_auto;
42 extern float sub_delay;
43 extern float sub_fps;
44 extern char **sub_name;
45 extern char **sub_paths;
46 extern char  *font_name;
47 extern char  *sub_font_name;
48 extern char  *audio_lang;
49 extern char  *dvdsub_lang;
50 
51 extern float  font_factor;
52 extern double force_fps;
53 extern double video_time_usage;
54 extern double vout_time_usage;
55 
56 extern int disable_system_conf;
57 extern int disable_user_conf;
58 extern int audio_id;
59 extern int video_id;
60 extern int dvdsub_id;
61 extern int vobsub_id;
62 
63 extern int stream_cache_size;
64 extern float stream_cache_min_percent;
65 extern float stream_cache_seek_min_percent;
66 
67 extern const char *mencoder_version;
68 extern const char *mplayer_version;
69 
70 extern m_config_t *mconfig;
71 extern const m_option_t noconfig_opts[];
72 
73 void print_version(const char* name);
74 void init_vo_spudec(struct stream *stream, struct sh_video *sh_video, struct sh_sub *sh_sub);
75 void update_subtitles(struct sh_video *sh_video, double refpts, demux_stream_t *d_dvdsub, int reset);
76 void update_teletext(struct sh_video *sh_video, demuxer_t *demuxer, int reset);
77 int select_audio(demuxer_t* demuxer, int audio_id, char* audio_lang);
78 int select_video(demuxer_t* demuxer, int video_id);
79 void set_osd_subtitle(subtitle *subs);
80 
81 int cfg_inc_verbose(m_option_t *conf);
82 int cfg_include(m_option_t *conf, const char *filename);
83 
84 void common_preinit(int *argc_ptr, char **argv_ptr[]);
85 int common_init(void);
86 void common_uninit(void);
87 
88 double calc_a_pts(struct sh_audio *sh_audio, demux_stream_t *d_audio);
89 
90 #endif /* MPLAYER_MPCOMMON_H */
91