<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Arial, sans-serif" size="2">
<div>Hi All</div>
<div>I wrote some code using libXrandr to check the current screen rotation state</div>
<div>&nbsp;</div>
<div><font face="Arial, sans-serif"><i>int CheckRotationState(Display * x11_dpy) {</i></font></div>
<div><font face="Arial, sans-serif"><i>&nbsp;&nbsp;&nbsp; Rotation current_rotation;</i></font></div>
<div><font face="Arial, sans-serif"><i>&nbsp;&nbsp;&nbsp; XRRScreenConfiguration *scrn_cfg;</i></font></div>
<div><font face="Arial, sans-serif"><i>&nbsp;&nbsp;&nbsp; scrn_cfg = XRRGetScreenInfo(x11_dpy, DefaultRootWindow(x11_dpy));</i></font></div>
<div><font face="Arial, sans-serif"><i>&nbsp;&nbsp;&nbsp; XRRConfigCurrentConfiguration (scrn_cfg, &amp;current_rotation);</i></font></div>
<div><font face="Arial, sans-serif"><i>&nbsp;&nbsp;&nbsp; XRRFreeScreenConfigInfo(scrn_cfg);</i></font></div>
<div><font face="Arial, sans-serif"><i>&nbsp;&nbsp;&nbsp; return current_rotation;</i></font></div>
<div><font face="Arial, sans-serif"><i>}</i></font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div><font face="Arial, sans-serif"><i>CheckRotationState </i>is put ahead of <i>XvPutImage</i>,&nbsp; that is to say every time I want to display an image, I will firstly check the screen rotation state. If the return value of <i>CheckRotationState </i>is <i>RR_Rotate_0(There
isn't any rotation)</i>, I will use hardware overlay to display video, or I will use textured blit way. But I found the performance degraded a lot after add <i>CheckRotationState</i>. Seems that <i>XRRGetScreenInfo </i>consumes much time. I tried another interface
<i>XRRRotations</i>, but can only get the cached information, not the current rotation state.</font></div>
<div><font face="Arial, sans-serif">Does anyone have some good idea about how to get the screen rotation state from the Server efficiently? </font></div>
<div><font face="Arial, sans-serif">&nbsp;</font></div>
<div><font face="Arial, sans-serif">Best Regards</font></div>
<div><font face="&#23435;&#20307;, sans-serif">&nbsp;</font></div>
</font>
</body>
</html>