* panoramix.c : Wall panoramic video with edge blending plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001, 2002, 2003 VideoLAN
- * $Id: panoramix.c 2006-08-29 16:20:15Z ced $
+ * $Id$
*
* Authors: Cedric Cocquebert <cedric.cocquebert@supelec.fr>
* based on Samuel Hocevar <sam@zoy.org>
* Preamble
*****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <vlc/vlc.h>
+#include <vlc_plugin.h>
#include <vlc_vout.h>
#include "filter_common.h"
#define OVERLAP 2350
#ifdef OVERLAP
#include <math.h>
- // OS CODE DEPENDANT to get display dimensions
+ // OS CODE DEPENDENT to get display dimensions
#ifdef SYS_MINGW32
#include <windows.h>
#else
vlc_module_begin();
set_description( N_("Panoramix: wall with overlap video filter") );
- set_shortname( _("Panoramix" ));
+ set_shortname( N_("Panoramix" ));
set_capability( "video filter", 0 );
set_category( CAT_VIDEO );
set_subcategory( SUBCAT_VIDEO_VFILTER );
add_integer( CFG_PREFIX "cols", -1, NULL,
- COLS_TEXT, COLS_LONGTEXT, VLC_TRUE );
+ COLS_TEXT, COLS_LONGTEXT, true );
add_integer( CFG_PREFIX "rows", -1, NULL,
- ROWS_TEXT, ROWS_LONGTEXT, VLC_TRUE );
+ ROWS_TEXT, ROWS_LONGTEXT, true );
#ifdef OVERLAP
#define OFFSET_X_TEXT N_("Offset X offset (automatic compensation)")
#define OFFSET_X_LONGTEXT N_("Select if you want an automatic offset in horizontal (in case of misalignment due to autoratio control)")
- add_bool( CFG_PREFIX "offset-x", 1, NULL, OFFSET_X_TEXT, OFFSET_X_LONGTEXT, VLC_TRUE );
+ add_bool( CFG_PREFIX "offset-x", 1, NULL, OFFSET_X_TEXT, OFFSET_X_LONGTEXT, true );
#define LENGTH_TEXT N_("length of the overlapping area (in %)")
#define LENGTH_LONGTEXT N_("Select in percent the length of the blended zone")
- add_integer_with_range( CFG_PREFIX "bz-length", 100, 0, 100, NULL, LENGTH_TEXT, LENGTH_LONGTEXT, VLC_TRUE );
+ add_integer_with_range( CFG_PREFIX "bz-length", 100, 0, 100, NULL, LENGTH_TEXT, LENGTH_LONGTEXT, true );
#define HEIGHT_TEXT N_("height of the overlapping area (in %)")
#define HEIGHT_LONGTEXT N_("Select in percent the height of the blended zone (case of 2x2 wall)")
- add_integer_with_range( CFG_PREFIX "bz-height", 100, 0, 100, NULL, HEIGHT_TEXT, HEIGHT_LONGTEXT, VLC_TRUE );
+ add_integer_with_range( CFG_PREFIX "bz-height", 100, 0, 100, NULL, HEIGHT_TEXT, HEIGHT_LONGTEXT, true );
#define ATTENUATION_TEXT N_("Attenuation")
#define ATTENUATION_LONGTEXT N_("Check this option if you want attenuate blended zone by this plug-in (if option is unchecked, attenuate is made by opengl)")
- add_bool( CFG_PREFIX "attenuate", 1, NULL, ATTENUATION_TEXT, ATTENUATION_LONGTEXT, VLC_FALSE );
+ add_bool( CFG_PREFIX "attenuate", 1, NULL, ATTENUATION_TEXT, ATTENUATION_LONGTEXT, false );
#define BEGIN_TEXT N_("Attenuation, begin (in %)")
#define BEGIN_LONGTEXT N_("Select in percent the Lagrange coeff of the beginning blended zone")
- add_integer_with_range( CFG_PREFIX "bz-begin", 0, 0, 100, NULL, BEGIN_TEXT, BEGIN_LONGTEXT, VLC_TRUE );
+ add_integer_with_range( CFG_PREFIX "bz-begin", 0, 0, 100, NULL, BEGIN_TEXT, BEGIN_LONGTEXT, true );
#define MIDDLE_TEXT N_("Attenuation, middle (in %)")
#define MIDDLE_LONGTEXT N_("Select in percent the Lagrange coeff of the middle of blended zone")
- add_integer_with_range( CFG_PREFIX "bz-middle", 50, 0, 100, NULL, MIDDLE_TEXT, MIDDLE_LONGTEXT, VLC_FALSE );
+ add_integer_with_range( CFG_PREFIX "bz-middle", 50, 0, 100, NULL, MIDDLE_TEXT, MIDDLE_LONGTEXT, false );
#define END_TEXT N_("Attenuation, end (in %)")
#define END_LONGTEXT N_("Select in percent the Lagrange coeff of the end of blended zone")
- add_integer_with_range( CFG_PREFIX "bz-end", 100, 0, 100, NULL, END_TEXT, END_LONGTEXT, VLC_TRUE );
+ add_integer_with_range( CFG_PREFIX "bz-end", 100, 0, 100, NULL, END_TEXT, END_LONGTEXT, true );
#define MIDDLE_POS_TEXT N_("middle position (in %)")
#define MIDDLE_POS_LONGTEXT N_("Select in percent (50 is center) the position of the middle point (Lagrange) of blended zone")
- add_integer_with_range( CFG_PREFIX "bz-middle-pos", 50, 1, 99, NULL, MIDDLE_POS_TEXT, MIDDLE_POS_LONGTEXT, VLC_FALSE );
+ add_integer_with_range( CFG_PREFIX "bz-middle-pos", 50, 1, 99, NULL, MIDDLE_POS_TEXT, MIDDLE_POS_LONGTEXT, false );
#ifdef GAMMA
#define RGAMMA_TEXT N_("Gamma (Red) correction")
#define RGAMMA_LONGTEXT N_("Select the gamma for the correction of blended zone (Red or Y component)")
- add_float_with_range( CFG_PREFIX "bz-gamma-red", 1, 0, 5, NULL, RGAMMA_TEXT, RGAMMA_LONGTEXT, VLC_TRUE );
+ add_float_with_range( CFG_PREFIX "bz-gamma-red", 1, 0, 5, NULL, RGAMMA_TEXT, RGAMMA_LONGTEXT, true );
#define GGAMMA_TEXT N_("Gamma (Green) correction")
#define GGAMMA_LONGTEXT N_("Select the gamma for the correction of blended zone (Green or U component)")
- add_float_with_range( CFG_PREFIX "bz-gamma-green", 1, 0, 5, NULL, GGAMMA_TEXT, GGAMMA_LONGTEXT, VLC_TRUE );
+ add_float_with_range( CFG_PREFIX "bz-gamma-green", 1, 0, 5, NULL, GGAMMA_TEXT, GGAMMA_LONGTEXT, true );
#define BGAMMA_TEXT N_("Gamma (Blue) correction")
#define BGAMMA_LONGTEXT N_("Select the gamma for the correction of blended zone (Blue or V component)")
- add_float_with_range( CFG_PREFIX "bz-gamma-blue", 1, 0, 5, NULL, BGAMMA_TEXT, BGAMMA_LONGTEXT, VLC_TRUE );
+ add_float_with_range( CFG_PREFIX "bz-gamma-blue", 1, 0, 5, NULL, BGAMMA_TEXT, BGAMMA_LONGTEXT, true );
#endif
#define RGAMMA_BC_TEXT N_("Black Crush for Red")
#define RGAMMA_BC_LONGTEXT N_("Select the Black Crush of blended zone (Red or Y component)")
#define GGAMMA_WL_LONGTEXT N_("Select the White Level of blended zone (Green or U component)")
#define BGAMMA_WL_TEXT N_("White Level for Blue")
#define BGAMMA_WL_LONGTEXT N_("Select the White Level of blended zone (Blue or V component)")
- add_integer_with_range( CFG_PREFIX "bz-blackcrush-red", 140, 0, 255, NULL, RGAMMA_BC_TEXT, RGAMMA_BC_LONGTEXT, VLC_TRUE );
- add_integer_with_range( CFG_PREFIX "bz-blackcrush-green", 140, 0, 255, NULL, GGAMMA_BC_TEXT, GGAMMA_BC_LONGTEXT, VLC_TRUE );
- add_integer_with_range( CFG_PREFIX "bz-blackcrush-blue", 140, 0, 255, NULL, BGAMMA_BC_TEXT, BGAMMA_BC_LONGTEXT, VLC_TRUE );
- add_integer_with_range( CFG_PREFIX "bz-whitecrush-red", 200, 0, 255, NULL, RGAMMA_WC_TEXT, RGAMMA_WC_LONGTEXT, VLC_TRUE );
- add_integer_with_range( CFG_PREFIX "bz-whitecrush-green", 200, 0, 255, NULL, GGAMMA_WC_TEXT, GGAMMA_WC_LONGTEXT, VLC_TRUE );
- add_integer_with_range( CFG_PREFIX "bz-whitecrush-blue", 200, 0, 255, NULL, BGAMMA_WC_TEXT, BGAMMA_WC_LONGTEXT, VLC_TRUE );
- add_integer_with_range( CFG_PREFIX "bz-blacklevel-red", 150, 0, 255, NULL, RGAMMA_BL_TEXT, RGAMMA_BL_LONGTEXT, VLC_TRUE );
- add_integer_with_range( CFG_PREFIX "bz-blacklevel-green", 150, 0, 255, NULL, GGAMMA_BL_TEXT, GGAMMA_BL_LONGTEXT, VLC_TRUE );
- add_integer_with_range( CFG_PREFIX "bz-blacklevel-blue", 150, 0, 255, NULL, BGAMMA_BL_TEXT, BGAMMA_BL_LONGTEXT, VLC_TRUE );
- add_integer_with_range( CFG_PREFIX "bz-whitelevel-red", 0, 0, 255, NULL, RGAMMA_WL_TEXT, RGAMMA_WL_LONGTEXT, VLC_TRUE );
- add_integer_with_range( CFG_PREFIX "bz-whitelevel-green", 0, 0, 255, NULL, GGAMMA_WL_TEXT, GGAMMA_WL_LONGTEXT, VLC_TRUE );
- add_integer_with_range( CFG_PREFIX "bz-whitelevel-blue", 0, 0, 255, NULL, BGAMMA_WL_TEXT, BGAMMA_WL_LONGTEXT, VLC_TRUE );
+ add_integer_with_range( CFG_PREFIX "bz-blackcrush-red", 140, 0, 255, NULL, RGAMMA_BC_TEXT, RGAMMA_BC_LONGTEXT, true );
+ add_integer_with_range( CFG_PREFIX "bz-blackcrush-green", 140, 0, 255, NULL, GGAMMA_BC_TEXT, GGAMMA_BC_LONGTEXT, true );
+ add_integer_with_range( CFG_PREFIX "bz-blackcrush-blue", 140, 0, 255, NULL, BGAMMA_BC_TEXT, BGAMMA_BC_LONGTEXT, true );
+ add_integer_with_range( CFG_PREFIX "bz-whitecrush-red", 200, 0, 255, NULL, RGAMMA_WC_TEXT, RGAMMA_WC_LONGTEXT, true );
+ add_integer_with_range( CFG_PREFIX "bz-whitecrush-green", 200, 0, 255, NULL, GGAMMA_WC_TEXT, GGAMMA_WC_LONGTEXT, true );
+ add_integer_with_range( CFG_PREFIX "bz-whitecrush-blue", 200, 0, 255, NULL, BGAMMA_WC_TEXT, BGAMMA_WC_LONGTEXT, true );
+ add_integer_with_range( CFG_PREFIX "bz-blacklevel-red", 150, 0, 255, NULL, RGAMMA_BL_TEXT, RGAMMA_BL_LONGTEXT, true );
+ add_integer_with_range( CFG_PREFIX "bz-blacklevel-green", 150, 0, 255, NULL, GGAMMA_BL_TEXT, GGAMMA_BL_LONGTEXT, true );
+ add_integer_with_range( CFG_PREFIX "bz-blacklevel-blue", 150, 0, 255, NULL, BGAMMA_BL_TEXT, BGAMMA_BL_LONGTEXT, true );
+ add_integer_with_range( CFG_PREFIX "bz-whitelevel-red", 0, 0, 255, NULL, RGAMMA_WL_TEXT, RGAMMA_WL_LONGTEXT, true );
+ add_integer_with_range( CFG_PREFIX "bz-whitelevel-green", 0, 0, 255, NULL, GGAMMA_WL_TEXT, GGAMMA_WL_LONGTEXT, true );
+ add_integer_with_range( CFG_PREFIX "bz-whitelevel-blue", 0, 0, 255, NULL, BGAMMA_WL_TEXT, BGAMMA_WL_LONGTEXT, true );
#ifndef SYS_MINGW32
#define XINERAMA_TEXT N_("Xinerama option")
#define XINERAMA_LONGTEXT N_("Uncheck if you have not used xinerama")
- add_bool( CFG_PREFIX "xinerama", 1, NULL, XINERAMA_TEXT, XINERAMA_LONGTEXT, VLC_TRUE );
+ add_bool( CFG_PREFIX "xinerama", 1, NULL, XINERAMA_TEXT, XINERAMA_LONGTEXT, true );
#endif
#endif
- add_string( CFG_PREFIX "active", NULL, NULL, ACTIVE_TEXT, ACTIVE_LONGTEXT, VLC_TRUE );
+ add_string( CFG_PREFIX "active", NULL, NULL, ACTIVE_TEXT, ACTIVE_LONGTEXT, true );
add_shortcut( "panoramix" );
set_callbacks( Create, Destroy );
vlc_module_end();
-static const char *ppsz_filter_options[] = {
+static const char *const ppsz_filter_options[] = {
"cols", "rows", "offset-x", "bz-length", "bz-height", "attenuate",
"bz-begin", "bz-middle", "bz-end", "bz-middle-pos", "bz-gamma-red",
"bz-gamma-green", "bz-gamma-blue", "bz-blackcrush-red",
struct vout_sys_t
{
#ifdef OVERLAP
- vlc_bool_t b_autocrop;
- vlc_bool_t b_attenuate;
+ bool b_autocrop;
+ bool b_attenuate;
unsigned int bz_length, bz_height, bz_begin, bz_middle, bz_end, bz_middle_pos;
unsigned int i_ratio_max;
unsigned int i_ratio;
unsigned int a_0, a_1, a_2;
- vlc_bool_t b_has_changed;
+ bool b_has_changed;
int lambda[2][VOUT_MAX_PLANES][500];
int cstYUV[2][VOUT_MAX_PLANES][500];
int lambda2[2][VOUT_MAX_PLANES][500];
#endif
#endif
#ifndef SYS_MINGW32
- vlc_bool_t b_xinerama;
+ bool b_xinerama;
#endif
#endif
int i_col;
int i_vout;
struct vout_list_t
{
- vlc_bool_t b_active;
+ bool b_active;
int i_width;
int i_height;
vout_thread_t *p_vout;
p_vout->p_sys->i_col = var_CreateGetInteger( p_vout, CFG_PREFIX "cols" );
p_vout->p_sys->i_row = var_CreateGetInteger( p_vout, CFG_PREFIX "rows" );
-// OS dependant code : Autodetect number of displays in wall
+// OS dependent code : Autodetect number of displays in wall
#ifdef SYS_MINGW32
if ((p_vout->p_sys->i_col < 0) || (p_vout->p_sys->i_row < 0) )
{
*****************************************************************************/
static int AdjustHeight( vout_thread_t *p_vout )
{
- vlc_bool_t b_fullscreen = var_CreateGetInteger( p_vout, "fullscreen" );
+ bool b_fullscreen = var_CreateGetInteger( p_vout, "fullscreen" );
int i_window_width = p_vout->i_window_width;
int i_window_height = p_vout->i_window_height;
double d_halfLength = 0;
double d_halfLength_calculated;
int i_offset = 0;
-// OS DEPENDANT CODE to get display dimensions
+// OS DEPENDENT CODE to get display dimensions
if (b_fullscreen)
{
#ifdef SYS_MINGW32
while( p_in < p_in_end )
{
#ifndef OVERLAP
- p_vout->p_libvlc->pf_memcpy( p_out , p_in, i_copy_pitch);
+ vlc_memcpy( p_out, p_in, i_copy_pitch);
#else
if (p_vout->p_sys->i_col > 2)
{
length /= 2;
if (i_col == 0)
- p_vout->p_libvlc->pf_memcpy( p_out + length , p_in, i_copy_pitch - length);
+ vlc_memcpy( p_out + length , p_in, i_copy_pitch - length);
else if (i_col + 1 == p_vout->p_sys->i_col)
- p_vout->p_libvlc->pf_memcpy( p_out, p_in - length, i_copy_pitch - length);
- else
- p_vout->p_libvlc->pf_memcpy( p_out, p_in - length, i_copy_pitch);
+ vlc_memcpy( p_out, p_in - length, i_copy_pitch - length);
+ else
+ vlc_memcpy( p_out, p_in - length, i_copy_pitch);
if ((i_col == 0))
// black bar
length *= 2;
}
else
- p_vout->p_libvlc->pf_memcpy( p_out , p_in, i_copy_pitch);
+ vlc_memcpy( p_out , p_in, i_copy_pitch);
if (p_vout->p_sys->b_attenuate)
{
}
#ifdef OVERLAP
- if (p_vout->p_sys->b_has_changed) p_vout->p_sys->b_has_changed = VLC_FALSE;
+ if (p_vout->p_sys->b_has_changed) p_vout->p_sys->b_has_changed = false;
#endif
}
while( p_in < p_in_end )
{
#ifndef OVERLAP
- p_vout->p_libvlc->pf_memcpy( p_out, p_in, i_copy_pitch);
+ vlc_memcpy( p_out, p_in, i_copy_pitch );
#else
if (p_vout->p_sys->i_col > 2)
{
// vertical blend
length /= 2;
if (i_col == 0)
- p_vout->p_libvlc->pf_memcpy( p_out + length, p_in, i_copy_pitch - length);
+ vlc_memcpy( p_out + length, p_in, i_copy_pitch - length);
else if (i_col + 1 == p_vout->p_sys->i_col)
- p_vout->p_libvlc->pf_memcpy( p_out, p_in - length, i_copy_pitch - length);
- else
- p_vout->p_libvlc->pf_memcpy( p_out, p_in - length, i_copy_pitch);
+ vlc_memcpy( p_out, p_in - length, i_copy_pitch - length);
+ else
+ vlc_memcpy( p_out, p_in - length, i_copy_pitch);
if ((i_col == 0))
// black bar
length *= 2;
}
else
- p_vout->p_libvlc->pf_memcpy( p_out, p_in, i_copy_pitch);
+ vlc_memcpy( p_out, p_in, i_copy_pitch);
// vertical blend
// first blended zone
}
}
#ifdef OVERLAP
- if (p_vout->p_sys->b_has_changed) p_vout->p_sys->b_has_changed = VLC_FALSE;
+ if (p_vout->p_sys->b_has_changed) p_vout->p_sys->b_has_changed = false;
#endif
}
while( p_in < p_in_end )
{
#ifndef OVERLAP
- p_vout->p_libvlc->pf_memcpy( p_out, p_in, i_copy_pitch);
+ vlc_memcpy( p_out, p_in, i_copy_pitch);
#else
- p_vout->p_libvlc->pf_memcpy( p_out + i_col * length, p_in + i_col * length, i_copy_pitch - length);
+ vlc_memcpy( p_out + i_col * length, p_in + i_col * length, i_copy_pitch - length);
p_out += LeftOffset;
p_in += LeftOffset;
#ifndef GAMMA
}
}
#ifdef OVERLAP
- if (p_vout->p_sys->b_has_changed) p_vout->p_sys->b_has_changed = VLC_FALSE;
+ if (p_vout->p_sys->b_has_changed) p_vout->p_sys->b_has_changed = false;
#endif
}
#endif
static int SendEvents( vlc_object_t *p_this, char const *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *_p_vout )
{
+ VLC_UNUSED(oldval);
vout_thread_t *p_vout = (vout_thread_t *)_p_vout;
int i_vout;
vlc_value_t sentval = newval;
static int SendEventsToChild( vlc_object_t *p_this, char const *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *p_data )
{
-
+ VLC_UNUSED(oldval); VLC_UNUSED(p_data);
vout_thread_t *p_vout = (vout_thread_t *)p_this;
int i_row, i_col, i_vout = 0;