diff options
author | phintuka <phintuka> | 2008-02-19 02:59:46 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2008-02-19 02:59:46 +0000 |
commit | 6107d6038b27ecb4c476b2109595a9ad9604a1a4 (patch) | |
tree | b8807ef0c5f0395a27068c5e44d79ef9a2d1ed56 | |
parent | 1ba355234ae47addb65c6812302512cbffa5eb79 (diff) | |
download | xineliboutput-6107d6038b27ecb4c476b2109595a9ad9604a1a4.tar.gz xineliboutput-6107d6038b27ecb4c476b2109595a9ad9604a1a4.tar.bz2 |
Software scaling UI
-rw-r--r-- | config.c | 26 | ||||
-rw-r--r-- | config.h | 9 | ||||
-rw-r--r-- | frontend_local.c | 4 | ||||
-rw-r--r-- | frontend_svr.c | 4 | ||||
-rw-r--r-- | setup_menu.c | 27 |
5 files changed, 65 insertions, 5 deletions
@@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: config.c,v 1.51 2008-02-19 00:43:04 phelin Exp $ + * $Id: config.c,v 1.52 2008-02-19 02:59:46 phintuka Exp $ * */ @@ -350,6 +350,19 @@ const char *config_t::AutocropOptions(void) return NULL; } +const char *config_t::SwScaleOptions(void) +{ + if(swscale) { + static char buffer[256]; + snprintf(buffer, sizeof(buffer), + "no_downscaling=%d,output_width=%d,output_height=%d", + swscale_downscale?0:1, swscale_width, swscale_height); + buffer[sizeof(buffer)-1] = 0; + return buffer; + } + return NULL; +} + const char *config_t::FfmpegPpOptions(void) { if(ffmpeg_pp) { @@ -476,6 +489,11 @@ config_t::config_t() { autocrop_fixedsize = 1; autocrop_subs = 1; + swscale = 0; // enable/disable + swscale_downscale = 0; // allow downscaling + swscale_width = 720; // output video width + swscale_height = 576; // output video height + remote_mode = 0; listen_port = LISTEN_PORT; remote_keyboard = 1; @@ -732,6 +750,12 @@ bool config_t::SetupParse(const char *Name, const char *Value) else if (!strcasecmp(Name, "Video.AutoCrop.SoftStart")) autocrop_soft = atoi(Value); else if (!strcasecmp(Name, "Video.AutoCrop.FixedSize")) autocrop_fixedsize = atoi(Value); else if (!strcasecmp(Name, "Video.AutoCrop.DetectSubs")) autocrop_subs = atoi(Value); + + else if (!strcasecmp(Name, "Video.SwScale")) swscale = atoi(Value); + else if (!strcasecmp(Name, "Video.SwScale.Downscale")) swscale_downscale = atoi(Value); + else if (!strcasecmp(Name, "Video.SwScale.Width")) swscale_width = atoi(Value); + else if (!strcasecmp(Name, "Video.SwScale.Height")) swscale_height = atoi(Value); + else if (!strcasecmp(Name, "Video.HUE")) hue = atoi(Value); else if (!strcasecmp(Name, "Video.Saturation")) saturation = atoi(Value); else if (!strcasecmp(Name, "Video.Contrast")) contrast = atoi(Value); @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: config.h,v 1.35 2008-02-19 00:43:04 phelin Exp $ + * $Id: config.h,v 1.36 2008-02-19 02:59:46 phintuka Exp $ * */ @@ -273,6 +273,12 @@ class config_t { int autocrop_fixedsize; int autocrop_subs; + // (video) software scaling + int swscale; // enable/disable + int swscale_downscale; // allow downscaling + int swscale_width; // output video width + int swscale_height; // output video height + // sharpen / soften post plugin int unsharp; // enable / disable int unsharp_luma_matrix_width; // 3..11, should be an odd number @@ -329,6 +335,7 @@ class config_t { bool IsPlaylistFile(const char *); const char *AutocropOptions(void); + const char *SwScaleOptions(void); const char *FfmpegPpOptions(void); const char *UnsharpOptions(void); const char *Denoise3dOptions(void); diff --git a/frontend_local.c b/frontend_local.c index b23461e3..1c7b8c7c 100644 --- a/frontend_local.c +++ b/frontend_local.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: frontend_local.c,v 1.28 2008-02-19 00:43:04 phelin Exp $ + * $Id: frontend_local.c,v 1.29 2008-02-19 02:59:46 phintuka Exp $ * */ @@ -404,6 +404,8 @@ void cXinelibLocal::Action(void) ConfigurePostprocessing("upmix", xc.audio_upmix ? true : false, NULL); ConfigurePostprocessing("autocrop", xc.autocrop ? true : false, xc.AutocropOptions()); + ConfigurePostprocessing("swscale", xc.swscale ? true : false, + xc.SwScaleOptions()); ConfigurePostprocessing("pp", xc.ffmpeg_pp ? true : false, xc.FfmpegPpOptions()); ConfigurePostprocessing("unsharp",xc.unsharp ? true : false, diff --git a/frontend_svr.c b/frontend_svr.c index ae66d285..1b0295c2 100644 --- a/frontend_svr.c +++ b/frontend_svr.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: frontend_svr.c,v 1.49 2008-02-19 00:43:04 phelin Exp $ + * $Id: frontend_svr.c,v 1.50 2008-02-19 02:59:46 phintuka Exp $ * */ @@ -1163,6 +1163,8 @@ void cXinelibServer::Handle_Control_CONFIG(int cli) ConfigurePostprocessing("upmix", xc.audio_upmix ? true : false, NULL); ConfigurePostprocessing("autocrop", xc.autocrop ? true : false, xc.AutocropOptions()); + ConfigurePostprocessing("swscale", xc.swscale ? true : false, + xc.SwScaleOptions()); ConfigurePostprocessing("pp", xc.ffmpeg_pp ? true : false, xc.FfmpegPpOptions()); ConfigurePostprocessing("unsharp",xc.unsharp ? true : false, diff --git a/setup_menu.c b/setup_menu.c index 331a9da5..b87a0626 100644 --- a/setup_menu.c +++ b/setup_menu.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: setup_menu.c,v 1.44 2008-02-19 00:43:04 phelin Exp $ + * $Id: setup_menu.c,v 1.45 2008-02-19 02:59:46 phintuka Exp $ * */ @@ -485,6 +485,7 @@ class cMenuSetupVideo : public cMenuSetupPage config_t newconfig; cOsdItem *ctrl_autocrop; + cOsdItem *ctrl_swscale; cOsdItem *ctrl_hue; cOsdItem *ctrl_saturation; cOsdItem *ctrl_contrast; @@ -535,6 +536,8 @@ cMenuSetupVideo::~cMenuSetupVideo(void) cXinelibDevice::Instance().ConfigurePostprocessing( "autocrop", xc.autocrop ? true : false, xc.AutocropOptions()); cXinelibDevice::Instance().ConfigurePostprocessing( + "swscale", xc.swscale ? true : false, xc.SwScaleOptions()); + cXinelibDevice::Instance().ConfigurePostprocessing( "pp", xc.ffmpeg_pp ? true : false, xc.FfmpegPpOptions()); cXinelibDevice::Instance().ConfigurePostprocessing( "unsharp", xc.unsharp ? true : false, xc.UnsharpOptions()); @@ -572,6 +575,18 @@ void cMenuSetupVideo::Set(void) &newconfig.autocrop_subs)); } + Add(ctrl_swscale = + new cMenuEditBoolItem(tr("Software scaling"), + &newconfig.swscale)); + if(newconfig.autocrop) { + Add(new cMenuEditIntItem( tr(" Width"), + &newconfig.swscale_width, 360, 2000)); + Add(new cMenuEditIntItem( tr(" Height"), + &newconfig.swscale_height, 288, 1200)); + Add(new cMenuEditBoolItem(tr(" Allow downscaling"), + &newconfig.swscale_downscale)); + } + Add(ctrl_overscan = new cMenuEditTypedIntItem(tr("Overscan (crop image borders)"), "%", &newconfig.overscan, 0, 10, @@ -706,6 +721,12 @@ eOSState cMenuSetupVideo::ProcessKey(eKeys Key) newconfig.AutocropOptions()); Set(); } + else if(item == ctrl_swscale) { + cXinelibDevice::Instance().ConfigurePostprocessing( + "swscale", newconfig.swscale ? true : false, + newconfig.SwScaleOptions()); + Set(); + } else if(item == ctrl_pp) { cXinelibDevice::Instance().ConfigurePostprocessing( "pp", newconfig.ffmpeg_pp ? true : false, @@ -757,6 +778,10 @@ void cMenuSetupVideo::Store(void) SetupStore("Video.AutoCrop.SoftStart", xc.autocrop_soft); SetupStore("Video.AutoCrop.FixedSize", xc.autocrop_fixedsize); SetupStore("Video.AutoCrop.DetectSubs", xc.autocrop_subs); + SetupStore("Video.SwScale", xc.swscale); + SetupStore("Video.SwScale.Downscale", xc.swscale_downscale); + SetupStore("Video.SwScale.Width", xc.swscale_width); + SetupStore("Video.SwScale.Height", xc.swscale_height); SetupStore("Video.HUE", xc.hue); SetupStore("Video.Saturation", xc.saturation); SetupStore("Video.Contrast", xc.contrast); |