Reformat vd.c
[mplayer.git] / mp_core.h
blob7c8d3b4d5a2288fc05e03c12470e896d938e8d1c
1 #ifndef MPLAYER_MP_CORE_H
2 #define MPLAYER_MP_CORE_H
4 #include "options.h"
5 #include "mixer.h"
6 #include "subreader.h"
8 // definitions used internally by the core player code
10 #define INITIALIZED_VO 1
11 #define INITIALIZED_AO 2
12 #define INITIALIZED_GUI 4
13 #define INITIALIZED_GETCH2 8
14 #define INITIALIZED_SPUDEC 32
15 #define INITIALIZED_STREAM 64
16 #define INITIALIZED_INPUT 128
17 #define INITIALIZED_VOBSUB 256
18 #define INITIALIZED_DEMUXER 512
19 #define INITIALIZED_ACODEC 1024
20 #define INITIALIZED_VCODEC 2048
21 #define INITIALIZED_ALL 0xFFFF
24 #define SUB_SOURCE_SUBS 0
25 #define SUB_SOURCE_VOBSUB 1
26 #define SUB_SOURCE_DEMUX 2
27 #define SUB_SOURCES 3
30 #define PT_NEXT_ENTRY 1
31 #define PT_PREV_ENTRY -1
32 #define PT_NEXT_SRC 2
33 #define PT_PREV_SRC -2
34 #define PT_UP_NEXT 3
35 #define PT_UP_PREV -3
38 typedef struct MPContext {
39 struct MPOpts opts;
40 struct vo_x11_state *x11_state;
41 int osd_show_percentage;
42 int osd_function;
43 const ao_functions_t *audio_out;
44 struct play_tree *playtree;
45 struct play_tree_iter *playtree_iter;
46 int eof;
47 int play_tree_step;
49 struct stream *stream;
50 struct demuxer *demuxer;
51 struct sh_audio *sh_audio;
52 struct sh_video *sh_video;
53 struct demux_stream *d_audio;
54 struct demux_stream *d_video;
55 struct demux_stream *d_sub;
56 mixer_t mixer;
57 struct vo *video_out;
58 // Frames buffered in the vo ready to flip. Currently always 0 or 1.
59 // This is really a vo variable but currently there's no suitable vo
60 // struct.
61 int num_buffered_frames;
63 // AV sync: the next frame should be shown when the audio out has this
64 // much (in seconds) buffered data left. Increased when more data is
65 // written to the ao, decreased when moving to the next frame.
66 // In the audio-only case used as a timer since the last seek
67 // by the audio CPU usage meter.
68 double delay;
70 // Used to communicate the parameters of a seek between parts
71 float rel_seek_secs;
72 int abs_seek_pos;
74 float begin_skip; ///< start time of the current skip while on edlout mode
75 // audio is muted if either EDL or user activates mute
76 short edl_muted; ///< Stores whether EDL is currently in muted mode.
77 short user_muted; ///< Stores whether user wanted muted mode.
79 int global_sub_size; // this encompasses all subtitle sources
80 int global_sub_pos; // this encompasses all subtitle sources
81 int set_of_sub_pos;
82 int set_of_sub_size;
83 int global_sub_indices[SUB_SOURCES];
84 // set_of_ass_tracks[i] contains subtitles from set_of_subtitles[i]
85 // parsed by libass or NULL if format unsupported
86 struct ass_track_s *set_of_ass_tracks[MAX_SUBTITLE_FILES];
87 sub_data* set_of_subtitles[MAX_SUBTITLE_FILES];
89 int file_format;
91 int last_dvb_step;
92 int dvbin_reopen;
94 int was_paused;
96 #ifdef USE_DVDNAV
97 struct mp_image *nav_smpi; ///< last decoded dvdnav video image
98 unsigned char *nav_buffer; ///< last read dvdnav video frame
99 unsigned char *nav_start; ///< pointer to last read video buffer
100 int nav_in_size; ///< last read size
101 #endif
102 } MPContext;
105 // Most of these should not be globals
106 extern FILE *edl_fd;
107 extern int file_filter;
108 // These appear in options list
109 extern int forced_subs_only;
111 struct ao_data;
112 int build_afilter_chain(struct MPContext *mpctx, struct sh_audio *sh_audio, struct ao_data *ao_data);
113 void uninit_player(struct MPContext *mpctx, unsigned int mask);
114 void reinit_audio_chain(struct MPContext *mpctx);
115 void init_vo_spudec(struct MPContext *mpctx);
116 double playing_audio_pts(struct MPContext *mpctx);
117 void exit_player_with_rc(struct MPContext *mpctx, const char* how, int rc);
118 void add_subtitles(struct MPContext *mpctx, char *filename, float fps, int noerr);
119 int reinit_video_chain(struct MPContext *mpctx);
121 #endif /* MPLAYER_MP_CORE_H */