summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphintuka <phintuka>2011-03-20 21:36:31 +0000
committerphintuka <phintuka>2011-03-20 21:36:31 +0000
commitafe52d74afc4bdb8579024543d8c3d2f6033ad8d (patch)
tree4a5589493119597660bbe59aec7215024b3f8f60
parent994af0bba5e30034791e9a3f26942448d8dad973 (diff)
downloadxineliboutput-afe52d74afc4bdb8579024543d8c3d2f6033ad8d.tar.gz
xineliboutput-afe52d74afc4bdb8579024543d8c3d2f6033ad8d.tar.bz2
Added cXinelibDevice::SupportsTrueColorOSD()
-rw-r--r--device.c26
-rw-r--r--device.h4
2 files changed, 28 insertions, 2 deletions
diff --git a/device.c b/device.c
index a31109a6..6d70f601 100644
--- a/device.c
+++ b/device.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: device.c,v 1.112 2010-06-04 10:40:20 rofafor Exp $
+ * $Id: device.c,v 1.113 2011-03-20 21:36:31 phintuka Exp $
*
*/
@@ -1640,6 +1640,30 @@ void cXinelibDevice::GetOsdSize(int &Width, int &Height, double &PixelAspect)
PixelAspect = 16.0 / 9.0 / (double)Width * (double)Height;
}
+bool cXinelibDevice::SupportsTrueColorOSD(void)
+{
+ switch (xc.osd_color_depth) {
+ default:
+ case OSD_DEPTH_LUT8: return false;
+ case OSD_DEPTH_TRUECOLOR: return true;
+ case OSD_DEPTH_auto:;
+ }
+
+ // Automatic mode:
+ // Use TrueColor if all clients support it.
+ // Special handling when no remote clients:
+ // - local frontend supports TrueColor --> use TrueColor
+ // - no local frontend --> use LUT8
+
+ if (m_local) {
+ if (!m_local->SupportsTrueColorOSD())
+ return false;
+ return !m_server || !!m_server->SupportsTrueColorOSD();
+ }
+
+ return m_server && (m_server->SupportsTrueColorOSD() == 1);
+}
+
//
// SPU decoder
//
diff --git a/device.h b/device.h
index a1f82d9c..a3968733 100644
--- a/device.h
+++ b/device.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: device.h,v 1.60 2010-06-04 10:40:20 rofafor Exp $
+ * $Id: device.h,v 1.61 2011-03-20 21:36:31 phintuka Exp $
*
*/
@@ -90,6 +90,8 @@ class cXinelibDevice : public cDevice
virtual bool CanReplay(void) const { return true; };
virtual bool HasIBPTrickSpeed(void) { return xc.ibp_trickspeed; }
+ bool SupportsTrueColorOSD(void);
+
// Playback control
private: