From 66f7eb3aa9eb07360fbd8794223b046dee420855 Mon Sep 17 00:00:00 2001 From: phelin Date: Tue, 19 Feb 2008 00:43:04 +0000 Subject: Added the possibility to select the aspect ratio of the video. --- config.c | 14 ++++++++++++- config.h | 12 +++++++++++- device.c | 8 ++++---- device.h | 4 ++-- frontend.c | 8 ++++---- frontend.h | 4 ++-- frontend_local.c | 4 ++-- frontend_svr.c | 4 ++-- i18n.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- menu.c | 19 +++++++++++++++--- po/de_DE.po | 12 ++++++++++++ po/fi_FI.po | 12 ++++++++++++ po/it_IT.po | 12 ++++++++++++ po/ru_RU.po | 12 ++++++++++++ setup_menu.c | 21 +++++++++++++------- xine_frontend.c | 7 ++++++- xine_input_vdr.c | 32 +++++++++++++++++++++--------- 17 files changed, 206 insertions(+), 39 deletions(-) diff --git a/config.c b/config.c index 625f15ac..56ff5965 100644 --- a/config.c +++ b/config.c @@ -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.50 2008-02-05 00:19:26 phintuka Exp $ + * $Id: config.c,v 1.51 2008-02-19 00:43:04 phelin Exp $ * */ @@ -56,6 +56,16 @@ const char * const config_t::s_aspects[ ASPECT_count+1 ] = { NULL }; +const char * const config_t::s_vo_aspects[ VO_ASPECT_count+1 ] = { + trNOOP("automatic"), + trNOOP("square"), + "4:3", + trNOOP("anamorphic"), + trNOOP("DVB"), + NULL +}; + + const char * const config_t::s_deinterlaceMethods[ DEINTERLACE_count+1 ] = { "none", "bob", @@ -506,6 +516,7 @@ config_t::config_t() { saturation = -1; contrast = -1; brightness = -1; + vo_aspect_ratio = 0; strn0cpy(browse_files_dir, VideoDirectory, sizeof(browse_files_dir)); strn0cpy(browse_music_dir, VideoDirectory, sizeof(browse_music_dir)); @@ -728,6 +739,7 @@ bool config_t::SetupParse(const char *Name, const char *Value) else if (!strcasecmp(Name, "Video.Overscan")) overscan = atoi(Value); else if (!strcasecmp(Name, "Video.IBPTrickSpeed")) ibp_trickspeed = atoi(Value); else if (!strcasecmp(Name, "Video.MaxTrickSpeed")) max_trickspeed = atoi(Value); + else if (!strcasecmp(Name, "Video.AspectRatio")) vo_aspect_ratio = atoi(Value); else if (!strcasecmp(Name, "Post.pp.Enable")) ffmpeg_pp = atoi(Value); else if (!strcasecmp(Name, "Post.pp.Quality")) ffmpeg_pp_quality = atoi(Value); diff --git a/config.h b/config.h index c917b59b..7af02626 100644 --- a/config.h +++ b/config.h @@ -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.34 2008-02-05 00:19:26 phintuka Exp $ + * $Id: config.h,v 1.35 2008-02-19 00:43:04 phelin Exp $ * */ @@ -33,6 +33,14 @@ #define ASPECT_CENTER_CUT_OUT 6 #define ASPECT_count 7 +// VIDEO OUTPUT ASPECT RATIO +#define VO_ASPECT_AUTO 0 +#define VO_ASPECT_SQUARE 1 /* 1:1 */ +#define VO_ASPECT_4_3 2 /* 4:3 */ +#define VO_ASPECT_ANAMORPHIC 3 /* 16:9 */ +#define VO_ASPECT_DVB 4 /* 2.11:1 */ +#define VO_ASPECT_count 5 + // De-interlace method #define DEINTERLACE_NONE 0 #define DEINTERLACE_BOB 1 @@ -172,6 +180,7 @@ class config_t { static const char * const s_subtitleSizes[]; static const char * const s_subExts[]; static const char * const s_osdMixers[]; + static const char * const s_vo_aspects[]; public: @@ -216,6 +225,7 @@ class config_t { int saturation; // 0...0xffff, -1 == off int contrast; // 0...0xffff, -1 == off int brightness; // 0...0xffff, -1 == off + int vo_aspect_ratio; // OSD settings eMainMenuMode main_menu_mode; // used internally to open right sub-menu diff --git a/device.c b/device.c index 29b6c32a..e3ceaf22 100644 --- a/device.c +++ b/device.c @@ -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.50 2008-02-05 00:47:05 phintuka Exp $ + * $Id: device.c,v 1.51 2008-02-19 00:43:04 phelin Exp $ * */ @@ -456,14 +456,14 @@ void cXinelibDevice::ConfigurePostprocessing(const char *name, bool on, } void cXinelibDevice::ConfigureVideo(int hue, int saturation, int brightness, int contrast, - int overscan) + int overscan, int vo_aspect_ratio) { TRACEF("cXinelibDevice::ConfigureVideo"); if(m_local) - m_local->ConfigureVideo(hue, saturation, brightness, contrast, overscan); + m_local->ConfigureVideo(hue, saturation, brightness, contrast, overscan, vo_aspect_ratio); if(m_server) - m_server->ConfigureVideo(hue, saturation, brightness, contrast, overscan); + m_server->ConfigureVideo(hue, saturation, brightness, contrast, overscan, vo_aspect_ratio); } void cXinelibDevice::ConfigureDecoder(int pes_buffers) diff --git a/device.h b/device.h index b578410b..f2b4ab6d 100644 --- a/device.h +++ b/device.h @@ -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.28 2008-02-05 00:28:43 phintuka Exp $ + * $Id: device.h,v 1.29 2008-02-19 00:43:04 phelin Exp $ * */ @@ -213,7 +213,7 @@ class cXinelibDevice : public cDevice void ConfigurePostprocessing(const char *name, bool on=true, const char *args=NULL); void ConfigureVideo(int hue, int saturation, int brightness, int contrast, - int overscan); + int overscan, int vo_aspect_ratio); // local mode: void ConfigureWindow(int fullscreen, int width, int height, int modeswitch, const char *modeline, diff --git a/frontend.c b/frontend.c index 3befe5aa..e3413f28 100644 --- a/frontend.c +++ b/frontend.c @@ -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.44 2008-02-05 00:30:48 phintuka Exp $ + * $Id: frontend.c,v 1.45 2008-02-19 00:43:04 phelin Exp $ * */ @@ -804,13 +804,13 @@ int cXinelibThread::ConfigurePostprocessing(const char *name, bool on, const cha int cXinelibThread::ConfigureVideo(int hue, int saturation, int brightness, int contrast, - int overscan) + int overscan, int vo_aspect_ratio) { char cmd[128]; Xine_Control("OVERSCAN", overscan); snprintf(cmd, sizeof(cmd), - "VIDEO_PROPERTIES %d %d %d %d", - hue, saturation, brightness, contrast); + "VIDEO_PROPERTIES %d %d %d %d %d", + hue, saturation, brightness, contrast, vo_aspect_ratio); return Xine_Control(cmd); } diff --git a/frontend.h b/frontend.h index ac265eee..9137074c 100644 --- a/frontend.h +++ b/frontend.h @@ -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.17 2008-01-09 08:44:15 phintuka Exp $ + * $Id: frontend.h,v 1.18 2008-02-19 00:43:04 phelin Exp $ * */ @@ -117,7 +117,7 @@ class cXinelibThread : public cThread, public cListObject virtual int ConfigurePostprocessing(const char *name, bool on, const char *args); virtual int ConfigureVideo(int hue, int saturation, int brightness, int contrast, - int overscan); + int overscan, int vo_aspect_ratio); // 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 f45c9907..b23461e3 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.27 2007-05-18 15:09:42 phintuka Exp $ + * $Id: frontend_local.c,v 1.28 2008-02-19 00:43:04 phelin Exp $ * */ @@ -400,7 +400,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, xc.overscan); + ConfigureVideo(xc.hue, xc.saturation, xc.brightness, xc.contrast, xc.overscan, xc.vo_aspect_ratio); 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 2b65a74e..ae66d285 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.48 2008-01-09 08:44:15 phintuka Exp $ + * $Id: frontend_svr.c,v 1.49 2008-02-19 00:43:04 phelin Exp $ * */ @@ -1159,7 +1159,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, xc.overscan); + ConfigureVideo(xc.hue, xc.saturation, xc.brightness, xc.contrast, xc.overscan, xc.vo_aspect_ratio); ConfigurePostprocessing("upmix", xc.audio_upmix ? true : false, NULL); ConfigurePostprocessing("autocrop", xc.autocrop ? true : false, xc.AutocropOptions()); diff --git a/i18n.c b/i18n.c index 81d75dce..010e3b66 100644 --- a/i18n.c +++ b/i18n.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: i18n.c,v 1.31 2008-02-19 00:18:20 phelin Exp $ + * $Id: i18n.c,v 1.32 2008-02-19 00:43:04 phelin Exp $ * * Translations provided by: * @@ -3491,6 +3491,64 @@ const tI18nPhrase Phrases[] = { "", // Russian "", // Croatian }, + { "Video aspect ratio", // English + "", // Deutsch + "", // Slovenski + "", // Italiano + "", // Nederlands + "", // Portugus + "", // Franais + "", // Norsk + "Videon kuvasuhde", // Suomi + "", // Polski + "", // Espaol + "", // Ellinika + "", // Svenska + "", // Romaneste + "", // Magyar + "", // Catala + "", // Russian + "", // Croatian + }, + { "square", // English + "", // Deutsch + "", // Slovenski + "", // Italiano + "", // Nederlands + "", // Portugus + "", // Franais + "", // Norsk + "neliö", // Suomi + "", // Polski + "", // Espaol + "", // Ellinika + "", // Svenska + "", // Romaneste + "", // Magyar + "", // Catala + "", // Russian + "", // Croatian + }, + { "anamorphic", // English + "", // Deutsch + "", // Slovenski + "", // Italiano + "", // Nederlands + "", // Portugus + "", // Franais + "", // Norsk + "anamorfinen", // Suomi + "", // Polski + "", // Espaol + "", // Ellinika + "", // Svenska + "", // Romaneste + "", // Magyar + "", // Catala + "", // Russian + "", // Croatian + }, + { NULL } }; diff --git a/menu.c b/menu.c index 9bc21af5..15dd51f8 100644 --- a/menu.c +++ b/menu.c @@ -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.45 2008-02-19 00:38:51 phelin Exp $ + * $Id: menu.c,v 1.46 2008-02-19 00:43:04 phelin Exp $ * */ @@ -43,6 +43,7 @@ symlink $(CONFDIR)/plugins/xineliboutput/default_playlist */ # define HOTKEY_ADELAY_UP kUp /* audio delay up */ # define HOTKEY_ADELAY_DOWN kDown /* audio delay down */ +# define HOTKEY_TOGGLE_VO_ASPECT kRight #endif //#define OLD_SPU_MENU @@ -750,7 +751,7 @@ cMenuXinelib::~cMenuXinelib() if(xc.overscan != overscan) cXinelibDevice::Instance().ConfigureVideo(xc.hue, xc.saturation, xc.brightness, - xc.contrast, xc.overscan); + xc.contrast, xc.overscan, xc.vo_aspect_ratio); if(xc.headphone != headphone) cXinelibDevice::Instance().ConfigurePostprocessing("headphone", @@ -839,7 +840,7 @@ eOSState cMenuXinelib::ProcessKey(eKeys Key) xc.audio_surround, xc.speaker_type); else if(item == ctrl_overscan) cXinelibDevice::Instance().ConfigureVideo(xc.hue, xc.saturation, xc.brightness, - xc.contrast, overscan); + xc.contrast, overscan, xc.vo_aspect_ratio); } if(Key==kLeft || Key==kRight) { if(item == ctrl_headphone) @@ -988,6 +989,18 @@ eOSState cMenuXinelib::ProcessHotkey(eKeys Key) tr(xc.s_aspects[xc.display_aspect])); break; + case HOTKEY_TOGGLE_VO_ASPECT: + /* auto, square, 4:3, anamorphic or DVB */ + if(!OnlyInfo) { + xc.vo_aspect_ratio = (xc.vo_aspect_ratio < VO_ASPECT_count-1) ? xc.vo_aspect_ratio + 1 : 0; + cXinelibDevice::Instance().ConfigureVideo(xc.hue, xc.saturation, xc.brightness, + xc.contrast, xc.overscan, xc.vo_aspect_ratio); + } + asprintf(&Message, "%s %s %s", tr("Video aspect ratio"), + OnlyInfo ? ":" : "->", + tr(xc.s_vo_aspects[xc.vo_aspect_ratio])); + break; + case HOTKEY_TOGGLE_CROP: /* off, force, auto */ if(!OnlyInfo) { diff --git a/po/de_DE.po b/po/de_DE.po index d8994ef6..51114544 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -45,6 +45,15 @@ msgstr "Pan&Scan" msgid "CenterCutOut" msgstr "CenterCutOut" +msgid "square" +msgstr "" + +msgid "anamorphic" +msgstr "" + +msgid "DVB" +msgstr "" + msgid "off" msgstr "Aus" @@ -252,6 +261,9 @@ msgstr "Lokale Anzeige" msgid "Aspect ratio" msgstr "Seitenverhältnis" +msgid "Video aspect ratio" +msgstr "" + msgid "On" msgstr "" diff --git a/po/fi_FI.po b/po/fi_FI.po index c7e908ab..7cf8c8e7 100644 --- a/po/fi_FI.po +++ b/po/fi_FI.po @@ -46,6 +46,15 @@ msgstr "Pan&Scan" msgid "CenterCutOut" msgstr "CenterCutOut" +msgid "square" +msgstr "neliö" + +msgid "anamorphic" +msgstr "anamorfinen" + +msgid "DVB" +msgstr "" + msgid "off" msgstr "ei käytössä" @@ -253,6 +262,9 @@ msgstr "Paikallinen n msgid "Aspect ratio" msgstr "Kuvasuhde" +msgid "Video aspect ratio" +msgstr "Videon kuvasuhde" + msgid "On" msgstr "" diff --git a/po/it_IT.po b/po/it_IT.po index 3c1b57e3..616de107 100644 --- a/po/it_IT.po +++ b/po/it_IT.po @@ -44,6 +44,15 @@ msgstr "Pan&Scan" msgid "CenterCutOut" msgstr "CenterCutOut" +msgid "square" +msgstr "" + +msgid "anamorphic" +msgstr "" + +msgid "DVB" +msgstr "" + msgid "off" msgstr "spento" @@ -251,6 +260,9 @@ msgstr "Frontend locale" msgid "Aspect ratio" msgstr "Proporzioni" +msgid "Video aspect ratio" +msgstr "" + msgid "On" msgstr "Attivo" diff --git a/po/ru_RU.po b/po/ru_RU.po index ae22a96e..9ccdf253 100644 --- a/po/ru_RU.po +++ b/po/ru_RU.po @@ -45,6 +45,15 @@ msgstr "Pan&Scan" msgid "CenterCutOut" msgstr "" +msgid "square" +msgstr "" + +msgid "anamorphic" +msgstr "" + +msgid "DVB" +msgstr "" + msgid "off" msgstr "²ëÚÛ." @@ -252,6 +261,9 @@ msgstr " msgid "Aspect ratio" msgstr "" +msgid "Video aspect ratio" +msgstr "" + msgid "On" msgstr "" diff --git a/setup_menu.c b/setup_menu.c index d005f3bd..331a9da5 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.43 2008-02-05 00:34:34 phintuka Exp $ + * $Id: setup_menu.c,v 1.44 2008-02-19 00:43:04 phelin Exp $ * */ @@ -495,6 +495,7 @@ class cMenuSetupVideo : public cMenuSetupPage cOsdItem *ctrl_tvtime_method; cOsdItem *ctrl_unsharp; cOsdItem *ctrl_denoise3d; + cOsdItem *ctrl_vo_aspect_ratio; int deinterlace; struct tvtime_s tvtime; @@ -530,7 +531,7 @@ cMenuSetupVideo::~cMenuSetupVideo(void) { cXinelibDevice::Instance().ConfigureVideo(xc.hue, xc.saturation, xc.brightness, xc.contrast, - xc.overscan); + xc.overscan, xc.vo_aspect_ratio); cXinelibDevice::Instance().ConfigurePostprocessing( "autocrop", xc.autocrop ? true : false, xc.AutocropOptions()); cXinelibDevice::Instance().ConfigurePostprocessing( @@ -552,6 +553,10 @@ void cMenuSetupVideo::Set(void) Add(NewTitle(tr("Video"))); + Add(ctrl_vo_aspect_ratio = + new cMenuEditStraI18nItem(tr("Aspect ratio"), &newconfig.vo_aspect_ratio, + VO_ASPECT_count, xc.s_vo_aspects)); + Add(ctrl_autocrop = new cMenuEditBoolItem(tr("Crop letterbox 4:3 to 16:9"), &newconfig.autocrop)); @@ -679,20 +684,21 @@ eOSState cMenuSetupVideo::ProcessKey(eKeys Key) if(item == ctrl_hue || item == ctrl_saturation || item == ctrl_contrast || item == ctrl_brightness || - item == ctrl_overscan) + item == ctrl_overscan || item == ctrl_vo_aspect_ratio) #ifdef INTEGER_CONFIG_VIDEO_CONTROLS cXinelibDevice::Instance().ConfigureVideo(newconfig.hue, newconfig.saturation, newconfig.brightness, newconfig.contrast, - newconfig.overscan); + newconfig.overscan, + newconfig.vo_aspect_ratio); #else cXinelibDevice::Instance().ConfigureVideo( INDEX_TO_CONTROL(newconfig.hue), INDEX_TO_CONTROL(newconfig.saturation), INDEX_TO_CONTROL(newconfig.brightness), INDEX_TO_CONTROL(newconfig.contrast), - newconfig.overscan); + newconfig.overscan, newconfig.vo_aspect_ratio); #endif else if(item == ctrl_autocrop) { cXinelibDevice::Instance().ConfigurePostprocessing( @@ -758,6 +764,7 @@ void cMenuSetupVideo::Store(void) SetupStore("Video.Overscan", xc.overscan); SetupStore("Video.IBPTrickSpeed", xc.ibp_trickspeed); SetupStore("Video.MaxTrickSpeed", xc.max_trickspeed); + SetupStore("Video.AspectRatio", xc.vo_aspect_ratio); SetupStore("Post.pp.Enable", xc.ffmpeg_pp); SetupStore("Post.pp.Quality", xc.ffmpeg_pp_quality); SetupStore("Post.pp.Mode", xc.ffmpeg_pp_mode); @@ -1682,7 +1689,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, xc.overscan); + cXinelibDevice::Instance().ConfigureVideo(xc.hue, xc.saturation, br, co, xc.overscan, xc.vo_aspect_ratio); m_Osd->Flush(); return osContinue; case kUp: @@ -1691,7 +1698,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, xc.overscan); + cXinelibDevice::Instance().ConfigureVideo(xc.hue, xc.saturation, br, co, xc.overscan, xc.vo_aspect_ratio); m_Osd->Flush(); return osContinue; } diff --git a/xine_frontend.c b/xine_frontend.c index ff6b7ea4..330187df 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.47 2008-01-03 20:06:27 phintuka Exp $ + * $Id: xine_frontend.c,v 1.48 2008-02-19 00:43:04 phelin Exp $ * */ @@ -1414,6 +1414,11 @@ static void *fe_control(void *fe_handle, const char *cmd) /* trigger forced redraw to make changes effective */ xine_set_param(this->stream, XINE_PARAM_VO_ZOOM_X, 100); } + } else if(!strncmp(cmd, "VO_ASPECT ", 10)) { + int vo_aspect_ratio; + if(1 == sscanf(cmd+10, "%d", &vo_aspect_ratio)) { + xine_set_param(this->stream, XINE_PARAM_VO_ASPECT_RATIO, vo_aspect_ratio); + } } diff --git a/xine_input_vdr.c b/xine_input_vdr.c index 82985997..186b1499 100644 --- a/xine_input_vdr.c +++ b/xine_input_vdr.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xine_input_vdr.c,v 1.113 2008-01-24 21:18:09 phelin Exp $ + * $Id: xine_input_vdr.c,v 1.114 2008-02-19 00:43:04 phelin Exp $ * */ @@ -304,6 +304,7 @@ typedef struct vdr_input_plugin_s { int orig_brightness; int orig_saturation; int orig_contrast; + int orig_vo_aspect_ratio; /* OSD */ pthread_mutex_t osd_lock; @@ -2478,13 +2479,15 @@ static int set_deinterlace_method(vdr_input_plugin_t *this, const char *method_n static int set_video_properties(vdr_input_plugin_t *this, int hue, int saturation, - int brightness, int contrast) + int brightness, int contrast, + int vo_aspect_ratio) { pthread_mutex_lock(&this->lock); /* when changed first time, save original/default values */ if(!this->video_properties_saved && - (hue>=0 || saturation>=0 || contrast>=0 || brightness>=0)) { + (hue>=0 || saturation>=0 || contrast>=0 || brightness>=0 || + vo_aspect_ratio>=0)) { this->video_properties_saved = 1; this->orig_hue = xine_get_param(this->stream, XINE_PARAM_VO_HUE ); @@ -2494,6 +2497,8 @@ static int set_video_properties(vdr_input_plugin_t *this, XINE_PARAM_VO_BRIGHTNESS ); this->orig_contrast = xine_get_param(this->stream, XINE_PARAM_VO_CONTRAST ); + this->orig_vo_aspect_ratio = xine_get_param(this->stream, + XINE_PARAM_VO_ASPECT_RATIO ); } /* set new values, or restore default/original values */ @@ -2509,8 +2514,11 @@ static int set_video_properties(vdr_input_plugin_t *this, if(contrast>=0 || this->video_properties_saved) xine_set_param(this->stream, XINE_PARAM_VO_CONTRAST, contrast>=0 ? contrast : this->orig_contrast ); + if(vo_aspect_ratio>=0 || this->video_properties_saved) + xine_set_param(this->stream, XINE_PARAM_VO_ASPECT_RATIO, + vo_aspect_ratio>=0 ? vo_aspect_ratio : this->orig_vo_aspect_ratio ); - if(hue<0 && saturation<0 && contrast<0 && brightness<0) + if(hue<0 && saturation<0 && contrast<0 && brightness<0 && vo_aspect_ratio<0) this->video_properties_saved = 0; pthread_mutex_unlock(&this->lock); @@ -3419,10 +3427,10 @@ static int vdr_plugin_parse_control(input_plugin_t *this_gen, const char *cmd) err = handle_control_osdcmd(this); } else if(!strncasecmp(cmd, "VIDEO_PROPERTIES ", 17)) { - int hue, saturation, brightness, contrast; - if(4 == sscanf(cmd, "VIDEO_PROPERTIES %d %d %d %d", - &hue, &saturation, &brightness, &contrast)) - err = set_video_properties(this, hue, saturation, brightness, contrast); + int hue, saturation, brightness, contrast, vo_aspect_ratio; + if(5 == sscanf(cmd, "VIDEO_PROPERTIES %d %d %d %d %d", + &hue, &saturation, &brightness, &contrast, &vo_aspect_ratio)) + err = set_video_properties(this, hue, saturation, brightness, contrast, vo_aspect_ratio); else err = CONTROL_PARAM_ERROR; @@ -3432,6 +3440,12 @@ static int vdr_plugin_parse_control(input_plugin_t *this_gen, const char *cmd) else this->funcs.fe_control(this->funcs.fe_handle, cmd); + } else if(!strncasecmp(cmd, "VO_ASPECT ", 10)) { + if(1 == sscanf(cmd, "VO_ASPECT %d", &tmp32)) { + xine_set_param(stream, XINE_PARAM_VO_ASPECT_RATIO, tmp32); + } else + err = CONTROL_PARAM_ERROR; + } else if(!strncasecmp(cmd, "DEINTERLACE ", 12)) { if(this->fd_control < 0) err = set_deinterlace_method(this, cmd+12); @@ -5436,7 +5450,7 @@ static void vdr_plugin_dispose (input_plugin_t *this_gen) /* restore video properties */ if(this->video_properties_saved) - set_video_properties(this, -1,-1,-1,-1); /* restore defaults */ + set_video_properties(this, -1,-1,-1,-1,-1); /* restore defaults */ signal_buffer_pool_not_empty(this); signal_buffer_not_empty(this); -- cgit v1.2.3