当前位置: 首页 > news >正文

【FFmpeg】AVIOContext结构体

【FFmpeg】AVIOContext结构体

  • 1.AVIOContext结构体的定义

参考:
FFMPEG结构体分析:AVIOContext

示例工程:
【FFmpeg】调用ffmpeg库实现264软编
【FFmpeg】调用ffmpeg库实现264软解
【FFmpeg】调用ffmpeg库进行RTMP推流和拉流
【FFmpeg】调用ffmpeg库进行SDL2解码后渲染

流程分析:
【FFmpeg】编码链路上主要函数的简单分析
【FFmpeg】解码链路上主要函数的简单分析

结构体分析:
【FFmpeg】AVCodec结构体
【FFmpeg】AVCodecContext结构体
【FFmpeg】AVStream结构体
【FFmpeg】AVFormatContext结构体

1.AVIOContext结构体的定义

AVIOContext定义了输入输出上下文之中的信息,涉及到码流的输入输出,是非常重要的结构体,位于libavformat\avio.h中,定义如下

/*** Bytestream IO Context.* New public fields can be added with minor version bumps.* Removal, reordering and changes to existing public fields require* a major version bump.* sizeof(AVIOContext) must not be used outside libav*.** @note None of the function pointers in AVIOContext should be called*       directly, they should only be set by the client application*       when implementing custom I/O. Normally these are set to the*       function pointers specified in avio_alloc_context()*/
// 码流输入输出的上下文
// @note AVIOContext中的所有函数指针都不应该被直接调用,它们只应该由客户端应用程序在实现自定义I/O时设置
// 通常将这些设置为avio_alloc_context()中指定的函数指针
typedef struct AVIOContext {/*** A class for private options.** If this AVIOContext is created by avio_open2(), av_class is set and* passes the options down to protocols.** If this AVIOContext is manually allocated, then av_class may be set by* the caller.** warning -- this field can be NULL, be sure to not pass this AVIOContext* to any av_opt_* functions in that case.*/// 用于私有配置的选项// 如果这个AVIOContext是由avio_open2创建的,设置av_class并将选项向下传递给协议// 如果这个AVIOContext是手动分配的,那么av_class可以由调用者设置// warning: 这个字段可以为NULL,在这种情况下,请确保不要将这个AVIOContext传递给任何av_opt_*函数const AVClass *av_class;/** The following shows the relationship between buffer, buf_ptr,* buf_ptr_max, buf_end, buf_size, and pos, when reading and when writing* (since AVIOContext is used for both):************************************************************************************                                   READING************************************************************************************                            |              buffer_size              |*                            |---------------------------------------|*                            |                                       |**                         buffer          buf_ptr       buf_end*                            +---------------+-----------------------+*                            |/ / / / / / / /|/ / / / / / /|         |*  read buffer:              |/ / consumed / | to be read /|         |*                            |/ / / / / / / /|/ / / / / / /|         |*                            +---------------+-----------------------+**                                                         pos*              +-------------------------------------------+-----------------+*  input file: |                                           |                 |*              +-------------------------------------------+-----------------+*************************************************************************************                                   WRITING************************************************************************************                             |          buffer_size                 |*                             |--------------------------------------|*                             |                                      |**                                                buf_ptr_max*                          buffer                 (buf_ptr)       buf_end*                             +-----------------------+--------------+*                             |/ / / / / / / / / / / /|              |*  write buffer:              | / / to be flushed / / |              |*                             |/ / / / / / / / / / / /|              |*                             +-----------------------+--------------+*                               buf_ptr can be in this*                               due to a backward seek**                            pos*               +-------------+----------------------------------------------+*  output file: |             |                                              |*               +-------------+----------------------------------------------+**/// buffer的起始地址unsigned char *buffer;  /**< Start of the buffer. */// 最大的buffer大小int buffer_size;        /**< Maximum buffer size */// 当前buffer指针指向的位置unsigned char *buf_ptr; /**< Current position in the buffer */// 如果read函数返回的数据少于请求,则数据的结束值可能小于buffer+buffer_size,例如,对于尚未接收到更多数据的流// 当前buffer指针的末尾unsigned char *buf_end; /**< End of the data, may be less thanbuffer+buffer_size if the read function returnedless data than requested, e.g. for streams whereno more data has been received yet. */// 私有指针,传递给read/write/seek/… 函数void *opaque;           /**< A private pointer, passed to the read/write/seek/...functions. */// 读取packetint (*read_packet)(void *opaque, uint8_t *buf, int buf_size);// 写入packetint (*write_packet)(void *opaque, const uint8_t *buf, int buf_size);// 查找int64_t (*seek)(void *opaque, int64_t offset, int whence);// 当前缓冲区在文件中的位置int64_t pos;            /**< position in the file of the current buffer */// 如果由于错误或eof而无法读取,则为Trueint eof_reached;        /**< true if was unable to read due to error or eof */// 错误码int error;              /**< contains the error code or 0 if no error happened */// 如果是写入状态,则置为trueint write_flag;         /**< true if open for writing */// 最大的packet大小int max_packet_size;// 最小的packet大小(在刷新数据之前,尝试至少缓冲这么多的数据)int min_packet_size;    /**< Try to buffer at least this amount of databefore flushing it. */// checksum用于验证数据完整性// 存储了校验值,以验证数据的完整性。通过将数据块的大小累加到checksum,然后对结果进行按位反转来实现的// 这个机制主要用于检测数据传输过程中可能发生的错误,尤其是在网络传输或文件读写中unsigned long checksum;unsigned char *checksum_ptr;unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size);/*** Pause or resume playback for network streaming protocols - e.g. MMS.*/// 暂停或恢复网络流协议的播放int (*read_pause)(void *opaque, int pause);/*** Seek to a given timestamp in stream with the specified stream_index.* Needed for some network streaming protocols which don't support seeking* to byte position.*/// 使用指定的stream_index在流中查找给定的时间戳// 需要一些网络流协议,不支持寻求字节位置int64_t (*read_seek)(void *opaque, int stream_index,int64_t timestamp, int flags);/*** A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.*//*流查找的行为,有两个定义* Seeking works like for a local file.#define AVIO_SEEKABLE_NORMAL (1 << 0)* Seeking by timestamp with avio_seek_time() is possible.#define AVIO_SEEKABLE_TIME   (1 << 1)*/int seekable;/*** avio_read and avio_write should if possible be satisfied directly* instead of going through a buffer, and avio_seek will always* call the underlying seek function directly.*/// 如果可能的话,应该直接满足Avio_read和avio_write,而不是通过缓冲区,avio_seek将始终直接调用底层的seek函数int direct;/*** ',' separated list of allowed protocols.*/// 协议的白名单const char *protocol_whitelist;/*** ',' separated list of disallowed protocols.*/// 协议的黑名单const char *protocol_blacklist;/*** A callback that is used instead of write_packet.*/// 一个用来代替write_packet的回调int (*write_data_type)(void *opaque, const uint8_t *buf, int buf_size,enum AVIODataMarkerType type, int64_t time);/*** If set, don't call write_data_type separately for AVIO_DATA_MARKER_BOUNDARY_POINT,* but ignore them and treat them as AVIO_DATA_MARKER_UNKNOWN (to avoid needlessly* small chunks of data returned from the callback).*/// 如果设置了,不要为AVIO_DATA_MARKER_BOUNDARY_POINT单独调用write_data_type,// 而是忽略它们并将它们视为AVIO_DATA_MARKER_UNKNOWN(以避免从回调返回不必要的小块数据)int ignore_boundary_point;/*** Maximum reached position before a backward seek in the write buffer,* used keeping track of already written data for a later flush.*/// 写缓冲区中向后寻道之前达到的最大位置,用于跟踪已写入的数据,以便以后刷新unsigned char *buf_ptr_max;/*** Read-only statistic of bytes read for this AVIOContext.*/// 只读统计为该AVIOContext读取的字节数int64_t bytes_read;/*** Read-only statistic of bytes written for this AVIOContext.*/// 只读统计写入该AVIOContext的字节数。int64_t bytes_written;
} AVIOContext;

