2008-02-22 09:09:46 +00:00
|
|
|
#ifndef MPLAYER_MP_CORE_H
|
|
|
|
#define MPLAYER_MP_CORE_H
|
2008-01-01 21:35:58 +00:00
|
|
|
|
2008-01-30 07:21:05 +00:00
|
|
|
#include "mp_osd.h"
|
|
|
|
|
2007-02-21 00:49:24 +00:00
|
|
|
// definitions used internally by the core player code
|
|
|
|
|
2008-02-14 14:23:55 +00:00
|
|
|
#define INITIALIZED_VO 1
|
|
|
|
#define INITIALIZED_AO 2
|
|
|
|
#define INITIALIZED_GUI 4
|
|
|
|
#define INITIALIZED_GETCH2 8
|
|
|
|
#define INITIALIZED_SPUDEC 32
|
|
|
|
#define INITIALIZED_STREAM 64
|
|
|
|
#define INITIALIZED_INPUT 128
|
|
|
|
#define INITIALIZED_VOBSUB 256
|
|
|
|
#define INITIALIZED_DEMUXER 512
|
|
|
|
#define INITIALIZED_ACODEC 1024
|
|
|
|
#define INITIALIZED_VCODEC 2048
|
|
|
|
#define INITIALIZED_ALL 0xFFFF
|
2007-02-21 00:49:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
#define SUB_SOURCE_SUBS 0
|
|
|
|
#define SUB_SOURCE_VOBSUB 1
|
|
|
|
#define SUB_SOURCE_DEMUX 2
|
|
|
|
#define SUB_SOURCES 3
|
|
|
|
|
|
|
|
|
|
|
|
#define PT_NEXT_ENTRY 1
|
|
|
|
#define PT_PREV_ENTRY -1
|
|
|
|
#define PT_NEXT_SRC 2
|
|
|
|
#define PT_PREV_SRC -2
|
|
|
|
#define PT_UP_NEXT 3
|
|
|
|
#define PT_UP_PREV -3
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct MPContext {
|
|
|
|
int osd_show_percentage;
|
|
|
|
int osd_function;
|
2008-02-01 20:11:14 +00:00
|
|
|
const ao_functions_t *audio_out;
|
2007-02-21 00:49:24 +00:00
|
|
|
play_tree_t *playtree;
|
|
|
|
play_tree_iter_t *playtree_iter;
|
|
|
|
int eof;
|
|
|
|
int play_tree_step;
|
2007-07-09 14:51:47 +00:00
|
|
|
int loop_times;
|
2007-02-21 00:49:24 +00:00
|
|
|
|
|
|
|
stream_t *stream;
|
|
|
|
demuxer_t *demuxer;
|
|
|
|
sh_audio_t *sh_audio;
|
|
|
|
sh_video_t *sh_video;
|
2007-02-22 20:44:48 +00:00
|
|
|
demux_stream_t *d_audio;
|
2007-02-21 00:49:24 +00:00
|
|
|
demux_stream_t *d_video;
|
|
|
|
demux_stream_t *d_sub;
|
|
|
|
mixer_t mixer;
|
2007-12-02 14:24:23 +00:00
|
|
|
const vo_functions_t *video_out;
|
2007-02-21 21:59:33 +00:00
|
|
|
// Frames buffered in the vo ready to flip. Currently always 0 or 1.
|
|
|
|
// This is really a vo variable but currently there's no suitable vo
|
|
|
|
// struct.
|
|
|
|
int num_buffered_frames;
|
2007-02-21 00:49:24 +00:00
|
|
|
|
2007-03-11 06:16:14 +00:00
|
|
|
// AV sync: the next frame should be shown when the audio out has this
|
|
|
|
// much (in seconds) buffered data left. Increased when more data is
|
|
|
|
// written to the ao, decreased when moving to the next frame.
|
|
|
|
// In the audio-only case used as a timer since the last seek
|
|
|
|
// by the audio CPU usage meter.
|
|
|
|
double delay;
|
|
|
|
|
2007-02-22 20:44:48 +00:00
|
|
|
float begin_skip; ///< start time of the current skip while on edlout mode
|
|
|
|
// audio is muted if either EDL or user activates mute
|
2007-02-21 00:49:24 +00:00
|
|
|
short edl_muted; ///< Stores whether EDL is currently in muted mode.
|
|
|
|
short user_muted; ///< Stores whether user wanted muted mode.
|
|
|
|
|
|
|
|
int global_sub_size; // this encompasses all subtitle sources
|
|
|
|
int global_sub_pos; // this encompasses all subtitle sources
|
|
|
|
int set_of_sub_pos;
|
|
|
|
int set_of_sub_size;
|
|
|
|
int global_sub_indices[SUB_SOURCES];
|
|
|
|
#ifdef USE_ASS
|
|
|
|
// set_of_ass_tracks[i] contains subtitles from set_of_subtitles[i]
|
|
|
|
// parsed by libass or NULL if format unsupported
|
|
|
|
ass_track_t* set_of_ass_tracks[MAX_SUBTITLE_FILES];
|
|
|
|
#endif
|
|
|
|
sub_data* set_of_subtitles[MAX_SUBTITLE_FILES];
|
|
|
|
|
|
|
|
int file_format;
|
|
|
|
|
|
|
|
#ifdef HAS_DVBIN_SUPPORT
|
|
|
|
int last_dvb_step;
|
|
|
|
int dvbin_reopen;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int was_paused;
|
2008-01-26 11:51:34 +00:00
|
|
|
|
|
|
|
#ifdef USE_DVDNAV
|
|
|
|
mp_image_t *nav_smpi; ///< last decoded dvdnav video image
|
|
|
|
unsigned char *nav_buffer; ///< last read dvdnav video frame
|
|
|
|
unsigned char *nav_start; ///< pointer to last read video buffer
|
|
|
|
int nav_in_size; ///< last read size
|
|
|
|
#endif
|
2007-02-21 00:49:24 +00:00
|
|
|
} MPContext;
|
|
|
|
|
|
|
|
|
|
|
|
// Most of these should not be globals
|
|
|
|
extern int abs_seek_pos;
|
|
|
|
extern float rel_seek_secs;
|
|
|
|
extern FILE *edl_fd;
|
|
|
|
extern int file_filter;
|
|
|
|
// These appear in options list
|
|
|
|
extern float playback_speed;
|
|
|
|
extern int fixed_vo;
|
|
|
|
extern int forced_subs_only;
|
|
|
|
|
|
|
|
|
|
|
|
int build_afilter_chain(sh_audio_t *sh_audio, ao_data_t *ao_data);
|
|
|
|
void uninit_player(unsigned int mask);
|
|
|
|
void reinit_audio_chain(void);
|
|
|
|
void init_vo_spudec(void);
|
|
|
|
double playing_audio_pts(sh_audio_t *sh_audio, demux_stream_t *d_audio,
|
2008-02-01 20:11:14 +00:00
|
|
|
const ao_functions_t *audio_out);
|
2007-02-21 00:49:24 +00:00
|
|
|
void exit_player_with_rc(const char* how, int rc);
|
2007-12-04 12:34:44 +00:00
|
|
|
void add_subtitles(char *filename, float fps, int noerr);
|
2007-02-21 00:49:24 +00:00
|
|
|
int reinit_video_chain(void);
|
2008-01-01 21:35:58 +00:00
|
|
|
|
2008-02-22 09:09:46 +00:00
|
|
|
#endif /* MPLAYER_MP_CORE_H */
|