From: Miguel F. <mig...@us...> - 2002-03-21 18:29:54
|
Update of /cvsroot/xine/xine-lib/src/video_out In directory usw-pr-cvs1:/tmp/cvs-serv16247/src/video_out Modified Files: video_out_syncfb.c video_out_x11.h video_out_xshm.c video_out_xv.c Log Message: adding new parameters to frame_output_cb Index: video_out_syncfb.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/video_out/video_out_syncfb.c,v retrieving revision 1.57 retrieving revision 1.58 diff -u -r1.57 -r1.58 --- video_out_syncfb.c 21 Mar 2002 16:21:01 -0000 1.57 +++ video_out_syncfb.c 21 Mar 2002 18:29:51 -0000 1.58 @@ -174,6 +174,7 @@ int gui_x, gui_y; int gui_width, gui_height; + int gui_win_x, gui_win_y; /* * "output" size: @@ -200,7 +201,8 @@ void (*frame_output_cb) (void *user_data, int video_width, int video_height, int *dest_x, int *dest_y, - int *dest_height, int *dest_width); + int *dest_height, int *dest_width, + int *win_x, int *win_y); char scratch[256]; @@ -681,8 +683,8 @@ this->syncfb_config.image_width = this->output_width; this->syncfb_config.image_height = (this->deinterlace_enabled) ? (this->output_height-2) : this->output_height; - this->syncfb_config.image_xorg = this->output_xoffset; - this->syncfb_config.image_yorg = this->output_yoffset; + this->syncfb_config.image_xorg = this->output_xoffset + this->gui_win_x; + this->syncfb_config.image_yorg = this->output_yoffset + this->gui_win_y; this->syncfb_config.src_crop_top = this->displayed_yoffset; this->syncfb_config.src_crop_bot = (this->deinterlace_enabled && this->displayed_yoffset == 0) ? 1 : this->displayed_yoffset; @@ -748,20 +750,24 @@ 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 gui_x, gui_y, gui_width, gui_height, gui_win_x, gui_win_y; int ret = 0; this->frame_output_cb (this->user_data, this->ideal_width, this->ideal_height, - &gui_x, &gui_y, &gui_width, &gui_height); + &gui_x, &gui_y, &gui_width, &gui_height, + &gui_win_x, &gui_win_y ); if ( (gui_x != this->gui_x) || (gui_y != this->gui_y) - || (gui_width != this->gui_width) || (gui_height != this->gui_height) ) { + || (gui_width != this->gui_width) || (gui_height != this->gui_height) + || (gui_win_x != this->gui_win_x) || (gui_win_y != this->gui_win_y) ) { this->gui_x = gui_x; this->gui_y = gui_y; this->gui_width = gui_width; this->gui_height = gui_height; + this->gui_win_x = gui_win_x; + this->gui_win_y = gui_win_y; syncfb_compute_output_size (this); Index: video_out_x11.h =================================================================== RCS file: /cvsroot/xine/xine-lib/src/video_out/video_out_x11.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- video_out_x11.h 16 Feb 2002 22:43:24 -0000 1.14 +++ video_out_x11.h 21 Mar 2002 18:29:51 -0000 1.15 @@ -81,12 +81,16 @@ * area and the video output driver will do it's best * to adjust the video frames to that size (while * preserving aspect ration and stuff). + * dest_x, dest_y: offset inside window + * dest_width, dest_height: available drawing space + * win_x, win_y: window absolute screen position */ void (*frame_output_cb) (void *user_data, int video_width, int video_height, int *dest_x, int *dest_y, - int *dest_width, int *dest_height); + int *dest_width, int *dest_height, + int *win_x, int *win_y); } x11_visual_t; Index: video_out_xshm.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/video_out/video_out_xshm.c,v retrieving revision 1.68 retrieving revision 1.69 diff -u -r1.68 -r1.69 --- video_out_xshm.c 21 Mar 2002 16:21:01 -0000 1.68 +++ video_out_xshm.c 21 Mar 2002 18:29:51 -0000 1.69 @@ -151,7 +151,9 @@ int gui_y; int gui_width; int gui_height; - + int gui_win_x; + int gui_win_y; + /* aspect ratio of pixels on screen */ double display_ratio; @@ -162,7 +164,8 @@ void (*frame_output_cb) (void *user_data, int video_width, int video_height, int *dest_x, int *dest_y, - int *dest_height, int *dest_width); + int *dest_height, int *dest_width, + int *win_x, int *win_y); void (*dest_size_cb) (void *user_data, int video_width, int video_height, @@ -787,7 +790,7 @@ XSetForeground (this->display, this->gc, this->black.pixel); XFillRectangle(this->display, this->drawable, this->gc, - 0, 0, + this->gui_x, this->gui_y, this->gui_width, this->gui_height); #if 0 @@ -823,23 +826,28 @@ 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 gui_x, gui_y, gui_width, gui_height, gui_win_x, gui_win_y; 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); + &gui_x, &gui_y, &gui_width, &gui_height, + &gui_win_x, &gui_win_y ); if ( (this->gui_x != gui_x) || (this->gui_y != gui_y) || (this->gui_width != gui_width) - || (this->gui_height != gui_height) ) { + || (this->gui_height != gui_height) + || (this->gui_win_x != gui_win_x) + || (this->gui_win_y != gui_win_y) ) { this->gui_x = gui_x; this->gui_y = gui_y; this->gui_width = gui_width; this->gui_height = gui_height; + this->gui_win_x = gui_win_x; + this->gui_win_y = gui_win_y; clean_output_area (this); ret = 1; @@ -873,7 +881,7 @@ frame->vo_frame.displayed (&frame->vo_frame); } else { - int gui_x, gui_y, gui_width, gui_height; + int gui_x, gui_y, gui_width, gui_height, gui_win_x, gui_win_y; #ifdef LOG printf ("video_out_xshm: about to draw frame %d x %d...\n", @@ -887,16 +895,21 @@ this->frame_output_cb (this->user_data, frame->output_width, frame->output_height, - &gui_x, &gui_y, &gui_width, &gui_height); + &gui_x, &gui_y, &gui_width, &gui_height, + &gui_win_x, &gui_win_y); if ( (this->gui_x != gui_x) || (this->gui_y != gui_y) || (this->gui_width != gui_width) - || (this->gui_height != gui_height) ) { + || (this->gui_height != gui_height) + || (this->gui_win_x != gui_win_x) + || (this->gui_win_y != gui_win_y) ) { this->gui_x = gui_x; this->gui_y = gui_y; this->gui_width = gui_width; this->gui_height = gui_height; + this->gui_win_x = gui_win_x; + this->gui_win_y = gui_win_y; clean_output_area (this); } @@ -912,8 +925,8 @@ this->cur_frame = frame; - xoffset = (this->gui_width - frame->output_width) / 2; - yoffset = (this->gui_height - frame->output_height) / 2; + xoffset = (this->gui_width - frame->output_width) / 2 + this->gui_x; + yoffset = (this->gui_height - frame->output_height) / 2 + this->gui_y; XLockDisplay (this->display); #ifdef LOG @@ -1046,8 +1059,8 @@ * 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); - y -= ((this->gui_height - frame->output_height) >> 1); + x -= ((this->gui_width - frame->output_width) >> 1) + this->gui_x; + y -= ((this->gui_height - frame->output_height) >> 1) + this->gui_y; /* * 2. Index: video_out_xv.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/video_out/video_out_xv.c,v retrieving revision 1.106 retrieving revision 1.107 diff -u -r1.106 -r1.107 --- video_out_xv.c 21 Mar 2002 16:21:02 -0000 1.106 +++ video_out_xv.c 21 Mar 2002 18:29:51 -0000 1.107 @@ -161,6 +161,7 @@ int gui_x, gui_y; int gui_width, gui_height; + int gui_win_x, gui_win_y; /* * "output" size: @@ -187,7 +188,8 @@ void (*frame_output_cb) (void *user_data, int video_width, int video_height, int *dest_x, int *dest_y, - int *dest_height, int *dest_width); + int *dest_height, int *dest_width, + int *win_x, int *win_y); char scratch[256]; @@ -575,7 +577,7 @@ XSetForeground (this->display, this->gc, this->black.pixel); XFillRectangle(this->display, this->drawable, this->gc, - 0, 0, this->gui_width, this->gui_height); + this->gui_x, this->gui_y, this->gui_width, this->gui_height); if (this->use_colorkey) { XSetForeground (this->display, this->gc, this->colorkey); @@ -700,8 +702,8 @@ this->output_height = (double) this->ideal_height * y_factor ; } - this->output_xoffset = (this->gui_width - this->output_width) / 2; - this->output_yoffset = (this->gui_height - this->output_height) / 2; + 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; #ifdef LOG printf ("video_out_xv: frame source %d x %d => screen output %d x %d\n", @@ -759,20 +761,24 @@ 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 gui_x, gui_y, gui_width, gui_height, gui_win_x, gui_win_y; int ret = 0; this->frame_output_cb (this->user_data, this->ideal_width, this->ideal_height, - &gui_x, &gui_y, &gui_width, &gui_height); + &gui_x, &gui_y, &gui_width, &gui_height, + &gui_win_x, &gui_win_y ); if ( (gui_x != this->gui_x) || (gui_y != this->gui_y) - || (gui_width != this->gui_width) || (gui_height != this->gui_height) ) { + || (gui_width != this->gui_width) || (gui_height != this->gui_height) + || (gui_win_x != this->gui_win_x) || (gui_win_y != this->gui_win_y) ) { this->gui_x = gui_x; this->gui_y = gui_y; this->gui_width = gui_width; this->gui_height = gui_height; + this->gui_win_x = gui_win_x; + this->gui_win_y = gui_win_y; xv_compute_output_size (this); |