From 3186621e53a1c78ea093cf6ae9672cc7166b6ac7 Mon Sep 17 00:00:00 2001 From: Christophe Thommeret Date: Fri, 7 Nov 2008 17:05:55 +0000 Subject: voraw minor fix let raw video out plugin handle cropping. --HG-- extra : transplant_source : %F3l%EFUI%28%2C%A0%0C%3E%AD%EA%EC%80%D1%9A%C0/%20%E5 --- src/video_out/video_out_raw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/video_out') diff --git a/src/video_out/video_out_raw.c b/src/video_out/video_out_raw.c index 45cfc1eda..0d4bf445a 100644 --- a/src/video_out/video_out_raw.c +++ b/src/video_out/video_out_raw.c @@ -473,7 +473,7 @@ static int raw_gui_data_exchange (vo_driver_t *this_gen, int data_type, void *da static uint32_t raw_get_capabilities (vo_driver_t *this_gen) { - uint32_t capabilities = VO_CAP_YV12 | VO_CAP_YUY2; + uint32_t capabilities = VO_CAP_YV12 | VO_CAP_YUY2 | VO_CAP_CROP; return capabilities; } -- cgit v1.2.3 From 2c5aa1b2a0964a6df110d3cad0946b0870c62c0c Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Sun, 19 Oct 2008 16:55:34 +0200 Subject: Pass native HWND through xine to SDL To place SDL output inside an existing window, the SDL_WINDOWID environement variable has to be set. This was done by the SDL video out pluging if HAVE_X11 was defined, but not for WIN32, where it works as well. --HG-- extra : transplant_source : E%169%A2%B4%93%3CY%07%A9%9F%1C%E0%B8-%14m4%A2%11 --- src/video_out/video_out_sdl.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/video_out') diff --git a/src/video_out/video_out_sdl.c b/src/video_out/video_out_sdl.c index b53d1d31c..89150f5d0 100644 --- a/src/video_out/video_out_sdl.c +++ b/src/video_out/video_out_sdl.c @@ -469,9 +469,11 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi sdl_driver_t *this; const SDL_VideoInfo *vidInfo; -#ifdef HAVE_X11 +#if defined(HAVE_X11) || defined(WIN32) static char SDL_windowhack[32]; x11_visual_t *visual = (x11_visual_t *) visual_gen; +#endif +#ifdef HAVE_X11 XWindowAttributes window_attributes; #endif @@ -502,14 +504,18 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi _x_vo_scale_init( &this->sc, 0, 0, config); this->sc.frame_output_cb = visual->frame_output_cb; this->sc.user_data = visual->user_data; - - /* set SDL to use our existing X11 window */ - sprintf(SDL_windowhack,"SDL_WINDOWID=0x%x", (uint32_t) this->drawable ); - putenv(SDL_windowhack); #else _x_vo_scale_init( &this->sc, 0, 0, config ); #endif +#if defined(HAVE_X11) || defined(WIN32) + /* set SDL to use our existing X11/win32 window */ + if (visual->d){ + sprintf(SDL_windowhack,"SDL_WINDOWID=0x%x", (uint32_t) visual->d); + putenv(SDL_windowhack); + } +#endif + if ((SDL_Init (SDL_INIT_VIDEO)) < 0) { xprintf (this->xine, XINE_VERBOSITY_DEBUG, "video_out_sdl: open_plugin - sdl video initialization failed.\n"); return NULL; -- cgit v1.2.3 From 9620f841cbb1aa8284b1c8aa40ddcb18611c056c Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 30 Oct 2008 21:57:36 +0100 Subject: Create secondary buffer with correct pixelformat If neither YV12 nor YUV2 format is supported by DirectX, a secondary buffer with the same pixelformat as the primary buffer is used. However, the pixel format of the primary was not passed to CreateSurface, instead a 16 bit pixelformat was created, which is the reason why the video was broken on 24bit or 32bit desktops. --HG-- extra : transplant_source : %A6-%ADwyY%EE%C8%26%E2%5E%2A%83%0A%0B/%CBM%23%0F --- src/video_out/video_out_directx.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/video_out') diff --git a/src/video_out/video_out_directx.c b/src/video_out/video_out_directx.c index f1136eab0..529968bec 100644 --- a/src/video_out/video_out_directx.c +++ b/src/video_out/video_out_directx.c @@ -117,7 +117,7 @@ typedef struct { yuv2rgb_t *yuv2rgb; /* used for format conversion */ int mode; /* rgb mode */ int bytespp; /* rgb bits per pixel */ - + DDPIXELFORMAT primary_pixel_format; alphablend_t alphablend_extra_data; } win32_driver_t; @@ -367,8 +367,9 @@ static boolean CreateSecondary( win32_driver_t * win32_driver, int width, int he lprintf("CreateSecondary() - Falling back to back buffer same as primary\n"); lprintf("CreateSecondary() - act_format = (NATIVE) %d\n", IMGFMT_NATIVE); - ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; + ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT; ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY; + ddsd.ddpfPixelFormat = win32_driver->primary_pixel_format; win32_driver->act_format = IMGFMT_NATIVE; if( IDirectDraw_CreateSurface( win32_driver->ddobj, &ddsd, &win32_driver->secondary, 0 ) == DD_OK ) @@ -429,6 +430,10 @@ static boolean CheckPixelFormat( win32_driver_t * win32_driver ) Error( 0, "IDirectDrawSurface_GetPixelFormat ( CheckPixelFormat ) : error 0x%lx", result ); return 0; } + + /* store pixel format for CreateSecondary */ + + win32_driver->primary_pixel_format = ddpf; /* TODO : support paletized video modes */ @@ -478,6 +483,7 @@ static boolean CheckPixelFormat( win32_driver_t * win32_driver ) win32_driver->mode = MODE_15_BGR; } + lprintf("win32 mode: %u\n", win32_driver->mode); return TRUE; } -- cgit v1.2.3 From 80738bd4f54bd6c73a68789303e8c34fa47d7dfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Tue, 18 Nov 2008 21:13:55 +0100 Subject: Fix of the two opened CACA windows in cacaxine (xine-ui). There is needed some ui<->lib interaction: used caca display is optionally delivered from ui to the caca vo plugin. --- src/video_out/video_out_caca.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/video_out') diff --git a/src/video_out/video_out_caca.c b/src/video_out/video_out_caca.c index 3eec45211..65ebf707e 100644 --- a/src/video_out/video_out_caca.c +++ b/src/video_out/video_out_caca.c @@ -276,6 +276,7 @@ static int caca_redraw_needed (vo_driver_t *this_gen) { static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *visual_gen) { caca_class_t *class = (caca_class_t *) class_gen; + caca_display_t *dp = (caca_display_t *)visual_gen; caca_driver_t *this; this = calloc(1, sizeof (caca_driver_t)); @@ -300,8 +301,13 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi this->yuv2rgb_factory = yuv2rgb_factory_init(MODE_32_RGB, 0, NULL); this->yuv2rgb_factory->set_csc_levels(this->yuv2rgb_factory, 0, 128, 128); - this->cv = cucul_create_canvas(0, 0); - this->dp = caca_create_display(this->cv); + if (dp) { + this->cv = caca_get_canvas(dp); + this->dp = dp; + } else { + this->cv = cucul_create_canvas(0, 0); + this->dp = caca_create_display(this->cv); + } caca_refresh_display(this->dp); return &this->vo_driver; -- cgit v1.2.3 From 2ba1e128cbb791cfdb2829895a854bb664018912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Thu, 20 Nov 2008 20:39:50 +0100 Subject: Fix using of the pointers, leak fixes in configfile. --- src/video_out/video_out_raw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/video_out') diff --git a/src/video_out/video_out_raw.c b/src/video_out/video_out_raw.c index 0d4bf445a..99e2c0004 100644 --- a/src/video_out/video_out_raw.c +++ b/src/video_out/video_out_raw.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007 the xine project + * Copyright (C) 2007-2008 the xine project * * This file is part of xine, a free video player. * @@ -212,7 +212,7 @@ static void raw_overlay_end (vo_driver_t *this_gen, vo_frame_t *vo_img) if ( !this->ovl_changed ) return; - this->raw_overlay_cb( this->user_data, this->ovl_changed-1, &this->overlays ); + this->raw_overlay_cb( this->user_data, this->ovl_changed-1, this->overlays ); this->ovl_changed = 0; } -- cgit v1.2.3 From ea2b5508e35f5125fd65730822b30bb8895ad87d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Thu, 20 Nov 2008 20:56:19 +0100 Subject: Some warning fixes: XINE_FORMAT_SCANF, statics in headers, consts, ... Add warning flags to the DEBUG_CFLAGS too. --- src/video_out/deinterlace.c | 14 +++++++++++++- src/video_out/deinterlace.h | 13 ++----------- src/video_out/video_out_xv.c | 2 +- src/video_out/video_out_xvmc.c | 2 ++ src/video_out/video_out_xxmc.c | 7 +++---- 5 files changed, 21 insertions(+), 17 deletions(-) (limited to 'src/video_out') diff --git a/src/video_out/deinterlace.c b/src/video_out/deinterlace.c index 8ba161ebb..263160808 100644 --- a/src/video_out/deinterlace.c +++ b/src/video_out/deinterlace.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001 the xine project + * Copyright (C) 2001-2008 the xine project * * This file is part of xine, a free video player. * @@ -37,6 +37,18 @@ #include "xineutils.h" +const char *deinterlace_methods[] = { + "none", + "bob", + "weave", + "greedy", + "onefield", + "onefield_xv", + "linearblend", + NULL +}; + + /* DeinterlaceFieldBob algorithm Based on Virtual Dub plugin by Gunnar Thalin diff --git a/src/video_out/deinterlace.h b/src/video_out/deinterlace.h index 2ebbf53d9..d7712f581 100644 --- a/src/video_out/deinterlace.h +++ b/src/video_out/deinterlace.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001 the xine project + * Copyright (C) 2001-2008 the xine project * * This file is part of xine, a free video player. * @@ -41,15 +41,6 @@ void deinterlace_yuv( uint8_t *pdst, uint8_t *psrc[], #define DEINTERLACE_ONEFIELDXV 5 #define DEINTERLACE_LINEARBLEND 6 -static const char *deinterlace_methods[] = { - "none", - "bob", - "weave", - "greedy", - "onefield", - "onefield_xv", - "linearblend", - NULL -}; +extern const char *deinterlace_methods[]; #endif diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c index 6a11ebc34..b71518958 100644 --- a/src/video_out/video_out_xv.c +++ b/src/video_out/video_out_xv.c @@ -1093,7 +1093,7 @@ static int xv_gui_data_exchange (vo_driver_t *this_gen, return 0; } -static void xv_store_port_attribute(xv_driver_t *this, char *name) { +static void xv_store_port_attribute(xv_driver_t *this, const char *name) { Atom atom; xv_portattribute_t *attr; diff --git a/src/video_out/video_out_xvmc.c b/src/video_out/video_out_xvmc.c index 366a03859..c2560ccc0 100644 --- a/src/video_out/video_out_xvmc.c +++ b/src/video_out/video_out_xvmc.c @@ -699,6 +699,7 @@ static cxid_t *xvmc_set_context (xvmc_driver_t *this, return NULL; } +#if 0 static XvImage *create_ximage (xvmc_driver_t *this, XShmSegmentInfo *shminfo, int width, int height, int format) { unsigned int xvmc_format; @@ -754,6 +755,7 @@ static void dispose_ximage (xvmc_driver_t *this, lprintf ("dispose_ximage\n"); XFree(myimage); } +#endif static void xvmc_update_frame_format (vo_driver_t *this_gen, vo_frame_t *frame_gen, diff --git a/src/video_out/video_out_xxmc.c b/src/video_out/video_out_xxmc.c index b8d6abf83..b3ac39697 100644 --- a/src/video_out/video_out_xxmc.c +++ b/src/video_out/video_out_xxmc.c @@ -159,7 +159,6 @@ static void xxmc_xvmc_dump_subpictures(xxmc_driver_t *this) static void xxmc_xvmc_surface_handler_construct(xxmc_driver_t *this) { - int i; xvmc_surface_handler_t *handler = &this->xvmc_surf_handler; pthread_mutex_init(&handler->mutex,NULL); @@ -1608,8 +1607,8 @@ static void xxmc_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) * other than 100 %, so let's disable deinterlacing at all for this frame */ if (this->deinterlace_enabled && this->bob) { - disable_deinterlace = this->disable_bob_for_progressive_frames && frame->vo_frame.progressive_frame - || this->disable_bob_for_scaled_osd && this->scaled_osd_active + disable_deinterlace = (this->disable_bob_for_progressive_frames && frame->vo_frame.progressive_frame) + || (this->disable_bob_for_scaled_osd && this->scaled_osd_active) || !frame->vo_frame.stream || xine_get_param(frame->vo_frame.stream, XINE_PARAM_FINE_SPEED) != XINE_FINE_SPEED_NORMAL; if (!disable_deinterlace) { @@ -2406,7 +2405,7 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi x11_visual_t *visual = (x11_visual_t *) visual_gen; XColor dummy; XvImage *myimage; - unsigned int adaptors, j; + unsigned int adaptors; unsigned int ver,rel,req,ev,err; XShmSegmentInfo myshminfo; XvPortID xv_port; -- cgit v1.2.3