summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2002-01-22 01:43:13 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2002-01-22 01:43:13 +0000
commite17745d976e48cf8c7711443374ae241faafd95e (patch)
tree8c0e8a0ad28fd18fcd9b42d127ba8de18cd5a6c7
parent60c74f7eb02e2db53a2aa6eb920861216b5fee8a (diff)
downloadxine-lib-e17745d976e48cf8c7711443374ae241faafd95e.tar.gz
xine-lib-e17745d976e48cf8c7711443374ae241faafd95e.tar.bz2
- small w32codec bugfixes
- remove (hopefully) unneeded memcpy - fix SDL capabilities - add fb and SDL warnings CVS patchset: 1436 CVS date: 2002/01/22 01:43:13
-rw-r--r--src/libw32dll/w32codec.c18
-rw-r--r--src/video_out/alphablend.c9
-rw-r--r--src/video_out/alphablend.h2
-rw-r--r--src/video_out/video_out_fb.c3
-rw-r--r--src/video_out/video_out_sdl.c44
-rw-r--r--src/video_out/video_out_syncfb.c4
-rw-r--r--src/video_out/video_out_xv.c6
7 files changed, 65 insertions, 21 deletions
diff --git a/src/libw32dll/w32codec.c b/src/libw32dll/w32codec.c
index eff744cbb..ae8a8cf2b 100644
--- a/src/libw32dll/w32codec.c
+++ b/src/libw32dll/w32codec.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: w32codec.c,v 1.60 2002/01/18 01:02:32 miguelfreitas Exp $
+ * $Id: w32codec.c,v 1.61 2002/01/22 01:43:13 miguelfreitas Exp $
*
* routines for using w32 codecs
* DirectShow support by Miguel Freitas (Nov/2001)
@@ -496,6 +496,8 @@ static void w32v_init_codec (w32v_decoder_t *this, int buf_type) {
static void w32v_init_ds_codec (w32v_decoder_t *this, int buf_type) {
uint32_t vo_cap;
int outfmt;
+
+ w32v_init_rgb_ycc();
printf ("w32codec: init Direct Show video codec...\n");
@@ -620,6 +622,7 @@ static void w32v_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
HRESULT ret;
vo_frame_t *img;
+ uint8_t *img_buffer = this->img_buffer;
/* decoder video frame */
@@ -629,30 +632,35 @@ static void w32v_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
this->bih.biWidth,
this->bih.biHeight,
42,
- IMGFMT_YUY2,
+ this->outfmt,
this->video_step,
VO_BOTH_FIELDS);
+ if (this->outfmt==IMGFMT_YUY2)
+ img_buffer = img->base[0];
+
if( !this->ds_driver )
ret = (!this->ex_functions)
?ICDecompress(this->hic, ICDECOMPRESS_NOTKEYFRAME |
((this->skipframes)?ICDECOMPRESS_HURRYUP|ICDECOMPRESS_PREROL:0),
&this->bih, this->buf, &this->o_bih,
- (this->skipframes)?NULL:this->img_buffer)
+ (this->skipframes)?NULL:img_buffer)
:ICDecompressEx(this->hic, ICDECOMPRESS_NOTKEYFRAME |
((this->skipframes)?ICDECOMPRESS_HURRYUP|ICDECOMPRESS_PREROL:0),
&this->bih, this->buf, &this->o_bih,
- (this->skipframes)?NULL:this->img_buffer);
+ (this->skipframes)?NULL:img_buffer);
else {
ret = DS_VideoDecoder_DecodeInternal(this->ds_dec, this->buf, this->size, 0,
- (this->skipframes)?NULL:this->img_buffer);
+ (this->skipframes)?NULL:img_buffer);
}
if(!this->skipframes) {
if (this->outfmt==IMGFMT_YUY2) {
/* already decoded into YUY2 format by DLL */
+ /*
xine_fast_memcpy(img->base[0], this->img_buffer,
this->bih.biHeight*this->bih.biWidth*2);
+ */
} else {
/* now, convert rgb to yuv */
int row, col;
diff --git a/src/video_out/alphablend.c b/src/video_out/alphablend.c
index 28c20b53d..ce50a7b21 100644
--- a/src/video_out/alphablend.c
+++ b/src/video_out/alphablend.c
@@ -394,7 +394,7 @@ static void mem_blend8(uint8_t *mem, uint8_t val, uint8_t o, size_t sz)
}
}
-void blend_yuv (uint8_t * dst_img, vo_overlay_t * img_overl,
+void blend_yuv (uint8_t *dst_base[3], vo_overlay_t * img_overl,
int dst_width, int dst_height)
{
clut_t *my_clut;
@@ -413,10 +413,11 @@ void blend_yuv (uint8_t * dst_img, vo_overlay_t * img_overl,
int x, y;
uint8_t clr=0;
- uint8_t *dst_y = dst_img + dst_width * y_off + x_off;
- uint8_t *dst_cr = dst_img + dst_width * dst_height +
+ uint8_t *dst_y = dst_base[0] + dst_width * y_off + x_off;
+ uint8_t *dst_cr = dst_base[1] +
+ (y_off / 2) * (dst_width / 2) + (x_off / 2) + 1;
+ uint8_t *dst_cb = dst_base[2] +
(y_off / 2) * (dst_width / 2) + (x_off / 2) + 1;
- uint8_t *dst_cb = dst_cr + (dst_width * dst_height) / 4;
#ifdef LOG_BLEND_YUV
printf("overlay_blend started x=%d, y=%d, w=%d h=%d\n",img_overl->x,img_overl->y,img_overl->width,img_overl->height);
#endif
diff --git a/src/video_out/alphablend.h b/src/video_out/alphablend.h
index 14f6fcaf3..f039fe568 100644
--- a/src/video_out/alphablend.h
+++ b/src/video_out/alphablend.h
@@ -46,7 +46,7 @@ void blend_rgb32 (uint8_t * img, vo_overlay_t * img_overl,
int img_width, int img_height,
int dst_width, int dst_height);
-void blend_yuv (uint8_t * dst_img, vo_overlay_t * img_overl,
+void blend_yuv (uint8_t *dst_base[3], vo_overlay_t * img_overl,
int dst_width, int dst_height);
void blend_yuy2 (uint8_t * dst_img, vo_overlay_t * img_overl,
diff --git a/src/video_out/video_out_fb.c b/src/video_out/video_out_fb.c
index 47877a650..0c073845c 100644
--- a/src/video_out/video_out_fb.c
+++ b/src/video_out/video_out_fb.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_fb.c,v 1.3 2002/01/15 20:39:39 jcdutton Exp $
+ * $Id: video_out_fb.c,v 1.4 2002/01/22 01:43:13 miguelfreitas Exp $
*
* video_out_fb.c, frame buffer xine driver by Miguel Freitas
*
@@ -916,6 +916,7 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) {
-100, 100, "gamma correction for FB driver",
NULL, NULL, NULL));
+ printf ("video_out_fb: warning, xine's framebuffer driver is EXPERIMENTAL\n");
return &this->vo_driver;
}
diff --git a/src/video_out/video_out_sdl.c b/src/video_out/video_out_sdl.c
index dbe19362e..39efccc63 100644
--- a/src/video_out/video_out_sdl.c
+++ b/src/video_out/video_out_sdl.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_sdl.c,v 1.2 2002/01/21 09:54:03 jkeil Exp $
+ * $Id: video_out_sdl.c,v 1.3 2002/01/22 01:43:13 miguelfreitas Exp $
*
* video_out_sdl.c, Simple DirectMedia Layer
*
@@ -26,6 +26,15 @@
* Dominik Schnitzer <aeneas@linuxvideo.org>
*
* xine version by Miguel Freitas (Jan/2002)
+ * Missing features:
+ * - mouse position translation
+ * - logo state aware
+ * - fullscreen
+ * - stability, testing, etc?? ;)
+ *
+ * BIG WARNING HERE: if you use RedHat SDL packages you will probably
+ * get segfault when no hwaccel is available. more info at:
+ * https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=58408
*/
#ifdef HAVE_CONFIG_H
@@ -327,10 +336,16 @@ static void sdl_update_frame_format (vo_driver_t *this_gen,
}
if( format == IMGFMT_YV12 ) {
+#ifdef SDL_LOG
+ printf ("video_out_sdl: format YV12 ");
+#endif
frame->overlay = SDL_CreateYUVOverlay (width, height, SDL_YV12_OVERLAY,
this->surface);
} else if( format == IMGFMT_YUY2 ) {
+#ifdef SDL_LOG
+ printf ("video_out_sdl: format YUY2 ");
+#endif
frame->overlay = SDL_CreateYUVOverlay (width, height, SDL_YUY2_OVERLAY,
this->surface);
}
@@ -338,6 +353,10 @@ static void sdl_update_frame_format (vo_driver_t *this_gen,
if (frame->overlay == NULL)
return;
+#ifdef SDL_LOG
+ printf ("[%p %p %p]\n", frame->overlay->pixels[0], frame->overlay->pixels[1],
+ frame->overlay->pixels[2] );
+#endif
frame->vo_frame.base[0] = frame->overlay->pixels[0];
frame->vo_frame.base[1] = frame->overlay->pixels[2];
frame->vo_frame.base[2] = frame->overlay->pixels[1];
@@ -361,7 +380,7 @@ static void sdl_overlay_blend (vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_
if (overlay->rle) {
if( frame->format == IMGFMT_YV12 )
- blend_yuv( frame->vo_frame.base[0], overlay, frame->width, frame->height);
+ blend_yuv( frame->vo_frame.base, overlay, frame->width, frame->height);
else
blend_yuy2( frame->vo_frame.base[0], overlay, frame->width, frame->height);
}
@@ -396,7 +415,7 @@ static void sdl_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) {
printf("video_out_sdl: change frame format\n");
sdl_calc_format (this, frame->width, frame->height, frame->ratio_code);
}
-
+
SDL_UnlockYUVOverlay (frame->overlay);
/*
SDL_DisplayYUVOverlay (frame->overlay, &(this->surface->clip_rect));
@@ -486,22 +505,35 @@ static int sdl_gui_data_exchange (vo_driver_t *this_gen,
switch (data_type) {
case GUI_DATA_EX_DEST_POS_SIZE_CHANGED:
+#ifdef SDL_LOG
+ printf ("video_out_sdl: GUI_DATA_EX_DEST_POS_SIZE_CHANGED\n");
+#endif
area = (x11_rectangle_t *) data;
sdl_adapt_to_output_area (this, area->x, area->y, area->w, area->h);
break;
case GUI_DATA_EX_LOGO_VISIBILITY:
+#ifdef SDL_LOG
+ printf ("video_out_sdl: GUI_DATA_EX_LOGO_VISIBILITY\n");
+#endif
/* FIXME: implement */
break;
case GUI_DATA_EX_DRAWABLE_CHANGED:
+#ifdef SDL_LOG
+ printf ("video_out_sdl: GUI_DATA_EX_DRAWABLE_CHANGED\n");
+#endif
+
this->drawable = (Drawable) data;
/* OOPS! Is it possible to change SDL window id? */
/* probably we need to close and reinitialize SDL */
break;
case GUI_DATA_EX_EXPOSE_EVENT:
+#ifdef SDL_LOG
+ printf ("video_out_sdl: GUI_DATA_EX_EXPOSE_EVENT\n");
+#endif
break;
default:
@@ -529,7 +561,7 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) {
sdl_driver_t *this;
const SDL_VideoInfo * vidInfo;
#ifdef HAVE_X11
- char SDL_windowhack[32];
+ static char SDL_windowhack[32];
x11_visual_t *visual = (x11_visual_t *) visual_gen;
XWindowAttributes window_attributes;
#endif
@@ -590,7 +622,7 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) {
this->output_yoffset = 0;
this->output_width = 0;
this->output_height = 0;
- this->capabilities = 0;
+ this->capabilities = VO_CAP_YUY2 | VO_CAP_YV12;
#ifdef HAVE_X11
XGetWindowAttributes(this->display, this->drawable, &window_attributes);
@@ -616,6 +648,8 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) {
this->vo_driver.exit = sdl_exit;
this->vo_driver.get_info = get_video_out_plugin_info;
+ printf ("video_out_sdl: warning, xine's SDL driver is EXPERIMENTAL\n");
+ printf ("video_out_sdl: fullscreen mode is NOT supported\n");
return &this->vo_driver;
}
diff --git a/src/video_out/video_out_syncfb.c b/src/video_out/video_out_syncfb.c
index 36104a518..b163f8adb 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.50 2002/01/09 22:33:04 jcdutton Exp $
+ * $Id: video_out_syncfb.c,v 1.51 2002/01/22 01:43:13 miguelfreitas Exp $
*
* video_out_syncfb.c, SyncFB (for Matrox G200/G400 cards) interface for xine
*
@@ -857,7 +857,7 @@ static void syncfb_overlay_blend(vo_driver_t* this_gen, vo_frame_t* frame_gen, v
if(overlay->rle) {
if( frame->format == IMGFMT_YV12 )
- blend_yuv( frame->vo_frame.base[0], overlay, frame->vo_frame.width,
+ blend_yuv( frame->vo_frame.base, overlay, frame->vo_frame.width,
frame->vo_frame.height);
else
blend_yuy2( frame->vo_frame.base[0], overlay, frame->vo_frame.width,
diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c
index d01bb6830..b21c6df23 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.88 2002/01/09 22:33:04 jcdutton Exp $
+ * $Id: video_out_xv.c,v 1.89 2002/01/22 01:43:13 miguelfreitas Exp $
*
* video_out_xv.c, X11 video extension interface for xine
*
@@ -800,9 +800,9 @@ static void xv_overlay_blend (vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_o
if (overlay->rle) {
if( frame->format == IMGFMT_YV12 )
- blend_yuv( frame->image->data, overlay, frame->width, frame->height);
+ blend_yuv( frame->vo_frame.base, overlay, frame->width, frame->height);
else
- blend_yuy2( frame->image->data, overlay, frame->width, frame->height);
+ blend_yuy2( frame->vo_frame.base[0], overlay, frame->width, frame->height);
}
}