AVIOContext当中比较重要的信息包括:
(1)unsigned char *buffer:buffer的起始地址
(2)int buffer_size:buffer的大小
(3)unsigned char *buf_ptr:buffer当前的指针
(4)unsigned char *buf_end:buffer末尾的地址
(5)void *opaque:URLContext
(6)int (*read_packet)(void *opaque, uint8_t *buf, int buf_size):读取packet
(7)int (*write_packet)(void *opaque, const uint8_t *buf, int buf_size):写入packet
(8)int64_t (*seek)(void *opaque, int64_t offset, int whence):定位查找
(9)unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size):更新校验信息checksum
(10)int (*read_pause)(void *opaque, int pause):暂停流的读取
(11)const char *protocol_XXXlist:协议的黑白名单

相对比于雷博记录的内容,新版本的AVIOContext增加的比较重要的是协议的黑白名单,白名单当中的protocol表示可用,黑名单当中的protocol表示不可用。在解码的时候,buffer会存储FFmpeg读取的数据,例如解码已经编码好的.h264文件。

URLContext的定义如下,位于libavformat\url.h中

typedef struct URLContext {const AVClass *av_class;    /**< information for av_log(). Set by url_open(). */const struct URLProtocol *prot;void *priv_data;char *filename;             /**< specified URL */int flags;int max_packet_size;        /**< if non zero, the stream is packetized with this max packet size */int is_streamed;            /**< true if streamed (no seek possible), default = false */int is_connected;AVIOInterruptCB interrupt_callback;int64_t rw_timeout;         /**< maximum time to wait for (network) read/write operation completion, in mcs */const char *protocol_whitelist;const char *protocol_blacklist;int min_packet_size;        /**< if non zero, the stream is packetized with this min packet size */
} URLContext;

