#include <cerrno>

extern int errno 是通过系统调用设置的,在错误事件中的某些库函数表明了什么发生了错误。

// The -*- C++ -*- forwarding header.

// Copyright (C) 1997-2020 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library.  This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.

// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
// <http://www.gnu.org/licenses/>.

/** @file cerrno
 *  This is a Standard C++ Library file.  You should @c \#include this file
 *  in your programs, rather than any of the @a *.h implementation files.
 *
 *  This is the C++ version of the Standard C Library header @c errno.h,
 *  and its contents are (mostly) the same as that header, but are all
 *  contained in the namespace @c std (except for names which are defined
 *  as macros in C).
 */

//
// ISO C++ 14882: 19.3  Error numbers
//

#pragma GCC system_header

#include <bits/c++config.h>
#include <errno.h>

#ifndef _GLIBCXX_CERRNO
#define _GLIBCXX_CERRNO 1

// Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998
#ifndef errno
#define errno errno
#endif

#endif
  1. EPERM (1): 操作不允许。

  2. ENOENT (2): 文件或目录不存在。

  3. ESRCH (3): 没有找到进程。

  4. EINTR (4): 系统调用被中断。

  5. EIO (5): 输入/输出错误。

  6. ENXIO (6): 没有这样的设备或地址。

  7. E2BIG (7): 参数列表太长。

  8. ENOEXEC (8): 可执行文件格式错误。

  9. EBADF (9): 无效的文件描述符。

  10. ECHILD (10): 没有子进程。

  11. EAGAIN (11): 再试一次(临时性错误)。

  12. ENOMEM (12): 内存不足。

  13. EACCES (13): 权限被拒绝。

  14. EFAULT (14): 坏地址。

  15. ENOTBLK (15): 需要块设备操作。

  16. EBUSY (16): 设备或资源忙。

  17. EEXIST (17): 文件已存在。

  18. EXDEV (18): 跨设备链接。

  19. ENODEV (19): 没有这样的设备。

  20. ENOTDIR (20): 不是一个目录。

  21. EISDIR (21): 是一个目录。

  22. EINVAL (22): 无效的参数。

  23. ENFILE (23): 文件表溢出。

  24. EMFILE (24): 打开的文件太多。

  25. ENOTTY (25): 不是终端或面向终端的操作。

  26. ETXTBSY (26): 文本文件忙。

  27. EFBIG (27): 文件太大,无法打开。

  28. ENOSPC (28): 设备上没有空间。

  29. ESPIPE (29): 非法的查找(seek)操作。

  30. EROFS (30): 只读文件系统。

  31. EMLINK (31): 太多硬链接。

  32. EPIPE (32): 管道被破坏。

