spice-gtk环境变量

1、SPICE_DISABLE_CHANNELS:禁止其他通道的消息处理

const char *disabled  = g_getenv("SPICE_DISABLE_CHANNELS");
if (disabled && strstr(disabled, desc))c->disable_channel_msg = TRUE;

2、SPICE_AGENT_LOG_RECORDS:开启日志显示

static void recorder_trace_entry(recorder_info *info, recorder_entry *entry, ...)
// ----------------------------------------------------------------------------//   Show a recorder entry when a trace is enabled// ----------------------------------------------------------------------------
{va_list args;if (strchr(entry->format, '\n') != NULL) {g_critical("Agent records cannot contain '\n' char ... (%s)", entry->where);return;}// send info/entry to the socketg_mutex_lock(&mutex_socket);if (communication_f == NULL) {g_mutex_unlock(&mutex_socket);return;}va_start(args, entry);do_send_entry(communication_f, info, entry, args);va_end(args);if (g_strcmp0(g_getenv("SPICE_AGENT_LOG_RECORDS"), "1") == 0) {va_start(args, entry);do_send_entry(stderr, info, entry, args);va_end(args);}g_mutex_unlock(&mutex_socket);}

3、SPICE_DISABLE_ADAPTIVE_STREAMING:是否开启自适应视频

static void spice_display_channel_init(SpiceDisplayChannel *channel){SpiceDisplayChannelPrivate *c;c = channel->priv = spice_display_channel_get_instance_private(channel);c->surfaces = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, destroy_surface);c->image_cache.ops = &image_cache_ops;c->palette_cache.ops = &palette_cache_ops;c->image_surfaces.ops = &image_surfaces_ops;c->monitors_max = 1;c->scanout.fd = -1;if (g_getenv("SPICE_DISABLE_ADAPTIVE_STREAMING")) {SPICE_DEBUG("adaptive video disabled");c->enable_adaptive_streaming = FALSE;} else {c->enable_adaptive_streaming = TRUE;}}/* coroutine context */static void display_handle_stream_data(SpiceChannel *channel, SpiceMsgIn *in){...if (c->enable_adaptive_streaming) {display_update_stream_report(SPICE_DISPLAY_CHANNEL(channel), op->id, op->multi_media_time, margin_report);if (st->playback_sync_drops_seq_len >= STREAM_PLAYBACK_SYNC_DROP_SEQ_LEN_LIMIT) {spice_session_sync_playback_latency(spice_channel_get_session(channel));st->playback_sync_drops_seq_len = 0;}}}static void spice_display_channel_set_capabilities(SpiceChannel *channel){SpiceSession *s = spice_channel_get_session(channel);guint i;spice_channel_set_capability(channel, SPICE_DISPLAY_CAP_SIZED_STREAM);spice_channel_set_capability(channel, SPICE_DISPLAY_CAP_MONITORS_CONFIG);spice_channel_set_capability(channel, SPICE_DISPLAY_CAP_COMPOSITE);spice_channel_set_capability(channel, SPICE_DISPLAY_CAP_A8_SURFACE);#ifdef USE_LZ4spice_channel_set_capability(channel, SPICE_DISPLAY_CAP_LZ4_COMPRESSION);#endifif (SPICE_DISPLAY_CHANNEL(channel)->priv->enable_adaptive_streaming) {spice_channel_set_capability(channel, SPICE_DISPLAY_CAP_STREAM_REPORT);}...}

4、SPICE_MAX_CLIPBOARD:剪切板最大字符数

case PROP_MAX_CLIPBOARD:g_value_set_int(value, spice_main_get_max_clipboard(self));break;

5、SPICE_MIG_HOST

/* main context */
static gboolean migrate_connect(spice_migrate *mig)
{int port, sport;const char *host;g_return_val_if_fail(mig != NULL, FALSE);g_return_val_if_fail(mig->nchannels == 0, FALSE);g_return_val_if_fail(mig->session != NULL, FALSE);spice_session_set_migration_state(mig->session, SPICE_SESSION_MIGRATION_CONNECTING);SpiceMigrationDstInfo *info = &mig->info;SPICE_DEBUG("migrate_begin %u %s %d %d",info->host_size, info->host_data, info->port, info->sport);port = info->port;sport = info->sport;host = (char*)info->host_data;if (info->cert_subject_data == NULL ||strlen((const char*)info->cert_subject_data) == 0) {/* only verify hostname if no cert subject */g_object_set(mig->session, "verify", SPICE_SESSION_VERIFY_HOSTNAME, NULL);} else {// session data are already copiedg_object_set(mig->session,"cert-subject", info->cert_subject_data,"verify", SPICE_SESSION_VERIFY_SUBJECT,NULL);}if (g_getenv("SPICE_MIG_HOST"))host = g_getenv("SPICE_MIG_HOST");...
}

6、SPICE_DISABLE_OPUS:禁用播放通道和录音通道的opus编码

static void spice_playback_channel_set_capabilities(SpiceChannel *channel){if (!g_getenv("SPICE_DISABLE_OPUS"))if (snd_codec_is_capable(SPICE_AUDIO_DATA_MODE_OPUS, SND_CODEC_ANY_FREQUENCY))spice_channel_set_capability(SPICE_CHANNEL(channel), SPICE_PLAYBACK_CAP_OPUS);spice_channel_set_capability(SPICE_CHANNEL(channel), SPICE_PLAYBACK_CAP_VOLUME);spice_channel_set_capability(SPICE_CHANNEL(channel), SPICE_PLAYBACK_CAP_LATENCY);}static void spice_record_channel_set_capabilities(SpiceChannel *channel){if (!g_getenv("SPICE_DISABLE_OPUS"))if (snd_codec_is_capable(SPICE_AUDIO_DATA_MODE_OPUS, SND_CODEC_ANY_FREQUENCY))spice_channel_set_capability(SPICE_CHANNEL(channel), SPICE_RECORD_CAP_OPUS);spice_channel_set_capability(SPICE_CHANNEL(channel), SPICE_RECORD_CAP_VOLUME);}

7、SPICE_GST_AUDIOSINK:使用环境变量的播放声音的pipeline

static void playback_start(SpicePlaybackChannel *channel, gint format, gint channels,gint frequency, gpointer data){SpiceGstaudio *gstaudio = data;SpiceGstaudioPrivate *p = gstaudio->priv;...if (!p->playback.pipe) {GError *error = NULL;gchar *audio_caps = g_strdup_printf("audio/x-raw,format=\"S16LE\",channels=%d,rate=%d,layout=interleaved", channels, frequency);gchar *pipeline = g_strdup (g_getenv("SPICE_GST_AUDIOSINK"));if (pipeline == NULL)pipeline = g_strdup_printf("appsrc is-live=1 do-timestamp=0 format=time caps=\"%s\" name=\"appsrc\" ! queue ! ""audioconvert ! audioresample ! autoaudiosink name=\"audiosink\"", audio_caps);...}

8、HOME:获取工作主目录

void spice_set_session_option(SpiceSession *session){g_return_if_fail(SPICE_IS_SESSION(session));if (ca_file == NULL) {const char *homedir = g_getenv("HOME");if (!homedir)homedir = g_get_home_dir();ca_file = g_build_filename(homedir, ".spicec", "spice_truststore.pem", NULL);if (!g_file_test(ca_file, G_FILE_TEST_IS_REGULAR))g_clear_pointer(&ca_file, g_free);}...}

9、SPICE_PROXY:设置网络代理

static void update_proxy(SpiceSession *self, const gchar *str){SpiceSessionPrivate *s = self->priv;SpiceURI *proxy = NULL;GError *error = NULL;if (str == NULL)str = g_getenv("SPICE_PROXY");if (str == NULL || *str == 0) {g_clear_object(&s->proxy);return;}proxy = spice_uri_new();if (!spice_uri_parse(proxy, str, &error))g_clear_object(&proxy);if (error) {g_warning("%s", error->message);g_clear_error(&error);}if (proxy != NULL) {g_clear_object(&s->proxy);s->proxy = proxy;}}

10、SPICE_DISABLE_GL_SCANOUT:禁用opengl-es显示   

 /*** SpiceSession:gl-scanout:** Whether to enable gl-scanout (Unix only).  Set to TRUE by* default on EGL-enabled host, unless SPICE_DISABLE_GL_SCANOUT* environment variable is set.** Since: 0.36**/g_object_class_install_property(gobject_class, PROP_GL_SCANOUT,g_param_spec_boolean("gl-scanout","Enable GL scanout support","Enable GL scanout support",#ifdef HAVE_EGLg_getenv("SPICE_DISABLE_GL_SCANOUT") == NULL,G_PARAM_CONSTRUCT |#elsefalse,#endifG_PARAM_READWRITE |G_PARAM_STATIC_STRINGS));

11、G_MESSAGES_DEBUG:打开g_debug()的输出(export G_MESSAGES_DEBUG=all)

static void spice_util_enable_debug_messages(void){const gchar *doms = g_getenv("G_MESSAGES_DEBUG");if (!doms) {g_setenv("G_MESSAGES_DEBUG", G_LOG_DOMAIN, 1);} else if (g_str_equal(doms, "all")) {return;} else if (!strstr(doms, G_LOG_DOMAIN)) {gchar *newdoms = g_strdup_printf("%s %s", doms, G_LOG_DOMAIN);g_setenv("G_MESSAGES_DEBUG", newdoms, 1);g_free(newdoms);}}

12、SPICE_DEBUG:是否开启debug信息

static gpointer getenv_debug(gpointer data){gboolean debug;debug = (g_getenv("SPICE_DEBUG") != NULL);if (debug)spice_util_enable_debug_messages();return GINT_TO_POINTER(debug);}

13、SPICE_KEYPRESS_DELAY:显示通道设置键盘延时的时间

static voidspice_display_set_keypress_delay(SpiceDisplay *display, guint delay){SpiceDisplayPrivate *d = display->priv;const gchar *env = g_getenv("SPICE_KEYPRESS_DELAY");if (env != NULL)delay = strtoul(env, NULL, 10);if (d->keypress_delay != delay) {DISPLAY_DEBUG(display, "keypress-delay is set to %u ms", delay);d->keypress_delay = delay;g_object_notify(G_OBJECT(display), "keypress-delay");}}

14、SPICE_DEBUG_CURSOR:光标通道名称

static GdkCursor* spice_display_get_blank_cursor(SpiceDisplay *display){GdkDisplay *gdk_display;const gchar *cursor_name;GdkWindow *gdk_window = GDK_WINDOW(gtk_widget_get_window(GTK_WIDGET(display)));if (gdk_window == NULL)return NULL;gdk_display = gdk_window_get_display(gdk_window);cursor_name = g_getenv("SPICE_DEBUG_CURSOR") ? "crosshair" : "none";return gdk_cursor_new_from_name(gdk_display, cursor_name);}

15、SPICE_NOGRAB:输入通道不抓取键盘和鼠标

static void try_keyboard_grab(SpiceDisplay *display){GtkWidget *widget = GTK_WIDGET(display);SpiceDisplayPrivate *d = display->priv;GdkGrabStatus status;if (g_getenv("SPICE_NOGRAB"))return;if (d->disable_inputs)return;...}static void try_mouse_grab(SpiceDisplay *display){SpiceDisplayPrivate *d = display->priv;if (g_getenv("SPICE_NOGRAB"))return;if (d->disable_inputs)return;...}

16、DISABLE_GSTVIDEOOVERLAY:禁用视频窗口绑定

static void gst_sync_bus_call(GstBus *bus, GstMessage *msg, SpiceDisplay *display){switch(GST_MESSAGE_TYPE(msg)) {case GST_MESSAGE_ELEMENT: {if (gst_is_video_overlay_prepare_window_handle_message(msg) && !g_getenv("DISABLE_GSTVIDEOOVERLAY") && GDK_IS_X11_DISPLAY(gdk_display_get_default())) {GdkWindow *window = gtk_widget_get_window(GTK_WIDGET(display));if (window && gdk_window_ensure_native(window)) {SpiceDisplayPrivate *d = display->priv;GstVideoOverlay *overlay = GST_VIDEO_OVERLAY(GST_MESSAGE_SRC(msg));g_weak_ref_set(&d->overlay_weak_ref, overlay);gst_video_overlay_handle_events(overlay, false);gst_video_overlay_set_window_handle(overlay, (uintptr_t)GDK_WINDOW_XID(window));return;}}break;}...}/* This callback should pass to the widget a pointer of the pipeline* so that we can the set GST pipeline and overlay related calls from* here.  If the pipeline pointer is NULL, the drawing area of the* native renderer is set visible.*/static gboolean set_overlay(SpiceChannel *channel, void* pipeline_ptr, SpiceDisplay *display){SpiceDisplayPrivate *d = display->priv;if (pipeline_ptr == NULL) {gtk_stack_set_visible_child_name(d->stack, "draw-area");return true;}#if defined(GDK_WINDOWING_X11)/* GstVideoOverlay is currently used only under x */if (!g_getenv("DISABLE_GSTVIDEOOVERLAY") &&GDK_IS_X11_DISPLAY(gdk_display_get_default())) {GdkWindow *window;window = gtk_widget_get_window(GTK_WIDGET(display));if (window && gdk_window_ensure_native(window)) {GstBus *bus;gtk_stack_set_visible_child_name(d->stack, "gst-area");bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline_ptr));gst_bus_enable_sync_message_emission(bus);g_signal_connect(bus, "sync-message", G_CALLBACK(gst_sync_bus_call), display);gst_object_unref(bus);return true;}}#endifreturn false;}

17、SPICE_USB_ACL_BINARY:ACL设备名称

G_GNUC_INTERNALvoid spice_usb_acl_helper_open_acl_async(SpiceUsbAclHelper *self,gint busnum, gint devnum,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data){g_return_if_fail(SPICE_IS_USB_ACL_HELPER(self));SpiceUsbAclHelperPrivate *priv = self->priv;GTask *task;GError *err = NULL;GIOStatus status;GPid helper_pid;gsize bytes_written;const gchar *acl_helper = g_getenv("SPICE_USB_ACL_BINARY");if (acl_helper == NULL)acl_helper = ACL_HELPER_PATH"/spice-client-glib-usb-acl-helper";gchar *argv[] = { (char*)acl_helper, NULL };gint in, out;gchar buf[128];task = g_task_new(self, cancellable, callback, user_data);if (priv->out_ch) {g_task_return_new_error(task,SPICE_CLIENT_ERROR, SPICE_CLIENT_ERROR_FAILED,"Error acl-helper already has an acl open");goto done;}...}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/591356.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

SpringBoot灵活集成多数据源(定制版)

如来说世界,非世界,是名世界 如来说目录,非目录,是名目录 前言前期准备代码实现演示扩展 前言 本篇博客基于SpringBoot整合MyBatis-plus,如果有不懂这个的, 可以查看我的这篇博客:快速CRUD的秘诀…

信息化和数字化的本质区别是什么?

信息化和数字化是两个概念的区别 它们有什么区别和联系呢?信息化:“业务数据化”,先让业务流程能被数据记录下来。信息化“业务数据化”。数字化:“数据业务化”,用已累积的业务数据去反哺优化业务流程。数字化“数据…

C++:继承(这一篇就够了)

C:继承(这一篇就够了) 一、继承的概念及定义1.1 继承的概念1.2 继承定义1.2.1定义格式1.2.2 继承关系和访问限定符1.2.3 继承基类成员访问方式的变化 二、基类和派生类对象赋值转换三、继承中的作用域四、派生类的默认成员函数五、继承与静态…

可穿戴智能设备应用领域以及使用意义分别有哪些?

可穿戴智能设备有哪些? 可穿戴智能设备是指可以佩戴在身上,具有智能功能和交互能力的电子设备。以下是一些常见的可穿戴智能设备: 智能手表:智能手表结合了传统手表的功能和智能设备的特性,可以显示时间、接收通知、监…

基于长短期神经网络lstm的求解方程

目录 背影 摘要 代码和数据下载:基于长短期神经网络lstm的求解方程资源-CSDN文库 https://download.csdn.net/download/abc991835105/87657743 LSTM的基本定义 LSTM实现的步骤 基于长短期神经网络lstm的求解方程 结果分析 展望 参考论文 背影 方程求解,为提高精度,本文用L…

图像分割实战-系列教程6:unet医学细胞分割实战4(医学数据集、图像分割、语义分割、unet网络、代码逐行解读)

🍁🍁🍁图像分割实战-系列教程 总目录 有任何问题欢迎在下面留言 本篇文章的代码运行界面均在Pycharm中进行 本篇文章配套的代码资源已经上传 unet医学细胞分割实战1 unet医学细胞分割实战2 unet医学细胞分割实战3 unet医学细胞分割实战4 unet…

Linux下一切皆文件

个人主页:Lei宝啊 愿所有美好如期而遇 目录 你是否听过Linux下一切皆文件? 在哪里我们体悟到了Linux下一切皆文件? 文件是什么? 在哪里体悟到的? 常见疑惑 怎么办到的Linux下一切皆文件? 我们抛出…

LED显示屏常用驱动芯片一览表

LED显示屏驱动芯片是专门用于驱动LED显示屏的核心芯片,它能够将输入的电信号转化为驱动能力,以控制LED灯的亮度和颜色。LED显示屏驱动芯片具有高可靠性、低功耗、长寿命等优点,是LED显示屏产业的核心零部件之一。 SM16306SJ LED显示屏驱动芯…

《MySQL系列-InnoDB引擎02》InnoDB存储引擎介绍

文章目录 第二章 InnoDB存储引擎1 InnoDB存储引擎概述2 InnoDB存储引擎的版本3 InnoDB体系架构3.1 后台线程3.2 内存 4 Checkpoint技术5 Master Thread 工作方式5.1 InnoDB 1.0.x版本之前的Master Thread5.2 InnoDB 1.2.x版本之前的Master Thread5.3 InnoDB 1.2.x版本的Master …

《知识扫盲》什么是动态库、静态库、共享库?

共享库(Shared Library)、动态库(Dynamic Library)和静态库(Static Library)是三种不同的库文件,它们在编程中有不同的作用和使用方式。 静态库: 静态库是一组预编译的对象文件的集合…

python写入csv文件总是多出一行空行(windows)

问题代码 import csv from os import pathfull_path path.abspath(__file__) path_dir path.dirname(full_path)data [[Name, Age, City],[John, 25, New York],[Alice, 30, Los Angeles],[Bob, 35, Chicago] ] # 代码使用都是正常的,但是总是多出一行空格 with…

Unity游戏资源更新(AB包)

目录 前言: 一、什么是AssetBundle 二、AssetBudle的基本使用 1.AssetBundle打包 2.BuildAssetBundle BuildAssetBundleOptions BuildTarget 示例 3.AssetBundle的加载 LoadFromFile LoadFromMemory LoadFromMemoryAsync UnityWebRequestAsssetBundle 前…

nginx+rsyslog+kafka+clickhouse+grafana 实现nginx 网关监控

需求 我想做一个类似腾讯云网关日志最终以仪表方式呈现,比如说qps、p99、p95的请求响应时间等等 流程图 数据流转就像标题 nginx ----> rsyslog ----> kafka —> clickhouse —> grafana 部署 kafka kafka 相关部署这里不做赘述,只要创…

数据库触发器trigger 的应用

文章目录 1. 什么是触发器(trigger)?2. 触发器的种类2.1 DML 触发器2.2 DDL 触发器2.3 登录触发器 3. 触发器的优点4. 触发器的缺点5. 应用示例5.1 触发器的创建5.2 删除触发器 1. 什么是触发器(trigger)? 在某种操作执行的同时触发另一种操作。它的执…

跨境电商代采是什么?怎么做代采网站?

跨境电商独立站就是跨境电商自行搭建的销售网站,服务器、域名都是自主购买的,并由跨境电商独立运营与营销推广。 近些年来,各类第三方电商平台虽然流量大,但是随着进驻电商数量的增加,流量竞争也愈发激烈,…

关于图片复制出现拒绝访问的问题探讨

最近看到一个个bug一个图片无法实现复制,代码是这样的 package demo.demo18.Test; import java.io.*; public class test1 { public static void main(String[] args) throws IOException { try ( //需求:复制照片 //1.创建一个字节输入流管道与源文件接…

雷达遮挡检测综述

1 概述 雷达(毫米波、激光)的遮挡是实际项目中比较常见的现象,优秀的算法应当能够及时、准确地检测出雷达是否被遮挡,以及遮挡的严重程度,然后将故障信息发送给诊断系统,并在仪表盘上显示,如…

WiFi7: EMLSR操作之一 -- 概述

原文:EMLSR操作能够允许非AP MLD使用一个或以上的link侦听初始控制帧,该控制帧由AP MLD以non-HT(dup)格式发送,并在接下来在同一Link进行帧交换。 非AP MLD在处于EMLSR模式时受EMLSR模式限制。 AP MLD在dot11EHTEMLSROptionActi…

每天刷两道题——第四天

1.1最大子数组和 给一个整数数组 nums ,找出一个具有最大和的连续子数组(子数组最少包含一个元素),返回其最大和。 输入:nums [-2,1,-3,4,-1,2,1,-5,4] 输出:6 解释:连续子数组 [4,-1,2,1] 的…

win系统微软输入法踩坑之输入法

例如:字母间距变宽 或者打字总是繁体等等 字母变宽是因为快捷键误触切换成了全角字符。。 立马打开输入法设置界面进行相关设置(你要解决的输入法问题都可以在这里得到解决):