diff --git a/src/driver/fb_accel_cs_hd1.cpp b/src/driver/fb_accel_cs_hd1.cpp index af62fea21..f890cfbcc 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 8a6b42767..0b027ece9 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 a530b67b8..126146459 100644 --- a/src/driver/fb_generic.cpp +++ b/src/driver/fb_generic.cpp @@ -46,6 +46,7 @@ #include #include +#include #include #include #include @@ -362,9 +363,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 810fcc063..2209e7f2d 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); enum {