diff --git a/src/gui/osd_helpers.cpp b/src/gui/osd_helpers.cpp index c06563f5a..0133d4aa5 100644 --- a/src/gui/osd_helpers.cpp +++ b/src/gui/osd_helpers.cpp @@ -181,3 +181,44 @@ uint32_t COsdHelpers::getOsdResolution() } return 0; } + +#define DEBUGINFO_SETVIDEOSYSTEM + +int COsdHelpers::setVideoSystem(int newSystem, bool remember/* = true*/) +{ + if ((newSystem < 0) || (newSystem > VIDEO_STD_MAX)) + return -1; + + if (newSystem == getVideoSystem()) + return 0; + +#ifdef DEBUGINFO_SETVIDEOSYSTEM + int fd = CFrameBuffer::getInstance()->getFileHandle(); + fb_var_screeninfo var; + fb_fix_screeninfo fix; + + ioctl(fd, FBIOGET_VSCREENINFO, &var); + ioctl(fd, FBIOGET_FSCREENINFO, &fix); + printf(">>>>>[%s - %s:%d] before SetVideoSystem:\n" + " var.xres : %4d, var.yres : %4d, var.yres_virtual: %4d\n" + " fix.line_length : %4d, fix.smem_len: %d Byte\n", + __path_file__, __func__, __LINE__, + var.xres, var.yres, var.yres_virtual, + fix.line_length, fix.smem_len); +#endif + + int ret = videoDecoder->SetVideoSystem(newSystem, remember); + +#ifdef DEBUGINFO_SETVIDEOSYSTEM + ioctl(fd, FBIOGET_VSCREENINFO, &var); + ioctl(fd, FBIOGET_FSCREENINFO, &fix); + printf(">>>>>[%s - %s:%d] after SetVideoSystem:\n" + " var.xres : %4d, var.yres : %4d, var.yres_virtual: %4d\n" + " fix.line_length : %4d, fix.smem_len: %d Byte\n", + __path_file__, __func__, __LINE__, + var.xres, var.yres, var.yres_virtual, + fix.line_length, fix.smem_len); +#endif + + return ret; +} diff --git a/src/gui/osd_helpers.h b/src/gui/osd_helpers.h index d2c735e50..bd4a629c0 100644 --- a/src/gui/osd_helpers.h +++ b/src/gui/osd_helpers.h @@ -23,6 +23,7 @@ class COsdHelpers int isVideoSystem1080(int res); int getVideoSystem(); uint32_t getOsdResolution(); + int setVideoSystem(int newSystem, bool remember = true); }; diff --git a/src/gui/videosettings.cpp b/src/gui/videosettings.cpp index 6cb14bcd4..b477a7d00 100644 --- a/src/gui/videosettings.cpp +++ b/src/gui/videosettings.cpp @@ -414,7 +414,7 @@ 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()->setVideoSystem(g_settings.video_Mode); //FIXME COsdHelpers::getInstance()->changeOsdResolution(0, true, true); if (do_ask) @@ -426,7 +426,7 @@ void CVideoSettings::setupVideoSystem(bool do_ask) { g_settings.video_Mode = prev_video_mode; COsdHelpers::getInstance()->resetOsdResolution(g_settings.video_Mode); - videoDecoder->SetVideoSystem(g_settings.video_Mode); + COsdHelpers::getInstance()->setVideoSystem(g_settings.video_Mode); COsdHelpers::getInstance()->changeOsdResolution(0, true, true); } else @@ -612,7 +612,7 @@ void CVideoSettings::nextMode(void) 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()->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 bfbc41b08..a9adafce6 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2995,12 +2995,12 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) if (!frameBufferInitialized) { coh->resetOsdResolution(videoSystem); - videoDecoder->SetVideoSystem(videoSystem, false); + coh->setVideoSystem(videoSystem, false); return messages_return::handled; } coh->resetOsdResolution(videoSystem); - videoDecoder->SetVideoSystem(videoSystem, false); + coh->setVideoSystem(videoSystem, false); coh->changeOsdResolution(0, true, true); return messages_return::handled; } diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index eafc43f60..391f658de 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -1664,7 +1664,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd) case CZapitMessages::CMD_SET_VIDEO_SYSTEM: { CZapitMessages::commandInt msg; CBasicServer::receive_data(connfd, &msg, sizeof(msg)); - videoDecoder->SetVideoSystem(msg.val); + COsdHelpers::getInstance()->setVideoSystem(msg.val); COsdHelpers::getInstance()->changeOsdResolution(0, true); CNeutrinoApp::getInstance()->g_settings_video_Mode(msg.val); break; @@ -2369,7 +2369,7 @@ bool CZapit::Start(Z_start_arg *ZapStart_arg) audioDecoder = cAudio::GetDecoder(0); videoDecoder->SetDemux(videoDemux); - videoDecoder->SetVideoSystem(video_mode); + COsdHelpers::getInstance()->setVideoSystem(video_mode); uint32_t osd_resolution = ZapStart_arg->osd_resolution; COsdHelpers::getInstance()->changeOsdResolution(osd_resolution); videoDecoder->Standby(false);