CFbAccelCSHD2::setMode: Fix if ENABLE_CHANGE_OSD_RESOLUTION is not defined

Origin commit data
------------------
Branch: ni/coolstream
Commit: 515ab1fe59
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2017-03-23 (Thu, 23 Mar 2017)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Michael Liebmann
2017-03-23 21:27:06 +01:00
parent 968e1ce9c0
commit c2d87de865
2 changed files with 30 additions and 22 deletions

View File

@@ -234,29 +234,35 @@ int CFbAccelCSHD2::setMode(unsigned int nxRes, unsigned int nyRes, unsigned int
if (osd_resolutions.empty()) if (osd_resolutions.empty())
setOsdResolutions(); setOsdResolutions();
if (fullHdAvailable()) { unsigned int nxRes_ = nxRes;
screeninfo.xres=nxRes; unsigned int nyRes_ = nyRes;
screeninfo.yres=nyRes; unsigned int nbpp_ = nbpp;
screeninfo.xres_virtual=nxRes; if (!fullHdAvailable()) {
screeninfo.yres_virtual=nyRes*2; nxRes_ = 1280;
screeninfo.height=0; nyRes_ = 720;
screeninfo.width=0; nbpp_ = 32;
screeninfo.xoffset=screeninfo.yoffset=0; }
screeninfo.bits_per_pixel=nbpp; 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;
screeninfo.bits_per_pixel=nbpp_;
if (ioctl(fd, FBIOPUT_VSCREENINFO, &screeninfo)<0) if (ioctl(fd, FBIOPUT_VSCREENINFO, &screeninfo)<0)
perror(LOGTAG "FBIOPUT_VSCREENINFO"); perror(LOGTAG "FBIOPUT_VSCREENINFO");
printf(LOGTAG "SetMode: %dbits, red %d:%d green %d:%d blue %d:%d transp %d:%d\n", printf(LOGTAG "SetMode: %dbits, red %d:%d green %d:%d blue %d:%d transp %d:%d\n",
screeninfo.bits_per_pixel, screeninfo.red.length, screeninfo.red.offset, screeninfo.green.length, screeninfo.green.offset, screeninfo.blue.length, screeninfo.blue.offset, screeninfo.transp.length, screeninfo.transp.offset); screeninfo.bits_per_pixel, screeninfo.red.length, screeninfo.red.offset, screeninfo.green.length, screeninfo.green.offset, screeninfo.blue.length, screeninfo.blue.offset, screeninfo.transp.length, screeninfo.transp.offset);
if ((screeninfo.xres != nxRes) || if ((screeninfo.xres != nxRes_) ||
(screeninfo.yres != nyRes) || (screeninfo.yres != nyRes_) ||
(screeninfo.bits_per_pixel != nbpp)) { (screeninfo.bits_per_pixel != nbpp_)) {
printf(LOGTAG "SetMode failed: wanted: %dx%dx%d, got %dx%dx%d\n", printf(LOGTAG "SetMode failed: wanted: %dx%dx%d, got %dx%dx%d\n",
nxRes, nyRes, nbpp, nxRes_, nyRes_, nbpp_,
screeninfo.xres, screeninfo.yres, screeninfo.bits_per_pixel); screeninfo.xres, screeninfo.yres, screeninfo.bits_per_pixel);
return -1; return -1;
}
} }
fb_fix_screeninfo _fix; fb_fix_screeninfo _fix;
@@ -337,8 +343,10 @@ int CFbAccelCSHD2::scale2Res(int size)
bool CFbAccelCSHD2::fullHdAvailable() bool CFbAccelCSHD2::fullHdAvailable()
{ {
#ifdef ENABLE_CHANGE_OSD_RESOLUTION
if (available >= 16588800) /* new fb driver with maxres 1920x1080(*8) */ if (available >= 16588800) /* new fb driver with maxres 1920x1080(*8) */
return true; return true;
#endif
return false; return false;
} }

View File

@@ -2139,7 +2139,7 @@ int CNeutrinoApp::run(int argc, char **argv)
TIMER_START(); TIMER_START();
cs_api_init(); cs_api_init();
cs_register_messenger(CSSendMessage); cs_register_messenger(CSSendMessage);
#ifdef BOXMODEL_CS_HD2 #if defined(HAVE_COOL_HARDWARE) && defined(ENABLE_CHANGE_OSD_RESOLUTION)
cs_new_auto_videosystem(); cs_new_auto_videosystem();
#endif #endif