Fix wrong setting of samplesize (must be bytes per sample, not bits)
[mplayer/glamo.git] / mp_core.h
blob4f5659c067188f8b46749fcee6358973b218d889
1 // definitions used internally by the core player code
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
17 #define SUB_SOURCE_SUBS 0
18 #define SUB_SOURCE_VOBSUB 1
19 #define SUB_SOURCE_DEMUX 2
20 #define SUB_SOURCES 3
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
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
42 #define MAX_OSD_LEVEL 3
43 #define MAX_TERM_OSD_LEVEL 1
46 typedef struct MPContext {
47 int osd_show_percentage;
48 int osd_function;
49 ao_functions_t *audio_out;
50 play_tree_t *playtree;
51 play_tree_iter_t *playtree_iter;
52 int eof;
53 int play_tree_step;
55 stream_t *stream;
56 demuxer_t *demuxer;
57 sh_audio_t *sh_audio;
58 sh_video_t *sh_video;
59 demux_stream_t *d_audio;
60 demux_stream_t *d_video;
61 demux_stream_t *d_sub;
62 mixer_t mixer;
63 vo_functions_t *video_out;
64 // Frames buffered in the vo ready to flip. Currently always 0 or 1.
65 // This is really a vo variable but currently there's no suitable vo
66 // struct.
67 int num_buffered_frames;
69 float begin_skip; ///< start time of the current skip while on edlout mode
70 // audio is muted if either EDL or user activates mute
71 short edl_muted; ///< Stores whether EDL is currently in muted mode.
72 short user_muted; ///< Stores whether user wanted muted mode.
74 int global_sub_size; // this encompasses all subtitle sources
75 int global_sub_pos; // this encompasses all subtitle sources
76 int set_of_sub_pos;
77 int set_of_sub_size;
78 int global_sub_indices[SUB_SOURCES];
79 #ifdef USE_ASS
80 // set_of_ass_tracks[i] contains subtitles from set_of_subtitles[i]
81 // parsed by libass or NULL if format unsupported
82 ass_track_t* set_of_ass_tracks[MAX_SUBTITLE_FILES];
83 #endif
84 sub_data* set_of_subtitles[MAX_SUBTITLE_FILES];
86 int file_format;
88 #ifdef HAS_DVBIN_SUPPORT
89 int last_dvb_step;
90 int dvbin_reopen;
91 #endif
93 int was_paused;
94 } MPContext;
97 // Most of these should not be globals
98 extern int abs_seek_pos;
99 extern float rel_seek_secs;
100 extern FILE *edl_fd;
101 extern int file_filter;
102 // These appear in options list
103 extern float playback_speed;
104 extern int osd_duration;
105 extern int term_osd;
106 extern int fixed_vo;
107 extern int ass_enabled;
108 extern int fixed_vo;
109 extern int forced_subs_only;
111 // These were listed as externs in mplayer.c, should be in some other header
112 extern int vo_gamma_gamma;
113 extern int vo_gamma_brightness;
114 extern int vo_gamma_contrast;
115 extern int vo_gamma_saturation;
116 extern int vo_gamma_hue;
120 int build_afilter_chain(sh_audio_t *sh_audio, ao_data_t *ao_data);
121 void uninit_player(unsigned int mask);
122 void reinit_audio_chain(void);
123 void init_vo_spudec(void);
124 void set_osd_bar(int type,const char* name,double min,double max,double val);
125 void set_osd_msg(int id, int level, int time, const char* fmt, ...);
126 double playing_audio_pts(sh_audio_t *sh_audio, demux_stream_t *d_audio,
127 ao_functions_t *audio_out);
128 void exit_player_with_rc(const char* how, int rc);
129 char *get_path(const char *filename);
130 void rm_osd_msg(int id);
131 void add_subtitles(char *filename, float fps, int silent);
132 void mplayer_put_key(int code);
133 int reinit_video_chain(void);