Index: C:/vlc/vlc-trunk/vlc/src/video_output/video_output.c =================================================================== --- C:/vlc/vlc-trunk/vlc/src/video_output/video_output.c (revision 17566) +++ C:/vlc/vlc-trunk/vlc/src/video_output/video_output.c (working copy) @@ -67,6 +67,8 @@ /* Object variables callbacks */ static int DeinterlaceCallback( vlc_object_t *, char const *, vlc_value_t, vlc_value_t, void * ); +static int CropRatioCallback( vlc_object_t *, char const *, + vlc_value_t, vlc_value_t, void * ); static int FilterCallback( vlc_object_t *, char const *, vlc_value_t, vlc_value_t, void * ); static int VideoFilter2Callback( vlc_object_t *, char const *, @@ -420,8 +422,67 @@ if( val.psz_string ) free( val.psz_string ); } var_AddCallback( p_vout, "deinterlace", DeinterlaceCallback, NULL ); + + /* Ratio object var */ + var_Create( p_vout, "ratio-crop", VLC_VAR_STRING | + VLC_VAR_HASCHOICE); + + char * psz_buf = config_GetPsz( p_vout, "ratio-crop" ); + var_Change( p_vout, "ratio-crop", VLC_VAR_CLEARCHOICES, NULL, NULL ); + + text.psz_string = _("Ratio"); + var_Change( p_vout, "ratio-crop", VLC_VAR_SETTEXT, &text, NULL ); + val.psz_string = ""; + var_Change( p_vout, "ratio-crop", VLC_VAR_DELCHOICE, &val, 0 ); + val.psz_string = ""; text.psz_string = _("Disable"); + var_Change( p_vout, "ratio-crop", VLC_VAR_ADDCHOICE, &val, &text ); + val.psz_string = "0"; text.psz_string = _("Auto"); + var_Change( p_vout, "ratio-crop", VLC_VAR_ADDCHOICE, &val, &text ); + vlc_value_t val_aux; + char *psz_filter, *psz_crop = NULL; + var_Get( p_vout, "vout-filter", &val_aux ); + psz_filter = val_aux.psz_string; + if( psz_filter ) psz_crop = strstr( psz_filter, "crop" ); + if( psz_crop ) + { + val.psz_string = "1333"; text.psz_string = "1333"; + var_Change( p_vout, "ratio-crop", VLC_VAR_ADDCHOICE, &val, &text ); + val.psz_string = "1666"; text.psz_string = "1666"; + var_Change( p_vout, "ratio-crop", VLC_VAR_ADDCHOICE, &val, &text ); + val.psz_string = "1777"; text.psz_string = "1777"; + var_Change( p_vout, "ratio-crop", VLC_VAR_ADDCHOICE, &val, &text ); + val.psz_string = "1850"; text.psz_string = "1850"; + var_Change( p_vout, "ratio-crop", VLC_VAR_ADDCHOICE, &val, &text ); + val.psz_string = "2350"; text.psz_string = "2350"; + var_Change( p_vout, "ratio-crop", VLC_VAR_ADDCHOICE, &val, &text ); + + /* Add custom crop ratios */ + if( psz_buf && *psz_buf ) + { + char *psz_cur = psz_buf; + char *psz_next; + while( psz_cur && *psz_cur ) + { + psz_next = strchr( psz_cur, ',' ); + if( psz_next ) + { + *psz_next = '\0'; + psz_next++; + } + val.psz_string = strdup( psz_cur ); + text.psz_string = strdup( psz_cur ); + var_Change( p_vout, "ratio-crop", VLC_VAR_ADDCHOICE, &val, &text); + free( val.psz_string ); + free( text.psz_string ); + psz_cur = psz_next; + } + } + if( psz_buf ) free( psz_buf ); + } + var_AddCallback( p_vout, "ratio-crop", CropRatioCallback, NULL ); + var_Create( p_vout, "vout-filter", VLC_VAR_STRING | VLC_VAR_DOINHERIT ); text.psz_string = _("Filters"); var_Change( p_vout, "vout-filter", VLC_VAR_SETTEXT, &text, NULL ); @@ -1494,6 +1555,69 @@ return VLC_SUCCESS; } +/***************************************************************************** + * object variables callbacks: a bunch of object variables are used by the + * interfaces to interact with the vout. + *****************************************************************************/ +static int CropRatioCallback( vlc_object_t *p_this, char const *psz_cmd, + vlc_value_t oldval, vlc_value_t newval, void *p_data ) +{ + vout_thread_t *p_vout = (vout_thread_t *)p_this; + input_thread_t *p_input; + vlc_value_t val; + + char *psz_mode = newval.psz_string; + char *psz_filter, *psz_crop = NULL; + + var_Get( p_vout, "vout-filter", &val ); + psz_filter = val.psz_string; + if( psz_filter ) psz_crop = strstr( psz_filter, "crop" ); + + if( !psz_mode || !*psz_mode ) + { + if( psz_crop ) + { + char *psz_src = psz_crop + sizeof("crop") - 1; + if( psz_src[0] == ':' ) psz_src++; + memmove( psz_crop, psz_src, strlen(psz_src) + 1 ); + val.psz_string = psz_crop; + var_Set( p_vout, "vout-filter", val ); + } + } + else if( !psz_crop ) + { + char *psz_filter_new = malloc(sizeof("crop:") + strlen( psz_filter )*sizeof(char) ); + strcpy( psz_filter_new, "crop" ); + if( psz_filter && *psz_filter ) + { + strcat( psz_filter_new, ":"); + strcat( psz_filter_new, psz_filter); + } + val.psz_string = psz_filter_new; + var_Set( p_vout, "vout-filter", val ); + free(psz_filter_new); + } + if( psz_filter ) free( psz_filter ); + + val.b_bool = VLC_TRUE; + var_Set( p_vout, "intf-change", val ); + + p_input = (input_thread_t *)vlc_object_find( p_this, VLC_OBJECT_INPUT, + FIND_PARENT ); + if( !p_input ) return VLC_EGENERIC; + + if( psz_mode && *psz_mode ) + { + /* Modify input as well because the vout might have to be restarted */ + val.psz_string = psz_mode; + var_Create( p_input, "ratio-crop", VLC_VAR_STRING); + var_SetString( p_input, "ratio-crop", val.psz_string ); + } + vlc_object_release( p_input ); + + return VLC_SUCCESS; +} + static int FilterCallback( vlc_object_t *p_this, char const *psz_cmd, vlc_value_t oldval, vlc_value_t newval, void *p_data ) { Index: C:/vlc/vlc-trunk/vlc/src/libvlc.h =================================================================== --- C:/vlc/vlc-trunk/vlc/src/libvlc.h (revision 17566) +++ C:/vlc/vlc-trunk/vlc/src/libvlc.h (working copy) @@ -334,6 +334,13 @@ #define SNAP_SEQUENTIAL_LONGTEXT N_( \ "Use sequential numbers instead of timestamps for snapshot numbering") +#define RATIO_CROP_TEXT N_("Video cropping by ratio custom list") +#define RATIO_CROP_LONGTEXT N_( \ + "Comma seperated list of crop ratios which will be added in the " \ + "interface's crop ratios list." \ + "Accepted formats are 1333, 1666, etc expressing the movie " \ + "ratio (x1000).") + #define CROP_TEXT N_("Video cropping") #define CROP_LONGTEXT N_( \ "This forces the cropping of the source video. " \ @@ -1181,6 +1188,8 @@ #define CROP_RIGHT_KEY_LONGTEXT N_("Crop one pixel from the right of the video") #define UNCROP_RIGHT_KEY_TEXT N_("Uncrop one pixel from the right of the video") #define UNCROP_RIGHT_KEY_LONGTEXT N_("Uncrop one pixel from the right of the video") +#define RATIO_KEY_TEXT N_("crop with ratio the video") +#define RATIO_KEY_LONGTEXT N_("crop with ratio the video") #define VLC_USAGE N_( \ @@ -1313,7 +1322,8 @@ add_integer( "width", -1, NULL, WIDTH_TEXT, WIDTH_LONGTEXT, VLC_TRUE ); add_integer( "height", -1, NULL, HEIGHT_TEXT, HEIGHT_LONGTEXT, VLC_TRUE ); add_integer( "video-x", -1, NULL, VIDEOX_TEXT, VIDEOX_LONGTEXT, VLC_TRUE ); - add_integer( "video-y", -1, NULL, VIDEOY_TEXT, VIDEOY_LONGTEXT, VLC_TRUE ); + add_integer( "video-y", -1, NULL, VIDEOY_TEXT, VIDEOY_LONGTEXT, VLC_TRUE ); + add_string( "ratio-crop", NULL, NULL, RATIO_CROP_TEXT, RATIO_CROP_LONGTEXT, VLC_FALSE ); add_string( "crop", NULL, NULL, CROP_TEXT, CROP_LONGTEXT, VLC_FALSE ); add_string( "custom-crop-ratios", NULL, NULL, CUSTOM_CROP_RATIOS_TEXT, CUSTOM_CROP_RATIOS_LONGTEXT, VLC_FALSE ); @@ -1848,6 +1858,7 @@ # define KEY_HISTORY_FORWARD KEY_MODIFIER_COMMAND|']' # define KEY_RECORD KEY_MODIFIER_COMMAND|KEY_MODIFIER_SHIFT|'r' # define KEY_DUMP KEY_MODIFIER_COMMAND|KEY_MODIFIER_SHIFT|'d' +# define KEY_RATIO 'r' #else # define KEY_FULLSCREEN 'f' @@ -1931,6 +1942,7 @@ # define KEY_HISTORY_FORWARD KEY_MODIFIER_CTRL|'b' # define KEY_RECORD KEY_MODIFIER_CTRL|'r' # define KEY_DUMP KEY_MODIFIER_CTRL|KEY_MODIFIER_SHIFT|'d' +# define KEY_RATIO 'r' #endif add_key( "key-fullscreen", KEY_FULLSCREEN, NULL, FULLSCREEN_KEY_TEXT, @@ -2050,8 +2062,10 @@ add_key( "key-crop-right", KEY_CROP_RIGHT, NULL, CROP_RIGHT_KEY_TEXT, CROP_RIGHT_KEY_LONGTEXT, VLC_TRUE ); add_key( "key-uncrop-right", KEY_UNCROP_RIGHT, NULL, - UNCROP_RIGHT_KEY_TEXT, UNCROP_RIGHT_KEY_LONGTEXT, VLC_TRUE ); - + UNCROP_RIGHT_KEY_TEXT, UNCROP_RIGHT_KEY_LONGTEXT, VLC_TRUE ); + add_key( "key-ratio", KEY_RATIO, NULL, + RATIO_KEY_TEXT, RATIO_KEY_LONGTEXT, VLC_TRUE ); + set_section ( N_("Jump sizes" ), NULL ); add_integer( "extrashort-jump-size", 3, NULL, JIEXTRASHORT_TEXT, JIEXTRASHORT_LONGTEXT, VLC_FALSE ); @@ -2286,6 +2300,7 @@ { "key-history-back", ACTIONID_HISTORY_BACK, 0, 0, 0, 0 }, { "key-history-forward", ACTIONID_HISTORY_FORWARD, 0, 0, 0, 0 }, { "key-record", ACTIONID_RECORD, 0, 0, 0, 0 }, - { "key-dump", ACTIONID_DUMP, 0, 0, 0, 0 }, + { "key-dump", ACTIONID_DUMP, 0, 0, 0, 0 }, + { "key-ratio", ACTIONID_RATIO, 0, 0, 0, 0 }, { NULL, 0, 0, 0, 0, 0 } }; Index: C:/vlc/vlc-trunk/vlc/modules/control/hotkeys.c =================================================================== --- C:/vlc/vlc-trunk/vlc/modules/control/hotkeys.c (revision 17566) +++ C:/vlc/vlc-trunk/vlc/modules/control/hotkeys.c (working copy) @@ -526,6 +526,32 @@ } free( val.psz_string ); } + else if( i_action == ACTIONID_RATIO && p_vout ) + { + vlc_value_t val={0}, val_list, text_list; + var_Get( p_vout, "ratio-crop", &val ); + if( var_Change( p_vout, "ratio-crop", VLC_VAR_GETLIST, + &val_list, &text_list ) >= 0 ) + { + int i; + for( i = 0; i < val_list.p_list->i_count; i++ ) + { + if( !strcmp( val_list.p_list->p_values[i].psz_string, + val.psz_string ) ) + { + i++; + break; + } + } + if( i == val_list.p_list->i_count ) i = 0; + var_SetString( p_vout, "ratio-crop", + val_list.p_list->p_values[i].psz_string ); + vout_OSDMessage( VLC_OBJECT(p_input), DEFAULT_CHAN, + _("Ratio: %s"), + text_list.p_list->p_values[i].psz_string ); + } + free( val.psz_string ); + } else if( i_action == ACTIONID_DEINTERLACE && p_vout ) { vlc_value_t val={0}, val_list, text_list; Index: C:/vlc/vlc-trunk/vlc/modules/gui/wince/menus.cpp =================================================================== --- C:/vlc/vlc-trunk/vlc/modules/gui/wince/menus.cpp (revision 17566) +++ C:/vlc/vlc-trunk/vlc/modules/gui/wince/menus.cpp (working copy) @@ -136,6 +136,8 @@ pi_objects[i++] = p_object->i_object_id; ppsz_varnames[i] = "deinterlace"; pi_objects[i++] = p_object->i_object_id; + ppsz_varnames[i] = "ratio-crop"; + pi_objects[i++] = p_object->i_object_id; ppsz_varnames[i] = "aspect-ratio"; pi_objects[i++] = p_object->i_object_id; ppsz_varnames[i] = "crop"; Index: C:/vlc/vlc-trunk/vlc/modules/gui/wxwidgets/menus.cpp =================================================================== --- C:/vlc/vlc-trunk/vlc/modules/gui/wxwidgets/menus.cpp (revision 17566) +++ C:/vlc/vlc-trunk/vlc/modules/gui/wxwidgets/menus.cpp (working copy) @@ -164,9 +164,10 @@ { PUSH_VAR( "fullscreen" ); PUSH_VAR( "zoom" ); - PUSH_VAR( "deinterlace" ); - PUSH_VAR( "aspect-ratio" ); - PUSH_VAR( "crop" ); + PUSH_VAR( "deinterlace" ); + PUSH_VAR( "ratio-crop" ); + PUSH_VAR( "aspect-ratio" ); + PUSH_VAR( "crop" ); PUSH_VAR( "video-on-top" ); PUSH_VAR( "directx-wallpaper" ); PUSH_VAR( "video-snapshot" ); Index: C:/vlc/vlc-trunk/vlc/modules/gui/qt4/menus.cpp =================================================================== --- C:/vlc/vlc-trunk/vlc/modules/gui/qt4/menus.cpp (revision 17566) +++ C:/vlc/vlc-trunk/vlc/modules/gui/qt4/menus.cpp (working copy) @@ -76,7 +76,8 @@ { PUSH_VAR( "fullscreen" ); PUSH_VAR( "zoom" ); - PUSH_VAR( "deinterlace" ); + PUSH_VAR( "deinterlace" ); + PUSH_VAR( "ratio-crop" ); PUSH_VAR( "aspect-ratio" ); PUSH_VAR( "crop" ); PUSH_VAR( "video-on-top" ); Index: C:/vlc/vlc-trunk/vlc/modules/video_filter/panoramix.c =================================================================== --- C:/vlc/vlc-trunk/vlc/modules/video_filter/panoramix.c (revision 17566) +++ C:/vlc/vlc-trunk/vlc/modules/video_filter/panoramix.c (working copy) @@ -38,13 +38,12 @@ #ifdef OVERLAP #include // OS CODE DEPENDANT to get display dimensions - #ifdef SYS_LINUX - #include - #else #ifdef SYS_MINGW32 #include + #else + #include #endif - #endif + #define USE_CROP_MODULE 1 #define GAMMA 1 // #define PACKED_YUV 1 #define F2(a) ((a)*(a)) @@ -90,7 +89,7 @@ "defaults to all") vlc_module_begin(); - set_description( _("Panoramix: wall with overlap video filter") ); + set_description( N_("Panoramix: wall with overlap video filter") ); set_shortname( _("Panoramix" )); set_capability( "video filter", 0 ); set_category( CAT_VIDEO ); @@ -183,7 +182,7 @@ add_integer_with_range( "bz-whitelevel-red", 0, 0, 255, NULL, RGAMMA_WL_TEXT, RGAMMA_WL_LONGTEXT, VLC_TRUE ); add_integer_with_range( "bz-whitelevel-green", 0, 0, 255, NULL, GGAMMA_WL_TEXT, GGAMMA_WL_LONGTEXT, VLC_TRUE ); add_integer_with_range( "bz-whitelevel-blue", 0, 0, 255, NULL, BGAMMA_WL_TEXT, BGAMMA_WL_LONGTEXT, VLC_TRUE ); -#ifdef SYS_LINUX +#ifndef SYS_MINGW32 #define XINERAMA_TEXT N_("Xinerama option") #define XINERAMA_LONGTEXT N_("Uncheck if you have not used xinerama") add_bool( "xinerama", 1, NULL, XINERAMA_TEXT, XINERAMA_LONGTEXT, VLC_TRUE ); @@ -228,7 +227,7 @@ uint8_t LUT2[VOUT_MAX_PLANES][256][500]; #endif #endif -#ifdef SYS_LINUX +#ifndef SYS_MINGW32 vlc_bool_t b_xinerama; #endif #endif @@ -338,8 +337,8 @@ p_vout->pf_control = Control; /* Look what method was requested */ - p_vout->p_sys->i_col = config_GetInt( p_vout, "panoramix-cols" ); - p_vout->p_sys->i_row = config_GetInt( p_vout, "panoramix-rows" ); + p_vout->p_sys->i_col = var_CreateGetInteger( p_vout, "panoramix-cols" ); + p_vout->p_sys->i_row = var_CreateGetInteger( p_vout, "panoramix-rows" ); // OS dependant code : Autodetect number of displays in wall #ifdef SYS_MINGW32 @@ -362,40 +361,50 @@ p_vout->p_sys->i_row = 1; } } - config_PutInt( p_vout, "panoramix-cols", p_vout->p_sys->i_col); - config_PutInt( p_vout, "panoramix-rows", p_vout->p_sys->i_row); + var_SetInteger( p_vout, "panoramix-cols", p_vout->p_sys->i_col); + var_SetInteger( p_vout, "panoramix-rows", p_vout->p_sys->i_row); } #endif #ifdef OVERLAP - p_vout->p_sys->i_offset_x = config_GetInt( p_vout, "offset-x" ); + p_vout->p_sys->i_offset_x = var_CreateGetInteger( p_vout, "offset-x" ); if (p_vout->p_sys->i_col > 2) p_vout->p_sys->i_offset_x = 0; // offset-x is used in case of 2x1 wall & autocrop - p_vout->p_sys->b_autocrop = !(config_GetInt( p_vout, "ratio" ) == 0); - if (!p_vout->p_sys->b_autocrop) p_vout->p_sys->b_autocrop = config_GetInt( p_vout, "autocrop" ); - p_vout->p_sys->b_attenuate = config_GetInt( p_vout, "panoramix-attenuate"); - p_vout->p_sys->bz_length = config_GetInt( p_vout, "bz-length" ); +#ifdef USE_CROP_MODULE + p_vout->p_sys->b_autocrop = !(var_CreateGetInteger( p_vout, "ratio" ) == 0); +#else + p_vout->p_sys->b_autocrop = VLC_FALSE; +#endif + if (!p_vout->p_sys->b_autocrop) p_vout->p_sys->b_autocrop = var_CreateGetInteger( p_vout, "autocrop" ); + p_vout->p_sys->b_attenuate = var_CreateGetInteger( p_vout, "panoramix-attenuate"); + p_vout->p_sys->bz_length = var_CreateGetInteger( p_vout, "bz-length" ); if (p_vout->p_sys->i_row > 1) - p_vout->p_sys->bz_height = config_GetInt( p_vout, "bz-height" ); + p_vout->p_sys->bz_height = var_CreateGetInteger( p_vout, "bz-height" ); else p_vout->p_sys->bz_height = 100; - p_vout->p_sys->bz_begin = config_GetInt( p_vout, "bz-begin" ); - p_vout->p_sys->bz_middle = config_GetInt( p_vout, "bz-middle" ); - p_vout->p_sys->bz_end = config_GetInt( p_vout, "bz-end" ); - p_vout->p_sys->bz_middle_pos = config_GetInt( p_vout, "bz-middle-pos" ); + p_vout->p_sys->bz_begin = var_CreateGetInteger( p_vout, "bz-begin" ); + p_vout->p_sys->bz_middle = var_CreateGetInteger( p_vout, "bz-middle" ); + p_vout->p_sys->bz_end = var_CreateGetInteger( p_vout, "bz-end" ); + p_vout->p_sys->bz_middle_pos = var_CreateGetInteger( p_vout, "bz-middle-pos" ); double d_p = 100.0 / p_vout->p_sys->bz_middle_pos; - p_vout->p_sys->i_ratio_max = config_GetInt( p_vout, "ratio-max" ); // in crop module with autocrop ... - p_vout->p_sys->i_ratio = config_GetInt( p_vout, "ratio" ); // in crop module with manual ratio ... +#ifdef USE_CROP_MODULE + p_vout->p_sys->i_ratio_max = var_CreateGetInteger( p_vout, "ratio-max" ); // in crop module with autocrop ... + p_vout->p_sys->i_ratio = var_CreateGetInteger( p_vout, "ratio" ); // in crop module with manual ratio ... +#else + p_vout->p_sys->i_ratio_max = RATIO_MAX; + p_vout->p_sys->i_ratio = 0; +#endif + p_vout->p_sys->a_2 = d_p * p_vout->p_sys->bz_begin - (double)(d_p * d_p / (d_p - 1)) * p_vout->p_sys->bz_middle + (double)(d_p / (d_p - 1)) * p_vout->p_sys->bz_end; p_vout->p_sys->a_1 = -(d_p + 1) * p_vout->p_sys->bz_begin + (double)(d_p * d_p / (d_p - 1)) * p_vout->p_sys->bz_middle - (double)(1 / (d_p - 1)) * p_vout->p_sys->bz_end; p_vout->p_sys->a_0 = p_vout->p_sys->bz_begin; #ifdef GAMMA - p_vout->p_sys->f_gamma_red = config_GetFloat( p_vout, "bz-gamma-red" ); - p_vout->p_sys->f_gamma_green = config_GetFloat( p_vout, "bz-gamma-green" ); - p_vout->p_sys->f_gamma_blue = config_GetFloat( p_vout, "bz-gamma-blue" ); + p_vout->p_sys->f_gamma_red = var_CreateGetFloat( p_vout, "bz-gamma-red" ); + p_vout->p_sys->f_gamma_green = var_CreateGetFloat( p_vout, "bz-gamma-green" ); + p_vout->p_sys->f_gamma_blue = var_CreateGetFloat( p_vout, "bz-gamma-blue" ); #endif -#ifdef SYS_LINUX - p_vout->p_sys->b_xinerama= config_GetInt( p_vout, "xinerama" ); +#ifndef SYS_MINGW32 + p_vout->p_sys->b_xinerama= var_CreateGetInteger( p_vout, "xinerama" ); #endif #else p_vout->p_sys->i_col = __MAX( 1, __MIN( 15, p_vout->p_sys->i_col ) ); @@ -530,7 +539,7 @@ *****************************************************************************/ static int AdjustHeight( vout_thread_t *p_vout ) { - vlc_bool_t b_fullscreen = config_GetInt( p_vout, "fullscreen" ); + vlc_bool_t 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; @@ -541,30 +550,24 @@ // OS DEPENDANT CODE to get display dimensions if (b_fullscreen) { -#ifdef SYS_LINUX - Display *p_display = XOpenDisplay( "" ); - if (p_vout->p_sys->b_xinerama) - if (p_vout->p_sys->i_row == 2) - { - i_window_width = DisplayWidth(p_display, 0) / 2; - i_window_height = DisplayHeight(p_display, 0) /2; - } - else // p_vout->p_sys->i_row == 1 - { - i_window_width = DisplayWidth(p_display, 0) / 2; - i_window_height = DisplayHeight(p_display, 0); - } - else - { - i_window_width = DisplayWidth(p_display, 0); - i_window_height = DisplayHeight(p_display, 0); - } -#elif SYS_MINGW32 +#ifdef SYS_MINGW32 i_window_width = GetSystemMetrics(SM_CXSCREEN); i_window_height = GetSystemMetrics(SM_CYSCREEN); +#else + Display *p_display = XOpenDisplay( "" ); + if (p_vout->p_sys->b_xinerama) + { + i_window_width = DisplayWidth(p_display, 0) / p_vout->p_sys->i_col; + i_window_height = DisplayHeight(p_display, 0) / p_vout->p_sys->i_row; + } + else + { + i_window_width = DisplayWidth(p_display, 0); + i_window_height = DisplayHeight(p_display, 0); + } + XCloseDisplay( p_display ); + free(p_display); #endif - config_PutInt( p_vout, "width", i_window_width); - config_PutInt( p_vout, "height", i_window_height); var_SetInteger( p_vout, "width", i_window_width); var_SetInteger( p_vout, "height", i_window_height); p_vout->i_window_width = i_window_width; @@ -594,8 +597,8 @@ } p_vout->p_sys->i_halfLength = (d_halfLength + 0.5); p_vout->p_sys->bz_length = (p_vout->p_sys->i_halfLength * 100.0 * p_vout->p_sys->i_col) / p_vout->render.i_width; - config_PutInt( p_vout, "bz-length", p_vout->p_sys->bz_length); - config_PutInt( p_vout, "panoramix-rows", p_vout->p_sys->i_row); + var_SetInteger( p_vout, "bz-length", p_vout->p_sys->bz_length); + var_SetInteger( p_vout, "panoramix-rows", p_vout->p_sys->i_row); } } else @@ -612,7 +615,7 @@ double d_bz_length = (p_vout->p_sys->i_halfLength * p_vout->p_sys->i_col * 100.0) / p_vout->render.i_width; // F(2x) != 2F(x) in opengl module if (p_vout->p_sys->i_col == 2) d_bz_length = (100.0 * d_bz_length) / (100.0 - d_bz_length) ; - config_PutInt( p_vout, "bz-length", (int)(d_bz_length + 0.5)); + var_SetInteger( p_vout, "bz-length", (int)(d_bz_length + 0.5)); } i_offset = (int)d_halfLength - (int) (p_vout->p_sys->i_halfLength * (double)i_window_height * @@ -652,21 +655,21 @@ float f_BlackLevel[VOUT_MAX_PLANES]; float f_WhiteCrush[VOUT_MAX_PLANES]; float f_WhiteLevel[VOUT_MAX_PLANES]; - p_vout->p_sys->f_gamma[0] = config_GetFloat( p_vout, "bz-gamma-red" ); - p_vout->p_sys->f_gamma[1] = config_GetFloat( p_vout, "bz-gamma-green" ); - p_vout->p_sys->f_gamma[2] = config_GetFloat( p_vout, "bz-gamma-blue" ); - f_BlackCrush[0] = (float)config_GetInt( p_vout, "bz-blackcrush-red" ) / 255.0; - f_BlackCrush[1] = (float)config_GetInt( p_vout, "bz-blackcrush-green" ) / 255.0; - f_BlackCrush[2] = (float)config_GetInt( p_vout, "bz-blackcrush-blue" ) / 255.0; - f_WhiteCrush[0] = (float)config_GetInt( p_vout, "bz-whitecrush-red" ) / 255.0; - f_WhiteCrush[1] = (float)config_GetInt( p_vout, "bz-whitecrush-green" ) / 255.0; - f_WhiteCrush[2] = (float)config_GetInt( p_vout, "bz-whitecrush-blue" ) / 255.0; - f_BlackLevel[0] = (float)config_GetInt( p_vout, "bz-blacklevel-red" ) / 255.0; - f_BlackLevel[1] = (float)config_GetInt( p_vout, "bz-blacklevel-green" ) / 255.0; - f_BlackLevel[2] = (float)config_GetInt( p_vout, "bz-blacklevel-blue" ) / 255.0; - f_WhiteLevel[0] = (float)config_GetInt( p_vout, "bz-whitelevel-red" ) / 255.0; - f_WhiteLevel[1] = (float)config_GetInt( p_vout, "bz-whitelevel-green" ) / 255.0; - f_WhiteLevel[2] = (float)config_GetInt( p_vout, "bz-whitelevel-blue" ) / 255.0; + p_vout->p_sys->f_gamma[0] = var_CreateGetFloat( p_vout, "bz-gamma-red" ); + p_vout->p_sys->f_gamma[1] = var_CreateGetFloat( p_vout, "bz-gamma-green" ); + p_vout->p_sys->f_gamma[2] = var_CreateGetFloat( p_vout, "bz-gamma-blue" ); + f_BlackCrush[0] = (float)var_CreateGetInteger( p_vout, "bz-blackcrush-red" ) / 255.0; + f_BlackCrush[1] = (float)var_CreateGetInteger( p_vout, "bz-blackcrush-green" ) / 255.0; + f_BlackCrush[2] = (float)var_CreateGetInteger( p_vout, "bz-blackcrush-blue" ) / 255.0; + f_WhiteCrush[0] = (float)var_CreateGetInteger( p_vout, "bz-whitecrush-red" ) / 255.0; + f_WhiteCrush[1] = (float)var_CreateGetInteger( p_vout, "bz-whitecrush-green" ) / 255.0; + f_WhiteCrush[2] = (float)var_CreateGetInteger( p_vout, "bz-whitecrush-blue" ) / 255.0; + f_BlackLevel[0] = (float)var_CreateGetInteger( p_vout, "bz-blacklevel-red" ) / 255.0; + f_BlackLevel[1] = (float)var_CreateGetInteger( p_vout, "bz-blacklevel-green" ) / 255.0; + f_BlackLevel[2] = (float)var_CreateGetInteger( p_vout, "bz-blacklevel-blue" ) / 255.0; + f_WhiteLevel[0] = (float)var_CreateGetInteger( p_vout, "bz-whitelevel-red" ) / 255.0; + f_WhiteLevel[1] = (float)var_CreateGetInteger( p_vout, "bz-whitelevel-green" ) / 255.0; + f_WhiteLevel[2] = (float)var_CreateGetInteger( p_vout, "bz-whitelevel-blue" ) / 255.0; switch (p_vout->render.i_chroma) { // planar YVU @@ -677,16 +680,16 @@ case VLC_FOURCC('U','Y','N','V'): // packed by 2 case VLC_FOURCC('Y','4','2','2'): // packed by 2 // case VLC_FOURCC('c','y','u','v'): // packed by 2 - p_vout->p_sys->f_gamma[2] = config_GetFloat( p_vout, "bz-gamma-green" ); - p_vout->p_sys->f_gamma[1] = config_GetFloat( p_vout, "bz-gamma-blue" ); - f_BlackCrush[2] = (float)config_GetInt( p_vout, "bz-blackcrush-green" ) / 255.0; - f_BlackCrush[1] = (float)config_GetInt( p_vout, "bz-blackcrush-blue" ) / 255.0; - f_WhiteCrush[2] = (float)config_GetInt( p_vout, "bz-whitecrush-green" ) / 255.0; - f_WhiteCrush[1] = (float)config_GetInt( p_vout, "bz-whitecrush-blue" ) / 255.0; - f_BlackLevel[2] = (float)config_GetInt( p_vout, "bz-blacklevel-green" ) / 255.0; - f_BlackLevel[1] = (float)config_GetInt( p_vout, "bz-blacklevel-blue" ) / 255.0; - f_WhiteLevel[2] = (float)config_GetInt( p_vout, "bz-whitelevel-green" ) / 255.0; - f_WhiteLevel[1] = (float)config_GetInt( p_vout, "bz-whitelevel-blue" ) / 255.0; + p_vout->p_sys->f_gamma[2] = var_CreateGetFloat( p_vout, "bz-gamma-green" ); + p_vout->p_sys->f_gamma[1] = var_CreateGetFloat( p_vout, "bz-gamma-blue" ); + f_BlackCrush[2] = (float)var_CreateGetInteger( p_vout, "bz-blackcrush-green" ) / 255.0; + f_BlackCrush[1] = (float)var_CreateGetInteger( p_vout, "bz-blackcrush-blue" ) / 255.0; + f_WhiteCrush[2] = (float)var_CreateGetInteger( p_vout, "bz-whitecrush-green" ) / 255.0; + f_WhiteCrush[1] = (float)var_CreateGetInteger( p_vout, "bz-whitecrush-blue" ) / 255.0; + f_BlackLevel[2] = (float)var_CreateGetInteger( p_vout, "bz-blacklevel-green" ) / 255.0; + f_BlackLevel[1] = (float)var_CreateGetInteger( p_vout, "bz-blacklevel-blue" ) / 255.0; + f_WhiteLevel[2] = (float)var_CreateGetInteger( p_vout, "bz-whitelevel-green" ) / 255.0; + f_WhiteLevel[1] = (float)var_CreateGetInteger( p_vout, "bz-whitelevel-blue" ) / 255.0; // planar YUV case VLC_FOURCC('I','4','4','4'): case VLC_FOURCC('I','4','2','2'): @@ -800,7 +803,7 @@ p_vout->p_sys->i_vout++; continue; } - + 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; @@ -816,7 +819,6 @@ #ifdef OVERLAP if (p_vout->p_sys->i_offset_x < 0) { - config_PutInt(p_vout, "video-x", -p_vout->p_sys->i_offset_x); var_SetInteger(p_vout, "video-x", -p_vout->p_sys->i_offset_x); p_vout->p_sys->i_offset_x = 0; } @@ -869,7 +871,7 @@ int i_index; #ifdef OVERLAP - config_PutInt( p_vout, "bz-length", p_vout->p_sys->bz_length); + var_SetInteger( p_vout, "bz-length", p_vout->p_sys->bz_length); #endif /* Free the fake output buffers we allocated */ for( i_index = I_OUTPUTPICTURES ; i_index ; ) Index: C:/vlc/vlc-trunk/vlc/include/vlc_keys.h =================================================================== --- C:/vlc/vlc-trunk/vlc/include/vlc_keys.h (revision 17566) +++ C:/vlc/vlc-trunk/vlc/include/vlc_keys.h (working copy) @@ -299,3 +299,5 @@ #define ACTIONID_CROP_RIGHT 78 #define ACTIONID_UNCROP_RIGHT 79 #define ACTIONID_DUMP 80 +#define ACTIONID_RATIO 81 +