annotate mp_core.h @ 26087:2a112aed0dda

Demuxer-independent subtitle track selection.
author eugeni
date Fri, 29 Feb 2008 17:25:44 +0000
parents 4129c8cfa742
children 83c95bd31aab
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25962
diff changeset
1 #ifndef MPLAYER_MP_CORE_H
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25962
diff changeset
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"
9d4121fa508a Split osd related stuff from mp_core.h into new header file mp_osd.h.
ulion
parents: 25824
diff changeset
5
22280
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
6 // 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
7
25962
afa125da85cf typo fix: inited --> initialized
diego
parents: 25913
diff changeset
8 #define INITIALIZED_VO 1
afa125da85cf typo fix: inited --> initialized
diego
parents: 25913
diff changeset
9 #define INITIALIZED_AO 2
afa125da85cf typo fix: inited --> initialized
diego
parents: 25913
diff changeset
10 #define INITIALIZED_GUI 4
afa125da85cf typo fix: inited --> initialized
diego
parents: 25913
diff changeset
11 #define INITIALIZED_GETCH2 8
afa125da85cf typo fix: inited --> initialized
diego
parents: 25913
diff changeset
12 #define INITIALIZED_SPUDEC 32
afa125da85cf typo fix: inited --> initialized
diego
parents: 25913
diff changeset
13 #define INITIALIZED_STREAM 64
afa125da85cf typo fix: inited --> initialized
diego
parents: 25913
diff changeset
14 #define INITIALIZED_INPUT 128
afa125da85cf typo fix: inited --> initialized
diego
parents: 25913
diff changeset
15 #define INITIALIZED_VOBSUB 256
afa125da85cf typo fix: inited --> initialized
diego
parents: 25913
diff changeset
16 #define INITIALIZED_DEMUXER 512
afa125da85cf typo fix: inited --> initialized
diego
parents: 25913
diff changeset
17 #define INITIALIZED_ACODEC 1024
afa125da85cf typo fix: inited --> initialized
diego
parents: 25913
diff changeset
18 #define INITIALIZED_VCODEC 2048
afa125da85cf typo fix: inited --> initialized
diego
parents: 25913
diff changeset
19 #define INITIALIZED_ALL 0xFFFF
22280
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
20
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 #define SUB_SOURCE_SUBS 0
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
23 #define SUB_SOURCE_VOBSUB 1
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
24 #define SUB_SOURCE_DEMUX 2
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
25 #define SUB_SOURCES 3
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
26
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
27
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
28 #define PT_NEXT_ENTRY 1
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
29 #define PT_PREV_ENTRY -1
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
30 #define PT_NEXT_SRC 2
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
31 #define PT_PREV_SRC -2
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
32 #define PT_UP_NEXT 3
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
33 #define PT_UP_PREV -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 typedef struct MPContext {
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
37 int osd_show_percentage;
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
38 int osd_function;
25913
21a1dc062bc5 ao_functions_t should be const, part 1
reimar
parents: 25899
diff changeset
39 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
40 play_tree_t *playtree;
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
41 play_tree_iter_t *playtree_iter;
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
42 int eof;
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
43 int play_tree_step;
23726
11abe5f3dcaa Move loop_times into mpctx.
albeu
parents: 22488
diff changeset
44 int loop_times;
22280
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 stream_t *stream;
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
47 demuxer_t *demuxer;
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
48 sh_audio_t *sh_audio;
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
49 sh_video_t *sh_video;
22297
3340e52ad814 Move some related variables together & add a comment
uau
parents: 22288
diff changeset
50 demux_stream_t *d_audio;
22280
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
51 demux_stream_t *d_video;
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
52 demux_stream_t *d_sub;
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
53 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
54 const vo_functions_t *video_out;
22288
da8ba4c0fc57 Cleanup, move "global" state from the frame_time_remaining mainloop
uau
parents: 22280
diff changeset
55 // 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
56 // 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
57 // struct.
da8ba4c0fc57 Cleanup, move "global" state from the frame_time_remaining mainloop
uau
parents: 22280
diff changeset
58 int num_buffered_frames;
22280
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
59
22488
b6aa3eedf49b Move the sh_audio->delay field to mpctx->delay.
uau
parents: 22297
diff changeset
60 // AV sync: the next frame should be shown when the audio out has this
b6aa3eedf49b Move the sh_audio->delay field to mpctx->delay.
uau
parents: 22297
diff changeset
61 // much (in seconds) buffered data left. Increased when more data is
b6aa3eedf49b Move the sh_audio->delay field to mpctx->delay.
uau
parents: 22297
diff changeset
62 // written to the ao, decreased when moving to the next frame.
b6aa3eedf49b Move the sh_audio->delay field to mpctx->delay.
uau
parents: 22297
diff changeset
63 // In the audio-only case used as a timer since the last seek
b6aa3eedf49b Move the sh_audio->delay field to mpctx->delay.
uau
parents: 22297
diff changeset
64 // by the audio CPU usage meter.
b6aa3eedf49b Move the sh_audio->delay field to mpctx->delay.
uau
parents: 22297
diff changeset
65 double delay;
b6aa3eedf49b Move the sh_audio->delay field to mpctx->delay.
uau
parents: 22297
diff changeset
66
22297
3340e52ad814 Move some related variables together & add a comment
uau
parents: 22288
diff changeset
67 float begin_skip; ///< start time of the current skip while on edlout mode
3340e52ad814 Move some related variables together & add a comment
uau
parents: 22288
diff changeset
68 // 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
69 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
70 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
71
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
72 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
73 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
74 int set_of_sub_pos;
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
75 int set_of_sub_size;
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
76 int global_sub_indices[SUB_SOURCES];
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
77 #ifdef USE_ASS
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
78 // 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
79 // 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
80 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
81 #endif
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
82 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
83
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
84 int file_format;
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
85
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
86 #ifdef HAS_DVBIN_SUPPORT
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
87 int last_dvb_step;
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
88 int dvbin_reopen;
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
89 #endif
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
90
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
91 int was_paused;
25824
eb338d06c638 Add support for dvdnav still frames playback.
ben
parents: 25553
diff changeset
92
eb338d06c638 Add support for dvdnav still frames playback.
ben
parents: 25553
diff changeset
93 #ifdef USE_DVDNAV
eb338d06c638 Add support for dvdnav still frames playback.
ben
parents: 25553
diff changeset
94 mp_image_t *nav_smpi; ///< last decoded dvdnav video image
eb338d06c638 Add support for dvdnav still frames playback.
ben
parents: 25553
diff changeset
95 unsigned char *nav_buffer; ///< last read dvdnav video frame
eb338d06c638 Add support for dvdnav still frames playback.
ben
parents: 25553
diff changeset
96 unsigned char *nav_start; ///< pointer to last read video buffer
eb338d06c638 Add support for dvdnav still frames playback.
ben
parents: 25553
diff changeset
97 int nav_in_size; ///< last read size
eb338d06c638 Add support for dvdnav still frames playback.
ben
parents: 25553
diff changeset
98 #endif
22280
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
99 } MPContext;
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
100
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
101
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
102 // 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
103 extern int abs_seek_pos;
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
104 extern float rel_seek_secs;
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
105 extern FILE *edl_fd;
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
106 extern int file_filter;
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
107 // These appear in options list
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
108 extern float playback_speed;
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
109 extern int fixed_vo;
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
110 extern int forced_subs_only;
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
111
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
112
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
113 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
114 void uninit_player(unsigned int mask);
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
115 void reinit_audio_chain(void);
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
116 void init_vo_spudec(void);
a5e5b0c45c03 Split command/property handling from mplayer.c to a new file command.c.
uau
parents:
diff changeset
117 double playing_audio_pts(sh_audio_t *sh_audio, demux_stream_t *d_audio,
25913
21a1dc062bc5 ao_functions_t should be const, part 1
reimar
parents: 25899
diff changeset
118 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
119 void exit_player_with_rc(const char* how, int rc);
25264
42aa06653705 When auto loading subs, log warning instead of error for load failure.
ulion
parents: 25219
diff changeset
120 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
121 int reinit_video_chain(void);
25553
6ac1ece1f9fe Add multiple inclusion guards to all header files that lack them.
diego
parents: 25264
diff changeset
122
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25962
diff changeset
123 #endif /* MPLAYER_MP_CORE_H */