Commit 9e519df8 authored by Sam Hocevar's avatar Sam Hocevar

* modules/video_output/caca.c:

    + Ported to libcaca 0.6.
    + Removed dithering configuration variable; use the CACA_DITHERING
      environment variable instead, until the API is polished.
  * include/codecs.h:
    + Minor coding style fix.
parent 641a4a04
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* codecs.h: codec related structures needed by the demuxers and decoders * codecs.h: codec related structures needed by the demuxers and decoders
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: codecs.h,v 1.8 2003/11/06 16:36:40 nitrox Exp $ * $Id: codecs.h,v 1.9 2004/01/04 04:50:24 sam Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Author: Gildas Bazin <gbazin@netcourrier.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* caca.c: Color ASCII Art video output plugin using libcaca * caca.c: Color ASCII Art video output plugin using libcaca
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: caca.c,v 1.4 2003/12/04 16:49:43 sam Exp $ * $Id: caca.c,v 1.5 2004/01/04 04:50:24 sam Exp $
* *
* Authors: Sam Hocevar <sam@zoy.org> * Authors: Sam Hocevar <sam@zoy.org>
* *
...@@ -50,25 +50,7 @@ static void Display ( vout_thread_t *, picture_t * ); ...@@ -50,25 +50,7 @@ static void Display ( vout_thread_t *, picture_t * );
/***************************************************************************** /*****************************************************************************
* Module descriptor * Module descriptor
*****************************************************************************/ *****************************************************************************/
#define MODE_TEXT N_("dithering mode")
#define MODE_LONGTEXT N_("Choose the libcaca dithering mode")
static char *mode_list[] = { "none",
"ordered2",
"ordered4",
"ordered8",
"random" };
static char *mode_list_text[] = { N_("No dithering"),
N_("2x2 ordered dithering"),
N_("4x4 ordered dithering"),
N_("8x8 ordered dithering"),
N_("Random dithering") };
vlc_module_begin(); vlc_module_begin();
add_category_hint( N_("Dithering"), NULL, VLC_FALSE );
add_string( "caca-dithering", "ordered", NULL, MODE_TEXT,
MODE_LONGTEXT, VLC_FALSE );
change_string_list( mode_list, mode_list_text, 0 );
set_description( _("colour ASCII art video output") ); set_description( _("colour ASCII art video output") );
set_capability( "video output", 12 ); set_capability( "video output", 12 );
set_callbacks( Create, Destroy ); set_callbacks( Create, Destroy );
...@@ -93,8 +75,6 @@ struct vout_sys_t ...@@ -93,8 +75,6 @@ struct vout_sys_t
static int Create( vlc_object_t *p_this ) static int Create( 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;
enum caca_dithering dither = CACA_DITHERING_ORDERED4;
vlc_value_t val;
/* Allocate structure */ /* Allocate structure */
p_vout->p_sys = malloc( sizeof( vout_sys_t ) ); p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
...@@ -111,30 +91,6 @@ static int Create( vlc_object_t *p_this ) ...@@ -111,30 +91,6 @@ static int Create( vlc_object_t *p_this )
return VLC_EGENERIC; return VLC_EGENERIC;
} }
var_Create( p_vout, "caca-dithering", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
var_Get( p_vout, "caca-dithering", &val );
if( val.psz_string )
{
if( !strcmp( val.psz_string, "none" ) )
{
dither = CACA_DITHERING_NONE;
}
else if( !strcmp( val.psz_string, "ordered2" ) )
{
dither = CACA_DITHERING_ORDERED2;
}
else if( !strcmp( val.psz_string, "ordered4" ) )
{
dither = CACA_DITHERING_ORDERED4;
}
else if( !strcmp( val.psz_string, "random" ) )
{
dither = CACA_DITHERING_RANDOM;
}
free( val.psz_string );
}
caca_set_dithering( dither );
p_vout->pf_init = Init; p_vout->pf_init = Init;
p_vout->pf_end = End; p_vout->pf_end = End;
p_vout->pf_manage = Manage; p_vout->pf_manage = Manage;
...@@ -171,7 +127,8 @@ static int Init( vout_thread_t *p_vout ) ...@@ -171,7 +127,8 @@ static int Init( vout_thread_t *p_vout )
4 * ((p_vout->output.i_width + 15) & ~15), 4 * ((p_vout->output.i_width + 15) & ~15),
p_vout->output.i_rmask, p_vout->output.i_rmask,
p_vout->output.i_gmask, p_vout->output.i_gmask,
p_vout->output.i_bmask ); p_vout->output.i_bmask,
0x00000000 );
if( !p_vout->p_sys->p_bitmap ) if( !p_vout->p_sys->p_bitmap )
{ {
msg_Err( p_vout, "could not create libcaca bitmap" ); msg_Err( p_vout, "could not create libcaca bitmap" );
...@@ -257,10 +214,10 @@ static int Manage( vout_thread_t *p_vout ) ...@@ -257,10 +214,10 @@ static int Manage( vout_thread_t *p_vout )
default: default:
continue; continue;
} }
}
var_Set( p_vout->p_vlc, "key-pressed", val ); var_Set( p_vout->p_vlc, "key-pressed", val );
} }
}
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
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