diff --git a/lib/libcoolstream2/cs_api.h b/lib/libcoolstream2/cs_api.h index fe1b463da..bbb03eb46 100644 --- a/lib/libcoolstream2/cs_api.h +++ b/lib/libcoolstream2/cs_api.h @@ -49,6 +49,7 @@ enum CS_LOG_MODULE { // Initialization void cs_api_init(void); void cs_api_exit(void); +void cs_new_auto_videosystem(); // Memory helpers void *cs_malloc_uncached(size_t size); diff --git a/lib/libcoolstream2/video_cs.h b/lib/libcoolstream2/video_cs.h index 6c1da4931..3bfa62793 100644 --- a/lib/libcoolstream2/video_cs.h +++ b/lib/libcoolstream2/video_cs.h @@ -190,6 +190,7 @@ private: analog_mode_t analog_mode_scart; fp_icon mode_icon; cDemux *demux; + int current_video_system; // int SelectAutoFormat(); void ScalePic(); @@ -244,6 +245,7 @@ public: int Flush(void); /* set video_system */ + int GetVideoSystem(); int SetVideoSystem(int video_system, bool remember = true); int SetStreamType(VIDEO_FORMAT type); void SetSyncMode(AVSYNC_TYPE mode); diff --git a/src/driver/fb_accel_cs_hd1.cpp b/src/driver/fb_accel_cs_hd1.cpp index cfc1b8cc4..46cc19c12 100644 --- a/src/driver/fb_accel_cs_hd1.cpp +++ b/src/driver/fb_accel_cs_hd1.cpp @@ -344,6 +344,7 @@ void CFbAccelCSHD1::setOsdResolutions() res.xRes = 1280; res.yRes = 720; res.bpp = 32; + res.mode = OSDMODE_720; osd_resolutions.push_back(res); } diff --git a/src/driver/fb_accel_cs_hd2.cpp b/src/driver/fb_accel_cs_hd2.cpp index e1143eea7..ed42473a3 100644 --- a/src/driver/fb_accel_cs_hd2.cpp +++ b/src/driver/fb_accel_cs_hd2.cpp @@ -215,11 +215,13 @@ void CFbAccelCSHD2::setOsdResolutions() res.xRes = 1280; res.yRes = 720; res.bpp = 32; + res.mode = OSDMODE_720; osd_resolutions.push_back(res); if (fullHdAvailable()) { res.xRes = 1920; res.yRes = 1080; res.bpp = 32; + res.mode = OSDMODE_1080; osd_resolutions.push_back(res); } } diff --git a/src/driver/fb_accel_cs_hdx_inc.h b/src/driver/fb_accel_cs_hdx_inc.h index cd38baa72..da858312e 100644 --- a/src/driver/fb_accel_cs_hdx_inc.h +++ b/src/driver/fb_accel_cs_hdx_inc.h @@ -32,6 +32,7 @@ #include #include #include +#include #include #include diff --git a/src/driver/fb_generic.cpp b/src/driver/fb_generic.cpp index e8a5274b1..0fd7e0ee4 100644 --- a/src/driver/fb_generic.cpp +++ b/src/driver/fb_generic.cpp @@ -46,6 +46,7 @@ #include #include +#include #include #include #include @@ -367,9 +368,22 @@ void CFrameBuffer::setOsdResolutions() res.xRes = 1280; res.yRes = 720; res.bpp = 32; + res.mode = OSDMODE_720; osd_resolutions.push_back(res); } +size_t CFrameBuffer::getIndexOsdResolution(uint32_t mode) +{ + if (osd_resolutions.size() == 1) + return 0; + + for (size_t i = 0; i < osd_resolutions.size(); i++) { + if (osd_resolutions[i].mode == mode) + return i; + } + return 0; +} + #if 0 //never used void CFrameBuffer::setTransparency( int /*tr*/ ) diff --git a/src/driver/fb_generic.h b/src/driver/fb_generic.h index ffa96fdc2..ec47f0b28 100644 --- a/src/driver/fb_generic.h +++ b/src/driver/fb_generic.h @@ -44,6 +44,7 @@ typedef struct osd_resolution_t uint32_t yRes; uint32_t xRes; uint32_t bpp; + uint32_t mode; } osd_resolution_struct_t; typedef struct gradientData_t @@ -284,6 +285,7 @@ class CFrameBuffer : public sigc::trackable virtual bool fullHdAvailable() { return false; }; virtual void setOsdResolutions(); std::vector osd_resolutions; + size_t getIndexOsdResolution(uint32_t mode); //NI void clearIconCache(); diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index dd16a9d55..2b1ba6fc1 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -79,6 +79,7 @@ libneutrino_gui_a_SOURCES = \ nfs.cpp \ ni_menu.cpp \ opkg_manager.cpp \ + osd_helpers.cpp \ osd_progressbar_setup.cpp \ osd_setup.cpp \ osdlang_setup.cpp \ diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index ea7d5891c..26c3a01b5 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -726,15 +726,15 @@ void CInfoViewer::check_channellogo_ca_SettingsChange() } } -void CInfoViewer::showTitle(t_channel_id chid, const bool calledFromNumZap, int epgpos) +void CInfoViewer::showTitle(t_channel_id chid, const bool calledFromNumZap, int epgpos, bool forcePaintButtonBar/*=false*/) { CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(chid); if(channel) - showTitle(channel, calledFromNumZap, epgpos); + showTitle(channel, calledFromNumZap, epgpos, forcePaintButtonBar); } -void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap, int epgpos) +void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap, int epgpos, bool forcePaintButtonBar/*=false*/) { if(!calledFromNumZap && !(zap_mode & IV_MODE_DEFAULT)) resetSwitchMode(); @@ -758,7 +758,8 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap check_channellogo_ca_SettingsChange(); aspectRatio = 0; last_curr_id = last_next_id = 0; - showButtonBar = !calledFromNumZap; + showButtonBar = (!calledFromNumZap || forcePaintButtonBar); + bool noTimer = (calledFromNumZap && forcePaintButtonBar); fileplay = (ChanNum == 0); newfreq = true; @@ -820,7 +821,7 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap InfoIcons->paintIcons(true); if (showButtonBar) { - infoViewerBB->paintshowButtonBar(); + infoViewerBB->paintshowButtonBar(noTimer); } int ChanNumWidth = 0; diff --git a/src/gui/infoviewer.h b/src/gui/infoviewer.h index e64cbaf2e..5fbcb9802 100644 --- a/src/gui/infoviewer.h +++ b/src/gui/infoviewer.h @@ -184,8 +184,8 @@ class CInfoViewer void start(); void showEpgInfo(); - void showTitle(CZapitChannel * channel, const bool calledFromNumZap = false, int epgpos = 0); - void showTitle(t_channel_id channel_id, const bool calledFromNumZap = false, int epgpos = 0); + void showTitle(CZapitChannel * channel, const bool calledFromNumZap = false, int epgpos = 0, bool forcePaintButtonBar = false); + void showTitle(t_channel_id channel_id, const bool calledFromNumZap = false, int epgpos = 0, bool forcePaintButtonBar = false); void lookAheadEPG(const int ChanNum, const std::string & Channel, const t_channel_id new_channel_id = 0, const bool calledFromNumZap = false); //alpha: fix for nvod subchannel update void killTitle(); CSectionsdClient::CurrentNextInfo getEPG(const t_channel_id for_channel_id, CSectionsdClient::CurrentNextInfo &info); diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 2606320f2..84df919a9 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -475,7 +475,7 @@ void CInfoViewerBB::showBBIcons(const int modus, const std::string & icon) } } -void CInfoViewerBB::paintshowButtonBar() +void CInfoViewerBB::paintshowButtonBar(bool noTimer/*=false*/) { if (!is_visible) return; @@ -483,7 +483,9 @@ void CInfoViewerBB::paintshowButtonBar() for (int i = 0; i < CInfoViewerBB::BUTTON_MAX; i++) { tmp_bbButtonInfoText[i] = ""; } - g_InfoViewer->sec_timer_id = g_RCInput->addTimer(1*1000*1000, false); + + if (!noTimer) + g_InfoViewer->sec_timer_id = g_RCInput->addTimer(1*1000*1000, false); if (g_settings.infobar_casystem_display < 2) paint_ca_bar(); diff --git a/src/gui/infoviewer_bb.h b/src/gui/infoviewer_bb.h index c6861d73d..fb067eac6 100644 --- a/src/gui/infoviewer_bb.h +++ b/src/gui/infoviewer_bb.h @@ -150,7 +150,7 @@ class CInfoViewerBB void showIcon_Tuner(void); void showIcon_DD(void); void showBBButtons(bool paintFooter = false); - void paintshowButtonBar(); + void paintshowButtonBar(bool noTimer = false); void getBBButtonInfo(void); void reset_allScala(void); void initBBOffset(void); diff --git a/src/gui/osd_helpers.cpp b/src/gui/osd_helpers.cpp new file mode 100644 index 000000000..c06563f5a --- /dev/null +++ b/src/gui/osd_helpers.cpp @@ -0,0 +1,183 @@ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include + +extern CInfoClock *InfoClock; +extern CTimeOSD *FileTimeOSD; +extern cVideo *videoDecoder; + +COsdHelpers::COsdHelpers() +{ + g_settings_osd_resolution_save = 0; +} + +COsdHelpers::~COsdHelpers() +{ +} + +COsdHelpers* COsdHelpers::getInstance() +{ + static COsdHelpers* osdh = NULL; + if(!osdh) + osdh = new COsdHelpers(); + + return osdh; +} + +#ifdef ENABLE_CHANGE_OSD_RESOLUTION +void COsdHelpers::changeOsdResolution(uint32_t mode, bool automode/*=false*/, bool forceOsdReset/*=false*/) +{ + size_t idx = 0; + bool resetOsd = false; + uint32_t modeNew; + + CFrameBuffer *frameBuffer = CFrameBuffer::getInstance(); + + if (automode) { + if (g_settings.video_Mode == VIDEO_STD_AUTO) + modeNew = OSDMODE_1080; + else + modeNew = g_settings_osd_resolution_save; + } + else { + modeNew = mode; + } + + int videoSystem = getVideoSystem(); + if (!isVideoSystem1080(videoSystem)) + modeNew = OSDMODE_720; + idx = frameBuffer->getIndexOsdResolution(modeNew); + resetOsd = (modeNew != getOsdResolution()) ? true : false; + + if (forceOsdReset) + resetOsd = true; + + if (frameBuffer->fullHdAvailable()) { + if (frameBuffer->osd_resolutions.empty()) + return; + + bool ivVisible = false; + if (g_InfoViewer && g_InfoViewer->is_visible) { + g_InfoViewer->killTitle(); + ivVisible = true; + } + + int switchFB = frameBuffer->setMode(frameBuffer->osd_resolutions[idx].xRes, + frameBuffer->osd_resolutions[idx].yRes, + frameBuffer->osd_resolutions[idx].bpp); + + if (switchFB == 0) { +//printf("\n>>>>>[%s:%d] New res: %dx%dx%d\n \n", __func__, __LINE__, resW, resH, bpp); + g_settings.osd_resolution = modeNew; + if (InfoClock) + InfoClock->enableInfoClock(false); + frameBuffer->Clear(); + if (resetOsd) { + CNeutrinoApp::getInstance()->setScreenSettings(); + CNeutrinoApp::getInstance()->SetupFonts(CNeutrinoFonts::FONTSETUP_NEUTRINO_FONT); + CVolumeHelper::getInstance()->refresh(); + if (InfoClock) + CInfoClock::getInstance()->ClearDisplay(); + if (FileTimeOSD) + FileTimeOSD->Init(); + if (CNeutrinoApp::getInstance()->channelList) + CNeutrinoApp::getInstance()->channelList->ResetModules(); + } + if (InfoClock) + InfoClock->enableInfoClock(true); + } + if (g_InfoViewer) { + g_InfoViewer->ResetModules(); + g_InfoViewer->start(); + } + if (ivVisible) { + CNeutrinoApp::getInstance()->StopSubtitles(); + g_InfoViewer->showTitle(CNeutrinoApp::getInstance()->channelList->getActiveChannel(), true, 0, true); + CNeutrinoApp::getInstance()->StartSubtitles(); + } + } +} + +void COsdHelpers::resetOsdResolution(int newSystem) +{ + int videoSystem = getVideoSystem(); + if ((isVideoSystem1080(videoSystem)) && (!isVideoSystem1080(newSystem))) { + CFrameBuffer::getInstance()->setMode(1280, 720, 32); + } +} +#else +void COsdHelpers::changeOsdResolution(uint32_t, bool, bool) +{ +} + +void COsdHelpers::resetOsdResolution(int) +{ +} +#endif + + +int COsdHelpers::isVideoSystem1080(int res) +{ + if ((res == VIDEO_STD_1080I60) || + (res == VIDEO_STD_1080I50) || + (res == VIDEO_STD_1080P30) || + (res == VIDEO_STD_1080P24) || + (res == VIDEO_STD_1080P25)) + return true; + +#ifdef BOXMODEL_CS_HD2 + if ((res == VIDEO_STD_1080P50) || + (res == VIDEO_STD_1080P60) || + (res == VIDEO_STD_1080P2397) || + (res == VIDEO_STD_1080P2997)) + return true; +#endif + +#if 0 + /* for testing only */ + if (res == VIDEO_STD_720P50) + return true; +#endif + + return false; +} + +#ifdef ENABLE_CHANGE_OSD_RESOLUTION +int COsdHelpers::getVideoSystem() +{ + return videoDecoder->GetVideoSystem(); +} +#else +int COsdHelpers::getVideoSystem() +{ + return g_settings.video_Mode; +} +#endif + +uint32_t COsdHelpers::getOsdResolution() +{ + CFrameBuffer *frameBuffer = CFrameBuffer::getInstance(); + if (frameBuffer->osd_resolutions.size() == 1) + return 0; + + uint32_t yRes = frameBuffer->getScreenHeight(true); + for (size_t i = 0; i < frameBuffer->osd_resolutions.size(); i++) { + if (frameBuffer->osd_resolutions[i].yRes == yRes) + return frameBuffer->osd_resolutions[i].mode; + } + return 0; +} diff --git a/src/gui/osd_helpers.h b/src/gui/osd_helpers.h new file mode 100644 index 000000000..d2c735e50 --- /dev/null +++ b/src/gui/osd_helpers.h @@ -0,0 +1,29 @@ + +#ifndef __osd_helpers__ +#define __osd_helpers__ + +enum { + OSDMODE_720 = 0, + OSDMODE_1080 = 1 +}; + +class COsdHelpers +{ + private: + + public: + COsdHelpers(); + ~COsdHelpers(); + static COsdHelpers* getInstance(); + + int g_settings_osd_resolution_save; + + void changeOsdResolution(uint32_t mode, bool automode=false, bool forceOsdReset=false); + void resetOsdResolution(int newSystem); + int isVideoSystem1080(int res); + int getVideoSystem(); + uint32_t getOsdResolution(); +}; + + +#endif //__osd_helpers__ diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 9a2d675e0..a0fa45688 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -39,6 +39,7 @@ #include #include "osd_setup.h" +#include "osd_helpers.h" #include "themes.h" #include "screensetup.h" #include "osdlang_setup.h" @@ -680,7 +681,11 @@ int COsdSetup::showOsdSetup() kext[0].valname = "-"; resCount = 1; } - CMenuOptionChooser * osd_res = new CMenuOptionChooser(LOCALE_COLORMENU_OSD_RESOLUTION, &g_settings.osd_resolution, kext, resCount, (resCount>1), this); + int videoSystem = COsdHelpers::getInstance()->getVideoSystem(); + bool enable = ((resCount > 1) && + COsdHelpers::getInstance()->isVideoSystem1080(videoSystem) && + (g_settings.video_Mode != VIDEO_STD_AUTO)); + CMenuOptionChooser * osd_res = new CMenuOptionChooser(LOCALE_COLORMENU_OSD_RESOLUTION, &g_settings.osd_resolution, kext, resCount, enable, this); osd_res->setHint("", LOCALE_MENU_HINT_OSD_RESOLUTION); osd_menu->addItem(osd_res); #endif @@ -1495,6 +1500,13 @@ bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data) #ifdef ENABLE_CHANGE_OSD_RESOLUTION else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_COLORMENU_OSD_RESOLUTION)) { + if (frameBuffer->osd_resolutions.empty()) + return true; + osd_menu->hide(); + uint32_t osd_mode = (uint32_t)*(int*)data; + COsdHelpers::getInstance()->g_settings_osd_resolution_save = osd_mode; + COsdHelpers::getInstance()->changeOsdResolution(osd_mode); +#if 0 if (frameBuffer->fullHdAvailable()) { if (frameBuffer->osd_resolutions.empty()) return true; @@ -1524,6 +1536,7 @@ bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data) g_InfoViewer->ResetModules(); } } +#endif return true; } #endif diff --git a/src/gui/videosettings.cpp b/src/gui/videosettings.cpp index 9a013a6af..6cb14bcd4 100644 --- a/src/gui/videosettings.cpp +++ b/src/gui/videosettings.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -412,7 +413,9 @@ void CVideoSettings::setVideoSettings() void CVideoSettings::setupVideoSystem(bool do_ask) { printf("[neutrino VideoSettings] %s setup videosystem...\n", __FUNCTION__); + COsdHelpers::getInstance()->resetOsdResolution(g_settings.video_Mode); videoDecoder->SetVideoSystem(g_settings.video_Mode); //FIXME + COsdHelpers::getInstance()->changeOsdResolution(0, true, true); if (do_ask) { @@ -422,7 +425,9 @@ void CVideoSettings::setupVideoSystem(bool do_ask) if (ShowMsg(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_VIDEO_MODE_OK), CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_INFO) != CMsgBox::mbrYes) { g_settings.video_Mode = prev_video_mode; + COsdHelpers::getInstance()->resetOsdResolution(g_settings.video_Mode); videoDecoder->SetVideoSystem(g_settings.video_Mode); + COsdHelpers::getInstance()->changeOsdResolution(0, true, true); } else prev_video_mode = g_settings.video_Mode; @@ -606,7 +611,9 @@ void CVideoSettings::nextMode(void) else if(res == messages_return::cancel_info) { g_settings.video_Mode = VIDEOMENU_VIDEOMODE_OPTIONS[curmode].key; //CVFD::getInstance()->ShowText(text); + COsdHelpers::getInstance()->resetOsdResolution(g_settings.video_Mode); videoDecoder->SetVideoSystem(g_settings.video_Mode); + COsdHelpers::getInstance()->changeOsdResolution(0, true, true); //return; disp_cur = 1; } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index aa2a1803a..f47ada581 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -81,6 +81,7 @@ #include "gui/infoviewer.h" #include "gui/mediaplayer.h" #include "gui/movieplayer.h" +#include "gui/osd_helpers.h" #include "gui/osd_setup.h" #include "gui/osdlang_setup.h" #include "gui/pictureviewer.h" @@ -237,6 +238,7 @@ CNeutrinoApp::CNeutrinoApp() { standby_pressed_at.tv_sec = 0; osd_resolution_tmp = -1; + frameBufferInitialized = false; frameBuffer = CFrameBuffer::getInstance(); frameBuffer->setIconBasePath(ICONSDIR); @@ -777,6 +779,7 @@ int CNeutrinoApp::loadSetup(const char * fname) //screen configuration g_settings.osd_resolution = (osd_resolution_tmp == -1) ? configfile.getInt32("osd_resolution", 0) : osd_resolution_tmp; + COsdHelpers::getInstance()->g_settings_osd_resolution_save = g_settings.osd_resolution; g_settings.screen_StartX_crt_0 = configfile.getInt32("screen_StartX_crt_0", 80); g_settings.screen_StartY_crt_0 = configfile.getInt32("screen_StartY_crt_0", 45); g_settings.screen_EndX_crt_0 = configfile.getInt32("screen_EndX_crt_0" , 1280 - g_settings.screen_StartX_crt_0 - 1); @@ -1468,7 +1471,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("channellist_show_numbers", g_settings.channellist_show_numbers); //screen configuration - configfile.setInt32("osd_resolution" , g_settings.osd_resolution); + configfile.setInt32("osd_resolution" , COsdHelpers::getInstance()->g_settings_osd_resolution_save); configfile.setInt32("screen_StartX_lcd_0", g_settings.screen_StartX_lcd_0); configfile.setInt32("screen_StartY_lcd_0", g_settings.screen_StartY_lcd_0); configfile.setInt32("screen_EndX_lcd_0" , g_settings.screen_EndX_lcd_0); @@ -1979,6 +1982,7 @@ void CNeutrinoApp::CmdParser(int argc, char **argv) /************************************************************************************** * CNeutrinoApp - setup the framebuffer * **************************************************************************************/ + void CNeutrinoApp::SetupFrameBuffer() { frameBuffer->init(); @@ -2007,6 +2011,10 @@ void CNeutrinoApp::SetupFrameBuffer() frameBuffer->osd_resolutions[ort].yRes, frameBuffer->osd_resolutions[ort].bpp); +/* + setFbMode = 0; + COsdHelpers::getInstance()->changeOsdResolution(0, true); +*/ #else /* all other hardware ignores setMode parameters */ setFbMode = frameBuffer->setMode(0, 0, 0); @@ -2017,6 +2025,7 @@ void CNeutrinoApp::SetupFrameBuffer() exit(-1); } frameBuffer->Clear(); + frameBufferInitialized = true; } /************************************************************************************** @@ -2230,6 +2239,9 @@ int CNeutrinoApp::run(int argc, char **argv) TIMER_START(); cs_api_init(); cs_register_messenger(CSSendMessage); +#ifdef BOXMODEL_CS_HD2 + cs_new_auto_videosystem(); +#endif g_Locale = new CLocaleManager; @@ -2296,6 +2308,8 @@ TIMER_START(); ZapStart_arg.volume = g_settings.current_volume; ZapStart_arg.webtv_xml = &g_settings.webtv_xml; + ZapStart_arg.osd_resolution = g_settings.osd_resolution; + CCamManager::getInstance()->SetCITuner(g_settings.ci_tuner); /* create decoders, read channels */ bool zapit_init = CZapit::getInstance()->Start(&ZapStart_arg); @@ -3162,6 +3176,24 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) CMoviePlayerGui::getInstance(true).showSubtitle(data); return messages_return::handled; } + if (msg == NeutrinoMessages::EVT_AUTO_SET_VIDEOSYSTEM) { + printf(">>>>>[CNeutrinoApp::%s:%d] Receive EVT_AUTO_SET_VIDEOSYSTEM message\n", __func__, __LINE__); + COsdHelpers *coh = COsdHelpers::getInstance(); + int videoSystem = (int)data; + if (coh->getVideoSystem() == videoSystem) + return messages_return::handled; + + if (!frameBufferInitialized) { + coh->resetOsdResolution(videoSystem); + videoDecoder->SetVideoSystem(videoSystem, false); + return messages_return::handled; + } + + coh->resetOsdResolution(videoSystem); + videoDecoder->SetVideoSystem(videoSystem, false); + coh->changeOsdResolution(0, true, true); + return messages_return::handled; + } if(msg == NeutrinoMessages::EVT_ZAP_COMPLETE) { CZapit::getInstance()->GetAudioMode(g_settings.audio_AnalogMode); if(g_settings.audio_AnalogMode < 0 || g_settings.audio_AnalogMode > 2) diff --git a/src/neutrino.h b/src/neutrino.h index 7f9aa9915..ece4741dd 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -109,6 +109,7 @@ private: bool channelList_painted; int first_mode_found; int osd_resolution_tmp; + bool frameBufferInitialized; bool blank_screen; //NI void SDT_ReloadChannels(); diff --git a/src/neutrinoMessages.h b/src/neutrinoMessages.h index fe89d019a..81f77fa6c 100644 --- a/src/neutrinoMessages.h +++ b/src/neutrinoMessages.h @@ -123,6 +123,7 @@ struct NeutrinoMessages { /* NEVER CHANGE THIS */ EVT_CA_MESSAGE = CRCInput::RC_Events + 60, /* data = CA_MESSAGE pointer */ EVT_SUBT_MESSAGE = CRCInput::RC_Events + 61, /* data = subtitles pointer */ + EVT_AUTO_SET_VIDEOSYSTEM = CRCInput::RC_Events + 62, /* data = new video system */ /* END */ EVT_CURRENTEPG = CRCInput::RC_WithData + 1, diff --git a/src/zapit/include/zapit/zapit.h b/src/zapit/include/zapit/zapit.h index 907405ef7..6151fd0b1 100644 --- a/src/zapit/include/zapit/zapit.h +++ b/src/zapit/include/zapit/zapit.h @@ -42,6 +42,7 @@ typedef struct ZAPIT_start_arg t_channel_id startchannelradio_id; int uselastchannel; int video_mode; + uint32_t osd_resolution; int volume; int ci_clock; std::list *webtv_xml; diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 807589b9f..d762ab0bd 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -75,6 +75,7 @@ #include #include +#include /* globals */ int sig_delay = 2; // seconds between signal check @@ -1663,6 +1664,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd) CZapitMessages::commandInt msg; CBasicServer::receive_data(connfd, &msg, sizeof(msg)); videoDecoder->SetVideoSystem(msg.val); + COsdHelpers::getInstance()->changeOsdResolution(0, true); CNeutrinoApp::getInstance()->g_settings_video_Mode(msg.val); break; } @@ -2367,6 +2369,8 @@ bool CZapit::Start(Z_start_arg *ZapStart_arg) videoDecoder->SetDemux(videoDemux); videoDecoder->SetVideoSystem(video_mode); + uint32_t osd_resolution = ZapStart_arg->osd_resolution; + COsdHelpers::getInstance()->changeOsdResolution(osd_resolution); videoDecoder->Standby(false); audioDecoder->SetDemux(audioDemux);