diff options
Diffstat (limited to 'src/video_out')
| -rw-r--r-- | src/video_out/deinterlace.h | 2 | ||||
| -rw-r--r-- | src/video_out/video_out_directfb.c | 4 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/video_out/video_out_directx.c | 0 | ||||
| -rw-r--r-- | src/video_out/video_out_fb.c | 81 | ||||
| -rw-r--r-- | src/video_out/video_out_xshm.c | 2 | ||||
| -rw-r--r-- | src/video_out/video_out_xxmc.c | 12 |
6 files changed, 41 insertions, 60 deletions
diff --git a/src/video_out/deinterlace.h b/src/video_out/deinterlace.h index a9904b42a..6f398fcbd 100644 --- a/src/video_out/deinterlace.h +++ b/src/video_out/deinterlace.h @@ -41,7 +41,7 @@ void deinterlace_yuv( uint8_t *pdst, uint8_t *psrc[], #define DEINTERLACE_ONEFIELDXV 5 #define DEINTERLACE_LINEARBLEND 6 -static const char *deinterlace_methods[] = { +static const char *const deinterlace_methods[] = { "none", "bob", "weave", diff --git a/src/video_out/video_out_directfb.c b/src/video_out/video_out_directfb.c index efbb30f2d..a374c56de 100644 --- a/src/video_out/video_out_directfb.c +++ b/src/video_out/video_out_directfb.c @@ -1333,8 +1333,8 @@ static void update_config_cb (void *data, xine_cfg_entry_t *entry) { static void init_config (directfb_driver_t *this) { config_values_t *config = this->xine->config; - static const char *buffermode_enum[] = {"single", "double", "triple", 0}; - static const char *fieldparity_enum[] = {"none", "top", "bottom", 0}; + static const char *const buffermode_enum[] = {"single", "double", "triple", 0}; + static const char *const fieldparity_enum[] = {"none", "top", "bottom", 0}; this->buffermode = config->register_enum (config, "video.device.directfb_buffermode", this->buffermode, (char**)buffermode_enum, diff --git a/src/video_out/video_out_directx.c b/src/video_out/video_out_directx.c index 7c3e5a78c..7c3e5a78c 100644..100755 --- a/src/video_out/video_out_directx.c +++ b/src/video_out/video_out_directx.c diff --git a/src/video_out/video_out_fb.c b/src/video_out/video_out_fb.c index e88def112..e2672e2a1 100644 --- a/src/video_out/video_out_fb.c +++ b/src/video_out/video_out_fb.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2003 the xine project and Fredrik Noring + * Copyright (C) 2000-2007 the xine project and Fredrik Noring * * This file is part of xine, a free video player. * @@ -18,28 +18,28 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * * $Id: video_out_fb.c,v 1.49 2006/12/19 19:10:51 dsalt Exp $ - * - * video_out_fb.c, frame buffer xine driver by Miguel Freitas + */ + +/** + * @file + * @brief Frame buffer xine driver * - * Contributors: + * @author Miguel Freitas * - * Fredrik Noring <noring@nocrew.org>: Zero copy buffers and clean up. + * @author Fredrik Noring <noring@nocrew.org>: + * Zero copy buffers and clean up. * - * based on xine's video_out_xshm.c... - * ...based on mpeg2dec code from - * Aaron Holtzman <aholtzma@ess.engr.uvic.ca> + * @author Aaron Holtzman <aholtzma@ess.engr.uvic.ca>: + * Based on xine's video_out_xshm.c, based on mpeg2dec code from * - * ideas from ppmtofb - Display P?M graphics on framebuffer devices - * by Geert Uytterhoeven and Chris Lawrence + * @author Geert Uytterhoeven and Chris Lawrence: + * Ideas from ppmtofb - Display P?M graphics on framebuffer devices. * - * Note: Use this with fbxine. It may work with the regular xine too, - * provided the visual type is changed (see below). + * @note Use this with fbxine. * - * TODO: VT switching (configurable) + * @todo VT Switching (configurable) */ -/* #define USE_X11_VISUAL */ - #define RECOMMENDED_NUM_BUFFERS 5 #define MAXIMUM_NUM_BUFFERS 25 @@ -356,21 +356,10 @@ static void reset_dest_pointers(fb_frame_t *frame, int flags) static void frame_reallocate(fb_driver_t *this, fb_frame_t *frame, uint32_t width, uint32_t height, int format) { - if(frame->chunk[0]) - { - free(frame->chunk[0]); - frame->chunk[0] = NULL; - } - if(frame->chunk[1]) - { - free(frame->chunk[1]); - frame->chunk[1] = NULL; - } - if(frame->chunk[2]) - { - free(frame->chunk[2]); - frame->chunk[2] = NULL; - } + free(frame->chunk[0]); + free(frame->chunk[1]); + free(frame->chunk[2]); + memset(frame->chunk, 0, sizeof(frame->chunk[0])*3); if(this->use_zero_copy) { @@ -380,10 +369,9 @@ static void frame_reallocate(fb_driver_t *this, fb_frame_t *frame, } else { - if(frame->data) - free(frame->data); - frame->data = xine_xmalloc(frame->sc.output_width * - frame->sc.output_height * + free(frame->data); + frame->data = xine_xcalloc(frame->sc.output_width * + frame->sc.output_height, this->bytes_per_pixel); } @@ -842,7 +830,7 @@ static void register_callbacks(fb_driver_t *this) static int open_fb_device(config_values_t *config, xine_t *xine) { - static char devkey[] = "video.device.fb_device"; /* Why static? */ + static const char devkey[] = "video.device.fb_device"; char *device_name; int fd; @@ -924,7 +912,7 @@ static int mode_visual(fb_driver_t *this, config_values_t *config, } } - xprintf(this->xine, XINE_VERBOSITY_LOG, _("video_out_fb: Your video mode was not recognized, sorry.\n")); + xprintf(this->xine, XINE_VERBOSITY_LOG, _("%s: Your video mode was not recognized, sorry.\n"), LOG_MODULE); return 0; } @@ -981,16 +969,16 @@ static void setup_buffers(fb_driver_t *this, this->cur_frame = this->old_frame = 0; xprintf(this->xine, XINE_VERBOSITY_LOG, - _("video_out_fb: %d video RAM buffers are available.\n"), this->total_num_native_buffers); + _("%s: %d video RAM buffers are available.\n"), LOG_MODULE, this->total_num_native_buffers); if(this->total_num_native_buffers < RECOMMENDED_NUM_BUFFERS) { this->use_zero_copy = 0; xprintf(this->xine, XINE_VERBOSITY_LOG, - _("WARNING: video_out_fb: Zero copy buffers are DISABLED because only %d buffers\n" + _("WARNING: %s: Zero copy buffers are DISABLED because only %d buffers\n" " are available which is less than the recommended %d buffers. Lowering\n" " the frame buffer resolution might help.\n"), - this->total_num_native_buffers, RECOMMENDED_NUM_BUFFERS); + LOG_MODULE, this->total_num_native_buffers, RECOMMENDED_NUM_BUFFERS); } else { @@ -998,8 +986,8 @@ static void setup_buffers(fb_driver_t *this, this->fb_var.yoffset = this->fb_var.yres; if(ioctl(this->fd, FBIOPAN_DISPLAY, &this->fb_var) == -1) { xprintf(this->xine, XINE_VERBOSITY_LOG, - _("WARNING: video_out_fb: Zero copy buffers are DISABLED because kernel driver\n" - " do not support screen panning (used for frame flips).\n")); + _("WARNING: %s: Zero copy buffers are DISABLED because kernel driver\n" + " do not support screen panning (used for frame flips).\n"), LOG_MODULE); } else { this->fb_var.yoffset = 0; ioctl(this->fd, FBIOPAN_DISPLAY, &this->fb_var); @@ -1067,12 +1055,13 @@ static vo_driver_t *fb_open_plugin(video_driver_class_t *class_gen, if(this->depth > 16) xprintf(this->xine, XINE_VERBOSITY_LOG, - _("WARNING: video_out_fb: current display depth is %d. For better performance\n" - " a depth of 16 bpp is recommended!\n\n"), this->depth); + _("WARNING: %s: current display depth is %d. For better performance\n" + " a depth of 16 bpp is recommended!\n\n"), LOG_MODULE, this->depth); xprintf(class->xine, XINE_VERBOSITY_DEBUG, - "video_out_fb: video mode depth is %d (%d bpp),\n" + "%s: video mode depth is %d (%d bpp),\n" " red: %d/%d, green: %d/%d, blue: %d/%d\n", + LOG_MODULE, this->depth, this->bpp, this->fb_var.red.length, this->fb_var.red.offset, this->fb_var.green.length, this->fb_var.green.offset, @@ -1125,11 +1114,7 @@ static void *fb_init_class(xine_t *xine, void *visual_gen) static const vo_info_t vo_info_fb = { 1, /* priority */ -#ifdef USE_X11_VISUAL - XINE_VISUAL_TYPE_X11 /* visual type */ -#else XINE_VISUAL_TYPE_FB /* visual type */ -#endif }; /* exported plugin catalog entry */ diff --git a/src/video_out/video_out_xshm.c b/src/video_out/video_out_xshm.c index 00d3bee1c..82270ec8a 100644 --- a/src/video_out/video_out_xshm.c +++ b/src/video_out/video_out_xshm.c @@ -284,7 +284,7 @@ static XImage *create_ximage (xshm_driver_t *this, XShmSegmentInfo *shminfo, this->bytes_per_pixel = this->bpp / 8; this->image_byte_order = myimage->byte_order; - myimage->data = xine_xmalloc (width * this->bytes_per_pixel * height); + myimage->data = xine_xcalloc (width * height, this->bytes_per_pixel); } return myimage; diff --git a/src/video_out/video_out_xxmc.c b/src/video_out/video_out_xxmc.c index fd19f391b..8ba60f6c7 100644 --- a/src/video_out/video_out_xxmc.c +++ b/src/video_out/video_out_xxmc.c @@ -165,14 +165,10 @@ static void xxmc_xvmc_surface_handler_construct(xxmc_driver_t *this) xvmc_surface_handler_t *handler = &this->xvmc_surf_handler; pthread_mutex_init(&handler->mutex,NULL); - for (i=0; i<XVMC_MAX_SURFACES; ++i) { - handler->surfInUse[i] = 0; - handler->surfValid[i] = 0; - } - for (i=0; i<XVMC_MAX_SUBPICTURES; ++i) { - handler->subInUse[i] = 0; - handler->subValid[i] = 0; - } + memset(handler->surfInUse, 0, sizeof(*handler->surfInUse)*XVMC_MAX_SURFACES); + memset(handler->surfValid, 0, sizeof(*handler->surfValid)*XVMC_MAX_SURFACES); + memset(handler->subInUse, 0, sizeof(*handler->subInUse)*XVMC_MAX_SUBPICTURES); + memset(handler->subValid, 0, sizeof(*handler->subValid)*XVMC_MAX_SUBPICTURES); } static void xxmc_xvmc_destroy_surfaces(xxmc_driver_t *this) |
