diff options
author | Guenter Bartsch <guenter@users.sourceforge.net> | 2001-07-10 19:33:05 +0000 |
---|---|---|
committer | Guenter Bartsch <guenter@users.sourceforge.net> | 2001-07-10 19:33:05 +0000 |
commit | 9125c00c6d1242b911cbf68cdd25114cd9972c8f (patch) | |
tree | 313071ce6aac40d9fb35b12d65eba2bbf84927dc | |
parent | cec0ffca0dfba3f6807e63636ea2c12cec982db9 (diff) | |
download | xine-lib-9125c00c6d1242b911cbf68cdd25114cd9972c8f.tar.gz xine-lib-9125c00c6d1242b911cbf68cdd25114cd9972c8f.tar.bz2 |
subtitle patches (esp. for XShm) from James
CVS patchset: 263
CVS date: 2001/07/10 19:33:05
-rw-r--r-- | include/xine.h.tmpl.in | 5 | ||||
-rw-r--r-- | src/video_out/Makefile.am | 2 | ||||
-rw-r--r-- | src/video_out/alphablend.c | 15 | ||||
-rw-r--r-- | src/video_out/alphablend.h | 7 | ||||
-rw-r--r-- | src/video_out/video_out_aa.c | 6 | ||||
-rw-r--r-- | src/video_out/video_out_xshm.c | 37 | ||||
-rw-r--r-- | src/video_out/video_out_xv.c | 19 | ||||
-rw-r--r-- | src/xine-engine/video_out.c | 10 | ||||
-rw-r--r-- | src/xine-engine/video_out.h | 6 |
9 files changed, 54 insertions, 53 deletions
diff --git a/include/xine.h.tmpl.in b/include/xine.h.tmpl.in index 41030a86f..327eeb2c5 100644 --- a/include/xine.h.tmpl.in +++ b/include/xine.h.tmpl.in @@ -29,7 +29,7 @@ \endverbatim */ /* - * $Id: xine.h.tmpl.in,v 1.26 2001/07/08 18:15:54 guenter Exp $ + * $Id: xine.h.tmpl.in,v 1.27 2001/07/10 19:33:05 guenter Exp $ * */ @@ -153,8 +153,7 @@ struct vo_driver_s { void (*display_frame) (vo_driver_t *this, vo_frame_t *vo_img); /* overlay functions */ - void (*overlay_blend) (vo_frame_t *vo_img, vo_overlay_t *overlay); - void (*set_overlay) (vo_driver_t *this, vo_overlay_t *overlay); + void (*overlay_blend) (vo_driver_t *this, vo_frame_t *vo_img, vo_overlay_t *overlay); /* * these can be used by the gui directly: diff --git a/src/video_out/Makefile.am b/src/video_out/Makefile.am index 70908130d..743725355 100644 --- a/src/video_out/Makefile.am +++ b/src/video_out/Makefile.am @@ -30,7 +30,7 @@ xineplug_vo_out_xv_la_LIBADD = $(XV_LIB) $(X_LIBS) -lXext xineplug_vo_out_xv_la_LDFLAGS = -avoid-version -module xineplug_vo_out_xshm_la_SOURCES = yuv2rgb.c yuv2rgb_mmx.c yuv2rgb_mlib.c \ - video_out_xshm.c + alphablend.c video_out_xshm.c xineplug_vo_out_xshm_la_LIBADD = $(X_LIBS) -lXext xineplug_vo_out_xshm_la_LDFLAGS = -avoid-version -module diff --git a/src/video_out/alphablend.c b/src/video_out/alphablend.c index a9f373832..21669e96a 100644 --- a/src/video_out/alphablend.c +++ b/src/video_out/alphablend.c @@ -140,10 +140,8 @@ void blend_tux_rgb16 (uint8_t * img, int dst_width, int dst_height) for (x=0; x<img_overl->width; x++) { \ o = img_overl->trans[*src&0x0f]; \ \ -/* if ((*src&0x0f) != 0) if alpha is != 0 */ \ - if (o) /* if alpha is != 0 */ \ - *dst = blendpixel_rgb##bpp (*dst, img_overl->clut[(*src&0x0f)]/*.y*/, o); \ -/* *dst = blendpixel_rgb##bpp (*dst, myclut[img_overl->clut[(*src&0x0f)]], o);*/\ + if ((*src) >> 4 & 0xf) /* if alpha is != 0 */ \ + *dst = blendpixel_rgb##bpp (*dst, myclut[img_overl->clut[(*src&0x0f)]], o); \ src++; \ dst++; \ } \ @@ -151,11 +149,9 @@ void blend_tux_rgb16 (uint8_t * img, int dst_width, int dst_height) } \ } -//void blend_rgb16 (uint8_t *img, overlay_buf_t *img_overl, int dst_width, int dst_height) -void blend_rgb (uint8_t * img, vo_overlay_t * img_overl, int dst_width, +void blend_rgb16 (uint8_t * img, vo_overlay_t * img_overl, int dst_width, int dst_height) { -#ifdef PRIV_CLUT u_int myclut[] = { 0x0000, 0x20e2, @@ -174,7 +170,6 @@ void blend_rgb (uint8_t * img, vo_overlay_t * img_overl, int dst_width, 0xad13, 0xffdf, }; -#endif BLEND (16, img, img_overl, dst_width, dst_height); //blend_tux_rgb16 (img, dst_width, dst_height); @@ -184,7 +179,6 @@ void blend_rgb24 (uint8_t * img, vo_overlay_t * img_overl, int dst_width, int dst_height) { //FIXME CLUT -#ifdef PRIV_CLUT u_int myclut[] = { 0x0000, 0x20e2, @@ -203,7 +197,6 @@ void blend_rgb24 (uint8_t * img, vo_overlay_t * img_overl, int dst_width, 0xad13, 0xffdf, }; -#endif BLEND (24, img, img_overl, dst_width, dst_height); } @@ -211,7 +204,6 @@ void blend_rgb32 (uint8_t * img, vo_overlay_t * img_overl, int dst_width, int dst_height) { //FIXME CLUT -#ifdef PRIV_CLUT u_int myclut[] = { 0x0000, 0x20e2, @@ -230,7 +222,6 @@ void blend_rgb32 (uint8_t * img, vo_overlay_t * img_overl, int dst_width, 0xad13, 0xffdf, }; -#endif BLEND (32, img, img_overl, dst_width, dst_height); } diff --git a/src/video_out/alphablend.h b/src/video_out/alphablend.h index 7afa470f7..6043c6071 100644 --- a/src/video_out/alphablend.h +++ b/src/video_out/alphablend.h @@ -28,8 +28,11 @@ #include "video_out.h" -void blend_rgb (uint8_t * img, vo_overlay_t * overlay, int width, - +void blend_rgb16 (uint8_t * img, vo_overlay_t * overlay, int width, + int height); +void blend_rgb24 (uint8_t * img, vo_overlay_t * overlay, int width, + int height); +void blend_rgb32 (uint8_t * img, vo_overlay_t * overlay, int width, int height); void blend_yuv (uint8_t * img, vo_overlay_t * overlay, int width, diff --git a/src/video_out/video_out_aa.c b/src/video_out/video_out_aa.c index 1ab490ee2..a496b9319 100644 --- a/src/video_out/video_out_aa.c +++ b/src/video_out/video_out_aa.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_aa.c,v 1.8 2001/07/04 17:10:24 uid32519 Exp $ + * $Id: video_out_aa.c,v 1.9 2001/07/10 19:33:05 guenter Exp $ * * video_out_aa.c, ascii-art output plugin for xine * @@ -261,9 +261,6 @@ static void aa_get_property_min_max (vo_driver_t *this_gen, *max = 0; } -static void aa_set_overlay (vo_driver_t *this, vo_overlay_t *overlay) { -} - static void aa_exit (vo_driver_t *this_gen) { } @@ -286,7 +283,6 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) { this->vo_driver.get_property_min_max = aa_get_property_min_max; this->vo_driver.gui_data_exchange = NULL; this->vo_driver.exit = aa_exit; - this->vo_driver.set_overlay = aa_set_overlay; return (vo_driver_t*) this; } diff --git a/src/video_out/video_out_xshm.c b/src/video_out/video_out_xshm.c index 28fc79817..a33ee9922 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.15 2001/07/06 11:14:38 heikos Exp $ + * $Id: video_out_xshm.c,v 1.16 2001/07/10 19:33:05 guenter Exp $ * * video_out_xshm.c, X11 shared memory extension interface for xine * @@ -55,6 +55,7 @@ #include "utils.h" #include "video_out_x11.h" #include "yuv2rgb.h" +#include "alphablend.h" uint32_t xine_debug; @@ -597,6 +598,31 @@ static void xshm_update_frame_format (vo_driver_t *this_gen, } } +/* + * + */ +static void xshm_overlay_blend (vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *overlay) { + xshm_driver_t *this = (xshm_driver_t *) this_gen; + xshm_frame_t *frame = (xshm_frame_t *) frame_gen; + +// Alpha Blend here + if (overlay->data) { + switch(this->bpp) { + case 16: + blend_rgb16( frame->image->data, overlay, frame->rgb_width, frame->rgb_height); + break; + case 24: + blend_rgb24( frame->image->data, overlay, frame->rgb_width, frame->rgb_height); + break; + case 32: + blend_rgb32( frame->image->data, overlay, frame->rgb_width, frame->rgb_height); + break; + default: +/* It should never get here */ + } + } +} + static void xshm_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) { xshm_driver_t *this = (xshm_driver_t *) this_gen; @@ -654,13 +680,6 @@ static void xshm_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) { } } -/* Stores an overlay in the Video Out driver */ -static void xshm_set_overlay (vo_driver_t *this_gen, vo_overlay_t *overlay) { - xshm_driver_t *this = (xshm_driver_t *) this_gen; - - this->overlay = overlay; -} - static int xshm_get_property (vo_driver_t *this_gen, int property) { xshm_driver_t *this = (xshm_driver_t *) this_gen; @@ -831,8 +850,8 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) { this->vo_driver.get_capabilities = xshm_get_capabilities; this->vo_driver.alloc_frame = xshm_alloc_frame; this->vo_driver.update_frame_format = xshm_update_frame_format; + this->vo_driver.overlay_blend = xshm_overlay_blend; this->vo_driver.display_frame = xshm_display_frame; - this->vo_driver.set_overlay = xshm_set_overlay; this->vo_driver.get_property = xshm_get_property; this->vo_driver.set_property = xshm_set_property; this->vo_driver.get_property_min_max = xshm_get_property_min_max; diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c index 154cf2381..795476484 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.51 2001/07/09 16:13:11 guenter Exp $ + * $Id: video_out_xv.c,v 1.52 2001/07/10 19:33:05 guenter Exp $ * * video_out_xv.c, X11 video extension interface for xine * @@ -539,15 +539,18 @@ static void xv_calc_format (xv_driver_t *this, /* * */ -static void xv_overlay_blend (vo_frame_t *frame_gen, vo_overlay_t *overlay) { +static void xv_overlay_blend (vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *overlay) { xv_frame_t *frame = (xv_frame_t *) frame_gen; -// Alpha Blend here -// As XV drivers improve to support Hardware overlay, we will change this function. + /* Alpha Blend here + * As XV drivers improve to support Hardware overlay, we will change this function. + */ + if (overlay->data) { blend_yuv( frame->image->data, overlay, frame->width, frame->height); } + } /* @@ -609,13 +612,6 @@ static void xv_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) { } } -/* Stores an overlay in the Video Out driver */ -static void xv_set_overlay (vo_driver_t *this_gen, vo_overlay_t *overlay) { - xv_driver_t *this = (xv_driver_t *) this_gen; - - this->overlay = overlay; -} - static int xv_get_property (vo_driver_t *this_gen, int property) { xv_driver_t *this = (xv_driver_t *) this_gen; @@ -896,7 +892,6 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) { this->vo_driver.update_frame_format = xv_update_frame_format; this->vo_driver.overlay_blend = xv_overlay_blend; this->vo_driver.display_frame = xv_display_frame; - this->vo_driver.set_overlay = xv_set_overlay; this->vo_driver.get_property = xv_get_property; this->vo_driver.set_property = xv_set_property; this->vo_driver.get_property_min_max = xv_get_property_min_max; diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c index f573670ac..2bcb5d4ea 100644 --- a/src/xine-engine/video_out.c +++ b/src/xine-engine/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: video_out.c,v 1.32 2001/07/09 16:13:12 guenter Exp $ + * $Id: video_out.c,v 1.33 2001/07/10 19:33:05 guenter Exp $ * */ @@ -276,21 +276,21 @@ static void *video_out_loop (void *this_gen) { xprintf (VERBOSE|VIDEO, "video_out : passing to video driver, image with pts = %d\n", pts); + overlay=this->first_overlay; while (overlay) { if(overlay->state==OVERLAY_SHOWING) { - this->driver->overlay_blend (img,overlay); + if (this->driver->overlay_blend) this->driver->overlay_blend (this->driver, img, overlay); } overlay=overlay->next; } + this->driver->display_frame (this->driver, img); -/* Control Overlay SHOW/HIDE based on PTS */ -/* FIXME: Not implemented: These all need to be put to FREE state if the slider gets moved or STOP is pressed. */ + /* Control Overlay SHOW/HIDE based on PTS */ overlay=this->first_overlay; count=1; while (overlay) { -// count++; switch(overlay->state) { case OVERLAY_FREE: break; diff --git a/src/xine-engine/video_out.h b/src/xine-engine/video_out.h index 2d825462d..f73f1a707 100644 --- a/src/xine-engine/video_out.h +++ b/src/xine-engine/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: video_out.h,v 1.11 2001/07/08 18:15:54 guenter Exp $ + * $Id: video_out.h,v 1.12 2001/07/10 19:33:05 guenter Exp $ * * * xine version of video_out.h @@ -218,9 +218,7 @@ struct vo_driver_s { void (*display_frame) (vo_driver_t *this, vo_frame_t *vo_img); /* overlay functions */ - void (*overlay_blend) (vo_frame_t *vo_img, vo_overlay_t *overlay); - void (*set_overlay) (vo_driver_t *this, vo_overlay_t *overlay); - + void (*overlay_blend) (vo_driver_t *this, vo_frame_t *vo_img, vo_overlay_t *overlay); /* * these can be used by the gui directly: |