相对于老版本的FFmpeg,这里一个比较大的改变是增加了protocol的黑白名单。URLProtocol的定义如下,同样位于libavformat\url.h中

typedef struct URLProtocol {const char *name;int     (*url_open)( URLContext *h, const char *url, int flags);/*** This callback is to be used by protocols which open further nested* protocols. options are then to be passed to ffurl_open_whitelist()* or ffurl_connect() for those nested protocols.*/// 此回调将由打开进一步嵌套协议的协议使用。然后将这些嵌套协议的选项传递给ffurl_open_whitelist()或ffurl_connect()int     (*url_open2)(URLContext *h, const char *url, int flags, AVDictionary **options);int     (*url_accept)(URLContext *s, URLContext **c);int     (*url_handshake)(URLContext *c);/*** Read data from the protocol.* If data is immediately available (even less than size), EOF is* reached or an error occurs (including EINTR), return immediately.* Otherwise:* In non-blocking mode, return AVERROR(EAGAIN) immediately.* In blocking mode, wait for data/EOF/error with a short timeout (0.1s),* and return AVERROR(EAGAIN) on timeout.* Checking interrupt_callback, looping on EINTR and EAGAIN and until* enough data has been read is left to the calling function; see* retry_transfer_wrapper in avio.c.*/// 从protocol读取数据// 如果数据立即可用(甚至小于大小),达到EOF或发生错误(包括EINTR),则立即返回// 在非阻塞模式下,立即返回AVERROR(EAGAIN)。在阻塞模式下,等待数据/EOF/错误有一个短超时(0.1s),并在超时时返回AVERROR(EAGAIN)// 检查interrupt_callback,在EINTR和EAGAIN上循环,直到有足够的数据被读取给调用函数;参见avio.c中的retry_transfer_wrapperint     (*url_read)( URLContext *h, unsigned char *buf, int size);int     (*url_write)(URLContext *h, const unsigned char *buf, int size);int64_t (*url_seek)( URLContext *h, int64_t pos, int whence);int     (*url_close)(URLContext *h);int (*url_read_pause)(void *urlcontext, int pause);int64_t (*url_read_seek)(void *urlcontext, int stream_index,int64_t timestamp, int flags);int (*url_get_file_handle)(URLContext *h);int (*url_get_multi_file_handle)(URLContext *h, int **handles,int *numhandles);int (*url_get_short_seek)(URLContext *h);int (*url_shutdown)(URLContext *h, int flags);const AVClass *priv_data_class;int priv_data_size;int flags;// 相对比于老版本的FFmpeg,这里还增加了dir的操作int (*url_check)(URLContext *h, int mask);int (*url_open_dir)(URLContext *h);int (*url_read_dir)(URLContext *h, AVIODirEntry **next);int (*url_close_dir)(URLContext *h);int (*url_delete)(URLContext *h);int (*url_move)(URLContext *h_src, URLContext *h_dst);const char *default_whitelist;
} URLProtocol;

在实际的结构体定义如下所示,定义是file的protocol,其中还定义了白名单为"file,crypto,data"

const URLProtocol ff_file_protocol = {.name                = "file",.url_open            = file_open,.url_read            = file_read,.url_write           = file_write,.url_seek            = file_seek,.url_close           = file_close,.url_get_file_handle = file_get_handle,.url_check           = file_check,.url_delete          = file_delete,.url_move            = file_move,.priv_data_size      = sizeof(FileContext),.priv_data_class     = &file_class,.url_open_dir        = file_open_dir,.url_read_dir        = file_read_dir,.url_close_dir       = file_close_dir,.default_whitelist   = "file,crypto,data"
};

