From nobody Thu Apr 3 11:35:08 2025 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=1742946269; cv=none; d=zohomail.com; s=zohoarc; b=F9SHHbhaUoI4CrbrT0xPj25rCYZ4v+ZAR4tCsJKVc02grDOWFWqXahY1j/odv7ePury0pw0cMCwd0D2Yuwvl3cdtcrNcGJZf9Deob00HrENK5R5rCi+30LPr652BawaL1ls54Bq6l/DFJpdBaQWYs6N1Xtf5V6hAl99v0MxVPMY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1742946269; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1zNGosqIZcbtPJC7gDn8n8UxxZz/kddupJBz/vL0/Ys=; b=bEu6gJ53TbTKgfdSHVG7khqM44s7bM9bxTBczs9W32y4R4eGNNimB7c9kxVijPN9UT5eo16p6TGQgD7LNvH6QiLUFODD2kxm2HMbu89A+81ddJiUKPQjFX2v3h0DZ+w2q03yetIUQYbtXWQX5bycyjcFGcrwxNF2EHalKxpiFUE= 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 SMTPS id 1742946269163689.1017290187581; Tue, 25 Mar 2025 16:44:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1txDve-0000P6-4D; Tue, 25 Mar 2025 19:43:30 -0400 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 1txDvb-0000OA-Kk for qemu-devel@nongnu.org; Tue, 25 Mar 2025 19:43:27 -0400 Received: from mgamail.intel.com ([198.175.65.12]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1txDvZ-0005Gz-RF for qemu-devel@nongnu.org; Tue, 25 Mar 2025 19:43:27 -0400 Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2025 16:43:19 -0700 Received: from vkasired-desk2.fm.intel.com ([10.105.128.132]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2025 16:43:18 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1742946206; x=1774482206; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GUPbIlrSAOGAWvUKfKQQlreI6b7vKByoVl8Mn2xfEqE=; b=Q6rWroDAXJJhA3WlL7uvNN2wM5dra5T5cEUMTc3VywZ/a2dXHv6Lju+T Pa1eQMClcgyilUa1SiDksU6KRvyANTSZYqJwUpZegqUvqod2E69lZ+jfG UOjoy72xmz/N+EbUtcA2ANuIA3UqOimslZCZZHLuL1XeLVdDoGL5XdMYb 1HodY6r2ORTTLHK9x7vTSPUbnkMylDNEf2erzM4ww9KtLqW+aAvCuwwGp FPwnjgF8HDN2mcWEJ5mM0AdiJqA240BwUt6lxDwCe80zoMvLiBAAGIzCk XJLZHPnT59Qw0XdolE28UuVYDoUsS9kckTrVgXR/ZheYnhd1lDAYT0dIe A==; X-CSE-ConnectionGUID: OeAnHpZGStWkUbwOvEDWTA== X-CSE-MsgGUID: ffkblxS6Rlqeq/09HvZYsA== X-IronPort-AV: E=McAfee;i="6700,10204,11384"; a="55582833" X-IronPort-AV: E=Sophos;i="6.14,276,1736841600"; d="scan'208";a="55582833" X-CSE-ConnectionGUID: CNzz1PR4S76lvR1ugZy2Jg== X-CSE-MsgGUID: kgpRvg1/T+iNt0jvdBpvTA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.14,276,1736841600"; d="scan'208";a="124332496" From: Vivek Kasireddy To: qemu-devel@nongnu.org Cc: Vivek Kasireddy , Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Dmitry Osipenko , Frediano Ziglio , Dongwon Kim Subject: [PATCH v2 1/6] ui/spice: Add an option for users to provide a preferred codec Date: Tue, 25 Mar 2025 16:39:31 -0700 Message-ID: <20250325234115.1332883-2-vivek.kasireddy@intel.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250325234115.1332883-1-vivek.kasireddy@intel.com> References: <20250325234115.1332883-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=198.175.65.12; envelope-from=vivek.kasireddy@intel.com; helo=mgamail.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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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: 1742946270146019000 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: Dmitry Osipenko Cc: Frediano Ziglio Cc: Dongwon Kim Signed-off-by: Vivek Kasireddy --- qemu-options.hx | 5 +++++ ui/spice-core.c | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/qemu-options.hx b/qemu-options.hx index dc694a99a3..608a07cfc1 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2281,6 +2281,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" + " [,video-codecs=3D:\n" " [,gl=3D[on|off]][,rendernode=3D]\n" " enable spice\n" " at least one of {port, tls-port} is mandatory\n", @@ -2369,6 +2370,10 @@ SRST ``seamless-migration=3D[on|off]`` Enable/disable spice seamless migration. Default is off. =20 + ``video-codecs=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 0326c63bec..907b0e9a81 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -488,6 +488,9 @@ static QemuOptsList qemu_spice_opts =3D { },{ .name =3D "streaming-video", .type =3D QEMU_OPT_STRING, + },{ + .name =3D "video-codecs", + .type =3D QEMU_OPT_STRING, },{ .name =3D "agent-mouse", .type =3D QEMU_OPT_BOOL, @@ -662,6 +665,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 *video_codecs =3D NULL; int port, tls_port, addr_flags; spice_image_compression_t compression; spice_wan_compression_t wan_compr; @@ -801,6 +805,14 @@ static void qemu_spice_init(void) spice_server_set_streaming_video(spice_server, SPICE_STREAM_VIDEO_= OFF); } =20 + video_codecs =3D qemu_opt_get(opts, "video-codecs"); + if (video_codecs) { + if (spice_server_set_video_codecs(spice_server, video_codecs)) { + error_report("invalid video codecs"); + exit(1); + } + } + spice_server_set_agent_mouse (spice_server, qemu_opt_get_bool(opts, "agent-mouse", 1)); spice_server_set_playback_compression --=20 2.48.1