X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fvideo_output%2Fggi.c;h=1124919c4bbf594666d3a667404c3f6c80a2a117;hb=3f6f97f1326fe9d502171012699986dd404c17c4;hp=76ca5e997df791ae9cfd00f0d355b7d167812b7c;hpb=be8ca6e9a9924ccdf8c72449b85bdb97e05e87a6;p=vlc diff --git a/modules/video_output/ggi.c b/modules/video_output/ggi.c index 76ca5e997d..1124919c4b 100644 --- a/modules/video_output/ggi.c +++ b/modules/video_output/ggi.c @@ -2,16 +2,16 @@ * ggi.c : GGI plugin for vlc ***************************************************************************** * Copyright (C) 2000, 2001 VideoLAN - * $Id: ggi.c,v 1.2 2002/11/10 18:04:22 sam Exp $ + * $Id$ * * Authors: Vincent Seguin * Samuel Hocevar - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -42,25 +42,25 @@ static int Create ( vlc_object_t * ); static void Destroy ( vlc_object_t * ); static int Init ( vout_thread_t * ); -static void End ( vout_thread_t * ); -static int Manage ( vout_thread_t * ); -static void Display ( vout_thread_t *, picture_t * ); +static void End ( vout_thread_t * ); +static int Manage ( vout_thread_t * ); +static void Display ( vout_thread_t *, picture_t * ); static int OpenDisplay ( vout_thread_t * ); static void CloseDisplay ( vout_thread_t * ); -static void SetPalette ( vout_thread_t *, u16 *, u16 *, u16 * ); +static void SetPalette ( vout_thread_t *, uint16_t *, uint16_t *, uint16_t * ); /***************************************************************************** * Module descriptor *****************************************************************************/ #define DISPLAY_TEXT N_("X11 display name") -#define DISPLAY_LONGTEXT N_("Specify the X11 hardware display you want to use."\ - "\nBy default vlc will use the value of the DISPLAY"\ - " environment variable.") +#define DISPLAY_LONGTEXT N_( \ + "Specify the X11 hardware display you want to use.\n" \ + "By default, VLC will use the value of the DISPLAY " \ + "environment variable.") -vlc_module_begin(); - add_category_hint( N_("Miscellaneous"), NULL ); - add_string( "ggi-display", NULL, NULL, DISPLAY_TEXT, DISPLAY_LONGTEXT ); +vlc_module_begin(); + add_string( "ggi-display", NULL, NULL, DISPLAY_TEXT, DISPLAY_LONGTEXT, VLC_TRUE ); set_description( "General Graphics Interface video output" ); set_capability( "video output", 30 ); set_callbacks( Create, Destroy ); @@ -74,7 +74,7 @@ vlc_module_end(); *****************************************************************************/ struct vout_sys_t { - /* GGI system informations */ + /* GGI system information */ ggi_visual_t p_display; /* display device */ ggi_mode mode; /* mode descriptor */ @@ -190,6 +190,7 @@ static int Init( vout_thread_t *p_vout ) p_pic->p->p_pixels = p_b[ 0 ]->write; p_pic->p->i_pixel_pitch = p_b[ 0 ]->buffer.plb.pixelformat->size / 8; p_pic->p->i_lines = p_vout->p_sys->mode.visible.y; + p_pic->p->i_visible_lines = p_vout->p_sys->mode.visible.y; p_pic->p->i_pitch = p_b[ 0 ]->buffer.plb.stride; @@ -254,9 +255,9 @@ static void End( vout_thread_t *p_vout ) * Terminate an output method created by Create *****************************************************************************/ static void Destroy( vlc_object_t *p_this ) -{ - vout_thread_t *p_vout = (vout_thread_t *)p_this; - +{ + vout_thread_t *p_vout = (vout_thread_t *)p_this; + CloseDisplay( p_vout ); free( p_vout->p_sys ); @@ -266,7 +267,7 @@ static void Destroy( vlc_object_t *p_this ) * Manage: handle GGI events ***************************************************************************** * This function should be called regularly by video output thread. It returns - * a non null value if an error occured. + * a non null value if an error occurred. *****************************************************************************/ static int Manage( vout_thread_t *p_vout ) { @@ -278,7 +279,7 @@ static int Manage( vout_thread_t *p_vout ) mask = emKeyboard | emPtrButtonPress | emPtrButtonRelease; ggiEventPoll( p_vout->p_sys->p_display, mask, &tv ); - + while( ggiEventsQueued( p_vout->p_sys->p_display, mask) ) { ggiEventRead( p_vout->p_sys->p_display, &event, mask); @@ -511,11 +512,12 @@ static void CloseDisplay( vout_thread_t *p_vout ) /***************************************************************************** * SetPalette: sets an 8 bpp palette *****************************************************************************/ -static void SetPalette( vout_thread_t *p_vout, u16 *red, u16 *green, u16 *blue ) +static void SetPalette( vout_thread_t *p_vout, + uint16_t *red, uint16_t *green, uint16_t *blue ) { ggi_color colors[256]; int i; - + /* Fill colors with color information */ for( i = 0; i < 256; i++ ) {