<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> </div>
<div><font face="Arial, sans-serif"><i>int CheckRotationState(Display * x11_dpy) {</i></font></div>
<div><font face="Arial, sans-serif"><i> Rotation current_rotation;</i></font></div>
<div><font face="Arial, sans-serif"><i> XRRScreenConfiguration *scrn_cfg;</i></font></div>
<div><font face="Arial, sans-serif"><i> scrn_cfg = XRRGetScreenInfo(x11_dpy, DefaultRootWindow(x11_dpy));</i></font></div>
<div><font face="Arial, sans-serif"><i> XRRConfigCurrentConfiguration (scrn_cfg, &current_rotation);</i></font></div>
<div><font face="Arial, sans-serif"><i> XRRFreeScreenConfigInfo(scrn_cfg);</i></font></div>
<div><font face="Arial, sans-serif"><i> return current_rotation;</i></font></div>
<div><font face="Arial, sans-serif"><i>}</i></font></div>
<div><font face="Arial, sans-serif"> </font></div>
<div><font face="Arial, sans-serif"><i>CheckRotationState </i>is put ahead of <i>XvPutImage</i>, 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"> </font></div>
<div><font face="Arial, sans-serif">Best Regards</font></div>
<div><font face="宋体, sans-serif"> </font></div>
</font>
</body>
</html>