summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@symbol.nonexistent.invalid>2008-04-03 06:25:41 +0300
committerUoti Urpala <uau@symbol.nonexistent.invalid>2008-04-23 13:41:04 +0300
commit2bcfe1e077fe043751d3f7c73c82be761629419f (patch)
treed66207e0fad0af6d50b1d8a047d34570730a3413 /mplayer.c
parent3bb140d847eb214cf71256794170d72616edbaf4 (diff)
downloadmpv-2bcfe1e077fe043751d3f7c73c82be761629419f.tar.bz2
mpv-2bcfe1e077fe043751d3f7c73c82be761629419f.tar.xz
Add new video driver API
Create new video driver API that has a per-instance context structure and does not rely on keeping status in global or static variables. Existing drivers are not yet converted to this API; instead there is a wrapper which translates calls to them. In the new API, an old API call vo_functions->xyz(args) is generally replaced by vo_xyz(vo_instance, args). The changes to keep the vesa, dxr2 and xover drivers compiling have not been tested.
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/mplayer.c b/mplayer.c
index d5ee16ebdc..1aeaa06e17 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -626,7 +626,7 @@ void uninit_player(unsigned int mask){
if(mask&INITIALIZED_VO){
initialized_flags&=~INITIALIZED_VO;
current_module="uninit_vo";
- mpctx->video_out->uninit();
+ vo_destroy(mpctx->video_out);
mpctx->video_out=NULL;
#ifdef USE_DVDNAV
mp_dvdnav_context_free(mpctx);
@@ -2344,7 +2344,7 @@ static void pause_loop(void)
guiGetEvent(guiCEvent, (char *)guiSetPause);
#endif
if (mpctx->video_out && mpctx->sh_video && vo_config_count)
- mpctx->video_out->control(VOCTRL_PAUSE, NULL);
+ vo_control(mpctx->video_out, VOCTRL_PAUSE, NULL);
if (mpctx->audio_out && mpctx->sh_audio)
mpctx->audio_out->pause(); // pause audio, keep data if possible
@@ -2357,7 +2357,7 @@ static void pause_loop(void)
continue;
}
if (mpctx->sh_video && mpctx->video_out && vo_config_count)
- mpctx->video_out->check_events();
+ vo_check_events(mpctx->video_out);
#ifdef HAVE_NEW_GUI
if (use_gui) {
guiEventHandling();
@@ -2380,7 +2380,7 @@ static void pause_loop(void)
if (mpctx->audio_out && mpctx->sh_audio)
mpctx->audio_out->resume(); // resume audio
if (mpctx->video_out && mpctx->sh_video && vo_config_count)
- mpctx->video_out->control(VOCTRL_RESUME, NULL); // resume video
+ vo_control(mpctx->video_out, VOCTRL_RESUME, NULL); // resume video
(void)GetRelativeTime(); // ignore time that passed during pause
#ifdef HAVE_NEW_GUI
if (use_gui) {
@@ -2498,7 +2498,7 @@ static int seek(MPContext *mpctx, double amount, int style)
current_module = "seek_video_reset";
resync_video_stream(mpctx->sh_video);
if (vo_config_count)
- mpctx->video_out->control(VOCTRL_RESET, NULL);
+ vo_control(mpctx->video_out, VOCTRL_RESET, NULL);
mpctx->sh_video->num_buffered_pts = 0;
mpctx->sh_video->last_pts = MP_NOPTS_VALUE;
mpctx->num_buffered_frames = 0;
@@ -2997,7 +2997,8 @@ while (player_idle_mode && !filename) {
play_tree_t * entry = NULL;
mp_cmd_t * cmd;
while (!(cmd = mp_input_get_cmd(0,1,0))) { // wait for command
- if (mpctx->video_out && vo_config_count) mpctx->video_out->check_events();
+ if (mpctx->video_out && vo_config_count)
+ vo_check_events(mpctx->video_out);
usec_sleep(20000);
}
switch (cmd->id) {
@@ -3732,7 +3733,8 @@ if(!mpctx->sh_video) {
#endif
current_module="vo_check_events";
- if (vo_config_count) mpctx->video_out->check_events();
+ if (vo_config_count)
+ vo_check_events(mpctx->video_out);
#ifdef HAVE_X11
if (stop_xscreensaver) {
@@ -3757,7 +3759,8 @@ if(!mpctx->sh_video) {
if (!frame_time_remaining && blit_frame) {
unsigned int t2=GetTimer();
- if(vo_config_count) mpctx->video_out->flip_page();
+ if(vo_config_count)
+ vo_flip_page(mpctx->video_out);
mpctx->num_buffered_frames--;
vout_time_usage += (GetTimer() - t2) * 0.000001;