Commit fe7ab73a authored by Sam Hocevar's avatar Sam Hocevar

  * ./plugins/aa/aa.c: we now parse the AAOPTS environment variable.
  * ./plugins/aa/aa.c: a few simplifications in the code.
parent cb8ef93c
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
HEAD HEAD
* ./plugins/aa/aa.c: we now parse the AAOPTS environment variable.
* ./plugins/aa/aa.c: a few simplifications in the code.
* ./configure.in: wrote a better test for libdvdread detection. * ./configure.in: wrote a better test for libdvdread detection.
* ./plugins/gtk/gtk.glade: added lines this #@%$! Glade had munched, fixes * ./plugins/gtk/gtk.glade: added lines this #@%$! Glade had munched, fixes
a segfault in the Gtk+ popup menu when toggling the interface. a segfault in the Gtk+ popup menu when toggling the interface.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_aa.c: Aa video output display method for testing purposes * vout_aa.c: Aa video output display method for testing purposes
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: aa.c,v 1.1 2002/03/19 14:00:50 sam Exp $ * $Id: aa.c,v 1.2 2002/04/10 00:04:04 sam Exp $
* *
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no> * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
* *
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
...@@ -35,8 +35,6 @@ ...@@ -35,8 +35,6 @@
#include "video.h" #include "video.h"
#include "video_output.h" #include "video_output.h"
#define AA_MAX_DIRECTBUFFERS 1
/***************************************************************************** /*****************************************************************************
* Capabilities defined in the other files. * Capabilities defined in the other files.
*****************************************************************************/ *****************************************************************************/
...@@ -91,7 +89,6 @@ static int vout_Manage ( struct vout_thread_s * ); ...@@ -91,7 +89,6 @@ static int vout_Manage ( struct vout_thread_s * );
static void vout_Render ( struct vout_thread_s *, struct picture_s * ); static void vout_Render ( struct vout_thread_s *, struct picture_s * );
static void vout_Display ( struct vout_thread_s *, struct picture_s * ); static void vout_Display ( struct vout_thread_s *, struct picture_s * );
static int NewPicture ( struct vout_thread_s *, struct picture_s * );
static void SetPalette ( struct vout_thread_s *, u16 *, u16 *, u16 * ); static void SetPalette ( struct vout_thread_s *, u16 *, u16 *, u16 * );
/***************************************************************************** /*****************************************************************************
...@@ -124,9 +121,13 @@ static int vout_Create( vout_thread_t *p_vout ) ...@@ -124,9 +121,13 @@ static int vout_Create( vout_thread_t *p_vout )
return( 1 ); return( 1 );
} }
if (!(p_vout->p_sys->aa_context = aa_autoinit(&aa_defparams))) { /* Don't parse any options, but take $AAOPTS into account */
intf_ErrMsg("error: Cannot initialize AA-lib. Sorry"); aa_parseoptions( NULL, NULL, NULL, NULL );
return( 1 );
if (!(p_vout->p_sys->aa_context = aa_autoinit(&aa_defparams)))
{
intf_ErrMsg( "vout error: cannot initialize AA-lib. Sorry" );
return( 1 );
} }
p_vout->p_sys->i_width = aa_imgwidth(p_vout->p_sys->aa_context); p_vout->p_sys->i_width = aa_imgwidth(p_vout->p_sys->aa_context);
p_vout->p_sys->i_height = aa_imgheight(p_vout->p_sys->aa_context); p_vout->p_sys->i_height = aa_imgheight(p_vout->p_sys->aa_context);
...@@ -140,8 +141,8 @@ static int vout_Create( vout_thread_t *p_vout ) ...@@ -140,8 +141,8 @@ static int vout_Create( vout_thread_t *p_vout )
static int vout_Init( vout_thread_t *p_vout ) static int vout_Init( vout_thread_t *p_vout )
{ {
int i_index; int i_index;
picture_t *p_pic; picture_t *p_pic = NULL;
I_OUTPUTPICTURES = 0; I_OUTPUTPICTURES = 0;
p_vout->output.i_chroma = FOURCC_RGB2; p_vout->output.i_chroma = FOURCC_RGB2;
...@@ -151,37 +152,36 @@ static int vout_Init( vout_thread_t *p_vout ) ...@@ -151,37 +152,36 @@ static int vout_Init( vout_thread_t *p_vout )
* VOUT_ASPECT_FACTOR / p_vout->p_sys->i_height; * VOUT_ASPECT_FACTOR / p_vout->p_sys->i_height;
p_vout->output.pf_setpalette = SetPalette; p_vout->output.pf_setpalette = SetPalette;
/* Find an empty picture slot */
/* Try to initialize AA_MAX_DIRECTBUFFERS direct buffers */ for( i_index = 0 ; i_index < VOUT_MAX_PICTURES ; i_index++ )
while( I_OUTPUTPICTURES < AA_MAX_DIRECTBUFFERS )
{ {
p_pic = NULL; if( p_vout->p_picture[ i_index ].i_status == FREE_PICTURE )
/* Find an empty picture slot */
for( i_index = 0 ; i_index < VOUT_MAX_PICTURES ; i_index++ )
{
if( p_vout->p_picture[ i_index ].i_status == FREE_PICTURE )
{
p_pic = p_vout->p_picture + i_index;
break;
}
}
/* Allocate the picture */
if( p_pic == NULL || NewPicture( p_vout, p_pic ) )
{ {
p_pic = p_vout->p_picture + i_index;
break; break;
} }
}
p_pic->i_status = DESTROYED_PICTURE; if( p_pic == NULL )
p_pic->i_type = DIRECT_PICTURE; {
return -1;
PP_OUTPUTPICTURE[ I_OUTPUTPICTURES ] = p_pic;
I_OUTPUTPICTURES++;
} }
return( 0 ); /* Allocate the picture */
p_pic->p->p_pixels = aa_image( p_vout->p_sys->aa_context );
p_pic->p->i_pixel_bytes = 1;
p_pic->p->i_lines = p_vout->p_sys->i_height;
p_pic->p->i_pitch = p_vout->p_sys->i_width;
p_pic->p->b_margin = 0;
p_pic->i_planes = 1;
p_pic->i_status = DESTROYED_PICTURE;
p_pic->i_type = DIRECT_PICTURE;
PP_OUTPUTPICTURE[ I_OUTPUTPICTURES ] = p_pic;
I_OUTPUTPICTURES++;
return 0;
} }
/***************************************************************************** /*****************************************************************************
...@@ -233,27 +233,11 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -233,27 +233,11 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
vout_PlacePicture( p_vout, p_vout->p_sys->i_width, p_vout->p_sys->i_height, vout_PlacePicture( p_vout, p_vout->p_sys->i_width, p_vout->p_sys->i_height,
&i_x, &i_y, &i_width, &i_height ); &i_x, &i_y, &i_width, &i_height );
// p_vout->p_sys->aa_context->imagebuffer = p_pic->p_data; // p_vout->p_sys->aa_context->imagebuffer = p_pic->p_data;
aa_fastrender(p_vout->p_sys->aa_context, 0, 0, aa_scrwidth(p_vout->p_sys->aa_context), aa_fastrender( p_vout->p_sys->aa_context, 0, 0,
aa_scrheight(p_vout->p_sys->aa_context)); aa_scrwidth(p_vout->p_sys->aa_context),
aa_flush(p_vout->p_sys->aa_context); aa_scrheight(p_vout->p_sys->aa_context) );
}
/***************************************************************************** aa_flush(p_vout->p_sys->aa_context);
* NewPicture: allocate a picture
*****************************************************************************
* Returns 0 on success, -1 otherwise
*****************************************************************************/
static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic )
{
p_pic->p->p_pixels = aa_image(p_vout->p_sys->aa_context);
p_pic->p->i_pixel_bytes = 1;
p_pic->p->i_lines = p_vout->p_sys->i_height;
p_pic->p->i_pitch = p_vout->p_sys->i_width;
p_pic->p->b_margin = 0;
p_pic->i_planes = 1;
return( 0 );
} }
/***************************************************************************** /*****************************************************************************
...@@ -262,11 +246,11 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -262,11 +246,11 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic )
static void SetPalette( vout_thread_t *p_vout, u16 *red, u16 *green, u16 *blue ) static void SetPalette( vout_thread_t *p_vout, u16 *red, u16 *green, u16 *blue )
{ {
int i; int i;
/* Fill colors with color information */ /* Fill colors with color information */
for( i = 0; i < 256; i++ ) for( i = 0; i < 256; i++ )
{ {
aa_setpalette( p_vout->p_sys->palette, 256 -i, aa_setpalette( p_vout->p_sys->palette, 256 -i,
red[ i ], green[ i ], blue[ i ] ); red[ i ], green[ i ], blue[ i ] );
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment