Merge branch 'pu/fb-setmode' of https://github.com/tuxbox-neutrino/gui-neutrino into ni/tuxbox

Origin commit data
------------------
Commit: 13c7e927b7
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-03-05 (Sun, 05 Mar 2017)
This commit is contained in:
vanhofen
2017-03-05 20:43:50 +01:00
6 changed files with 64 additions and 33 deletions

View File

@@ -235,8 +235,10 @@ int CFbAccelCSHD2::setMode(unsigned int nxRes, unsigned int nyRes, unsigned int
setOsdResolutions();
if (fullHdAvailable()) {
screeninfo.xres_virtual=screeninfo.xres=nxRes;
screeninfo.yres_virtual=screeninfo.yres=nyRes;
screeninfo.xres=nxRes;
screeninfo.yres=nyRes;
screeninfo.xres_virtual=nxRes;
screeninfo.yres_virtual=nyRes*2;
screeninfo.height=0;
screeninfo.width=0;
screeninfo.xoffset=screeninfo.yoffset=0;

View File

@@ -62,7 +62,13 @@ void COsdHelpers::changeOsdResolution(uint32_t mode, bool automode/*=false*/, bo
modeNew = OSDMODE_720;
idx = frameBuffer->getIndexOsdResolution(modeNew);
resetOsd = (modeNew != getOsdResolution()) ? true : false;
#if 1
printf(">>>>>[%s:%d] osd mode: %s => %s, automode: %s, forceOsdReset: %s\n", __func__, __LINE__,
(g_settings.osd_resolution == OSDMODE_720)?"OSDMODE_720":"OSDMODE_1080",
(modeNew == OSDMODE_720)?"OSDMODE_720":"OSDMODE_1080",
(automode)?"true":"false",
(forceOsdReset)?"true":"false");
#endif
if (forceOsdReset)
resetOsd = true;
@@ -111,25 +117,12 @@ void COsdHelpers::changeOsdResolution(uint32_t mode, bool automode/*=false*/, bo
}
}
}
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) ||
@@ -181,3 +174,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;
}

View File

@@ -19,10 +19,10 @@ class COsdHelpers
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();
int setVideoSystem(int newSystem, bool remember = true);
};

View File

@@ -413,9 +413,8 @@ 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);
COsdHelpers::getInstance()->setVideoSystem(g_settings.video_Mode); //FIXME
COsdHelpers::getInstance()->changeOsdResolution(0, true, false);
if (do_ask)
{
@@ -425,9 +424,8 @@ 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);
COsdHelpers::getInstance()->setVideoSystem(g_settings.video_Mode);
COsdHelpers::getInstance()->changeOsdResolution(0, true, false);
}
else
prev_video_mode = g_settings.video_Mode;
@@ -611,9 +609,8 @@ 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);
COsdHelpers::getInstance()->setVideoSystem(g_settings.video_Mode);
COsdHelpers::getInstance()->changeOsdResolution(0, true, false);
//return;
disp_cur = 1;
}

View File

@@ -3186,14 +3186,12 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
return messages_return::handled;
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->changeOsdResolution(0, true, true);
coh->setVideoSystem(videoSystem, false);
coh->changeOsdResolution(0, true, false);
return messages_return::handled;
}
if(msg == NeutrinoMessages::EVT_ZAP_COMPLETE) {

View File

@@ -1663,7 +1663,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;
@@ -2368,7 +2368,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);