From ea3075396359901c579da0a09bed571acc2e7362 Mon Sep 17 00:00:00 2001 From: Mike Lampard Date: Tue, 2 Apr 2002 13:31:03 +0000 Subject: re-enable overlay capabilities, minor bugfix. CVS patchset: 1665 CVS date: 2002/04/02 13:31:03 --- src/dxr3/dxr3_video_out.c | 31 +++++++++++++++++++++++++------ src/dxr3/dxr3_video_out.h | 13 +++++++++++-- src/dxr3/dxr3_vo_core.c | 11 ++++++++--- 3 files changed, 44 insertions(+), 11 deletions(-) diff --git a/src/dxr3/dxr3_video_out.c b/src/dxr3/dxr3_video_out.c index 5cc561557..25effa1f3 100644 --- a/src/dxr3/dxr3_video_out.c +++ b/src/dxr3/dxr3_video_out.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: dxr3_video_out.c,v 1.11 2002/03/31 14:33:12 mlampard Exp $ + * $Id: dxr3_video_out.c,v 1.12 2002/04/02 13:31:03 mlampard Exp $ * * mpeg1 encoding video out plugin for the dxr3. * @@ -210,6 +210,9 @@ static void dxr3_update_frame_format (vo_driver_t *this_gen, dxr3_frame_t *frame = (dxr3_frame_t *) frame_gen; int image_size, oheight; + if(this->overlay_enabled) + dxr3_redraw_needed((vo_driver_t *)this); + /* reset the copy calls counter (number of calls to dxr3_frame_copy) */ frame->copy_calls = 0; frame->vo_frame.driver = this_gen; @@ -219,7 +222,6 @@ static void dxr3_update_frame_format (vo_driver_t *this_gen, if (format == IMGFMT_MPEG) { /* talking to dxr3 decoder */ int aspect; - /* a bit of a hack. we must release the em8300_mv fd for * the dxr3 decoder plugin */ if (this->fd_video >= 0) { @@ -398,14 +400,30 @@ static void dxr3_update_frame_format (vo_driver_t *this_gen, } -static int dxr3_redraw_needed(vo_driver_t *this_gen) +int dxr3_redraw_needed(vo_driver_t *this_gen) { dxr3_driver_t *this = (dxr3_driver_t *) this_gen; - + int gui_win_x, gui_win_y, gypos,gxpos,gw,gh; + + this->frame_output_cb (this->user_data, + this->video_width, this->video_height, + &gxpos, &gypos, &gw, &gh, + &gui_win_x, &gui_win_y ); + + if(this->xpos!=gxpos || this->ypos!=gypos || + this->width !=gw || this->height!=gh) { + this->xpos=gxpos+1; + this->ypos=gypos+1; + this->width=gw; + this->height=gh; + dxr3_overlay_adapt_area(this, this->xpos, this->ypos, this->width, this->height, gui_win_x, gui_win_y); + } + if (this->need_redraw) { this->need_redraw = 0; - return 1; + return 1; } + return 0; } @@ -421,6 +439,7 @@ static void dxr3_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) { dxr3_driver_t *this = (dxr3_driver_t*)this_gen; dxr3_frame_t *frame = (dxr3_frame_t*)frame_gen; + if (frame_gen->format != IMGFMT_MPEG && this->enc && this->enc->on_display_frame) { this->enc->on_display_frame(this, frame); } else { @@ -614,10 +633,10 @@ printf("dxr3_video_out:init_plugin\n"); this->overlay_enabled = 0; this->aspectratio = ASPECT_FULL; + gather_screen_vars(this, visual_gen); dxr3_read_config(this); if (this->overlay_enabled) { - gather_screen_vars(this, visual_gen); dxr3_get_keycolor(this); dxr3_overlay_buggy_preinit(&this->overlay, this->fd_control); } diff --git a/src/dxr3/dxr3_video_out.h b/src/dxr3/dxr3_video_out.h index db89d7a62..d225fd534 100644 --- a/src/dxr3/dxr3_video_out.h +++ b/src/dxr3/dxr3_video_out.h @@ -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: dxr3_video_out.h,v 1.16 2002/03/31 14:33:12 mlampard Exp $ + * $Id: dxr3_video_out.h,v 1.17 2002/04/02 13:31:04 mlampard Exp $ * */ @@ -134,9 +134,16 @@ typedef struct dxr3_driver_s { char *user_data; - void (*frame_output_cb) (char *userdata, int video_width, + 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 *win_x, int *win_u); + +/* void (*frame_output_cb) (char *userdata, int video_width, int video_height, int *dest_x, int *dest_y, int *dest_height, int *dest_width); +*/ } dxr3_driver_t; typedef struct dxr3_frame_s { @@ -157,6 +164,8 @@ struct encoder_data_s { }; /* func definitions */ +int dxr3_redraw_needed(vo_driver_t *this_gen); + /* Overlay functions */ int dxr3_overlay_set_mode(dxr3_overlay_t *this, int mode); int dxr3_overlay_set_attributes(dxr3_overlay_t *this); diff --git a/src/dxr3/dxr3_vo_core.c b/src/dxr3/dxr3_vo_core.c index a450bd7d2..fbd729d15 100644 --- a/src/dxr3/dxr3_vo_core.c +++ b/src/dxr3/dxr3_vo_core.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: dxr3_vo_core.c,v 1.18 2002/03/31 14:33:12 mlampard Exp $ + * $Id: dxr3_vo_core.c,v 1.19 2002/04/02 13:31:03 mlampard Exp $ * ************************************************************************* * core functions common to both Standard and RT-Encoding vo plugins * @@ -164,7 +164,7 @@ void dxr3_read_config(dxr3_driver_t *this) /******** is this window fullscreen? ************/ -static int is_fullscreen(dxr3_driver_t *this) +int is_fullscreen(dxr3_driver_t *this) { XWindowAttributes a; @@ -309,7 +309,7 @@ int dxr3_set_property (vo_driver_t *this_gen, if (this->overlay_enabled && !fullscreen){ int foo; this->frame_output_cb(this->user_data, this->width, - this->width/this->desired_ratio, &foo, &foo, &foo, &foo); + this->width/this->desired_ratio, &foo, &foo, &foo, &foo, &foo, &foo); } break; case VO_PROP_COLORKEY: @@ -407,6 +407,10 @@ int dxr3_gui_data_exchange (vo_driver_t *this_gen, switch (data_type) { /************************************************************************* * FIXME: Removed due to changes in XV by Guenter, but don't know what to replace it with + * Update 2/4/02 - Mike Lampard: + * This functionality is now incorporated into dxr3_redraw_needed until + * a cleaner way can be found to update window changes. + case GUI_DATA_EX_DEST_POS_SIZE_CHANGED:{ x11_rectangle_t *area = (x11_rectangle_t*) data; dxr3_overlay_adapt_area(this, area->x, area->y, area->w, area->h); @@ -423,6 +427,7 @@ int dxr3_gui_data_exchange (vo_driver_t *this_gen, XFillRectangle(this->display, this->win, this->gc, 0, 0, this->width, this->height); XUnlockDisplay(this->display); + dxr3_redraw_needed((vo_driver_t*)this); } break; case GUI_DATA_EX_DRAWABLE_CHANGED:{ -- cgit v1.2.3