comparison mp_core.h @ 22280:a5e5b0c45c03

Split command/property handling from mplayer.c to a new file command.c. Move some global and static variables under a struct that can be given as a parameter. Add a context argument to the property functions so that they do not have to depend on global/static variables.
author uau
date Wed, 21 Feb 2007 00:49:24 +0000
parents
children da8ba4c0fc57
comparison
equal deleted inserted replaced
22279:856feaa9cb61 22280:a5e5b0c45c03
1 // definitions used internally by the core player code
2
3 #define INITED_VO 1
4 #define INITED_AO 2
5 #define INITED_GUI 4
6 #define INITED_GETCH2 8
7 #define INITED_SPUDEC 32
8 #define INITED_STREAM 64
9 #define INITED_INPUT 128
10 #define INITED_VOBSUB 256
11 #define INITED_DEMUXER 512
12 #define INITED_ACODEC 1024
13 #define INITED_VCODEC 2048
14 #define INITED_ALL 0xFFFF
15
16
17 #define SUB_SOURCE_SUBS 0
18 #define SUB_SOURCE_VOBSUB 1
19 #define SUB_SOURCE_DEMUX 2
20 #define SUB_SOURCES 3
21
22
23 #define PT_NEXT_ENTRY 1
24 #define PT_PREV_ENTRY -1
25 #define PT_NEXT_SRC 2
26 #define PT_PREV_SRC -2
27 #define PT_UP_NEXT 3
28 #define PT_UP_PREV -3
29
30
31 #define OSD_MSG_TV_CHANNEL 0
32 #define OSD_MSG_TEXT 1
33 #define OSD_MSG_SUB_DELAY 2
34 #define OSD_MSG_SPEED 3
35 #define OSD_MSG_OSD_STATUS 4
36 #define OSD_MSG_BAR 5
37 #define OSD_MSG_PAUSE 6
38 #define OSD_MSG_RADIO_CHANNEL 7
39 /// Base id for messages generated from the commmand to property bridge.
40 #define OSD_MSG_PROPERTY 0x100
41
42 #define MAX_OSD_LEVEL 3
43 #define MAX_TERM_OSD_LEVEL 1
44
45
46 typedef struct MPContext {
47 int osd_show_percentage;
48 int osd_function;
49 demux_stream_t *d_audio;
50 ao_functions_t *audio_out;
51 float begin_skip; ///< start time of the current skip while on edlout mode
52 play_tree_t *playtree;
53 play_tree_iter_t *playtree_iter;
54 int eof;
55 int play_tree_step;
56
57 stream_t *stream;
58 demuxer_t *demuxer;
59 sh_audio_t *sh_audio;
60 sh_video_t *sh_video;
61 demux_stream_t *d_video;
62 demux_stream_t *d_sub;
63 mixer_t mixer;
64 vo_functions_t *video_out;
65
66 short edl_muted; ///< Stores whether EDL is currently in muted mode.
67 short user_muted; ///< Stores whether user wanted muted mode.
68
69 int global_sub_size; // this encompasses all subtitle sources
70 int global_sub_pos; // this encompasses all subtitle sources
71 int set_of_sub_pos;
72 int set_of_sub_size;
73 int global_sub_indices[SUB_SOURCES];
74 #ifdef USE_ASS
75 // set_of_ass_tracks[i] contains subtitles from set_of_subtitles[i]
76 // parsed by libass or NULL if format unsupported
77 ass_track_t* set_of_ass_tracks[MAX_SUBTITLE_FILES];
78 #endif
79 sub_data* set_of_subtitles[MAX_SUBTITLE_FILES];
80
81 int file_format;
82
83 #ifdef HAS_DVBIN_SUPPORT
84 int last_dvb_step;
85 int dvbin_reopen;
86 #endif
87
88 int was_paused;
89 } MPContext;
90
91
92 // Most of these should not be globals
93 extern int abs_seek_pos;
94 extern float rel_seek_secs;
95 extern FILE *edl_fd;
96 extern int file_filter;
97 // These appear in options list
98 extern float playback_speed;
99 extern int osd_duration;
100 extern int term_osd;
101 extern int fixed_vo;
102 extern int ass_enabled;
103 extern int fixed_vo;
104 extern int forced_subs_only;
105
106 // These were listed as externs in mplayer.c, should be in some other header
107 extern int vo_gamma_gamma;
108 extern int vo_gamma_brightness;
109 extern int vo_gamma_contrast;
110 extern int vo_gamma_saturation;
111 extern int vo_gamma_hue;
112
113
114
115 int build_afilter_chain(sh_audio_t *sh_audio, ao_data_t *ao_data);
116 void uninit_player(unsigned int mask);
117 void reinit_audio_chain(void);
118 void init_vo_spudec(void);
119 void set_osd_bar(int type,const char* name,double min,double max,double val);
120 void set_osd_msg(int id, int level, int time, const char* fmt, ...);
121 double playing_audio_pts(sh_audio_t *sh_audio, demux_stream_t *d_audio,
122 ao_functions_t *audio_out);
123 void exit_player_with_rc(const char* how, int rc);
124 char *get_path(const char *filename);
125 void rm_osd_msg(int id);
126 void add_subtitles(char *filename, float fps, int silent);
127 void mplayer_put_key(int code);
128 int reinit_video_chain(void);