[Toxine-cvs] CVS: toxine/src/plugins vo_aa.c,1.17,1.18 vo_caca.c,1.3,1.4 vo_dxr3.c,1.21,1.22 vo_none
Brought to you by:
f1rmb
From: Daniel Caujolle-B. <f1...@us...> - 2004-05-30 22:45:40
|
Update of /cvsroot/toxine/toxine/src/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24057 Modified Files: vo_aa.c vo_caca.c vo_dxr3.c vo_none.c vo_x11.c Log Message: @@forgotten watchdog usage. Index: vo_aa.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/plugins/vo_aa.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- vo_aa.c 27 May 2004 00:27:40 -0000 1.17 +++ vo_aa.c 30 May 2004 22:45:26 -0000 1.18 @@ -57,11 +57,10 @@ aa_hidecursor(private->context); - tox->video.port = xine_open_video_driver(tox->xine, - tox->video.name, - XINE_VISUAL_TYPE_AA, - (void *) private->context); - + start_watchdog(tox, "xine_open_video_driver"); + tox->video.port = xine_open_video_driver(tox->xine, tox->video.name, XINE_VISUAL_TYPE_AA, (void *) private->context); + stop_watchdog(tox); + if(tox->video.port == NULL) { perr("xine_open_video_driver() failed to load '%s' driver.\n", tox->video.name); exit(TOX_ERR_XINE_OPEN_VIDEO_DRIVER); @@ -74,7 +73,9 @@ toxine_vo_plugin_t *vop = (toxine_vo_plugin_t *) tox->video.cur_plugin; aa_private_t *private = (aa_private_t *) vop->private; + start_watchdog(tox, "xine_close_video_driver"); xine_close_video_driver(tox->xine, tox->video.port); + stop_watchdog(tox); tox->video.port = NULL; private->init = 0; Index: vo_caca.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/plugins/vo_caca.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- vo_caca.c 27 May 2004 00:27:40 -0000 1.3 +++ vo_caca.c 30 May 2004 22:45:27 -0000 1.4 @@ -75,7 +75,9 @@ private->init = 1; + start_watchdog(tox, "xine_open_video_driver"); tox->video.port = xine_open_video_driver(tox->xine, tox->video.name, XINE_VISUAL_TYPE_CACA, NULL); + stop_watchdog(tox); if(tox->video.port == NULL) { perr("xine_open_video_driver() failed to load '%s' driver.\n", tox->video.name); @@ -90,7 +92,9 @@ toxine_vo_plugin_t *vop = (toxine_vo_plugin_t *) tox->video.cur_plugin; caca_private_t *private = (caca_private_t *) vop->private; + start_watchdog(tox, "xine_close_video_driver"); xine_close_video_driver(tox->xine, tox->video.port); + stop_watchdog(tox); tox->video.port = NULL; private->init = 0; Index: vo_dxr3.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/plugins/vo_dxr3.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- vo_dxr3.c 27 May 2004 00:27:40 -0000 1.21 +++ vo_dxr3.c 30 May 2004 22:45:27 -0000 1.22 @@ -52,9 +52,11 @@ mode = 1; /* First, we have to initialize the config entry */ + start_watchdog(tox, "xine_config_register_enum"); (void *) xine_config_register_enum(tox->xine, "dxr3.videoout_mode", 0, videoout_modes, "Dxr3: videoout mode (tv or overlay)", NULL, 0, NULL, NULL); + stop_watchdog(tox); /* Then, force it to TV mode */ toxine_config_update_num(tox, "dxr3.videoout_mode", mode); @@ -63,7 +65,9 @@ /* Reload config file now */ toxine_config_load(tox); + start_watchdog(tox, "xine_open_video_driver"); tox->video.port = xine_open_video_driver(tox->xine, drivername, XINE_VISUAL_TYPE_X11, NULL); + stop_watchdog(tox); private->init = 1; @@ -80,7 +84,9 @@ toxine_vo_plugin_t *vop = (toxine_vo_plugin_t *) tox->video.cur_plugin; dxr3_private_t *private = (dxr3_private_t *) vop->private; + start_watchdog(tox, "xine_close_video_driver"); xine_close_video_driver(tox->xine, tox->video.port); + stop_watchdog(tox); tox->video.port = NULL; private->init = 0; Index: vo_none.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/plugins/vo_none.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- vo_none.c 27 May 2004 00:27:40 -0000 1.14 +++ vo_none.c 30 May 2004 22:45:27 -0000 1.15 @@ -33,8 +33,9 @@ toxine_vo_plugin_t *vop = (toxine_vo_plugin_t *) tox->video.cur_plugin; none_private_t *private = (none_private_t *) vop->private; - tox->video.port = xine_open_video_driver(tox->xine, tox->video.name, XINE_VISUAL_TYPE_NONE, - (void *)NULL); + start_watchdog(tox, "xine_open_video_driver"); + tox->video.port = xine_open_video_driver(tox->xine, tox->video.name, XINE_VISUAL_TYPE_NONE, (void *)NULL); + stop_watchdog(tox); private->init = 1; @@ -51,7 +52,9 @@ toxine_vo_plugin_t *vop = (toxine_vo_plugin_t *) tox->video.cur_plugin; none_private_t *private = (none_private_t *) vop->private; + start_watchdog(tox, "xine_close_video_driver"); xine_close_video_driver(tox->xine, tox->video.port); + stop_watchdog(tox); tox->video.port = NULL; private->init = 0; Index: vo_x11.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/plugins/vo_x11.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- vo_x11.c 27 May 2004 00:27:40 -0000 1.31 +++ vo_x11.c 30 May 2004 22:45:27 -0000 1.32 @@ -256,9 +256,13 @@ private->x11_drawable[private->fullscreen].y); #endif - if(tox->video.port && (tox->xine_state & XINE_STREAM)) + if(tox->video.port && (tox->xine_state & XINE_STREAM)) { + start_watchdog(tox, "xine_gui_send_vo_data"); xine_gui_send_vo_data(tox->stream, XINE_GUI_SEND_DRAWABLE_CHANGED, (void*) private->x11_drawable[private->fullscreen].video_window); + stop_watchdog(tox); + + } pthread_mutex_unlock(&private->mutex); @@ -297,7 +301,9 @@ if(tox->xine_state & XINE_STREAM) { if(tox->xine != NULL) { + start_watchdog(tox, "xine_get_status"); status = xine_get_status(tox->stream); + stop_watchdog(tox); if(status == XINE_STATUS_PLAY) { screensaver_timer++; @@ -338,13 +344,19 @@ rect.w = 0; rect.h = 0; - if(tox->video.port && (tox->xine_state & XINE_STREAM) && - (xine_gui_send_vo_data(tox->stream, - XINE_GUI_SEND_TRANSLATE_GUI_TO_VIDEO, (void*)&rect) != -1)) { - /* driver implements gui->video coordinate space translation, use it */ - *video_x = rect.x; - *video_y = rect.y; - return 1; + if(tox->video.port && (tox->xine_state & XINE_STREAM)) { + int result; + + start_watchdog(tox, "xine_gui_send_vo_data"); + result = xine_gui_send_vo_data(tox->stream, XINE_GUI_SEND_TRANSLATE_GUI_TO_VIDEO, (void*)&rect); + stop_watchdog(tox); + + if(result != -1) { + /* driver implements gui->video coordinate space translation, use it */ + *video_x = rect.x; + *video_y = rect.y; + return 1; + } } /* Driver cannot convert gui->video space, fall back to old code... */ @@ -456,7 +468,9 @@ XLockDisplay (private->display); if(tox->video.port && (tox->xine_state & XINE_STREAM)) { + start_watchdog(tox, "xine_gui_send_vo_data"); xine_gui_send_vo_data(tox->stream, XINE_GUI_SEND_SELECT_VISUAL, (void *)&vinfo); + stop_watchdog(tox); if(vinfo != (XVisualInfo *) -1) { if(!vinfo) { perr("Output driver cannot select a working visual\n"); @@ -719,10 +733,12 @@ if(!strcasecmp(tox->video.name, "dxr3_ov")) { /* First, we have to initialize the config entry */ + start_watchdog(tox, "xine_config_register_enum"); (void *) xine_config_register_enum(tox->xine, "dxr3.videoout_mode", 0, videoout_modes, "Dxr3: videoout mode (tv or overlay)", NULL, 0, NULL, NULL); - + stop_watchdog(tox); + /* Then, force it to Overlay mode */ toxine_config_update_num(tox, "dxr3.videoout_mode", mode); /* Force saving */ @@ -736,8 +752,9 @@ xine_strdupa(drivername, tox->video.name); - tox->video.port = xine_open_video_driver(tox->xine, drivername, - XINE_VISUAL_TYPE_X11, (void *)&vis); + start_watchdog(tox, "xine_open_video_driver"); + tox->video.port = xine_open_video_driver(tox->xine, drivername, XINE_VISUAL_TYPE_X11, (void *)&vis); + stop_watchdog(tox); if(tox->video.port == NULL) { perr("xine_open_video_driver() failed to load '%s' driver.\n", drivername); @@ -831,20 +848,45 @@ case XK_BackSpace: /* speed == * 1 */ if(tox->xine_state & XINE_STREAM) { - if((xine_get_param(tox->stream, XINE_PARAM_SPEED)) != XINE_SPEED_NORMAL) + int speed; + + start_watchdog(tox, "xine_config_register_enum"); + speed = xine_get_param(tox->stream, XINE_PARAM_SPEED); + stop_watchdog(tox); + + if(speed != XINE_SPEED_NORMAL) { + start_watchdog(tox, "xine_set_param"); xine_set_param(tox->stream, XINE_PARAM_SPEED, XINE_SPEED_NORMAL); + stop_watchdog(tox); + } } break; case XK_Up: /* speed++ */ if(tox->xine_state & XINE_STREAM) { - if((xine_get_param(tox->stream, XINE_PARAM_SPEED)) < XINE_SPEED_FAST_4) { - if((xine_get_param(tox->stream, XINE_PARAM_SPEED)) > XINE_SPEED_PAUSE) - xine_set_param(tox->stream, XINE_PARAM_SPEED, - ((xine_get_param(tox->stream, XINE_PARAM_SPEED)) * 2)); + int speed; + + start_watchdog(tox, "xine_get_param"); + speed = xine_get_param(tox->stream, XINE_PARAM_SPEED); + stop_watchdog(tox); + + if(speed < XINE_SPEED_FAST_4) { + start_watchdog(tox, "xine_get_param"); + speed = xine_get_param(tox->stream, XINE_PARAM_SPEED); + stop_watchdog(tox); + + if(speed > XINE_SPEED_PAUSE) { + start_watchdog(tox, "xine_get_param"); + speed = xine_get_param(tox->stream, XINE_PARAM_SPEED) * 2; + stop_watchdog(tox); + } else - xine_set_param(tox->stream, XINE_PARAM_SPEED, XINE_SPEED_SLOW_4); + speed = XINE_SPEED_SLOW_4; + + start_watchdog(tox, "xine_set_param"); + xine_set_param(tox->stream, XINE_PARAM_SPEED, speed); + stop_watchdog(tox); } } break; @@ -852,18 +894,41 @@ case XK_Down: /* speed-- */ if(tox->xine_state & XINE_STREAM) { - if((xine_get_param(tox->stream, XINE_PARAM_SPEED)) > XINE_SPEED_PAUSE) - xine_set_param(tox->stream, XINE_PARAM_SPEED, - ((xine_get_param(tox->stream, XINE_PARAM_SPEED)) / 2)); + int speed; + + start_watchdog(tox, "xine_get_param"); + speed = xine_get_param(tox->stream, XINE_PARAM_SPEED); + stop_watchdog(tox); + + if(speed > XINE_SPEED_PAUSE) { + + start_watchdog(tox, "xine_get_param"); + speed = xine_get_param(tox->stream, XINE_PARAM_SPEED) / 2; + stop_watchdog(tox); + + start_watchdog(tox, "xine_set_param"); + xine_set_param(tox->stream, XINE_PARAM_SPEED, speed); + stop_watchdog(tox); + } } break; case XK_space: if(tox->xine_state & XINE_STREAM) { - if(xine_get_param(tox->stream, XINE_PARAM_SPEED) != XINE_SPEED_PAUSE) - xine_set_param(tox->stream, XINE_PARAM_SPEED, XINE_SPEED_PAUSE); + int speed; + + start_watchdog(tox, "xine_get_param"); + speed = xine_get_param(tox->stream, XINE_PARAM_SPEED); + stop_watchdog(tox); + + if(speed != XINE_SPEED_PAUSE) + speed = XINE_SPEED_PAUSE; else - xine_set_param(tox->stream, XINE_PARAM_SPEED, XINE_SPEED_NORMAL); + speed = XINE_SPEED_NORMAL; + + start_watchdog(tox, "xine_set_param"); + xine_set_param(tox->stream, XINE_PARAM_SPEED, speed); + stop_watchdog(tox); } break; } @@ -894,7 +959,9 @@ input.button = 0; /* No buttons, just motion. */ input.x = x; input.y = y; + start_watchdog(tox, "xine_event_send"); xine_event_send(tox->stream, &event); + stop_watchdog(tox); } } break; @@ -922,7 +989,9 @@ input.button = 1; input.x = x; input.y = y; + start_watchdog(tox, "xine_event_send"); xine_event_send(tox->stream, &event); + stop_watchdog(tox); } } } @@ -934,8 +1003,11 @@ if (xevent->count == 0) { if((xev->xany.window == private->x11_drawable[private->fullscreen].video_window) - && tox->video.port && (tox->xine_state & XINE_STREAM)) + && tox->video.port && (tox->xine_state & XINE_STREAM)) { + start_watchdog(tox, "xine_gui_send_vo_data"); xine_gui_send_vo_data(tox->stream, XINE_GUI_SEND_EXPOSE_EVENT, (void *)xev); + stop_watchdog(tox); + } } } @@ -1037,7 +1109,9 @@ pthread_mutex_lock(&private->mutex); pthread_join(private->timed_thread, NULL); + start_watchdog(tox, "xine_close_video_driver"); xine_close_video_driver(tox->xine, tox->video.port); + stop_watchdog(tox); tox->video.port = NULL; XLockDisplay(private->display); |