#include <stdio.h> #include <chrono> #include <string> #include <iomanip> #include <cstdint> #include <stdint.h> #include <fstream> #include <thread> #include <atomic> #include <dirent.h> #include <sys/stat.h> #include <queue> #include <mutex> #include <condition_variable> #include <sys/types.h> #include <algorithm> // 用于 std::sort #ifndef _WIN32 #include <fcntl.h> #include <unistd.h> #include <sys/ioctl.h> #include <linux/videodev2.h> #include <cerrno> #include <cstring> // for strerror #endif using namespace std::chrono; #include <opencv4/opencv2/opencv.hpp> #include <opencv4/opencv2/cudaimgproc.hpp> // ����������ͷ�ļ� using namespace cv; #include <vector> using namespace std; #include "../FasterStereoCuda/FasterStereoCuda.h" //#include "../FasterStereoCuda/FasterStereoCuda.h" #ifdef _DEBUG #pragma comment(lib,"opencv_world440d.lib") #pragma comment(lib, "FasterStereoCudad.lib") #else //#pragma comment(lib,"opencv_world320.lib") #pragma comment(lib, "FasterStereoCuda.lib") #endif #include "option_manager.h" #include "cuda_runtime_api.h" #include "device_launch_parameters.h" #include <opencv4/opencv2/cudawarping.hpp> extern "C" { #include <libavcodec/avcodec.h> #include <libavformat/avformat.h> #include <libavdevice/avdevice.h> #include <libswscale/swscale.h> #include <libavutil/imgutils.h> } #include "/home/hhm/wolwo/ffmpeg_uvc_20250915/ffmpeg_uvc/Bento4/include/Core/Ap4Types.h" #include "/home/hhm/wolwo/ffmpeg_uvc_20250915/ffmpeg_uvc/Bento4/include/Core/Ap4Results.h" #include "/home/hhm/wolwo/ffmpeg_uvc_20250915/ffmpeg_uvc/Bento4/include/Core/Ap4DataBuffer.h" #include "/home/hhm/wolwo/ffmpeg_uvc_20250915/ffmpeg_uvc/Bento4/include/Codecs/Ap4NalParser.h" #include "/home/hhm/wolwo/ffmpeg_uvc_20250915/ffmpeg_uvc/Bento4/include/Codecs/Ap4BitStream.h" #ifdef _DEBUG #pragma comment(lib, "../ffmpeg_uvc/x64/Release/Bento4.lib") // Debug版本 #else #pragma comment(lib, "../ffmpeg_uvc/x64/Release/Bento4.lib") // Release版本 #endif // 陀螺仪数据类型定义 typedef uint8_t TC_U8; typedef uint32_t TC_U32; typedef uint64_t TC_U64; typedef int32_t TC_S32; typedef bool TC_BOOL; #define TC_TRUE true #define TC_FALSE false #define TC_RET_OK 0 #define TC_RET_ERROR -1 #define TC_RET_OUTOFMEMORY -2 #define MAX_GYRO_DATA_NUM 100 #define UUID_ISO_IEC_OFFSET 16 #define MAX_SEI_PAYLOAD_COUNT 64 #define MAX_SEI_NALU_SIZE 4096 详细注释上述代码
09-24
# 代码详细注释 ```cpp // 标准C/C++头文件 #include <stdio.h> // 标准输入输出 #include <chrono> // 时间相关功能(C++11) #include <string> // 字符串处理 #include <iomanip> // 输入输出格式化 #include <cstdint> // 固定宽度整数类型 #include <stdint.h> // C风格的固定宽度整数类型 #include <fstream> // 文件流操作 #include <thread> // 多线程支持(C++11) #include <atomic> // 原子操作(C++11) #include <dirent.h> // 目录操作 #include <sys/stat.h> // 文件状态信息 #include <queue> // 队列容器 #include <mutex> // 互斥锁(C++11) #include <condition_variable> // 条件变量(C++11) // 系统相关头文件 #include <sys/types.h> // 基本系统数据类型 #include <algorithm> // STL算法 // Windows/Linux平台特定头文件 #ifndef _WIN32 #include <fcntl.h> // 文件控制选项 #include <unistd.h> // POSIX API #include <sys/ioctl.h> // 设备I/O控制 #include <linux/videodev2.h> // 视频设备接口 #include <cerrno> // 错误号定义 #include <cstring> // 字符串操作 #endif // 时间相关命名空间 using namespace std::chrono; // OpenCV头文件 #include <opencv4/opencv2/opencv.hpp> // OpenCV核心功能 #include <opencv4/opencv2/cudaimgproc.hpp> // CUDA图像处理 using namespace cv; // OpenCV命名空间 // STL容器 #include <vector> // 向量容器 using namespace std; // 标准命名空间 // 自定义头文件 #include "../FasterStereoCuda/FasterStereoCuda.h" // 立体视觉CUDA加速库 // Windows平台下的库链接指令 #ifdef _DEBUG #pragma comment(lib,"opencv_world440d.lib") // OpenCV调试库 #pragma comment(lib, "FasterStereoCudad.lib") // 立体视觉调试库 #else #pragma comment(lib, "FasterStereoCuda.lib") // 立体视觉发布库 #endif // 自定义管理器和CUDA相关 #include "option_manager.h" // 选项管理器 #include "cuda_runtime_api.h" // CUDA运行时API #include "device_launch_parameters.h" // CUDA设备启动参数 #include <opencv4/opencv2/cudawarping.hpp> // CUDA图像变形 // FFmpeg相关头文件(使用C语言链接规范) extern "C" { #include <libavcodec/avcodec.h> // 编解码器 #include <libavformat/avformat.h> // 格式处理 #include <libavdevice/avdevice.h> // 设备处理 #include <libswscale/swscale.h> // 图像缩放 #include <libavutil/imgutils.h> // 图像工具 } // Bento4 MP4处理库头文件 #include "/home/hhm/wolwo/ffmpeg_uvc_20250915/ffmpeg_uvc/Bento4/include/Core/Ap4Types.h" #include "/home/hhm/wolwo/ffmpeg_uvc_20250915/ffmpeg_uvc/Bento4/include/Core/Ap4Results.h" #include "/home/hhm/wolwo/ffmpeg_uvc_20250915/ffmpeg_uvc/Bento4/include/Core/Ap4DataBuffer.h" #include "/home/hhm/wolwo/ffmpeg_uvc_20250915/ffmpeg_uvc/Bento4/include/Codecs/Ap4NalParser.h" #include "/home/hhm/wolwo/ffmpeg_uvc_20250915/ffmpeg_uvc/Bento4/include/Codecs/Ap4BitStream.h" // Bento4库链接指令 #ifdef _DEBUG #pragma comment(lib, "../ffmpeg_uvc/x64/Release/Bento4.lib") // Debug版本 #else #pragma comment(lib, "../ffmpeg_uvc/x64/Release/Bento4.lib") // Release版本 #endif // 陀螺仪数据类型定义 typedef uint8_t TC_U8; // 无符号8位整数 typedef uint32_t TC_U32; // 无符号32位整数 typedef uint64_t TC_U64; // 无符号64位整数 typedef int32_t TC_S32; // 有符号32位整数 typedef bool TC_BOOL; // 布尔类型 // 常量定义 #define TC_TRUE true // 真值 #define TC_FALSE false // 假值 #define TC_RET_OK 0 // 成功返回值 #define TC_RET_ERROR -1 // 错误返回值 #define TC_RET_OUTOFMEMORY -2 // 内存不足返回值 #define MAX_GYRO_DATA_NUM 100 // 最大陀螺仪数据数量 #define UUID_ISO_IEC_OFFSET 16 // UUID偏移量 #define MAX_SEI_PAYLOAD_COUNT 64 // 最大SEI负载计数 #define MAX_SEI_NALU_SIZE 4096 // 最大SEI NALU大小 ``` 这段代码主要包含以下功能模块: 1. 基础C++标准库和系统API的头文件引入 2. OpenCV计算机视觉库的引入 3. CUDA加速相关功能的引入 4. FFmpeg多媒体处理库的引入 5. Bento4 MP4处理库的引入 6. 自定义类型和常量的定义
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值