2008-02-22 10:09:46 +01:00
|
|
|
#ifndef MPLAYER_MP_CORE_H
|
|
|
|
#define MPLAYER_MP_CORE_H
|
2008-01-01 22:35:58 +01:00
|
|
|
|
2008-03-31 05:19:29 +02:00
|
|
|
#include "options.h"
|
2008-03-05 00:35:24 +01:00
|
|
|
#include "mixer.h"
|
|
|
|
#include "subreader.h"
|
2008-01-30 08:21:05 +01:00
|
|
|
|
2007-02-21 01:49:24 +01:00
|
|
|
// definitions used internally by the core player code
|
|
|
|
|
2008-02-14 15:23:55 +01: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 01:49:24 +01: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 {
|
2008-03-31 05:19:29 +02:00
|
|
|
struct MPOpts opts;
|
2008-04-26 09:44:59 +02:00
|
|
|
struct m_config *mconfig;
|
2008-04-20 06:36:34 +02:00
|
|
|
struct vo_x11_state *x11_state;
|
2007-02-21 01:49:24 +01:00
|
|
|
int osd_show_percentage;
|
|
|
|
int osd_function;
|
2008-02-01 21:11:14 +01:00
|
|
|
const ao_functions_t *audio_out;
|
2008-04-23 08:49:25 +02:00
|
|
|
struct play_tree *playtree;
|
|
|
|
struct play_tree_iter *playtree_iter;
|
2008-04-26 14:17:51 +02:00
|
|
|
char *filename; // currently playing file
|
2007-02-21 01:49:24 +01:00
|
|
|
int eof;
|
|
|
|
int play_tree_step;
|
2008-04-26 14:31:39 +02:00
|
|
|
unsigned int initialized_flags; // which subsystems have been initialized
|
2007-02-21 01:49:24 +01:00
|
|
|
|
2008-04-24 04:49:44 +02:00
|
|
|
struct stream *stream;
|
|
|
|
struct demuxer *demuxer;
|
2008-04-23 08:49:25 +02:00
|
|
|
struct sh_audio *sh_audio;
|
|
|
|
struct sh_video *sh_video;
|
|
|
|
struct demux_stream *d_audio;
|
|
|
|
struct demux_stream *d_video;
|
|
|
|
struct demux_stream *d_sub;
|
2007-02-21 01:49:24 +01:00
|
|
|
mixer_t mixer;
|
2008-04-03 05:25:41 +02:00
|
|
|
struct vo *video_out;
|
2007-02-21 22:59:33 +01: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 01:49:24 +01:00
|
|
|
|
2007-03-11 07:16:14 +01: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;
|
|
|
|
|
2008-04-21 05:17:22 +02:00
|
|
|
// Used to communicate the parameters of a seek between parts
|
|
|
|
float rel_seek_secs;
|
|
|
|
int abs_seek_pos;
|
|
|
|
|
2007-02-22 21:44:48 +01: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 01:49:24 +01: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];
|
|
|
|
// set_of_ass_tracks[i] contains subtitles from set_of_subtitles[i]
|
|
|
|
// parsed by libass or NULL if format unsupported
|
2008-04-23 08:49:25 +02:00
|
|
|
struct ass_track_s *set_of_ass_tracks[MAX_SUBTITLE_FILES];
|
2007-02-21 01:49:24 +01:00
|
|
|
sub_data* set_of_subtitles[MAX_SUBTITLE_FILES];
|
|
|
|
|
|
|
|
int file_format;
|
|
|
|
|
|
|
|
int last_dvb_step;
|
|
|
|
int dvbin_reopen;
|
|
|
|
|
|
|
|
int was_paused;
|
2008-01-26 12:51:34 +01:00
|
|
|
|
|
|
|
#ifdef USE_DVDNAV
|
2008-04-24 04:49:44 +02:00
|
|
|
struct mp_image *nav_smpi; ///< last decoded dvdnav video image
|
2008-01-26 12:51:34 +01:00
|
|
|
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 01:49:24 +01:00
|
|
|
} MPContext;
|
|
|
|
|
|
|
|
|
|
|
|
// Most of these should not be globals
|
|
|
|
extern FILE *edl_fd;
|
|
|
|
extern int file_filter;
|
|
|
|
// These appear in options list
|
|
|
|
extern int forced_subs_only;
|
|
|
|
|
2008-04-24 04:49:44 +02:00
|
|
|
struct ao_data;
|
|
|
|
int build_afilter_chain(struct MPContext *mpctx, struct sh_audio *sh_audio, struct ao_data *ao_data);
|
2008-04-21 05:07:22 +02:00
|
|
|
void uninit_player(struct MPContext *mpctx, unsigned int mask);
|
|
|
|
void reinit_audio_chain(struct MPContext *mpctx);
|
|
|
|
void init_vo_spudec(struct MPContext *mpctx);
|
2008-04-21 05:55:23 +02:00
|
|
|
double playing_audio_pts(struct MPContext *mpctx);
|
2008-04-21 05:07:22 +02:00
|
|
|
void exit_player_with_rc(struct MPContext *mpctx, const char* how, int rc);
|
|
|
|
void add_subtitles(struct MPContext *mpctx, char *filename, float fps, int noerr);
|
|
|
|
int reinit_video_chain(struct MPContext *mpctx);
|
2008-01-01 22:35:58 +01:00
|
|
|
|
2008-02-22 10:09:46 +01:00
|
|
|
#endif /* MPLAYER_MP_CORE_H */
|