From nobody Mon Feb 9 19:53:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1673416716; cv=none; d=zohomail.com; s=zohoarc; b=SCni9BuRQWI2cGs2NlqxsPUPRUhbMc7OuQYebPOMrrLkgRZYnKY33fessYH8AL2SBSshX47kSp0BP41Ffark2GgYbPgTOxvGJwXMd8wg/odiTV0xu4lJZv276NAovsSa6vovV74cgRL27I8cyuD2v0weEX2m0JKw7moy7SWXtCM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673416716; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UV18E2GO1aYVcSWJoOjKOcb5RUaL1jglqMoIIi+PFvE=; b=ekgvkItid67gVIF0GTuHd9QSEZn4PAkNCQpqSMiBBwFynOJFjBDB/8qguPK1JmtU3gm+rKZQdnP3vfDZO9Odk5anlb0gxQItWm85uFVvOIvxDuLI1u9DWKd/3ODMixcWRfV0BX4szHjSVfD4kK4LmKy53JyMgdYb/BooipkDZ/0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTP id 1673416716580446.43911661024197; Tue, 10 Jan 2023 21:58:36 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFU72-0004p2-T8; Wed, 11 Jan 2023 00:57:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFU71-0004o5-Rs for qemu-devel@nongnu.org; Wed, 11 Jan 2023 00:57:23 -0500 Received: from mga02.intel.com ([134.134.136.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFU70-0005Bd-9e for qemu-devel@nongnu.org; Wed, 11 Jan 2023 00:57:23 -0500 Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jan 2023 21:57:07 -0800 Received: from vkasired-desk2.fm.intel.com ([10.105.128.127]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jan 2023 21:57:07 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673416642; x=1704952642; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dhNTF3QDCDcr1faDyACdENyYpr5UW+kl+qZ031o1tSg=; b=KUWgMpBmo9qdr8pV2oU5tDqhQvROa2waxpQh5O89mFK+3Dy6korKW75X ardXcBI2WOKGvZFZzE+xNF2Ph3BLItz0HZzmnmvAKXJdIV4icHwzXHChP yVFLHvn98sGAfjNDNYzIf0H4qBtD5IEBJGBLGriixDUT8KJilgMyECNV3 oUH8f78LpTMfG6BBk2jiaB+xipwUx11oQt82qjhhdYFJfbGQV1MqXTHRz NhA7CggTS7AI4w6aa+upbTH7OpWl2jDK1pF8spviCSqYFB2bQ7dfy8kKL 305R++XkV9cBVbmoMc6JGenzw3lugUCbB7LRhoPEZdfz+yw8LOUPLtEkq Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="311147388" X-IronPort-AV: E=Sophos;i="5.96,315,1665471600"; d="scan'208";a="311147388" X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="650621153" X-IronPort-AV: E=Sophos;i="5.96,315,1665471600"; d="scan'208";a="650621153" From: Vivek Kasireddy To: qemu-devel@nongnu.org Cc: Vivek Kasireddy , Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Dongwon Kim Subject: [RFC v1 1/2] spice: Add an option for users to provide a preferred codec Date: Tue, 10 Jan 2023 21:37:06 -0800 Message-Id: <20230111053707.781484-2-vivek.kasireddy@intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230111053707.781484-1-vivek.kasireddy@intel.com> References: <20230111053707.781484-1-vivek.kasireddy@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=134.134.136.20; envelope-from=vivek.kasireddy@intel.com; helo=mga02.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1673416718368100001 Giving users an option to choose a particular codec will enable them to make an appropriate decision based on their hardware and use-case. Cc: Gerd Hoffmann Cc: Marc-Andr=C3=A9 Lureau Cc: Dongwon Kim Signed-off-by: Vivek Kasireddy --- qemu-options.hx | 5 +++++ ui/spice-core.c | 14 ++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/qemu-options.hx b/qemu-options.hx index 3aa3a2f5a3..aab8df0922 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2142,6 +2142,7 @@ DEF("spice", HAS_ARG, QEMU_OPTION_spice, " [,streaming-video=3D[off|all|filter]][,disable-copy-paste=3Don= |off]\n" " [,disable-agent-file-xfer=3Don|off][,agent-mouse=3D[on|off]]\n" " [,playback-compression=3D[on|off]][,seamless-migration=3D[on|o= ff]]\n" + " [,preferred-codec=3D:\n" " [,gl=3D[on|off]][,rendernode=3D]\n" " enable spice\n" " at least one of {port, tls-port} is mandatory\n", @@ -2237,6 +2238,10 @@ SRST ``seamless-migration=3D[on|off]`` Enable/disable spice seamless migration. Default is off. =20 + ``preferred-codec=3D:`` + Provide the preferred codec the Spice server should use. + Default would be spice:mjpeg. + ``gl=3D[on|off]`` Enable/disable OpenGL context. Default is off. =20 diff --git a/ui/spice-core.c b/ui/spice-core.c index 72f8f1681c..6e00211e3a 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -469,6 +469,9 @@ static QemuOptsList qemu_spice_opts =3D { },{ .name =3D "streaming-video", .type =3D QEMU_OPT_STRING, + },{ + .name =3D "preferred-codec", + .type =3D QEMU_OPT_STRING, },{ .name =3D "agent-mouse", .type =3D QEMU_OPT_BOOL, @@ -644,6 +647,7 @@ static void qemu_spice_init(void) char *x509_key_file =3D NULL, *x509_cert_file =3D NULL, *x509_cacert_file =3D NULL; + const char *preferred_codec =3D NULL; int port, tls_port, addr_flags; spice_image_compression_t compression; spice_wan_compression_t wan_compr; @@ -795,6 +799,16 @@ static void qemu_spice_init(void) spice_server_set_streaming_video(spice_server, SPICE_STREAM_VIDEO_= OFF); } =20 + preferred_codec =3D qemu_opt_get(opts, "preferred-codec"); + if (preferred_codec) { + if (spice_server_set_video_codecs(spice_server, preferred_codec)) { + error_report("Preferred codec name is not valid"); + exit(1); + } + } else { + spice_server_set_video_codecs(spice_server, "spice:mjpeg"); + } + spice_server_set_agent_mouse (spice_server, qemu_opt_get_bool(opts, "agent-mouse", 1)); spice_server_set_playback_compression --=20 2.37.2