mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-04 04:11:09 +02:00
COsdHelpers: Add function setVideoSystem()
Origin commit data
------------------
Commit: fa08347ef4
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2017-03-05 (Sun, 05 Mar 2017)
This commit is contained in:
@@ -181,3 +181,44 @@ uint32_t COsdHelpers::getOsdResolution()
|
|||||||
}
|
}
|
||||||
return 0;
|
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;
|
||||||
|
}
|
||||||
|
@@ -23,6 +23,7 @@ class COsdHelpers
|
|||||||
int isVideoSystem1080(int res);
|
int isVideoSystem1080(int res);
|
||||||
int getVideoSystem();
|
int getVideoSystem();
|
||||||
uint32_t getOsdResolution();
|
uint32_t getOsdResolution();
|
||||||
|
int setVideoSystem(int newSystem, bool remember = true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -414,7 +414,7 @@ void CVideoSettings::setupVideoSystem(bool do_ask)
|
|||||||
{
|
{
|
||||||
printf("[neutrino VideoSettings] %s setup videosystem...\n", __FUNCTION__);
|
printf("[neutrino VideoSettings] %s setup videosystem...\n", __FUNCTION__);
|
||||||
COsdHelpers::getInstance()->resetOsdResolution(g_settings.video_Mode);
|
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);
|
COsdHelpers::getInstance()->changeOsdResolution(0, true, true);
|
||||||
|
|
||||||
if (do_ask)
|
if (do_ask)
|
||||||
@@ -426,7 +426,7 @@ void CVideoSettings::setupVideoSystem(bool do_ask)
|
|||||||
{
|
{
|
||||||
g_settings.video_Mode = prev_video_mode;
|
g_settings.video_Mode = prev_video_mode;
|
||||||
COsdHelpers::getInstance()->resetOsdResolution(g_settings.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);
|
COsdHelpers::getInstance()->changeOsdResolution(0, true, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -612,7 +612,7 @@ void CVideoSettings::nextMode(void)
|
|||||||
g_settings.video_Mode = VIDEOMENU_VIDEOMODE_OPTIONS[curmode].key;
|
g_settings.video_Mode = VIDEOMENU_VIDEOMODE_OPTIONS[curmode].key;
|
||||||
//CVFD::getInstance()->ShowText(text);
|
//CVFD::getInstance()->ShowText(text);
|
||||||
COsdHelpers::getInstance()->resetOsdResolution(g_settings.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);
|
COsdHelpers::getInstance()->changeOsdResolution(0, true, true);
|
||||||
//return;
|
//return;
|
||||||
disp_cur = 1;
|
disp_cur = 1;
|
||||||
|
@@ -2995,12 +2995,12 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
|
|||||||
|
|
||||||
if (!frameBufferInitialized) {
|
if (!frameBufferInitialized) {
|
||||||
coh->resetOsdResolution(videoSystem);
|
coh->resetOsdResolution(videoSystem);
|
||||||
videoDecoder->SetVideoSystem(videoSystem, false);
|
coh->setVideoSystem(videoSystem, false);
|
||||||
return messages_return::handled;
|
return messages_return::handled;
|
||||||
}
|
}
|
||||||
|
|
||||||
coh->resetOsdResolution(videoSystem);
|
coh->resetOsdResolution(videoSystem);
|
||||||
videoDecoder->SetVideoSystem(videoSystem, false);
|
coh->setVideoSystem(videoSystem, false);
|
||||||
coh->changeOsdResolution(0, true, true);
|
coh->changeOsdResolution(0, true, true);
|
||||||
return messages_return::handled;
|
return messages_return::handled;
|
||||||
}
|
}
|
||||||
|
@@ -1664,7 +1664,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd)
|
|||||||
case CZapitMessages::CMD_SET_VIDEO_SYSTEM: {
|
case CZapitMessages::CMD_SET_VIDEO_SYSTEM: {
|
||||||
CZapitMessages::commandInt msg;
|
CZapitMessages::commandInt msg;
|
||||||
CBasicServer::receive_data(connfd, &msg, sizeof(msg));
|
CBasicServer::receive_data(connfd, &msg, sizeof(msg));
|
||||||
videoDecoder->SetVideoSystem(msg.val);
|
COsdHelpers::getInstance()->setVideoSystem(msg.val);
|
||||||
COsdHelpers::getInstance()->changeOsdResolution(0, true);
|
COsdHelpers::getInstance()->changeOsdResolution(0, true);
|
||||||
CNeutrinoApp::getInstance()->g_settings_video_Mode(msg.val);
|
CNeutrinoApp::getInstance()->g_settings_video_Mode(msg.val);
|
||||||
break;
|
break;
|
||||||
@@ -2369,7 +2369,7 @@ bool CZapit::Start(Z_start_arg *ZapStart_arg)
|
|||||||
audioDecoder = cAudio::GetDecoder(0);
|
audioDecoder = cAudio::GetDecoder(0);
|
||||||
|
|
||||||
videoDecoder->SetDemux(videoDemux);
|
videoDecoder->SetDemux(videoDemux);
|
||||||
videoDecoder->SetVideoSystem(video_mode);
|
COsdHelpers::getInstance()->setVideoSystem(video_mode);
|
||||||
uint32_t osd_resolution = ZapStart_arg->osd_resolution;
|
uint32_t osd_resolution = ZapStart_arg->osd_resolution;
|
||||||
COsdHelpers::getInstance()->changeOsdResolution(osd_resolution);
|
COsdHelpers::getInstance()->changeOsdResolution(osd_resolution);
|
||||||
videoDecoder->Standby(false);
|
videoDecoder->Standby(false);
|
||||||
|
Reference in New Issue
Block a user