Mercurial > mplayer.hg
annotate mp_core.h @ 23425:098e38f17263
Recode the whole subtitle file to utf-8 before parsing.
This allows reading subtitles in ucs-2.
author | eugeni |
---|---|
date | Fri, 01 Jun 2007 19:58:29 +0000 |
parents | b6aa3eedf49b |
children | 11abe5f3dcaa |
rev | line source |
---|---|
22280
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
1 // definitions used internally by the core player code |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
2 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
3 #define INITED_VO 1 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
4 #define INITED_AO 2 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
5 #define INITED_GUI 4 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
6 #define INITED_GETCH2 8 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
7 #define INITED_SPUDEC 32 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
8 #define INITED_STREAM 64 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
9 #define INITED_INPUT 128 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
10 #define INITED_VOBSUB 256 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
11 #define INITED_DEMUXER 512 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
12 #define INITED_ACODEC 1024 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
13 #define INITED_VCODEC 2048 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
14 #define INITED_ALL 0xFFFF |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
15 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
16 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
17 #define SUB_SOURCE_SUBS 0 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
18 #define SUB_SOURCE_VOBSUB 1 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
19 #define SUB_SOURCE_DEMUX 2 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
20 #define SUB_SOURCES 3 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
21 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
22 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
23 #define PT_NEXT_ENTRY 1 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
24 #define PT_PREV_ENTRY -1 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
25 #define PT_NEXT_SRC 2 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
26 #define PT_PREV_SRC -2 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
27 #define PT_UP_NEXT 3 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
28 #define PT_UP_PREV -3 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
29 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
30 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
31 #define OSD_MSG_TV_CHANNEL 0 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
32 #define OSD_MSG_TEXT 1 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
33 #define OSD_MSG_SUB_DELAY 2 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
34 #define OSD_MSG_SPEED 3 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
35 #define OSD_MSG_OSD_STATUS 4 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
36 #define OSD_MSG_BAR 5 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
37 #define OSD_MSG_PAUSE 6 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
38 #define OSD_MSG_RADIO_CHANNEL 7 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
39 /// Base id for messages generated from the commmand to property bridge. |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
40 #define OSD_MSG_PROPERTY 0x100 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
41 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
42 #define MAX_OSD_LEVEL 3 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
43 #define MAX_TERM_OSD_LEVEL 1 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
44 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
45 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
46 typedef struct MPContext { |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
47 int osd_show_percentage; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
48 int osd_function; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
49 ao_functions_t *audio_out; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
50 play_tree_t *playtree; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
51 play_tree_iter_t *playtree_iter; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
52 int eof; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
53 int play_tree_step; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
54 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
55 stream_t *stream; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
56 demuxer_t *demuxer; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
57 sh_audio_t *sh_audio; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
58 sh_video_t *sh_video; |
22297 | 59 demux_stream_t *d_audio; |
22280
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
60 demux_stream_t *d_video; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
61 demux_stream_t *d_sub; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
62 mixer_t mixer; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
63 vo_functions_t *video_out; |
22288
da8ba4c0fc57
Cleanup, move "global" state from the frame_time_remaining mainloop
uau
parents:
22280
diff
changeset
|
64 // Frames buffered in the vo ready to flip. Currently always 0 or 1. |
da8ba4c0fc57
Cleanup, move "global" state from the frame_time_remaining mainloop
uau
parents:
22280
diff
changeset
|
65 // This is really a vo variable but currently there's no suitable vo |
da8ba4c0fc57
Cleanup, move "global" state from the frame_time_remaining mainloop
uau
parents:
22280
diff
changeset
|
66 // struct. |
da8ba4c0fc57
Cleanup, move "global" state from the frame_time_remaining mainloop
uau
parents:
22280
diff
changeset
|
67 int num_buffered_frames; |
22280
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
68 |
22488 | 69 // AV sync: the next frame should be shown when the audio out has this |
70 // much (in seconds) buffered data left. Increased when more data is | |
71 // written to the ao, decreased when moving to the next frame. | |
72 // In the audio-only case used as a timer since the last seek | |
73 // by the audio CPU usage meter. | |
74 double delay; | |
75 | |
22297 | 76 float begin_skip; ///< start time of the current skip while on edlout mode |
77 // audio is muted if either EDL or user activates mute | |
22280
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
78 short edl_muted; ///< Stores whether EDL is currently in muted mode. |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
79 short user_muted; ///< Stores whether user wanted muted mode. |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
80 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
81 int global_sub_size; // this encompasses all subtitle sources |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
82 int global_sub_pos; // this encompasses all subtitle sources |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
83 int set_of_sub_pos; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
84 int set_of_sub_size; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
85 int global_sub_indices[SUB_SOURCES]; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
86 #ifdef USE_ASS |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
87 // set_of_ass_tracks[i] contains subtitles from set_of_subtitles[i] |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
88 // parsed by libass or NULL if format unsupported |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
89 ass_track_t* set_of_ass_tracks[MAX_SUBTITLE_FILES]; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
90 #endif |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
91 sub_data* set_of_subtitles[MAX_SUBTITLE_FILES]; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
92 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
93 int file_format; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
94 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
95 #ifdef HAS_DVBIN_SUPPORT |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
96 int last_dvb_step; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
97 int dvbin_reopen; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
98 #endif |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
99 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
100 int was_paused; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
101 } MPContext; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
102 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
103 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
104 // Most of these should not be globals |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
105 extern int abs_seek_pos; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
106 extern float rel_seek_secs; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
107 extern FILE *edl_fd; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
108 extern int file_filter; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
109 // These appear in options list |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
110 extern float playback_speed; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
111 extern int osd_duration; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
112 extern int term_osd; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
113 extern int fixed_vo; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
114 extern int ass_enabled; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
115 extern int fixed_vo; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
116 extern int forced_subs_only; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
117 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
118 // These were listed as externs in mplayer.c, should be in some other header |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
119 extern int vo_gamma_gamma; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
120 extern int vo_gamma_brightness; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
121 extern int vo_gamma_contrast; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
122 extern int vo_gamma_saturation; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
123 extern int vo_gamma_hue; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
124 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
125 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
126 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
127 int build_afilter_chain(sh_audio_t *sh_audio, ao_data_t *ao_data); |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
128 void uninit_player(unsigned int mask); |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
129 void reinit_audio_chain(void); |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
130 void init_vo_spudec(void); |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
131 void set_osd_bar(int type,const char* name,double min,double max,double val); |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
132 void set_osd_msg(int id, int level, int time, const char* fmt, ...); |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
133 double playing_audio_pts(sh_audio_t *sh_audio, demux_stream_t *d_audio, |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
134 ao_functions_t *audio_out); |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
135 void exit_player_with_rc(const char* how, int rc); |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
136 char *get_path(const char *filename); |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
137 void rm_osd_msg(int id); |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
138 void add_subtitles(char *filename, float fps, int silent); |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
139 void mplayer_put_key(int code); |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
140 int reinit_video_chain(void); |