diff options
author | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2002-03-21 16:21:01 +0000 |
---|---|---|
committer | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2002-03-21 16:21:01 +0000 |
commit | 891fb0a646780b715e4f8d53b49e4615917a13e8 (patch) | |
tree | ef2c1525f9d4567bb6083fc305f3b3fc65a9e27b /src/video_out | |
parent | be7a8b70ff25d405dbaa8fc082fc9349f65bf26b (diff) | |
download | xine-lib-891fb0a646780b715e4f8d53b49e4615917a13e8.tar.gz xine-lib-891fb0a646780b715e4f8d53b49e4615917a13e8.tar.bz2 |
- only draw still frame/logo if needed
- fix syncfb driver
CVS patchset: 1605
CVS date: 2002/03/21 16:21:01
Diffstat (limited to 'src/video_out')
-rw-r--r-- | src/video_out/video_out_syncfb.c | 53 | ||||
-rw-r--r-- | src/video_out/video_out_xshm.c | 47 | ||||
-rw-r--r-- | src/video_out/video_out_xv.c | 62 |
3 files changed, 106 insertions, 56 deletions
diff --git a/src/video_out/video_out_syncfb.c b/src/video_out/video_out_syncfb.c index 5c18312e1..79505c8a5 100644 --- a/src/video_out/video_out_syncfb.c +++ b/src/video_out/video_out_syncfb.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out_syncfb.c,v 1.56 2002/03/18 11:01:07 richwareham Exp $ + * $Id: video_out_syncfb.c,v 1.57 2002/03/21 16:21:01 miguelfreitas Exp $ * * video_out_syncfb.c, SyncFB (for Matrox G200/G400 cards) interface for xine * @@ -746,6 +746,32 @@ static void syncfb_flush_recent_frames (syncfb_driver_t *this) { } #endif +static int syncfb_redraw_needed (vo_driver_t *this_gen) { + syncfb_driver_t *this = (syncfb_driver_t *) this_gen; + int gui_x, gui_y, gui_width, gui_height; + int ret = 0; + + this->frame_output_cb (this->user_data, + this->ideal_width, this->ideal_height, + &gui_x, &gui_y, &gui_width, &gui_height); + + if ( (gui_x != this->gui_x) || (gui_y != this->gui_y) + || (gui_width != this->gui_width) || (gui_height != this->gui_height) ) { + + this->gui_x = gui_x; + this->gui_y = gui_y; + this->gui_width = gui_width; + this->gui_height = gui_height; + + syncfb_compute_output_size (this); + + syncfb_clean_output_area (this); + + ret = 1; + } + + return ret; +} static void syncfb_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) { @@ -760,7 +786,6 @@ static void syncfb_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) printf ("video_out_xv: xv_display_frame... not displayed, waiting for completion event\n"); } else { - int gui_x, gui_y, gui_width, gui_height; /* * queue frames (deinterlacing) @@ -797,25 +822,9 @@ static void syncfb_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) * ask for offset and output size */ - this->frame_output_cb (this->user_data, - this->ideal_width, this->ideal_height, - &gui_x, &gui_y, &gui_width, &gui_height); - - if ( (gui_x != this->gui_x) || (gui_y != this->gui_y) - || (gui_width != this->gui_width) || (gui_height != this->gui_height) ) { - - this->gui_x = gui_x; - this->gui_y = gui_y; - this->gui_width = gui_width; - this->gui_height = gui_height; - - syncfb_compute_output_size (this); - - syncfb_clean_output_area (this); - } - + syncfb_redraw_needed( this_gen ); - /* the rest is only successful and safe, if the overlay is really on */ + /* the rest is only successful and safe, if the overlay is really on */ if(this->overlay_state) { if(this->bufinfo.id != -1) { printf("video_out_syncfb: error. (invalid syncfb image buffer state)\n"); @@ -838,7 +847,6 @@ static void syncfb_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) printf("video_out_syncfb: error. (commit ioctl failed)\n"); } - frame->vo_frame.displayed(&frame->vo_frame); this->bufinfo.id = -1; } } @@ -1200,6 +1208,7 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) { this->vo_driver.get_property_min_max = syncfb_get_property_min_max; this->vo_driver.gui_data_exchange = syncfb_gui_data_exchange; this->vo_driver.exit = syncfb_exit; + this->vo_driver.redraw_needed = syncfb_redraw_needed; /* * init properties @@ -1221,7 +1230,7 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) { } static vo_info_t vo_info_syncfb = { - 4, + 5, "SyncFB", "xine video output plugin using the SyncFB module for Matrox G200/G400 cards", VISUAL_TYPE_X11, diff --git a/src/video_out/video_out_xshm.c b/src/video_out/video_out_xshm.c index 6411b4282..9c6bbfb83 100644 --- a/src/video_out/video_out_xshm.c +++ b/src/video_out/video_out_xshm.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out_xshm.c,v 1.67 2002/03/07 13:26:16 jcdutton Exp $ + * $Id: video_out_xshm.c,v 1.68 2002/03/21 16:21:01 miguelfreitas Exp $ * * video_out_xshm.c, X11 shared memory extension interface for xine * @@ -787,7 +787,7 @@ static void clean_output_area (xshm_driver_t *this) { XSetForeground (this->display, this->gc, this->black.pixel); XFillRectangle(this->display, this->drawable, this->gc, - this->gui_x, this->gui_y, + 0, 0, this->gui_width, this->gui_height); #if 0 @@ -821,6 +821,38 @@ static void clean_output_area (xshm_driver_t *this) { XUnlockDisplay (this->display); } +static int xshm_redraw_needed (vo_driver_t *this_gen) { + xshm_driver_t *this = (xshm_driver_t *) this_gen; + int gui_x, gui_y, gui_width, gui_height; + int ret = 0; + + if( this->cur_frame ) + { + this->frame_output_cb (this->user_data, + this->cur_frame->output_width, this->cur_frame->output_height, + &gui_x, &gui_y, &gui_width, &gui_height); + + if ( (this->gui_x != gui_x) || (this->gui_y != gui_y) + || (this->gui_width != gui_width) + || (this->gui_height != gui_height) ) { + + this->gui_x = gui_x; + this->gui_y = gui_y; + this->gui_width = gui_width; + this->gui_height = gui_height; + + clean_output_area (this); + ret = 1; + } + } + else + { + ret = 1; + } + + return ret; +} + static void xshm_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) { xshm_driver_t *this = (xshm_driver_t *) this_gen; @@ -880,8 +912,8 @@ static void xshm_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) { this->cur_frame = frame; - xoffset = (this->gui_width - frame->output_width) / 2 + this->gui_x; - yoffset = (this->gui_height - frame->output_height) / 2 + this->gui_y; + xoffset = (this->gui_width - frame->output_width) / 2; + yoffset = (this->gui_height - frame->output_height) / 2; XLockDisplay (this->display); #ifdef LOG @@ -1014,8 +1046,8 @@ static void xshm_translate_gui2video (xshm_driver_t *this, * gui area. This is the case in fullscreen mode, where we often * have black borders on the top/bottom/left/right side. */ - x -= ((this->gui_width - frame->output_width) >> 1) + this->gui_x; - y -= ((this->gui_height - frame->output_height) >> 1) + this->gui_y; + x -= ((this->gui_width - frame->output_width) >> 1); + y -= ((this->gui_height - frame->output_height) >> 1); /* * 2. @@ -1271,6 +1303,7 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) { this->vo_driver.get_property_min_max = xshm_get_property_min_max; this->vo_driver.gui_data_exchange = xshm_gui_data_exchange; this->vo_driver.exit = xshm_exit; + this->vo_driver.redraw_needed = xshm_redraw_needed; XAllocNamedColor (this->display, DefaultColormap (this->display, this->screen), @@ -1405,7 +1438,7 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) { } static vo_info_t vo_info_shm = { - 4, /* interface version */ + 5, /* interface version */ "XShm", /* id */ "xine video output plugin using the MIT X shared memory extension", VISUAL_TYPE_X11, /* visual_type */ diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c index a2514bd73..f98226b42 100644 --- a/src/video_out/video_out_xv.c +++ b/src/video_out/video_out_xv.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out_xv.c,v 1.105 2002/03/07 13:26:16 jcdutton Exp $ + * $Id: video_out_xv.c,v 1.106 2002/03/21 16:21:02 miguelfreitas Exp $ * * video_out_xv.c, X11 video extension interface for xine * @@ -161,7 +161,7 @@ struct xv_driver_s { int gui_x, gui_y; int gui_width, gui_height; - + /* * "output" size: * @@ -575,7 +575,7 @@ static void xv_clean_output_area (xv_driver_t *this) { XSetForeground (this->display, this->gc, this->black.pixel); XFillRectangle(this->display, this->drawable, this->gc, - this->gui_x, this->gui_y, this->gui_width, this->gui_height); + 0, 0, this->gui_width, this->gui_height); if (this->use_colorkey) { XSetForeground (this->display, this->gc, this->colorkey); @@ -700,8 +700,8 @@ static void xv_compute_output_size (xv_driver_t *this) { this->output_height = (double) this->ideal_height * y_factor ; } - this->output_xoffset = (this->gui_width - this->output_width) / 2 + this->gui_x; - this->output_yoffset = (this->gui_height - this->output_height) / 2 + this->gui_y; + this->output_xoffset = (this->gui_width - this->output_width) / 2; + this->output_yoffset = (this->gui_height - this->output_height) / 2; #ifdef LOG printf ("video_out_xv: frame source %d x %d => screen output %d x %d\n", @@ -757,7 +757,33 @@ static void xv_flush_recent_frames (xv_driver_t *this) { } #endif +static int xv_redraw_needed (vo_driver_t *this_gen) { + xv_driver_t *this = (xv_driver_t *) this_gen; + int gui_x, gui_y, gui_width, gui_height; + int ret = 0; + + this->frame_output_cb (this->user_data, + this->ideal_width, this->ideal_height, + &gui_x, &gui_y, &gui_width, &gui_height); + + if ( (gui_x != this->gui_x) || (gui_y != this->gui_y) + || (gui_width != this->gui_width) || (gui_height != this->gui_height) ) { + + this->gui_x = gui_x; + this->gui_y = gui_y; + this->gui_width = gui_width; + this->gui_height = gui_height; + xv_compute_output_size (this); + + xv_clean_output_area (this); + + ret = 1; + } + + return ret; +} + static void xv_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) { xv_driver_t *this = (xv_driver_t *) this_gen; @@ -774,8 +800,6 @@ static void xv_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) { } else { - int gui_x, gui_y, gui_width, gui_height; - /* * queue frames (deinterlacing) * free old frames @@ -819,24 +843,7 @@ static void xv_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) { * tell gui that we are about to display a frame, * ask for offset and output size */ - - this->frame_output_cb (this->user_data, - this->ideal_width, this->ideal_height, - &gui_x, &gui_y, &gui_width, &gui_height); - - if ( (gui_x != this->gui_x) || (gui_y != this->gui_y) - || (gui_width != this->gui_width) || (gui_height != this->gui_height) ) { - - this->gui_x = gui_x; - this->gui_y = gui_y; - this->gui_width = gui_width; - this->gui_height = gui_height; - - xv_compute_output_size (this); - - xv_clean_output_area (this); - } - + xv_redraw_needed (this_gen); XLockDisplay (this->display); @@ -1005,7 +1012,7 @@ static int xv_gui_data_exchange (vo_driver_t *this_gen, XExposeEvent * xev = (XExposeEvent *) data; /* FIXME : take care of completion events */ - + if (xev->count == 0) { if (this->cur_frame) { XLockDisplay (this->display); @@ -1308,6 +1315,7 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) { this->vo_driver.get_property_min_max = xv_get_property_min_max; this->vo_driver.gui_data_exchange = xv_gui_data_exchange; this->vo_driver.exit = xv_exit; + this->vo_driver.redraw_needed = xv_redraw_needed; /* * init properties @@ -1434,7 +1442,7 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) { } static vo_info_t vo_info_xv = { - 4, + 5, "Xv", "xine video output plugin using the MIT X video extension", VISUAL_TYPE_X11, |