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 @@
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.
* ./plugins/gtk/gtk.glade: added lines this #@%$! Glade had munched, fixes
a segfault in the Gtk+ popup menu when toggling the interface.
......
......@@ -2,7 +2,7 @@
* vout_aa.c: Aa video output display method for testing purposes
*****************************************************************************
* 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>
*
......@@ -35,8 +35,6 @@
#include "video.h"
#include "video_output.h"
#define AA_MAX_DIRECTBUFFERS 1
/*****************************************************************************
* Capabilities defined in the other files.
*****************************************************************************/
......@@ -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_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 * );
/*****************************************************************************
......@@ -124,8 +121,12 @@ static int vout_Create( vout_thread_t *p_vout )
return( 1 );
}
if (!(p_vout->p_sys->aa_context = aa_autoinit(&aa_defparams))) {
intf_ErrMsg("error: Cannot initialize AA-lib. Sorry");
/* Don't parse any options, but take $AAOPTS into account */
aa_parseoptions( NULL, NULL, NULL, NULL );
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);
......@@ -140,7 +141,7 @@ static int vout_Create( vout_thread_t *p_vout )
static int vout_Init( vout_thread_t *p_vout )
{
int i_index;
picture_t *p_pic;
picture_t *p_pic = NULL;
I_OUTPUTPICTURES = 0;
......@@ -151,12 +152,6 @@ static int vout_Init( vout_thread_t *p_vout )
* VOUT_ASPECT_FACTOR / p_vout->p_sys->i_height;
p_vout->output.pf_setpalette = SetPalette;
/* Try to initialize AA_MAX_DIRECTBUFFERS direct buffers */
while( I_OUTPUTPICTURES < AA_MAX_DIRECTBUFFERS )
{
p_pic = NULL;
/* Find an empty picture slot */
for( i_index = 0 ; i_index < VOUT_MAX_PICTURES ; i_index++ )
{
......@@ -167,21 +162,26 @@ static int vout_Init( vout_thread_t *p_vout )
}
}
/* Allocate the picture */
if( p_pic == NULL || NewPicture( p_vout, p_pic ) )
if( p_pic == NULL )
{
break;
return -1;
}
/* 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 );
return 0;
}
/*****************************************************************************
......@@ -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,
&i_x, &i_y, &i_width, &i_height );
// 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_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;
aa_fastrender( p_vout->p_sys->aa_context, 0, 0,
aa_scrwidth(p_vout->p_sys->aa_context),
aa_scrheight(p_vout->p_sys->aa_context) );
return( 0 );
aa_flush(p_vout->p_sys->aa_context);
}
/*****************************************************************************
......
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