diff options
-rw-r--r-- | device.c | 9 | ||||
-rw-r--r-- | device.h | 5 | ||||
-rw-r--r-- | frontend.c | 6 | ||||
-rw-r--r-- | frontend.h | 5 | ||||
-rw-r--r-- | frontend_local.c | 4 | ||||
-rw-r--r-- | frontend_svr.c | 4 | ||||
-rw-r--r-- | menu.c | 6 | ||||
-rw-r--r-- | setup_menu.c | 21 | ||||
-rw-r--r-- | xine_frontend.c | 17 |
9 files changed, 54 insertions, 23 deletions
@@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: device.c,v 1.15 2006-08-24 23:31:16 phintuka Exp $ + * $Id: device.c,v 1.16 2006-08-25 04:03:11 phintuka Exp $ * */ @@ -379,14 +379,15 @@ void cXinelibDevice::ConfigurePostprocessing(const char *name, bool on, m_server->ConfigurePostprocessing(name, on, args); } -void cXinelibDevice::ConfigureVideo(int hue, int saturation, int brightness, int contrast) +void cXinelibDevice::ConfigureVideo(int hue, int saturation, int brightness, int contrast, + int overscan) { TRACEF("cXinelibDevice::ConfigureVideo"); if(m_local) - m_local->ConfigureVideo(hue, saturation, brightness, contrast); + m_local->ConfigureVideo(hue, saturation, brightness, contrast, overscan); if(m_server) - m_server->ConfigureVideo(hue, saturation, brightness, contrast); + m_server->ConfigureVideo(hue, saturation, brightness, contrast, overscan); } void cXinelibDevice::ConfigureDecoder(int pes_buffers, int priority) @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: device.h,v 1.9 2006-08-24 23:31:16 phintuka Exp $ + * $Id: device.h,v 1.10 2006-08-25 04:03:11 phintuka Exp $ * */ @@ -111,7 +111,8 @@ class cXinelibDevice : public cDevice int speaker_type); void ConfigurePostprocessing(const char *name, bool on=true, const char *args=NULL); - void ConfigureVideo(int hue, int saturation, int brightness, int contrast); + void ConfigureVideo(int hue, int saturation, int brightness, int contrast, + int overscan); // local mode: void ConfigureWindow(int fullscreen, int width, int height, int modeswitch, const char *modeline, @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: frontend.c,v 1.12 2006-08-22 08:32:38 phintuka Exp $ + * $Id: frontend.c,v 1.13 2006-08-25 04:03:11 phintuka Exp $ * */ @@ -592,9 +592,11 @@ int cXinelibThread::ConfigurePostprocessing(const char *name, bool on, const cha } int cXinelibThread::ConfigureVideo(int hue, int saturation, - int brightness, int contrast) + int brightness, int contrast, + int overscan) { char cmd[128]; + Xine_Control("OVERSCAN", overscan); sprintf(cmd, "VIDEO_PROPERTIES %d %d %d %d", hue, saturation, brightness, contrast); return Xine_Control(cmd); @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: frontend.h,v 1.6 2006-08-22 03:45:34 phintuka Exp $ + * $Id: frontend.h,v 1.7 2006-08-25 04:03:11 phintuka Exp $ * */ @@ -114,7 +114,8 @@ class cXinelibThread : public cThread, public cListObject int speaker_type); virtual int ConfigurePostprocessing(const char *name, bool on, const char *args); virtual int ConfigureVideo(int hue, int saturation, - int brightness, int contrast); + int brightness, int contrast, + int overscan); // Local frontend: virtual void ConfigureWindow(int fullscreen, int width, int height, int modeswitch, const char *modeline, diff --git a/frontend_local.c b/frontend_local.c index b0b7a369..a2b80ffd 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.8 2006-08-22 03:45:34 phintuka Exp $ + * $Id: frontend_local.c,v 1.9 2006-08-25 04:03:11 phintuka Exp $ * */ @@ -405,7 +405,7 @@ void cXinelibLocal::Action(void) ConfigurePostprocessing(xc.deinterlace_method, xc.audio_delay, xc.audio_compression, xc.audio_equalizer, xc.audio_surround, xc.speaker_type); - ConfigureVideo(xc.hue, xc.saturation, xc.brightness, xc.contrast); + ConfigureVideo(xc.hue, xc.saturation, xc.brightness, xc.contrast, xc.overscan); ConfigurePostprocessing("upmix", xc.audio_upmix ? true : false, NULL); ConfigurePostprocessing("autocrop", xc.autocrop ? true : false, xc.AutocropOptions()); diff --git a/frontend_svr.c b/frontend_svr.c index 31bf4b05..6a8e3c00 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.18 2006-08-24 09:20:07 phintuka Exp $ + * $Id: frontend_svr.c,v 1.19 2006-08-25 04:03:11 phintuka Exp $ * */ @@ -1018,7 +1018,7 @@ void cXinelibServer::Handle_Control_CONFIG(int cli) ConfigurePostprocessing(xc.deinterlace_method, xc.audio_delay, xc.audio_compression, xc.audio_equalizer, xc.audio_surround, xc.speaker_type); - ConfigureVideo(xc.hue, xc.saturation, xc.brightness, xc.contrast); + ConfigureVideo(xc.hue, xc.saturation, xc.brightness, xc.contrast, xc.overscan); ConfigurePostprocessing("upmix", xc.audio_upmix ? true : false, NULL); ConfigurePostprocessing("autocrop", xc.autocrop ? true : false, xc.AutocropOptions()); @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: menu.c,v 1.11 2006-08-22 03:45:34 phintuka Exp $ + * $Id: menu.c,v 1.12 2006-08-25 04:03:11 phintuka Exp $ * */ @@ -484,7 +484,7 @@ eOSState cTestGrayscale::ProcessKey(eKeys key) br -= 0xffff/1024; sprintf(s, "b %d", br); m_Osd->DrawText(400, 100, s, 0xff000000, 0xffffffff, cFont::GetFont(fontSml)); - cXinelibDevice::Instance().ConfigureVideo(xc.hue, xc.saturation, br, co); + cXinelibDevice::Instance().ConfigureVideo(xc.hue, xc.saturation, br, co, xc.overscan); m_Osd->Flush(); return osContinue; case kUp: @@ -493,7 +493,7 @@ eOSState cTestGrayscale::ProcessKey(eKeys key) co -= 0xffff/1024; sprintf(s, "c %d", co); m_Osd->DrawText(400, 130, s, 0xff000000, 0xffffffff, cFont::GetFont(fontSml)); - cXinelibDevice::Instance().ConfigureVideo(xc.hue, xc.saturation, br, co); + cXinelibDevice::Instance().ConfigureVideo(xc.hue, xc.saturation, br, co, xc.overscan); m_Osd->Flush(); return osContinue; } diff --git a/setup_menu.c b/setup_menu.c index 241341f1..f5d2bfe3 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.6 2006-08-22 03:53:34 phintuka Exp $ + * $Id: setup_menu.c,v 1.7 2006-08-25 04:03:11 phintuka Exp $ * */ @@ -372,6 +372,7 @@ class cMenuSetupVideo : public cMenuSetupPage cOsdItem *ctrl_saturation; cOsdItem *ctrl_contrast; cOsdItem *ctrl_brightness; + cOsdItem *ctrl_overscan; protected: virtual void Store(void); @@ -399,7 +400,8 @@ cMenuSetupVideo::cMenuSetupVideo(void) cMenuSetupVideo::~cMenuSetupVideo(void) { cXinelibDevice::Instance().ConfigureVideo(xc.hue, xc.saturation, - xc.brightness, xc.contrast); + xc.brightness, xc.contrast, + xc.overscan); cXinelibDevice::Instance().ConfigurePostprocessing( "autocrop", xc.autocrop ? true : false, xc.AutocropOptions()); } @@ -427,6 +429,11 @@ void cMenuSetupVideo::Set(void) &newconfig.autocrop_subs)); } + Add(ctrl_overscan = + new cMenuEditTypedIntItem(tr("Overscan (crop image borders)"), "%", + &newconfig.overscan, 0, 10, + tr("Off"))); + #ifdef INTEGER_CONFIG_VIDEO_CONTROLS Add(new cMenuEditIntItem(tr("HUE"), &newconfig.hue, -1, 0xffff)); Add(new cMenuEditIntItem(tr("Saturation"), &newconfig.saturation,-1,0xffff)); @@ -462,18 +469,21 @@ eOSState cMenuSetupVideo::ProcessKey(eKeys Key) return state; if(item == ctrl_hue || item == ctrl_saturation || - item == ctrl_contrast || item == ctrl_brightness ) + item == ctrl_contrast || item == ctrl_brightness || + item == ctrl_overscan) #ifdef INTEGER_CONFIG_VIDEO_CONTROLS cXinelibDevice::Instance().ConfigureVideo(newconfig.hue, newconfig.saturation, newconfig.brightness, - newconfig.contrast); + newconfig.contrast, + newconfig.overscan); #else cXinelibDevice::Instance().ConfigureVideo( INDEX_TO_CONTROL(newconfig.hue), INDEX_TO_CONTROL(newconfig.saturation), INDEX_TO_CONTROL(newconfig.brightness), - INDEX_TO_CONTROL(newconfig.contrast)); + INDEX_TO_CONTROL(newconfig.contrast), + newconfig.overscan); #endif else if(item == ctrl_autocrop) { cXinelibDevice::Instance().ConfigurePostprocessing( @@ -505,6 +515,7 @@ void cMenuSetupVideo::Store(void) SetupStore("Video.Saturation", xc.saturation); SetupStore("Video.Contrast", xc.contrast); SetupStore("Video.Brightness", xc.brightness); + SetupStore("Video.Overscan", xc.overscan); } diff --git a/xine_frontend.c b/xine_frontend.c index b6bf1588..a99299c5 100644 --- a/xine_frontend.c +++ b/xine_frontend.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xine_frontend.c,v 1.15 2006-08-23 05:30:14 phintuka Exp $ + * $Id: xine_frontend.c,v 1.16 2006-08-25 04:03:11 phintuka Exp $ * */ @@ -225,6 +225,15 @@ static void fe_frame_output_cb (void *data, } #endif + if(this->overscan) { + int crop_x = this->overscan * this->width / 100 / 2; + int crop_y = this->overscan * this->height / 100 / 2; + *dest_x -= crop_x; + *dest_y -= crop_y; + *dest_width += crop_x; + *dest_height += crop_y; + } + #if 0 static int n=0,t=25/**10*/; n++; static char *s_aspect[] = {"Auto","Default","4:3","16:9","16:10","Pan&Scan"}; @@ -1171,8 +1180,14 @@ static void *fe_control(void *fe_handle, const char *cmd) free(result->data); free(result); } + + } else if(!strncmp(cmd, "OVERSCAN ", 9)) { + int overscan; + if(1 == sscanf(cmd+9, "%d", &overscan)) + this->overscan = overscan; } + return NULL; } |