* adjust.c : Contrast/Hue/Saturation/Brightness video plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001, 2002, 2003 VideoLAN
- * $Id: adjust.c,v 1.17 2004/01/25 20:05:28 hartman Exp $
+ * $Id$
*
* Authors: Simon Latapie <garf@via.ecp.fr>
*
vlc_module_begin();
set_description( _("Image properties filter") );
+ set_shortname( N_("Image adjust" ));
+ set_category( CAT_VIDEO );
+ set_subcategory( SUBCAT_VIDEO_VFILTER );
set_capability( "video filter", 0 );
add_float_with_range( "contrast", 1.0, 0.0, 2.0, NULL, CONT_TEXT, CONT_LONGTEXT, VLC_FALSE );
return (a > 255) ? 255 : (a < 0) ? 0 : a;
}
+/*****************************************************************************
+ * Control: control facility for the vout (forwards to child vout)
+ *****************************************************************************/
+static int Control( vout_thread_t *p_vout, int i_query, va_list args )
+{
+ return vout_vaControl( p_vout->p_sys->p_vout, i_query, args );
+}
+
/*****************************************************************************
* Create: allocates adjust video thread output method
*****************************************************************************
p_vout->pf_manage = NULL;
p_vout->pf_render = Render;
p_vout->pf_display = NULL;
+ p_vout->pf_control = Control;
var_Create( p_vout, "contrast", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT );
var_Create( p_vout, "brightness", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT );
{
int i_index;
picture_t *p_pic;
+ video_format_t fmt = {0};
I_OUTPUTPICTURES = 0;
p_vout->output.i_height = p_vout->render.i_height;
p_vout->output.i_aspect = p_vout->render.i_aspect;
+ fmt.i_width = fmt.i_visible_width = p_vout->render.i_width;
+ fmt.i_height = fmt.i_visible_height = p_vout->render.i_height;
+ fmt.i_x_offset = fmt.i_y_offset = 0;
+ fmt.i_chroma = p_vout->render.i_chroma;
+ fmt.i_aspect = p_vout->render.i_aspect;
+ fmt.i_sar_num = p_vout->render.i_aspect * fmt.i_height / fmt.i_width;
+ fmt.i_sar_den = VOUT_ASPECT_FACTOR;
+
/* Try to open the real video output */
msg_Dbg( p_vout, "spawning the real video output" );
- p_vout->p_sys->p_vout = vout_Create( p_vout,
- p_vout->render.i_width, p_vout->render.i_height,
- p_vout->render.i_chroma, p_vout->render.i_aspect );
+ p_vout->p_sys->p_vout = vout_Create( p_vout, &fmt );
/* Everything failed */
if( p_vout->p_sys->p_vout == NULL )
{
vout_thread_t *p_vout = (vout_thread_t *)p_this;
- DEL_CALLBACKS( p_vout->p_sys->p_vout, SendEvents );
- vlc_object_detach( p_vout->p_sys->p_vout );
- vout_Destroy( p_vout->p_sys->p_vout );
+ if( p_vout->p_sys->p_vout )
+ {
+ DEL_CALLBACKS( p_vout->p_sys->p_vout, SendEvents );
+ vlc_object_detach( p_vout->p_sys->p_vout );
+ vout_Destroy( p_vout->p_sys->p_vout );
+ }
DEL_PARENT_CALLBACKS( SendEventsToChild );
*/
p_in = p_pic->p[0].p_pixels;
- p_in_end = p_in + p_pic->p[0].i_lines * p_pic->p[0].i_pitch - 8;
+ p_in_end = p_in + p_pic->p[0].i_visible_lines * p_pic->p[0].i_pitch - 8;
p_out = p_outpic->p[0].p_pixels;
p_in = p_pic->p[1].p_pixels;
p_in_v = p_pic->p[2].p_pixels;
- p_in_end = p_in + p_pic->p[1].i_lines * p_pic->p[1].i_pitch - 8;
+ p_in_end = p_in + p_pic->p[1].i_visible_lines * p_pic->p[1].i_pitch - 8;
p_out = p_outpic->p[1].p_pixels;
p_out_v = p_outpic->p[2].p_pixels;