[libvirt] [PATCH 10/12] vbox: fix _displayTakeScreenShotPNGToArray

Dawid Zamirski dzamirski at datto.com
Thu Dec 29 20:34:31 UTC 2016


This function was not implemented for vbox 5+ which removed
TakeScreenShotPNGToArray but provides TakeScreenShotToArray with
BitmapFormat_PNG argument which is the same thing.
---
 src/vbox/vbox_tmpl.c | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index 5e6a919..d022742 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -2029,21 +2029,20 @@ _displayGetScreenResolution(IDisplay *display ATTRIBUTE_UNUSED,
 }
 
 static nsresult
-_displayTakeScreenShotPNGToArray(IDisplay *display ATTRIBUTE_UNUSED,
-                                 PRUint32 screenId ATTRIBUTE_UNUSED,
-                                 PRUint32 width ATTRIBUTE_UNUSED,
-                                 PRUint32 height ATTRIBUTE_UNUSED,
-                                 PRUint32 *screenDataSize ATTRIBUTE_UNUSED,
-                                 PRUint8** screenData ATTRIBUTE_UNUSED)
-{
-#if VBOX_API_VERSION < 4000000 || VBOX_API_VERSION >= 5000000
-    vboxUnsupported();
-    return 0;
-#else /* VBOX_API_VERSION >= 4000000 && VBOX_API_VERSION < 5000000 */
+_displayTakeScreenShotPNGToArray(IDisplay *display, PRUint32 screenId,
+                                 PRUint32 width, PRUint32 height,
+                                 PRUint32 *screenDataSize,
+                                 PRUint8** screenData)
+{
+#if VBOX_API_VERSION >= 5000000
+    return display->vtbl->TakeScreenShotToArray(display, screenId, width,
+                                                height, BitmapFormat_PNG,
+                                                screenDataSize, screenData);
+#else /* VBOX_API_VERSION < 5000000 */
     return display->vtbl->TakeScreenShotPNGToArray(display, screenId, width,
                                                    height, screenDataSize,
                                                    screenData);
-#endif /* VBOX_API_VERSION >= 4000000 */
+#endif /* VBOX_API_VERSION >= 5000000 */
 }
 
 static nsresult
-- 
2.9.3




More information about the libvir-list mailing list