summaryrefslogtreecommitdiffstats
path: root/mp_core.h
diff options
context:
space:
mode:
Diffstat (limited to 'mp_core.h')
-rw-r--r--mp_core.h79
1 files changed, 39 insertions, 40 deletions
diff --git a/mp_core.h b/mp_core.h
index 947778a181..4a667b56d7 100644
--- a/mp_core.h
+++ b/mp_core.h
@@ -1,14 +1,8 @@
#ifndef MPLAYER_MP_CORE_H
#define MPLAYER_MP_CORE_H
-#include "mp_osd.h"
-#include "libao2/audio_out.h"
-#include "playtree.h"
-#include "stream/stream.h"
-#include "libmpdemux/demuxer.h"
-#include "libmpdemux/stheader.h"
+#include "options.h"
#include "mixer.h"
-#include "libvo/video_out.h"
#include "subreader.h"
// definitions used internally by the core player code
@@ -19,7 +13,6 @@
#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
@@ -43,24 +36,30 @@
typedef struct MPContext {
+ struct MPOpts opts;
+ struct m_config *mconfig;
+ struct vo_x11_state *x11_state;
+ struct mp_fifo *key_fifo;
+ struct input_ctx *input;
int osd_show_percentage;
int osd_function;
const ao_functions_t *audio_out;
- play_tree_t *playtree;
- play_tree_iter_t *playtree_iter;
+ struct play_tree *playtree;
+ struct play_tree_iter *playtree_iter;
+ char *filename; // currently playing file
int eof;
int play_tree_step;
- int loop_times;
-
- stream_t *stream;
- demuxer_t *demuxer;
- sh_audio_t *sh_audio;
- sh_video_t *sh_video;
- demux_stream_t *d_audio;
- demux_stream_t *d_video;
- demux_stream_t *d_sub;
+ unsigned int initialized_flags; // which subsystems have been initialized
+
+ struct stream *stream;
+ struct demuxer *demuxer;
+ 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;
mixer_t mixer;
- const vo_functions_t *video_out;
+ struct vo *video_out;
// 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.
@@ -73,6 +72,15 @@ typedef struct MPContext {
// by the audio CPU usage meter.
double delay;
+ // Timestamp from the last time some timing functions read the
+ // current time, in (occasionally wrapping) microseconds. Used
+ // to turn a new time value to a delta from last time.
+ unsigned int last_time;
+
+ // Used to communicate the parameters of a seek between parts
+ float rel_seek_secs;
+ int abs_seek_pos;
+
float begin_skip; ///< start time of the current skip while on edlout mode
// audio is muted if either EDL or user activates mute
short edl_muted; ///< Stores whether EDL is currently in muted mode.
@@ -83,24 +91,20 @@ typedef struct MPContext {
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
+ struct ass_track_s *set_of_ass_tracks[MAX_SUBTITLE_FILES];
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;
#ifdef USE_DVDNAV
- struct mp_image_s *nav_smpi; ///< last decoded dvdnav video image
+ struct mp_image *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
@@ -109,24 +113,19 @@ typedef struct 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,
- const ao_functions_t *audio_out);
-void exit_player_with_rc(const char* how, int rc);
-void add_subtitles(char *filename, float fps, int noerr);
-int reinit_video_chain(void);
+struct ao_data;
+int build_afilter_chain(struct MPContext *mpctx, struct sh_audio *sh_audio, struct ao_data *ao_data);
+void uninit_player(struct MPContext *mpctx, unsigned int mask);
+void reinit_audio_chain(struct MPContext *mpctx);
+void init_vo_spudec(struct MPContext *mpctx);
+double playing_audio_pts(struct MPContext *mpctx);
+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);
#endif /* MPLAYER_MP_CORE_H */