又比如tcp的protocol,不过这里没有定义默认的白名单

const URLProtocol ff_tcp_protocol = {.name                = "tcp",.url_open            = tcp_open,.url_accept          = tcp_accept,.url_read            = tcp_read,.url_write           = tcp_write,.url_close           = tcp_close,.url_get_file_handle = tcp_get_file_handle,.url_get_short_seek  = tcp_get_window_size,.url_shutdown        = tcp_shutdown,.priv_data_size      = sizeof(TCPContext),.flags               = URL_PROTOCOL_FLAG_NETWORK,.priv_data_class     = &tcp_class,
};

CSDN : https://blog.csdn.net/weixin_42877471
Github : https://github.com/DoFulangChen

相关文章:

【FFmpeg】AVIOContext结构体

【FFmpeg】AVIOContext结构体 1.AVIOContext结构体的定义 参考&#xff1a; FFMPEG结构体分析&#xff1a;AVIOContext 示例工程&#xff1a; 【FFmpeg】调用ffmpeg库实现264软编 【FFmpeg】调用ffmpeg库实现264软解 【FFmpeg】调用ffmpeg库进行RTMP推流和拉流 【FFmpeg】调用…...

Python控制结构

文章目录 控制结构1. 条件语句1.1 if语句1.2 elif语句1.3 else 语句 2. 循环语句2.1 for循环2.2 while循环 控制循环的语句3.1 break语句3.2 continue语句3.3 else语句与循环配合 控制结构 Python中的控制结构是指管理代码执行流程的语句和机制&#xff0c;包括条件语句、循环…...

OpenCV--图形轮廓

