4 // definitions used internally by the core player code
9 #define INITED_GETCH2 8
10 #define INITED_SPUDEC 32
11 #define INITED_STREAM 64
12 #define INITED_INPUT 128
13 #define INITED_VOBSUB 256
14 #define INITED_DEMUXER 512
15 #define INITED_ACODEC 1024
16 #define INITED_VCODEC 2048
17 #define INITED_ALL 0xFFFF
20 #define SUB_SOURCE_SUBS 0
21 #define SUB_SOURCE_VOBSUB 1
22 #define SUB_SOURCE_DEMUX 2
26 #define PT_NEXT_ENTRY 1
27 #define PT_PREV_ENTRY -1
29 #define PT_PREV_SRC -2
34 #define OSD_MSG_TV_CHANNEL 0
35 #define OSD_MSG_TEXT 1
36 #define OSD_MSG_SUB_DELAY 2
37 #define OSD_MSG_SPEED 3
38 #define OSD_MSG_OSD_STATUS 4
40 #define OSD_MSG_PAUSE 6
41 #define OSD_MSG_RADIO_CHANNEL 7
42 /// Base id for messages generated from the commmand to property bridge.
43 #define OSD_MSG_PROPERTY 0x100
45 #define MAX_OSD_LEVEL 3
46 #define MAX_TERM_OSD_LEVEL 1
49 typedef struct MPContext
{
50 int osd_show_percentage
;
52 ao_functions_t
*audio_out
;
53 play_tree_t
*playtree
;
54 play_tree_iter_t
*playtree_iter
;
63 demux_stream_t
*d_audio
;
64 demux_stream_t
*d_video
;
65 demux_stream_t
*d_sub
;
67 const vo_functions_t
*video_out
;
68 // Frames buffered in the vo ready to flip. Currently always 0 or 1.
69 // This is really a vo variable but currently there's no suitable vo
71 int num_buffered_frames
;
73 // AV sync: the next frame should be shown when the audio out has this
74 // much (in seconds) buffered data left. Increased when more data is
75 // written to the ao, decreased when moving to the next frame.
76 // In the audio-only case used as a timer since the last seek
77 // by the audio CPU usage meter.
80 float begin_skip
; ///< start time of the current skip while on edlout mode
81 // audio is muted if either EDL or user activates mute
82 short edl_muted
; ///< Stores whether EDL is currently in muted mode.
83 short user_muted
; ///< Stores whether user wanted muted mode.
85 int global_sub_size
; // this encompasses all subtitle sources
86 int global_sub_pos
; // this encompasses all subtitle sources
89 int global_sub_indices
[SUB_SOURCES
];
91 // set_of_ass_tracks[i] contains subtitles from set_of_subtitles[i]
92 // parsed by libass or NULL if format unsupported
93 ass_track_t
* set_of_ass_tracks
[MAX_SUBTITLE_FILES
];
95 sub_data
* set_of_subtitles
[MAX_SUBTITLE_FILES
];
99 #ifdef HAS_DVBIN_SUPPORT
108 // Most of these should not be globals
109 extern int abs_seek_pos
;
110 extern float rel_seek_secs
;
112 extern int file_filter
;
113 // These appear in options list
114 extern float playback_speed
;
115 extern int osd_duration
;
118 extern int forced_subs_only
;
121 int build_afilter_chain(sh_audio_t
*sh_audio
, ao_data_t
*ao_data
);
122 void uninit_player(unsigned int mask
);
123 void reinit_audio_chain(void);
124 void init_vo_spudec(void);
125 void set_osd_bar(int type
,const char* name
,double min
,double max
,double val
);
126 void set_osd_msg(int id
, int level
, int time
, const char* fmt
, ...);
127 double playing_audio_pts(sh_audio_t
*sh_audio
, demux_stream_t
*d_audio
,
128 ao_functions_t
*audio_out
);
129 void exit_player_with_rc(const char* how
, int rc
);
130 void rm_osd_msg(int id
);
131 void add_subtitles(char *filename
, float fps
, int noerr
);
132 int reinit_video_chain(void);
134 #endif /* MP_CORE_H */