Mercurial > mplayer.hg
annotate mp_core.h @ 30266:fe8671946fae
Add -fno-common to avoid misalignment for global var under win32 like what
has been done for ffmpeg.
author | zuxy |
---|---|
date | Fri, 15 Jan 2010 09:31:15 +0000 |
parents | 6fb92182aff3 |
children | c1a3f1bbba26 |
rev | line source |
---|---|
26029 | 1 #ifndef MPLAYER_MP_CORE_H |
2 #define MPLAYER_MP_CORE_H | |
25553
6ac1ece1f9fe
Add multiple inclusion guards to all header files that lack them.
diego
parents:
25264
diff
changeset
|
3 |
25899
9d4121fa508a
Split osd related stuff from mp_core.h into new header file mp_osd.h.
ulion
parents:
25824
diff
changeset
|
4 #include "mp_osd.h" |
26131
83c95bd31aab
Add necessary #includes to pass 'make checkheaders'.
diego
parents:
26029
diff
changeset
|
5 #include "libao2/audio_out.h" |
83c95bd31aab
Add necessary #includes to pass 'make checkheaders'.
diego
parents:
26029
diff
changeset
|
6 #include "playtree.h" |
83c95bd31aab
Add necessary #includes to pass 'make checkheaders'.
diego
parents:
26029
diff
changeset
|
7 #include "stream/stream.h" |
83c95bd31aab
Add necessary #includes to pass 'make checkheaders'.
diego
parents:
26029
diff
changeset
|
8 #include "libmpdemux/demuxer.h" |
83c95bd31aab
Add necessary #includes to pass 'make checkheaders'.
diego
parents:
26029
diff
changeset
|
9 #include "libmpdemux/stheader.h" |
83c95bd31aab
Add necessary #includes to pass 'make checkheaders'.
diego
parents:
26029
diff
changeset
|
10 #include "mixer.h" |
83c95bd31aab
Add necessary #includes to pass 'make checkheaders'.
diego
parents:
26029
diff
changeset
|
11 #include "libvo/video_out.h" |
83c95bd31aab
Add necessary #includes to pass 'make checkheaders'.
diego
parents:
26029
diff
changeset
|
12 #include "subreader.h" |
25899
9d4121fa508a
Split osd related stuff from mp_core.h into new header file mp_osd.h.
ulion
parents:
25824
diff
changeset
|
13 |
22280
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
14 // 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
|
15 |
25962 | 16 #define INITIALIZED_VO 1 |
17 #define INITIALIZED_AO 2 | |
18 #define INITIALIZED_GUI 4 | |
19 #define INITIALIZED_GETCH2 8 | |
20 #define INITIALIZED_SPUDEC 32 | |
21 #define INITIALIZED_STREAM 64 | |
22 #define INITIALIZED_INPUT 128 | |
23 #define INITIALIZED_VOBSUB 256 | |
24 #define INITIALIZED_DEMUXER 512 | |
25 #define INITIALIZED_ACODEC 1024 | |
26 #define INITIALIZED_VCODEC 2048 | |
27 #define INITIALIZED_ALL 0xFFFF | |
22280
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
28 |
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 #define SUB_SOURCE_SUBS 0 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
31 #define SUB_SOURCE_VOBSUB 1 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
32 #define SUB_SOURCE_DEMUX 2 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
33 #define SUB_SOURCES 3 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
34 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
35 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
36 #define PT_NEXT_ENTRY 1 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
37 #define PT_PREV_ENTRY -1 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
38 #define PT_NEXT_SRC 2 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
39 #define PT_PREV_SRC -2 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
40 #define PT_UP_NEXT 3 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
41 #define PT_UP_PREV -3 |
26877 | 42 #define PT_STOP 4 |
22280
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
43 |
28032
92e770f6e890
Print ID_EXIT and exit reason message in identify mode when exiting.
reimar
parents:
27370
diff
changeset
|
44 typedef enum { |
92e770f6e890
Print ID_EXIT and exit reason message in identify mode when exiting.
reimar
parents:
27370
diff
changeset
|
45 EXIT_NONE, |
92e770f6e890
Print ID_EXIT and exit reason message in identify mode when exiting.
reimar
parents:
27370
diff
changeset
|
46 EXIT_QUIT, |
92e770f6e890
Print ID_EXIT and exit reason message in identify mode when exiting.
reimar
parents:
27370
diff
changeset
|
47 EXIT_EOF, |
92e770f6e890
Print ID_EXIT and exit reason message in identify mode when exiting.
reimar
parents:
27370
diff
changeset
|
48 EXIT_ERROR |
92e770f6e890
Print ID_EXIT and exit reason message in identify mode when exiting.
reimar
parents:
27370
diff
changeset
|
49 } exit_reason_t; |
22280
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
50 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
51 typedef struct MPContext { |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
52 int osd_show_percentage; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
53 int osd_function; |
25913 | 54 const ao_functions_t *audio_out; |
22280
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
55 play_tree_t *playtree; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
56 play_tree_iter_t *playtree_iter; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
57 int eof; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
58 int play_tree_step; |
23726 | 59 int loop_times; |
22280
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
60 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
61 stream_t *stream; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
62 demuxer_t *demuxer; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
63 sh_audio_t *sh_audio; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
64 sh_video_t *sh_video; |
22297 | 65 demux_stream_t *d_audio; |
22280
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
66 demux_stream_t *d_video; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
67 demux_stream_t *d_sub; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
68 mixer_t mixer; |
25219
e82ecde2cbd4
Mark several uses of vo_functions_t as const to stop some of the current
reimar
parents:
24242
diff
changeset
|
69 const vo_functions_t *video_out; |
22288
da8ba4c0fc57
Cleanup, move "global" state from the frame_time_remaining mainloop
uau
parents:
22280
diff
changeset
|
70 // 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
|
71 // 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
|
72 // struct. |
da8ba4c0fc57
Cleanup, move "global" state from the frame_time_remaining mainloop
uau
parents:
22280
diff
changeset
|
73 int num_buffered_frames; |
22280
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
74 |
30176
6fb92182aff3
At startup and while seeking avoid to introduce pointless sleeps and possibly
reimar
parents:
30175
diff
changeset
|
75 // used to retry decoding after startup/seeking to compensate for codec delay |
6fb92182aff3
At startup and while seeking avoid to introduce pointless sleeps and possibly
reimar
parents:
30175
diff
changeset
|
76 int startup_decode_retry; |
30175
b7bb4a899a6b
Also reset time_frame and next_frame_time on reset, it makes no sense to
reimar
parents:
28032
diff
changeset
|
77 // how long until we need to display the "current" frame |
b7bb4a899a6b
Also reset time_frame and next_frame_time on reset, it makes no sense to
reimar
parents:
28032
diff
changeset
|
78 float time_frame; |
b7bb4a899a6b
Also reset time_frame and next_frame_time on reset, it makes no sense to
reimar
parents:
28032
diff
changeset
|
79 |
22488 | 80 // AV sync: the next frame should be shown when the audio out has this |
81 // much (in seconds) buffered data left. Increased when more data is | |
82 // written to the ao, decreased when moving to the next frame. | |
83 // In the audio-only case used as a timer since the last seek | |
84 // by the audio CPU usage meter. | |
85 double delay; | |
86 | |
22297 | 87 float begin_skip; ///< start time of the current skip while on edlout mode |
88 // 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
|
89 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
|
90 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
|
91 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
92 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
|
93 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
|
94 int set_of_sub_pos; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
95 int set_of_sub_size; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
96 int global_sub_indices[SUB_SOURCES]; |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26877
diff
changeset
|
97 #ifdef CONFIG_ASS |
22280
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
98 // 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
|
99 // 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
|
100 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
|
101 #endif |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
102 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
|
103 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
104 int file_format; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
105 |
27370
14c5017f40d2
Change a bunch of video/audio-output-specific preprocessor directives from
diego
parents:
27341
diff
changeset
|
106 #ifdef CONFIG_DVBIN |
22280
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
107 int last_dvb_step; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
108 int dvbin_reopen; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
109 #endif |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
110 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
111 int was_paused; |
25824 | 112 |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26877
diff
changeset
|
113 #ifdef CONFIG_DVDNAV |
26272
f6accae8703b
mp_core.h: Fix use of 'mp_image_t' without definition
uau
parents:
26131
diff
changeset
|
114 struct mp_image_s *nav_smpi; ///< last decoded dvdnav video image |
25824 | 115 unsigned char *nav_buffer; ///< last read dvdnav video frame |
116 unsigned char *nav_start; ///< pointer to last read video buffer | |
117 int nav_in_size; ///< last read size | |
118 #endif | |
22280
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
119 } MPContext; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
120 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
121 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
122 // 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
|
123 extern int abs_seek_pos; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
124 extern float rel_seek_secs; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
125 extern FILE *edl_fd; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
126 extern int file_filter; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
127 // These appear in options list |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
128 extern float playback_speed; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
129 extern int fixed_vo; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
130 extern int forced_subs_only; |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
131 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
132 |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
133 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
|
134 void uninit_player(unsigned int mask); |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
135 void reinit_audio_chain(void); |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
136 void init_vo_spudec(void); |
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
137 double playing_audio_pts(sh_audio_t *sh_audio, demux_stream_t *d_audio, |
25913 | 138 const ao_functions_t *audio_out); |
28032
92e770f6e890
Print ID_EXIT and exit reason message in identify mode when exiting.
reimar
parents:
27370
diff
changeset
|
139 void exit_player_with_rc(exit_reason_t how, int rc); |
25264
42aa06653705
When auto loading subs, log warning instead of error for load failure.
ulion
parents:
25219
diff
changeset
|
140 void add_subtitles(char *filename, float fps, int noerr); |
22280
a5e5b0c45c03
Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff
changeset
|
141 int reinit_video_chain(void); |
25553
6ac1ece1f9fe
Add multiple inclusion guards to all header files that lack them.
diego
parents:
25264
diff
changeset
|
142 |
26029 | 143 #endif /* MPLAYER_MP_CORE_H */ |