图形轮廓 图像轮廓查找轮廓绘制轮廓计算轮廓的面积和周长多边形逼近与凸包外接矩形 图像轮廓 import cv2 import numpy as np""" 图形轮廓--具有相同颜色或灰度的连续点的曲线 用于图形分析和物体的识别和检测 注意&#xff1a;为了检测的准确性&#xff0c;必…...

MYSQL通过EXPLAIN关键字来分析SQL查询的执行计划,判断是否命中了索引

在MySQL中&#xff0c;你可以通过EXPLAIN关键字来分析SQL查询的执行计划&#xff0c;从而判断是否命中了索引。 准备查询语句&#xff1a; 首先&#xff0c;你需要一个带有WHERE子句的SELECT查询&#xff0c;因为WHERE子句中的条件通常与索引相关联。例如&#xff1a; SELECT …...

clean code-代码整洁之道 阅读笔记(第十二章)

第十二章 系统 12.1 通过选进设计达到整洁目的 Kent Beck关于简单设计的四条规则&#xff0c;对于创建具有良好设计的软件有着莫大的帮助。 据Kent所述&#xff0c;只要遵循以下规则&#xff0c;设计就能变得"简单"&#xff1a;运行所有测试&#xff1b;不可重复&…...

FFmpeg YUV编码为H264

使用FFmpeg库把YUV420P文件编码为H264文件&#xff0c;FFmpeg版本为4.4.2-0。 需要yuv测试文件的&#xff0c;可以从我上传的MP4文件中用ffmpeg提取&#xff0c;命令如下&#xff1a; ffmpeg -i <input.mp4> -pix_fmt yuv420p <output.yuv> 代码如下&#xff1a;…...

【C语言】顺序表(上卷)

什么是数据结构&#xff1f; 数据结构是由“数据”和“结构”两词组合而来的。 数据需要管理。数据结构就是计算机存储、组织数据的方式。比如一个班级就是一个结构&#xff0c;管理的就是班级里的学生。如果我们要找三年2班的同学李华&#xff0c;就可以直接去三年2班找而不…...

Luma AI如何注册:文生视频领域的新星

文章目录 Luma AI如何注册&#xff1a;文生视频领域的新星一、Luma 注册方式二、Luma 的效果三、Luma 的优势四、Luma 的功能总结 Luma AI如何注册&#xff1a;文生视频领域的新星 近年来&#xff0c;Luma AI 凭借其在文生视频领域的创新技术&#xff0c;逐渐成为行业的新星。…...

一站式实时数仓Hologres整体能力介绍

讲师&#xff1a;阿里云Hologres PD丁烨 一、产品定位 随着技术的进步&#xff0c;大数据正从规模化转向实时化处理。用户对传统的T1分析已不满足&#xff0c;期望获得更高时效性的计算和分析能力。例如实时大屏&#xff0c;城市大脑的交通监控、风控和实时的个性化推荐&…...

如何在 Windows 上安装 Docker Desktop

如何在 Windows 上安装 Docker Desktop Docker 是一个开放平台&#xff0c;用于开发、部署和运行应用程序。Docker Desktop 是 Docker 在 Windows 和 macOS 上的官方客户端&#xff0c;它使得开发者能够轻松地在本地环境中构建、运行和共享容器化应用程序。本文将详细介绍如何…...

WPF由文本框输入的内容动态渲染下拉框

在做项目过程中&#xff0c;需要扫码枪扫描快递单号或者手动输入快递单号时&#xff0c;自动检索该单号是哪个快递公司的&#xff0c;下拉框中自动带出该单号的快递公司。当输入的快递单号不存在时&#xff0c;将数据库中所有快递公司都带出 效果&#xff1a; 通过输入的快递单…...

RPCMon:一款基于ETW的RPC监控工具

关于RPCMon RPCMon是一款基于事件跟踪的WindowsRPC监控工具&#xff0c;该工具是一款GUI工具&#xff0c;可以帮助广大研究人员通过ETW&#xff08;Event Tracing for Windows&#xff09;扫描RPC通信。 RPCMon能够为广大研究人员提供进程之间RPC通信的高级视图&#xff0c;该…...

【odoo】常用的字符转义:“>“,“<“,““,“/“等

概要 字符转义是指在编写代码或处理文本数据时&#xff0c;将特殊字符转换为另一种形式&#xff0c;以便在特定的上下文中正确解析和处理这些字符。 内容 特殊字符描述XML转义表示法&和符号&amp;<小于符号<>大于符号>"双引号&quot;单引号&ap…...

李宏毅深度学习项目——HW1个人笔记

视频链接 PDF链接 googleColab链接 GoogleColab是一个免费的jupyter notebook&#xff0c;可以用上面的gpu资源进行训练 题目 通过前两天的数据&#xff0c;预测第三天某个人感染新冠的概率 范例 导包 # Numerical Operations import math import numpy as np# Reading/Wr…...

3D Gaussian Splatting Windows安装

0.安装C++ 编译器 https://aka.ms/vs/17/release/vs_buildtools.exe 1.下载源码 git clone https://github.com/graphdeco-inria/gaussian-splatting --recursive 2.安装cuda NVIDIA GPU Computing Toolkit CUDA Toolkit Archive | NVIDIA Developer 3.安装COLMAP...

人脸识别——可解释的人脸识别(XFR)人脸识别模型是根据什么来识别个人的

可解释性人脸识别&#xff08;XFR&#xff09;&#xff1f; 人脸识别有一个任务叫1:N&#xff08;识别&#xff09;。这个任务将一个人的照片与N张注册照片进行比较&#xff0c;找出相似度最高的人。 这项任务用于刑事调查和出入境点。在犯罪调查中&#xff0c;任务从监控摄像…...

仓库管理系统的设计

管理员账户功能包括&#xff1a;系统首页&#xff0c;个人中心&#xff0c;管理员管理&#xff0c;公告管理&#xff0c;物资管理&#xff0c;基础数据管理&#xff0c;用户管理 用户账户功能包括&#xff1a;系统首页&#xff0c;个人中心&#xff0c;公告管理&#xff0c;物…...

最火AI角色扮演流量已达谷歌搜索20%!每秒处理2万推理请求,Transformer作者公开优化秘诀

卡奥斯智能交互引擎是卡奥斯基于海尔近40年工业生产经验积累和卡奥斯7年工业互联网平台建设的最佳实践&#xff0c;基于大语言模型和RAG技术&#xff0c;集合海量工业领域生态资源方优质产品和知识服务&#xff0c;旨在通过智能搜索、连续交互&#xff0c;实时生成个性化的内容…...

MySQL:MySQL分组排序函数rank()、row_number()、dense_rank()与partition by结合使用

一、前言 在 MySQL 中&#xff0c;虽然标准的 SQL 函数 RANK(), ROW_NUMBER(), 和 DENSE_RANK() 是 SQL 标准的一部分&#xff0c;但早期的 MySQL 版本并不直接支持这些窗口函数。然而&#xff0c;从 MySQL 8.0 开始&#xff0c;这些函数被引入以支持窗口函数&#xff08;也称为…...

opencv c++ 检测图像尺寸大小,标注轮廓

1. 项目背景 本项目旨在开发一个图像处理程序&#xff0c;通过使用计算机视觉技术&#xff0c;能够自动检测图像中物体的尺寸并进行分类。项目利用了开源的计算机视觉库 OpenCV&#xff0c;实现了图像的灰度处理、二值化、轮廓检测、边界框绘制以及尺寸分类等功能。通过这些功…...

应用升级/灾备测试时使用guarantee 闪回点迅速回退

1.场景 应用要升级,当升级失败时,数据库回退到升级前. 要测试系统,测试完成后,数据库要回退到测试前。 相对于RMAN恢复需要很长时间&#xff0c; 数据库闪回只需要几分钟。 2.技术实现 数据库设置 2个db_recovery参数 创建guarantee闪回点&#xff0c;不需要开启数据库闪回。…...

Qt/C++开发监控GB28181系统/取流协议/同时支持udp/tcp被动/tcp主动

一、前言说明 在2011版本的gb28181协议中&#xff0c;拉取视频流只要求udp方式&#xff0c;从2016开始要求新增支持tcp被动和tcp主动两种方式&#xff0c;udp理论上会丢包的&#xff0c;所以实际使用过程可能会出现画面花屏的情况&#xff0c;而tcp肯定不丢包&#xff0c;起码…...

遍历 Map 类型集合的方法汇总

1 方法一 先用方法 keySet() 获取集合中的所有键。再通过 gey(key) 方法用对应键获取值 import java.util.HashMap; import java.util.Set;public class Test {public static void main(String[] args) {HashMap hashMap new HashMap();hashMap.put("语文",99);has…...

2025 后端自学UNIAPP【项目实战:旅游项目】6、我的收藏页面

代码框架视图 1、先添加一个获取收藏景点的列表请求 【在文件my_api.js文件中添加】 // 引入公共的请求封装 import http from ./my_http.js// 登录接口&#xff08;适配服务端返回 Token&#xff09; export const login async (code, avatar) > {const res await http…...

网络编程(UDP编程)

思维导图 UDP基础编程&#xff08;单播&#xff09; 1.流程图 服务器&#xff1a;短信的接收方 创建套接字 (socket)-----------------------------------------》有手机指定网络信息-----------------------------------------------》有号码绑定套接字 (bind)--------------…...

Maven 概述、安装、配置、仓库、私服详解

目录 1、Maven 概述 1.1 Maven 的定义 1.2 Maven 解决的问题 1.3 Maven 的核心特性与优势 2、Maven 安装 2.1 下载 Maven 2.2 安装配置 Maven 2.3 测试安装 2.4 修改 Maven 本地仓库的默认路径 3、Maven 配置 3.1 配置本地仓库 3.2 配置 JDK 3.3 IDEA 配置本地 Ma…...

解读《网络安全法》最新修订,把握网络安全新趋势

《网络安全法》自2017年施行以来&#xff0c;在维护网络空间安全方面发挥了重要作用。但随着网络环境的日益复杂&#xff0c;网络攻击、数据泄露等事件频发&#xff0c;现行法律已难以完全适应新的风险挑战。 2025年3月28日&#xff0c;国家网信办会同相关部门起草了《网络安全…...

Golang——9、反射和文件操作

反射和文件操作 1、反射1.1、reflect.TypeOf()获取任意值的类型对象1.2、reflect.ValueOf()1.3、结构体反射 2、文件操作2.1、os.Open()打开文件2.2、方式一&#xff1a;使用Read()读取文件2.3、方式二&#xff1a;bufio读取文件2.4、方式三&#xff1a;os.ReadFile读取2.5、写…...

苹果AI眼镜:从“工具”到“社交姿态”的范式革命——重新定义AI交互入口的未来机会

在2025年的AI硬件浪潮中,苹果AI眼镜(Apple Glasses)正在引发一场关于“人机交互形态”的深度思考。它并非简单地替代AirPods或Apple Watch,而是开辟了一个全新的、日常可接受的AI入口。其核心价值不在于功能的堆叠,而在于如何通过形态设计打破社交壁垒,成为用户“全天佩戴…...

通过 Ansible 在 Windows 2022 上安装 IIS Web 服务器

拓扑结构 这是一个用于通过 Ansible 部署 IIS Web 服务器的实验室拓扑。 前提条件&#xff1a; 在被管理的节点上安装WinRm 准备一张自签名的证书 开放防火墙入站tcp 5985 5986端口 准备自签名证书 PS C:\Users\azureuser> $cert New-SelfSignedCertificate -DnsName &…...