aboutsummaryrefslogtreecommitdiff
path: root/qapi
diff options
context:
space:
mode:
authorKshitij Suri <kshitij.suri@nutanix.com>2022-04-08 07:13:35 +0000
committerGerd Hoffmann <kraxel@redhat.com>2022-04-27 07:51:01 +0200
commit9a0a119a382867dc9a5c2ae9348003bf79d84af2 (patch)
tree59f6774e8d1f085f0dc051717a8ef024a839891a /qapi
parent95f8510ef428f988897176b9585b8ba1432f939f (diff)
downloadqemu-9a0a119a382867dc9a5c2ae9348003bf79d84af2.zip
qemu-9a0a119a382867dc9a5c2ae9348003bf79d84af2.tar.gz
qemu-9a0a119a382867dc9a5c2ae9348003bf79d84af2.tar.bz2
Added parameter to take screenshot with screendump as PNG
Currently screendump only supports PPM format, which is un-compressed. Added a "format" parameter to QMP and HMP screendump command to support PNG image capture using libpng. QMP example usage: { "execute": "screendump", "arguments": { "filename": "/tmp/image", "format":"png" } } HMP example usage: screendump /tmp/image -f png Resolves: https://gitlab.com/qemu-project/qemu/-/issues/718 Signed-off-by: Kshitij Suri <kshitij.suri@nutanix.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-Id: <20220408071336.99839-3-kshitij.suri@nutanix.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'qapi')
-rw-r--r--qapi/ui.json24
1 files changed, 21 insertions, 3 deletions
diff --git a/qapi/ui.json b/qapi/ui.json
index 13a8bb8..596f37f 100644
--- a/qapi/ui.json
+++ b/qapi/ui.json
@@ -158,11 +158,26 @@
{ 'command': 'expire_password', 'boxed': true, 'data': 'ExpirePasswordOptions' }
##
+# @ImageFormat:
+#
+# Supported image format types.
+#
+# @png: PNG format
+#
+# @ppm: PPM format
+#
+# Since: 7.1
+#
+##
+{ 'enum': 'ImageFormat',
+ 'data': ['ppm', 'png'] }
+
+##
# @screendump:
#
-# Write a PPM of the VGA screen to a file.
+# Capture the contents of a screen and write it to a file.
#
-# @filename: the path of a new PPM file to store the image
+# @filename: the path of a new file to store the image
#
# @device: ID of the display device that should be dumped. If this parameter
# is missing, the primary display will be used. (Since 2.12)
@@ -171,6 +186,8 @@
# parameter is missing, head #0 will be used. Also note that the head
# can only be specified in conjunction with the device ID. (Since 2.12)
#
+# @format: image format for screendump. (default: ppm) (Since 7.1)
+#
# Returns: Nothing on success
#
# Since: 0.14
@@ -183,7 +200,8 @@
#
##
{ 'command': 'screendump',
- 'data': {'filename': 'str', '*device': 'str', '*head': 'int'},
+ 'data': {'filename': 'str', '*device': 'str', '*head': 'int',
+ '*format': 'ImageFormat'},
'coroutine': true }
##